subprocess.Popen on Windows

M

madpython

playing with subprocess.Popen on Windows I stumbled into the following
problem:
Python 2.4.3 (#69, Mar 29 2006, 17:35:34)

IDLE 1.1.3

Traceback (most recent call last):
File "<pyshell#2>", line 1, in -toplevel-
p2=subprocess.Popen("c:\\asd.bat",stdout=subprocess.PIPE)
File "C:\Python24\lib\subprocess.py", line 533, in __init__
(p2cread, p2cwrite,
File "C:\Python24\lib\subprocess.py", line 593, in _get_handles
p2cread = self._make_inheritable(p2cread)
File "C:\Python24\lib\subprocess.py", line 634, in _make_inheritable
DUPLICATE_SAME_ACCESS)
TypeError: an integer is requiredWhat do I do wrongly?
 
3

3c273

madpython said:
playing with subprocess.Popen on Windows I stumbled into the following
problem:
Python 2.4.3 (#69, Mar 29 2006, 17:35:34)

IDLE 1.1.3


Traceback (most recent call last):
File "<pyshell#2>", line 1, in -toplevel-
p2=subprocess.Popen("c:\\asd.bat",stdout=subprocess.PIPE)
File "C:\Python24\lib\subprocess.py", line 533, in __init__
(p2cread, p2cwrite,
File "C:\Python24\lib\subprocess.py", line 593, in _get_handles
p2cread = self._make_inheritable(p2cread)
File "C:\Python24\lib\subprocess.py", line 634, in _make_inheritable
DUPLICATE_SAME_ACCESS)
TypeError: an integer is required
What do I do wrongly?
I get the same thing. This only happens when using IDLE. From a command
prompt, everthing works as expected. Hopefully somebody else will know why.
Louis
 
M

mmamsch

I get the same thing. This only happens when using IDLE. From a command
prompt, everthing works as expected. Hopefully somebody else will know why.
Louis

I think IDLE replaces the sys.stdin and sys.stdout by a class to redirect IO.
So when using IDLE stdin and stdout are not integer handles anymore.

Greetings, Mathias
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,528
Members
45,000
Latest member
MurrayKeync

Latest Threads

Top