rocky / python-decompile3

Python decompiler for 3.7-3.8 Stripped down from uncompyle6 so we can refactor and start to fix up some long-standing problems
GNU General Public License v3.0
1.12k stars 155 forks source link

TypeError: __new__() got an unexpected keyword argument 'positions' #166

Open Xcating opened 9 months ago

Xcating commented 9 months ago

Description

run the

decompyle3 pvzrouge.pyc

TypeError: new() got an unexpected keyword argument 'positions'

How to Reproduce

decompyle3 pvzrouge.pyc

PVZ-Rouge.zip

pvzrouge.zip

Output Given

# decompyle3 version 3.9.1.dev0
# Python bytecode version base 3.8.0 (3413)
# Decompiled from: Python 3.8.0 (tags/v3.8.0:fa919fd, Oct 14 2019, 19:21:23) [MSC v.1916 32 bit (Intel)]
# Embedded file name: pvzrouge.py
Traceback (most recent call last):
  File "E:\Python308\Scripts\decompyle3-script.py", line 11, in <module>
    load_entry_point('decompyle3==3.9.1.dev0', 'console_scripts', 'decompyle3')()
  File "E:\Python308\lib\site-packages\click\core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
  File "E:\Python308\lib\site-packages\click\core.py", line 1078, in main
    rv = self.invoke(ctx)
  File "E:\Python308\lib\site-packages\click\core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "E:\Python308\lib\site-packages\click\core.py", line 783, in invoke
    return __callback(*args, **kwargs)
  File "E:\Python308\lib\site-packages\decompyle3-3.9.1.dev0-py3.8.egg\decompyle3\bin\decompile.py", line 166, in main_bin
  File "E:\Python308\lib\site-packages\decompyle3-3.9.1.dev0-py3.8.egg\decompyle3\main.py", line 336, in main
  File "E:\Python308\lib\site-packages\decompyle3-3.9.1.dev0-py3.8.egg\decompyle3\main.py", line 239, in decompile_file
  File "E:\Python308\lib\site-packages\decompyle3-3.9.1.dev0-py3.8.egg\decompyle3\main.py", line 159, in decompile
  File "E:\Python308\lib\site-packages\decompyle3-3.9.1.dev0-py3.8.egg\decompyle3\semantics\pysource.py", line 1121, in code_deparse
  File "E:\Python308\lib\site-packages\decompyle3-3.9.1.dev0-py3.8.egg\decompyle3\scanners\scanner38.py", line 67, in ingest
  File "E:\Python308\lib\site-packages\decompyle3-3.9.1.dev0-py3.8.egg\decompyle3\scanners\scanner37.py", line 65, in ingest
  File "E:\Python308\lib\site-packages\decompyle3-3.9.1.dev0-py3.8.egg\decompyle3\scanners\scanner37base.py", line 373, in ingest
TypeError: __new__() got an unexpected keyword argument 'positions'

Expected behavior

Successfully output pvzrooge.py

Environment

decompyle3, version 3.9.1.dev0 (github latest version) (use setup.py installed) Python 3.8.0 Windows 11 PIP LIST

Package      Version
------------ -------
click        8.1.7
colorama     0.4.6
decompyle3 3.9.1.dev0   3.9.0
pip          19.2.3
setuptools   41.2.0
six          1.16.0
spark-parser 1.8.9
uncompyle6   3.9.0
xdis         6.0.5
rocky commented 8 months ago

When I try decompiling, I am not seeing that particular error, although the bytecode does not decompiler. I suspect that message is related to a memory allocation problem.

The bytecode for this is very large and probably auto-generated by a program. It seems like the bytecode to some sort of game, right?

While this is a legitimate bug, it is not in the form that can be easily isolated to make it easy to fix. It would help to have the smallest case that exhibits the problem. Doing that may be a fair amount of work for someone to undertake.

In other words, this would be tedious work to fix as this code stands. It may eventually get fixed, through a different bug report or by someone doing work to pinpoint the problem more.