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

Add follow_symlink argument to Inotify observer #1086

Merged
merged 2 commits into from
Nov 12, 2024

Conversation

Corentin-pro
Copy link
Contributor

@Corentin-pro Corentin-pro commented Nov 12, 2024

Adding follow_symlink as keyword argument allow to have recursive watch consistent with the polling method.

This makes the change from PR #109 the default behavior but not the only option. The default values being False this changes will not change nor break any previous use of the library.

Fixes #365.

Ruff is OK and 2 tests are not passing (were not passing before changes either on my computer):

  • test_0_watchmedo.py::test_kill_auto_restart : threading.active_count() == old_thread_count -> assert 1 == 2
  • test_inotify_c.py::test_select_fd: stack.enter_context(open(path)) -> OSError: [Errno 24] Too many open files: '/tmp/[...]/pytest-1/test_select_fd0/new_file', my ulimit is unlimited

Copy link
Collaborator

@BoboTiG BoboTiG left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, thank you @Corentin-pro!

Would you mind adding a line in the changelog also, please?

src/watchdog/observers/inotify_c.py Outdated Show resolved Hide resolved
* Improve link test in inotify_c.py
@Corentin-pro
Copy link
Contributor Author

Corentin-pro commented Nov 12, 2024

@BoboTiG I ran tox (fixed some code format) and find the mypy issue, the added follow_symlink keyword is now in the schedule function of FSEventObserver too.

I don't know what should I add in the changelog, I couldn't find examples in previous PR.

@BoboTiG BoboTiG merged commit 861293a into gorakhargosh:master Nov 12, 2024
20 of 21 checks passed
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.

[Question] How to follow symbolic link
2 participants