cnfatal / rpycdec

Tools to decompile renpy .rpyc .rpymc files.
https://pypi.org/project/rpycdec
MIT License
14 stars 3 forks source link

AttributeError: 'NoneType' object has no attribute 'get_code' #9

Closed D0n-A closed 5 months ago

D0n-A commented 5 months ago

Hello again!

My configuration is as follows:

  1. Windows 11 23H3;
  2. Python 3.11.7;
  3. RPYC was compiled on RenPy 7.4.11.2266.

After a update, unfortunately, a lot of files give out similar errors (01.rpyc):

D:\342321342>rpycdec D:\342321342
ERROR:rpycdec.decompile:decode file D:\342321342\01.rpyc failed: 'NoneType' object has no attribute 'get_code'
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "C:\Python\Scripts\rpycdec.exe\__main__.py", line 7, in <module>
  File "C:\Python\Lib\site-packages\rpycdec\cli.py", line 23, in main
    decompile(src)
  File "C:\Python\Lib\site-packages\rpycdec\decompile.py", line 48, in decompile
    decompile_file(
  File "C:\Python\Lib\site-packages\rpycdec\decompile.py", line 26, in decompile_file
    raise e
  File "C:\Python\Lib\site-packages\rpycdec\decompile.py", line 23, in decompile_file
    code = renpy.util.get_code(stmt)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python\Lib\site-packages\renpy\util.py", line 102, in get_code
    rv.append(get_code(item, **kwargs))
              ^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python\Lib\site-packages\renpy\util.py", line 109, in get_code
    return node.get_code(**kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python\Lib\site-packages\renpy\ast.py", line 188, in get_code
    rv.append(util.indent(f"{util.get_code(self.block, **kwargs)}"))
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python\Lib\site-packages\renpy\util.py", line 102, in get_code
    rv.append(get_code(item, **kwargs))
              ^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python\Lib\site-packages\renpy\util.py", line 109, in get_code
    return node.get_code(**kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python\Lib\site-packages\renpy\ast.py", line 489, in get_code
    start += f"{util.get_code(argument,**kwargs)}"
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python\Lib\site-packages\renpy\util.py", line 109, in get_code
    return node.get_code(**kwargs)
           ^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'get_code'

And (02.rpyc)...

D:\342321342>rpycdec D:\342321342
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "C:\Python\Scripts\rpycdec.exe\__main__.py", line 7, in <module>
  File "C:\Python\Lib\site-packages\rpycdec\cli.py", line 23, in main
    decompile(src)
  File "C:\Python\Lib\site-packages\rpycdec\decompile.py", line 48, in decompile
    decompile_file(
  File "C:\Python\Lib\site-packages\rpycdec\decompile.py", line 21, in decompile_file
    stmt = stmts.load_file(input_file)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python\Lib\site-packages\rpycdec\stmts.py", line 107, in load_file
    return load(file)
           ^^^^^^^^^^
  File "C:\Python\Lib\site-packages\rpycdec\stmts.py", line 91, in load
    _, stmts = pickle.loads(bindata)
               ^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'Say' object has no attribute 'statement_start'

And here's and rpyc itself:

Thank you in advance again!

cnfatal commented 5 months ago

Hi, try the latest code once more.

D0n-A commented 5 months ago

Everything is working fine now. Thanks again!