mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
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.
This commit is contained in:
parent
3bfc8e0fcc
commit
e471e72977
13 changed files with 57 additions and 96 deletions
|
@ -1085,12 +1085,6 @@ are always available. They are listed here in alphabetical order.
|
|||
first decoded using a platform-dependent encoding or using the specified
|
||||
*encoding* if given.
|
||||
|
||||
There is an additional mode character permitted, ``'U'``, which no longer
|
||||
has any effect, and is considered deprecated. It previously enabled
|
||||
:term:`universal newlines` in text mode, which became the default behaviour
|
||||
in Python 3.0. Refer to the documentation of the
|
||||
:ref:`newline <open-newline-parameter>` parameter for further details.
|
||||
|
||||
.. note::
|
||||
|
||||
Python doesn't depend on the underlying operating system's notion of text
|
||||
|
@ -1247,10 +1241,6 @@ are always available. They are listed here in alphabetical order.
|
|||
|
||||
* The file is now non-inheritable.
|
||||
|
||||
.. deprecated-removed:: 3.4 4.0
|
||||
|
||||
The ``'U'`` mode.
|
||||
|
||||
.. versionchanged::
|
||||
3.5
|
||||
|
||||
|
@ -1266,6 +1256,10 @@ are always available. They are listed here in alphabetical order.
|
|||
* On Windows, opening a console buffer may return a subclass of
|
||||
:class:`io.RawIOBase` other than :class:`io.FileIO`.
|
||||
|
||||
.. versionchanged:: 3.9
|
||||
The ``'U'`` mode has been removed.
|
||||
|
||||
|
||||
.. function:: ord(c)
|
||||
|
||||
Given a string representing one Unicode character, return an integer
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue