Ren'Py An error occurred while saving the game

benbendeben

New Member
Jul 30, 2022
13
1
When I was translating the English game into Chinese, I had a problem with saving the game incorrectly. I couldn't fix it, so I asked for help. Thank you.
Error Message:
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 <module>
    $ ui.interact()
  File "renpy/common/00action_file.rpy", line 383, in __call__
    renpy.save(fn, extra_info=save_name)
Exception: Could not pickle <module 'time' (built-in)>. (perhaps renpy.game.log.log[19].stores['store']['time'] = <module 'time' (built-in)>)

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

Full traceback:
  File "renpy/common/00gamemenu.rpy", line 170, in script
    $ ui.interact()
  File "C:\Users\Administrator\Desktop\FromTheTop!-0.24-pc\renpy\ast.py", line 1131, in execute
    renpy.python.py_exec_bytecode(self.code.bytecode, self.hide, store=self.store)
  File "C:\Users\Administrator\Desktop\FromTheTop!-0.24-pc\renpy\python.py", line 1049, in py_exec_bytecode
    exec(bytecode, globals, locals)
  File "renpy/common/00gamemenu.rpy", line 170, in <module>
    $ ui.interact()
  File "C:\Users\Administrator\Desktop\FromTheTop!-0.24-pc\renpy\ui.py", line 299, in interact
    rv = renpy.game.interface.interact(roll_forward=roll_forward, **kwargs)
  File "C:\Users\Administrator\Desktop\FromTheTop!-0.24-pc\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, **kwargs) # type: ignore
  File "C:\Users\Administrator\Desktop\FromTheTop!-0.24-pc\renpy\display\core.py", line 4252, in interact_core
    rv = root_widget.event(ev, x, y, 0)
  File "C:\Users\Administrator\Desktop\FromTheTop!-0.24-pc\renpy\display\layout.py", line 1175, in event
    rv = i.event(ev, x - xo, y - yo, cst)
  File "C:\Users\Administrator\Desktop\FromTheTop!-0.24-pc\renpy\display\layout.py", line 1175, in event
    rv = i.event(ev, x - xo, y - yo, cst)
  File "C:\Users\Administrator\Desktop\FromTheTop!-0.24-pc\renpy\display\layout.py", line 1175, in event
    rv = i.event(ev, x - xo, y - yo, cst)
  File "C:\Users\Administrator\Desktop\FromTheTop!-0.24-pc\renpy\display\screen.py", line 743, in event
    rv = self.child.event(ev, x, y, st)
  File "C:\Users\Administrator\Desktop\FromTheTop!-0.24-pc\renpy\display\layout.py", line 1175, in event
    rv = i.event(ev, x - xo, y - yo, cst)
  File "C:\Users\Administrator\Desktop\FromTheTop!-0.24-pc\renpy\display\layout.py", line 279, in event
    rv = d.event(ev, x - xo, y - yo, st)
  File "C:\Users\Administrator\Desktop\FromTheTop!-0.24-pc\renpy\display\behavior.py", line 1064, in event
    return handle_click(self.clicked)
  File "C:\Users\Administrator\Desktop\FromTheTop!-0.24-pc\renpy\display\behavior.py", line 999, in handle_click
    rv = run(action)
  File "C:\Users\Administrator\Desktop\FromTheTop!-0.24-pc\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 "C:\Users\Administrator\Desktop\FromTheTop!-0.24-pc\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 "C:\Users\Administrator\Desktop\FromTheTop!-0.24-pc\renpy\loadsave.py", line 389, in save
    dump((roots, renpy.game.log), logf)
  File "C:\Users\Administrator\Desktop\FromTheTop!-0.24-pc\renpy\compat\pickle.py", line 103, in dump
    pickle.dump(o, f, pickle.HIGHEST_PROTOCOL if highest else PROTOCOL)
  File "C:\Users\Administrator\Desktop\FromTheTop!-0.24-pc\renpy\python.py", line 1146, in module_pickle
    raise Exception("Could not pickle {!r}.".format(module))
Exception: Could not pickle <module 'time' (built-in)>. (perhaps renpy.game.log.log[19].stores['store']['time'] = <module 'time' (built-in)>)

Windows-10-10.0.19041 AMD64
Ren'Py 8.0.1.22070801
From the Top! 0.24
Fri Nov 25 21:32:54 2022
 

rayminator

Engaged Member
Respected User
Sep 26, 2018
3,040
3,125
try this create a text.txt and change the txt to rpy

add this to the text file
Python:
init python:
    config.use_cpickle = False
to see if you getting a different error message
 

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Respected User
Donor
Jun 10, 2017
10,265
15,074
Exception: Could not pickle <module 'time' (built-in)>. (perhaps renpy.game.log.log[19].stores['store']['time'] = <module 'time' (built-in)>)
Did you changed something more than the text itself ?

The error is telling you that there's a variable named time, that is savable and which point to the Python module named "time".
There's no reason for this to happen, using the said "time" module should be done this way:
Python:
init python:
    import time
Then the module will be available directly, without need to more code, through the time object like ; now = time.gmtime() by example.

But here, it looks like at some time there's at least one of those two lines, default time = time or $ time = time.


Python:
init python:
    config.use_cpickle = False
This is useless. As the doc say, it have no effect on Python 3.x, and like he's using Ren'Py 8.0.1, he is using it.
 

benbendeben

New Member
Jul 30, 2022
13
1
Did you changed something more than the text itself ?

The error is telling you that there's a variable named time, that is savable and which point to the Python module named "time".
There's no reason for this to happen, using the said "time" module should be done this way:
Python:
init python:
    import time
Then the module will be available directly, without need to more code, through the time object like ; now = time.gmtime() by example.

But here, it looks like at some time there's at least one of those two lines, default time = time or $ time = time.




This is useless. As the doc say, it have no effect on Python 3.x, and like he's using Ren'Py 8.0.1, he is using it.
[/引用]

No changes were made except for the text. I used renpy8.0.2.exe to generate translated text and then imported Translator++.exe for translation.
 

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Respected User
Donor
Jun 10, 2017
10,265
15,074
No changes were made except for the text. I used renpy8.0.2.exe to generate translated text and then imported Translator++.exe for translation.
Hmm :/

Well, I don't know how it ended this way, because it would be known if the error was in the original, but I told you why the error happen.