summaryrefslogtreecommitdiffstats
path: root/Lib/fileinput.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2016-04-27 20:13:46 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2016-04-27 20:13:46 (GMT)
commitb275210a3b0e04691ebd1c1d0374720be59911b9 (patch)
treede432dfc32f21bd012351ae1f92758fbe6332d6b /Lib/fileinput.py
parent258a5d4dcb0fbf787c5e7e78b30e200534753413 (diff)
downloadcpython-b275210a3b0e04691ebd1c1d0374720be59911b9.zip
cpython-b275210a3b0e04691ebd1c1d0374720be59911b9.tar.gz
cpython-b275210a3b0e04691ebd1c1d0374720be59911b9.tar.bz2
Issue #25788: fileinput.hook_encoded() now supports an "errors" argument
for passing to open. Original patch by Joseph Hackman.
Diffstat (limited to 'Lib/fileinput.py')
-rw-r--r--Lib/fileinput.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/fileinput.py b/Lib/fileinput.py
index 1e19d24..721fe9c 100644
--- a/Lib/fileinput.py
+++ b/Lib/fileinput.py
@@ -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