byte code generated under linux ==> bad magic number under

skip at pobox.com skip at pobox.com
Thu Sep 29 05:32:58 EDT 2005


    Fredrik> byte code is portable between platforms, but it's not portable
    Fredrik> between different major Python releases (2.4.2 can run 2.4.1
    Fredrik> bytecodes, but not 2.3 bytecodes, etc).

There is one slight problem with transporting .pyc files.  The generated
.pyc file records the absolute path to the .py file from which it was
generated.  If it is moved to a different filesystem -- even if the .py file
goes along for the ride -- tracebacks display an incorrect path and fail to
display the corresponding source line.

Skip



More information about the Python-list mailing list