freeCodeCamp / LearnToCodeRPG

A visual novel video game where you learn to code and get a dev job 🎯
https://www.freecodecamp.org/news/learn-to-code-rpg-1-5-update/
BSD 3-Clause "New" or "Revised" License
1.05k stars 110 forks source link

Game won't allow me to save #89

Closed Steven-EB closed 1 year ago

Steven-EB commented 1 year ago

Looking forward for reporting a security issue: Please report security issues by following our security policy: https://contribute.freecodecamp.org/#/security

Describe the bug Every time I try to save, a screen pops up that says "An exception has occured" and it won't let me save.

To Reproduce Steps to reproduce the behavior:

  1. Go to 'Save'
  2. Click on 'Save'
  3. Click on empty slot to save in
  4. See error

Expected behavior I expect to be able to save.

Screenshots

Screen Shot 2022-12-24 at 10 34 44 AM

Desktop (please complete the following information):

Smartphone (please complete the following information): n/a

Additional context

BBCode: [code] I'm sorry, but an uncaught exception occurred.

While running game code: File "renpy/common/00gamemenu.rpy", line 170, in script $ ui.interact() File "renpy/common/00gamemenu.rpy", line 170, in $ ui.interact() File "renpy/common/00action_file.rpy", line 383, in call renpy.save(fn, extra_info=save_name) TypeError: cannot pickle '_io.TextIOWrapper' object (perhaps store.f = <_io.TextIOWrapper name='/Applications/LearnToCodeRPG.app/Contents/Resources/autorun/game/version.txt' encoding='utf-8'>)

-- Full Traceback ------------------------------------------------------------

Full traceback: File "renpy/common/00gamemenu.rpy", line 170, in script $ ui.interact() File "/Applications/LearnToCodeRPG.app/Contents/Resources/autorun/renpy/ast.py", line 1131, in execute renpy.python.py_exec_bytecode(self.code.bytecode, self.hide, store=self.store) File "/Applications/LearnToCodeRPG.app/Contents/Resources/autorun/renpy/python.py", line 1061, in py_exec_bytecode exec(bytecode, globals, locals) File "renpy/common/00gamemenu.rpy", line 170, in $ ui.interact() File "/Applications/LearnToCodeRPG.app/Contents/Resources/autorun/renpy/ui.py", line 299, in interact rv = renpy.game.interface.interact(roll_forward=roll_forward, kwargs) File "/Applications/LearnToCodeRPG.app/Contents/Resources/autorun/renpy/display/core.py", line 3377, 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 "/Applications/LearnToCodeRPG.app/Contents/Resources/autorun/renpy/display/core.py", line 4258, in interact_core rv = root_widget.event(ev, x, y, 0) File "/Applications/LearnToCodeRPG.app/Contents/Resources/autorun/renpy/display/layout.py", line 1175, in event rv = i.event(ev, x - xo, y - yo, cst) File "/Applications/LearnToCodeRPG.app/Contents/Resources/autorun/renpy/display/transition.py", line 53, in event return self.new_widget.event(ev, x, y, st) # E1101 File "/Applications/LearnToCodeRPG.app/Contents/Resources/autorun/renpy/display/layout.py", line 1175, in event rv = i.event(ev, x - xo, y - yo, cst) File "/Applications/LearnToCodeRPG.app/Contents/Resources/autorun/renpy/display/layout.py", line 1175, in event rv = i.event(ev, x - xo, y - yo, cst) File "/Applications/LearnToCodeRPG.app/Contents/Resources/autorun/renpy/display/screen.py", line 743, in event rv = self.child.event(ev, x, y, st) File "/Applications/LearnToCodeRPG.app/Contents/Resources/autorun/renpy/display/layout.py", line 1175, in event rv = i.event(ev, x - xo, y - yo, cst) File "/Applications/LearnToCodeRPG.app/Contents/Resources/autorun/renpy/display/layout.py", line 1399, in event rv = super(Window, self).event(ev, x, y, st) File "/Applications/LearnToCodeRPG.app/Contents/Resources/autorun/renpy/display/layout.py", line 279, in event rv = d.event(ev, x - xo, y - yo, st) File "/Applications/LearnToCodeRPG.app/Contents/Resources/autorun/renpy/display/layout.py", line 1175, in event rv = i.event(ev, x - xo, y - yo, cst) File "/Applications/LearnToCodeRPG.app/Contents/Resources/autorun/renpy/display/layout.py", line 1399, in event rv = super(Window, self).event(ev, x, y, st) File "/Applications/LearnToCodeRPG.app/Contents/Resources/autorun/renpy/display/layout.py", line 279, in event rv = d.event(ev, x - xo, y - yo, st) File "/Applications/LearnToCodeRPG.app/Contents/Resources/autorun/renpy/display/layout.py", line 1175, in event rv = i.event(ev, x - xo, y - yo, cst) File "/Applications/LearnToCodeRPG.app/Contents/Resources/autorun/renpy/display/layout.py", line 279, in event rv = d.event(ev, x - xo, y - yo, st) File "/Applications/LearnToCodeRPG.app/Contents/Resources/autorun/renpy/display/behavior.py", line 1073, in event return handle_click(self.clicked) File "/Applications/LearnToCodeRPG.app/Contents/Resources/autorun/renpy/display/behavior.py", line 1008, in handle_click rv = run(action) File "/Applications/LearnToCodeRPG.app/Contents/Resources/autorun/renpy/display/behavior.py", line 329, in run return action(*args, **kwargs) File "renpy/common/00action_file.rpy", line 383, in call renpy.save(fn, extra_info=save_name) File "/Applications/LearnToCodeRPG.app/Contents/Resources/autorun/renpy/loadsave.py", line 408, in save reraise(t, e, tb) File "/home/tom/ab/renpy-build/tmp/install.linux-x8664/lib/python3.9/site-packages/future/utils/init.py", line 441, in raise File "/Applications/LearnToCodeRPG.app/Contents/Resources/autorun/renpy/loadsave.py", line 389, in save dump((roots, renpy.game.log), logf) File "/Applications/LearnToCodeRPG.app/Contents/Resources/autorun/renpy/compat/pickle.py", line 103, in dump pickle.dump(o, f, pickle.HIGHEST_PROTOCOL if highest else PROTOCOL) TypeError: cannot pickle '_io.TextIOWrapper' object (perhaps store.f = <_io.TextIOWrapper name='/Applications/LearnToCodeRPG.app/Contents/Resources/autorun/game/version.txt' encoding='utf-8'>)

macOS-10.16-x86_64-i386-64bit x86_64 Ren'Py 8.0.3.22090809 Learn to Code RPG 1.5 Sat Dec 24 10:26:22 2022 [/code]

Markdown:

I'm sorry, but an uncaught exception occurred.

While running game code:
  File "renpy/common/00gamemenu.rpy", line 170, in script
    $ ui.interact()
  File "renpy/common/00gamemenu.rpy", line 170, in <module>
    $ ui.interact()
  File "renpy/common/00action_file.rpy", line 383, in __call__
    renpy.save(fn, extra_info=save_name)
TypeError: cannot pickle '_io.TextIOWrapper' object (perhaps store.f = <_io.TextIOWrapper name='/Applications/LearnToCodeRPG.app/Contents/Resources/autorun/game/version.txt' encoding='utf-8'>)

-- Full Traceback ------------------------------------------------------------

Full traceback:
  File "renpy/common/00gamemenu.rpy", line 170, in script
    $ ui.interact()
  File "/Applications/LearnToCodeRPG.app/Contents/Resources/autorun/renpy/ast.py", line 1131, in execute
    renpy.python.py_exec_bytecode(self.code.bytecode, self.hide, store=self.store)
  File "/Applications/LearnToCodeRPG.app/Contents/Resources/autorun/renpy/python.py", line 1061, in py_exec_bytecode
    exec(bytecode, globals, locals)
  File "renpy/common/00gamemenu.rpy", line 170, in <module>
    $ ui.interact()
  File "/Applications/LearnToCodeRPG.app/Contents/Resources/autorun/renpy/ui.py", line 299, in interact
    rv = renpy.game.interface.interact(roll_forward=roll_forward, **kwargs)
  File "/Applications/LearnToCodeRPG.app/Contents/Resources/autorun/renpy/display/core.py", line 3377, 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 "/Applications/LearnToCodeRPG.app/Contents/Resources/autorun/renpy/display/core.py", line 4258, in interact_core
    rv = root_widget.event(ev, x, y, 0)
  File "/Applications/LearnToCodeRPG.app/Contents/Resources/autorun/renpy/display/layout.py", line 1175, in event
    rv = i.event(ev, x - xo, y - yo, cst)
  File "/Applications/LearnToCodeRPG.app/Contents/Resources/autorun/renpy/display/transition.py", line 53, in event
    return self.new_widget.event(ev, x, y, st) # E1101
  File "/Applications/LearnToCodeRPG.app/Contents/Resources/autorun/renpy/display/layout.py", line 1175, in event
    rv = i.event(ev, x - xo, y - yo, cst)
  File "/Applications/LearnToCodeRPG.app/Contents/Resources/autorun/renpy/display/layout.py", line 1175, in event
    rv = i.event(ev, x - xo, y - yo, cst)
  File "/Applications/LearnToCodeRPG.app/Contents/Resources/autorun/renpy/display/screen.py", line 743, in event
    rv = self.child.event(ev, x, y, st)
  File "/Applications/LearnToCodeRPG.app/Contents/Resources/autorun/renpy/display/layout.py", line 1175, in event
    rv = i.event(ev, x - xo, y - yo, cst)
  File "/Applications/LearnToCodeRPG.app/Contents/Resources/autorun/renpy/display/layout.py", line 1399, in event
    rv = super(Window, self).event(ev, x, y, st)
  File "/Applications/LearnToCodeRPG.app/Contents/Resources/autorun/renpy/display/layout.py", line 279, in event
    rv = d.event(ev, x - xo, y - yo, st)
  File "/Applications/LearnToCodeRPG.app/Contents/Resources/autorun/renpy/display/layout.py", line 1175, in event
    rv = i.event(ev, x - xo, y - yo, cst)
  File "/Applications/LearnToCodeRPG.app/Contents/Resources/autorun/renpy/display/layout.py", line 1399, in event
    rv = super(Window, self).event(ev, x, y, st)
  File "/Applications/LearnToCodeRPG.app/Contents/Resources/autorun/renpy/display/layout.py", line 279, in event
    rv = d.event(ev, x - xo, y - yo, st)
  File "/Applications/LearnToCodeRPG.app/Contents/Resources/autorun/renpy/display/layout.py", line 1175, in event
    rv = i.event(ev, x - xo, y - yo, cst)
  File "/Applications/LearnToCodeRPG.app/Contents/Resources/autorun/renpy/display/layout.py", line 279, in event
    rv = d.event(ev, x - xo, y - yo, st)
  File "/Applications/LearnToCodeRPG.app/Contents/Resources/autorun/renpy/display/behavior.py", line 1073, in event
    return handle_click(self.clicked)
  File "/Applications/LearnToCodeRPG.app/Contents/Resources/autorun/renpy/display/behavior.py", line 1008, in handle_click
    rv = run(action)
  File "/Applications/LearnToCodeRPG.app/Contents/Resources/autorun/renpy/display/behavior.py", line 329, in run
    return action(*args, **kwargs)
  File "renpy/common/00action_file.rpy", line 383, in __call__
    renpy.save(fn, extra_info=save_name)
  File "/Applications/LearnToCodeRPG.app/Contents/Resources/autorun/renpy/loadsave.py", line 408, in save
    reraise(t, e, tb)
  File "/home/tom/ab/renpy-build/tmp/install.linux-x86_64/lib/python3.9/site-packages/future/utils/__init__.py", line 441, in raise_
  File "/Applications/LearnToCodeRPG.app/Contents/Resources/autorun/renpy/loadsave.py", line 389, in save
    dump((roots, renpy.game.log), logf)
  File "/Applications/LearnToCodeRPG.app/Contents/Resources/autorun/renpy/compat/pickle.py", line 103, in dump
    pickle.dump(o, f, pickle.HIGHEST_PROTOCOL if highest else PROTOCOL)
TypeError: cannot pickle '_io.TextIOWrapper' object (perhaps store.f = <_io.TextIOWrapper name='/Applications/LearnToCodeRPG.app/Contents/Resources/autorun/game/version.txt' encoding='utf-8'>)

macOS-10.16-x86_64-i386-64bit x86_64
Ren'Py 8.0.3.22090809
Learn to Code RPG 1.5
Sat Dec 24 10:26:22 2022
Anifyuli commented 1 year ago

I get this error too after click save button and select save slots. I playing this game in Linux. I think error is same, but difference is playing platform.

I'm sorry, but an uncaught exception occurred.

While running game code:
  File "renpy/common/00gamemenu.rpy", line 170, in script
    $ ui.interact()
  File "renpy/common/00gamemenu.rpy", line 170, in <module>
    $ ui.interact()
  File "renpy/common/00action_file.rpy", line 383, in __call__
    renpy.save(fn, extra_info=save_name)
TypeError: cannot pickle '_io.TextIOWrapper' object (perhaps store.requests = <module 'requests' from '/home/anifyuli/.config/itch/apps/learn-to-code-rpg/LearnToCodeRPG-1.5-linux/lib/python3.9/requests/__init__.pyc'>)

-- Full Traceback ------------------------------------------------------------

Full traceback:
  File "renpy/common/00gamemenu.rpy", line 170, in script
    $ ui.interact()
  File "/home/anifyuli/.config/itch/apps/learn-to-code-rpg/LearnToCodeRPG-1.5-linux/renpy/ast.py", line 1131, in execute
    renpy.python.py_exec_bytecode(self.code.bytecode, self.hide, store=self.store)
  File "/home/anifyuli/.config/itch/apps/learn-to-code-rpg/LearnToCodeRPG-1.5-linux/renpy/python.py", line 1061, in py_exec_bytecode
    exec(bytecode, globals, locals)
  File "renpy/common/00gamemenu.rpy", line 170, in <module>
    $ ui.interact()
  File "/home/anifyuli/.config/itch/apps/learn-to-code-rpg/LearnToCodeRPG-1.5-linux/renpy/ui.py", line 299, in interact
    rv = renpy.game.interface.interact(roll_forward=roll_forward, **kwargs)
  File "/home/anifyuli/.config/itch/apps/learn-to-code-rpg/LearnToCodeRPG-1.5-linux/renpy/display/core.py", line 3377, 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 "/home/anifyuli/.config/itch/apps/learn-to-code-rpg/LearnToCodeRPG-1.5-linux/renpy/display/core.py", line 4258, in interact_core
    rv = root_widget.event(ev, x, y, 0)
  File "/home/anifyuli/.config/itch/apps/learn-to-code-rpg/LearnToCodeRPG-1.5-linux/renpy/display/layout.py", line 1175, in event
    rv = i.event(ev, x - xo, y - yo, cst)
  File "/home/anifyuli/.config/itch/apps/learn-to-code-rpg/LearnToCodeRPG-1.5-linux/renpy/display/transition.py", line 53, in event
    return self.new_widget.event(ev, x, y, st) # E1101
  File "/home/anifyuli/.config/itch/apps/learn-to-code-rpg/LearnToCodeRPG-1.5-linux/renpy/display/layout.py", line 1175, in event
    rv = i.event(ev, x - xo, y - yo, cst)
  File "/home/anifyuli/.config/itch/apps/learn-to-code-rpg/LearnToCodeRPG-1.5-linux/renpy/display/layout.py", line 1175, in event
    rv = i.event(ev, x - xo, y - yo, cst)
  File "/home/anifyuli/.config/itch/apps/learn-to-code-rpg/LearnToCodeRPG-1.5-linux/renpy/display/screen.py", line 743, in event
    rv = self.child.event(ev, x, y, st)
  File "/home/anifyuli/.config/itch/apps/learn-to-code-rpg/LearnToCodeRPG-1.5-linux/renpy/display/layout.py", line 1175, in event
    rv = i.event(ev, x - xo, y - yo, cst)
  File "/home/anifyuli/.config/itch/apps/learn-to-code-rpg/LearnToCodeRPG-1.5-linux/renpy/display/layout.py", line 1399, in event
    rv = super(Window, self).event(ev, x, y, st)
  File "/home/anifyuli/.config/itch/apps/learn-to-code-rpg/LearnToCodeRPG-1.5-linux/renpy/display/layout.py", line 279, in event
    rv = d.event(ev, x - xo, y - yo, st)
  File "/home/anifyuli/.config/itch/apps/learn-to-code-rpg/LearnToCodeRPG-1.5-linux/renpy/display/layout.py", line 1175, in event
    rv = i.event(ev, x - xo, y - yo, cst)
  File "/home/anifyuli/.config/itch/apps/learn-to-code-rpg/LearnToCodeRPG-1.5-linux/renpy/display/layout.py", line 1399, in event
    rv = super(Window, self).event(ev, x, y, st)
  File "/home/anifyuli/.config/itch/apps/learn-to-code-rpg/LearnToCodeRPG-1.5-linux/renpy/display/layout.py", line 279, in event
    rv = d.event(ev, x - xo, y - yo, st)
  File "/home/anifyuli/.config/itch/apps/learn-to-code-rpg/LearnToCodeRPG-1.5-linux/renpy/display/layout.py", line 1175, in event
    rv = i.event(ev, x - xo, y - yo, cst)
  File "/home/anifyuli/.config/itch/apps/learn-to-code-rpg/LearnToCodeRPG-1.5-linux/renpy/display/layout.py", line 279, in event
    rv = d.event(ev, x - xo, y - yo, st)
  File "/home/anifyuli/.config/itch/apps/learn-to-code-rpg/LearnToCodeRPG-1.5-linux/renpy/display/behavior.py", line 1073, in event
    return handle_click(self.clicked)
  File "/home/anifyuli/.config/itch/apps/learn-to-code-rpg/LearnToCodeRPG-1.5-linux/renpy/display/behavior.py", line 1008, in handle_click
    rv = run(action)
  File "/home/anifyuli/.config/itch/apps/learn-to-code-rpg/LearnToCodeRPG-1.5-linux/renpy/display/behavior.py", line 329, in run
    return action(*args, **kwargs)
  File "renpy/common/00action_file.rpy", line 383, in __call__
    renpy.save(fn, extra_info=save_name)
  File "/home/anifyuli/.config/itch/apps/learn-to-code-rpg/LearnToCodeRPG-1.5-linux/renpy/loadsave.py", line 408, in save
    reraise(t, e, tb)
  File "/home/tom/ab/renpy-build/tmp/install.linux-x86_64/lib/python3.9/site-packages/future/utils/__init__.py", line 441, in raise_
  File "/home/anifyuli/.config/itch/apps/learn-to-code-rpg/LearnToCodeRPG-1.5-linux/renpy/loadsave.py", line 389, in save
    dump((roots, renpy.game.log), logf)
  File "/home/anifyuli/.config/itch/apps/learn-to-code-rpg/LearnToCodeRPG-1.5-linux/renpy/compat/pickle.py", line 103, in dump
    pickle.dump(o, f, pickle.HIGHEST_PROTOCOL if highest else PROTOCOL)
TypeError: cannot pickle '_io.TextIOWrapper' object (perhaps store.requests = <module 'requests' from '/home/anifyuli/.config/itch/apps/learn-to-code-rpg/LearnToCodeRPG-1.5-linux/lib/python3.9/requests/__init__.pyc'>)

Linux-6.0.14-300.fc37.x86_64-x86_64-with-glibc2.36 x86_64
Ren'Py 8.0.3.22090809
Learn to Code RPG 1.5
Sun Dec 25 00:10:20 2022
janetd9 commented 1 year ago

Windows 10 (22H2) user here. I get the same error as described above.

RuolinZheng08 commented 1 year ago

https://github.com/freeCodeCamp/LearnToCodeRPG/commit/c220e63c220cb5ca6b3169b1f771c8524d7d99c1