diff options
Diffstat (limited to 'Lib/zipfile.py')
-rw-r--r-- | Lib/zipfile.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/zipfile.py b/Lib/zipfile.py index 0eed4ce..d99c0d7 100644 --- a/Lib/zipfile.py +++ b/Lib/zipfile.py @@ -2334,6 +2334,8 @@ class Path: if args or kwargs: raise ValueError("encoding args invalid for binary operation") return stream + else: + kwargs["encoding"] = io.text_encoding(kwargs.get("encoding")) return io.TextIOWrapper(stream, *args, **kwargs) @property @@ -2345,6 +2347,7 @@ class Path: return pathlib.Path(self.root.filename).joinpath(self.at) def read_text(self, *args, **kwargs): + kwargs["encoding"] = io.text_encoding(kwargs.get("encoding")) with self.open('r', *args, **kwargs) as strm: return strm.read() |