Skip to content

Commit

Permalink
Ensure ObservedWatch.path is a string (fix gorakhargosh#651)
Browse files Browse the repository at this point in the history
  • Loading branch information
rec committed Apr 28, 2020
1 parent 077d5b1 commit d2280d4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/watchdog/observers/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
# limitations under the License.

from __future__ import with_statement
import os
import threading
from watchdog.utils import BaseThread
from watchdog.utils.compat import queue
Expand Down Expand Up @@ -46,7 +47,10 @@ class ObservedWatch(object):
"""

def __init__(self, path, recursive):
self._path = path
if isinstance(path, getattr(os, 'PathLike', ())):
self._path = os.fspath(path)
else:
self._path = path
self._is_recursive = recursive

@property
Expand Down

0 comments on commit d2280d4

Please sign in to comment.