[Buildbot-devel] Annoying behavior for ShellCommand under Win32
exarkun at twistedmatrix.com
exarkun at twistedmatrix.com
Wed Jan 27 19:44:49 UTC 2010
On 07:12 pm, fcrestois at hotmail.com wrote:
>
>I am integrating Buildbot 7.12 with Python 2.6 and Twisted 8.2 under
>Windows XP
>And I find the same annoying behavior than BuildBot 7.5 with Python 2.4
>and Twisted 2.4
>
>For windows user, It is very convenient to start directly the
>VisualStudio devenv command line to make a build
>This command line have a parameters like 1Cplateform|configuration 1D
>
>If I run a simple build factory with a shell command step like
>
>from buildbot.steps.shell import ShellCommand
>factory.addStep(ShellCommand(command=r'echo "Win32|Release"'))
>
>The stdio display the wrong result \"Win32|Release\"
>
>The problem come from the function cmdLineQuote(s) from
>twisted\python\win32.py
>The 1Cquoting under windows 1D thread is a 5 years old bug :
>http://twistedmatrix.com/trac/ticket/1123
Thanks for pointing this out. I was going to point you at this buildbot
ticket:
http://buildbot.net/trac/ticket/377
which itself refers to another ticket in the Twisted tracker:
http://twistedmatrix.com/trac/ticket/3933
which is closed as invalid. I think #3933 was a duplicate of #1123, so
I'm going to go close #1123 as invalid now as well.
Here's my conclusion from ticket #3933:
Okay, so after some more careful investigation, including tracking down
the source of this report to http://buildbot.net/trac/ticket/377 and far
more time than I really cared to spend reading documentation about
Windows brain damage, my conclusion is that this isn't a valid bug.
The API Twisted wraps, CreateProcess, does not require | to be quoted.
Quoting does no harm, but neither does it do any good. Instead, it is
certain other programs which have quoting rules of which Twisted is
presently unaware. For example, cmd.exe does require | to be quoted.
spawnProcess is the wrong place to fix cmd.exe quoting issues, though.
Instead, if a nice, error-resistant cmd.exe-invocation API is desired,
it should be layered on top of spawnProcess and the appropriate quoting
rules added there.
I still think this is true. BuildBot is providing an API for invoking
cmd.exe, apparently. This means the quoting rules belong somewhere in
BuildBot. I'm not familiar enough with BuildBot's command running code
to say exactly where this belongs, though.
Jean-Paul
More information about the devel
mailing list