GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [3.14] gh-100609: Render an unnamed zipfile as ":zipfile:" in `zipfile.Path` (GH-160103) by jaraco · Pull Request #160124 · python/cpython

Conversation

@jaraco

@jaraco jaraco commented Oct 21, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

Manual backport of #160103 to 3.14; miss-islington could not apply it cleanly.

The conflict: zipfile/_path/_functools.py does 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 a none_as helper on a maintenance branch for a single call site, __str__ tests for None inline:

    def __str__(self):
        root = self.root.filename
        if root is None:
            root = ':zipfile:'
        return posixpath.join(root, self.at) if self.at else root

Note this cannot be shortened to self.root.filename or ':zipfile:': a zipfile whose filename is the empty string must keep rendering as empty, which test_unsupported_names covers.

The two new tests also use this branch's self.fixtures.enter_context idiom rather than self.enterContext, since gh-81954 — which introduced the enterContext style in this file along with a ResourceWarning on implicit ZipFile close — is main-only.

Verified on 3.14: test_zipfile passes (388 tests), including test_unsupported_names and the two new tests.

(cherry picked from commit ba96fab)

Co-authored-by: Jason R. Coombs [email protected]

  • Issue: str(zipfile.Path()) not working when root attribute is io.BytesIO #100609

🤖 Generated with Claude Code

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@jaraco @claude
[3.14] pythongh-100609: Render an unnamed zipfile as ":zipfile:" in `…
e818c8d
…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 <[email protected]>
Co-authored-by: Claude Opus 5 <[email protected]>
This was referenced Oct 21, 2026
gh-100609: Render an unnamed zipfile as ":zipfile:" in zipfile.Path #160103
Merged
str(zipfile.Path()) not working when root attribute is io.BytesIO #100609
Closed
@bedevere-app bedevere-app Bot added the awaiting core review label Oct 21, 2026
@jaraco
jaraco enabled auto-merge (squash) October 21, 2026 22:04
@jaraco
jaraco merged commit ba0e4a4 into python:3.14 Oct 21, 2026
53 of 54 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot removed the awaiting core review label Oct 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@jaraco
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.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.