Issue #15204: Deprecated the 'U' mode in file-like objects.

This commit is contained in:
Serhiy Storchaka 2013-11-23 22:12:06 +02:00
parent d41c343f28
commit 6787a3806e
13 changed files with 45 additions and 13 deletions

View file

@ -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: