mirror of
https://github.com/python/cpython.git
synced 2025-12-31 04:23:37 +00:00
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>
This commit is contained in:
parent
262445358e
commit
a32d693948
1 changed files with 6 additions and 3 deletions
|
|
@ -1585,7 +1585,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()
|
||||
|
||||
|
|
@ -1737,7 +1738,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()
|
||||
|
|
@ -1750,7 +1752,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()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue