Bug 1912931 - coccinelle fails to build with Python 3.10: Cannot resolve _Py_fopen
Summary: coccinelle fails to build with Python 3.10: Cannot resolve _Py_fopen
Status: NEW
Alias: None
Product: Fedora
Classification: Fedora
Component: coccinelle
Version: rawhide
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
Assignee: Richard W.M. Jones
QA Contact: Fedora Extras Quality Assurance
Depends On:
Blocks: PYTHON3.10
TreeView+ depends on / blocked
Reported: 2021-01-05 16:02 UTC by Tomáš Hrnčiar
Modified: 2021-02-09 16:24 UTC (History)
3 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)

Description Tomáš Hrnčiar 2021-01-05 16:02:21 UTC
coccinelle fails to build with Python 3.10.0a4.

/lib64/libpython3.10.so.1.0 returned Cannot resolve _Py_fopen

bpo-32381: Remove the private _Py_fopen() function which is no longer needed. Use _Py_wfopen() or _Py_fopen_obj() instead.


For the build logs, see:

For all our attempts to build coccinelle 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 Miro Hrončok 2021-01-05 16:06:42 UTC

    if (version_major >= 3) {
        Python__Py_fopen = resolve("_Py_fopen");

Comment 2 Richard W.M. Jones 2021-01-05 18:53:53 UTC
Hmm, I thought I fixed the Python 3.10 things (bug 1896393).  Or is Python 3.10
still in development?

Anyway this fix is a bit beyond me.  Replacing the call with _Py_wfopen
appears like it will work, but what I'm not sure is why on earth the code
is calling these internal python functions in the first place instead of
using regular fopen.  Indeed for Python 2 it *was* using regular fopen.

I will ask upstream.

Comment 3 Richard W.M. Jones 2021-01-05 18:58:42 UTC
Not in the archive yet but should appear here:

Comment 4 Miro Hrončok 2021-01-05 20:31:51 UTC
> Or is Python 3.10 still in development?

Yes, it is. See https://fedoraproject.org/wiki/Changes/Python3.10#Important_dates_and_plan

Comment 5 Ben Cotton 2021-02-09 15:37:06 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 34 development cycle.
Changing version to 34.

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