-
-
Notifications
You must be signed in to change notification settings - Fork 34.8k
Support copy() for zipfile #151824
Copy link
Copy link
Open
Labels
stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-featureA feature request or enhancementA feature request or enhancement
Metadata
Metadata
Assignees
Labels
stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-featureA feature request or enhancementA feature request or enhancement
Fields
Give feedbackNo fields configured for issues without a type.
Projects
StatusShow more project fields
No status
Feature or enhancement
Proposal:
Currently, copying an entry within a ZIP file is cumbersome due to the lack of support for simultaneous reading and writing. The implementer must either:
Both approaches are more complex and less performant, due to the need to decompress and recompress data.
If would be much more performant and friendly by implementing a
copy()method, using the similar internal buffered copying technique introduced by #134627 with the internal_ZipRepacker.This also opens the door to support an efficient
move()operation, composed ofcopy(),remove(), and optionallyrepack().Has this already been discussed elsewhere?
Mentioned in #134627
Links to previous discussion of this feature:
#134627
Linked PRs
copy()toZipFile#151825