Re: [stdlib-sig] quoting arguments for command-line evaluation

2010-05-25 Thread Philip Jenvey
On May 25, 2010, at 2:54 PM, Paul Moore wrote: > On 25 May 2010 13:22, Eric Smith wrote: >> Keep in mind that these routines typically only work on Unix-like systems, >> where the shell has a set of well defined rules for quoting and parsing. On >> Windows, each executable is in charge of parsin

Re: [stdlib-sig] quoting arguments for command-line evaluation

2010-05-25 Thread Paul Moore
On 25 May 2010 13:22, Eric Smith wrote: > Keep in mind that these routines typically only work on Unix-like systems, > where the shell has a set of well defined rules for quoting and parsing. On > Windows, each executable is in charge of parsing its own parameters from a > string. This is usually

Re: [stdlib-sig] quoting arguments for command-line evaluation

2010-05-25 Thread Eric Smith
Éric Araujo wrote: In my case, I was building up a command line to pass as a single string to subprocess, and needed a way to quote the args explicitly. That's why I went looking at this. FYI, if you need the reverse operation (string → list), look at shlex. Keep in mind that these routines t

Re: [stdlib-sig] quoting arguments for command-line evaluation

2010-05-25 Thread Éric Araujo
> In my case, I was building up a command line to pass as a single string > to subprocess, and needed a way to quote the args explicitly. That's > why I went looking at this. FYI, if you need the reverse operation (string → list), look at shlex. Cheers

Re: [stdlib-sig] quoting arguments for command-line evaluation

2010-05-24 Thread Ian Bicking
On Mon, May 24, 2010 at 11:23 AM, Bill Janssen wrote: > C. Titus Brown wrote: > > > On Mon, May 24, 2010 at 07:46:32AM -0700, Bill Janssen wrote: > > > I'm kind of surprised to see that the subprocess module doesn't have a > > > documented function for calling to properly quote command-line > >

Re: [stdlib-sig] quoting arguments for command-line evaluation

2010-05-24 Thread Bill Janssen
C. Titus Brown wrote: > On Mon, May 24, 2010 at 07:46:32AM -0700, Bill Janssen wrote: > > I'm kind of surprised to see that the subprocess module doesn't have a > > documented function for calling to properly quote command-line > > arguments. Nor does it seem to do so automatically -- at least o

Re: [stdlib-sig] quoting arguments for command-line evaluation

2010-05-24 Thread C. Titus Brown
On Mon, May 24, 2010 at 07:46:32AM -0700, Bill Janssen wrote: > I'm kind of surprised to see that the subprocess module doesn't have a > documented function for calling to properly quote command-line > arguments. Nor does it seem to do so automatically -- at least on Unix. Bill, I may be about to

[stdlib-sig] quoting arguments for command-line evaluation

2010-05-24 Thread Bill Janssen
I'm kind of surprised to see that the subprocess module doesn't have a documented function for calling to properly quote command-line arguments. Nor does it seem to do so automatically -- at least on Unix. It *does* have an undocumented function called "list2cmdline" (refered to in passing in the