Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

RemoteOperations::exec_command explicitly transfers LANG, LANGUAGE and LC_* envvars to the server side#187

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
Changes from1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
PrevPrevious commit
NextNext commit
Static methods are marked with@staticmethod [thanks to Victoria Shep…
…ard]The following methods of RemoteOperations were corrected: - _make_exec_env_list - _does_put_envvar_into_exec_cmd - _quote_envvar
  • Loading branch information
@dmitry-lipetsk
dmitry-lipetsk committedFeb 21, 2025
commitee78bcd2fc7002a1c3b5936425b3709c49d136aa
3 changes: 3 additions & 0 deletionstestgres/operations/remote_ops.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -515,6 +515,7 @@ def db_connect(self, dbname, user, password=None, host="localhost", port=5432):
)
return conn

@staticmethod
def _make_exec_env_list() -> list[str]:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

тут нужно self, либо добавить@staticmethod

Copy link
CollaboratorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

self тут не нужен. Это статический метод.

Хорошо, я добавлю этот декоратор.

Я там в других местах тоже статические методы определял...

Тогда я пока только в новом коде этого PR его добавлю, а потом, отдельным коммитом, добавим его во все остальные случаи.

PS. Я этот питон на ходу изучаю, поэтому многие вещи использую неправильно ))))

result = list[str]()
for envvar in os.environ.items():
Expand All@@ -529,6 +530,7 @@ def _make_exec_env_list() -> list[str]:

sm_envs_for_exec_cmd = ["LANG", "LANGUAGE"]

@staticmethod
def _does_put_envvar_into_exec_cmd(name: str) -> bool:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

тут нужно self, либо добавить@staticmethod

assert type(name) == str # noqa: E721
name = name.upper()
Expand All@@ -538,6 +540,7 @@ def _does_put_envvar_into_exec_cmd(name: str) -> bool:
return True
return False

@staticmethod
def _quote_envvar(value) -> str:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

тут нужно self, либо добавить@staticmethod

assert type(value) == str # noqa: E721
result = "\""
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp