summaryrefslogtreecommitdiffstats
path: root/Doc/library/fileinput.rst
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 /Doc/library/fileinput.rst
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 'Doc/library/fileinput.rst')
-rw-r--r--Doc/library/fileinput.rst10
1 files changed, 7 insertions, 3 deletions
diff --git a/Doc/library/fileinput.rst b/Doc/library/fileinput.rst
index 3433682..8efe8e3 100644
--- a/Doc/library/fileinput.rst
+++ b/Doc/library/fileinput.rst
@@ -193,10 +193,14 @@ The two following opening hooks are provided by this module:
Usage example: ``fi = fileinput.FileInput(openhook=fileinput.hook_compressed)``
-.. function:: hook_encoded(encoding)
+.. function:: hook_encoded(encoding, errors=None)
Returns a hook which opens each file with :func:`open`, using the given
- *encoding* to read the file.
+ *encoding* and *errors* to read the file.
Usage example: ``fi =
- fileinput.FileInput(openhook=fileinput.hook_encoded("iso-8859-1"))``
+ fileinput.FileInput(openhook=fileinput.hook_encoded("utf-8",
+ "surrogateescape"))``
+
+ .. versionchanged:: 3.6
+ Added the optional *errors* parameter.