https://github.com/python/cpython/commit/0b23bc334c3762615ef44a53663aeab1ed625595
commit: 0b23bc334c3762615ef44a53663aeab1ed625595
branch: 3.12
author: Miss Islington (bot) <[email protected]>
committer: gpshead <[email protected]>
date: 2024-03-31T18:53:51-07:00
summary:

[3.12] gh-102190: Add additional zipfile `pwd=` arg docstrings (gh-102195) 
(GH-117408)

gh-102190: Add additional zipfile `pwd=` arg docstrings (gh-102195)

This just documents the parameter that already exists.

---------

(cherry picked from commit a32d6939486d7f90ee57e215077f6116e19de24d)

Co-authored-by: Deborah <[email protected]>
Co-authored-by: Gregory P. Smith <[email protected]>
Co-authored-by: Erlend E. Aasland <[email protected]>

files:
M Lib/zipfile/__init__.py

diff --git a/Lib/zipfile/__init__.py b/Lib/zipfile/__init__.py
index a05c97ab89460c..91358156bc1e49 100644
--- a/Lib/zipfile/__init__.py
+++ b/Lib/zipfile/__init__.py
@@ -1562,7 +1562,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()
 
@@ -1714,7 +1715,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()
@@ -1727,7 +1729,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()

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: [email protected]

Reply via email to