diff --git a/mvw-dl.py b/mvw-dl.py index 18967c9..dc0e1b2 100644 --- a/mvw-dl.py +++ b/mvw-dl.py @@ -5,6 +5,7 @@ import logging import os import pathlib import re +import shutil import sys import time @@ -611,7 +612,12 @@ def copy_url( log.info(f"{shorthand_uuid} Moving file to final location '{dest_path}' ...") try: - os.rename(tmp_path, dest_path) + shutil.move(tmp_path, dest_path) + except OSError as ose: + log.error(f"{shorthand_uuid} Failed moving file with an OSError\n" + f"{ose}\n" + f"Other threads continue unhindered.") + else: log_successful_download(section_name, config_obj, show, state_file_abs_path, job_uuid, shorthand_uuid) log.info(f"{shorthand_uuid} Done moving") except Exception: