Hello, I tried to integrate your module to my project, but this error appeared. I'm using Ren'Py 8.2.1
I'm sorry, but an uncaught exception occurred.
While running game code:
File "game/00-chess-engine/chess_displayable.rpy", line 199, in script
init python:
File "game/00-chess-engine/chess_displayable.rpy", line 227, in <module>
STARTUPINFO = subprocess.STARTUPINFO()
NameError: name 'subprocess' is not defined
-- Full Traceback ------------------------------------------------------------
Full traceback:
File "game/00-chess-engine/chess_displayable.rpy", line 199, in script
init python:
File "C:\Users\Donakass\Desktop\renpy-8.2.1-sdk\renpy\ast.py", line 823, in execute
renpy.python.py_exec_bytecode(self.code.bytecode, self.hide, store=self.store)
File "C:\Users\Donakass\Desktop\renpy-8.2.1-sdk\renpy\python.py", line 1178, in py_exec_bytecode
exec(bytecode, globals, locals)
File "game/00-chess-engine/chess_displayable.rpy", line 227, in <module>
STARTUPINFO = subprocess.STARTUPINFO()
NameError: name 'subprocess' is not defined
Windows-10-10.0.19045 AMD64
Ren'Py 8.2.1.24030407
chess 1.0
Fri Mar 22 12:16:47 2024
Then I've imported subprocess library into chess_displayable.rpy after init python statement. It worked, but when the game ended and I tried to save progress, this error appeared
[code]
I'm sorry, but an uncaught exception occurred.
While running game code:
File "renpy/common/00gamemenu.rpy", line 174, in script
$ ui.interact()
File "renpy/common/00gamemenu.rpy", line 174, in <module>
$ ui.interact()
File "renpy/common/00action_file.rpy", line 414, in __call__
renpy.save(fn, extra_info=save_name)
AttributeError: Can't pickle local object 'WeakSet.__init__.<locals>._remove' (perhaps renpy.game.log.log[12].stores['store']['STOCKFISH_ENGINE'].transport.__getstate__()[1]['_extra']['subprocess']._waitpid_lock = <unlocked _thread.lock object at 0x0000000003834360>)
-- Full Traceback ------------------------------------------------------------
Full traceback:
File "renpy/common/00gamemenu.rpy", line 174, in script
$ ui.interact()
File "C:\Users\Donakass\Desktop\renpy-8.2.1-sdk\renpy\ast.py", line 823, in execute
renpy.python.py_exec_bytecode(self.code.bytecode, self.hide, store=self.store)
File "C:\Users\Donakass\Desktop\renpy-8.2.1-sdk\renpy\python.py", line 1178, in py_exec_bytecode
exec(bytecode, globals, locals)
File "renpy/common/00gamemenu.rpy", line 174, in <module>
$ ui.interact()
File "C:\Users\Donakass\Desktop\renpy-8.2.1-sdk\renpy\ui.py", line 301, in interact
rv = renpy.game.interface.interact(roll_forward=roll_forward, **kwargs)
File "C:\Users\Donakass\Desktop\renpy-8.2.1-sdk\renpy\display\core.py", line 2165, in interact
repeat, rv = self.interact_core(preloads=preloads, trans_pause=trans_pause, pause=pause, pause_start=pause_start, pause_modal=pause_modal, **kwargs) # type: ignore
File "C:\Users\Donakass\Desktop\renpy-8.2.1-sdk\renpy\display\core.py", line 3201, in interact_core
rv = root_widget.event(ev, x, y, 0)
File "C:\Users\Donakass\Desktop\renpy-8.2.1-sdk\renpy\display\layout.py", line 1202, in event
rv = i.event(ev, x - xo, y - yo, cst)
File "C:\Users\Donakass\Desktop\renpy-8.2.1-sdk\renpy\display\transition.py", line 53, in event
return self.new_widget.event(ev, x, y, st) # E1101
File "C:\Users\Donakass\Desktop\renpy-8.2.1-sdk\renpy\display\layout.py", line 1202, in event
rv = i.event(ev, x - xo, y - yo, cst)
File "C:\Users\Donakass\Desktop\renpy-8.2.1-sdk\renpy\display\layout.py", line 1202, in event
rv = i.event(ev, x - xo, y - yo, cst)
File "C:\Users\Donakass\Desktop\renpy-8.2.1-sdk\renpy\display\screen.py", line 793, in event
rv = self.child.event(ev, x, y, st)
File "C:\Users\Donakass\Desktop\renpy-8.2.1-sdk\renpy\display\layout.py", line 1202, in event
rv = i.event(ev, x - xo, y - yo, cst)
File "C:\Users\Donakass\Desktop\renpy-8.2.1-sdk\renpy\display\layout.py", line 1426, in event
rv = super(Window, self).event(ev, x, y, st)
File "C:\Users\Donakass\Desktop\renpy-8.2.1-sdk\renpy\display\layout.py", line 288, in event
rv = d.event(ev, x - xo, y - yo, st)
File "C:\Users\Donakass\Desktop\renpy-8.2.1-sdk\renpy\display\layout.py", line 1202, in event
rv = i.event(ev, x - xo, y - yo, cst)
File "C:\Users\Donakass\Desktop\renpy-8.2.1-sdk\renpy\display\layout.py", line 1426, in event
rv = super(Window, self).event(ev, x, y, st)
File "C:\Users\Donakass\Desktop\renpy-8.2.1-sdk\renpy\display\layout.py", line 288, in event
rv = d.event(ev, x - xo, y - yo, st)
File "C:\Users\Donakass\Desktop\renpy-8.2.1-sdk\renpy\display\layout.py", line 1202, in event
rv = i.event(ev, x - xo, y - yo, cst)
File "C:\Users\Donakass\Desktop\renpy-8.2.1-sdk\renpy\display\layout.py", line 288, in event
rv = d.event(ev, x - xo, y - yo, st)
File "C:\Users\Donakass\Desktop\renpy-8.2.1-sdk\renpy\display\behavior.py", line 1174, in event
return handle_click(self.clicked)
File "C:\Users\Donakass\Desktop\renpy-8.2.1-sdk\renpy\display\behavior.py", line 1095, in handle_click
rv = run(action)
File "C:\Users\Donakass\Desktop\renpy-8.2.1-sdk\renpy\display\behavior.py", line 395, in run
return action(*args, **kwargs)
File "renpy/common/00action_file.rpy", line 414, in __call__
renpy.save(fn, extra_info=save_name)
File "C:\Users\Donakass\Desktop\renpy-8.2.1-sdk\renpy\loadsave.py", line 436, in save
reraise(t, e, tb)
File "lib/python3.9/future/utils/__init__.py", line 444, in raise_
File "C:\Users\Donakass\Desktop\renpy-8.2.1-sdk\renpy\loadsave.py", line 417, in save
dump((roots, renpy.game.log), logf)
File "C:\Users\Donakass\Desktop\renpy-8.2.1-sdk\renpy\compat\pickle.py", line 103, in dump
pickle.dump(o, f, pickle.HIGHEST_PROTOCOL if highest else PROTOCOL)
AttributeError: Can't pickle local object 'WeakSet.__init__.<locals>._remove' (perhaps renpy.game.log.log[12].stores['store']['STOCKFISH_ENGINE'].transport.__getstate__()[1]['_extra']['subprocess']._waitpid_lock = <unlocked _thread.lock object at 0x0000000003834360>)
Windows-10-10.0.19045 AMD64
Ren'Py 8.2.1.24030407
chess 1.0
Fri Mar 22 12:20:10 2024
[/code]
I would appreciate any help, thank you!