summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorNed Deily <nad@acm.org>2011-01-24 22:22:06 (GMT)
committerNed Deily <nad@acm.org>2011-01-24 22:22:06 (GMT)
commitab5dd0092786d8503e54a7a75affb9dcc21a271c (patch)
tree98a1cd965b87ace6fd0b2dfad366e0eac2fd05b7 /Lib
parente2248f9e6d9b048e61d5117a6621e46e7df1866d (diff)
downloadcpython-ab5dd0092786d8503e54a7a75affb9dcc21a271c.zip
cpython-ab5dd0092786d8503e54a7a75affb9dcc21a271c.tar.gz
cpython-ab5dd0092786d8503e54a7a75affb9dcc21a271c.tar.bz2
Merged revisions 88174 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r88174 | ned.deily | 2011-01-24 13:46:44 -0800 (Mon, 24 Jan 2011) | 6 lines #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) ........
Diffstat (limited to 'Lib')
-rw-r--r--Lib/idlelib/EditorWindow.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/Lib/idlelib/EditorWindow.py b/Lib/idlelib/EditorWindow.py
index 20a2b26..ab75f3a 100644
--- a/Lib/idlelib/EditorWindow.py
+++ b/Lib/idlelib/EditorWindow.py
@@ -773,7 +773,8 @@ class EditorWindow(object):
"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:
@@ -791,7 +792,8 @@ class EditorWindow(object):
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: