You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Compilation breaks on Python 3.11.0a7 in PyFrame_GetLasti #32
Using the latest version of pythoncapi_compat.h currently breaks on Python 3.11.0a7.
I have seen this on GHA for Ubuntu and MacOS and locally on MacOS:
src/zope/container/_compat.h:254:14: error: incomplete definition of type 'struct _frame'
if (frame->f_lasti < 0) {
~~~~~^
/Users/runner/hostedtoolcache/Python/3.11.0-alpha.7/x64/include/python3.11/pytypedefs.h:22:16: note: forward declaration of 'struct _frame'
typedef struct _frame PyFrameObject;
^
In file included from src/zope/container/_zope_container_contained.c:34:
src/zope/container/_compat.h:257:17: error: incomplete definition of type 'struct _frame'
return frame->f_lasti * 2;
~~~~~^
If you don't need the latest enhancements of pythoncapi_compat.h, just keep your old version.
Sadly, the new version is not compatible with Python 3.11 alpha versions. PyFrameObject got a lot of changes in alpha versions. Hopefully, new public getter functions were added to solve most issues: https://docs.python.org/dev/c-api/frame.html Problem: implementing these getter functions for early alpha versions would require a lot of code in pythoncapi_compat.h, and I chose to not do that.
Workaround if you need to update pythoncapi_compat.h: manually remove the PyFrame functions which cause you build errors. Does it sound like a reasonable workaround to you? That's the approach that I adopted in my coverage PR: coveragepy/coveragepy#1353
I am trying to do so in zopefoundation/zope.container#45, but there are several other problems which arose over night in Python 3.10 and need to be fixed beforehand.
Activity
vstinner commentedon Apr 27, 2022
If you don't need the latest enhancements of pythoncapi_compat.h, just keep your old version.
Sadly, the new version is not compatible with Python 3.11 alpha versions. PyFrameObject got a lot of changes in alpha versions. Hopefully, new public getter functions were added to solve most issues: https://docs.python.org/dev/c-api/frame.html Problem: implementing these getter functions for early alpha versions would require a lot of code in pythoncapi_compat.h, and I chose to not do that.
Workaround if you need to update pythoncapi_compat.h: manually remove the PyFrame functions which cause you build errors. Does it sound like a reasonable workaround to you? That's the approach that I adopted in my coverage PR: coveragepy/coveragepy#1353
vstinner commentedon Apr 27, 2022
(Oops, I clicked on the wrong button by mistake, I didn't want to close the issue.)
icemac commentedon Apr 29, 2022
@vstinner Thank you for your explanation. It seems that I do not need
PyFrame_GetLasti– at least inzope.container.Thank you for your hard work on the compatibility side!
vstinner commentedon Jun 14, 2022
Python 3.11 beta3 is now released: can you update to a newer Python 3.11?
icemac commentedon Jun 24, 2022
I am trying to do so in zopefoundation/zope.container#45, but there are several other problems which arose over night in Python 3.10 and need to be fixed beforehand.
vstinner commentedon Jun 24, 2022
It seems to be unrelated to pythoncapi-compat. I close the issue.
Supporting alpha versions of Python 3.11 is too complicated. To get Python 3.11, use beta1 or newer.