From d467f219f548d72e118a93812b0b397a2723440c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micka=C3=ABl=20Schoentgen?= Date: Sun, 28 Jul 2024 15:04:02 +0200 Subject: [PATCH] fix --- src/watchdog/observers/api.py | 7 +------ src/watchdog/observers/fsevents.py | 2 +- src/watchdog/observers/fsevents2.py | 2 +- 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/src/watchdog/observers/api.py b/src/watchdog/observers/api.py index 62b689ef..4dc7d3c6 100644 --- a/src/watchdog/observers/api.py +++ b/src/watchdog/observers/api.py @@ -301,12 +301,7 @@ def schedule(self, event_handler, path, recursive=False, event_filter=None): # If we don't have an emitter for this watch already, create it. if self._emitter_for_watch.get(watch) is None: - emitter = self._emitter_class( - event_queue=self.event_queue, - watch=watch, - timeout=self.timeout, - event_filter=event_filter, - ) + emitter = self._emitter_class(self.event_queue, watch, timeout=self.timeout, event_filter=event_filter) if self.is_alive(): emitter.start() self._add_emitter(emitter) diff --git a/src/watchdog/observers/fsevents.py b/src/watchdog/observers/fsevents.py index 40243c8a..c3b29cd0 100644 --- a/src/watchdog/observers/fsevents.py +++ b/src/watchdog/observers/fsevents.py @@ -161,7 +161,7 @@ def queue_events(self, timeout, events): if logger.getEffectiveLevel() <= logging.DEBUG: for event in events: flags = ", ".join(attr for attr in dir(event) if getattr(event, attr) is True) - logger.debug("{}: {}", event, flags) + logger.debug("%s: %s", event, flags) if time.monotonic() - self._start_time > 60: # Event history is no longer needed, let's free some memory. diff --git a/src/watchdog/observers/fsevents2.py b/src/watchdog/observers/fsevents2.py index 8b812519..71941742 100644 --- a/src/watchdog/observers/fsevents2.py +++ b/src/watchdog/observers/fsevents2.py @@ -125,7 +125,7 @@ def stop(self): def _callback(self, streamRef, clientCallBackInfo, numEvents, eventPaths, eventFlags, eventIDs): events = [NativeEvent(path, flags, _id) for path, flags, _id in zip(eventPaths, eventFlags, eventIDs)] - logger.debug("FSEvents callback. Got {} events:", numEvents) + logger.debug("FSEvents callback. Got %d events:", numEvents) for e in events: logger.debug(e) self._queue.put(events)