Bug 672352

Summary: Incorrect python bytecode value for python 3.2
Product: [Fedora] Fedora Reporter: Dave Malcolm <dmalcolm>
Component: rpmlintAssignee: Tom "spot" Callaway <tcallawa>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: a.badger, manuel.wolfshant, tcallawa, tmz, ville.skytta
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-04-07 00:11:30 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Dave Malcolm 2011-01-24 22:10:06 UTC
Description of problem:

Running:
  rpmlint python3
on rawhide, I get numerous:
  python-bytecode-wrong-magic-value
errors of the form:
  python3-libs.x86_64: E: python-bytecode-wrong-magic-value /usr/lib64/python3.2/dbm/__pycache__/gnu.cpython-32.pyc expected 3160 (3.2), found 3180 (unknown)

rpmlint's FilesCheck.py:_python_magic_values  has:
    '3.1': 3150,
    '3.2': 3160,
    }

However, that seems to reflect 3.2a0.  The comment in the latest version of Python 3.2 (3.2rc1) has this comment in Python/import.c:
       Python 3.2a0: 3160 (add SETUP_WITH)
                     tag: cpython-32
       Python 3.2a1: 3170 (add DUP_TOP_TWO, remove DUP_TOPX and ROT_FOUR)
                     tag: cpython-32
       Python 3.2a2  3180 (add DELETE_DEREF)

So I believe that the '3.2' entry needs to be 3180 instead.

Looking at a sample file, I see:
  $ hexdump -C /usr/lib64/python3.2/urllib/__pycache__/__init__.cpython-32.pyc | head -n 1
  00000000  6c 0c 0d 0a f0 e5 a3 4b  63 00 00 00 00 00 00 00  |l......Kc.......|

where the first four bytes:
  0x6c 0x0c 0x0d 0x0a
and 0x0c6c is inddeed 3180.


Version-Release number of selected component (if applicable):
  rpmlint-1.0-3.fc15.noarch
  python3-3.2-0.6.b2.fc15.src.rpm



How reproducible:
100%

Comment 1 Dave Malcolm 2011-01-24 22:12:08 UTC
For reference, history of that file in the py3k branch is here:
  http://svn.python.org/view/python/branches/py3k/Python/import.c

and the last relevant change there was:
  http://svn.python.org/view?view=rev&revision=84686

Comment 3 Dave Malcolm 2011-04-07 00:11:30 UTC
Thanks!

rpmlint-1.1.tar.xz contains the fix, and I see that that version is in rawhide, and in the latest F15 version (rpmlint-1.1-3.fc15.src.rpm).

Closing this bug out