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 Guido.van.Rossum, eryksun, jkloth, pablogsal, paul.moore, shreyanavigyan, steve.dower, tim.golden, tim.peters, vstinner, zach.ware
Date 2021-04-30.12:03:50
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1619784230.45.0.495083800472.issue37387@roundup.psfhosted.org>
In-reply-to
Content
I proposed a way to fix the issue:

"Maybe the test should copy all .py files of the stdlib into a temporary directory and work there, to not impact other tests run in parallel."


Shreyan Avigyan:
> Though I've never been able to reproduce this test failure. Maybe it's fixed (maybe it was a side effect of another test)?

It's a race condition. It's hard to reproduce in a reliable way, but I'm sure that it has not been fixed.

The bug happens when one process tries to recreate the .pyc, whereas another process has the old .pyc file open. You can maybe make the issue more likely by adding a sleep in the code reading pyc content.

For example, in the FileLoader.get_data() method of importlib._bootstrap_external. Hacking importlib is non trivial, since the Python code is compiled as a frozen module.
History
Date User Action Args
2021-04-30 12:03:50vstinnersetrecipients: + vstinner, tim.peters, paul.moore, tim.golden, jkloth, zach.ware, eryksun, steve.dower, Guido.van.Rossum, pablogsal, shreyanavigyan
2021-04-30 12:03:50vstinnersetmessageid: <1619784230.45.0.495083800472.issue37387@roundup.psfhosted.org>
2021-04-30 12:03:50vstinnerlinkissue37387 messages
2021-04-30 12:03:50vstinnercreate