-
-
Notifications
You must be signed in to change notification settings - Fork 722
Closed
Description
Hi!
Observer cannot be instantiated in case eventlet.monkey_patch() patches Thread.
Here is the code which shows the problem:
# !/usr/bin/env python
from watchdog.observers import Observer
import eventlet
eventlet.monkey_patch()
obs = Observer() # THIS FAILS because of monkey_patch patches threads
Here is the exception I get running the above code
/usr/bin/python2.7 /home/gnuton/GIT/flickrsmartsync/flickrsmartsync/flickrsmartsync/test.py
Traceback (most recent call last):
File "/home/gnuton/GIT/flickrsmartsync/flickrsmartsync/flickrsmartsync/test.py", line 6, in <module>
obs = Observer() # THIS FAILS because of monkey_patch patches threads
File "/usr/local/lib/python2.7/dist-packages/watchdog/observers/inotify.py", line 186, in **init**
timeout=timeout)
File "/usr/local/lib/python2.7/dist-packages/watchdog/observers/api.py", line 208, in **init**
EventDispatcher.**init**(self, timeout)
File "/usr/local/lib/python2.7/dist-packages/watchdog/observers/api.py", line 164, in **init**
self._event_queue = EventQueue()
File "/usr/lib/python2.7/Queue.py", line 28, in __init__
self._init(maxsize)
File "/usr/local/lib/python2.7/dist-packages/watchdog/utils/bricks.py", line 87, in _init
queue.Queue._init(self, maxsize)
TypeError: unbound method _init() must be called with Queue instance as first argument (got EventQueue instance instead)
Metadata
Metadata
Assignees
Labels
No labels