Message158326
The "RuntimeError: maximum recursion depth exceeded" message is normally only triggered by pure Python recursion, so I would not have expected it here, but there should be some sort of graceful MemoryError or somesuch rather than a segfault.
The following code narrows it down to some issue in starmap():
def gstarmap(func, iterable):
for tup in iterable:
yield func(*tup)
def mylist(iterable):
return [x for x in iterable]
a = b = [1]
for i in xrange(100000):
# Things that trigger a segfault:
#a = starmap(add, izip(a, b))
#a = starmap(add, iter( (a, b) ))
a = starmap(add, (a, b) )
# Things that exit cleanly with a RuntimeError
#a = gstarmap(add, iter( (a, b) ))
#a = (x+y for x, y in iter( (a, b) ))
mylist(a)
One possibility may be that starmap.next needs to clear StopIteration exceptions in the same way as PyIter_Next():
if (result == NULL &&
PyErr_Occurred() &&
PyErr_ExceptionMatches(PyExc_StopIteration))
PyErr_Clear(); |
|
Date |
User |
Action |
Args |
2012-04-15 13:14:20 | rhettinger | set | recipients:
+ rhettinger, terry.reedy, pitrou, kristjan.jonsson, ezio.melotti, progrper |
2012-04-15 13:14:20 | rhettinger | set | messageid: <1334495660.29.0.71154021853.issue14507@psf.upfronthosting.co.za> |
2012-04-15 13:14:19 | rhettinger | link | issue14507 messages |
2012-04-15 13:14:19 | rhettinger | create | |
|