From 98ac69f04ccaf3328b05e65d19a24f205825be4f Mon Sep 17 00:00:00 2001 From: dhaug-op <56020126+dhaug-op@users.noreply.github.com> Date: Wed, 15 Jul 2020 17:06:30 +0200 Subject: [PATCH] Ensure path for finding root is absolute (#1550) As Path.resolve() is buggy on windows (see https://bugs.python.org/issue38671) an absolute path is ensured by prepending the Path.cwd() --- src/black/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/black/__init__.py b/src/black/__init__.py index 3d0a2d6..930f2cb 100644 --- a/src/black/__init__.py +++ b/src/black/__init__.py @@ -5834,7 +5834,7 @@ def find_project_root(srcs: Iterable[str]) -> Path: if not srcs: return Path("/").resolve() - path_srcs = [Path(src).resolve() for src in srcs] + path_srcs = [Path(Path.cwd(), src).resolve() for src in srcs] # A list of lists of parents for each 'src'. 'src' is included as a # "parent" of itself if it is a directory -- 2.39.5