| single |
Watchdog
========
|PyPI Version|
|PyPI Status|
|PyPI Python Versions|
|GitHub Build Status|
|Documentation Status|
|GitHub License|
.. :changelog:
Changelog
---------
7.1.1
~~~~~
2026-11-20 • [full history]
**Other Changes**
- [core] Allow pattern matching to evaluate relative paths against the
watched root directory, supporting intuitive non-recursive patterns (e.g.
``*.json``, ``logs/*.log``) under ``full_match()``. (`#1430
`__ Thanks to
@prateek-dagar)
- [core] RegexMatchingEventHandler now accepts a single string for
ignore_regexes, as it already does for regexes, instead of compiling each
character as a separate regex. (`#1419
`__, thanks to
@arieleven)
- [observers] Fix race condition between ``Observer.start() and
Observer.schedule()``, and release observer lock during event handler
dispatch to prevent blocking concurrent ``schedule() and unschedule()``
calls. (`#1044 `__,
thanks to @prateek-dagar)
- [fsevents] Fix compiler warnings in the C extension. (`#1411
`__, thanks to
@BoboTiG)
- [inotify] A recursive watch that hits the inotify watch or instance limit
(ENOSPC, EMFILE) on a subdirectory raises OSError from ``start() and
schedule()`` again, as in 6.0.0, instead of silently watching part of the
tree. A subdirectory created later that cannot be watched is logged as a
warning. (`#1454 `__,
thanks to @Kernel-Hunter)
- [inotify] Defer allocating an observer's inotify instance and reader
thread until its first scheduled watch. Empty observers no longer consume
inotify instances; resource-limit errors are raised by ``schedule()``
rather than construction. (`#1432
`__, thanks to
@kushaldave002)
- [inotify] Do not log an error when ``InotifyEmitter.queue_events()`` is
invoked while the emitter is inactive. (`#1462
`__, thanks to
@prateek-dagar)
- [inotify] Events read before a kernel queue overflow are delivered
instead of discarded, ahead of the EventsLostEvent. (`#1440
`__, thanks to
@KurathSec and @fstrasz)
- [inotify] Properly format the duplicate-callback RuntimeWarning message.
(`#1435 `__, thanks
to @BoboTiG)
- [inotify] Refactor watch tracking from flat string path dictionaries to a
hierarchical directory tree (DirNode), making recursive subtree moves
atomic operations with cycle detection and ancestor placeholder pruning.
(`#1459 `__, thanks to
@prateek-dagar)
- [inotify] Report lost events: after a kernel queue overflow, each watch
gets an EventsLostEvent for its directory or file, dispatched to the new
``FileSystemEventHandler.on_events_lost()`` once the watches are repaired.
Pattern and regex handlers (and so tricks) receive it only through
``on_events_lost()``. (`#1440
`__, thanks to
@fstrasz)
- [inotify] Stop watching directories moved out of a watched tree and emit
synthetic deletion/moved events for their subdirectories. (`#354
`__, thanks to
@prateek-dagar)
- [kqueue] Queue each event once per kqueue wakeup. A move reported the
parent DirModifiedEvent twice, and a write reported FileModifiedEvent
twice. (`#1442 `__,
thanks to @karolyi)
- [kqueue] Register the kevents when the emitter is created, not on the
emitter thread's first ``kqueue.control()`` call. Deletes, renames and
attribute changes made in between were lost, every time on free-threaded
Python. (`#1445 `__,
thanks to @karolyi)
- [kqueue] Stop the emitter with a DirDeletedEvent when the watched
directory is removed or moved, instead of letting its thread die with
FileNotFoundError. The kevents read in the same batch are still reported.
(`#1436 `__, thanks
to @karolyi)
- [windows] A ReadDirectoryChangesW or ReadDirectoryChangesExW buffer
overflow is now signalled instead of being silently dropped as zero events.
(`#1019 `__, thanks
to @MohammedAlkindi)
- [windows] Deliver events while the watched tree keeps changing:
``DirectoryChangeReader.get_events()`` now returns within its timeout
instead of waiting until no buffer has arrived for a full timeout. (`#1469
|