Python 2.7 segfaults on 'import site'

Gregory Ewing greg.ewing at canterbury.ac.nz
Mon Dec 29 18:41:42 EST 2014


Chris Angelico wrote:
> On Tue, Dec 30, 2014 at 7:17 AM, Ian Kelly <ian.g.kelly at gmail.com> wrote:
> 
>>You could try renaming the .pyc instead of deleting it.
> 
> Hmm, and in doing so I just learned that they don't, after all, have
> any sort of timestamp in them - I thought they did.

I think it contains the timestamp of the .py file that
it was created from, to facilitate detecting when it's
out of date.

% python -c 'import foo'
% md5 foo.pyc
MD5 (foo.pyc) = 4082584f949c04d46300281492ddbd5d
% touch foo.py
% python -c 'import foo'
% md5 foo.pyc
MD5 (foo.pyc) = b3445bc53fafbfdaf73f3c3611acbd75

-- 
Greg



More information about the Python-list mailing list