Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > subprocess.Popen on Windows

Reply
Thread Tools

subprocess.Popen on Windows

 
 
madpython
Guest
Posts: n/a
 
      06-23-2006
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?

 
Reply With Quote
 
 
 
 
3c273
Guest
Posts: n/a
 
      06-23-2006
"madpython" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) 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


 
Reply With Quote
 
 
 
 
mmamsch
Guest
Posts: n/a
 
      06-24-2006
On 23.06.2006 23:12:02, "3c273" wrote:
>"madpython" <(E-Mail Removed)> wrote in message
>news:(E-Mail Removed) 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
 
Reply With Quote
 
Uri Nix
Guest
Posts: n/a
 
      06-25-2006
Hi,

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

Cheers,
Uri

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
!Windows Live Mail replace Outlook Express on Windows XP and Windows Mail on Vista... Max Burke NZ Computing 8 05-18-2007 12:10 AM
Windows XP Home Connected to Windows XP Pro via TCP/IP Armstrong Wong Wireless Networking 1 11-25-2004 01:12 PM
wireless ad-hoc with Windows XP and Windows 2000 =?Utf-8?B?ZHVtbWthdWY=?= Wireless Networking 1 09-23-2004 11:34 AM
Windows XP laptop and Windows 2000 desktop won't communicate =?Utf-8?B?UmlmbGVtYW4=?= Wireless Networking 0 08-19-2004 03:35 AM



Advertisments