Watchdog getting events thrice in Python 3 -


i'm creating program in python using watchdog watches set of files , takes actions based on changes. put the exact example site in file:

import sys import time import logging watchdog.observers import observer watchdog.events import loggingeventhandler  if __name__ == "__main__":     logging.basicconfig(level=logging.info,                         format='%(asctime)s - %(message)s',                         datefmt='%y-%m-%d %h:%m:%s')     path = sys.argv[1] if len(sys.argv) > 1 else '.'     event_handler = loggingeventhandler()     observer = observer()     observer.schedule(event_handler, path, recursive=true)     observer.start()     try:         while true:             time.sleep(1)     except keyboardinterrupt:         observer.stop()     observer.join() 

then, noticed odd. have installed watchdog both python 2 , python 3, in same way (using pip2 install watchdog , pip3 install watchdog), , @ same time. however, when run program in python 2 , 3 , same modification once each, happens:

$ python2 watch_test.py 2015-09-30 11:18:32 - modified file: ./watch_test.py $ python3 watch_test.py 2015-09-30 11:18:39 - modified file: ./watch_test.py 2015-09-30 11:18:39 - modified file: ./watch_test.py 2015-09-30 11:18:39 - modified file: ./watch_test.py 

what i'm wondering cause behavior , how fix it.

this question is not duplicate of:


Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -