This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Compile errors --without-threads
Type: compile error Stage: resolved
Components: Build Versions: Python 3.6
process
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: Nosy List: ned.deily, patrik
Priority: normal Keywords:

Created on 2019-03-28 03:47 by patrik, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Messages (3)
msg339009 - (view) Author: (patrik) Date: 2019-03-28 03:47
Compiling python 3.6.8 configured with --without-threads (no other options) fails, with undefined references to PyGILState_GetThisThreadState in pylifecycle.c, and PyGILState_Ensure and PyGILState_Release in object.c.

I used Louis' fix from issue #24784 in pylifecycle.c, and placed #ifdef WITH_THREADS around the undefined calls in object.c (both in _PyObject_dump). With this, compiling works.

Installing then fails because Lib/threading.py attempts to import _thread, which is not available. This can be fixed by replacing the import with the pattern described in _dummy_thread:

try:
    import _thread
except ImportError:
    import _dummy_thread as _thread

import _thread happens in two places in threading.py (the second is "from _thread import stack_size"); both have to be rewritten as above.

There is also an unguarded import _thread in telnetlib, but it's inside a method def (mt_interact in class Telnet) so perhaps it does not cause installation to fail.
msg339010 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2019-03-28 04:05
Thanks for the report. Unfortunately, Python 3.6.8 was the last bugfix release of 3.6 so we now only accept and fix security-related issues for it.  I did a quick check and this does not appear to be a problem in 3.7.x but feel free to re-open the issue if it can be reproduced there.  Sorry!

https://devguide.python.org/#status-of-python-branches
https://devguide.python.org/devcycle/#security-branches
msg339012 - (view) Author: (patrik) Date: 2019-03-28 04:24
Not a problem. I wanted to record the issue just in case someone else encounters it, and also because there seems to have been a history of issues with the no-threads option. Happy to hear its sorted in 3.7.
History
Date User Action Args
2022-04-11 14:59:13adminsetgithub: 80639
2019-03-28 04:24:46patriksetmessages: + msg339012
2019-03-28 04:05:29ned.deilysetstatus: open -> closed

nosy: + ned.deily
messages: + msg339010

resolution: out of date
stage: resolved
2019-03-28 03:47:26patrikcreate