Thomas Wouters <tho...@python.org> added the comment:

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.

----------
nosy: +twouters
Added file: http://bugs.python.org/file23107/stdlib_landmark.diff

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue11561>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to