Skip to content

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?

* 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
TobiasRzepka pushed a commit to TobiasRzepka/watchdog that referenced this pull request Apr 19, 2025
…khargosh#1086)

* Add follow_symlink argument to Inotify observer

* Fix FSEventObserver (add follow_symlink kwarg)

* Improve link test in inotify_c.py

---------

Co-authored-by: Corentin <[email protected]>
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