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)
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.