summaryrefslogtreecommitdiffstats
path: root/Lib/zipfile
diff options
context:
space:
mode:
authorDeborah <32307299+dlwrnc@users.noreply.github.com>2024-03-31 20:11:48 (GMT)
committerGitHub <noreply@github.com>2024-03-31 20:11:48 (GMT)
commita32d6939486d7f90ee57e215077f6116e19de24d (patch)
tree51b2a8290a6f66ea147c922589731cb00b02625e /Lib/zipfile
parent262445358e21c56d7c68e3ee76c13e469d2ea348 (diff)
downloadcpython-a32d6939486d7f90ee57e215077f6116e19de24d.zip
cpython-a32d6939486d7f90ee57e215077f6116e19de24d.tar.gz
cpython-a32d6939486d7f90ee57e215077f6116e19de24d.tar.bz2
gh-102190: Add additional zipfile `pwd=` arg docstrings (gh-102195)
This just documents the parameter that already exists. --------- Co-authored-by: Gregory P. Smith <greg@krypto.org> Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
Diffstat (limited to 'Lib/zipfile')
-rw-r--r--Lib/zipfile/__init__.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/Lib/zipfile/__init__.py b/Lib/zipfile/__init__.py
index b330ece..e4603b5 100644
--- a/Lib/zipfile/__init__.py
+++ b/Lib/zipfile/__init__.py
@@ -1585,7 +1585,8 @@ class ZipFile:
self._didModify = True
def read(self, name, pwd=None):
- """Return file bytes for name."""
+ """Return file bytes for name. 'pwd' is the password to decrypt
+ encrypted files."""
with self.open(name, "r", pwd) as fp:
return fp.read()
@@ -1737,7 +1738,8 @@ class ZipFile:
"""Extract a member from the archive to the current working directory,
using its full name. Its file information is extracted as accurately
as possible. `member' may be a filename or a ZipInfo object. You can
- specify a different directory using `path'.
+ specify a different directory using `path'. You can specify the
+ password to decrypt the file using 'pwd'.
"""
if path is None:
path = os.getcwd()
@@ -1750,7 +1752,8 @@ class ZipFile:
"""Extract all members from the archive to the current working
directory. `path' specifies a different directory to extract to.
`members' is optional and must be a subset of the list returned
- by namelist().
+ by namelist(). You can specify the password to decrypt all files
+ using 'pwd'.
"""
if members is None:
members = self.namelist()