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 <>
Using attached importlib_sleep.patch, you can *see* the race condition with:

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

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/ is run twice instead of being run once. A lock is missing somewhere on the package module.
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: <>
2017-07-10 15:09:27vstinnerlinkissue30891 messages
2017-07-10 15:09:27vstinnercreate