[issue36663] pdb: store whole exception information in locals (via user_exception)

2021-07-04 Thread Irit Katriel


Irit Katriel  added the comment:

As mentioned above, I think this is redundant because the traceback is on 
exc_value.__traceback__. Closing as there was not reply to my question, but 
correct me if I misunderstood the issue.

--
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36663] pdb: store whole exception information in locals (via user_exception)

2021-06-12 Thread Irit Katriel


Irit Katriel  added the comment:

Isn't it enough that the traceback is available on exc_value.__traceback__?

--
nosy: +iritkatriel

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36663] pdb: store whole exception information in locals (via user_exception)

2019-04-18 Thread daniel hahler

New submission from daniel hahler :

Currently Pdb.user_exception does not store the traceback in "user_exception", 
but only passes it to `interaction`:


def user_exception(self, frame, exc_info):
"""This function is called if an exception occurs,
but only if we are to stop at or just below this level."""
if self._wait_for_mainpyfile:
return
exc_type, exc_value, exc_traceback = exc_info
frame.f_locals['__exception__'] = exc_type, exc_value
…
self.interaction(frame, exc_traceback)

I think it would be useful to have the whole exception info at hand in the 
debugger (via the frame locals) directly.


If backward compatible is important it should use a new name for this maybe 
(`__excinfo__`), i.e. if current code would assume `__exception__` to be of 
length 2 only.
But on the other hand this only affects extensions to the debugger, and not 
"real" programs, and therefore backward compatibility is not really required 
here?

Currenly pdb extensions (e.g. pdbpp) can get it either by going up in the 
stack, or grabbing it via `interaction`, but this issue is mainly about making 
it available in plain pdb for the user to interact with.

Code ref: 
https://github.com/python/cpython/blob/e8113f51a8bdf33188ee30a1c038a298329e7bfa/Lib/pdb.py#L295-L301

--
components: Library (Lib)
messages: 340512
nosy: blueyed
priority: normal
severity: normal
status: open
title: pdb: store whole exception information in locals (via user_exception)
versions: Python 3.9

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com