PyInotify icon indicating copy to clipboard operation
PyInotify copied to clipboard

Add watch directly on pathlib instances

Open BVollmerhaus opened this issue 6 years ago • 0 comments

The add_watch function only supports strings when supplying the path to watch. Thus, if one uses Python 3.4's pathlib module for paths, it has to be converted to a string first when adding a watch:

path = pathlib.Path('a/path')
i = inotify.adapters.Inotify()
i.add_watch(str(path))

While minor, it could be useful to allow passing pathlib instances directly:

path = pathlib.Path('a/path')
i = inotify.adapters.Inotify()
i.add_watch(path)

BVollmerhaus avatar Apr 10 '19 13:04 BVollmerhaus