rocky / python-uncompyle6

A cross-version Python bytecode decompiler
GNU General Public License v3.0
3.79k stars 413 forks source link

Error' in python 3.8.2 version #308

Closed Datez-Kun closed 4 years ago

Datez-Kun commented 4 years ago

I get this kind of problem when I run it, does this not work in the latest version of python right now? I tried it in python version 3.8.2

Python 3.8.2 (default, Mar  3 2020, 17:16:15)
[Clang 8.0.7 (https://android.googlesource.com/toolchain/clang b55f2d4ebfd35bf6 on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import uncompyle6
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/data/data/com.termux/files/home/python-uncompyle6/uncompyle6/__init__.py", line 48, in <module>
    import uncompyle6.semantics.pysource
  File "/data/data/com.termux/files/home/python-uncompyle6/uncompyle6/semantics/pysource.py", line 136, in <module>
    from uncompyle6.parsers.treenode import SyntaxTree
  File "/data/data/com.termux/files/home/python-uncompyle6/uncompyle6/parsers/treenode.py", line 3, in <module>
    from uncompyle6.scanners.tok import NoneToken
  File "/data/data/com.termux/files/home/python-uncompyle6/uncompyle6/scanners/tok.py", line 193, in <module>
    NoneToken = Token("LOAD_CONST", offset=-1, attr=None, pattr=None)
  File "/data/data/com.termux/files/home/python-uncompyle6/uncompyle6/scanners/tok.py", line 86, in __init__
    from xdis.std import _std_api
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 655, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 618, in _load_backward_compatible
  File "<frozen zipimport>", line 259, in load_module
  File "/data/data/com.termux/files/usr/lib/python3.8/site-packages/xdis-4.2.2-py3.8.egg/xdis/std.py", line 214, in <module>
  File "/data/data/com.termux/files/usr/lib/python3.8/site-packages/xdis-4.2.2-py3.8.egg/xdis/std.py", line 212, in make_std_api
  File "/data/data/com.termux/files/usr/lib/python3.8/site-packages/xdis-4.2.2-py3.8.egg/xdis/std.py", line 72, in __init__
  File "/data/data/com.termux/files/usr/lib/python3.8/site-packages/xdis-4.2.2-py3.8.egg/xdis/op_imports.py", line 162, in get_opcode_module
KeyError: '3.8.2'
>>>
rocky commented 4 years ago

Python 3.8.2 is a little new and I haven't told xdis about this version yet.

If you are a hacker it is pretty easy to clone that repo and add the 3.8.2 key and install the result

Be warned though that 3.7 and 3,8 support is a bit lacking right now. I am working on solidifying things in https://github.com/rocky/python-decompile3

If you not a Python hacker, just wait, and at some point I'll release a new xdis which notes there is a version 3.8.2 now.

Datez-Kun commented 4 years ago

Python 3.8.2 is a little new and I haven't told xdis about this version yet.

If you are a hacker it is pretty easy to clone that repo and add the 3.8.2 key and install the result

Be warned though that 3.7 and 3,8 support is a bit lacking right now. I am working on solidifying things in https://github.com/rocky/python-decompile3

If you not a Python hacker, just wait, and at some point I'll release a new xdis which notes there is a version 3.8.2 now.

where do I add the key 3.8.2, when I add

'3.8': opcode_38,
3.8: opcode_38
'3.8.2': opcode_38

in the op_imports.py file and then reinstalling, it didn't work at all

I will wait, please fix it immediately