Author christian.heimes
Recipients benjamin.peterson, christian.heimes, ncoghlan
Date 2008-11-20.21:01:10
SpamBayes Score 7.52869e-08
Marked as misclassified No
Message-id <4925D015.4090102@cheimes.de>
In-reply-to <1227213803.93.0.803152779397.issue4082@psf.upfronthosting.co.za>
Content
Nick Coghlan wrote:
> Nick Coghlan <ncoghlan@gmail.com> added the comment:
> 
> So what could be different between my x86 system and your x86_64 system
> that it works for me and not for you?
> 
> Could you try doing "python -i -m site" and poke around in the main
> namespace (which is where the interactive session will start) a bit to
> see if anything looks strange? __file__, __package__ and __name__ are
> probably of particular interest.

That didn't help much

$ ./python -i -m site
 >>> __name__
'__main__'
 >>> __package__
''
 >>> __file__
 >>> __file__ is None
True

However a pdb session has revealed some interesting things including the 
reason for the "bug".

$ ./python -m site
 > 
/home/heimes/dev/python/release26-maint/Lib/runpy.py(103)_run_module_as_main()
-> try:
(Pdb) w
 > 
/home/heimes/dev/python/release26-maint/Lib/runpy.py(103)_run_module_as_main()
-> try:
(Pdb) p mod_name, set_argv0
('site', 1)
(Pdb) n
 > 
/home/heimes/dev/python/release26-maint/Lib/runpy.py(104)_run_module_as_main()
-> loader, code, fname = _get_module_details(mod_name)
(Pdb) n
 > 
/home/heimes/dev/python/release26-maint/Lib/runpy.py(117)_run_module_as_main()
-> pkg_name = mod_name.rpartition('.')[0]
(Pdb) p loader, code, fname
(<zipimporter object 
"/usr/local/lib/python2.6/site-packages/setuptools-0.6c9-py2.6.egg">, 
<code object <module> at 0x7fe765e95f30, file 
"build/bdist.linux-x86_64/egg/site.py", line 1>, None)
(Pdb) p code
<code object <module> at 0x7fe765e95f30, file 
"build/bdist.linux-x86_64/egg/site.py", line 1>

Solution for my issue:
$ sudo rm -rf /usr/local/lib/python2.6/site-packages/

Thanks for listening ... :/ I'm feeling embarrassed

Christian
History
Date User Action Args
2008-11-20 21:01:11christian.heimessetrecipients: + christian.heimes, ncoghlan, benjamin.peterson
2008-11-20 21:01:11christian.heimeslinkissue4082 messages
2008-11-20 21:01:10christian.heimescreate