Fix filemon fallback watcher to ignore things which aren't files.

This commit is contained in:
Lance Edgar 2015-01-26 14:28:31 -06:00
parent fe11a46012
commit 289b856317

View file

@ -183,12 +183,15 @@ def fallback_watcher(profile):
for fn in os.listdir(path):
fpath = os.path.join(path, fn)
# If the primary watcher is handling this file, then it very
# well could have disappeared already.
# We only want files; no folders etc. Note that if the primary
# watcher noticed and is handling this file, it very well could
# have disappeared already.
try:
if not os.path.isfile(fpath):
continue
modtime = os.path.getmtime(fpath)
except WindowsError:
log.debug("file disappeared: {0}".format(fpath))
log.debug("file presumably disappeared: {0}".format(fpath))
continue
# Queue file for processing only if its last modification time