I sometimes get this error while working

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Post Reply
Message
Author
User avatar
Nano
Newbie
Posts: 7
Joined: Sun Feb 13, 2022 10:44 pm
Projects: Heart of Spades
Contact:

I sometimes get this error while working

#1 Post by Nano »

Is this normal? I'm just writing with autoreload on.

Code: Select all

I'm sorry, but an uncaught exception occurred.

While running game code:
  File "renpy/common/00keymap.rpy", line 469, in script
    python hide:
  File "renpy/common/00keymap.rpy", line 469, in <module>
    python hide:
  File "renpy/common/00keymap.rpy", line 488, in _execute_python_hide
    renpy.save("_reload-1", "reload save game")
RuntimeError: maximum recursion depth exceeded while calling a Python object

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

Full traceback:
  File "renpy/common/00keymap.rpy", line 469, in script
    python hide:
  File "renpy/ast.py", line 928, in execute
    renpy.python.py_exec_bytecode(self.code.bytecode, self.hide, store=self.store)
  File "renpy/python.py", line 2245, in py_exec_bytecode
    exec(bytecode, globals, locals)
  File "renpy/common/00keymap.rpy", line 469, in <module>
    python hide:
  File "renpy/common/00keymap.rpy", line 488, in _execute_python_hide
    renpy.save("_reload-1", "reload save game")
  File "renpy/loadsave.py", line 415, in save
    reraise(t, e, tb)
  File "renpy/loadsave.py", line 401, in save
    dump((roots, renpy.game.log), logf)
  File "renpy/loadsave.py", line 49, in dump
    cPickle.dump(o, f, cPickle.HIGHEST_PROTOCOL)
RuntimeError: maximum recursion depth exceeded while calling a Python object

Windows-10-10.0.19041
Ren'Py 7.4.11.2266
Heart of Spades 1.0
Mon Feb 14 21:55:19 2022

User avatar
Per K Grok
Miko-Class Veteran
Posts: 882
Joined: Fri May 18, 2018 1:02 am
Completed: the Ghost Pilot, Sea of Lost Ships, Bubbles and the Pterodactyls, Defenders of Adacan Part 1-3, the Phantom Flyer
itch: per-k-grok
Location: Sverige
Contact:

Re: I sometimes get this error while working

#2 Post by Per K Grok »

Nano wrote: Mon Feb 14, 2022 10:00 am Is this normal? I'm just writing with autoreload on.

Code: Select all

I'm sorry, but an uncaught exception occurred.

While running game code:
  File "renpy/common/00keymap.rpy", line 469, in script
    python hide:
  File "renpy/common/00keymap.rpy", line 469, in <module>
    python hide:
  File "renpy/common/00keymap.rpy", line 488, in _execute_python_hide
    renpy.save("_reload-1", "reload save game")
RuntimeError: maximum recursion depth exceeded while calling a Python object

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

Full traceback:
  File "renpy/common/00keymap.rpy", line 469, in script
    python hide:
  File "renpy/ast.py", line 928, in execute
    renpy.python.py_exec_bytecode(self.code.bytecode, self.hide, store=self.store)
  File "renpy/python.py", line 2245, in py_exec_bytecode
    exec(bytecode, globals, locals)
  File "renpy/common/00keymap.rpy", line 469, in <module>
    python hide:
  File "renpy/common/00keymap.rpy", line 488, in _execute_python_hide
    renpy.save("_reload-1", "reload save game")
  File "renpy/loadsave.py", line 415, in save
    reraise(t, e, tb)
  File "renpy/loadsave.py", line 401, in save
    dump((roots, renpy.game.log), logf)
  File "renpy/loadsave.py", line 49, in dump
    cPickle.dump(o, f, cPickle.HIGHEST_PROTOCOL)
RuntimeError: maximum recursion depth exceeded while calling a Python object

Windows-10-10.0.19041
Ren'Py 7.4.11.2266
Heart of Spades 1.0
Mon Feb 14 21:55:19 2022
You typically get this error when you have a function that calls other functions or itself too many times, maybe in a loop.
So, are you using functions in your code?

User avatar
Ocelot
Lemma-Class Veteran
Posts: 2444
Joined: Tue Aug 23, 2016 10:35 am
Github: MiiNiPaa
Discord: MiiNiPaa#4384
Contact:

Re: I sometimes get this error while working

#3 Post by Ocelot »

No, this is not normal. Generally it happens when there is some kind of stack pollution happens and you spend enough time in your game to trigger it. There are other ways to run into this problem, but it is impossible to say without studying the code.
< < insert Rick Cook quote here > >

User avatar
Nano
Newbie
Posts: 7
Joined: Sun Feb 13, 2022 10:44 pm
Projects: Heart of Spades
Contact:

Re: I sometimes get this error while working

#4 Post by Nano »

Per K Grok wrote: Mon Feb 14, 2022 10:27 am
Nano wrote: Mon Feb 14, 2022 10:00 am Is this normal? I'm just writing with autoreload on.

Code: Select all

I'm sorry, but an uncaught exception occurred.

While running game code:
  File "renpy/common/00keymap.rpy", line 469, in script
    python hide:
  File "renpy/common/00keymap.rpy", line 469, in <module>
    python hide:
  File "renpy/common/00keymap.rpy", line 488, in _execute_python_hide
    renpy.save("_reload-1", "reload save game")
RuntimeError: maximum recursion depth exceeded while calling a Python object

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

Full traceback:
  File "renpy/common/00keymap.rpy", line 469, in script
    python hide:
  File "renpy/ast.py", line 928, in execute
    renpy.python.py_exec_bytecode(self.code.bytecode, self.hide, store=self.store)
  File "renpy/python.py", line 2245, in py_exec_bytecode
    exec(bytecode, globals, locals)
  File "renpy/common/00keymap.rpy", line 469, in <module>
    python hide:
  File "renpy/common/00keymap.rpy", line 488, in _execute_python_hide
    renpy.save("_reload-1", "reload save game")
  File "renpy/loadsave.py", line 415, in save
    reraise(t, e, tb)
  File "renpy/loadsave.py", line 401, in save
    dump((roots, renpy.game.log), logf)
  File "renpy/loadsave.py", line 49, in dump
    cPickle.dump(o, f, cPickle.HIGHEST_PROTOCOL)
RuntimeError: maximum recursion depth exceeded while calling a Python object

Windows-10-10.0.19041
Ren'Py 7.4.11.2266
Heart of Spades 1.0
Mon Feb 14 21:55:19 2022
You typically get this error when you have a function that calls other functions or itself too many times, maybe in a loop.
So, are you using functions in your code?

Well, I do use them a little. I have one that is a bit long but only used once. I only get this error on autoreload though. Will this cause crashes in the future when other people play it?

User avatar
Ocelot
Lemma-Class Veteran
Posts: 2444
Joined: Tue Aug 23, 2016 10:35 am
Github: MiiNiPaa
Discord: MiiNiPaa#4384
Contact:

Re: I sometimes get this error while working

#5 Post by Ocelot »

Nano wrote: Tue Feb 15, 2022 6:23 pm Well, I do use them a little. I have one that is a bit long but only used once. I only get this error on autoreload though. Will this cause crashes in the future when other people play it?
Probably yes. Autoreload is basically saving, restarting the game and loading that save.
Actually, after looking at trace, I noticed, that crash happens in save function. You somehow have stack overflow when pickling objects. One theoretical possibility is that you have object containing reference to itself, which for some reason is not recognised by cpickle as circular reference.
< < insert Rick Cook quote here > >

User avatar
Nano
Newbie
Posts: 7
Joined: Sun Feb 13, 2022 10:44 pm
Projects: Heart of Spades
Contact:

Re: I sometimes get this error while working

#6 Post by Nano »

Sorry, I'm a bit new to Ren'py. Do you mean defining something which references itself? Also, I'm running into this one now too. It occurs when I use interactive director for a few minutes, then is fine once I restart the game.

Code: Select all

I'm sorry, but an uncaught exception occurred.

While parsing game/script2.rpy.
  File "game/script2.rpy", line 240, in script
    m 'Are you kidding? I might be over that stuff, but hot guys are hot guys.'
  File "renpy/common/00director.rpy", line 1308, in event
    rv = self.child.event(ev, x, y, st)
  File "renpy/common/00director.rpy", line 1077, in __call__
    update_ast()
  File "renpy/common/00director.rpy", line 457, in update_ast
    renpy.scriptedit.add_to_ast_before(statement, state.filename, linenumber)
ScriptError: could not find label '(u'game/script2.rpy', 1645167482, 8)'.

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

Full traceback:
  File "game/script2.rpy", line 240, in script
    m 'Are you kidding? I might be over that stuff, but hot guys are hot guys.'
  File "renpy/ast.py", line 721, in execute
    renpy.exports.say(who, what, *args, **kwargs)
  File "renpy/exports.py", line 1419, in say
    who(what, *args, **kwargs)
  File "renpy/character.py", line 1249, in __call__
    self.do_display(who, what, cb_args=self.cb_args, dtt=dtt, **display_args)
  File "renpy/character.py", line 901, in do_display
    **display_args)
  File "renpy/character.py", line 647, in display_say
    rv = renpy.ui.interact(mouse='say', type=type, roll_forward=roll_forward)
  File "renpy/ui.py", line 298, in interact
    rv = renpy.game.interface.interact(roll_forward=roll_forward, **kwargs)
  File "renpy/display/core.py", line 3325, in interact
    repeat, rv = self.interact_core(preloads=preloads, trans_pause=trans_pause, pause=pause, pause_start=pause_start, **kwargs)
  File "renpy/display/core.py", line 4160, in interact_core
    rv = root_widget.event(ev, x, y, 0)
  File "renpy/display/layout.py", line 1102, in event
    rv = i.event(ev, x - xo, y - yo, cst)
  File "renpy/display/layout.py", line 1102, in event
    rv = i.event(ev, x - xo, y - yo, cst)
  File "renpy/display/layout.py", line 1102, in event
    rv = i.event(ev, x - xo, y - yo, cst)
  File "renpy/display/screen.py", line 727, in event
    rv = self.child.event(ev, x, y, st)
  File "renpy/display/layout.py", line 1102, in event
    rv = i.event(ev, x - xo, y - yo, cst)
  File "renpy/common/00director.rpy", line 1308, in event
    rv = self.child.event(ev, x, y, st)
  File "renpy/display/layout.py", line 1323, in event
    rv = super(Window, self).event(ev, x, y, st)
  File "renpy/display/layout.py", line 273, in event
    rv = d.event(ev, x - xo, y - yo, st)
  File "renpy/display/layout.py", line 1102, in event
    rv = i.event(ev, x - xo, y - yo, cst)
  File "renpy/display/layout.py", line 1102, in event
    rv = i.event(ev, x - xo, y - yo, cst)
  File "renpy/display/layout.py", line 1323, in event
    rv = super(Window, self).event(ev, x, y, st)
  File "renpy/display/layout.py", line 273, in event
    rv = d.event(ev, x - xo, y - yo, st)
  File "renpy/display/layout.py", line 273, in event
    rv = d.event(ev, x - xo, y - yo, st)
  File "renpy/display/viewport.py", line 299, in event
    rv = super(Viewport, self).event(ev, x, y, st)
  File "renpy/display/layout.py", line 273, in event
    rv = d.event(ev, x - xo, y - yo, st)
  File "renpy/display/layout.py", line 1102, in event
    rv = i.event(ev, x - xo, y - yo, cst)
  File "renpy/display/behavior.py", line 983, in event
    return handle_click(self.clicked)
  File "renpy/display/behavior.py", line 918, in handle_click
    rv = run(action)
  File "renpy/display/behavior.py", line 330, in run
    return action(*args, **kwargs)
  File "renpy/common/00director.rpy", line 1077, in __call__
    update_ast()
  File "renpy/common/00director.rpy", line 457, in update_ast
    renpy.scriptedit.add_to_ast_before(statement, state.filename, linenumber)
  File "renpy/scriptedit.py", line 359, in add_to_ast_before
    renpy.game.log.replace_node(old, block[0])
  File "renpy/python.py", line 1705, in replace_node
    i.context.replace_node(old, new)
  File "renpy/execution.py", line 334, in replace_one
    n = renpy.game.script.lookup(name)
  File "renpy/script.py", line 918, in lookup
    raise ScriptError("could not find label '%s'." % str(original))
ScriptError: could not find label '(u'game/script2.rpy', 1645167482, 8)'.

Windows-10-10.0.19041
Ren'Py 7.4.11.2266
Heart of Spades 1.0
Fri Feb 18 15:04:41 2022

Post Reply

Who is online

Users browsing this forum: Google [Bot]