mirror of
https://github.com/pyrogram/pyrogram
synced 2025-08-29 13:27:47 +00:00
Fix saving files on another drive (windows) @EriHoss
This commit is contained in:
parent
f6ea3e9b42
commit
76ad29ae11
@ -574,13 +574,8 @@ class Client:
|
||||
|
||||
if temp_file_path:
|
||||
final_file_path = os.path.join(directory, file_name)
|
||||
|
||||
try:
|
||||
os.remove(final_file_path)
|
||||
except OSError:
|
||||
pass
|
||||
|
||||
os.renames(temp_file_path, final_file_path)
|
||||
os.makedirs(directory, exist_ok=True)
|
||||
shutil.move(temp_file_path, final_file_path)
|
||||
except Exception as e:
|
||||
log.error(e, exc_info=True)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user