Hi all, I have some embedded Python code which looks like this in C++
_gstate = PyGILState_Ensure(); PyImport_ImportModule("a"); ... PyGILState_Release(_gstate); and is called from different threads which are created in C++. My module a.py then imports another module b in python, which defines a lot of functions. When several threads execute this simultaneously I often get a stacktrace saying some function near the end of module b is not defined, presumably because the module has been imported part-initialised. This only seems to happen when my Python modules are packaged in a zip file, not when they are ordinary files on disk. I have observed this in both Python 3.7 and Python 3.8. Does anyone have any insights or suggestions for how to debug this? It seems likely to be hard to produce a reproducible test case. Regards, Geoff Bache -- https://mail.python.org/mailman/listinfo/python-list