New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Windows shlex fix #2895
Merged
Merged
Windows shlex fix #2895
Conversation
This file contains 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
however the double backslash _is_ special in that in prevents the 2nd backslash from escaping the following character. the reason for this is to allow shlex to consume the double backslash during command splitting.
for less surprises, stick to shlex POSIX mode, regardless of the running platform. on win32 platforms, explicitly convert a single backslash to double backslash, unless the following character is "special" fix tox-dev#2635 str_convert fixup str_convert: always use shlex POSIX mode for less surprises, stick to shlex POSIX mode, regardless of the running platform. on win32 platforms, explicitly convert a single backslash to double backslash, unless the following character is "special" fix tox-dev#2635 str_convert fixup
export SubRequest from tox.pytest add return type annotation to test fixture
gaborbernat
approved these changes
Jan 25, 2023
Add a note that backslashes remaining in the string after substitution will be handled by shlex, noting platform-specific difference.
descope bot
added a commit
to descope/django-descope
that referenced
this pull request
Feb 8, 2023
This PR contains the following updates: | Package | Type | Update | Change | Pending | |---|---|---|---|---| | [tox](https://togithub.com/tox-dev/tox) ([changelog](https://tox.wiki/en/latest/changelog.html)) | dev | minor | `4.3.5` -> `4.4.0` | `4.4.5` (+4) | --- ### Release Notes <details> <summary>tox-dev/tox</summary> ### [`v4.4.0`](https://togithub.com/tox-dev/tox/releases/tag/4.4.0) [Compare Source](https://togithub.com/tox-dev/tox/compare/4.3.5...4.4.0) #### What's Changed - Add more explanation to `list_dependencies_command` configuration option by [@​Czaki](https://togithub.com/Czaki) in [tox-dev/tox#2883 - \[pre-commit.ci] pre-commit autoupdate by [@​pre-commit-ci](https://togithub.com/pre-commit-ci) in [tox-dev/tox#2889 - Enforce constraints during install_package_deps by [@​masenf](https://togithub.com/masenf) in [tox-dev/tox#2888 - Windows shlex fix by [@​masenf](https://togithub.com/masenf) in [tox-dev/tox#2895 #### New Contributors - [@​Czaki](https://togithub.com/Czaki) made their first contribution in [tox-dev/tox#2883 **Full Changelog**: tox-dev/tox@4.3.5...4.4.0 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNC4xMDEuMCIsInVwZGF0ZWRJblZlciI6IjM0LjEwMS4wIn0=--> Co-authored-by: descope[bot] <descope[bot]@users.noreply.github.com>
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.
When parsing command lines, use
shlex(..., posix=True)
, even on windows platforms, since non-POSIX mode does not handle escape characters and quoting like a shell would. This improves cross-platform configurations without hacks or esoteric quoting.To make this transition easier, on Windows, the backslash path separator will not treated as an escape character unless it preceeds a quote, whitespace, or another backslash chracter. This allows paths to mostly be written in single or double backslash style.
Note that double-backslash will no longer be escaped to a single backslash in substitutions, instead the double backslash will be consumed as part of command splitting, on either posix or windows platforms.
In some instances superfluous double or single quote characters may be stripped from arg arrays in ways that do not occur in the default windows
cmd.exe
shell.TODO
Ensure this does not regress #2732 and other recent fixes around the substitution parser.
Thanks for contribution
Please, make sure you address all the checklists (for details on how see
development documentation)!
tox -e fix
)docs/changelog
folder