Thanks.&nbsp; I updated the fix and the tests.<br><br>
<div><span class="gmail_quote">On 11/2/05, <b class="gmail_sendername">James Y Knight</b> &lt;<a href="mailto:foom@fuhm.net">foom@fuhm.net</a>&gt; wrote:</span>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">On Nov 2, 2005, at 3:50 PM, Justin Johnson wrote:<br>&gt;&nbsp;&nbsp;_cmdLineQuoteRe = re.compile(r'(\\*)&quot;')<br>
&gt;&nbsp;&nbsp;def _cmdLineQuote(s):<br>&gt; -&nbsp;&nbsp;&nbsp;&nbsp;return '&quot;' + _cmdLineQuoteRe.sub(r'\1\1\\&quot;', s) + '&quot;'<br>&gt; +&nbsp;&nbsp;&nbsp;&nbsp;quote = ((&quot; &quot; in s) or (&quot;\t&quot; in s)) and '&quot;' or ''<br>&gt; +&nbsp;&nbsp;&nbsp;&nbsp;return quote + _cmdLineQuoteRe.sub(r'\1\1\\&quot;', s) + quote
<br><br><br>That should be checking for a doublequote in addition to space and tab.<br><br>Also I just noticed another bug:<br>With input string (two characters):<br>&quot;\<br>the output should be (6 chars):<br>&quot;\&quot;\\&quot;
<br>but is currently completely incorrect:<br>&quot;\&quot;\&quot;<br><br>I think that second can be fixed with:<br>_cmdLineQuoteRe = re.compile(r'(\\*)&quot;')<br>_cmdLineQuoteRe2 = re.compile(r'(\\+)\Z')<br>def _cmdLineQuote(s):
<br>&nbsp;&nbsp;&nbsp;&nbsp;return '&quot;' + _cmdLineQuoteRe2.sub(r&quot;\1\1&quot;, _cmdLineQuoteRe.sub<br>(r'\1\1\\&quot;', s)) + '&quot;'<br><br>James<br><br>_______________________________________________<br>Twisted-Python mailing list<br>
<a href="mailto:Twisted-Python@twistedmatrix.com">Twisted-Python@twistedmatrix.com</a><br><a href="http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python">http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
</a><br></blockquote></div><br>