Skip to content

Commit

Permalink
gh-102190: Add additional zipfile pwd docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
dlwrnc committed Feb 24, 2023
1 parent 0c85786 commit 4b78754
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions Lib/zipfile/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1518,7 +1518,8 @@ def comment(self, comment):
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()

Expand Down Expand Up @@ -1665,7 +1666,8 @@ def extract(self, member, path=None, pwd=None):
"""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()
Expand All @@ -1678,7 +1680,8 @@ def extractall(self, path=None, members=None, pwd=None):
"""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()
Expand Down

0 comments on commit 4b78754

Please sign in to comment.