Skip to content

gh-128089: Bump the PYC magic number #128097

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jan 6, 2025
Merged

Conversation

JelleZijlstra
Copy link
Member

@JelleZijlstra JelleZijlstra commented Dec 19, 2024

@merwok merwok changed the title gh-128089: Bump the magic number gh-128089: Bump the PYC magic number Dec 19, 2024
Copy link
Member

@vstinner vstinner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@JelleZijlstra
Copy link
Member Author

Unrelated failure in test_glob

======================================================================
FAIL: test_selflink (test.test_glob.SymlinkLoopGlobTests.test_selflink)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/runner/work/cpython/cpython-ro-srcdir/Lib/test/test_glob.py", line 543, in test_selflink
    self.assertIn(path, results)
    ~~~~~~~~~~~~~^^^^^^^^^^^^^^^
AssertionError: 'dir/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/file' not found in {'dir/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/file', 'dir/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/file', 'dir/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/file'}

@vstinner
Copy link
Member

I re-ran the failed job.

@JelleZijlstra
Copy link
Member Author

Seems like another PR bumping the magic number just went in. Is it still worth it to merge this change @hroncok? I could bump the number further but then the patch wouldn't apply cleanly to 3.14a3 anyway.

Copy link
Member

@Eclips4 Eclips4 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but it seems to have a merging conflict now. By looking at d2f1d91, it appears that d2f1d91 should use Python 3.14a4 instead of Python 3.14a3, is that right?

@hroncok
Copy link
Contributor

hroncok commented Dec 19, 2024

Ah. We cannot backport a version bump that would be equal to a4, or else we'll have the same problem when a4 is out.

@hroncok
Copy link
Contributor

hroncok commented Dec 19, 2024

But we can take this, make it 3610. The main branch already had 3611 it seems.

@JelleZijlstra
Copy link
Member Author

Main is still on 3610, so it's possible the next alpha will get released with that number.

@vstinner
Copy link
Member

Since the magic number was bumped to 3610 by another change, I suggest to not bump the magic number again. Maybe just change the magic number comment to mention annotationlib?

@vstinner
Copy link
Member

Or if you still want to increase the magic number, maybe the NOT_TAKEN instruction should get 3611, and annotationlib should get 3610. I don't know :-(

@hroncok
Copy link
Contributor

hroncok commented Dec 20, 2024

Main is still on 3610...

#define PYC_MAGIC_NUMBER 3611

@JelleZijlstra
Copy link
Member Author

Oh right, the last comment is for 3610 but the actual number is 3611.

@JelleZijlstra
Copy link
Member Author

Apparently 3610 was accidentally skipped (#128115). Which gives us the opportunity to retcon 3610 into being the annotations change.

@befeleme
Copy link
Contributor

befeleme commented Jan 6, 2025

Hello, is there any chance this could be merged? Or what's the plan forward?

Copy link
Member

@vstinner vstinner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The NEWS entry is outdated:

Bump the PYC magic number for an internal change in annotate functions. The
magic number should have been increased in release 3.14a3. Users running
3.14a3 with PYC files generated using earlier alphas may run into problems.

I suggest to remove it.

@vstinner vstinner enabled auto-merge (squash) January 6, 2025 10:08
@vstinner
Copy link
Member

vstinner commented Jan 6, 2025

I enabled auto-merge.

@vstinner vstinner merged commit d50fa05 into python:main Jan 6, 2025
40 of 41 checks passed
@vstinner
Copy link
Member

vstinner commented Jan 6, 2025

@befeleme: magic number 3610 is now assigned to annotationlib VALUE_WITH_FAKE_GLOBALS. You can backport this change to alpha3 if you want.

@vstinner
Copy link
Member

vstinner commented Jan 6, 2025

PR merged, thanks @JelleZijlstra.

@befeleme
Copy link
Contributor

befeleme commented Jan 6, 2025

@befeleme: magic number 3610 is now assigned to annotationlib VALUE_WITH_FAKE_GLOBALS. You can backport this change to alpha3 if you want.

Thank you

srinivasreddy pushed a commit to srinivasreddy/cpython that referenced this pull request Jan 8, 2025
…thon#128097)

Assign 3610 PYC magic number to VALUE_WITH_FAKE_GLOBALS
format of annotationlib.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants