From f22e5ac1718516a2b099cec206e0ffb5a2f13afb Mon Sep 17 00:00:00 2001 From: Ben Busby Date: Fri, 3 Jun 2022 14:29:57 -0600 Subject: [PATCH] Catch and ignore unpickling errors in pip installs This seems to be caused by an odd behavior related to Flask sessions and instances of Whoogle installed via pip. I didn't investigate it too much, since catching and ignoring the result doesn't impact Whoogle functionality at all (configuration and session values persist as normal). Since this doesn't affect non-pip instances, I don't believe it to be a fault within Whoogle itself. Fixes #765 --- app/routes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/routes.py b/app/routes.py index 5b73251..90826bc 100644 --- a/app/routes.py +++ b/app/routes.py @@ -81,7 +81,7 @@ def session_required(f): if isinstance(data, dict) and 'valid' in data: continue invalid_sessions.append(session_path) - except (EOFError, FileNotFoundError): + except (EOFError, FileNotFoundError, pickle.UnpicklingError): pass for invalid_session in invalid_sessions: