Skip to content
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

gh-101144: Allow open and read_text encoding to be positional. #101145

Merged
Merged
5 changes: 2 additions & 3 deletions Lib/zipfile/_path.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,9 +281,8 @@ def stem(self):
def filename(self):
return pathlib.Path(self.root.filename).joinpath(self.at)

def read_text(self, encoding=None, *args, **kwargs):
encoding = io.text_encoding(encoding)
with self.open('r', *args, encoding=encoding, **kwargs) as strm:
def read_text(self, *args, **kwargs):
with self.open('r', *args, **kwargs) as strm:
gpshead marked this conversation as resolved.
Show resolved Hide resolved
return strm.read()

def read_bytes(self):
Expand Down