[ https://issues.apache.org/jira/browse/MESOS-10093?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17031100#comment-17031100 ]
Greg Mann edited comment on MESOS-10093 at 2/5/20 10:53 PM: ------------------------------------------------------------ On windows, we execute shell commands as arguments to {{cmd.exe}}. I ran the following test in the command prompt: {noformat} C:\Users\Administrator>cmd /c "python -c \"print('hello world')\"" File "<string>", line 1 "print('hello ^ SyntaxError: EOL while scanning string literal C:\Users\Administrator>cmd /c "python -c ^"print('hello world')^"" hello world {noformat} In libprocess, it looks like we currently escape double quotes using a backslash: https://github.com/apache/mesos/blob/4990d2cd6e76da340b30e200be0d700124dac2b1/3rdparty/stout/include/stout/os/windows/shell.hpp#L188-L191 Based on the above test, it appears that we should be escaping them with caret instead. NOTE that before merging such a change, we should confirm that changing this escaping behavior doesn't break Mesos containerizer tasks. was (Author: greggomann): On windows, we execute shell commands as arguments to {{cmd.exe}}. I ran the following test in the command prompt: {noformat} C:\Users\Administrator>cmd /c "python -c \"print('hello world')\"" File "<string>", line 1 "print('hello ^ SyntaxError: EOL while scanning string literal C:\Users\Administrator>cmd /c "python -c ^"print('hello world')^"" hello world {noformat} In libprocess, it looks like we currently escape double quotes using a backslash: https://github.com/apache/mesos/blob/4990d2cd6e76da340b30e200be0d700124dac2b1/3rdparty/stout/include/stout/os/windows/shell.hpp#L188-L191 Based on the above test, it appears that escaping them with caret instead. NOTE that before merging such a change, we should confirm that changing this escaping behavior doesn't break Mesos containerizer tasks. > Docker containerizer does handle whitespace correctly on Windows > ---------------------------------------------------------------- > > Key: MESOS-10093 > URL: https://issues.apache.org/jira/browse/MESOS-10093 > Project: Mesos > Issue Type: Bug > Affects Versions: 1.9.0 > Reporter: Greg Mann > Priority: Major > Labels: containerization, docker, mesosphere, windows > > When running some tests of Mesos on Windows, I discovered that the following > command would not execute successfully when passed to the Docker > containerizer in {{TaskInfo.command}}: > {noformat} > python -c "print('hello world')" > {noformat} > The following error is found in the task sandbox: > {noformat} > File "<string>", line 1 > "print('hello > ^ > SyntaxError: EOL while scanning string literal > {noformat} -- This message was sent by Atlassian Jira (v8.3.4#803005)