Issue 9663: importlib should exclusively open bytecode files (original) (raw)

Importlib does not use any OS-level protections to gain exclusivity when opening a file like import.c does through open_exclusive. It probably should, though, when writing bytecode else one might end up with corrupt code. That's bad as bad marshal data is a flat-out import failure and not simply glossed over.

Plus if I don't do this now I will just end up getting a bug report that test_multiprocessing is randomly failing on the buildbots because of this issue since that "precious" little test seems to love to ferret out concurrency issues in importlib.