Bug 672352 - Incorrect python bytecode value for python 3.2
Summary: Incorrect python bytecode value for python 3.2
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: rpmlint
Version: rawhide
Hardware: Unspecified
OS: Linux
unspecified
unspecified
Target Milestone: ---
Assignee: Tom "spot" Callaway
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-01-24 22:10 UTC by Dave Malcolm
Modified: 2011-04-07 00:11 UTC (History)
5 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2011-04-07 00:11:30 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

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


Note You need to log in before you can comment on or make changes to this bug.