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

Force FSEvents to use recursive mode to ensure that events are delivered #1013

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

Rosuav
Copy link

@Rosuav Rosuav commented Oct 9, 2023

Code that works fine on Linux can fail on a Mac, due to inotify working fine with non-recursive but FSEvents failing. The solution is to ensure recursive mode.

Patch mandates recursive mode when using FSEvents.

@Rosuav
Copy link
Author

Rosuav commented Oct 12, 2023

Does anyone who has a Mac want to help out with this? Otherwise, I'm going to have to keep on triggering CI failures just to see how it runs.

@BoboTiG
Copy link
Collaborator

BoboTiG commented Oct 12, 2023

I could give a hand later maybe.
In the mean time, do you mind rebasing on master, and fix that one 🙏🏻:

    def test_add_watch_twice(observer: BaseObserver, p: P) -> None:
        """Adding the same watch twice used to result in a null pointer return without an exception.
    
        See https://github.com/gorakhargosh/watchdog/issues/765
        """
    
        a = p("a")
        mkdir(a)
        h = FileSystemEventHandler()
>       w = ObservedWatch(a)
E       TypeError: ObservedWatch.__init__() missing 1 required positional argument: 'recursive'

@Rosuav
Copy link
Author

Rosuav commented Oct 12, 2023

Done and done, though honestly, I don't expect it to work this time either.

@mikejgray
Copy link

@Rosuav What needed to be done on this one? I'm running into the same issue and would be happy to help, whether it's contributing code or just testing on my Macs

@Rosuav
Copy link
Author

Rosuav commented Apr 20, 2024

@Rosuav What needed to be done on this one?

Testing. The existing code works just fine on Linux, so all I can really do is make sure that my attempts don't actually break things. I have no way to see whether it's any improvement.

So if you can grab the code, try it out, and see whether it works, that would be immensely helpful. You can quickly iterate on it, make small changes and test, without waiting for the whole "commit, push, wait for CI, read the log" thing. As you can see, I tend to wander off and do other things (you know how it is, always myriad other things to look into).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants