Message290787
itertools.chain.from_iterable (somewhat ironically) uses recursion to resolve the next iterator, which means it can run out of the C stack when there's a long run of empty iterables. This is most obvious when building with low optimisation modes, or with Py_DEBUG enabled:
Python 3.7.0a0 (heads/master:c431854a09, Mar 29 2017, 10:03:50)
[GCC 4.8.4] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import itertools
>>> next(itertools.chain.from_iterable(() for unused in range(10000000)))
Segmentation fault (core dumped) |
|
Date |
User |
Action |
Args |
2017-03-29 17:09:09 | twouters | set | recipients:
+ twouters, gregory.p.smith |
2017-03-29 17:09:09 | twouters | set | messageid: <1490807349.39.0.701880825332.issue29942@psf.upfronthosting.co.za> |
2017-03-29 17:09:09 | twouters | link | issue29942 messages |
2017-03-29 17:09:09 | twouters | create | |
|