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
pull/781/head
Ben Busby 2 years ago
parent ef98d85dc5
commit f22e5ac171
No known key found for this signature in database
GPG Key ID: B9B7231E01D924A1

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

Loading…
Cancel
Save