Issue 5634: cPickle error in case of recursion limit (original) (raw)

Issue5634

Created on 2009-03-31 21:25 by bad, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
!!! bad,2009-03-31 21:25 proposed patch
Messages (3)
msg84915 - (view) Author: vadim suvorov (bad) * Date: 2009-03-31 21:25
In case of heavily recursive data structure cPickle produces intermittent random exceptions (AttributeError, etc.). The expected is RuntimeError: ('maximum recursion depth exceeded in ...'). In addition, the behavior differs for classic/new classes. The reason: the cPickle needs several optional methods (__getstate__, __getinitargs__) for each object. In their absence an AttributeError is generated. It is normally suppressed, but suppression itself causes recursion. The error in exception processing leads to fancy errors. The proposed solution: temporary (for call of PyErr_ExceptionMatches()) increase recursion limit.
msg85205 - (view) Author: Amaury Forgeot d'Arc (amaury.forgeotdarc) * (Python committer) Date: 2009-04-02 14:52
Georg, I think that your recent change in r71024 implements the same idea directly in PyErr_ExceptionMatches. Can you confirm this and close the issue?
msg85392 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2009-04-04 13:39
Yes, that's true. It should be more generally helpful in there.
History
Date User Action Args
2022-04-11 14:56:47 admin set github: 49884
2009-04-04 13:39:34 georg.brandl set status: open -> closedresolution: fixedmessages: +
2009-04-04 00:28:40 collinwinter set nosy: + collinwinter
2009-04-02 14:52:40 amaury.forgeotdarc set assignee: georg.brandlmessages: + nosy: + amaury.forgeotdarc, georg.brandl
2009-03-31 21:25:51 bad create