[New-bugs-announce] [issue36458] Compile errors --without-threads

patrik report at bugs.python.org
Wed Mar 27 23:47:26 EDT 2019


New submission from patrik <patrik.haslum at anu.edu.au>:

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.

----------
components: Build
messages: 339009
nosy: patrik
priority: normal
severity: normal
status: open
title: Compile errors --without-threads
type: compile error
versions: Python 3.6

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue36458>
_______________________________________


More information about the New-bugs-announce mailing list