Skip to content

Commit 4d8e75b

Browse files
committed
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
1 parent 890450e commit 4d8e75b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/taskgraph/run-task/run-task

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,15 +199,15 @@ def remove(path):
199199
return
200200

201201
"""
202-
On Windows, adds '\\\\?\\' to paths which match ^[A-Za-z]:\\.* to access
202+
On Windows, adds '\\\\?\\' to paths which match ^[A-Za-z]:(\\|/).* to access
203203
files or directories that exceed MAX_PATH(260) limitation or that ends
204204
with a period.
205205
"""
206206
if (
207207
sys.platform in ("win32", "cygwin")
208208
and len(path) >= 3
209209
and path[1] == ":"
210-
and path[2] == "\\"
210+
and path[2] in (os.pathsep, os.altsep)
211211
):
212212
path = "\\\\?\\%s" % path
213213

0 commit comments

Comments
 (0)