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

Lines changed: 4 additions & 1 deletion
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy