[Patches] [ python-Patches-1559298 ] test_popen fails on Windows if installed to "Program Files"

SourceForge.net noreply at sourceforge.net
Fri Sep 15 14:59:10 CEST 2006


Patches item #1559298, was opened at 2006-09-15 14:59
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1559298&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Windows
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Martin v. Löwis (loewis)
Assigned to: Nobody/Anonymous (nobody)
Summary: test_popen fails on Windows if installed to "Program Files"

Initial Comment:
test_popen fails in 2.5c2. The reason is that popen invokes

cmd.exe /c "c:\program files\python25\python.exe" -c
"import sys;print sys.argv"

cmd.exe does not support that syntax, and gives an
error (which silently disappears); the pipe read then
returns an empty string.

This problem exists atleast since Python 2.3.

To fix this, cmd.exe needs to be invoked as

cmd.exe /c "c:\program files\python25\python.exe" -c
"import sys;print sys.argv"

The attached patch fixes this by always wrapping the
command line with an addition pair of quotes.

It's not clear to me whether this can go into 2.5.1: an
application may already work around this problem by
passing extra quotes to popen, which would then break
if popen adds even more quotes.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1559298&group_id=5470


More information about the Patches mailing list