[issue19219] speed up marshal.loads()

Antoine Pitrou report at bugs.python.org
Fri Oct 11 16:34:55 CEST 2013


Antoine Pitrou added the comment:

> I ran into this when developing version 3.  The reason is that while
> the marshal format includes the version information in its header,
> it isn't actually verified on loading. IIRC.  You specify the
> expected format to the function, or something like that.  So, if you
> don't do this, you get errors when loading previously generated .pyc
> files.

Exactly (I also tried this :-)). The problem is the version number
is *outside* of the marshal format: e.g. it's in the pyc file header.
When freezing a module (see frozen.c), the version number isn't included.
So our freedom is quite limited here: we have to support legacy frozen
modules.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue19219>
_______________________________________


More information about the Python-bugs-list mailing list