From 1be37a84d24206b4ea777f8e055642fe9e9d18ab Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sat, 14 Sep 2019 19:17:09 +0100 Subject: [PATCH] missing function --- webinterface.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/webinterface.py b/webinterface.py index 3947c2ecb..bef5b04e8 100644 --- a/webinterface.py +++ b/webinterface.py @@ -41,6 +41,7 @@ from content import getMentionsFromHtml from config import getConfigParam from skills import getSkills from cache import getPersonFromCache +from cache import storePersonInCache def updateAvatarImageCache(session,baseDir: str,httpPrefix: str,actor: str,avatarUrl: str,personCache: {},force=False) -> str: """Updates the cached avatar for the given actor @@ -62,8 +63,9 @@ def updateAvatarImageCache(session,baseDir: str,httpPrefix: str,actor: str,avata try: result=session.get(avatarUrl, headers=sessionHeaders, params=None) with open(avatarImageFilename, 'wb') as f: - result.raw.decode_content = True - copyfileobj(result.raw, f) + f.write(result.raw) + #result.raw.decode_content = True + #copyfileobj(result.raw, f) print('avatar image downloaded for '+actor) return avatarImageFilename.replace(baseDir+'/cache','') except Exception as e: