[Bug]: Driver CLI argument quoting breaks on trailing backslashes, embedded quotes and install paths with spaces
I maintainer di solito rispondono entro 1 giorno
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 69/100
Direzione di ricerca
Read src/Playwright/Program.cs and src/Playwright/Helpers/Driver.cs, especially the cited argument construction and process launch lines. Compare argument handling on the net8.0 and netstandard2.0 targets, then run the relevant driver CLI tests with trailing backslashes, embedded quotes, and an install path containing spaces. Done when arguments reach the CLI intact in each case.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Version
1.64.0, and main at d79328b
Steps to reproduce
Program.cs#L95-L99 and Driver.cs#L139-L144:
getArgs(args.Length > 0 ? "\"" + string.Join("\" \"", args) + "\"" : null)
// getArgs(null) => cliEntrypoint, unquoted
For pwsh bin/Debug/net8.0/playwright.ps1 codegen --save-storage "C:\My Dir\" https://example.com the generated command line is:
"codegen" "--save-storage" "C:\My Dir\" "https://example.com"
Under Windows argv rules, \" escapes the quote, so the last two arguments merge.
Other cases:
- Arguments that contain
", e.g.--grep 'say "hi"'or JSON passed to--viewport-size. - Running
playwright.ps1with no arguments when the project path contains a space (e.g.C:\Users\John Smith\...).cli.jsis passed unquoted, so Node.js getsC:\Users\John.
Expected behavior
Arguments reach the Playwright CLI exactly as typed.
Actual behavior
Arguments are split or merged. With no arguments and a path containing spaces, Node.js fails with Cannot find module 'C:\Users\John'.
Additional context
Fix: on .NET Core / net8.0 use ProcessStartInfo.ArgumentList. On netstandard2.0, escape per the MSVCRT rules (double the backslashes before a quote, escape "), and always quote cli.js.
#3033 (multi-targeting) would make ArgumentList available.
Environment
- Operating System: Windows (also affects Linux/macOS for no-argument + spaces)
- CPU: any
- Browser: All
- .NET Version (TFM): any
- Other info: found by code review of main @ d79328b
- Lingua principale
- C#
- Stelle
- 3k
- Fork
- 307
- Merge medio
- 1g 13h
- PR unite (30g)
- 21
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di microsoft/playwright-dotnet
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
microsoft/playwright-dotnet#3432 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
microsoft/playwright-dotnet#3426 ·
I maintainer di solito rispondono entro 1 giorno
-
[Bug]: PlaywrightSettingsProvider.LaunchOptions returns and mutates the shared runsettings objectAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
microsoft/playwright-dotnet#3425 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
microsoft/playwright-dotnet#3448 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
microsoft/playwright-dotnet#3447 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di microsoft/playwright-dotnet
Issue simili
-
.NET Docs Next Major State: Needs Discussion
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
getsentry/sentry-dotnet#5912 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
BeyondDimension/SteamTools#4163 · 1 commento ·
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 90/100
ShareX/XerahS#316 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
SubtitleEdit/subtitleedit#16825 ·
I maintainer di solito rispondono entro 1 giorno
-
ci-flake kind:tests size:S type:bug
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 82/100
elsa-workflows/elsa-foundation#4058 · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno