Nick Coghlan <ncogh...@gmail.com> added the comment:

As per my response to RDM on python-dev, I think the patch is misguided as it 
currently stands.

The traceback on an exception is built up as the stack unwinds. The stack above 
the frame containing the exception handler obviously hasn't been unwound yet, 
so it isn't included in the traceback object.

Since the frame containing the exception handler is live, it and the frame 
stack above it reflect the state of the exception handler, while the tracebacks 
on the chain of exceptions currently being handled reflect the parts of the 
stack that have already been unwound.

For explicit printing, a separate section printing the stack with print_stack() 
is a better option than trying to embed the information in the stack trace of 
the exception currently being handled.

For the logging use case, a separate "stack_trace" flag to request inclusion of 
stack trace details independent of the exception state seems like a preferable 
option.

----------
nosy: +ncoghlan

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

Reply via email to