[Python-checkins] bpo-37014: Update docstring and Documentation of fileinput.FileInput(). (GH-13545) (GH-13753)
Ezio Melotti
webhook-mailer at python.org
Sun Jun 2 17:36:38 EDT 2019
https://github.com/python/cpython/commit/6bd438e137a0618b8db949a4751304f541b6674d
commit: 6bd438e137a0618b8db949a4751304f541b6674d
branch: 3.7
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: Ezio Melotti <ezio.melotti at gmail.com>
date: 2019-06-02T23:36:34+02:00
summary:
bpo-37014: Update docstring and Documentation of fileinput.FileInput(). (GH-13545) (GH-13753)
* bpo-37014: Update docstring and Documentation of fileinput.FileInput()
* Explain the behavior of fileinput.FileInput() when reading stdin.
* Update blurb.
* bpo-37014: Fix typo in the docstring and documentation.
(cherry picked from commit aca273e2401ca3151e15e984f400233b7f255e15)
Co-authored-by: Michele Angrisano <michele.angrisano at gmail.com>
files:
M Doc/library/fileinput.rst
M Lib/fileinput.py
M Misc/ACKS
diff --git a/Doc/library/fileinput.rst b/Doc/library/fileinput.rst
index 1fc11ffce25e..bf81749f9456 100644
--- a/Doc/library/fileinput.rst
+++ b/Doc/library/fileinput.rst
@@ -23,8 +23,9 @@ The typical use is::
This iterates over the lines of all files listed in ``sys.argv[1:]``, defaulting
to ``sys.stdin`` if the list is empty. If a filename is ``'-'``, it is also
-replaced by ``sys.stdin``. To specify an alternative list of filenames, pass it
-as the first argument to :func:`.input`. A single file name is also allowed.
+replaced by ``sys.stdin`` and the optional arguments *mode* and *openhook*
+are ignored. To specify an alternative list of filenames, pass it as the
+first argument to :func:`.input`. A single file name is also allowed.
All files are opened in text mode by default, but you can override this by
specifying the *mode* parameter in the call to :func:`.input` or
diff --git a/Lib/fileinput.py b/Lib/fileinput.py
index c6fc9a1981a1..c8b8b23674c9 100644
--- a/Lib/fileinput.py
+++ b/Lib/fileinput.py
@@ -8,9 +8,9 @@
This iterates over the lines of all files listed in sys.argv[1:],
defaulting to sys.stdin if the list is empty. If a filename is '-' it
-is also replaced by sys.stdin. To specify an alternative list of
-filenames, pass it as the argument to input(). A single file name is
-also allowed.
+is also replaced by sys.stdin and the optional arguments mode and
+openhook are ignored. To specify an alternative list of filenames,
+pass it as the argument to input(). A single file name is also allowed.
Functions filename(), lineno() return the filename and cumulative line
number of the line that has just been read; filelineno() returns its
diff --git a/Misc/ACKS b/Misc/ACKS
index 40e799088645..f7fc70afd173 100644
--- a/Misc/ACKS
+++ b/Misc/ACKS
@@ -55,6 +55,7 @@ Juancarlo Añez
Chris Angelico
Jérémy Anger
Jon Anglin
+Michele Angrisano
Ankur Ankan
Heidi Annexstad
Ramchandra Apte
More information about the Python-checkins
mailing list