Python ValueError: not allowed to raise maximum limit

Posted by Ricky Bobby on Stack Overflow See other posts from Stack Overflow or by Ricky Bobby
Published on 2012-04-14T16:33:25Z Indexed on 2012/08/28 21:39 UTC
Read the original article Hit count: 301

Filed under:
|
|

I'm using python 2.7.2 on mac os 10.7.3

I'm doing a recursive algorithm in python with more than 50 000 recursion levels.

I tried to increase the maximum recursion level to 1 000 000 but my python shell still exit after 18 000 recursion levels.

I tried to increase the resources available :

import resource 
resource.setrlimit(resource.RLIMIT_STACK, (2**29,-1))
sys.setrecursionlimit(10**6)

and I get this error :

Traceback (most recent call last):
  File "<pyshell#58>", line 1, in <module>
    resource.setrlimit(resource.RLIMIT_STACK,(2**29,-1))
ValueError: not allowed to raise maximum limit

I don't know why I cannot raise the maximum limit ?

thanks for your suggestions .

© Stack Overflow or respective owner

Related posts about python

Related posts about memory