TW <t...@waldmann-edv.de> added the comment:

Eryk, thanks much for your detailled and clear explaining!

Can confirm that using os.write makes it raise the RecursionError where I 
expected it to be. Also print() raising the RecursionError explains the 
behaviour I have seen.

Sadly, this also shows that handling RecursionError is not as easy as one would 
wish it to be, because the usual place for the exception handler is still too 
close to it triggering (again) and every other usually harmless call could also 
trigger it on that level.

So maybe a better solution is voluntarily stopping recursion at a safe distance 
from the recursion limit (== not going deeper, avoiding the exception).

Or doing some tricky construction of first going upwards to a safe distance 
from the limit when handling this exception.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue43674>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to