Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cPickleCache will not build on Python 3.9 without trace refs #124

Closed
tschorr opened this issue Feb 14, 2020 · 2 comments · Fixed by #129
Closed

cPickleCache will not build on Python 3.9 without trace refs #124

tschorr opened this issue Feb 14, 2020 · 2 comments · Fixed by #129
Assignees

Comments

@tschorr
Copy link

tschorr commented Feb 14, 2020

cPickleCache is relying on

_Py_ForgetReference(v);

which is no longer available on Python 3.9 without Py_TRACE_REFS being defined, s. python/cpython#18332

As a result, cPickleCache can't be built + imported:

from persistent import cPickleCache
*** ImportError: /home/thomas/devel/plone/persistent/.tox/py39/lib/python3.9/site-packages/persistent/cPickleCache.cpython-39-x86_64-linux-gnu.so: undefined symbol: _Py_ForgetReference

Tests silently work around this.

It is still possible to import cPersistence though, so code in the package that does import persistence and then uses persistent.Persistent, e.g.

class PersistentMapping(IterableUserDict, persistent.Persistent):
will be fine. But client code that uses the items defined in init.py:

will only ever see the Python implementation of both Persistent and the pickle cache.

-> This is causing trouble in the Persistence package, ticket coming there.

@PythonLinks
Copy link

I wonder if we could use the ArrangoDB serialization protocol, VelocityPack, instead of Python Pickle.
https://github.com/arangodb/velocypack

covers all of JSON plus dates, integers, binary data and arbitrary precision numbers
All this gives us the possibility to use the same byte sequence of data for transport, storage and (read-only) work. Using a single data format not only eliminates a lot of conversions but ?can also reduce runtime memory usage, as data does only need a single in-memory representation.

The other popular formats we looked at have all some deficiency with respect to the above list.

After reading more about it, it sounds more interesting than I initially thought.
What problems am I missing? I am curious what other people think of this idea?

@icemac icemac removed their assignment Feb 14, 2020
@jamadden jamadden self-assigned this Feb 18, 2020
jamadden added a commit that referenced this issue Feb 18, 2020
Guard use of the internal functions _Py_*Reference behind correct ifdefs.

Also fix use of deprecated function PyEval_CallObject to be PyObject_CallObject.

Fixes #124
@jamadden jamadden mentioned this issue Feb 18, 2020
jamadden added a commit that referenced this issue Feb 19, 2020
Guard use of the internal functions _Py_*Reference behind correct ifdefs.

Also fix use of deprecated function PyEval_CallObject to be PyObject_CallObject.

Fixes #124
jamadden added a commit that referenced this issue Feb 20, 2020
With PURE_PYTHON=0, like in zope.interface.

Also always require all three extensions. This solves mysterious issues you can get if you wind up mixing and matching (#124).

Fixes #131

Add travis and tox tests for this.
jamadden added a commit that referenced this issue Feb 21, 2020
With PURE_PYTHON=0, like in zope.interface.

Also always require all three extensions. This solves mysterious issues you can get if you wind up mixing and matching (#124).

Fixes #131

Add travis and tox tests for this.
jamadden added a commit that referenced this issue Feb 26, 2020
With PURE_PYTHON=0, like in zope.interface.

Also always require all three extensions. This solves mysterious issues you can get if you wind up mixing and matching (#124).

Fixes #131

Add travis and tox tests for this.
jamadden added a commit that referenced this issue Feb 27, 2020
With PURE_PYTHON=0, like in zope.interface.

Also always require all three extensions. This solves mysterious issues you can get if you wind up mixing and matching (#124).

Fixes #131

Add travis and tox tests for this.
@icemac
Copy link
Member

icemac commented Mar 6, 2020

@tschorr Thank you for your analysis and @jamadden thank you for fixing this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants