diff options
author | Victor Stinner <vstinner@python.org> | 2019-10-28 14:40:08 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-10-28 14:40:08 (GMT) |
commit | e471e72977c83664f13d041c78549140c86c92de (patch) | |
tree | feddc2c15e7199122f6f59992de0dab8f73b6149 /Doc/whatsnew | |
parent | 3bfc8e0fcc707d200c267ff05b052fd6a63c985a (diff) | |
download | cpython-e471e72977c83664f13d041c78549140c86c92de.zip cpython-e471e72977c83664f13d041c78549140c86c92de.tar.gz cpython-e471e72977c83664f13d041c78549140c86c92de.tar.bz2 |
bpo-37330: open() no longer accept 'U' in file mode (GH-16959)
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/whatsnew')
-rw-r--r-- | Doc/whatsnew/3.9.rst | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Doc/whatsnew/3.9.rst b/Doc/whatsnew/3.9.rst index 886c555..bca2229 100644 --- a/Doc/whatsnew/3.9.rst +++ b/Doc/whatsnew/3.9.rst @@ -284,6 +284,14 @@ that may require changes to your code. Changes in the Python API ------------------------- +* :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`.) + * :func:`__import__` and :func:`importlib.util.resolve_name` now raise :exc:`ImportError` where it previously raised :exc:`ValueError`. Callers catching the specific exception type and supporting both Python 3.9 and |