[Python-Dev] Mysterious Python pyc file corruption problems

Barry Warsaw barry at python.org
Fri May 17 18:32:35 CEST 2013

On May 17, 2013, at 12:10 AM, Thomas Wouters wrote:

>The 'unknown type codes' can also be explained if the two processes writing
>to the .pyc files are *different Python versions*. As you may recall, at
>Google we used to use modified Python interpreters that used '.pyc-2.2',
>'.pyc-2.4', etc, for the pyc extension. That was because otherwise
>different Python versions would keep overwriting the .pyc files of shared
>Python modules, and "at Google scale" it caused all manner of problems... I
>guess Ubuntu is approaching Google scale ;-)

I'd like to think so. :)  But I don't think this is part of the equation.

For Python 2 on Debian/Ubuntu, we use an elaborate symlink farm to keep all
pyc files in Python-version-specific directories.  The stdlib files are
already segregated, but the symlink farm takes care of package installs.  Note
that the symlinks are to the .py files, not the pyc files.

Fortunately we almost don't care about this anymore.  We dropped 2.6 in Ubuntu
a while ago and we'll very likely drop 2.6 in Debian Jessie.  We don't care
about any Python 3s earlier than 3.2, and getting rid of the symlink farm was
the primary motivator for PEP 3147.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-dev/attachments/20130517/1bb2e53d/attachment.pgp>

More information about the Python-Dev mailing list