[Python-checkins] cpython (3.2): Issue14929: Stop Idle 3.x from closing on Unicode decode errors when grepping.

terry.reedy python-checkins at python.org
Mon May 28 05:06:40 CEST 2012


http://hg.python.org/cpython/rev/12454f78967b
changeset:   77199:12454f78967b
branch:      3.2
parent:      77195:4a7582866735
user:        Terry Jan Reedy <tjreedy at udel.edu>
date:        Sun May 27 22:56:49 2012 -0400
summary:
  Issue14929: Stop Idle 3.x from closing on Unicode decode errors when grepping.
Patch by Roger Serwy.

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


diff --git a/Lib/idlelib/GrepDialog.py b/Lib/idlelib/GrepDialog.py
--- a/Lib/idlelib/GrepDialog.py
+++ b/Lib/idlelib/GrepDialog.py
@@ -81,7 +81,7 @@
         hits = 0
         for fn in list:
             try:
-                f = open(fn)
+                f = open(fn, errors='replace')
             except IOError as msg:
                 print(msg)
                 continue
diff --git a/Misc/NEWS b/Misc/NEWS
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -67,6 +67,9 @@
 Library
 -------
 
+- Issue14929: Stop Idle 3.x from closing on Unicode decode errors when grepping.
+  Patch by Roger Serwy.
+
 - Issue12510: Attempting to get invalid tooltip no longer closes Idle.
   Original patch by Roger Serwy.
 

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


More information about the Python-checkins mailing list