mirror of
https://github.com/Mayuri-Chan/pyrofork.git
synced 2026-01-03 14:04:51 +00:00
Fix saving files on another drive (windows) @EriHoss
This commit is contained in:
parent
f6ea3e9b42
commit
76ad29ae11
1 changed files with 2 additions and 7 deletions
|
|
@ -574,13 +574,8 @@ class Client:
|
||||||
|
|
||||||
if temp_file_path:
|
if temp_file_path:
|
||||||
final_file_path = os.path.join(directory, file_name)
|
final_file_path = os.path.join(directory, file_name)
|
||||||
|
os.makedirs(directory, exist_ok=True)
|
||||||
try:
|
shutil.move(temp_file_path, final_file_path)
|
||||||
os.remove(final_file_path)
|
|
||||||
except OSError:
|
|
||||||
pass
|
|
||||||
|
|
||||||
os.renames(temp_file_path, final_file_path)
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
log.error(e, exc_info=True)
|
log.error(e, exc_info=True)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue