From cdf553f506fbc786466e3b423377e5e50c320873 Mon Sep 17 00:00:00 2001 From: metroite <22453965+metroite@users.noreply.github.com> Date: Tue, 12 Aug 2025 17:41:05 +0200 Subject: [PATCH] fix failed recognition of custom containerfile due to Windows paths being misinterpreted as git urls Signed-off-by: Metroite <22453965+Metroite@users.noreply.github.com> --- podman_compose.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/podman_compose.py b/podman_compose.py index b4b24d54..84e6aa22 100755 --- a/podman_compose.py +++ b/podman_compose.py @@ -2834,7 +2834,9 @@ def is_context_git_url(path: str) -> bool: return True # URL contains a ":" character, a hint of a valid URL if r.scheme != "" and r.netloc == "" and r.path != "": - return True + # On Windows, this could be a drive letter, so we need to check the scheme + if not (os.name == "nt" and len(r.scheme) == 1): + return True if r.scheme == "": # tweak path URL to get username from url parser r = urllib.parse.urlparse("ssh://" + path) if r.username is not None and r.username != "":