diff options
author | Victor Stinner <vstinner@python.org> | 2021-09-02 10:58:00 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-02 10:58:00 (GMT) |
commit | 19ba2122ac7313ac29207360cfa864a275b9489e (patch) | |
tree | ab34611e2b6158889cabec93f76f40c71b6ea470 /Doc/library/fileinput.rst | |
parent | a8066087054417885db0a2dbdce2ddb2ac498247 (diff) | |
download | cpython-19ba2122ac7313ac29207360cfa864a275b9489e.zip cpython-19ba2122ac7313ac29207360cfa864a275b9489e.tar.gz cpython-19ba2122ac7313ac29207360cfa864a275b9489e.tar.bz2 |
bpo-37330: open() no longer accept 'U' in file mode (GH-28118)
open(), io.open(), codecs.open() and fileinput.FileInput no longer
accept "U" ("universal newline") in the file mode. This flag was
deprecated since Python 3.3.
Diffstat (limited to 'Doc/library/fileinput.rst')
-rw-r--r-- | Doc/library/fileinput.rst | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Doc/library/fileinput.rst b/Doc/library/fileinput.rst index 3880ed3..9f7802d 100644 --- a/Doc/library/fileinput.rst +++ b/Doc/library/fileinput.rst @@ -153,7 +153,7 @@ available for subclassing as well: and :meth:`~io.TextIOBase.readline` cannot be mixed. With *mode* you can specify which file mode will be passed to :func:`open`. It - must be one of ``'r'``, ``'rU'``, ``'U'`` and ``'rb'``. + must be one of ``'r'`` and ``'rb'``. The *openhook*, when given, must be a function that takes two arguments, *filename* and *mode*, and returns an accordingly opened file-like object. You @@ -171,9 +171,6 @@ available for subclassing as well: .. versionchanged:: 3.2 Can be used as a context manager. - .. deprecated:: 3.4 - The ``'rU'`` and ``'U'`` modes. - .. deprecated:: 3.8 Support for :meth:`__getitem__` method is deprecated. @@ -183,6 +180,9 @@ available for subclassing as well: .. versionchanged:: 3.10 The keyword-only parameter *encoding* and *errors* are added. + .. versionchanged:: 3.11 + The ``'rU'`` and ``'U'`` modes have been removed. + **Optional in-place filtering:** if the keyword argument ``inplace=True`` is passed to :func:`fileinput.input` or to the :class:`FileInput` constructor, the |