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 aware. One of my colleagues summarized it >> like this: >> >> """ >> 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" on both Windows and non-Windows systems. > > 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.
FWIW, I've also struggled with similar issues. For example, with no shell= argument, Windows typically opens up an extra window to run the command, while Unix doesn't. My most recent hack around this looked something like:: try: import win32con except ImportError: win32con = None kwargs = dict(...) if win32con is not None: kwargs['creationflags'] = win32con.CREATE_NO_WINDOW subprocess.Popen(cmd, **kwargs) I'd love to see subprocess become more consistent cross-platform. Steve -- I'm not *in*-sane. Indeed, I am so far *out* of sane that you appear a tiny blip on the distant coast of sanity. --- Bucky Katt, Get Fuzzy _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com