gorakhargosh/watchdog — Issue #75: Uncachable OSError: Permission Denied
Author: hgrecco
Created: 2011-10-10 13:40:26+00:00
State: open

Hi,

I use watchdog to monitor for new files in the filesystem and trigger automated processing of them. What happens is that the thread does not have access to certain files and crashes. Is there a way to provide to watchdog an error handler? Or that it continue monitoring for other files?

Below is an example of a traceback.

Hernan

File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 530, in __bootstrap_inner
self.run()
File "/Users/X/Documents/code/envs/Y/lib/python2.7/site-packages/watchdog/observers/api.py", line 192, in run
self.queue_events(self.timeout)
File "/Users/X/Documents/code/envs/Y/lib/python2.7/site-packages/watchdog/observers/kqueue.py", line 703, in queue_events
new_snapshot)
File "/Users/X/Documents/code/envs/Y/lib/python2.7/site-packages/watchdog/observers/kqueue.py", line 548, in _queue_dirs_modified
self.queue_event(DirCreatedEvent(directory_created))
File "/Users/X/Documents/code/envs/Y/lib/python2.7/site-packages/watchdog/observers/kqueue.py", line 520, in queue_event
self._register_kevent(event.src_path, event.is_directory)
File "/Users/X/Documents/code/envs/Y/lib/python2.7/site-packages/watchdog/observers/kqueue.py", line 470, in _register_kevent
self._descriptors.add(path, is_directory)
File "/Users/X/Documents/code/envs/Y/lib/python2.7/site-packages/watchdog/observers/kqueue.py", line 257, in add
self._add_descriptor(KeventDescriptor(path, is_directory))
File "/Users/X/Documents/code/envs/Y/lib/python2.7/site-packages/watchdog/observers/kqueue.py", line 342, in __init__
self._fd = os.open(path, WATCHDOG_OS_OPEN_FLAGS)
OSError: [Errno 13] Permission denied: '/Users/X/Public/Y/FOLDER'