Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 2679646

Browse files
[BUG FIX] Part for RemoteOps changes...
1 parent 28c91c2 commit 2679646

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

testgres/operations/remote_ops.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import platform
44
import subprocess
55
import tempfile
6+
import io
67

78
# we support both pg8000 and psycopg2
89
try:
@@ -341,7 +342,9 @@ def _read__text_with_encoding(self, filename, encoding):
341342
assert type(encoding) == str # noqa: E721
342343
content = self._read__binary(filename)
343344
assert type(content) == bytes # noqa: E721
344-
content_s = content.decode(encoding)
345+
buf0 = io.BytesIO(content)
346+
buf1 = io.TextIOWrapper(buf0, encoding=encoding)
347+
content_s = buf1.read()
345348
assert type(content_s) == str # noqa: E721
346349
return content_s
347350

0 commit comments

Comments
 (0)