[Python-Dev] 'commands' module on Win32 (original) (raw)
Tim Peters tim.peters at gmail.com
Fri Aug 13 16:52:10 CEST 2004
- Previous message: [Python-Dev] 'commands' module on Win32
- Next message: [Python-Dev] block-based decorators and other block issues
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
[Nick Coghlan]
... Are there any objections to changing this module so that only getstatus() is marked as Unix specific?
-0. It works on Unix. On Windows you have to distinguish among command.com systems (95/98/ME), cmd.exe systems (NT/2K/XP), and systems where the user installed their own COMSPEC shell. The command.com systems can't redirect stderr, and always return a status of 0 (command.com's own exit code, which has nothing to do with the exit code of the command being run). "It should work" on cmd.exe systems. Can't say anything definitive about use-my-own-shell systems.
IOW, telling the truth would complicate the docs, and the result wouldn't be portable across Windows boxes anyway. So I'd rather leave commands.py in peace, short, simple, obvious, but limited to Unix. It's not a suitable basis for a good solution to x-platform command-line work (Tcl's "exec" subsystem is an example of a good solution, but it's a lot of work).
- Previous message: [Python-Dev] 'commands' module on Win32
- Next message: [Python-Dev] block-based decorators and other block issues
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]