[Python-Dev] PEP: per user site-packages directory

Christian Heimes lists at cheimes.de
Sun Jan 13 20:12:43 CET 2008


Gregory P. Smith wrote:
>> I also tried to check if os.stat(__main__.__file__).st_uid ==
>> os.getuid() but the real __main__ is not available in site.py. It's
>> loaded and assigned much later.
> 
> Is sys.argv[0] available at that point?


No, it's not available, too. The 'site' module is imported by
Py_Initialize(). sys.argv and the real __main__ module are set much
later in Modules/main.c.

Christian


More information about the Python-Dev mailing list