Skip to content

gh-128089: Bump the PYC magic number - #128097

Merged
vstinner merged 3 commits into
python:mainfrom
JelleZijlstra:bump-magic
Jan 6, 2025
Merged

gh-128089: Bump the PYC magic number#128097
vstinner merged 3 commits into
python:mainfrom
JelleZijlstra:bump-magic

Conversation

@JelleZijlstra

@JelleZijlstraJelleZijlstra commented Dec 19, 2024

Copy link
Copy Markdown
Member

@merwokmerwok changed the title gh-128089: Bump the magic numbergh-128089: Bump the PYC magic numberDec 19, 2024

@vstinnervstinner left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@JelleZijlstra

Copy link
Copy Markdown
MemberAuthor

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
Copy Markdown
Member

I re-ran the failed job.

@JelleZijlstra

Copy link
Copy Markdown
MemberAuthor

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.

@Eclips4Eclips4 left a comment

Copy link
Copy Markdown
Member

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
Copy Markdown
Contributor

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
Copy Markdown
Contributor

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

@JelleZijlstra

Copy link
Copy Markdown
MemberAuthor

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

@vstinner

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor

Main is still on 3610...

#definePYC_MAGIC_NUMBER 3611

@JelleZijlstra

Copy link
Copy Markdown
MemberAuthor

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

@JelleZijlstra

Copy link
Copy Markdown
MemberAuthor

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

@befeleme

Copy link
Copy Markdown
Contributor

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

@vstinnervstinner left a comment

Copy link
Copy Markdown
Member

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
Copy Markdown
Member

I enabled auto-merge.

@vstinner
vstinner merged commit d50fa05 into python:mainJan 6, 2025
@vstinner

Copy link
Copy Markdown
Member

@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
Copy Markdown
Member

PR merged, thanks @JelleZijlstra.

@befeleme

Copy link
Copy Markdown
Contributor

@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 freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@JelleZijlstra@vstinner@hroncok@befeleme@Eclips4