From 5cc471cc8756db3f75fa7d76645c05b3c1742cda Mon Sep 17 00:00:00 2001 From: Ruud Date: Sat, 11 Jan 2014 00:05:24 +0100 Subject: [PATCH] Remove path on fail --- couchpotato/core/plugins/base.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/couchpotato/core/plugins/base.py b/couchpotato/core/plugins/base.py index e059f10a..3f7ed115 100644 --- a/couchpotato/core/plugins/base.py +++ b/couchpotato/core/plugins/base.py @@ -103,7 +103,9 @@ class Plugin(object): f.close() os.chmod(path, Env.getPermission('file')) except Exception, e: - log.error('Unable writing to file "%s": %s', (path, e)) + log.error('Unable writing to file "%s": %s', (path, traceback.format_exc())) + if os.path.isfile(path): + os.remove(path) def makeDir(self, path): path = ss(path)