summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregory P. Smith <greg@krypto.org>2013-02-07 22:11:03 -0800
committerGregory P. Smith <greg@krypto.org>2013-02-07 22:11:03 -0800
commita26ec65d93ffce79f127f350872faab9883e2c09 (patch)
tree6ea758842849e0b0c0ee4eb92a076d9262542f47
parent35c52b687ffa044a0a5a1fe2ef477ce653d926b7 (diff)
downloadcpython-git-a26ec65d93ffce79f127f350872faab9883e2c09.tar.gz
Issue #6972: fix the documentation mis applied patch.
-rw-r--r--Doc/library/zipfile.rst23
1 files changed, 13 insertions, 10 deletions
diff --git a/Doc/library/zipfile.rst b/Doc/library/zipfile.rst
index cf62d497cb..ebb1394515 100644
--- a/Doc/library/zipfile.rst
+++ b/Doc/library/zipfile.rst
@@ -213,6 +213,16 @@ ZipFile Objects
.. versionadded:: 2.6
+ .. note::
+
+ If a member filename is an absolute path, a drive/UNC sharepoint and
+ leading (back)slashes will be stripped, e.g.: ``///foo/bar`` becomes
+ ``foo/bar`` on Unix, and ``C:\foo\bar`` becomes ``foo\bar`` on Windows.
+ And all ``".."`` components in a member filename will be removed, e.g.:
+ ``../../foo../../ba..r`` becomes ``foo../ba..r``. On Windows illegal
+ characters (``:``, ``<``, ``>``, ``|``, ``"``, ``?``, and ``*``)
+ replaced by underscore (``_``).
+
.. method:: ZipFile.extractall([path[, members[, pwd]]])
@@ -227,6 +237,9 @@ ZipFile Objects
It is possible that files are created outside of *path*, e.g. members
that have absolute filenames starting with ``"/"`` or filenames with two
dots ``".."``.
+
+ .. versionchanged:: 2.7.4
+ The zipfile module attempts to prevent that. See :meth:`extract` note.
.. versionadded:: 2.6
@@ -242,16 +255,6 @@ ZipFile Objects
.. versionadded:: 2.6
- .. note::
-
- If a member filename is an absolute path, a drive/UNC sharepoint and
- leading (back)slashes will be stripped, e.g.: ``///foo/bar`` becomes
- ``foo/bar`` on Unix, and ``C:\foo\bar`` becomes ``foo\bar`` on Windows.
- And all ``".."`` components in a member filename will be removed, e.g.:
- ``../../foo../../ba..r`` becomes ``foo../ba..r``. On Windows illegal
- characters (``:``, ``<``, ``>``, ``|``, ``"``, ``?``, and ``*``)
- replaced by underscore (``_``).
-
.. method:: ZipFile.read(name[, pwd])