Browse Source

Fix handling the error when failing to remove a file.

tags/release_0.21.12^2
JackDandy 5 years ago
parent
commit
01be7aa700
  1. 7
      CHANGES.md
  2. 2
      sickbeard/helpers.py
  3. 2
      sickbeard/logger.py

7
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

2
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)

2
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)

Loading…
Cancel
Save