Python 2.7 segfaults on 'import site'

Chris Angelico rosuav at gmail.com
Mon Dec 29 09:33:45 EST 2014


rosuav at sikorsky:~$ python -S
Python 2.7.3 (default, Mar 13 2014, 11:03:55)
[GCC 4.7.2] on linux2
>>>
rosuav at sikorsky:~$ python
Segmentation fault

This is the system Python on Debian Wheezy, and I haven't changed
site.py at all. This broke some time in the last few days, and I'm
trying to figure out why. (I have been fiddling with my python3, but
the system Python is untouched, as you can see from the above.)
Attempting to 'import site' manually causes the same segfault; things
get interesting if I create my own local site.py though:

rosuav at sikorsky:~/aaa$ touch site.py
rosuav at sikorsky:~/aaa$ python
Segmentation fault
rosuav at sikorsky:~/aaa$ python -S
Python 2.7.3 (default, Mar 13 2014, 11:03:55)
[GCC 4.7.2] on linux2
>>> import site
>>>

So clearly an empty 'site' can be imported safely, but running Python
without -S segfaults.

Can anyone advise as to where I should look for the cause of the trouble?

ChrisA



More information about the Python-list mailing list