[issue42652] recursive in finally clause cause Python interpreter crash.

Xinmeng Xia report at bugs.python.org
Thu Dec 17 11:33:57 EST 2020


Xinmeng Xia <xiaxm at smail.nju.edu.cn> added the comment:

In issue #42500, crashes is resulted by recursion and try-except. Program like following will crash the interpreter.
=====
def foo():
	try:
		1/0
	except:
		pass
	foo()
foo()
=====
However with traceback module, program will no longer crash the interpreter. A recursive Error is returned as expected. 
=====
import traceback
def foo():
	try:
		1/0
	except:
		traceback.print_exc()
	foo()
foo()
=====
But it is still crash the interpreter in finally clause. I think this might be a new but and it is different from #42500. It should be related to traceback module, finally clause and recursion. what do you think?

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue42652>
_______________________________________


More information about the Python-bugs-list mailing list