seb-m / pyinotify

Monitoring filesystems events with inotify on Linux.
http://github.com/seb-m/pyinotify/wiki
MIT License
2.29k stars 377 forks source link

Crash when new directory are created by FTP in recursive mode #167

Open github-pmb opened 6 years ago

github-pmb commented 6 years ago

The main loop is recursively watching a directory. When a new directory is created by FTP in this directory, we have a crash (see traceback below). Probably FTP is doing that in a non standard manner (permission problem?). The FTP server is ProFTPd. The kernel is recent: Linux REDACTED 4.9.0-8-amd64 #1 SMP Debian 4.9.110-3+deb9u5 (2018-09-30) x86_64 GNU/Linux.

Traceback (most recent call last): File "./REDACTED.py", line REDACTED, in _main() File "./REDACTED.py", line REDACTED, in _main for event in i.event_gen(yield_nones=False): File "/usr/local/lib/python3.5/dist-packages/inotify/adapters.py", line 300, in event_gen self._i.add_watch(full_path, self._mask) File "/usr/local/lib/python3.5/dist-packages/inotify/adapters.py", line 95, in add_watch wd = inotify.calls.inotify_add_watch(self.__inotify_fd, path_bytes, mask) File "/usr/local/lib/python3.5/dist-packages/inotify/calls.py", line 35, in _check_nonnegative (result,)) inotify.calls.InotifyError: Call failed (should not be -1): (-1) ERRNO=(0)

Hope it helps to improve the code. Thanks.

karlgeorgehunt commented 5 years ago

I am having exactly the same issue. I also see this if I create a directory over SSH.