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
main
Ben Busby 2022-06-03 14:29:57 -06:00
parent ef98d85dc5
commit f22e5ac171
No known key found for this signature in database
GPG Key ID: B9B7231E01D924A1
1 changed files with 1 additions and 1 deletions

View File

@ -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: