This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: get status output fix for Win32
Type: Stage: resolved
Components: Library (Lib), Windows Versions: Python 2.6
process
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: tim.golden Nosy List: amaury.forgeotdarc, christian.heimes, dandel1984, jorend, tim.golden
Priority: normal Keywords: patch

Created on 2007-04-25 23:13 by dandel1984, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
win32_commands.diff dandel1984, 2007-04-25 23:13 Fix for commands.py
Messages (6)
msg52526 - (view) Author: Ken Phillis Jr. (dandel1984) Date: 2007-04-25 23:13
the two command output retrieval functions for python are broken on win32, and this patch fixes this, although it is possible that this fix will also work on dos, and os/2, but i am not sure about this... I've already tested it against python 2.5, 2.4 and 2.3, on windows xp and server 2k3.
msg52527 - (view) Author: Jason Orendorff (jorend) Date: 2007-04-26 14:27
Ken, thanks for the patch!  To be considered for Python 2.6, this patch would have to update documentation (Doc/lib) and tests (Lib/test) as well.

But more importantly:  This entire module is likely to be deprecated in Python 2.6, in favor of the subprocess module (which will gain new functions, subprocess.get_output() and subprocess.get_status_output().)  There was a long discussion about it on python-dev:

(start of a long thread)
http://mail.python.org/pipermail/python-dev/2007-March/071929.html

(even more)
http://mail.python.org/pipermail/python-dev/2007-March/072046.html

If that happens, there's no particular reason to do this, right?
msg52528 - (view) Author: Ken Phillis Jr. (dandel1984) Date: 2007-04-27 01:14
there is still a reason to do this, except for it'll haft to be integrated into the new module, because of how windows/dos handle the command line input, and most people will try working it as is, which is just simply put in a windows/dos command and expect it to work like it does in unix based systems, at which this does the job really well... a sample of that would be to call it like so:

commands.get_output("echo Testing")

as for tests I'll get that generated fast, so expect something to be posted in a few days.
msg59363 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2008-01-06 12:44
Do you call 8 months "a few days"? *g*
msg88320 - (view) Author: Amaury Forgeot d'Arc (amaury.forgeotdarc) * (Python committer) Date: 2009-05-25 17:11
The 'commands' module is deprecated, and has been removed in Python 3.0:
http://docs.python.org/dev/library/commands.html

The recommended (and portable) method is to use subprocess:
    p = subprocess.Popen(command, stdout=PIPE, stderr=STDOUT, shell=True)
    output = p.communicate()[0]

I suggest closing this issue.
msg113289 - (view) Author: Tim Golden (tim.golden) * (Python committer) Date: 2010-08-08 17:29
OK, I'm going to close this one:

* commands is out of 3.x
* it's a convenience for 2.x anyway, not a showstopper

If anyone feels keen enough to reopen the request, I'm willing to commit a suitable patch against the release27-maint branch, but I'm not interested in running it up myself.
History
Date User Action Args
2022-04-11 14:56:24adminsetgithub: 44900
2010-08-08 17:29:27tim.goldensetstatus: open -> closed
resolution: out of date
messages: + msg113289

stage: test needed -> resolved
2010-08-06 15:21:24tim.goldensetassignee: tim.golden

nosy: + tim.golden
2009-05-25 17:11:51amaury.forgeotdarcsetnosy: + amaury.forgeotdarc

messages: + msg88320
versions: - Python 3.1
2009-04-27 23:51:36ajaksu2setstage: test needed
versions: + Python 3.1
2008-01-06 12:44:34christian.heimessetnosy: + christian.heimes
messages: + msg59363
components: + Windows
versions: + Python 2.6
2007-04-25 23:13:38dandel1984create