-
Notifications
You must be signed in to change notification settings - Fork 340
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
Pipe character issues on Windows. #752
Comments
So it seems like we are plagued by yet again another quotes swallowing issue, here is the content of the
Note how the quotes have disappeared around the regex pattern? Changing to |
A bit of low-key debugging for a few definitions:
A few notes:
|
Actually just escaping the double-quotes with
I guess the issue is considered fixed but before closing I'm assuming the behaviour in 2.16.0 was incorrect then? |
Sorry you had to go through this. I did change However, as you point out correctly, it does not have enough context to do a good job. So instead, like you discovered, we should roll our own function that does take care about special, shell dependent characters.
I hope this does not introduce other problems but my suggestion is we include list2cmdline internally (good since it is deprecated = internal API anyway) and extend it to our needs. |
I just tested: At least the shell is smart enough to identify real redirection characters immediately. So my suggestion should be safe: Anything that has redirection characters at the point of our join parsing must actually be a string parameter and should be therefore quoted. Fingers crossed. |
Details aside, would it make sense to encapsulate this into a
`Shell.shlex_join` method?
A
…On Thu, Nov 21, 2019 at 3:25 AM Blazej Floch ***@***.***> wrote:
I just tested: At least the shell is smart enough to identify real
redirection characters immediately. So my suggestion should be safe:
Anything that has redirection characters at the point of our join parsing
must actually be a string parameter and should be therefore quoted.
Fingers crossed.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#752>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAMOUSW3XJJTKGU45VG2AKTQUVQIRANCNFSM4I3VQLGQ>
.
|
It already is in It seems that this kind of stuff is a mixture of os (process creation) and shell. So keeping them in utils and picking the right one based on the shell seems to be all the flexibility we need. Haven't read this thoroughly but seems to be a good reference for windows: |
I really should try to remember my own methods.
A
…On Thu, Nov 21, 2019 at 9:22 AM Blazej Floch ***@***.***> wrote:
It already is in Shell.join :)
https://github.com/nerdvegas/rez/blob/master/src/rez/shells.py#L281
It seems that this kind of stuff is a mixture of os (process creation) and
shell. So keeping them in utils and picking the right one based on the
shell seems to be all the flexibility we need.
Haven't read this thoroughly but seems to be a good reference for windows:
https://blogs.msdn.microsoft.com/twistylittlepassagesallalike/2011/04/23/everyone-quotes-command-line-arguments-the-wrong-way/
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#752>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAMOUSQ7WF5MHWFFANN2L3DQUW2DVANCNFSM4I3VQLGQ>
.
|
Hi,
I'm testing Rez 2.47.2 and encountering issues with pipe character handling, this time and for a change, a picture:
This is quite a problematic one, we are passing regex patterns as arguments often and it just breaks now.
I can escape them like this to some degree:
But I could not get it to work with more complex invocations unfortunately. Assuming a my-command.bat file which does echo its arguments, i.e.
echo %*
, in the current working directory:I could change
echo %*
toecho "%*"
and it would work but ifecho
is instead a Python program which expects arguments it will break because of the double quotes as it will receive the whole line as a single argument instead of the granular arguments.The text was updated successfully, but these errors were encountered: