This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author terry.reedy
Recipients iritkatriel, terry.reedy, vlad2
Date 2021-01-29.20:56:53
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1611953813.77.0.542434670108.issue43048@roundup.psfhosted.org>
In-reply-to
Content
With 3.9, exc.py produces for me

Traceback (most recent call last):
  File "F:\Python\a\tem3.py", line 3, in f
    raise ValueError('hello')
ValueError: hello

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "F:\Python\a\tem3.py", line 3, in f
    raise ValueError('hello')
ValueError: hello
...
During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "F:\Python\a\tem3.py", line 11, in <module>
    f()
  File "F:\Python\a\tem3.py", line 5, in f
    f()
  File "F:\Python\a\tem3.py", line 5, in f
    f()
  File "F:\Python\a\tem3.py", line 5, in f
    f()
  [Previous line repeated 992 more times]
  File "F:\Python\a\tem3.py", line 3, in f
    raise ValueError('hello')
RecursionError: maximum recursion depth exceeded while calling a Python object

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Programs\Python310\lib\runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Programs\Python310\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "F:\Python\a\tem3.py", line 14, in <module>
    print_exception(exc_info[0], exc_info[1], exc_info[2], None)
  File "C:\Programs\Python310\lib\traceback.py", line 113, in print_exception
    for line in TracebackException(
  File "C:\Programs\Python310\lib\traceback.py", line 503, in __init__
    context = TracebackException(
  File "C:\Programs\Python310\lib\traceback.py", line 503, in __init__
    context = TracebackException(
  File "C:\Programs\Python310\lib\traceback.py", line 503, in __init__
    context = TracebackException(
  [Previous line repeated 494 more times]
RecursionError: maximum recursion depth exceeded

This ends the same way as in #42848.


The patch in #42848 will appear in 3.10.0a5 in March.  Guido and Irit decided not to backport at the patch is as much a refactoring as a fix.

On a fresh repository build, exc.py ends with 

Traceback (most recent call last):
  File "f:\python\a\tem3.py", line 3, in f
    raise ValueError('hello')
ValueError: hello

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "f:\python\a\tem3.py", line 11, in <module>
    f()
  File "f:\python\a\tem3.py", line 5, in f
    f()
  File "f:\python\a\tem3.py", line 5, in f
    f()
  File "f:\python\a\tem3.py", line 5, in f
    f()
  [Previous line repeated 995 more times]
  File "f:\python\a\tem3.py", line 3, in f
    raise ValueError('hello')
RecursionError: maximum recursion depth exceeded while calling a Python object
got to the finish line!

I believe this is the expected improvement.
History
Date User Action Args
2021-01-29 20:56:53terry.reedysetrecipients: + terry.reedy, iritkatriel, vlad2
2021-01-29 20:56:53terry.reedysetmessageid: <1611953813.77.0.542434670108.issue43048@roundup.psfhosted.org>
2021-01-29 20:56:53terry.reedylinkissue43048 messages
2021-01-29 20:56:53terry.reedycreate