diff --git a/changelog.rst b/changelog.rst index 9f1918d0..0ece8039 100644 --- a/changelog.rst +++ b/changelog.rst @@ -8,8 +8,8 @@ Changelog 2024-xx-xx • `full history `__ -- -- Thanks to our beloved contributors: @ +- [fsevents] Add missing ``event_filter`` keyword-argument to ``FSEventsObserver.schedule()`` (`#1049 `__) +- Thanks to our beloved contributors: @BoboTiG 4.0.1 ~~~~~ diff --git a/src/watchdog/observers/fsevents.py b/src/watchdog/observers/fsevents.py index 40dce1ad..5e9c78ec 100644 --- a/src/watchdog/observers/fsevents.py +++ b/src/watchdog/observers/fsevents.py @@ -164,7 +164,7 @@ def _is_meta_mod(event): """Returns True if the event indicates a change in metadata.""" return event.is_inode_meta_mod or event.is_xattr_mod or event.is_owner_change - def queue_events(self, timeout, events): + def queue_events(self, timeout, events): # type: ignore[override] if logger.getEffectiveLevel() <= logging.DEBUG: for event in events: flags = ", ".join(attr for attr in dir(event) if getattr(event, attr) is True) @@ -335,11 +335,12 @@ def _encode_path(self, path): class FSEventsObserver(BaseObserver): def __init__(self, timeout=DEFAULT_OBSERVER_TIMEOUT): - super().__init__(emitter_class=FSEventsEmitter, timeout=timeout) + super().__init__(FSEventsEmitter, timeout=timeout) - def schedule(self, event_handler, path, recursive=False): + def schedule(self, event_handler, path, recursive=False, event_filter=None): # Fix for issue #26: Trace/BPT error when given a unicode path # string. https://github.com/gorakhargosh/watchdog/issues#issue/26 if isinstance(path, str): path = unicodedata.normalize("NFC", path) - return BaseObserver.schedule(self, event_handler, path, recursive) + + return super().schedule(event_handler, path, recursive=recursive, event_filter=event_filter)