diff --git a/core/utils.py b/core/utils.py index 03ecd41d8f..bdc3256cc4 100755 --- a/core/utils.py +++ b/core/utils.py @@ -362,7 +362,17 @@ def get_project_path(filepath): import os dir_path = os.path.dirname(filepath) if get_command_result("git rev-parse --is-inside-work-tree", dir_path) == "true": - return get_command_result("git rev-parse --show-toplevel", dir_path) + path_from_git = get_command_result("git rev-parse --show-toplevel", dir_path) + if get_os_name() == "windows": + path_parts = path_from_git.split("/") + # if this is a Unix-style absolute path, which should be a Windows-style one + if path_parts[0] == "/": + windows_path = path_parts[1] + ":/" + "/".join(path_parts[2:]) + return windows_path + else: + return path_from_git + else: + return path_from_git else: return filepath