diff --git a/Script/CopyThread.py b/Script/CopyThread.py index 6409e2e0ceaf794d8df524cabdceb7342902e0c6..6ecd39bc68fcfc660f3be68d0c07c9ad680495cc 100644 --- a/Script/CopyThread.py +++ b/Script/CopyThread.py @@ -359,8 +359,14 @@ class CopyThread(threading.Thread): self.logger.critical('No connection to Metadata database: database will not be updated for file %s', DataFile) ##### Copy successfull: rename .data.COPYING in .data.COPIED ##### - os.rename(DataFile + Constants.copying_ext, - DataFile + Constants.copied_ext) + try: + os.rename(DataFile + Constants.copying_ext, + DataFile + Constants.copied_ext) + except OSError as exc: + if exc.errno == errno.ENOENT: + self.logger.critical('error renaming %s: not present (deleted by external cause)', DataFile + Constants.copying_ext) + else: + raise exc if self.conf.DdmMonitoringEnabled: self.publishInDdmMonitoring(