[issue20778] ModuleFinder.load_module skips incorrect number of bytes in pyc files

Bohuslav "Slavek" Kabrda report at bugs.python.org
Wed Feb 26 10:49:14 CET 2014


New submission from Bohuslav "Slavek" Kabrda:

ModuleFinder.load_module currently only skips 8 bytes before trying to marshal.load the rest of the file, but it should skip 12 since 3.3 (magic, date, file size). I'm attaching a patch with test case.

BTW this was very painful to find out, since I couldn't find any reference to written pyc files - am I searching wrong or is this really not documented anywhere?

(Note, that this was originally reported at https://bugzilla.redhat.com/show_bug.cgi?id=1060338).

----------
components: Library (Lib)
files: fix-bytes-skipped-in-load_module.patch
keywords: patch
messages: 212244
nosy: bkabrda
priority: normal
severity: normal
status: open
title: ModuleFinder.load_module skips incorrect number of bytes in pyc files
versions: Python 3.3, Python 3.4
Added file: http://bugs.python.org/file34226/fix-bytes-skipped-in-load_module.patch

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


More information about the Python-bugs-list mailing list