aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrobot-piglet <robot-piglet@yandex-team.com>2024-06-06 06:56:20 +0300
committerrobot-piglet <robot-piglet@yandex-team.com>2024-06-06 07:06:13 +0300
commitf44820822073337ca895dee0ce177e5cf40260df (patch)
tree488bb2442f0d7f8cbfeaf6f0c9afe268135e8f99
parentf461772a29a6d4d1c1b4890a3c8c9e0384b72769 (diff)
downloadydb-f44820822073337ca895dee0ce177e5cf40260df.tar.gz
Intermediate changes
-rw-r--r--library/python/fs/__init__.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/library/python/fs/__init__.py b/library/python/fs/__init__.py
index 86391afbe9..6b6a011e7f 100644
--- a/library/python/fs/__init__.py
+++ b/library/python/fs/__init__.py
@@ -290,7 +290,10 @@ def copy_tree(src, dst, copy_function=shutil.copy2):
# Throws OSError
@errorfix_win
def read_file(path, binary=True):
- with open(path, 'r' + ('b' if binary else '')) as f:
+ kwargs = {}
+ if not binary and six.PY3:
+ kwargs['encoding'] = sys.getfilesystemencoding()
+ with open(path, 'r' + ('b' if binary else ''), **kwargs) as f:
return f.read()