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.

Author ncoghlan
Recipients doughellmann, eric.araujo, ncoghlan
Date 2010-10-31.15:15:14
SpamBayes Score 4.12949e-06
Marked as misclassified No
Message-id <1288538116.72.0.874687485494.issue10263@psf.upfronthosting.co.za>
In-reply-to
Content
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)
History
Date User Action Args
2010-10-31 15:15:16ncoghlansetrecipients: + ncoghlan, eric.araujo, doughellmann
2010-10-31 15:15:16ncoghlansetmessageid: <1288538116.72.0.874687485494.issue10263@psf.upfronthosting.co.za>
2010-10-31 15:15:15ncoghlanlinkissue10263 messages
2010-10-31 15:15:14ncoghlancreate