mirror of
https://github.com/python/cpython.git
synced 2025-12-15 21:44:50 +00:00
Issue #25788: fileinput.hook_encoded() now supports an "errors" argument
for passing to open. Original patch by Joseph Hackman.
This commit is contained in:
parent
258a5d4dcb
commit
b275210a3b
6 changed files with 40 additions and 6 deletions
|
|
@ -400,9 +400,9 @@ def hook_compressed(filename, mode):
|
|||
return open(filename, mode)
|
||||
|
||||
|
||||
def hook_encoded(encoding):
|
||||
def hook_encoded(encoding, errors=None):
|
||||
def openhook(filename, mode):
|
||||
return open(filename, mode, encoding=encoding)
|
||||
return open(filename, mode, encoding=encoding, errors=errors)
|
||||
return openhook
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue