Skip to content

C API: Restore removed PyEval_InitThreads() function #117929

Closed

Description

@vstinner

Since Python 3.7, PyEval_InitThreads() does nothing, since the GIL is now always created: https://vstinner.github.io/python37-gil-change.html This function is deprecated since Python 3.9 and I removed it in Python 3.13 alpha1.

Problem: my Fedora team identified that 16 projects are affected by this function removal.

  • collectd
  • freeradius
  • gnumeric
  • libesedb
  • libsigrokdecode
  • OpenIPMI
  • openscap
  • profanity
  • pyliblo
  • pyotherside
  • python-confluent-kafka
  • python-cradox
  • python-gphoto2
  • python-simpleaudio
  • python-subvertpy
  • rb_libtorrent

I propose to restore the function in Python 3.13 beta1, and remove it again in Python 3.14 alpha1.

Linked PRs

Activity

  1. added 2 commits that reference this issue on Apr 16, 2024
  2. vstinner commented on Apr 16, 2024

    @vstinner
    MemberAuthor

    collectd doesn't seem to be affected for 3 years: collectd/collectd@17d2fbe

    #if PY_VERSION_HEX < 0x03090000
      // deprecated. Called by Py_Initialize(). Removed in Py3.11
      // https://docs.python.org/3/c-api/init.html#c.PyEval_InitThreads
      PyEval_InitThreads();
    #else
      Py_Initialize();
    #endif

    The problem is that collected 5.12 is affected, there was no release since 2020. Only release candidates of a future 6.0 version.

    Fedora bug report: https://bugzilla.redhat.com/show_bug.cgi?id=2247197

  3. vstinner commented on Apr 16, 2024

    @vstinner
    MemberAuthor
  4. vstinner commented on Apr 16, 2024

    @vstinner
    MemberAuthor
  5. added a commit that references this issue on Apr 17, 2024
  6. vstinner commented on Apr 17, 2024

    @vstinner
    MemberAuthor

    Fixed by change 75eed5b

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions