From 02eaa9a14fa2994aa04936ae0d4c692c4d9067be Mon Sep 17 00:00:00 2001 From: "Mr. Outis" Date: Tue, 3 Dec 2019 18:38:11 -0600 Subject: [PATCH] py35: support for fspath(pathlib.Path()) --- dvc/utils/compat.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dvc/utils/compat.py b/dvc/utils/compat.py index 372c8d2c6..ab079c1d0 100644 --- a/dvc/utils/compat.py +++ b/dvc/utils/compat.py @@ -207,6 +207,12 @@ except ImportError: except AttributeError: if hasattr(path_type, "__fspath__"): raise + + # Support for pathlib.Path in Python 3.5, since it doesn't + # implement `__fspath__` + if isinstance(path, pathlib.Path): + return str(path) + else: raise TypeError( "expected str, bytes or os.PathLike object, "