[PATCH] ssh: use shlex to parse command line
steve at borho.org
Thu Sep 6 22:11:35 CDT 2007
On Thu, 2007-09-06 at 20:03 -0700, Brendan Cully wrote:
> On Thursday, 06 September 2007 at 21:33, Steve Borho wrote:
> > On Thu, 2007-09-06 at 18:00 -0700, Brendan Cully wrote:
> > > On Thursday, 06 September 2007 at 15:44, Steve Borho wrote:
> > > > # HG changeset patch
> > > > # User Steve Borho <steve at borho.org>
> > > > # Date 1189111299 18000
> > > > # Node ID 2cb669d7c6f6b52ff816e5ea2a0e89513a2c8044
> > > > # Parent f8c36b215281a7e8f3aaed632206d3627ee21e6e
> > > > ssh: use shlex to parse command line
> > >
> > > This seems to break test-init here. I haven't looked into why.
> > I tracked it down to the switch from os.system() to os.popen2().
> > The i.close() is supposed to return the same status that os.system()
> > returned, but it appears to always be None, thus allowing failed create
> > commands to continue (potentially dangerous).
> > I'll see if I can find a better fix.
> os.popen returns the result code, but os.popen2 does not. Probably the
> simplest thing to do is to use util.shellquote to produce a string for
> system. Something like ' '.join([util.shellquote(x) for x in args])
> might work? I'm not clear on what windows expects in terms of quoting
Neither am I. The os.spawnv() version seems to do the right thing, and
_should_ work on Windows as well, if the literature is to be believed.
Just sit on that patch for tonight and I'll test it on a Windows machine
Steve Borho (steve at borho.org)
Key fingerprint = 2D08 E7CF B624 624C DE1F E2E4 B0C2 5292 F2C6 2C8C
More information about the Mercurial-devel