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 1927146

Summary: borgbackup fails to build with Python 3.10: Avoid using PyObject_AsCharBuffer(), PyObject_AsReadBuffer() and PyObject_AsWriteBuffer()
Product: [Fedora] Fedora Reporter: Tomáš Hrnčiar <thrnciar>
Component: borgbackupAssignee: Felix Schwarz <fschwarz>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: fschwarz, mhroncok, ricardo.arguello, thrnciar
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-02-11 09:55:59 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On:    
Bug Blocks: 1890881    

Description Tomáš Hrnčiar 2021-02-10 08:13:35 UTC
borgbackup fails to build with Python 3.10.0a5.

src/borg/algorithms/msgpack/_unpacker.cpp:2332:17: error: ‘PyObject_AsReadBuffer’ was not declared in this scope; did you mean ‘PyObject_GetBuffer’?
 2332 |     __pyx_t_2 = PyObject_AsReadBuffer(__pyx_v_obj, ((void const **)__pyx_v_buf), __pyx_v_buffer_len); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 152, __pyx_L1_error)
      |                 ^~~~~~~~~~~~~~~~~~~~~
      |                 PyObject_GetBuffer
error: command '/usr/bin/gcc' failed with exit code 1

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

For the build logs, see:

For all our attempts to build borgbackup with Python 3.10, see:

Testing and mass rebuild of packages is happening in copr. You can follow these instructions to test locally in mock if your package builds with Python 3.10:

Let us know here if you have any questions.

Python 3.10 will be included in Fedora 35. To make that update smoother, we're building Fedora packages with early pre-releases of Python 3.10.
A build failure prevents us from testing all dependent packages (transitive [Build]Requires), so if this package is required a lot, it's important for us to get it fixed soon.
We'd appreciate help from the people who know this package best, but if you don't want to work on this now, let us know so we can try to work around it on our side.

Comment 1 Felix Schwarz 2021-02-10 10:00:16 UTC
notified upstream about the problem, hopefully they can fix it without our help.

Comment 2 Felix Schwarz 2021-02-10 22:18:48 UTC
I added a patch for the vendored msgpack and I hope everything works now...

Comment 3 Miro Hrončok 2021-02-10 22:48:49 UTC
Weirdly, Copr did not build the commit automatically. I've submitted it manually.

Comment 4 Miro Hrončok 2021-02-10 22:51:05 UTC
Got a Segmentation fault, those often happen due to a4/a5 mishmash in our Copr :/

Comment 5 Felix Schwarz 2021-02-11 07:53:53 UTC
Anything I can do or should we just wait a few days if the problem goes away?

Comment 6 Miro Hrončok 2021-02-11 08:54:02 UTC
Let's wait a few days please, sorry.

Comment 7 Felix Schwarz 2021-02-11 08:55:33 UTC
no problem, thank you for all your efforts.

Comment 8 Miro Hrončok 2021-02-11 09:55:59 UTC
(In reply to Felix Schwarz from comment #2)
> I added a patch for the vendored msgpack and I hope everything works now...

It does!