Repository navigation
Conversation
Use Python 3.9 Py_SET_SIZE() function to set an object size. Add a Py_SET_SIZE() implementation for Python 3.8 and older. On Python 3.11, Py_SIZE() can no longer be used as an l-value to set an object size: * https://docs.python.org/dev/c-api/structures.html#c.Py_SIZE * https://docs.python.org/dev/whatsnew/3.11.html#id2 Use the Py_REFCNT() and Py_TYPE() macros rather than accessing directly to ob_refcnt and ob_type members of the PyObject structure.
|
The intent of See my draft https://www.python.org/dev/peps/pep-0674/ for the rationale, and https://bugs.python.org/issue39573 for the issue which changed the Py_SIZE() macro to disallow using it as an l-value. In Python 3.11, Py_SIZE() is modified to disallow using it as an l-value. |
This requires the changes from #64 to run successfully.
|
@vstinner Thank you for your contribution. Running your commit on Python 3.11.0a4 on MacOS 11.6 I get the following errors: Am I doing something wrong there? |
|
Oh right, I missed two functions: fixed in my second commit. This change is not enough to fully support Python 3.11. save_float() and load_binfloat() use private _PyFloat_Pack8() and _PyFloat_Unpack8() functions which moved to the internal C API in Python 3.11. This function moved to the internal C API in Python 3.11: python/cpython@0a883a7 Maybe this function should be copied to zodbpickle as well. Rather than forking the _pickle module, maybe the |
I would prefer to address that in a separated PR. |
Indeed, |
Oh, that's an old issue. You should maybe propose again the idea? If it's useful to you, maybe other people outside Zope would find it useful? |
|
As this PR drastically improves the Python 3.11 situation, I'd suggest to merge it and fix the remaining @jamadden Do you think a signed contributor agreement is needed to merge this PR? |
I am not a lawyer, but: yes, I think so. The Plone Contributors Agreement FAQ seems pretty firm:
Only the Plone Release Manager can grant waivers:
While this is small, it introduces new functions/function like macros and calls them, replacing direct inline code. I'm also not the release manager, but that seems creative to me. |
Should I sign or was the question for @icemac? The README file doesn't mention this document, and the project has no CONTRIBUTING document. If I have to sign it, I don't know how to sign it. |
|
The instruction would be here P.S.: @icemac sounds like a good idea to add a contributor's document via the meta tool. |
|
@vstinner @jugmac00 It seems like be a problem in GitHub: According to https://docs.github.com/en/communities/setting-up-your-project-for-healthy-contributions/creating-a-default-community-health-file it is possible to have a We have https://github.com/zopefoundation/.github/blob/master/CONTRIBUTING.md. But maybe this only shows up at the right when creating the first PR. @vstinner Yes, please sign the contributor agreement. |
I understood that https://github.com/zopefoundation/zodbpickle/ should have in the root directory, in a |
https://github.blog/changelog/2019-02-21-organization-wide-community-health-files/ and https://docs.github.com/en/communities/setting-up-your-project-for-healthy-contributions/creating-a-default-community-health-file - so in theory it should have worked |
I read it and I'm sorry, I don't want to sign it. I don't want to transfer the rights of my header file to Plone, just to port zodbpickle to Python 3.11. If zodbpickle cannot use pythoncapi_compat.h, I suggest you to copy/paste the code provided in What's New in Python 3.10 and What's New in Python 3.11 and write a new PR based on that. |
What's New in Python 3.x code is distributed under the Zero Clause BSD License. See the notice at the bottom of the doc:
|
I added new public functions to Python 3.11 alpha7 for zodbpickle: see #67 |
In the meanwhile, the pythoncapi_compat project moved under the Python organization on GitHub: https://github.com/python/pythoncapi_compat and its license changed from MIT to Zero Clause BSD (0BSD) license. |
|
That's nice to hear. Thank you. |
Use Python 3.9 Py_SET_SIZE() function to set an object size. Add a
Py_SET_SIZE() implementation for Python 3.8 and older.
On Python 3.11, Py_SIZE() can no longer be used as an l-value to set
an object size:
Use the Py_REFCNT() and Py_TYPE() macros rather than accessing
directly to ob_refcnt and ob_type members of the PyObject structure.