Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Moving a previously removed folder crashing #46

Open
Jvlythical opened this issue Mar 1, 2018 · 0 comments
Open

Moving a previously removed folder crashing #46

Jvlythical opened this issue Mar 1, 2018 · 0 comments

Comments

@Jvlythical
Copy link

Error

Traceback (most recent call last):
  File "../test.py", line 20, in <module>
    _main()
  File "../test.py", line 11, in _main
    for event in i.event_gen(yield_nones=False):
  File "/home/jvlarble/.local/lib/python3.6/site-packages/inotify/adapters.py", line 307, in event_gen
    self._i.remove_watch(full_path, superficial=True)
  File "/home/jvlarble/.local/lib/python3.6/site-packages/inotify/adapters.py", line 118, in remove_watch
    self.remove_watch_with_id(wd)
  File "/home/jvlarble/.local/lib/python3.6/site-packages/inotify/adapters.py", line 126, in remove_watch_with_id
    inotify.calls.inotify_rm_watch(self.__inotify_fd, wd)
  File "/home/jvlarble/.local/lib/python3.6/site-packages/inotify/calls.py", line 35, in _check_nonnegative
    (result,))
inotify.calls.InotifyError: Call failed (should not be -1): (-1) ERRNO=(0)

Source

import inotify.adapters

def _main():
    i = inotify.adapters.InotifyTree('.')

    #i.add_watch('.')

    #with open('/tmp/test_file', 'w'):
    #    pass

    for event in i.event_gen(yield_nones=False):
        (_, type_names, path, filename) = event

        print("PATH=[{}] FILENAME=[{}] EVENT_TYPES={}".format(
              path, filename, type_names))

if __name__ == '__main__':
    _main()

Steps to reproduce:

mkdir a  
rmdir a  
mkdir a  
mv a b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant