Steps to reproduce problem:
1. Get a windows XP machine with pyscss and watchdog installed
2. Run pyScss in watch mode: C:> pyscss --watch=c:\somedir
What is expected:
The pyscss tool will run as expected and will monitor the directory
What actually happens:
An exception occurs:
C:\Documents and Settings\User>pyscss --watch="G:/workspace_indigo/project/css/"
Scanning acceleration disabled (_speedups not found)!
Exception in thread Thread-2:
Traceback (most recent call last):
File "C:\Python26\lib\threading.py", line 522, in __bootstrap_inner
File "C:\Python26\Lib\site-packages\watchdog\observers\api.py", line 191, in run
File "C:\Python26\Lib\site-packages\watchdog\observers\read_directory_changes.py", line 75, in queue_events
File "c:\python26\Lib\site-packages\watchdog\observers\winapi_common.py", line 126, in read_directory_changes
ArgumentError: argument 4: <type 'exceptions.TypeError'>: wrong type
My contribution to squash the bug:
I looked closer into it and saw that the 4th argument is the "recursive" argument of the function (bWatchSubtree according to the doc) and that it has to be a boolean. Unfortunately, because i did not set the "--recursive" flag when running the tool, the value of the flag is set to None, and it is passed to watchdog (and then to the WinApi calls) as None... and there it all breaks appart. The momentary fix is to run the tool with the "--recursive" flag set, but I think it would be much better to patch the OptionParser initialization so that the "--recursive" variable is set to false by default.
I don't know if this same bug happens on newer versions of Windows.
I can confirm that this also happens on Windows 7.
options.recursive must be a bool. Fixes #79.
I don't have a Windows dev environment handy, but I believe this is fixed on the development branch.