From a99eb91544067f6843ecfbb370d4fbed4740a9b8 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sat, 14 Sep 2019 20:34:35 +0100 Subject: [PATCH] Remove partial download --- webinterface.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/webinterface.py b/webinterface.py index ce31ad28a..96df86730 100644 --- a/webinterface.py +++ b/webinterface.py @@ -71,6 +71,9 @@ def updateAvatarImageCache(session,baseDir: str,httpPrefix: str,actor: str,avata except Exception as e: print('Failed to download avatar image: '+str(avatarUrl)) print(e) + # remove partial download + if os.path.isfile(avatarImageFilename): + os.remove(avatarImageFilename) sessionHeaders = {'Accept': 'application/activity+json; profile="https://www.w3.org/ns/activitystreams"'} personJson = getJson(session,actor,sessionHeaders,None,__version__,httpPrefix,None) if personJson: