This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author mark.dickinson
Recipients Jim.Jewett, benjamin.peterson, mark.dickinson, meador.inge, menegazzobr, terry.reedy
Date 2012-03-10.12:26:59
SpamBayes Score 7.716299e-06
Marked as misclassified No
Message-id <1331382420.32.0.703363205329.issue14169@psf.upfronthosting.co.za>
In-reply-to
Content
Interestingly, dis.dis also fails to decompile the .pyc bytecode generated by importing the file.  (This was after adding dummy AddUnit, MakeCustomaryToBase and MakeBaseToCustomary definitions to the top of the file to prevent the import raising an exception.)


>>> with open('small_with_error.pyc', 'r') as f:
...     bytecode = f.read()
... 
>>> bytecode = bytecode[8:]
>>> dis.dis(bytecode)

<... lots of output snipped ...>

       65686 LOAD_GLOBAL         4 (4)
       65689 STOP_CODE      
       65690 STOP_CODE      
       65691 POP_JUMP_IF_TRUE 27749
       65694 BUILD_TUPLE      1140
       65697 STOP_CODE      
       65698 STOP_CODE      
       65699 STOP_CODE      
       65700 STORE_GLOBAL    26482 (26482)
       65703 POP_JUMP_IF_TRUE  1652
       65706 STOP_CODE      
       65707 STOP_CODE      
       65708 STOP_CODE      
       65709 COMPARE_OP      24951
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Library/Frameworks/Python.framework/Versions/7.2/lib/python2.7/dis.py", line 45, in dis
    disassemble_string(x)
  File "/Library/Frameworks/Python.framework/Versions/7.2/lib/python2.7/dis.py", line 147, in disassemble_string
    print '(' + cmp_op[oparg] + ')',
IndexError: tuple index out of range
History
Date User Action Args
2012-03-10 12:27:00mark.dickinsonsetrecipients: + mark.dickinson, terry.reedy, benjamin.peterson, meador.inge, Jim.Jewett, menegazzobr
2012-03-10 12:27:00mark.dickinsonsetmessageid: <1331382420.32.0.703363205329.issue14169@psf.upfronthosting.co.za>
2012-03-10 12:26:59mark.dickinsonlinkissue14169 messages
2012-03-10 12:26:59mark.dickinsoncreate