New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Python 2.7 and windows 7 #85
Comments
Hi, It can be reproduced by the following piece of code: import time
from watchdog.observers import Observer
from watchdog.events import FileSystemEventHandler
class Handler(FileSystemEventHandler):
def on_any_event(self, event):
print "File changed: %s" % event.src_path
if __name__ == '__main__':
event_handler = Handler()
observer = Observer()
observer.schedule(event_handler, '.', recursive=True)
observer.start()
try:
while True:
time.sleep(1)
except KeyboardInterrupt:
observer.stop()
observer.join() The resulting exception looks like this:
Please tell me if you need any further information. |
Did some digging into the windows api on my own and sure enough I was able to identify the problem. Looking up the return values of ReadDirectoryChangesW I found the following:
I've been working on a network share. I'll leave this here in case anyone else finds this issue while googling the error message. |
This helped me just today. Maybe we should raise a custom error with a little bit more detailed message of why this happened (Or maybe just a link to this issue) |
Since I had some problems with python2.5, I tried also python 2.7 and now I get a different error:
(I guess something wrong with ctypes and the windows dlls, but I can't tell much more than that...)
C-c C-cException in thread Thread-2:
Traceback (most recent call last):
File "c:\Python27\lib\threading.py", line 552, in __bootstrap_inner
self.run()
File "c:\Python27\lib\site-packages\watchdog-0.5.4-py2.7.egg\watchdog\observers\api.py", line 192, in run
self.queue_events(self.timeout)
File "c:\Python27\lib\site-packages\watchdog-0.5.4-py2.7.egg\watchdog\observers\read_directory_changes.py", line 80, in queue_events
self.watch.is_recursive)
File "c:\Python27\lib\site-packages\watchdog-0.5.4-py2.7.egg\watchdog\observers\winapi_common.py", line 130, in read_directory_changes
None)
File "c:\Python27\lib\site-packages\watchdog-0.5.4-py2.7.egg\watchdog\observers\winapi.py", line 103, in _errcheck_bool
raise ctypes.WinError()
WindowsError: [Error 1] Incorrect function.
The text was updated successfully, but these errors were encountered: