Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

smacke
Copy link
Contributor

@smacke smacke commented Aug 31, 2025

When patching an empty closure into some function, we should patch a value of NULL (corresponding to address 0) rather than than the address of None, as per python/cpython#138267 (comment). This has actually always been a problem with deduperreload, but it wasn't until f6fd3f5 that there was a test case that actually manifested this bug.

Anyway, this PR should fix python/cpython#138267

@mgorny
Copy link
Contributor

mgorny commented Aug 31, 2025

Thanks! I can confirm that the suite passes with these changes!

@smacke
Copy link
Contributor Author

smacke commented Sep 1, 2025

Thanks! I can confirm that the suite passes with these changes!

That was going to be my next step -- to compile cpython with assertions and verify this fixes; thank you for saving me the trouble!

@mgorny
Copy link
Contributor

mgorny commented Sep 1, 2025

Np. Though given what you're doing here, it would probably make sense to test against assertion-enabled builds as part of CI. Unfortunately, I don't know an easy way to get a prebuilt version.

Copy link
Member

@krassowski krassowski left a comment

Choose a reason for hiding this comment

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

Thank you!

@krassowski krassowski changed the title deduperreload should patch NULL for empty closure rather than None deduperreload: patch NULL for empty closure rather than None Sep 1, 2025
@krassowski krassowski added this to the 9.6 milestone Sep 1, 2025
@krassowski krassowski merged commit e3b166f into ipython:main Sep 1, 2025
19 checks passed
Sign up for free to 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.

IPython test suite: ./Include/cpython/tupleobject.h:24: PyTuple_GET_SIZE: Assertion PyTuple_Check(op) failed.
3 participants