summaryrefslogtreecommitdiffstats
path: root/Doc/library/zipfile.rst
diff options
context:
space:
mode:
authorSam Ezeh <sam.z.ezeh@gmail.com>2022-04-05 18:41:38 (GMT)
committerGitHub <noreply@github.com>2022-04-05 18:41:38 (GMT)
commit050a8f94c678a05d506fe192c863c4a572178c42 (patch)
tree576ea8be15d5683c681a4c258567d814231f9d76 /Doc/library/zipfile.rst
parent9e88b572fb904b172f9e344069fb7118f1cee517 (diff)
downloadcpython-050a8f94c678a05d506fe192c863c4a572178c42.zip
cpython-050a8f94c678a05d506fe192c863c4a572178c42.tar.gz
cpython-050a8f94c678a05d506fe192c863c4a572178c42.tar.bz2
bpo-4833: Add ZipFile.mkdir (GH-32160)
Diffstat (limited to 'Doc/library/zipfile.rst')
-rw-r--r--Doc/library/zipfile.rst11
1 files changed, 11 insertions, 0 deletions
diff --git a/Doc/library/zipfile.rst b/Doc/library/zipfile.rst
index bfcc883..d6a1fce 100644
--- a/Doc/library/zipfile.rst
+++ b/Doc/library/zipfile.rst
@@ -478,6 +478,17 @@ ZipFile Objects
a closed ZipFile will raise a :exc:`ValueError`. Previously,
a :exc:`RuntimeError` was raised.
+.. method:: ZipFile.mkdir(zinfo_or_directory, mode=511)
+
+ Create a directory inside the archive. If *zinfo_or_directory* is a string,
+ a directory is created inside the archive with the mode that is specified in
+ the *mode* argument. If, however, *zinfo_or_directory* is
+ a :class:`ZipInfo` instance then the *mode* argument is ignored.
+
+ The archive must be opened with mode ``'w'``, ``'x'`` or ``'a'``.
+
+ .. versionadded:: 3.11
+
The following data attributes are also available: