diff options
author | Victor Stinner <vstinner@python.org> | 2020-03-04 17:50:22 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-04 17:50:22 (GMT) |
commit | 942f7a2dea2e95a0fa848329565c0d0288d92e47 (patch) | |
tree | 31abda8d45ef676a46ea63a6a8a61ccf6061e9c5 /Doc/library/fileinput.rst | |
parent | 00c77ae55a82548a6b45af73cdf712ea34910645 (diff) | |
download | cpython-942f7a2dea2e95a0fa848329565c0d0288d92e47.zip cpython-942f7a2dea2e95a0fa848329565c0d0288d92e47.tar.gz cpython-942f7a2dea2e95a0fa848329565c0d0288d92e47.tar.bz2 |
bpo-39674: Revert "bpo-37330: open() no longer accept 'U' in file mode (GH-16959)" (GH-18767)
This reverts commit e471e72977c83664f13d041c78549140c86c92de.
The mode will be removed from Python 3.10.
Diffstat (limited to 'Doc/library/fileinput.rst')
-rw-r--r-- | Doc/library/fileinput.rst | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/Doc/library/fileinput.rst b/Doc/library/fileinput.rst index 236f5d5..cc4039a 100644 --- a/Doc/library/fileinput.rst +++ b/Doc/library/fileinput.rst @@ -148,8 +148,8 @@ available for subclassing as well: The sequence must be accessed in strictly sequential order; random access 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 ``'r'`` or ``'rb'``. + With *mode* you can specify which file mode will be passed to :func:`open`. It + must be one of ``'r'``, ``'rU'``, ``'U'`` 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 @@ -166,14 +166,15 @@ 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. .. versionchanged:: 3.8 The keyword parameter *mode* and *openhook* are now keyword-only. - .. versionchanged:: 3.9 - The ``'rU'`` and ``'U'`` modes have been removed. **Optional in-place filtering:** if the keyword argument ``inplace=True`` is |