[issue35943] PyImport_GetModule() can return partially-initialized module

Geoffrey Bache report at bugs.python.org
Thu Feb 20 02:39:32 EST 2020


Geoffrey Bache <gjb1002 at users.sourceforge.net> added the comment:

I have been experiencing what I thought was this issue in my embedded Python code. We have been using Python 3.7, so I thought upgrading to 3.8.1 would fix it, but it doesn't seem to have made any difference.

My C++ code essentially can call PyImport_GetModule() from two threads simultaneously on the same module A. The symptoms I see are that one of them then gets a stacktrace in module B (imported by A), saying that some symbol defined near the end of B does not exist.

I've also noticed that this happens far more often on deployed code (where Python modules end up in a zip file) than when run directly in development (where the modules are just normal files). I can't see any difference in the frequency between 3.7.5 and 3.8.1.

Any ideas? Should I reopen this?

----------
nosy: +gjb1002

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


More information about the Python-bugs-list mailing list