[issue42801] Exception catching function crashes on recursive list

2021-06-09 Thread Dong-hee Na


Change by Dong-hee Na :


--
resolution:  -> fixed
stage:  -> resolved
status: open -> closed
versions: +Python 3.10, Python 3.8 -Python 3.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42801] Exception catching function crashes on recursive list

2021-01-01 Thread Steve Stagg


Steve Stagg  added the comment:

This is fixed by https://github.com/python/cpython/pull/23744

--
nosy: +stestagg

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42801] Exception catching function crashes on recursive list

2021-01-01 Thread Dong-hee Na


Dong-hee Na  added the comment:

FYI,I am able to reproduce on Python 3.9
The master version is not able to reproduce.

--
nosy: +corona10

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42801] Exception catching function crashes on recursive list

2020-12-31 Thread Steven D'Aprano


New submission from Steven D'Aprano :

This function crashes on the following recursive list:


def length(x):
try:
return sum(length(i) for i in x)
except Exception:
return 1


a = [[1, 2, 3], [4, 5, 6]]
a.append(a)
length(a)


Crashes:


Fatal Python error: _Py_CheckRecursiveCall: Cannot recover from stack overflow.
Python runtime state: initialized

Current thread 0x7eff18d77740 (most recent call first):
  File "", line 3 in length
  File "", line 3 in 
  File "", line 3 in length
  File "", line 3 in 
  ...
Aborted (core dumped)




For brevity I've cut some of the output. There are about fifty pairs of "line 3 
in length"/line 3 in " lines, all identical.

--
components: Interpreter Core
messages: 384150
nosy: steven.daprano
priority: normal
severity: normal
status: open
title: Exception catching function crashes on recursive list
type: crash
versions: Python 3.7, Python 3.9

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com