mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +00:00
Issue #15204: Deprecated the 'U' mode in file-like objects.
This commit is contained in:
parent
d41c343f28
commit
6787a3806e
13 changed files with 45 additions and 13 deletions
|
@ -222,6 +222,10 @@ class FileInput:
|
|||
if mode not in ('r', 'rU', 'U', 'rb'):
|
||||
raise ValueError("FileInput opening mode must be one of "
|
||||
"'r', 'rU', 'U' and 'rb'")
|
||||
if 'U' in mode:
|
||||
import warnings
|
||||
warnings.warn("Use of 'U' mode is deprecated",
|
||||
DeprecationWarning, 2)
|
||||
self._mode = mode
|
||||
if openhook:
|
||||
if inplace:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue