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) *  |
Date: 2008-01-06 12:44 |
Do you call 8 months "a few days"? *g* |
|
|
msg88320 - (view) |
Author: Amaury Forgeot d'Arc (amaury.forgeotdarc) *  |
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) *  |
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. |
|
|