rocky / python-uncompyle6

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

Python 3.7.9 TypeError :not all arguments converted during string formatting #404

Closed YuATools closed 2 years ago

YuATools commented 2 years ago

I am a Python beginner and decided to learn by looking at existing code. I attempted to solve the problem myself, but could not even figure out what was wrong.

Win10 Pro Python 3.7.9

Full error code:


  File "c:\users\sakurama\pyenv\py37env\lib\site-packages\xdis\opcodes\base.py", line 209, in opcode_check
    assert all(item in opmap.items() for item in l['opmap'].items())
AssertionError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\Sakurama\pyenv\py37env\Scripts\uncompyle6-script.py", line 11, in <module>
    load_entry_point('uncompyle6==2.11.5', 'console_scripts', 'uncompyle6')()
  File "c:\users\sakurama\pyenv\py37env\lib\site-packages\pkg_resources\__init__.py", line 490, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "c:\users\sakurama\pyenv\py37env\lib\site-packages\pkg_resources\__init__.py", line 2862, in load_entry_point
    return ep.load()
  File "c:\users\sakurama\pyenv\py37env\lib\site-packages\pkg_resources\__init__.py", line 2462, in load
    return self.resolve()
  File "c:\users\sakurama\pyenv\py37env\lib\site-packages\pkg_resources\__init__.py", line 2468, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "c:\users\sakurama\pyenv\py37env\lib\site-packages\uncompyle6\__init__.py", line 52, in <module>
    from uncompyle6.main import decompile_file
  File "c:\users\sakurama\pyenv\py37env\lib\site-packages\uncompyle6\main.py", line 6, in <module>
    from uncompyle6.disas import check_object_path
  File "c:\users\sakurama\pyenv\py37env\lib\site-packages\uncompyle6\disas.py", line 26, in <module>
    from xdis.main import disassemble_file as xdisassemble_file
  File "c:\users\sakurama\pyenv\py37env\lib\site-packages\xdis\main.py", line 30, in <module>
    from xdis.op_imports import op_imports
  File "c:\users\sakurama\pyenv\py37env\lib\site-packages\xdis\op_imports.py", line 22, in <module>
    from xdis.opcodes import opcode_37 as opcode_37
  File "c:\users\sakurama\pyenv\py37env\lib\site-packages\xdis\opcodes\opcode_37.py", line 112, in <module>
    finalize_opcodes(l)
  File "c:\users\sakurama\pyenv\py37env\lib\site-packages\xdis\opcodes\base.py", line 147, in finalize_opcodes
    opcode_check(l)
  File "c:\users\sakurama\pyenv\py37env\lib\site-packages\xdis\opcodes\base.py", line 214, in opcode_check
    sys.version_info)
TypeError: not all arguments converted during string formatting```
rocky commented 2 years ago

As "Python beginner" or beginning anything, you it would be good to read and follow instructions first before looking at existing code. The same thing is true for opening an issue.

Please read https://github.com/rocky/python-uncompyle6/issues/new?assignees=&labels=&template=bug-report.md and http://www.catb.org/~esr/faqs/smart-questions.html which is mentioned and linked in https://github.com/rocky/python-uncompyle6/blob/master/HOW-TO-REPORT-A-BUG.md

Follow the instructions there.