Skip to content
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

Use Py_REFCNT to access cPersistentObject refcounts #214

Merged
merged 1 commit into from
Feb 25, 2025

Conversation

cjwatson
Copy link
Contributor

These assertions failed to compile if built without -DNDEBUG. As of setuptools 75.7.0, setting CFLAGS to anything while building an extension no longer copies the CFLAGS that Python itself was built with, so NDEBUG is less likely to be defined. See pypa/setuptools#4836 and https://bugs.debian.org/1098602.

These assertions failed to compile if built without `-DNDEBUG`.  As of
setuptools 75.7.0, setting `CFLAGS` to anything while building an extension no
longer copies the `CFLAGS` that Python itself was built with, so `NDEBUG` is
less likely to be defined.  See pypa/setuptools#4836
and https://bugs.debian.org/1098602.
Copy link
Member

@tseaver tseaver left a comment

Choose a reason for hiding this comment

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

LGTM, although I don't really follow the pypa discussion. In any case, using the Py_REFCNT macro[1] is cleaner than direct access.

[1] https://docs.python.org/3/c-api/refcounting.html#c.Py_REFCNT

@tseaver tseaver merged commit a5de2b5 into zopefoundation:master Feb 25, 2025
47 checks passed
@thesamesam
Copy link

The TL;DR is that the asserts couldn't actually be compiled with some Python versions and setuptools was masking that by adding -DNDEBUG in more cases than one would expect.

@icemac
Copy link
Member

icemac commented Feb 26, 2025

Just released in https://pypi.org/project/persistent/6.1.1/.

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.

4 participants