Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Decompiling Python2.7 list literal produces indices instead of values

Closed
#527 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
65/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
python

Research direction

Reproduce the issue using the provided r.py, Python 2.7.18, py_compile, and the uncompyle6 command, then inspect the Python 2.7 list-literal decompilation path. Compare the generated list with the constants in r.pyc and add coverage showing that [239, 168, 254, 54, 235, 128] is preserved rather than emitted as indices.

Written by the indexing model from the issue text.

Description

Description

Decompiling Python2.7 list literal produces indices instead of values

How to Reproduce

$ printf 'x = 1\nL = [239, 168, 254, 54, 235, 128]\n' > r.py
$ python2 -c "import py_compile; py_compile.compile('r.py')"
$ uncompyle6 r.pyc
# uncompyle6 version 3.9.3
# Python bytecode version base 2.7 (62211)
# Decompiled from: Python 3.13.15 (main, Aug 12 2026, 10:32:31) [GCC 16.2.0]
# Embedded file name: r.py
# Compiled at: 2026-09-30 13:48:38
x = 1
L = [1, 2, 3, 4, 5, 6]
return

# okay decompiling r.pyc

Expected behavior

L = [239, 168, 254, 54, 235, 128]

Environment

uncompyle6, version 3.9.3
pydisasm, version 6.1.7
Python 2.7.18

Priority

It is a silent failure which can cost extra developer time.

Additional Context

Dominant language
Python
Stars
4.3k
Forks
465
Avg merge
4d 11h
Merged PRs (30d)
3

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

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.