rocky / python-uncompyle6

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

UnboundLocalError: local variable 'n' referenced before assignment #376

Closed krypton-byte closed 2 years ago

krypton-byte commented 2 years ago

Environment

Name: uncompyle6 Version: 3.8.0 Summary: Python cross-version byte-code decompiler Home-page: https://github.com/rocky/python-uncompyle6/ Author: Rocky Bernstein, Hartmut Goebel, John Aycock, and others Author-email: rb@dustyfeet.com License: GPL3 Location: /home/galaxyvplus6434/.local/lib/python2.7/site-packages Requires: spark-parser, xdis Required-by: uncompyle2

Distributor ID: Debian Description: Debian GNU/Linux 10 (buster) Release: 10 Codename: buster

Log

decompile('2.7', y, sys.stdout) File "/home/galaxyvplus6434/.local/lib/python2.7/site-packages/uncompyle6/main.py", line 149, in decompile co, out, bytecode_version, debug_opts=debug_opts, is_pypy=is_pypy File "/home/galaxyvplus6434/.local/lib/python2.7/site-packages/uncompyle6/semantics/pysource.py", line 2648, in code_deparse deparsed.gen_source(deparsed.ast, co.co_name, customize) File "/home/galaxyvplus6434/.local/lib/python2.7/site-packages/uncompyle6/semantics/pysource.py", line 2465, in gen_source self.text = self.traverse(ast, is_lambda=is_lambda) File "/home/galaxyvplus6434/.local/lib/python2.7/site-packages/uncompyle6/semantics/pysource.py", line 430, in traverse self.preorder(node) File "/home/galaxyvplus6434/.local/lib/python2.7/site-packages/uncompyle6/semantics/pysource.py", line 408, in preorder super(SourceWalker, self).preorder(node) File "/home/galaxyvplus6434/.local/lib/python2.7/site-packages/spark_parser/ast.py", line 117, in preorder self.preorder(kid) File "/home/galaxyvplus6434/.local/lib/python2.7/site-packages/uncompyle6/semantics/pysource.py", line 408, in preorder super(SourceWalker, self).preorder(node) File "/home/galaxyvplus6434/.local/lib/python2.7/site-packages/spark_parser/ast.py", line 110, in preorder func(node) File "/home/galaxyvplus6434/.local/lib/python2.7/site-packages/uncompyle6/semantics/pysource.py", line 728, in n_exec_stmt self.preorder(node[0]) File "/home/galaxyvplus6434/.local/lib/python2.7/site-packages/uncompyle6/semantics/pysource.py", line 408, in preorder super(SourceWalker, self).preorder(node) File "/home/galaxyvplus6434/.local/lib/python2.7/site-packages/spark_parser/ast.py", line 110, in preorder func(node) File "/home/galaxyvplus6434/.local/lib/python2.7/site-packages/uncompyle6/semantics/pysource.py", line 601, in n_expr self.preorder(node[0]) File "/home/galaxyvplus6434/.local/lib/python2.7/site-packages/uncompyle6/semantics/pysource.py", line 408, in preorder super(SourceWalker, self).preorder(node) File "/home/galaxyvplus6434/.local/lib/python2.7/site-packages/spark_parser/ast.py", line 112, in preorder self.default(node) File "/home/galaxyvplus6434/.local/lib/python2.7/site-packages/uncompyle6/semantics/pysource.py", line 2185, in default self.template_engine(table[key.kind], node) File "/home/galaxyvplus6434/.local/lib/python2.7/site-packages/uncompyle6/semantics/pysource.py", line 2145, in template_engine self.preorder(subnode) File "/home/galaxyvplus6434/.local/lib/python2.7/site-packages/uncompyle6/semantics/pysource.py", line 408, in preorder super(SourceWalker, self).preorder(node) File "/home/galaxyvplus6434/.local/lib/python2.7/site-packages/spark_parser/ast.py", line 110, in preorder func(node) File "/home/galaxyvplus6434/.local/lib/python2.7/site-packages/uncompyle6/semantics/pysource.py", line 601, in n_expr self.preorder(node[0]) File "/home/galaxyvplus6434/.local/lib/python2.7/site-packages/uncompyle6/semantics/pysource.py", line 408, in preorder super(SourceWalker, self).preorder(node) File "/home/galaxyvplus6434/.local/lib/python2.7/site-packages/spark_parser/ast.py", line 112, in preorder self.default(node) File "/home/galaxyvplus6434/.local/lib/python2.7/site-packages/uncompyle6/semantics/pysource.py", line 2185, in default self.template_engine(table[key.kind], node) File "/home/galaxyvplus6434/.local/lib/python2.7/site-packages/uncompyle6/semantics/pysource.py", line 2091, in template_engine self.preorder(node[index]) File "/home/galaxyvplus6434/.local/lib/python2.7/site-packages/uncompyle6/semantics/pysource.py", line 408, in preorder super(SourceWalker, self).preorder(node) File "/home/galaxyvplus6434/.local/lib/python2.7/site-packages/spark_parser/ast.py", line 110, in preorder func(node) File "/home/galaxyvplus6434/.local/lib/python2.7/site-packages/uncompyle6/semantics/pysource.py", line 601, in n_expr self.preorder(node[0]) File "/home/galaxyvplus6434/.local/lib/python2.7/site-packages/uncompyle6/semantics/pysource.py", line 408, in preorder super(SourceWalker, self).preorder(node) File "/home/galaxyvplus6434/.local/lib/python2.7/site-packages/spark_parser/ast.py", line 110, in preorder func(node) File "/home/galaxyvplus6434/.local/lib/python2.7/site-packages/uncompyle6/semantics/pysource.py", line 1984, in n_attribute self.default(node) File "/home/galaxyvplus6434/.local/lib/python2.7/site-packages/uncompyle6/semantics/pysource.py", line 2185, in default self.template_engine(table[key.kind], node) File "/home/galaxyvplus6434/.local/lib/python2.7/site-packages/uncompyle6/semantics/pysource.py", line 2091, in template_engine self.preorder(node[index]) File "/home/galaxyvplus6434/.local/lib/python2.7/site-packages/uncompyle6/semantics/pysource.py", line 408, in preorder super(SourceWalker, self).preorder(node) File "/home/galaxyvplus6434/.local/lib/python2.7/site-packages/spark_parser/ast.py", line 110, in preorder func(node) File "/home/galaxyvplus6434/.local/lib/python2.7/site-packages/uncompyle6/semantics/pysource.py", line 601, in n_expr self.preorder(node[0]) File "/home/galaxyvplus6434/.local/lib/python2.7/site-packages/uncompyle6/semantics/pysource.py", line 408, in preorder super(SourceWalker, self).preorder(node) File "/home/galaxyvplus6434/.local/lib/python2.7/site-packages/spark_parser/ast.py", line 112, in preorder self.default(node) File "/home/galaxyvplus6434/.local/lib/python2.7/site-packages/uncompyle6/semantics/pysource.py", line 2185, in default self.template_engine(table[key.kind], node) File "/home/galaxyvplus6434/.local/lib/python2.7/site-packages/uncompyle6/semantics/pysource.py", line 2145, in template_engine self.preorder(subnode) File "/home/galaxyvplus6434/.local/lib/python2.7/site-packages/uncompyle6/semantics/pysource.py", line 408, in preorder super(SourceWalker, self).preorder(node) File "/home/galaxyvplus6434/.local/lib/python2.7/site-packages/spark_parser/ast.py", line 110, in preorder func(node) File "/home/galaxyvplus6434/.local/lib/python2.7/site-packages/uncompyle6/semantics/pysource.py", line 601, in n_expr self.preorder(node[0]) File "/home/galaxyvplus6434/.local/lib/python2.7/site-packages/uncompyle6/semantics/pysource.py", line 408, in preorder super(SourceWalker, self).preorder(node) File "/home/galaxyvplus6434/.local/lib/python2.7/site-packages/spark_parser/ast.py", line 110, in preorder func(node) File "/home/galaxyvplus6434/.local/lib/python2.7/site-packages/uncompyle6/semantics/pysource.py", line 993, in n_list_comp assert n == "list_iter" UnboundLocalError: local variable 'n' referenced before assignment

rocky commented 2 years ago

Please read and follow https://github.com/rocky/python-uncompyle6/issues/new?assignees=&labels=&template=bug-report.md

rocky commented 2 years ago

Closed due to lack of interest