[Python-checkins] cpython (2.7): Issue #8793: Prevent IDLE crash in 2.7 when given strings with

ned.deily python-checkins at python.org
Wed Nov 16 03:30:16 CET 2011


http://hg.python.org/cpython/rev/e277fe8380e0
changeset:   73583:e277fe8380e0
branch:      2.7
parent:      73554:050772822bde
user:        Ned Deily <nad at acm.org>
date:        Tue Nov 15 18:29:02 2011 -0800
summary:
  Issue #8793: Prevent IDLE crash in 2.7 when given strings with
invalid hex escape sequences.

files:
  Lib/idlelib/ScriptBinding.py |  2 +-
  Misc/NEWS                    |  3 +++
  2 files changed, 4 insertions(+), 1 deletions(-)


diff --git a/Lib/idlelib/ScriptBinding.py b/Lib/idlelib/ScriptBinding.py
--- a/Lib/idlelib/ScriptBinding.py
+++ b/Lib/idlelib/ScriptBinding.py
@@ -101,7 +101,7 @@
             try:
                 # If successful, return the compiled code
                 return compile(source, filename, "exec")
-            except (SyntaxError, OverflowError), err:
+            except (SyntaxError, OverflowError, ValueError), err:
                 try:
                     msg, (errorfilename, lineno, offset, line) = err
                     if not errorfilename:
diff --git a/Misc/NEWS b/Misc/NEWS
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -79,6 +79,9 @@
 Library
 -------
 
+- Issue #8793: Prevent IDLE crash when given strings with invalid hex escape
+  sequences.
+
 - Issues #1745761, #755670, #13357, #12629, #1200313: HTMLParser now correctly
   handles non-valid attributes, including adjacent and unquoted attributes.
 

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list