[issue8632] subprocess doesn't handle Windows built-in commands as os.system() does

2010-05-05 Thread Alex Quinn

New submission from Alex Quinn aq2...@alexquinn.org:

The documentation says subprocess replaces os.system().  However, subprocess 
does not handle built-in Windows shell commands as os.system() does.

Works:
- os.system(dir /w)
- subprocess.Popen(cmd /c dir /w, stdout=subprocess.PIPE).communicate()[0]

Does NOT work:
- Popen(dir /w, stdout=PIPE).communicate()[0]
- Popen([dir, /w], stdout=PIPE).communicate()[0]

Examples:
s:\dpython31
Python 3.1.2 (r312:79149, Mar 21 2010, 00:41:52) [MSC v.1500 32 bit (Intel)] on 
win32
Type help, copyright, credits or license for more information.
 from subprocess import Popen, PIPE
 Popen([cmd, /c, dir, /w], stdout=PIPE).communicate()[0]
   .  (WORKED)
 Popen([dir, /w], stdout=PIPE).communicate()[0]
dir: cannot access /w: No such file or directory
b''   (DIDN'T WORK)


--
components: IO, Library (Lib), Windows
messages: 105091
nosy: Alex Quinn
priority: normal
severity: normal
status: open
title: subprocess doesn't handle Windows built-in commands as os.system() does
type: behavior
versions: Python 3.1

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8632
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8632] subprocess doesn't handle Windows built-in commands as os.system() does

2010-05-05 Thread Philip Jenvey

Philip Jenvey pjen...@underboss.org added the comment:

shell commands don't work because you're not specifying the shell=True argument 
to Popen. This is covered in the subprocess Replacing os.system documentation

--
nosy: +pjenvey
resolution:  - invalid
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8632
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8632] subprocess doesn't handle Windows built-in commands as os.system() does

2010-05-05 Thread Alex Quinn

Alex Quinn aq2...@alexquinn.org added the comment:

Sorry.  My mistake.  Thanks for clarifying.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8632
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com