summaryrefslogtreecommitdiff
path: root/Doc/library
diff options
context:
space:
mode:
authorBrett Cannon <brett@python.org>2013-02-01 16:36:49 -0500
committerBrett Cannon <brett@python.org>2013-02-01 16:36:49 -0500
commit0bc4329cda62d3c84fbae8560ee33577b1bc903c (patch)
treec1c69fd9841d11a974c8b4c97a736339ce1d688f /Doc/library
parent85ae3566d117df8f0ade3aa14a6ddda09711a663 (diff)
parent84d0bf94b036c5eb62b1fe31d33133a5ee05516d (diff)
downloadcpython-git-0bc4329cda62d3c84fbae8560ee33577b1bc903c.tar.gz
merge
Diffstat (limited to 'Doc/library')
-rw-r--r--Doc/library/zipfile.rst17
1 files changed, 12 insertions, 5 deletions
diff --git a/Doc/library/zipfile.rst b/Doc/library/zipfile.rst
index 9f6e0777e7..54f9b4b972 100644
--- a/Doc/library/zipfile.rst
+++ b/Doc/library/zipfile.rst
@@ -242,6 +242,16 @@ ZipFile Objects
to extract to. *member* can be a filename or a :class:`ZipInfo` object.
*pwd* is the password used for encrypted files.
+ .. 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 ``ะก:\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=None, members=None, pwd=None)
@@ -250,12 +260,9 @@ ZipFile Objects
be a subset of the list returned by :meth:`namelist`. *pwd* is the password
used for encrypted files.
- .. warning::
+ .. note::
- Never extract archives from untrusted sources without prior inspection.
- It is possible that files are created outside of *path*, e.g. members
- that have absolute filenames starting with ``"/"`` or filenames with two
- dots ``".."``.
+ See :meth:`extract` note.
.. method:: ZipFile.printdir()