-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
correct posixly shell quoting #23881
Conversation
You do make me wonder if I should have chosen another character instead. |
This was not the motivation for the PR, I just thought it would be interesting to note current known cases that this fixes (passing other exeflags is usually pretty rare, as is having shell metacharacters in the path). |
Yes, I know. I just wonder if this can cause other random script to error. Though this is just a compile flag so you normally won't use it in a script or |
2653f57
to
f8262f3
Compare
# @test contains(s, "echo hello >/dev/null") # make sure we echoed the input | ||
# end | ||
# @test readuntil(stdout_read, "\n") == "\e[0m\n" | ||
#end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: these disabled tests are left as motivation for someone to finish the implementation of #20401 🙂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do these tests not pass anymore?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With the current deprecation, they're partially broken. Hence the motivation for someone to remove the deprecation and finish implementing the #20401
Would it be possible to just make |
Perhaps, since I think currently shell_parse will get the same result when called on the result of shell_escape_posixly (that's partially of the idea of the function - to be an overly conservatively approximation of all shells). I don't think there's any particular reason to remove shell_escape however, since it's useful for its intended purpose (as a pretty-printer for Cmd objects), and I'm not sure what #20401 will want for changes to the parser. |
Actually, this isn't true, but upon further review, I think it may actually be due to other bugs in shell_escape, rather than being due to divergence between shell_parse and posix sh: julia> Base.shell_escape(` '$a"' `)
"'\$a\"'"
julia> Base.shell_escape(` '\$a\"' `)
"'\\\$a\\\"'" |
f8262f3
to
ef47e60
Compare
Ensures that
addprocs
arguments will be passed through a posix shell correctly, (including those with shell-metacharacters such as being added in #21849 for-C
, but also weird cases like--
and files named\r
).fix #10120