File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -772,7 +772,8 @@ def update_recent_files_list(self, new_file=None):
772772 "Load and update the recent files list and menus"
773773 rf_list = []
774774 if os .path .exists (self .recent_files_path ):
775- rf_list_file = open (self .recent_files_path ,'r' )
775+ rf_list_file = open (self .recent_files_path ,'r' ,
776+ encoding = 'utf_8' , errors = 'replace' )
776777 try :
777778 rf_list = rf_list_file .readlines ()
778779 finally :
@@ -790,7 +791,8 @@ def update_recent_files_list(self, new_file=None):
790791 rf_list = [path for path in rf_list if path not in bad_paths ]
791792 ulchars = "1234567890ABCDEFGHIJK"
792793 rf_list = rf_list [0 :len (ulchars )]
793- rf_file = open (self .recent_files_path , 'w' )
794+ rf_file = open (self .recent_files_path , 'w' ,
795+ encoding = 'utf_8' , errors = 'replace' )
794796 try :
795797 rf_file .writelines (rf_list )
796798 finally :
Original file line number Diff line number Diff line change @@ -16,6 +16,9 @@ Core and Builtins
1616Library
1717-------
1818
19+ - Issue #10974: IDLE no longer crashes if its recent files list includes files
20+ with non-ASCII characters in their path names.
21+
1922- Have hashlib.algorithms_available and hashlib.algorithms_guaranteed both
2023 return sets instead of one returning a tuple and the other a frozenset.
2124
You can’t perform that action at this time.
0 commit comments