Bug 1971260 - lmdb is not importable on Python 3.10
Summary: lmdb is not importable on Python 3.10
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: python-lmdb
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Petr Špaček
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: PYTHON3.10 1969179 1987896
TreeView+ depends on / blocked
 
Reported: 2021-06-13 08:49 UTC by Elliott Sales de Andrade
Modified: 2021-08-04 21:37 UTC (History)
7 users (show)

Fixed In Version: python3.10-3.10.0~rc1-1.fc35
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-08-04 21:37:20 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github jnwatson py-lmdb issues 261 0 None open py-lmdb doesn't work with Python 3.10 2021-06-13 08:49:02 UTC

Description Elliott Sales de Andrade 2021-06-13 08:49:02 UTC
Description of problem:
Installing lmdb in Rawhide produces an un-importable package.


Version-Release number of selected component (if applicable):
$ rpm -q python3-lmdb
python3-lmdb-1.0.0-2.fc35.x86_64


Steps to Reproduce:
1. mock -r fedora-rawhide-x86_64 --install python3-lmdb  (may need --enablerepo=local right now)
2. mock -r fedora-rawhide-x86_64 --shell
3. python3 -c 'import lmdb'


Actual results:
Traceback (most recent call last):
  File "/usr/lib64/python3.10/site-packages/lmdb/__init__.py", line 42, in <module>
    from lmdb.cpython import *
ImportError: /usr/lib64/python3.10/site-packages/lmdb/cpython.cpython-310-x86_64-linux-gnu.so: undefined symbol: PyObject_AsReadBuffer

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib64/python3.10/site-packages/lmdb/__init__.py", line 48, in <module>
    from lmdb.cffi import *
  File "/usr/lib64/python3.10/site-packages/lmdb/cffi.py", line 353, in <module>
    import cffi
ModuleNotFoundError: No module named 'cffi'


Expected results:
The CPython extension uses API that was removed in Python 3.10. It should be updated to not use it. If this cannot be done, the fallback to cffi should be fixed by adding a dependency on cffi.

Comment 1 Miro Hrončok 2021-06-14 10:37:26 UTC
PyObject_AsReadBuffer:

bpo-41103: PyObject_AsCharBuffer(), PyObject_AsReadBuffer(), PyObject_CheckReadBuffer(), and PyObject_AsWriteBuffer() are removed. Please migrate to new buffer protocol; PyObject_GetBuffer() and PyBuffer_Release().

https://docs.python.org/3.10/whatsnew/3.10.html#id4

Comment 2 Petr Viktorin (pviktori) 2021-06-16 15:30:37 UTC
I added a patch to the upstream commit that should make py-lmdb compile and work as it did on 3.9.
I do hope upstream comes up with a better fix, though.

Comment 3 Miro Hrončok 2021-08-04 14:31:55 UTC
With Python 3.10.0rc1, this works again. https://bugs.python.org/issue41103

https://copr.fedorainfracloud.org/coprs/g/python/python3.10/package/python-zict/

Comment 4 Fedora Update System 2021-08-04 21:36:20 UTC
FEDORA-2021-47a24beeaa has been pushed to the Fedora 35 stable repository.
If problem still persists, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.