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.

classification
Title: Lib2to3 fails with unreadable pickle file
Type: behavior Stage: resolved
Components: 2to3 (2.x to 3.x conversion tool) Versions: Python 3.7, Python 3.6, Python 3.3, Python 3.4, Python 3.5, Python 2.7
process
Status: closed Resolution: wont fix
Dependencies: Superseder: Close 2to3 issues and list them here
View: 45544
Assigned To: Nosy List: Jake Merdich
Priority: normal Keywords: patch

Created on 2017-04-18 23:57 by Jake Merdich, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
0001-Fallback-to-regenerating-2to3-grammars-on-read-fail.patch Jake Merdich, 2017-04-18 23:57
Messages (1)
msg291853 - (view) Author: Jake Merdich (Jake Merdich) * Date: 2017-04-18 23:57
There seem to have been a few issues in the past with creating the lib2to3 pickle files with the right permissions due to umask behavior (#15890). While I'm unaware of the status installer-level fixes have given, it seems prudent that the installed python should always function, given there is an obvious and trivial fallback (regenerating the grammar tables at runtime).

The current codebase will throw a PermissionDenied exception if the pickle file is unreadable, rather than fall back to generating the grammar tables. 

To reproduce:
 Install python2.6+, 3.0+
 chmod o-r $PYTHON_INSTALL/lib/pythonX.Y/lib2to3/*.pickle
 pythonX.Y -c "import lib2to3.pygram"

Notably, this sort of borked installation is quite hard to detect.... unless a user without root tries to run setuptools (*whistles*).
History
Date User Action Args
2022-04-11 14:58:45adminsetgithub: 74285
2021-10-20 22:51:05iritkatrielsetstatus: open -> closed
superseder: Close 2to3 issues and list them here
resolution: wont fix
stage: resolved
2017-04-18 23:57:59Jake Merdichcreate