[Patches] [Patch #101380] sys.(get|set)recursionlimit

noreply@sourceforge.net noreply@sourceforge.net
Thu, 31 Aug 2000 12:24:40 -0700


Patch #101380 has been updated. 

Project: 
Category: core (C code)
Status: Closed
Summary: sys.(get|set)recursionlimit

Follow-Ups:

Date: 2000-Aug-31 10:39
By: jhylton

Comment:
I also have a script find_limit.py that tries executes a bunch of different infinite recursion tests.  It could be included in Misc to let people find the right value for their platform.

The limit of 2500 is a bit conservative, but it's based on a recursive repr function that crashes after 2900 calls on my Linux box.  The other tests seems to survive up to 9100.


-------------------------------------------------------

Date: 2000-Aug-31 10:46
By: marangoz

Comment:
_Py_RecursionLimit is a better name for the variable. A public C API
Py_SetRecursionLimit() / Py_GetRecursionLimit() would be nice and
fair play with extension writers.
-------------------------------------------------------

Date: 2000-Aug-31 11:00
By: jhylton

Comment:
Improvements from Vladimir, plus cleanup of some sloppy naming in sysmodule.  Still need to add docs for new C API calls.

-------------------------------------------------------

Date: 2000-Aug-31 11:17
By: gvanrossum

Comment:
missing sysmodule.c part.
the recursion limit variable should be static.
otherwise fine.

-------------------------------------------------------

Date: 2000-Aug-31 11:20
By: jhylton

Comment:
make _Py_RecursionLimit static; use the C API
add sysmodule.c changes to patch

-------------------------------------------------------

Date: 2000-Aug-31 11:32
By: jhylton

Comment:
Oops.  Made the old patch with a >> /tmp/file instead of > /tmp/file

-------------------------------------------------------

Date: 2000-Aug-31 11:39
By: marangoz

Comment:
Looks good. I thought we agreed to be conservative and default to 1000?
-------------------------------------------------------

Date: 2000-Aug-31 11:46
By: marangoz

Comment:
Oops. A hardcoded lowest possible minimum seems desirable (100 ?),
both in the Python and the C interface. If the limit is set to 1, I expect 
big fun. And leaving it like this would be open to abuse...
-------------------------------------------------------

Date: 2000-Aug-31 12:24
By: jhylton

Comment:
Slightly modified patch accepted by Guido and checked in.

-------------------------------------------------------

-------------------------------------------------------
For more info, visit:

http://sourceforge.net/patch/?func=detailpatch&patch_id=101380&group_id=5470