Add support for PyPy3.12 - #10047
Add support for PyPy3.12#10047
Conversation
That's interesting, considering that |
|
pypy/pypy#3836 looks the closest issue, and a big job, so I expect later rather than sooner. |
| #if PY_MAJOR_VERSION > 3 || PY_MINOR_VERSION > 11 | ||
| #if (PY_MAJOR_VERSION > 3 || PY_MINOR_VERSION > 11) && !defined(PYPY_VERSION) | ||
| PyConfig config; | ||
| PyConfig_InitPythonConfig(&config); |
There was a problem hiding this comment.
PyConfig_InitPythonConfig() is designed to configuration Python initialization, not to read the current configuration.
To read the current configuration, you should call PyConfig_Get("filesystem_encoding") instead.
There was a problem hiding this comment.
PyConfig_Get was only added in Python 3.14. We could still call it anyway, with the help of pythoncapi_compat.h, but surely there must be a correct version that works naturally with Python 3.12 and 3.13?
There was a problem hiding this comment.
Hum, I read again the code and in fact, getting the encoding is only half of the problem. You should use the correct error handler as well.
There is a better API for that: use PyUnicode_FSConverter with PyArg_ParseTuple family and O& format. It gets the current filesystem encoding and error handler. It's available since Python 3.1.
Co-authored-by: Andrew Murray <3112309+radarhere@users.noreply.github.com>
PyPy v8.0.0 is out:
https://pypy.org/posts/2026/09/pypy-v800-release.html
This PR:
Adds
pypy3.12to the CI.Updates https://github.com/python/pythoncapi-compat/ to the latest, which is needed for PyPy3.12 support.
PyPy doesn't have
PyConfig, so update a "if 3.12+" check to "if 3.12+ and not PyPy" so PyPy 2.12 uses the else branch.Not available in cibuildwheel yet: pypa/cibuildwheel#2995.