Skip to content

Commit

Permalink
Merge pull request CroatianMeteorNetwork#84 from markmac99/fixes_for_…
Browse files Browse the repository at this point in the history
…issues_179_181

try/except round copy2 in archiveDir
  • Loading branch information
markmac99 authored Jul 21, 2023
2 parents 5155b27 + 1b24ddd commit 9d85dc1
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions RMS/Misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,10 @@ def archiveDir(source_dir, file_list, dest_dir, compress_file, delete_dest_dir=F
except FileNotFoundError:
log.warning('file {} not found '.format(os.path.join(source_dir, file_name)))
else:
shutil.copy2(os.path.join(source_dir, file_name), os.path.join(dest_dir, file_name))
try:
shutil.copy2(os.path.join(source_dir, file_name), os.path.join(dest_dir, file_name))
except Exception as e:
log.warning(e)


# Copy the additional files to the archive directory
Expand All @@ -158,7 +161,10 @@ def archiveDir(source_dir, file_list, dest_dir, compress_file, delete_dest_dir=F
except FileNotFoundError:
log.warning('file {} not found'.format(file_path))
else:
shutil.copy2(file_path, os.path.join(dest_dir, os.path.basename(file_path)))
try:
shutil.copy2(file_path, os.path.join(dest_dir, os.path.basename(file_path)))
except Exception as e:
log.warning(e)


# Compress the archive directory
Expand Down

0 comments on commit 9d85dc1

Please sign in to comment.