watchdog
watchdog copied to clipboard
Ambiguity in setting FileClosedEvent in filter
If the filter is set to FileClosedEvent
, the mask is set to InotifyConstants.IN_CLOSE
which includes IN_CLOSE_WRITE
and IN_CLOSE_NOWRITE
, but only IN_CLOSE_WRITE
will call on_closed()
. I think line 236 should be modified to event_mask |= InotifyConstants.IN_CLOSE_WRITE
to improve performance and maintain logical consistency in the code.
https://github.com/gorakhargosh/watchdog/blob/9f23b599f369cdd873c0cf3dd9e69567234d78fb/src/watchdog/observers/inotify.py#L235-L236
https://github.com/gorakhargosh/watchdog/blob/9f23b599f369cdd873c0cf3dd9e69567234d78fb/src/watchdog/observers/inotify.py#L190-L199