Bug?

43 views
Skip to first unread message

Zakhur

unread,
Jul 10, 2012, 8:07:43 PM7/10/12
to watchdo...@googlegroups.com
OK after installation of the latest...

site-packages/watchdog/observers/inotify.py

Around line 358

    def __eq__(self, inotify_event):
      return self.key == inotify_event.key

    def __ne__(self, inotify_event):
      return self.key == inotify_event.key

Hmm, if  __eq__ passes will __ne__ ever be tested?  And if it really IS __ne__ won't the __ne__ fail leaving the state indeterminate for the purposes of deduplication?

I used two virtual servers which shared a filer and put watchmedo shell-command --command='echo "{$watch_src_path}"' . on one server using my home directory on the shared filer, then I did a few touch, mv, cp, rm commands and they were faithfully loggrd in the other ssh window.  I thought that was pretty good, but then...  I was going to demo it to a colleague and  it was unresponsive. 

I have seen user reports on the web about the same problem--log once and nevermore.  Could those two overrides be the source of the problem?

Zak

Laurent LAPORTE

unread,
May 19, 2013, 9:03:15 AM5/19/13
to watchdo...@googlegroups.com
Hi,

Yes it is a bug. Replace it by:

        def __eq__(self, inotify_event):
            return self.key == inotify_event.key

        def __ne__(self, inotify_event):
            return self.key != inotify_event.key
Reply all
Reply to author
Forward
0 new messages