469,934 Members | 1,496 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,934 developers. It's quick & easy.

subprocess.Popen on Windows

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
import subprocess
p1=subprocess.Popen("c:\\asd.bat") #works OK
p2=subprocess.Popen("c:\\asd.bat",stdout=subproces s.PIPE)
Traceback (most recent call last):
File "<pyshell#2>", line 1, in -toplevel-
p2=subprocess.Popen("c:\\asd.bat",stdout=subproces s.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?

Jun 23 '06 #1
3 12426
"madpython" <ma*******@gmail.com> wrote in message
news:11**********************@g10g2000cwb.googlegr oups.com...
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
import subprocess
p1=subprocess.Popen("c:\\asd.bat") #works OK
p2=subprocess.Popen("c:\\asd.bat",stdout=subproces s.PIPE)
Traceback (most recent call last):
File "<pyshell#2>", line 1, in -toplevel-
p2=subprocess.Popen("c:\\asd.bat",stdout=subproces s.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
Jun 23 '06 #2
On 23.06.2006 23:12:02, "3c273" wrote:
"madpython" <ma*******@gmail.com> wrote in message
news:11**********************@g10g2000cwb.googleg roups.com...
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
>>> import subprocess
>>> p1=subprocess.Popen("c:\\asd.bat") #works OK
>>> p2=subprocess.Popen("c:\\asd.bat",stdout=subproces s.PIPE)


Traceback (most recent call last):
File "<pyshell#2>", line 1, in -toplevel-
p2=subprocess.Popen("c:\\asd.bat",stdout=subproces s.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


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
Jun 24 '06 #3
Hi,

Been there - try looking at:
http://groups.google.com/group/comp....9feabbfc940b01

Cheers,
Uri

Jun 25 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Darren Dale | last post: by
5 posts views Thread by Grant Edwards | last post: by
12 posts views Thread by Eric_Dexter | last post: by
12 posts views Thread by bhunter | last post: by
25 posts views Thread by Jeremy Banks | last post: by
reply views Thread by Eric Carlson | last post: by
1 post views Thread by Mark Shewfelt | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.