From c3ddeefd9a59b327654096d5ba3ebdceeeb488ad Mon Sep 17 00:00:00 2001 From: nanotube Date: Thu, 7 Aug 2008 05:04:59 +0000 Subject: [PATCH] Fix bug discovered by Will Ashford (who also gracefully provided a simple fix): if an application that isn't present on the computer is listed under 'Applications Not Logged', then no keystrokes whatsoever would be recorded, since an exception gets thrown every time. --- logwriter.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/logwriter.py b/logwriter.py index b2b5c62..79611e3 100644 --- a/logwriter.py +++ b/logwriter.py @@ -269,7 +269,7 @@ class LogWriter(threading.Thread): self.processName = self.GetProcessName(event) if self.settings['General']['Applications Not Logged'] != 'None': for path in self.settings['General']['Applications Not Logged'].split(';'): - if os.stat(path) == os.stat(self.processName): #we use os.stat instead of comparing strings due to multiple possible representations of a path + if os.path.exists(path) and os.stat(path) == os.stat(self.processName): #we use os.stat instead of comparing strings due to multiple possible representations of a path return False return True -- 2.45.1