File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed
Filter options
Expand file tree Collapse file tree 2 files changed +8
-2
lines changed
Original file line number Diff line number Diff line change @@ -83,6 +83,7 @@ def ensure_local_plotly_files():
83
83
for fn in [CREDENTIALS_FILE , CONFIG_FILE ]:
84
84
utils .ensure_file_exists (fn )
85
85
contents = utils .load_json_dict (fn )
86
+ contents_orig = contents .copy ()
86
87
for key , val in list (FILE_CONTENT [fn ].items ()):
87
88
# TODO: removed type checking below, may want to revisit
88
89
if key not in contents :
@@ -91,7 +92,12 @@ def ensure_local_plotly_files():
91
92
for key in contents_keys :
92
93
if key not in FILE_CONTENT [fn ]:
93
94
del contents [key ]
94
- utils .save_json_dict (fn , contents )
95
+ # save only if contents has changed.
96
+ # This is to avoid .credentials or .config file to be overwritten randomly,
97
+ # which we constantly keep experiencing
98
+ # (sync issues? the file might be locked for writing by other process in file._permissions)
99
+ if contents_orig .keys () != contents .keys ():
100
+ utils .save_json_dict (fn , contents )
95
101
96
102
else :
97
103
warnings .warn ("Looks like you don't have 'read-write' permission to "
Original file line number Diff line number Diff line change 1
- __version__ = '2.0.7 '
1
+ __version__ = '2.0.8 '
You can’t perform that action at this time.
0 commit comments