Nick Coghlan <ncogh...@gmail.com> added the comment:

Note also that site.py runs twice when used with -m: once implicitly during 
interpreter startup, and a second time as the main module. Due to the way the 
interpreter starts up and figures out sys.path, it is possible for the implicit 
import to pick up the correct version, but for the explicit invocation to find 
an old version.

With my site.py patched to include a "print __name__" line, I get the following:

$ ./python -m site
site
__main__
sys.path = [
  <details cut>
]
USER_BASE: <details cut> (exists)
USER_SITE: <details cut> (exists)
ENABLE_USER_SITE: True

The fact that you're only seeing one printout suggests to me that this is 
exactly the problem you're running into. The easiest way to confirm that is to 
run "python Lib/site.py" explicitly rather than via -m. That way you aren't 
relying on the second import working correctly (and I'm assuming you want to 
run this because you have doubts as to the correctness of the contents of your 
sys.path)

----------

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

Reply via email to