[prev in list] [next in list] [prev in thread] [next in thread]
List: python-patches
Subject: [Patches] [ python-Patches-660505 ] make commands.getstatusoutput work on windows
From: noreply () sourceforge ! net (noreply () sourceforge ! net)
Date: 2002-12-31 20:24:40
Message-ID: E18TSwK-0003EZ-00 () sc8-sf-web1 ! sourceforge ! net
[Download RAW message or body]
Patches item #660505, was opened at 2002-12-31 12:24
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=660505&group_id=5470
Category: Library (Lib)
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: Aleksandar Totic (atotic)
Assigned to: Nobody/Anonymous (nobody)
Summary: make commands.getstatusoutput work on windows
Initial Comment:
The following patch makes commands.getstatusoutput
work on windows NT. Original code:
pipe = os.popen('{ ' + cmd + '; } 2>&1', 'r')
did not work on window's cmd.exe. This is because
cmd.exe does not support "{}" command blocks.
To my knowledge, cmd.exe does not support command
blocks at all. So the patch simply executes the
command on nt, without any wrapping beyond adding
redirection.
old code: (r 1.15)
pipe = os.popen('{ ' + cmd + '; } 2>&1', 'r')
new code:
if (os.name == 'nt'):
pipe = os.popen(cmd + ' 2>&1', 'r')
else:
pipe = os.popen('{ ' + cmd + '; } 2>&1', 'r')
this is CVS Python source on Dec 31st, 2002, running
on Windows XP professional.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=660505&group_id=5470
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic