Skip to content

Commit

Permalink
fix: fix file copy on windows when copying to different drive (#7)
Browse files Browse the repository at this point in the history
* fix: fix file copy on windows when copying to different drive

Signed-off-by: Sylvain Leclerc <[email protected]>
  • Loading branch information
sylvlecl authored Oct 31, 2024
1 parent eda9075 commit fa45531
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/antares_web_installer/gui/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
ebarr: https://stackoverflow.com/questions/23947281/python-multiprocessing-redirect-stdout-of-a-child-process-to-a-tkinter-text
"""

import shutil
import typing
from pathlib import Path
from threading import Thread
Expand Down Expand Up @@ -176,7 +177,7 @@ def update_log_file(self):
# move log file into Antares logs directory
new_log_file_path = self.get_target_dir().joinpath(self.log_file.parent.name, self.log_file.name)
try:
self.log_file.replace(new_log_file_path)
shutil.move(str(self.log_file), str(new_log_file_path))
except FileNotFoundError as e:
if new_log_file_path.exists():
logger.debug("Log file '{}' was already moved. Skip renaming step.".format(new_log_file_path))
Expand Down

0 comments on commit fa45531

Please sign in to comment.