Skip to content

[3.12] gh-121735: Fix module-adjacent references in zip files (gh-123037) - #124011

Merged
Yhg1s merged 3 commits into
python:3.12from
jaraco:backport-ba687d9-3.12
Sep 24, 2024
Merged

[3.12] gh-121735: Fix module-adjacent references in zip files (gh-123037)#124011
Yhg1s merged 3 commits into
python:3.12from
jaraco:backport-ba687d9-3.12

Conversation

@jaraco

@jaracojaraco commented Sep 12, 2024

Copy link
Copy Markdown
Member

This PR is a selective backport of gh-123037, pulling only the fix and a one-off test to protect the behavior, but avoiding the test suite refactoring (which could not be backported as it also relies on other features only in Python 3.13).

@jaracojaraco changed the title [3.12] gh-121735: Fix module-adjacent references in zip files[3.12] gh-121735: Fix module-adjacent references in zip files (gh-123037)Sep 12, 2024
@jaraco
jaracoforce-pushed the backport-ba687d9-3.12 branch from 9712573 to 2d64973CompareSeptember 12, 2024 15:24
@jaraco
jaraco removed the request for review from warsawSeptember 12, 2024 15:25
@jaraco
jaraco marked this pull request as draft September 12, 2024 15:42
@jaraco

Copy link
Copy Markdown
MemberAuthor

That's weird. The tests are failing in CI, but they're passing for me locally. I wonder why that is.

@jaraco

Copy link
Copy Markdown
MemberAuthor

That's weird. The tests are failing in CI, but they're passing for me locally. I wonder why that is.

The issue was twofold:

  1. I failed to copy the whole fix, which requires changes to Lib/zipimport.py, which I'd missed because it was separated from the other crucial change by many changes to tests.
  2. Because I was running the tests against a previous build, the zipimport hadn't been recompiled, so was still using a bootstrap zip importer with the needed changes.

Rebuilding cpython from scratch allowed the issue to replicate.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@jaraco@Yhg1s