Message143610
For what it's worth, the need for a bootstrap-module has also come up within Google, where we have... somewhat different requirements than most. In order to fix import paths in a way that works even when using "python -S", I had a need to patch the very first module that gets imported. Unfortunately the actual first module that gets imported depends on the arguments passed to Python. So, I wrote the attached stdlib_landmark.diff patch, which makes a 'stdlib_landmark.py' file that is both the stdlib landmark (used by Python to find the stdlib itself, currently 'os.py') *and* the very first module that is imported, always.
(The 'stdlib_landmark' name may be a little clunky; a better name, mirroring sitecustomize, may be "stdlibcustomize" or such.)
And yes, this could have been fixed in other ways. I could've patched the interpreter directly, or made Python understand symlinks to .py/.pyc files better, or tried to make a bunch of other tools work better with symlinks. This has turned out the most convenient solution for a number of reasons, though. |
|
Date |
User |
Action |
Args |
2011-09-06 15:00:14 | twouters | set | recipients:
+ twouters, brett.cannon, ncoghlan, nedbat, ezio.melotti, eric.araujo, sandro.tosi, brandon-rhodes, eric.snow |
2011-09-06 15:00:14 | twouters | set | messageid: <1315321214.18.0.128892713458.issue11561@psf.upfronthosting.co.za> |
2011-09-06 15:00:13 | twouters | link | issue11561 messages |
2011-09-06 15:00:13 | twouters | create | |
|