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.
This commit is contained in:
Victor Stinner 2021-09-02 12:58:00 +02:00 committed by GitHub
parent a806608705
commit 19ba2122ac
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 61 additions and 104 deletions

View file

@ -321,6 +321,14 @@ Changes in the Python API
Python 3.8.
(Contributed by Illia Volochii in :issue:`43234`.)
* :func:`open`, :func:`io.open`, :func:`codecs.open` and
:class:`fileinput.FileInput` no longer accept ``'U'`` ("universal newline")
in the file mode. This flag was deprecated since Python 3.3. In Python 3, the
"universal newline" is used by default when a file is open in text mode. The
:ref:`newline parameter <open-newline-parameter>` of :func:`open` controls
how universal newlines works.
(Contributed by Victor Stinner in :issue:`37330`.)
C API Changes
=============