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

OsOps::read methods were corrected (text mode)#171

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
[BUG FIX] xxxOperations::_read__text_with_encoding opens a file as text
LocalOps uses "open(filename, mode='r', encoding=encoding)"RemoteOps uses "io.TextIOWrapper(io.BytesIO(binaryData), encoding=encoding)"It solves a problem on Windows.
  • Loading branch information
@dmitry-lipetsk
dmitry-lipetsk committedDec 25, 2024
commit28c91c2e2670f74bae5beaa18a6f3a30f0f0dfa6
9 changes: 4 additions & 5 deletionstestgres/operations/local_ops.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -286,11 +286,10 @@ def read(self, filename, encoding=None, binary=False):
def _read__text_with_encoding(self, filename, encoding):
assert type(filename) == str # noqa: E721
assert type(encoding) == str # noqa: E721
content = self._read__binary(filename)
assert type(content) == bytes # noqa: E721
content_s = content.decode(encoding)
assert type(content_s) == str # noqa: E721
return content_s
with open(filename, mode='r', encoding=encoding) as file: # open in a text mode
content = file.read()
assert type(content) == str # noqa: E721
return content

def _read__binary(self, filename):
assert type(filename) == str # noqa: E721
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp