summaryrefslogtreecommitdiffstats
path: root/Lib/zipfile.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2013-11-23 20:12:06 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2013-11-23 20:12:06 (GMT)
commit6787a3806ee6a85a6f21ede70c10e15a6df267c4 (patch)
treed72149a2f3a4eab3e8f288fa2a25bb1957620d91 /Lib/zipfile.py
parentd41c343f28bd7631cfa866f8276673ccafb71d57 (diff)
downloadcpython-6787a3806ee6a85a6f21ede70c10e15a6df267c4.zip
cpython-6787a3806ee6a85a6f21ede70c10e15a6df267c4.tar.gz
cpython-6787a3806ee6a85a6f21ede70c10e15a6df267c4.tar.bz2
Issue #15204: Deprecated the 'U' mode in file-like objects.
Diffstat (limited to 'Lib/zipfile.py')
-rw-r--r--Lib/zipfile.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/zipfile.py b/Lib/zipfile.py
index ae65b42..fad52a2 100644
--- a/Lib/zipfile.py
+++ b/Lib/zipfile.py
@@ -1117,6 +1117,10 @@ class ZipFile:
"""Return file-like object for 'name'."""
if mode not in ("r", "U", "rU"):
raise RuntimeError('open() requires mode "r", "U", or "rU"')
+ if 'U' in mode:
+ import warnings
+ warnings.warn("'U' mode is deprecated",
+ DeprecationWarning, 2)
if pwd and not isinstance(pwd, bytes):
raise TypeError("pwd: expected bytes, got %s" % type(pwd))
if not self.fp: