From 6ee4012c0a4d16fb3a6b2a9ea80a7a4b54073193 Mon Sep 17 00:00:00 2001 From: catboxanon <122327233+catboxanon@users.noreply.github.com> Date: Thu, 15 Feb 2024 13:31:44 -0500 Subject: [PATCH] Gracefully handle mtime read exception from cache --- modules/hashes.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/hashes.py b/modules/hashes.py index b7a33b427..d22e5fadc 100644 --- a/modules/hashes.py +++ b/modules/hashes.py @@ -21,7 +21,10 @@ def calculate_sha256(filename): def sha256_from_cache(filename, title, use_addnet_hash=False): hashes = cache("hashes-addnet") if use_addnet_hash else cache("hashes") - ondisk_mtime = os.path.getmtime(filename) + try: + ondisk_mtime = os.path.getmtime(filename) + except FileNotFoundError: + return None if title not in hashes: return None