Author ned.deily
Recipients Arfrever, benjamin.peterson, georg.brandl, ned.deily, ronaldoussoren, tpievila
Date 2012-09-01.11:02:44
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1346497367.11.0.775460914943.issue15822@psf.upfronthosting.co.za>
In-reply-to
Content
The problem here is in the "libinstall" Makefile target and that hidden dependency within lib2to3 that, as Tomi notes, causes lib2to3 to try to recreate the pickles anytime it runs if it thinks they are out of date.  The fixes for Issue15645 cause the recipes for that target to create the two grammar pickles in the source Lib directory before files are copied and installed into the destination lib directories. But there is no guarantee that the source files, Grammar.txt and PatternGrammar.txt, are installed into the destination lib before the corresponding pickle files are.  lib2to3/pgen2/driver compares the value of os.path.getmtime() for the txt and pickle files (assuming both exist).  On many (most) file systems, the copies happen fast enough and the resolution of getmtime is coarse enough that the files are created with the same time value so post-installation use of lib2to3 works OK. But on file systems like ext4 with high-resolution time values, it may happen that one or both of the pickle files is copied first and ends up with a slightly older time value than its corresponding txt file.  In that case the first use of lib2to3 will try to recreate the pickle which will most likely fail with a file permission error since the install directories are typically read-only to non-root users.

The attached patch tries to work around around the problem by touching the two pickle files after they and all the other relevant lib files have been installed.

Since any user could run into this problem on the right configuration, I think the fix (assuming reviewers concur with it) should be cherry-picked for 3.3.0rc2.
History
Date User Action Args
2012-09-01 11:02:47ned.deilysetrecipients: + ned.deily, georg.brandl, ronaldoussoren, benjamin.peterson, Arfrever, tpievila
2012-09-01 11:02:47ned.deilysetmessageid: <1346497367.11.0.775460914943.issue15822@psf.upfronthosting.co.za>
2012-09-01 11:02:46ned.deilylinkissue15822 messages
2012-09-01 11:02:45ned.deilycreate