FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-151824: Add `copy()` to `ZipFile` by danny0838 · Pull Request #151825 · python/cpython · GitHub

Repository navigation

gh-151824: Add copy() to ZipFile - #151825

Open
danny0838 wants to merge 2 commits into
python:mainfrom
danny0838:gh-51067-3
Open

danny0838 wants to merge 2 commits into
python:mainfrom
danny0838:gh-51067-3

Conversation

danny0838 commented Jun 21, 2026 •
edited by bedevere-app Bot
Loading

Copy link
Copy Markdown
Contributor

Following the remove() and repack() introduced by #134627, add copy() for performant member copying in a ZIP file.

Moving a member can also be done as a combination of copy(), remove(), and repack() like:

with ZipFile('spam.zip', 'a') as myzip:
    myzip.repack([myzip.remove(myzip.copy('old.txt', 'new.txt'))])

which is required since the filename is stored within the member's local file entry and thus need a gross rewriting.

read-the-docs-community Bot commented Jun 21, 2026 •
edited
Loading

Copy link
Copy Markdown

Copy link
Copy Markdown
Contributor Author

Nicely ping related reviewers in the previous PR: @gpshead, @merwok, @jaraco, @emmatyping, @AA-Turner.

Comment thread Doc/library/zipfile.rst
danny0838 requested a review from AA-Turner as a code owner June 21, 2026 07:33
picnixz requested review from emmatyping and jaraco June 21, 2026 07:42

github-actions Bot commented Oct 5, 2026

Copy link
Copy Markdown

This PR is stale because it has been open for 90 days with no activity.

github-actions Bot added the stale Stale PR or inactive for long period of time. label Oct 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting review stale Stale PR or inactive for long period of time.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL