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 is updated (read_binary, get_file_size)#170

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 fromall commits
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
13 changes: 2 additions & 11 deletionstestgres/operations/remote_ops.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -347,7 +347,7 @@ def read_binary(self, filename, start_pos):
assert type(start_pos) == int # noqa: E721
assert start_pos >= 0

cmd = "tail -c+{} {}".format(start_pos + 1, __class__._escape_path(filename))
cmd =["tail", "-c", "+{}".format(start_pos + 1),filename]
r = self.exec_command(cmd)
assert type(r) == bytes # noqa: E721
return r
Expand All@@ -367,7 +367,7 @@ def get_file_size(self, filename):

assert filename is not None
assert type(filename) == str # noqa: E721
cmd = "du -b " + __class__._escape_path(filename)
cmd =["du", "-b",filename]

s = self.exec_command(cmd, encoding=get_default_encoding())
assert type(s) == str # noqa: E721
Expand DownExpand Up@@ -462,15 +462,6 @@ def db_connect(self, dbname, user, password=None, host="localhost", port=5432):
)
return conn

def _escape_path(path):
assert type(path) == str # noqa: E721
assert path != "" # Ok?

r = "'"
r += path
r += "'"
return r


def normalize_error(error):
if isinstance(error, bytes):
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp