]> granicus.if.org Git - python/commitdiff
Issue14929: Stop Idle 3.x from closing on Unicode decode errors when grepping.
authorTerry Jan Reedy <tjreedy@udel.edu>
Mon, 28 May 2012 02:56:49 +0000 (22:56 -0400)
committerTerry Jan Reedy <tjreedy@udel.edu>
Mon, 28 May 2012 02:56:49 +0000 (22:56 -0400)
Patch by Roger Serwy.

Lib/idlelib/GrepDialog.py
Misc/NEWS

index 01e0483d4b279ec1eaf3d7408e2a01456eefdc6b..27fcc33c329e97407cefbf7ef174502289cbea3a 100644 (file)
@@ -81,7 +81,7 @@ class GrepDialog(SearchDialogBase):
         hits = 0
         for fn in list:
             try:
-                f = open(fn)
+                f = open(fn, errors='replace')
             except IOError as msg:
                 print(msg)
                 continue
index 3ea0ae30dff68a1818281fbdcc1174e0f9cc5657..2b457232f2e4825223188e607d5e02bf08cdfef3 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -67,6 +67,9 @@ Core and Builtins
 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.