IndexError: tuple index out of range

Open
#329 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
28/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
python

Research direction

Reproduce the failure with the attached urls.pyc.txt and the shown uncompyle6 command. Start at uncompyle6/main.py's decompile flow, then inspect semantics/pysource.py and scanners/scanner2.py around the reported ingest call. Done means the attached Python 2.7 bytecode no longer raises IndexError and produces decompiler output.

Written by the indexing model from the issue text.

Description

Invalid Bytecode Questionable Activity

Hi,
I am a bunch of pyc to be decompiled to py. The pyc is compiled by python version 2.7. So i downloaded the python-2.4 branch and setup the same in my python 2.7 env.
Now when I run the uncompyle6, I am getting the below error.

D:\>uncompyle6 -d "D:\Biotion85\mysite\urls.pyc"
# 2020.09.24 21:19:39 Arabian Standard Time
# uncompyle6 version 3.7.4
# Python bytecode 2.7 (62211)
# Decompiled from: Python 2.7.15 (default, May  6 2018, 17:56:56) [MSC v.1500 64 bit (AMD64)]
# Embedded file name: G:\Packages\source\source_8.5.3\mysite\urls.py
# Compiled at: 2020-09-10 16:53:00
Traceback (most recent call last):
  File "C:\Program Files (x86)\Python27\Scripts\uncompyle6-script.py", line 11, in <module>
    load_entry_point('uncompyle6==3.7.4', 'console_scripts', 'uncompyle6')()
  File "build\bdist.win-amd64\egg\uncompyle6\bin\uncompile.py", line 190, in main_bin
  File "build\bdist.win-amd64\egg\uncompyle6\main.py", line 327, in main
  File "build\bdist.win-amd64\egg\uncompyle6\main.py", line 229, in decompile_file
  File "build\bdist.win-amd64\egg\uncompyle6\main.py", line 148, in decompile
  File "build\bdist.win-amd64\egg\uncompyle6\semantics\pysource.py", line 2574, in code_deparse
  File "build\bdist.win-amd64\egg\uncompyle6\scanners\scanner2.py", line 362, in ingest
IndexError: tuple index out of range

attaching the pyc file for your reference.
urls.pyc.txt

Please help.

Dominant language
Python
Stars
4.3k
Forks
463
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from rocky/python-uncompyle6

All issues in rocky/python-uncompyle6

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.