Skip to content

Fix config string parsing for windows pathnames (with backslashes)#27408

Merged
sbc100 merged 1 commit into
emscripten-core:mainfrom
sbc100:shlex
Jul 23, 2026
Merged

Fix config string parsing for windows pathnames (with backslashes)#27408
sbc100 merged 1 commit into
emscripten-core:mainfrom
sbc100:shlex

Conversation

@sbc100

@sbc100 sbc100 commented Jul 23, 2026

Copy link
Copy Markdown
Collaborator

By using shlex.shlex(x, posix=True) and clearing lexer.escape, config
strings are parsed with POSIX quote handling while allowing Windows
paths to be specified with backslashes.

See: #27219

@sbc100
sbc100 requested a review from dschuff July 23, 2026 16:44
@sbc100
sbc100 force-pushed the shlex branch 3 times, most recently from 1e4a31a to b4dd4e9 Compare July 23, 2026 17:24
@sbc100 sbc100 changed the title Use shlex.parse with posix=False when parsing config strings Use shlex.shlex with escape=[] when parsing config strings Jul 23, 2026
@sbc100

sbc100 commented Jul 23, 2026

Copy link
Copy Markdown
Collaborator Author

Update the approach here, because it turns out we do rely on the posix behaviour for quoting arguments with spaces in them

By using `shlex.shlex(x, posix=True)` and clearing `lexer.escape`, config
strings are parsed with POSIX quote handling while allowing Windows
paths to be specified with backslashes.

See: emscripten-core#27219
@sbc100 sbc100 changed the title Use shlex.shlex with escape=[] when parsing config strings Fix config string parsing for windows pathnames (with backslashes) Jul 23, 2026
@sbc100
sbc100 merged commit fe5be6a into emscripten-core:main Jul 23, 2026
37 of 40 checks passed
@sbc100
sbc100 deleted the shlex branch July 23, 2026 18:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants