[issue14665] faulthandler prints tracebacks in reverse order

STINNER Victor report at bugs.python.org
Wed Apr 25 09:10:30 CEST 2012


STINNER Victor <victor.stinner at gmail.com> added the comment:

> Victor's argument makes sense to me. What I'd be inclined to do is shout at the reader a bit in the traceback header by making it:
>
>    Traceback (most recent call FIRST):

The output is something like:

Thread 0xf758d8d0:

 File "/home/edcjones/programs/python/Python-3.3.0a2/Lib/socket.py",
line 407 in create_connection
 File "/home/edcjones/programs/python/Python-3.3.0a2/Lib/imaplib.py",
line 236 in _create_socket
 File "/home/edcjones/programs/python/Python-3.3.0a2/Lib/imaplib.py",
line 1201 in _create_socket
...

"Thread 0xf758d8d0:" can be replaced with "Thread 0xf758d8d0 (most
recent call FIRST):".

A "reverse=False" parameter can be added to
faulthandler.dump_traceback() and
faulthandler.dump_tracebacks_later(). But I prefer to not add it to
faulthandler.enable() nor faulthandler.register() because
dump_traceback() is called from a signal handler. It may be surprising
to have an option on some functions but not on all functions.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue14665>
_______________________________________


More information about the Python-bugs-list mailing list