paultiq opened a new pull request, #48027: URL: https://github.com/apache/arrow/pull/48027
### Rationale for this change pyarrow builds fail on CPython 3.15 due to the 3.15's removal of PyWeakref_GetObject, used in extension_types.cc. This was deprecated in 3.13. A backport is available in the already-vendored [pythoncapi_compat](https://github.com/apache/arrow/blob/main/python/pyarrow/src/arrow/python/vendored/pythoncapi_compat.h). Fixes https://github.com/apache/arrow/issues/47823. To be clear: this fixes only the build issue reported in the issue, not "3.15 support". ### What changes are included in this PR? Replaces the sole use of PyWeakref_GET_OBJECT with the backported version of PyWeakref_GetRef. This follows the recommendation from [Pending removal in Python 3.15](https://docs.python.org/3/deprecations/c-api-pending-removal-in-3.15.html) > [PyWeakref_GetObject()](https://docs.python.org/3/c-api/weakref.html#c.PyWeakref_GetObject) and [PyWeakref_GET_OBJECT()](https://docs.python.org/3/c-api/weakref.html#c.PyWeakref_GET_OBJECT): Use [PyWeakref_GetRef()](https://docs.python.org/3/c-api/weakref.html#c.PyWeakref_GetRef) instead. The [pythoncapi-compat project](https://github.com/python/pythoncapi-compat/) can be used to get [PyWeakref_GetRef()](https://docs.python.org/3/c-api/weakref.html#c.PyWeakref_GetRef) on Python 3.12 and older. ### Are these changes tested? Build and tested on a local Ubuntu 24.04 build. ### Are there any user-facing changes? No user-facing changes. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
