mirror of
https://github.com/python/cpython.git
synced 2025-11-02 14:41:33 +00:00
gh-101961 fileinput.hookcompressed should not set the encoding value for the binary mode (gh-102068)
This commit is contained in:
parent
022b44f254
commit
6f25657b83
4 changed files with 32 additions and 12 deletions
|
|
@ -399,7 +399,7 @@ def isstdin(self):
|
|||
|
||||
|
||||
def hook_compressed(filename, mode, *, encoding=None, errors=None):
|
||||
if encoding is None: # EncodingWarning is emitted in FileInput() already.
|
||||
if encoding is None and "b" not in mode: # EncodingWarning is emitted in FileInput() already.
|
||||
encoding = "locale"
|
||||
ext = os.path.splitext(filename)[1]
|
||||
if ext == '.gz':
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue