This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author peterbe
Recipients peterbe
Date 2018-02-01.15:10:52
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1517497853.08.0.467229070634.issue32742@psf.upfronthosting.co.za>
In-reply-to
Content
The ZipFile class as a extractall method [0] that allows you to leave the 'members' empty. If empty, the 'members' becomes a list of all the *names* of files in the zip. Then it iterates over the names as sends each to `self._extract_member`. But that method needs it to be a ZipInfo object instead of a file name, so it re-wraps it [2].

Instead we can use `self.infolist()` to avoid that re-wrapping inside each `self._extract_member` call. 


[0] hhttps://github.com/python/cpython/blob/12e7cd8a51956a5ce373aac692ae6366c5f86584/Lib/zipfile.py#L1579
[1] https://github.com/python/cpython/blob/12e7cd8a51956a5ce373aac692ae6366c5f86584/Lib/zipfile.py#L1586
[2] https://github.com/python/cpython/blob/12e7cd8a51956a5ce373aac692ae6366c5f86584/Lib/zipfile.py#L1615-L1616
History
Date User Action Args
2018-02-01 15:10:53peterbesetrecipients: + peterbe
2018-02-01 15:10:53peterbesetmessageid: <1517497853.08.0.467229070634.issue32742@psf.upfronthosting.co.za>
2018-02-01 15:10:53peterbelinkissue32742 messages
2018-02-01 15:10:52peterbecreate