[issue36550] Avoid creating AttributeError exceptions in the debugger

2021-09-07 Thread Irit Katriel


Irit Katriel  added the comment:

Reopened.

--
resolution: rejected -> 
status: closed -> open
versions:  -Python 3.6, Python 3.7, Python 3.8

___
Python tracker 

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



[issue36550] Avoid creating AttributeError exceptions in the debugger

2021-09-07 Thread daniel hahler

daniel hahler  added the comment:

Given code like the following the try/except handling of Pdb (via `Cmd.onecmd`, 
see https://github.com/python/cpython/pull/4666) will mess with 
`sys.exc_info()`, which could be avoided:

```
try:
raise ValueError()
except Exception as exc:
e = exc
__import__('pdb').set_trace()
```

```
% ./python t_issue36550.py
--Return--
> …/t_issue36550.py(5)()->None
-> __import__('pdb').set_trace()
(Pdb) import sys; sys.exc_info()
(, AttributeError("'Pdb' object has no attribute 
'do_import'"), )
```

The initial / better motivation was described in the original issue: with 
pdb++/pdbpp I want to display tracebacks/errors with errors that might occur 
via Pdb's prompt, where this then showed up as interfering with it.

(Sorry for not responding on https://github.com/python/cpython/pull/4666 
earlier, but I think it is only part of this issue, and therefore it should not 
get closed, and also creating a new one instead does not sound useful to me, so 
please consider to re-open it instead.)

--
versions: +Python 3.10, Python 3.11, Python 3.6, Python 3.7, Python 3.8

___
Python tracker 

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



[issue36550] Avoid creating AttributeError exceptions in the debugger

2021-09-07 Thread Irit Katriel


Irit Katriel  added the comment:

Closing as the bug is not clear and the OP is not responding to requests on the 
PR to clarify it. Please create a new issue if you are still seeing a problem.

--
nosy: +iritkatriel
resolution:  -> rejected
stage: patch review -> 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



[issue36550] Avoid creating AttributeError exceptions in the debugger

2019-04-07 Thread daniel hahler


New submission from daniel hahler :

pdb should try (hard) to avoid creating unnecessary exceptions, e.g. 
``AttributeError`` when looking up commands, since this will show up in 
exception chains then (as "'Pdb' object has no attribute 'do_foo'").

See https://github.com/python/cpython/pull/4666 for an older PR in this regard.

My use case is to display the traceback for exceptions caused within/via 
Pdb.default(), to see more context when running code from pdb's prompt 
directly, where currently it would only display the exception itself.

--
components: Library (Lib)
messages: 339583
nosy: blueyed
priority: normal
severity: normal
status: open
title: Avoid creating AttributeError exceptions in the debugger
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



[issue36550] Avoid creating AttributeError exceptions in the debugger

2019-04-07 Thread daniel hahler


Change by daniel hahler :


--
keywords: +patch
pull_requests: +12643
stage:  -> patch review

___
Python tracker 

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