Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error decompile screens.rpyc from girls loveline #237

Open
KennedyMcMillan opened this issue Aug 14, 2024 · 6 comments
Open

Error decompile screens.rpyc from girls loveline #237

KennedyMcMillan opened this issue Aug 14, 2024 · 6 comments

Comments

@KennedyMcMillan
Copy link

KennedyMcMillan commented Aug 14, 2024

I got the following error from this vn: https://joonery.itch.io/girls-loveline

Decompiling screens.rpyc to screens.rpy...
Error while decompiling screens.rpyc:
Traceback (most recent call last):
File "unrpyc.py", line 211, in worker
try_harder=args.try_harder, sl_custom_names=args.sl_custom_names)
File "unrpyc.py", line 148, in decompile_rpyc
decompiler.pprint(out_file, ast, options)
File "/home/christopher/Desktop/Ren'Py_SDK's/unrpyc_renpy_6-7/decompiler/init.py", line 57, in pprint
Decompiler(out_file, options).dump(ast)
File "/home/christopher/Desktop/Ren'Py_SDK's/unrpyc_renpy_6-7/decompiler/init.py", line 121, in dump
super(Decompiler, self).dump(ast, skip_indent_until_write=True)
File "/home/christopher/Desktop/Ren'Py_SDK's/unrpyc_renpy_6-7/decompiler/util.py", line 70, in dump
self.print_nodes(ast)
File "/home/christopher/Desktop/Ren'Py_SDK's/unrpyc_renpy_6-7/decompiler/util.py", line 161, in print_nodes
self.print_node(node)
File "/home/christopher/Desktop/Ren'Py_SDK's/unrpyc_renpy_6-7/decompiler/init.py", line 134, in print_node
self.dispatch.get(type(ast), type(self).print_unknown)(self, ast)
File "/home/christopher/Desktop/Ren'Py_SDK's/unrpyc_renpy_6-7/decompiler/init.py", line 529, in print_init
self.print_nodes(ast.block)
File "/home/christopher/Desktop/Ren'Py_SDK's/unrpyc_renpy_6-7/decompiler/util.py", line 161, in print_nodes
self.print_node(node)
File "/home/christopher/Desktop/Ren'Py_SDK's/unrpyc_renpy_6-7/decompiler/init.py", line 134, in print_node
self.dispatch.get(type(ast), type(self).print_unknown)(self, ast)
File "/home/christopher/Desktop/Ren'Py_SDK's/unrpyc_renpy_6-7/decompiler/init.py", line 841, in print_screen
self.indent_level, self.linenumber, self.skip_indent_until_write
File "/home/christopher/Desktop/Ren'Py_SDK's/unrpyc_renpy_6-7/decompiler/sl2decompiler.py", line 41, in pprint
ast, indent_level, linenumber, skip_indent_until_write)
File "/home/christopher/Desktop/Ren'Py_SDK's/unrpyc_renpy_6-7/decompiler/util.py", line 70, in dump
self.print_nodes(ast)
File "/home/christopher/Desktop/Ren'Py_SDK's/unrpyc_renpy_6-7/decompiler/util.py", line 161, in print_nodes
self.print_node(node)
File "/home/christopher/Desktop/Ren'Py_SDK's/unrpyc_renpy_6-7/decompiler/sl2decompiler.py", line 59, in print_node
self.dispatch.get(type(ast), type(self).print_unknown)(self, ast)
File "/home/christopher/Desktop/Ren'Py_SDK's/unrpyc_renpy_6-7/decompiler/sl2decompiler.py", line 79, in print_screen
self.print_keyword_or_child(line)
File "/home/christopher/Desktop/Ren'Py_SDK's/unrpyc_renpy_6-7/decompiler/sl2decompiler.py", line 569, in print_keyword_or_child
self.print_node(item[2])
File "/home/christopher/Desktop/Ren'Py_SDK's/unrpyc_renpy_6-7/decompiler/sl2decompiler.py", line 59, in print_node
self.dispatch.get(type(ast), type(self).print_unknown)(self, ast)
File "/home/christopher/Desktop/Ren'Py_SDK's/unrpyc_renpy_6-7/decompiler/sl2decompiler.py", line 292, in print_displayable
self.print_keyword_or_child(line)
File "/home/christopher/Desktop/Ren'Py_SDK's/unrpyc_renpy_6-7/decompiler/sl2decompiler.py", line 569, in print_keyword_or_child
self.print_node(item[2])
File "/home/christopher/Desktop/Ren'Py_SDK's/unrpyc_renpy_6-7/decompiler/sl2decompiler.py", line 59, in print_node
self.dispatch.get(type(ast), type(self).print_unknown)(self, ast)
File "/home/christopher/Desktop/Ren'Py_SDK's/unrpyc_renpy_6-7/decompiler/sl2decompiler.py", line 292, in print_displayable
self.print_keyword_or_child(line)
File "/home/christopher/Desktop/Ren'Py_SDK's/unrpyc_renpy_6-7/decompiler/sl2decompiler.py", line 569, in print_keyword_or_child
self.print_node(item[2])
File "/home/christopher/Desktop/Ren'Py_SDK's/unrpyc_renpy_6-7/decompiler/sl2decompiler.py", line 59, in print_node
self.dispatch.get(type(ast), type(self).print_unknown)(self, ast)
File "/home/christopher/Desktop/Ren'Py_SDK's/unrpyc_renpy_6-7/decompiler/sl2decompiler.py", line 262, in print_displayable
ast.children[0].location[1] > ast.keyword[-1][1].linenumber) and
AttributeError: 'NoneType' object has no attribute 'linenumber'

Have any ideas? I using unrpyc-legacy 6-7
VN written on Ren'Py SDK 7.4.6
P.S. I can leave a link to GDrive with this file
P.P.S Thank you in advance!

@KennedyMcMillan KennedyMcMillan changed the title Error decompile screens.rpyc from girl loveline Error decompile screens.rpyc from girls loveline Aug 14, 2024
@CensoredUsername
Copy link
Owner

That looks like a proper bug.

It's in a pretty hairy part of the code, so I'd appreciate if you could send me the file!

Thanks!

@KennedyMcMillan
Copy link
Author

That looks like a proper bug.

It's in a pretty hairy part of the code, so I'd appreciate if you could send me the file!

Thanks!

No problem, take it: https://drive.google.com/file/d/1KEt8VJ6RobVRzfFgK_J4eaZZODnJX18I/view?usp=drive_link

@CensoredUsername
Copy link
Owner

I've found the issue, and implemented an initial fix for it on the dev branch. It'll need to be backported to legacy, but during my testing this file decompiled fine with unrpyc v2 so you can use that for now for this file.

@KennedyMcMillan
Copy link
Author

KennedyMcMillan commented Aug 16, 2024

I've found the issue, and implemented an initial fix for it on the dev branch. It'll need to be backported to legacy, but during my testing this file decompiled fine with unrpyc v2 so you can use that for now for this file.

Wonderful! Thanks for this fix!

@CensoredUsername
Copy link
Owner

CensoredUsername commented Aug 17, 2024

And now it ought to also be fixed on legacy.

I'm not cutting a release of this for master, as this is technically working around a bug in ren'py itself (where you can put keyword arguments without actual arguments at the end of a line, resulting in a slightly broken AST internally). As there's no reason to do this in a normal rpyc file, it'll make it into the next release eventually.

@KennedyMcMillan
Copy link
Author

And now it ought to also be fixed on legacy.

I'm not cutting a release of this for master, as this is technically working around a bug in ren'py itself (where you can put keyword arguments without actual arguments at the end of a line, resulting in a slightly broken AST internally). As there's no reason to do this in a normal rpyc file, it'll make it into the next release eventually.

Thank you very much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants