PythonMonkey icon indicating copy to clipboard operation
PythonMonkey copied to clipboard

python 3.13 support

Open Xmader opened this issue 1 year ago • 0 comments

In order to make PythonMonkey support the upcoming (October 1, 2024) Python 3.13 release, the following changes/actions need to be made in the codebase:

  • Python 3.13 added a PyLong_AsNativeBytes API, but also changed the function signature of the _PyLong_AsByteArray API (https://github.com/python/cpython/issues/111140)

  • _Py_IsFinalizing becomes a stable API in Python 3.13, and is renamed to Py_IsFinalizing

  • Python 3.13 moved several undocumented APIs to private and internal-only, i.e. removed from public use.

    • _PyDictView* APIs are removed.
    • _PyArg_CheckPositional API is removed.
    • _PyErr_SetKeyError API is removed. https://github.com/python/cpython/pull/108607
    • _PyThreadState_GetDict(tstate) API gets removed.
      • However, there would be no perfect replacement fix.
      • It's currently impossible in Python 3.13 to get the thread dictionary on a specific thread other than the current thread. (the public PyThreadState_GetDict() API can only get from the current thread)

Closes https://github.com/Distributive-Network/PythonMonkey/issues/441

Xmader avatar Sep 12 '24 20:09 Xmader