Skip to content
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 test scripts don't escape commas properly #115556

Closed
ambv opened this issue Feb 16, 2024 · 1 comment
Closed

Windows test scripts don't escape commas properly #115556

ambv opened this issue Feb 16, 2024 · 1 comment
Labels
build The build process and cross-build OS-windows

Comments

@ambv
Copy link
Contributor

ambv commented Feb 16, 2024

In Windows batch file execution, a comma is one of the magic parameter delimiters. To pass a comma as parameter data, you have to use string quotes around that parameter, like:

.\Tools\buildbot\test.bat -M33g "-uall,extralargefile" test_zipfile64

However, now the quotes become part of the parameter. Inside test.bat we employ some command-line parsing and shifting, which requires us to remove the quotes from parameters, if any, for the code to continue working.

This is doubly complicated by the fact that test.bat passes execution to rt.bat, which does similar parsing there. The fix is needed there, too.

Linked PRs

@ambv ambv added OS-windows build The build process and cross-build labels Feb 16, 2024
ambv added a commit to ambv/cpython that referenced this issue Feb 16, 2024
…t and rt.bat

This change essentially replaces usage of `%1` with `%~1`, which removes
quotes, if any. Without this change, the if statements fail due to
the quotes mangling the syntax.
ambv added a commit to ambv/cpython that referenced this issue Feb 16, 2024
…t and rt.bat

This change essentially replaces usage of `%1` with `%~1`, which removes
quotes, if any. Without this change, the if statements fail due to
the quotes mangling the syntax.
ambv added a commit that referenced this issue Feb 16, 2024
…rt.bat (#115557)

This change essentially replaces usage of `%1` with `%~1`, which removes
quotes, if any. Without this change, the if statements fail due to
the quotes mangling the syntax.

Additionally, this change works around comma being treated as a parameter
delimiter in test.bat by escaping commas at time of parsing. Tested
combinations of rt and regrtest arguments, all seems to work as before
but now you can specify commas in arguments like "-uall,extralargefile".
woodruffw pushed a commit to woodruffw-forks/cpython that referenced this issue Mar 4, 2024
…t and rt.bat (python#115557)

This change essentially replaces usage of `%1` with `%~1`, which removes
quotes, if any. Without this change, the if statements fail due to
the quotes mangling the syntax.

Additionally, this change works around comma being treated as a parameter
delimiter in test.bat by escaping commas at time of parsing. Tested
combinations of rt and regrtest arguments, all seems to work as before
but now you can specify commas in arguments like "-uall,extralargefile".
@hugovk
Copy link
Member

hugovk commented Mar 15, 2024

Closing because the PR has been merged. Please re-open if there's more needed here.

@hugovk hugovk closed this as completed Mar 15, 2024
diegorusso pushed a commit to diegorusso/cpython that referenced this issue Apr 17, 2024
…t and rt.bat (python#115557)

This change essentially replaces usage of `%1` with `%~1`, which removes
quotes, if any. Without this change, the if statements fail due to
the quotes mangling the syntax.

Additionally, this change works around comma being treated as a parameter
delimiter in test.bat by escaping commas at time of parsing. Tested
combinations of rt and regrtest arguments, all seems to work as before
but now you can specify commas in arguments like "-uall,extralargefile".
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build The build process and cross-build OS-windows
Projects
None yet
Development

No branches or pull requests

2 participants