Author shypike
Recipients brian.curtin, exarkun, ezio.melotti, shypike
Date 2010-06-12.22:48:19
SpamBayes Score 0.00085689
Marked as misclassified No
Message-id <1276382901.9.0.529586153547.issue8972@psf.upfronthosting.co.za>
In-reply-to
Content
A work-around could be that the caller puts double quotes around the individual elements of the sequence that need it.
However, this won't work because list2cmdline doesn't handle backslash quoting properly. An element like r'"foo"' is translated to r'\"foo\"'. This is incorrect because cmd.exe cannot handle this. The backslash may be appropriate for embedded quotes (like in r'foo"bar'), but not for outer quotes (like in r'"foobar"').

The user shouldn't have to worry with adding quotes anyway, so it would be better to demand that '|' and '&' are passed as separate elements in the sequence. Example ['echo', 'foo', '&', 'bar'].
When someone passes ['echo', 'foo&bar'], it is very obvious that r'echo "foo&bar"' is expected and not r'echo foo & bar'.

I have added a patch for this way of working of list2cmdline.
History
Date User Action Args
2010-06-12 22:48:22shypikesetrecipients: + shypike, exarkun, ezio.melotti, brian.curtin
2010-06-12 22:48:21shypikesetmessageid: <1276382901.9.0.529586153547.issue8972@psf.upfronthosting.co.za>
2010-06-12 22:48:20shypikelinkissue8972 messages
2010-06-12 22:48:19shypikecreate