diff -r 2bbe7dc920de Lib/idlelib/EditorWindow.py --- a/Lib/idlelib/EditorWindow.py Sat Dec 10 17:55:31 2011 -0500 +++ b/Lib/idlelib/EditorWindow.py Tue Dec 13 20:31:59 2011 -0600 @@ -799,12 +799,20 @@ 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', + try: + rf_file = open(self.recent_files_path, 'w', encoding='utf_8', errors='replace') - try: - rf_file.writelines(rf_list) - finally: - rf_file.close() + except IOError as err: + tkMessageBox.showerror(title='IDLE Error', + message='Unable to open Recent Files list for writing:\n%s' % str(err), + parent=self.text) + else: + try: + rf_file.writelines(rf_list) + finally: + rf_file.close() + + # for each edit window instance, construct the recent files menu for instance in self.top.instance_dict: menu = instance.recent_files_menu