File tree Expand file tree Collapse file tree 1 file changed +13
-5
lines changed Expand file tree Collapse file tree 1 file changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -49,11 +49,19 @@ def handle_prefs(self, user_data_dir):
49
49
undot_prefs , self ._undot_key (key , value )
50
50
)
51
51
prefs_file = os .path .join (default_path , "Preferences" )
52
- if os .path .exists (prefs_file ):
53
- with open (prefs_file , encoding = "latin1" , mode = "r" ) as f :
54
- undot_prefs = self ._merge_nested (json .load (f ), undot_prefs )
55
- with open (prefs_file , encoding = "latin1" , mode = "w" ) as f :
56
- json .dump (undot_prefs , f )
52
+ try :
53
+ if os .path .exists (prefs_file ):
54
+ with open (prefs_file , encoding = "utf-8" , mode = "r" ) as f :
55
+ undot_prefs = self ._merge_nested (
56
+ json .load (f ), undot_prefs
57
+ )
58
+ except Exception :
59
+ pass
60
+ try :
61
+ with open (prefs_file , encoding = "utf-8" , mode = "w" ) as f :
62
+ json .dump (undot_prefs , f )
63
+ except Exception :
64
+ pass
57
65
# Remove experimental_options to avoid errors
58
66
del self ._experimental_options ["prefs" ]
59
67
exclude_switches = self .experimental_options .get ("excludeSwitches" )
You can’t perform that action at this time.
0 commit comments