summaryrefslogtreecommitdiff
path: root/Doc/library/zipfile.rst
diff options
context:
space:
mode:
Diffstat (limited to 'Doc/library/zipfile.rst')
-rw-r--r--Doc/library/zipfile.rst4
1 files changed, 4 insertions, 0 deletions
diff --git a/Doc/library/zipfile.rst b/Doc/library/zipfile.rst
index 33f58b25ec..bd6c3a6af1 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::