1. JanKanis
  2. python-inotify
  3. Issues
Issue #7 new

PathWatcher: AssertionError when parent dir is deleted

Gary van der Merwe
created an issue

steps to reproduce:

  • Create watch file in sub dir
mkdir /tmp/xyz
touch /tmp/xyz/abc
  • run this python code
import inotify
import inotify.pathwatcher

w = inotify.pathwatcher.PathWatcher()
w.add('/tmp/xyz/abc', inotify.IN_ALL_EVENTS)

while True:
    for evt in w.read(block=False):
  • Delete a parent dir of the file
rm -r /tmp/xyz


Traceback (most recent call last):
  File "/home/garyvdm/dev/fnb/tickertape/python-gtk-ticker/pathnotify2.py", line 11, in <module>
    for evt in w.read(block=False):
  File "/home/garyvdm/dev/python-inotify/ve/lib/python2.7/site-packages/inotify/pathwatcher.py", line 212, in read
    for e in self._read_events(block):
  File "/home/garyvdm/dev/python-inotify/ve/lib/python2.7/site-packages/inotify/pathwatcher.py", line 230, in _read_events
    for e in eventiter:
  File "/home/garyvdm/dev/python-inotify/ve/lib/python2.7/site-packages/inotify/pathwatcher.py", line 531, in handle_event
    assert not self.callbacks

Comments (1)

  1. Log in to comment