Bug 678458 - Add detection of Python 3.2 bytecode
Summary: Add detection of Python 3.2 bytecode
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: file
Version: rawhide
Hardware: All
OS: Linux
unspecified
low
Target Milestone: ---
Assignee: Jan Kaluža
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-02-18 02:01 UTC by bouloumag
Modified: 2011-03-01 08:58 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-03-01 08:58:36 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description bouloumag 2011-02-18 02:01:58 UTC
Description of problem:

Please add detection of Python 3.2 bytecode for the .pyc/.pyo files. pyc files are detected as "data". 

Version-Release number of selected component (if applicable):


How reproducible:

# file something.pyo
# file something.pyc

Steps to Reproduce:
1.
2.
3.
  
Actual results:

type data

Expected results:

python files

Additional info:

Comment 1 Jan Kaluža 2011-02-23 12:45:47 UTC
If you have Python 3.2, could you please run following code and send me a output? it will show magic bytes used by pyc compiled in that Python version:

>>> import binascii, imp
>>> binascii.hexlify(imp.get_magic())

I don't have any Python 3.2 here and I want to be sure... Thanks.

Comment 2 bouloumag 2011-02-24 14:08:46 UTC
I have Python 3.2 :

>>> import binascii, imp
>>> >>> binascii.hexlify(imp.get_magic())
b'6c0c0d0a'

Comment 3 bouloumag 2011-02-25 01:41:06 UTC
Adding the following line to file-5.05/magic/Magdir/python works for me :

 belong          0x6c0c0d0a      python 3.2 byte-compiled

Comment 4 Jan Kaluža 2011-02-28 12:09:40 UTC
Thanks, I'll backport it soon.

Comment 5 Jan Kaluža 2011-03-01 08:58:36 UTC
Fixed in file-5.05-4.fc16.


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