[issue7539] unicode exceptions terminate pdb.pm() loop
Georg Brandl ge...@python.org added the comment: Thanks, applied to 2.7 branch in r83267. -- nosy: +georg.brandl resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7539 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7539] unicode exceptions terminate pdb.pm() loop
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: Here is a patch, along with the test that I modified a little bit: - it uses _saferepr (and repr.Repr) to render the exception object - it also fixes exception raised by the p action. - The test uses a raw docstring, to avoid chr(255) in the string -- nosy: +amaury.forgeotdarc Added file: http://bugs.python.org/file15693/pdb-unicode-exc.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7539 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7539] unicode exceptions terminate pdb.pm() loop
Marius Gedminas mar...@gedmin.as added the comment: I don't know what I was smoking when I said pdb.set_trace() wasn't affected; I just reproduced the bug with Python 2.6.4 (r264:75706, Dec 7 2009, 18:45:15) [GCC 4.4.1] on linux2 Type help, copyright, credits or license for more information. import pdb pdb.set_trace() --Return-- stdin(1)module()-None (Pdb) raise Exception(u'\xff') *** Exception: Traceback (most recent call last): File stdin, line 1, in module File /usr/lib/python2.6/bdb.py, line 50, in trace_dispatch return self.dispatch_return(frame, arg) File /usr/lib/python2.6/bdb.py, line 83, in dispatch_return self.user_return(frame, arg) File /usr/lib/python2.6/pdb.py, line 176, in user_return self.interaction(frame, None) File /usr/lib/python2.6/pdb.py, line 194, in interaction self.cmdloop() File /usr/lib/python2.6/cmd.py, line 142, in cmdloop stop = self.onecmd(line) File /usr/lib/python2.6/pdb.py, line 261, in onecmd return cmd.Cmd.onecmd(self, line) File /usr/lib/python2.6/cmd.py, line 218, in onecmd return self.default(line) File /usr/lib/python2.6/pdb.py, line 226, in default print self.stdout, '***', exc_type_name + ':', v UnicodeEncodeError: 'ascii' codec can't encode character u'\xff' in position 0: ordinal not in range(128) This makes testing simpler; attached is my very first patch for the Python test suite, please review it mercilessly. (I verified that the test will pass once the bug is fixed by replacing U+00FF with U+0001 and seeing that it passes.) -- keywords: +patch Added file: http://bugs.python.org/file15639/test-pdb-unicode-exc.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7539 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7539] unicode exceptions terminate pdb.pm() loop
New submission from Marius Gedminas mar...@gedmin.as: $ python2.6 Python 2.6.4 (r264:75706, Dec 7 2009, 18:45:15) [GCC 4.4.1] on linux2 Type help, copyright, credits or license for more information. None() Traceback (most recent call last): File stdin, line 1, in module TypeError: 'NoneType' object is not callable import pdb; pdb.pm() stdin(1)module() (Pdb) raise Exception(u'\xff') *** Exception: Traceback (most recent call last): File stdin, line 1, in module File /usr/lib/python2.6/pdb.py, line 1239, in pm post_mortem(sys.last_traceback) File /usr/lib/python2.6/pdb.py, line 1236, in post_mortem p.interaction(None, t) File /usr/lib/python2.6/pdb.py, line 194, in interaction self.cmdloop() File /usr/lib/python2.6/cmd.py, line 142, in cmdloop stop = self.onecmd(line) File /usr/lib/python2.6/pdb.py, line 261, in onecmd return cmd.Cmd.onecmd(self, line) File /usr/lib/python2.6/cmd.py, line 218, in onecmd return self.default(line) File /usr/lib/python2.6/pdb.py, line 226, in default print self.stdout, '***', exc_type_name + ':', v UnicodeEncodeError: 'ascii' codec can't encode character u'\xff' in position 0: ordinal not in range(128) Note that the post-mortem loop is terminated (if you do pdb.set_trace() instead of pdb.pm(), that doesn't happen). This is rather irritating then you're trying to post-mortem debug a failed test with expensive setup, when leaving the postmortem pdb session exits the process. Python 3.1 is not affected. I don't have 2.7 handy. -- components: Library (Lib), Unicode messages: 96560 nosy: mgedmin severity: normal status: open title: unicode exceptions terminate pdb.pm() loop type: behavior versions: Python 2.5, Python 2.6 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7539 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7539] unicode exceptions terminate pdb.pm() loop
Changes by Ezio Melotti ezio.melo...@gmail.com: -- nosy: +ezio.melotti priority: - normal stage: - test needed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7539 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com