Skip to content

Issue compiling on Arch Linux with python 3.13 #245

Closed

Description

@FabioLolix

Hi, I'm the AUR maintainer of pythonqt-git on AUR, with the update to Python 3.13.1 in the Arch Linux repository I have tried to rebuild the program, there is this issue; the same is happening for the last stable version 3.5.6

PythonQt.cpp: In constructor 'PythonQt::PythonQt(int, const QByteArray&)':
PythonQt.cpp:352:8: error: 'PyEval_ThreadsInitialized' was not declared in this scope; did you mean 'PythonAlreadyInitialized'?
  352 |   if (!PyEval_ThreadsInitialized()) {
      |        ^~~~~~~~~~~~~~~~~~~~~~~~~
      |        PythonAlreadyInitialized

Activity

  1. mrbean-bremen commented on Dec 28, 2024

    @mrbean-bremen
    Contributor

    Thanks! A bit of googling shows that this has indeed been removed.

    From the Python 3.13 release notes:

    Remove the PyEval_ThreadsInitialized() function, deprecated in Python 3.9. Since Python 3.7, Py_Initialize() always creates the GIL: calling PyEval_InitThreads() does nothing and PyEval_ThreadsInitialized() always returns non-zero.

    So this check can savely be removed from the code.

  2. FabioLolix commented on Dec 28, 2024

    @FabioLolix
    ContributorAuthor

    OK, I have removed the whole

    #ifdef PYTHONQT_FULL_THREAD_SUPPORT
      if (!PyEval_ThreadsInitialized()) {
        PyEval_InitThreads();
      }
    #endif
    

    and builded again, can I make the PR?

  3. mrbean-bremen commented on Dec 28, 2024

    @mrbean-bremen
    Contributor

    Of course, go ahead!

  4. mrbean-bremen commented on Dec 28, 2024

    @mrbean-bremen
    Contributor

    Maybe it also makes sense to add a Python 3.13 build to the CI - the OS does not really matter.

  5. mrbean-bremen commented on Dec 28, 2024

    @mrbean-bremen
    Contributor

    @FabioLolix - do you need a patch release?

  6. FabioLolix commented on Dec 28, 2024

    @FabioLolix
    ContributorAuthor

    pythonqt-git doesn't really need it because it pull the latest commit at build time but I'm sure other packagers will appreciate

  7. mrbean-bremen commented on Dec 28, 2024

    @mrbean-bremen
    Contributor

    Ok, thanks!

  8. added a commit that references this issue on Dec 30, 2024
    39ef1f0
  9. added a commit that references this issue on Aug 29, 2025
    d23463c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions