[pypy-commit] pyrepl default: Ignore UnicodeDecodeErrors here instead of crashing. Useful

arigo noreply at buildbot.pypy.org
Sun Feb 5 18:42:47 CET 2012


Author: Armin Rigo <arigo at tunes.org>
Branch: 
Changeset: r162:60e7c5ca06b5
Date: 2012-02-05 18:42 +0100
http://bitbucket.org/pypy/pyrepl/changeset/60e7c5ca06b5/

Log:	Ignore UnicodeDecodeErrors here instead of crashing. Useful because
	otherwise typing by mistake an accented letter during a Pdb++
	session crashes the program with UnicodeDecodeError.

diff --git a/pyrepl/unix_console.py b/pyrepl/unix_console.py
--- a/pyrepl/unix_console.py
+++ b/pyrepl/unix_console.py
@@ -411,7 +411,9 @@
                    e.args[4] == 'unexpected end of data':
                 pass
             else:
-                raise
+                #raise  -- but better to ignore UnicodeDecodeErrors here...
+                self.partial_char = ''
+                return
         else:
             self.partial_char = ''
             self.event_queue.push(c)


More information about the pypy-commit mailing list