diff --git a/CIME/utils.py b/CIME/utils.py index 9f6f0dfd2c9..0f642af4778 100644 --- a/CIME/utils.py +++ b/CIME/utils.py @@ -1409,10 +1409,14 @@ def safe_copy(src_path, tgt_path, preserve_meta=True): if owner_uid == os.getuid(): # I am the owner, copy file contents, permissions, and metadata - shutil.copy2( - src_path, - tgt_path, - ) + try: + shutil.copy2( + src_path, + tgt_path, + ) + # ignore same file error + except shutil.SameFileError: + pass else: # I am not the owner, just copy file contents shutil.copyfile(src_path, tgt_path)