Skip to content

SpiderFoot automates OSINT for threat intelligence and mapping your attack surface.

update cache file reading

Amr Awad12e8689de4e4
diff --git a/sflib.py b/sflib.py
index e32c56e7..57f97542 100644
--- a/sflib.py
+++ b/sflib.py
@@ -447,10 +447,8 @@ class SpiderFoot:
return None
if mtime > time.time() - timeoutHrs * 3600 or timeoutHrs == 0:
- fp = file(cacheFile, "r")
- fileContents = fp.read()
- fp.close()
- fileContents = fileContents.decode('utf-8')
+ with open(cacheFile, "r") as fp:
+ fileContents = fp.read()
return fileContents
else:
return None