[Python-checkins] r88174 - in python/branches/py3k: Lib/idlelib/EditorWindow.py Misc/NEWS

ned.deily python-checkins at python.org
Mon Jan 24 22:46:44 CET 2011


Author: ned.deily
Date: Mon Jan 24 22:46:44 2011
New Revision: 88174
Log:
#10974: IDLE no longer crashes if its recent files list includes files
 with non-ASCII characters in their path names.
 (with approval of release manager for 3.2rc2)
Modified:
 python/branches/py3k/Lib/idlelib/EditorWindow.py
 python/branches/py3k/Misc/NEWS
Modified: python/branches/py3k/Lib/idlelib/EditorWindow.py
==============================================================================
--- python/branches/py3k/Lib/idlelib/EditorWindow.py	(original)
+++ python/branches/py3k/Lib/idlelib/EditorWindow.py	Mon Jan 24 22:46:44 2011
@@ -772,7 +772,8 @@
 "Load and update the recent files list and menus"
 rf_list = []
 if os.path.exists(self.recent_files_path):
- rf_list_file = open(self.recent_files_path,'r')
+ rf_list_file = open(self.recent_files_path,'r',
+ encoding='utf_8', errors='replace')
 try:
 rf_list = rf_list_file.readlines()
 finally:
@@ -790,7 +791,8 @@
 rf_list = [path for path in rf_list if path not in bad_paths]
 ulchars = "1234567890ABCDEFGHIJK"
 rf_list = rf_list[0:len(ulchars)]
- rf_file = open(self.recent_files_path, 'w')
+ rf_file = open(self.recent_files_path, 'w',
+ encoding='utf_8', errors='replace')
 try:
 rf_file.writelines(rf_list)
 finally:
Modified: python/branches/py3k/Misc/NEWS
==============================================================================
--- python/branches/py3k/Misc/NEWS	(original)
+++ python/branches/py3k/Misc/NEWS	Mon Jan 24 22:46:44 2011
@@ -16,6 +16,9 @@
 Library
 -------
 
+- Issue #10974: IDLE no longer crashes if its recent files list includes files
+ with non-ASCII characters in their path names.
+
 - Have hashlib.algorithms_available and hashlib.algorithms_guaranteed both
 return sets instead of one returning a tuple and the other a frozenset.
 


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /