Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at
Bug 1971260 - lmdb is not importable on Python 3.10
Summary: lmdb is not importable on Python 3.10
Status: NEW
Alias: None
Product: Fedora
Classification: Fedora
Component: python-lmdb
Version: rawhide
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
Assignee: Petr Špaček
QA Contact: Fedora Extras Quality Assurance
Depends On:
Blocks: PYTHON3.10 1969179
TreeView+ depends on / blocked
Reported: 2021-06-13 08:49 UTC by Elliott Sales de Andrade
Modified: 2021-06-16 15:30 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Last Closed:
Type: Bug

Attachments (Terms of Use)

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

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/", line 42, in <module>
    from lmdb.cpython import *
ImportError: /usr/lib64/python3.10/site-packages/lmdb/ 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/", line 48, in <module>
    from lmdb.cffi import *
  File "/usr/lib64/python3.10/site-packages/lmdb/", 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

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

Comment 2 Petr Viktorin 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.

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