-
Notifications
You must be signed in to change notification settings - Fork 4k
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: backslashes passed to subprocess are unnecessarily unescaped. #4001
Comments
/cc @laszlocsomor |
Any update on this? |
I can take a look. |
I think the problem is we always escape bazel/src/tools/launcher/util/launcher_util.cc Lines 111 to 142 in a5833a8
But |
We need a similar test for Python and Java bazel/src/test/py/bazel/launcher_test.py Lines 276 to 316 in a5833a8
|
@meteorcloudy , I think we always have to follow Command Prompt escaping rules, not Bash escaping, because we pass the escaped arguments to CreateProcess. I have a pending change that fixes this. |
Right, but when we launch the exact binary Let's see if your change will break |
You're right, my change did break |
Ah, now I understand what you meant by this ;) |
I agree :) |
Kindly ping? |
I haven't been able to work on this lately. |
@yilei Sorry for the delay. |
Just sent a fix to review: |
…py_binary. Added a workaround for bazelbuild/bazel#4001 in absltest_test.py. PiperOrigin-RevId: 182114298
It has been fixed since bazel 0.10.0. PiperOrigin-RevId: 189957103
Please provide the following information. The more we know about your system and use case, the more easily and likely we can help.
Description of the problem / feature request / question:
I am running the generated .exe file of a py_binary, which is a data deps of another py_test. The backslashes in the arguments passed to the .exe file end up unnecessarily unescaped in the py_binary.
If possible, provide a minimal example to reproduce the problem:
BUILD:
main.py:
sub.py:
bazel test :main
fails, becausesys.argv[1]
is actuallyr'path\\to\\dir'
instead ofr'path\to\dir'
.Environment info
Operating System:
Windows Server 2016
Bazel version (output of
bazel info release
):release 0.7.0
The text was updated successfully, but these errors were encountered: