New submission from Simon Chopin <chopin.si...@gmail.com>:

This issue occurred at least in Python 2.7, I haven't checked in other versions.

When stepping on a return statement, pdb calls the return value __str__() 
method to display it at the end of the line. Only, it doesn't handle the 
potential exceptions raised within those functions.

An exemple would be:
import pdb

class A(object):
    def __new__(cls):
        pdb.set_trace()
        return super(A, cls).__new__()
    def __init__(self):
        self.value = "Foo"
    def __str__(self):
        return self.value

pdb.run("A()")

When using the step by step, pdb will be interrupted by an unhandled 
AttributeError.

----------
components: Library (Lib)
messages: 154916
nosy: Simon.Chopin
priority: normal
severity: normal
status: open
title: Unhandled exceptions in pdb return value display
versions: Python 2.7

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

Reply via email to