-
-
Notifications
You must be signed in to change notification settings - Fork 210
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ImportError in multithreaded context with cx_Logging [works with Python 3.10] #1632
Comments
I tested w/ py 3.8.10 and confirm. and its works.
|
Can you test with the latest version of cx_Freeze and cx_Logging 3.1? |
Can I close this issue? |
Sorry for the delay on getting back to this. I tested with Python 3.8.10, cx_Freeze 6.15.3, and cx_Logging 3.1.0 and I am still getting the issue. |
Can you test with Python 3.10? |
Tested with Python 3.10.11 and I no longer get the issue. |
I discovered that if you put a |
Describe the bug
"Just in time" imports using the form
from foo import bar
intermittently fail with anImportError
. When running the Python scripts directly the imports always succeed.The behavior shows up when two or more threads are attempting to import a given module at the same time. In order for the bug to manifest itself, the following must be true:
cx_Logging
before attempting to import the module.cProfile
orpstats
. It likely isn't constrained to just these modules, but in the scenario in which I encountered the bug, these imports were involved.To Reproduce
main.py
module.py
Freeze Command
Sample Output
Round 1 shows that the initial attempt to import the module fails for one of the threads. Round 2 shows that the import succeeds for all threads after the module was initially loaded.
Expected behavior
As is the case when running the Python scripts directly, the imports should succeed.
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: