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

Allow watching a file that didn't exist before #9

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

davidthomaswood
Copy link

If a watch request fails because the file didn't exist, an OSError is
correctly raised, but the alias remains in the list of requests.
Therefore it isn't possible to catch the exception, and retry the watch
request once the file has been created.

This patch adds the watch request to the request queue after attempting
to call _setup_watch, to ensure it doesn't get left in the queue if
the setup fails.

If a watch request fails because the file didn't exist, an `OSError` is
correctly raised, but the alias remains in the list of requests.
Therefore it isn't possible to catch the exception, and retry the watch
request once the file has been created.

This patch adds the watch request to the request queue after attempting
to call `_setup_watch`, to ensure it doesn't get left in the queue if
the setup fails.
@albertodonato
Copy link

I think the same should be done in the unwatch() method.
If a watched file is removed, it's not possible to unwatch it because the kernel will raise an OSError. In that case, the request is left around and you can't watch() the file again later.

@albertodonato
Copy link

What I described seems to be a similar issue to the one mentioned in #2

@albertodonato
Copy link

@rbarrois hi, any chance this could be merged?

@spumer
Copy link

spumer commented Mar 26, 2020

Any updates?

@fpemud
Copy link

fpemud commented Nov 25, 2020

Is this project dead? no action for years.

@spumer
Copy link

spumer commented Nov 25, 2020

I copy original module and apply all PR changes for my copy. All works fine, but this really sad when i see no progress all this time

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.

4 participants