CensoredUsername / unrpyc

A ren'py script decompiler
Other
824 stars 149 forks source link

TypeError: 'RevertableDict' object does not support item assignment #168

Closed NotAsea closed 4 months ago

NotAsea commented 1 year ago

I've already applied pull 154 and pull 161, but still get no luck, it still throw known error like TypeError: 'RevertableDict' object does not support item assignment or AttributeError: 'RevertableList' object has no attribute 'extend'

callstack:

Failed at decompiling D:\H\Games\LoSeSb-23.3.0-pc\game\ac/sleep.rpyc
Traceback (most recent call last):
  File "<unrpyc>", line 40, in decompile_game
  File "<unrpyc>", line 32, in decompile_rpyc
  File "<unrpyc>", line 27, in read_ast_from_file
  File "<magic>", line 143, in safe_loads
  File "/home/tom/ab/renpy-build/tmp/install.linux-x86_64/lib/python2.7/pickle.py", line 864, in load
  File "/home/tom/ab/renpy-build/tmp/install.linux-x86_64/lib/python2.7/pickle.py", line 1204, in load_setitem
TypeError: 'RevertableDict' object does not support item assignment

Failed at decompiling D:\H\Games\LoSeSb-23.3.0-pc\game\bg/forest/forest.rpyc
Traceback (most recent call last):
  File "<unrpyc>", line 40, in decompile_game
  File "<unrpyc>", line 32, in decompile_rpyc
  File "<unrpyc>", line 27, in read_ast_from_file
  File "<magic>", line 143, in safe_loads
  File "/home/tom/ab/renpy-build/tmp/install.linux-x86_64/lib/python2.7/pickle.py", line 864, in load
  File "/home/tom/ab/renpy-build/tmp/install.linux-x86_64/lib/python2.7/pickle.py", line 1195, in load_appends
AttributeError: 'RevertableList' object has no attribute 'extend'
madeddy commented 1 year ago
  1. Your issue report is insufficient. e.g. You didn even mention which RenPy version the app runs, your OS, ... This stuff is really important. Read this please: https://github.com/CensoredUsername/unrpyc#when-making-an-issue-report**
  2. I believe in your try something went wrong.
    • If you applied both pull requests to the same unrpyc i am not surprised. (?)
    • Otherwise it's something else, because i tested it with my pull request version from #161 and decompiled your game in question without a glitch. Maybe you want to try just the complete version(no changes needed): https://github.com/madeddy/unrpyc/tree/Renpy_8_7.5_compat_fix%40v1.1.8
TenchiMuyo1984 commented 10 months ago

I've the same issue

Versions:

What I've done:

  1. I copied the un-rpyc file into the game directory
  2. started the game

Game: APromiseBestLeftUnkept-0.9.3-pc

From unrpyc.log.txt

Traceback (most recent call last):
  File "<unrpyc>", line 40, in decompile_game
  File "<unrpyc>", line 32, in decompile_rpyc
  File "<unrpyc>", line 27, in read_ast_from_file
  File "<magic>", line 143, in safe_loads
  File "/home/tom/ab/renpy-build/tmp/install.linux-x86_64/lib/python2.7/pickle.py", line 864, in load
  File "/home/tom/ab/renpy-build/tmp/install.linux-x86_64/lib/python2.7/pickle.py", line 1212, in load_setitems
TypeError: 'RevertableDict' object does not support item assignment
...
Traceback (most recent call last):
  File "<unrpyc>", line 40, in decompile_game
  File "<unrpyc>", line 32, in decompile_rpyc
  File "<unrpyc>", line 27, in read_ast_from_file
  File "<magic>", line 143, in safe_loads
  File "/home/tom/ab/renpy-build/tmp/install.linux-x86_64/lib/python2.7/pickle.py", line 864, in load
  File "/home/tom/ab/renpy-build/tmp/install.linux-x86_64/lib/python2.7/pickle.py", line 1139, in load_reduce
  File "<magic>", line 24, in __new__
FakeUnpicklingError: <class 'set'> was instantiated with unexpected arguments ([],), {}
...
Traceback (most recent call last):
  File "<unrpyc>", line 40, in decompile_game
  File "<unrpyc>", line 32, in decompile_rpyc
  File "<unrpyc>", line 27, in read_ast_from_file
  File "<magic>", line 143, in safe_loads
  File "/home/tom/ab/renpy-build/tmp/install.linux-x86_64/lib/python2.7/pickle.py", line 864, in load
  File "/home/tom/ab/renpy-build/tmp/install.linux-x86_64/lib/python2.7/pickle.py", line 1195, in load_appends
AttributeError: 'RevertableList' object has no attribute 'extend'
madeddy commented 10 months ago

I've the same issue

Versions:

* un.rpyc: 1.1.8

Original unrpyc v1.1.8 does NOT support RenPy versions above 7.4.x !(Means no 7.5.x / 7.6.x / 8.0.x / 8.1.x)

NotAsea commented 8 months ago

@madeddy i'm sorry but, how can i use your fork to build rpy, rpyc file, i try build it like normal (which mean use picklemagic of master branch), but i still cannot decompile game, worse renpy even refuse to load un.rpy file

Windows-10-10.0.22621 AMD64
Ren'Py 8.0.2.22081402
Shattered Minds V0.06
NotAsea commented 8 months ago

more report, use un.rpy file from your folk (mention above), it suffer old error UnicodeDecodeError: 'ascii' codec can't decode byte 0xda in position 1: ordinal not in range(128). I also run unrpyc.py directly and still receive

Traceback (most recent call last):
  File "D:\code\unrpy8\unrpyc.py", line 202, in worker
    tag_outside_block=args.tag_outside_block, init_offset=args.init_offset, try_harder=args.try_harder)
  File "D:\code\unrpy8\unrpyc.py", line 165, in decompile_rpyc
    ast = read_ast_from_file(in_file)
  File "D:\code\unrpy8\unrpyc.py", line 138, in read_ast_from_file
    data, stmts = magic.safe_loads(raw_contents, class_factory, {"_ast", "collections"})
  File "D:\code\unrpy8\decompiler\magic.py", line 599, in safe_loads
    encoding=encoding, errors=errors).load()
  File "D:\phan mem lung tung\Scoop\apps\python27\current\lib\pickle.py", line 864, in load
    dispatch[key](self)
  File "D:\phan mem lung tung\Scoop\apps\python27\current\lib\pickle.py", line 1212, in load_setitems
    dict[stack[i]] = stack[i + 1]
TypeError: 'RevertableDict' object does not support item assignment
CensoredUsername commented 4 months ago

Seems to be a duplicate of #146, might be resolved on the dev branch now. Feel free to give it a spin!

CensoredUsername commented 4 months ago

Should be fixed in the current release, please reopen if it isn't.