Skip to content
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

FreeBSD kqueue: 'module' object is not callable #632

Closed
evilham opened this issue Feb 4, 2020 · 3 comments · Fixed by #638
Closed

FreeBSD kqueue: 'module' object is not callable #632

evilham opened this issue Feb 4, 2020 · 3 comments · Fixed by #638

Comments

@evilham
Copy link
Contributor

evilham commented Feb 4, 2020

Latest version (0.10.1) of watchdog on FreeBSD fails with:

  File ".../python3.7/site-packages/watchdog/observers/kqueue.py", line 439, in custom_stat
    stat_info = stat(path)
TypeError: 'module' object is not callable

Downgrading to version 0.9.0 works fine, so I am guessing it has to do with changes introduced here: d092a69

I guess #532 would be awesome to prevent this :-) good to see it's somehow on the radar!

@BoboTiG
Copy link
Collaborator

BoboTiG commented Feb 4, 2020

Arf, my bad. Thanks for the report!
Maybe could you open a PR as you are able to test it live? 🙏

@evilham
Copy link
Contributor Author

evilham commented Feb 4, 2020

Sure thing, will add that to my own personal queue :-D.

@evilham
Copy link
Contributor Author

evilham commented Feb 4, 2020

Woah, this is more complex than expected... Apparently watchdog is asking a lot of things that kqueue does not provide and... wel, everything is workarounds :-D...

I'll have to submit some patches to the tests first, this one I am not sure of:

@@ -226,11 +230,11 @@ def test_move_from_full():
 @pytest.mark.flaky(max_runs=5, min_passes=1, rerun_filter=rerun_filter)
 def test_separate_consecutive_moves():
     mkdir(p('dir1'))
+    touch(p('dir1', 'b'))
     touch(p('dir1', 'a'))
-    touch(p('b'))
     start_watching(p('dir1'))
     mv(p('dir1', 'a'), p('c'))
-    mv(p('b'), p('dir1', 'd'))
+    mv(p('dir1', 'b'), p('dir1', 'd'))

As far as the current KqueueEmitter is concerned, it looks like if we add a file from a different directory it is equivalent to that file being created and not renamed, as the test expects. Does this patch to the test make sense?

evilham added a commit to CamilionEU/watchdog that referenced this issue Feb 6, 2020
BoboTiG pushed a commit that referenced this issue Feb 6, 2020
* Partially restore support for BSD.

Fixes #632.

* Changelog bump with #638.

* Improve changelog message as per review.
CCP-Aporia pushed a commit to CCP-Aporia/watchdog that referenced this issue Aug 13, 2020
* Partially restore support for BSD.

Fixes gorakhargosh#632.

* Changelog bump with gorakhargosh#638.

* Improve changelog message as per review.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants