From 01be7aa700c26fe1322e8d3dfed5a55016aa74b6 Mon Sep 17 00:00:00 2001 From: JackDandy Date: Sun, 2 Feb 2020 01:31:54 +0000 Subject: [PATCH] Fix handling the error when failing to remove a file. --- CHANGES.md | 7 ++++++- sickbeard/helpers.py | 2 +- sickbeard/logger.py | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 45d4f36..2e35529 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,4 +1,9 @@ -### 0.21.11 (2020-02-01 21:40:00 UTC) +### 0.21.12 (2020-02-02 00:40:00 UTC) + +* Fix handling the error when failing to remove a file + + +### 0.21.11 (2020-02-01 21:40:00 UTC) * Change ended show mark "[ ! ]" of view-show/"Change show" pull down because Chromium removed the CSS method * Fix creating show list when there is no list at the cycle of backlog search spread diff --git a/sickbeard/helpers.py b/sickbeard/helpers.py index 161ad1f..a579aa5 100644 --- a/sickbeard/helpers.py +++ b/sickbeard/helpers.py @@ -263,7 +263,7 @@ def remove_file(filepath, tree=False, prefix_failure='', log_level=logger.MESSAG ek.ek(shutil.rmtree, filepath) else: ek.ek(os.remove, filepath) - except (OSError, WindowsError) as e: + except OSError as e: logger.log(u'%sUnable to %s %s %s: %s' % (prefix_failure, ('delete', 'trash')[sickbeard.TRASH_REMOVE_SHOW], ('file', 'dir')[tree], filepath, ex(e)), log_level) diff --git a/sickbeard/logger.py b/sickbeard/logger.py index e6d2cf4..13b21c5 100644 --- a/sickbeard/logger.py +++ b/sickbeard/logger.py @@ -369,7 +369,7 @@ class TimedCompressedRotatingFileHandler(TimedRotatingFileHandler): if sickbeard.TRASH_ROTATE_LOGS: try: send2trash(filepath) - except (OSError, WindowsError): + except OSError: pass else: remove_file_failed(filepath)