diff options
author | Georg Brandl <georg@python.org> | 2010-11-26 07:22:28 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2010-11-26 07:22:28 (GMT) |
commit | 86e0c89b2a9c715939a7d7aee3dc271850eabd62 (patch) | |
tree | 679d9a26ebfcd4e116851b7ec709bf013c874d92 /Doc | |
parent | 420cca92e8b1b5b9bd2b9a58a93d4e8f0ff86d1d (diff) | |
download | cpython-86e0c89b2a9c715939a7d7aee3dc271850eabd62.zip cpython-86e0c89b2a9c715939a7d7aee3dc271850eabd62.tar.gz cpython-86e0c89b2a9c715939a7d7aee3dc271850eabd62.tar.bz2 |
Merged revisions 85455 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k
........
r85455 | georg.brandl | 2010-10-14 08:59:45 +0200 (Do, 14 Okt 2010) | 1 line
#1710703: write zipfile structures also in the case of closing a new, but empty, archive.
........
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/library/zipfile.rst | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Doc/library/zipfile.rst b/Doc/library/zipfile.rst index 33f58b2..bd6c3a6 100644 --- a/Doc/library/zipfile.rst +++ b/Doc/library/zipfile.rst @@ -122,6 +122,10 @@ ZipFile Objects and :program:`unzip` commands on Unix (the InfoZIP utilities) don't support these extensions. + If the file is created with mode ``'a'`` or ``'w'`` and then + :meth:`close`\ d without adding any files to the archive, the appropriate + ZIP structures for an empty archive will be written to the file. + ZipFile is also a context manager and therefore supports the :keyword:`with` statement. In the example, *myzip* is closed after the :keyword:`with` statement's suite is finished---even if an exception occurs:: |