Skip to content

C API: Restore removed PyEval_InitThreads() function #117929

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
vstinner opened this issue Apr 16, 2024 · 5 comments
Closed

C API: Restore removed PyEval_InitThreads() function #117929

vstinner opened this issue Apr 16, 2024 · 5 comments

Comments

@vstinner
Copy link
Member

vstinner commented Apr 16, 2024

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

@vstinner
Copy link
Member Author

vstinner commented Apr 16, 2024

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

@vstinner
Copy link
Member Author

@vstinner
Copy link
Member Author

pyotherside: I proposed a fix, https://github.com/thp/pyotherside/pull/132/files

@corona10
Copy link
Member

@vstinner
Copy link
Member Author

Fixed by change 75eed5b

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

No branches or pull requests

2 participants