mirror of
https://github.com/kk7ds/chirp
synced 2026-08-13 17:51:36 -04:00
Fix updating repeaterbook cache on windows
Apparently windows can't do atomic rename, which means we have to remove and rename (and hope we don't fail in between). Fixes #10479
This commit is contained in:
parent
e6473aa729
commit
37d8b94de2
1 changed files with 6 additions and 1 deletions
|
|
@ -147,7 +147,12 @@ class RepeaterBook(base.NetworkResultRadio):
|
|||
return
|
||||
|
||||
if results['count']:
|
||||
os.rename(tmp, data_file)
|
||||
try:
|
||||
os.rename(tmp, data_file)
|
||||
except FileExistsError:
|
||||
# Windows can't do atomic rename
|
||||
os.remove(data_file)
|
||||
os.rename(tmp, data_file)
|
||||
else:
|
||||
os.remove(tmp)
|
||||
status.send_fail('No results!')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue