I don't know what I'm doing wrong.
This error happens when loading a save:
RuntimeError: maximum recursion depth exceeded while calling a Python object
I have defined classes in my game and some of them are subclasses, but I don't think there are that complex. I don't get where the error come from.
RuntimeError: maximum recursion depth exceeded while calling a Python object
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.
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.
- xavimat
- Eileen-Class Veteran
- Posts: 1461
- Joined: Sat Feb 25, 2012 8:45 pm
- Completed: Yeshua, Jesus Life, Cops&Robbers
- Projects: Fear&Love
- Organization: Pilgrim Creations
- Github: xavi-mat
- itch: pilgrimcreations
- Location: Spain
- Discord: xavimat
- Contact:
RuntimeError: maximum recursion depth exceeded while calling a Python object
Comunidad Ren'Py en español: ¡Únete a nuestro Discord!
Rhaier Kingdom A Ren'Py Multiplayer Adventure Visual Novel.
Cops&Robbers A two-player experiment | Fear&Love Why can't we say I love you?
Honest Critique (Avatar made with Chibi Maker by ~gen8)
Rhaier Kingdom A Ren'Py Multiplayer Adventure Visual Novel.
Cops&Robbers A two-player experiment | Fear&Love Why can't we say I love you?
Honest Critique (Avatar made with Chibi Maker by ~gen8)
Re: RuntimeError: maximum recursion depth exceeded while calling a Python object
May not be the complexity with the classes but somehow you've created a recursion inside one of the functions? Here's an example of someone accidentally creating recursion with a setter function: https://stackoverflow.com/questions/366 ... -when-call
Maybe you've got that somewhere in your code?
Maybe you've got that somewhere in your code?
- Remix
- Eileen-Class Veteran
- Posts: 1628
- Joined: Tue May 30, 2017 6:10 am
- Completed: None... yet (as I'm still looking for an artist)
- Projects: An un-named anime based trainer game
- Contact:
Re: RuntimeError: maximum recursion depth exceeded while calling a Python object
I presume that you are loading a fresh save... one saved after doing all the delete persistent stuff, play a bit of game, save it, load it?
As the save actually saves I'd conclude the objects are actually pickle-able so the culprit likely isn't there (though you could try config.use_cpickle = False to see if the traceback is improved)
With the recursion being __getattr__ ... Are you overloading that method (or __getattribute__ ) in your classes? (recursing getattr is all too easy if using super without fully wrapping the call in if:else logic) Are you using any getstate setstate methods? Are you extending object or a Ren'Py base class?
As codecs is a bytecode file I cannot even look through that to see if the recursing getattr in there can shed more light.
The above is therefore just guesswork on the hope that a getattr in that codecs file might also be calling a getattr in one of your classes...
As the save actually saves I'd conclude the objects are actually pickle-able so the culprit likely isn't there (though you could try config.use_cpickle = False to see if the traceback is improved)
With the recursion being __getattr__ ... Are you overloading that method (or __getattribute__ ) in your classes? (recursing getattr is all too easy if using super without fully wrapping the call in if:else logic) Are you using any getstate setstate methods? Are you extending object or a Ren'Py base class?
As codecs is a bytecode file I cannot even look through that to see if the recursing getattr in there can shed more light.
The above is therefore just guesswork on the hope that a getattr in that codecs file might also be calling a getattr in one of your classes...
Frameworks & Scriptlets:
- Speech Bubble dialogue system
- Multiple Notify with ATL and history
- (WIP) Radial Masking - needs updating to use Shader
- 7.4 - Smooth Tinting using ATL and matrixcolor
- Several other repositories there too
- xavimat
- Eileen-Class Veteran
- Posts: 1461
- Joined: Sat Feb 25, 2012 8:45 pm
- Completed: Yeshua, Jesus Life, Cops&Robbers
- Projects: Fear&Love
- Organization: Pilgrim Creations
- Github: xavi-mat
- itch: pilgrimcreations
- Location: Spain
- Discord: xavimat
- Contact:
Re: RuntimeError: maximum recursion depth exceeded while calling a Python object
Thanks to both of you. (Yes, fresh saves after deleting persistent, etc.)
I was using setattr inside the __init__ and some @property and maybe I have messed up using the same name for two variables.
I'm also using a lot of __("") functions (with double _), that could be translating strings more than once.
I'm not sure where the error came from.
Anyway, the error is not showing again, probably because I've simplified the __init__.
I was using setattr inside the __init__ and some @property and maybe I have messed up using the same name for two variables.
I'm also using a lot of __("") functions (with double _), that could be translating strings more than once.
I'm not sure where the error came from.
Anyway, the error is not showing again, probably because I've simplified the __init__.
Comunidad Ren'Py en español: ¡Únete a nuestro Discord!
Rhaier Kingdom A Ren'Py Multiplayer Adventure Visual Novel.
Cops&Robbers A two-player experiment | Fear&Love Why can't we say I love you?
Honest Critique (Avatar made with Chibi Maker by ~gen8)
Rhaier Kingdom A Ren'Py Multiplayer Adventure Visual Novel.
Cops&Robbers A two-player experiment | Fear&Love Why can't we say I love you?
Honest Critique (Avatar made with Chibi Maker by ~gen8)
Who is online
Users browsing this forum: Sugar_and_rice