Xavier de Gaye added the comment:

> There is at least one other place (do_break) where this same problem could 
> crop up.

Also in do_retval. And the exception is silently ignored in do_p and do_pp when 
repr() fails, which is not correct.

A solution could be to have a message_safe method to be used in such cases. For 
example, substitute in do_args:

    self.message('%s = %r' % (name, dict[name]))
with:
    self.message_safe('%s = %r', name, dict[name])

def message_safe(self, fmt, *args):
    try:
        print(fmt % args, file=self.stdout)
    except Exception:
        exc_info = sys.exc_info()[:2]
        self.error(traceback.format_exception_only(*exc_info)[-1].strip())

----------
nosy: +xdegaye

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

Reply via email to