Skip to content

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from 1 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
Prev Previous commit
Next Next commit
[BUG FIX] Part for RemoteOps changes...
  • Loading branch information
dmitry-lipetsk committed Dec 25, 2024
commit 2679646fd6f12038887db3d123fc6bdc8d7fb6b8
5 changes: 4 additions & 1 deletion testgres/operations/remote_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import platform
import subprocess
import tempfile
import io

# we support both pg8000 and psycopg2
try:
Expand Down Expand Up @@ -341,7 +342,9 @@ def _read__text_with_encoding(self, filename, encoding):
assert type(encoding) == str # noqa: E721
content = self._read__binary(filename)
assert type(content) == bytes # noqa: E721
content_s = content.decode(encoding)
buf0 = io.BytesIO(content)
buf1 = io.TextIOWrapper(buf0, encoding=encoding)
content_s = buf1.read()
assert type(content_s) == str # noqa: E721
return content_s

Expand Down