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.

Title: lib2to3 generation of pickle files is racy
Type: Stage: resolved
Components: 2to3 (2.x to 3.x conversion tool) Versions: Python 3.9, Python 3.8, Python 3.7, Python 3.6
Status: closed Resolution: wont fix
Dependencies: Superseder: Close 2to3 issues and list them here
View: 45544
Assigned To: Nosy List: barisione
Priority: normal Keywords:

Created on 2020-07-01 16:05 by barisione, last changed 2022-04-11 14:59 by admin. This issue is now closed.

File name Uploaded Description Edit barisione, 2020-07-01 16:05 Reproducer
Messages (1)
msg372760 - (view) Author: Marco Barisione (barisione) Date: 2020-07-01 16:05
The generation of pickle files in load_grammar in lib2to3/pgen2/ is racy as other processes may end up reading a half-written pickle file.

This is reproducible with the command line tool, but it's easier to reproduce by importing lib2to3. You just need different processes importing lib2to3 at the same time to make this happen, see the attached reproducer.

I tried with Python 3.9 for completeness and, while it happens there as well, it seems to be less frequent ony my computer than when using Python 3.6 (2% failure rate instead of 50% failure rate).
Date User Action Args
2022-04-11 14:59:33adminsetgithub: 85357
2021-10-20 22:53:44iritkatrielsetstatus: open -> closed
superseder: Close 2to3 issues and list them here
resolution: wont fix
stage: resolved
2020-07-01 16:05:44barisionecreate