From 43fc77eaa869f4d56be2dd1a15c758b677ca309b Mon Sep 17 00:00:00 2001 From: Andrew Halberstadt Date: Wed, 5 Mar 2025 09:59:34 -0500 Subject: [PATCH] fix(run-task): bug deleting long path names with forward slashes on Windows This is porting a fix that landed in mozfile (where this code was copied from). Bug: 1948871 --- src/taskgraph/run-task/run-task | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/taskgraph/run-task/run-task b/src/taskgraph/run-task/run-task index b52e00342..42a97be2a 100755 --- a/src/taskgraph/run-task/run-task +++ b/src/taskgraph/run-task/run-task @@ -199,7 +199,7 @@ def remove(path): return """ - On Windows, adds '\\\\?\\' to paths which match ^[A-Za-z]:\\.* to access + On Windows, adds '\\\\?\\' to paths which match ^[A-Za-z]:(\\|/).* to access files or directories that exceed MAX_PATH(260) limitation or that ends with a period. """ @@ -207,7 +207,7 @@ def remove(path): sys.platform in ("win32", "cygwin") and len(path) >= 3 and path[1] == ":" - and path[2] == "\\" + and path[2] in (os.pathsep, os.altsep) ): path = "\\\\?\\%s" % path