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 Guide.

Author vstinner
Recipients brett.cannon, eric.snow, ncoghlan, paul.moore, serhiy.storchaka, steve.dower, tim.golden, vstinner, zach.ware
Date 2017-07-10.15:09:27
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1499699367.15.0.953713520885.issue30891@psf.upfronthosting.co.za>
In-reply-to
Content
Using attached importlib_sleep.patch, you can *see* the race condition with:

diff --git a/Lib/test/test_import/data/package/__init__.py b/Lib/test/test_import/data/package/__init__.py
index a4f2bc3..f07eb11 100644
--- a/Lib/test/test_import/data/package/__init__.py
+++ b/Lib/test/test_import/data/package/__init__.py
@@ -1,2 +1,3 @@
 import package.submodule
+print("package: id=%#x" % id(package))
 package.submodule


Example of output:
---
haypo@selma$ ./python -m test -m test_concurrency -v test_import
package: id=0x7fb497400d58
package: id=0x7fb49744d458
test test_import failed -- (...)
---

Lib/test/test_import/data/package/__init__.py is run twice instead of being run once. A lock is missing somewhere on the package module.
History
Date User Action Args
2017-07-10 15:09:27vstinnersetrecipients: + vstinner, brett.cannon, paul.moore, ncoghlan, tim.golden, eric.snow, zach.ware, serhiy.storchaka, steve.dower
2017-07-10 15:09:27vstinnersetmessageid: <1499699367.15.0.953713520885.issue30891@psf.upfronthosting.co.za>
2017-07-10 15:09:27vstinnerlinkissue30891 messages
2017-07-10 15:09:27vstinnercreate