Repository navigation
[3.14] gh-100609: Render an unnamed zipfile as ":zipfile:" in zipfile.Path (GH-160103) - #160124
Merged
Merged
Conversation
…zipfile.Path` (pythonGH-160103) Synchronizes the fix from zipp 3.23.1. `str()` of a `zipfile.Path` whose zipfile has no filename previously raised `TypeError`. (cherry picked from commit ba96fab) Co-authored-by: Jason R. Coombs <jaraco@jaraco.com> Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
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
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Manual backport of #160103 to 3.14; miss-islington could not apply it cleanly.
The conflict:
zipfile/_path/_functools.pydoes not exist on 3.14 — it arrived with the zipp 3.23 refresh in gh-135276, which landed in 3.15. Rather than introduce a new private module and anone_ashelper on a maintenance branch for a single call site,__str__tests forNoneinline:Note this cannot be shortened to
self.root.filename or ':zipfile:': a zipfile whose filename is the empty string must keep rendering as empty, whichtest_unsupported_namescovers.The two new tests also use this branch's
self.fixtures.enter_contextidiom rather thanself.enterContext, since gh-81954 — which introduced theenterContextstyle in this file along with aResourceWarningon implicitZipFileclose — is main-only.Verified on 3.14:
test_zipfilepasses (388 tests), includingtest_unsupported_namesand the two new tests.(cherry picked from commit ba96fab)
Co-authored-by: Jason R. Coombs jaraco@jaraco.com
🤖 Generated with Claude Code