Importing not thread-save
See original GitHub issueSorry for posting information without any additional data, I have lack of experience to provide you simple example. I hope current information will enough.
The problem was in pyinstaller https://github.com/pyinstaller/pyinstaller/issues/2371 and now I see absolutely same problem with Nuitka last factory version on windows 7. One thread works perfect, 2 threads or more shows:
AttributeError: module 'XXX' has no attribute 'YYY'
Issue Analytics
- State:
- Created 5 years ago
- Comments:10 (6 by maintainers)
Top Results From Across the Web
Issue 38884: __import__ is not thread-safe on Python 3
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 ......
Read more >Issue 2834: import of Java classes is not thread safe - Jython
Any thread not already waiting inside the type system will then pick up an incomplete PyType from the ClassValue. We do need those...
Read more >import inside of a Python thread - Stack Overflow
Normal imports are thread-safe because they acquire an import lock prior to execution and release it once the import is done. If you...
Read more >The library is not thread-safe · Issue #106 · kjd/idna - GitHub
I imagine you can fix this for your application by calling idna.encode() once before the multiple threads are started, so the import will...
Read more >Thread-Safe Write to File in Python
example of writing to a file is not thread-safe. from random import random. from time import sleep. from threading import Thread.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I pushed this to the hotfix/0.5.32.8 branch, but I won’t be able to actually release it until after my holiday I suspect, at least not to PyPI.
I pushed to factory a commit that addresses the issue, let me know if it works for you:
http://nuitka.net/doc/factory.html