Repository navigation
Strip quotes from /system arguments on Windows - #2465
Merged
Merged
Conversation
Contributor
|
Released in https://github.com/dbcli/mycli/releases/tag/v2.32.1 ! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
On Windows,
/systemkept the quote characters in each quoted argument, becauseshlex.split(..., posix=False)does not remove them. So/system cd "my dir"failed with "The filename, directory name, or volume label syntax is incorrect", and/system python -c "print(12)"ran a string literal and printed nothing.This drops one pair of matching surrounding quotes (single or double) from each token when
WINis true. It is the same rule/sourcealready uses for its filename. POSIX is unchanged.Behavior change: on Windows a single-quoted token such as
'Write-Output 7'now loses its quotes. Before, the program received the quotes as text and printedWrite-Output 7instead of running it.Not changed: a quote in the middle of a word, such as
--opt="a b", is still split by non-POSIXshlex, same as before.Checks I ran on Windows 11, Python 3.14.7, on top of main 762f107:
test_special_io_commands.py: 226 passed, 18 skipped. The 4 new test cases fail without the fix.test_special_llm.pyignored: 86 failed, 3435 passed. The same 86 fail on main (POSIX-only tests on Windows), and main has 3430 passed.ruff check .,ruff format --check .andmypy --platform linuxon the changed file are clean.cd "tmp dir"andcd 'tmp dir'change directory.python -c "print(12)"prints 12.powershell -Command "Write-Output 8"prints 8.Fixes #2464
Validated with Claude Opus 5.5.
Checklist
changelog.mdfile.mycli/AUTHORS.txtfile (or it's already there).