From 6f12be2340320c16599e6ac724b115cc1fea0a20 Mon Sep 17 00:00:00 2001 From: JackDandy Date: Tue, 31 Oct 2017 00:30:58 +0000 Subject: [PATCH] Change get_size to return zero for a dir that doesn't exist. --- sickbeard/helpers.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sickbeard/helpers.py b/sickbeard/helpers.py index 7d9ebf87..9452cf1e 100644 --- a/sickbeard/helpers.py +++ b/sickbeard/helpers.py @@ -1334,7 +1334,10 @@ def human(size): def get_size(start_path='.'): if ek.ek(os.path.isfile, start_path): return ek.ek(os.path.getsize, start_path) - return sum(map((lambda x: x.stat(follow_symlinks=False).st_size), scantree(start_path))) + try: + return sum(map((lambda x: x.stat(follow_symlinks=False).st_size), scantree(start_path))) + except OSError: + return 0 def remove_article(text=''):