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

Add watch directly on pathlib instances #70

Open
BVollmerhaus opened this issue Apr 10, 2019 · 0 comments
Open

Add watch directly on pathlib instances #70

BVollmerhaus opened this issue Apr 10, 2019 · 0 comments

Comments

@BVollmerhaus
Copy link

BVollmerhaus commented Apr 10, 2019

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)
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