Re: [Python-Dev] subprocess insufficiently platform-independent?

2008-08-27 Thread Guido van Rossum
On Tue, Aug 26, 2008 at 8:08 PM, Mark Hammond [EMAIL PROTECTED] wrote: Guido quotes a colleague: Given a straightforward command list like: cmd = ['svn', 'ls', 'http://rietveld.googlecode.com/svn/trunk'] You apparently cannot pass this list to any subprocess function

Re: [Python-Dev] subprocess insufficiently platform-independent?

2008-08-27 Thread Curt Hagenlocher
On Wed, Aug 27, 2008 at 9:43 AM, Guido van Rossum [EMAIL PROTECTED] wrote: On Tue, Aug 26, 2008 at 8:08 PM, Mark Hammond [EMAIL PROTECTED] wrote: Then it works on Linux, but fails on Windows because it does not perform the Windows %PATHEXT% search that allows it to find that svn.exe is the

Re: [Python-Dev] subprocess insufficiently platform-independent?

2008-08-27 Thread Fredrik Lundh
Guido van Rossum wrote: I can't reproduce this as described. Which Windows version? This sounds like one of those things that could well vary by Windows version; if it works for you in Vista it may well be broken in XP. It could also vary by other setup parameters besides PATHEXT. It works

Re: [Python-Dev] subprocess insufficiently platform-independent?

2008-08-27 Thread Fredrik Lundh
Curt Hagenlocher wrote: I've found the documentation for CreateProcess (http://msdn.microsoft.com/en-us/library/ms682425.aspx) to be pretty reliable. And the mention of a .com in the docs suggests that the description has been around for a while... And I just described it as pretty vague ;-)

Re: [Python-Dev] subprocess insufficiently platform-independent?

2008-08-26 Thread Mark Hammond
Guido quotes a colleague: Given a straightforward command list like: cmd = ['svn', 'ls', 'http://rietveld.googlecode.com/svn/trunk'] You apparently cannot pass this list to any subprocess function (subprocess.call() or otherwise) with a set of arguments that allow it to just work

[Python-Dev] subprocess insufficiently platform-independent?

2008-08-25 Thread Guido van Rossum
Several people at Google seem to have independently discovered that despite all of the platform-independent goodness in subprocess.py, you still need to be platform aware. One of my colleagues summarized it like this: Given a straightforward command list like: cmd = ['svn', 'ls',

Re: [Python-Dev] subprocess insufficiently platform-independent?

2008-08-25 Thread Oleg Broytmann
On Mon, Aug 25, 2008 at 01:30:58PM -0400, Barry Warsaw wrote: Unless I'm misremembering (I no longer have access to Windows), I believe that if you use ' '.join(cmd) as the first argument, it will work cross-platform. What about arguments that contain spaces? Oleg. -- Oleg

Re: [Python-Dev] subprocess insufficiently platform-independent?

2008-08-25 Thread Guido van Rossum
On Mon, Aug 25, 2008 at 10:30 AM, Barry Warsaw [EMAIL PROTECTED] wrote: Unless I'm misremembering (I no longer have access to Windows), I believe that if you use ' '.join(cmd) as the first argument, it will work cross-platform. That will mean something different if there are spaces or shell

Re: [Python-Dev] subprocess insufficiently platform-independent?

2008-08-25 Thread Barry Warsaw
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Aug 25, 2008, at 1:33 PM, Oleg Broytmann wrote: On Mon, Aug 25, 2008 at 01:30:58PM -0400, Barry Warsaw wrote: Unless I'm misremembering (I no longer have access to Windows), I believe that if you use ' '.join(cmd) as the first argument, it will

Re: [Python-Dev] subprocess insufficiently platform-independent?

2008-08-25 Thread Steven Bethard
On Mon, Aug 25, 2008 at 11:30 AM, Barry Warsaw [EMAIL PROTECTED] wrote: On Aug 25, 2008, at 1:13 PM, Guido van Rossum wrote: Several people at Google seem to have independently discovered that despite all of the platform-independent goodness in subprocess.py, you still need to be platform

Re: [Python-Dev] subprocess insufficiently platform-independent?

2008-08-25 Thread Robert Brewer
Guido van Rossum wrote: Several people at Google seem to have independently discovered that despite all of the platform-independent goodness in subprocess.py, you still need to be platform aware. I can verify this. For CP we went back to using spawnl, but in an internal project we checked

Re: [Python-Dev] subprocess insufficiently platform-independent?

2008-08-25 Thread Greg Ewing
Guido van Rossum wrote: If you call: subprocess.call(cmd, shell=False) Then it works on Linux, but fails on Windows because it does not perform the Windows %PATHEXT% search that allows it to find that svn.exe is the actual executable to be invoked. Maybe the Windows implementation

Re: [Python-Dev] subprocess insufficiently platform-independent?

2008-08-25 Thread James Y Knight
On Aug 25, 2008, at 9:52 PM, Greg Ewing wrote: Guido van Rossum wrote: If you call: subprocess.call(cmd, shell=False) Then it works on Linux, but fails on Windows because it does not perform the Windows %PATHEXT% search that allows it to find that svn.exe is the actual executable to be