473,570 Members | 2,844 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

subprocess.Pope n on Windows

playing with subprocess.Pope n 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.P open("c:\\asd.b at") #works OK
p2=subprocess.P open("c:\\asd.b at",stdout=subp rocess.PIPE)
Traceback (most recent call last):
File "<pyshell#2 >", line 1, in -toplevel-
p2=subprocess.P open("c:\\asd.b at",stdout=subp rocess.PIPE)
File "C:\Python24\li b\subprocess.py ", line 533, in __init__
(p2cread, p2cwrite,
File "C:\Python24\li b\subprocess.py ", line 593, in _get_handles
p2cread = self._make_inhe ritable(p2cread )
File "C:\Python24\li b\subprocess.py ", line 634, in _make_inheritab le
DUPLICATE_SAME_ ACCESS)
TypeError: an integer is required

What do I do wrongly?

Jun 23 '06 #1
3 12741
"madpython" <ma*******@gmai l.com> wrote in message
news:11******** **************@ g10g2000cwb.goo glegroups.com.. .
playing with subprocess.Pope n 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.P open("c:\\asd.b at") #works OK
p2=subprocess.P open("c:\\asd.b at",stdout=subp rocess.PIPE)
Traceback (most recent call last):
File "<pyshell#2 >", line 1, in -toplevel-
p2=subprocess.P open("c:\\asd.b at",stdout=subp rocess.PIPE)
File "C:\Python24\li b\subprocess.py ", line 533, in __init__
(p2cread, p2cwrite,
File "C:\Python24\li b\subprocess.py ", line 593, in _get_handles
p2cread = self._make_inhe ritable(p2cread )
File "C:\Python24\li b\subprocess.py ", line 634, in _make_inheritab le
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*******@gmai l.com> wrote in message
news:11******* *************** @g10g2000cwb.go oglegroups.com. ..
playing with subprocess.Pope n 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.P open("c:\\asd.b at") #works OK
>>> p2=subprocess.P open("c:\\asd.b at",stdout=subp rocess.PIPE)


Traceback (most recent call last):
File "<pyshell#2 >", line 1, in -toplevel-
p2=subprocess.P open("c:\\asd.b at",stdout=subp rocess.PIPE)
File "C:\Python24\li b\subprocess.py ", line 533, in __init__
(p2cread, p2cwrite,
File "C:\Python24\li b\subprocess.py ", line 593, in _get_handles
p2cread = self._make_inhe ritable(p2cread )
File "C:\Python24\li b\subprocess.py ", line 634, in _make_inheritab le
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
5495
by: Darren Dale | last post by:
I'm a developer on the matplotlib project, and I am having trouble with the subprocess module on windows (Python 2.4.2 on winXP). No trouble to report with linux. I need to use _subprocess instead of pywin32, but my trouble exists with either option: import subprocess process = subprocess.Popen(, stderr=subprocess.STDOUT,...
13
5094
by: bayer.justin | last post by:
Hi, I am trying to communicate with a subprocess via the subprocess module. Consider the following example: <subprocess.Popen object at 0x729f0> Here hey is immediately print to stdout of my interpreter, I did not type in the "hey". But I want to read from the output into a string, so I do
5
14303
by: Grant Edwards | last post by:
I'm trying to use the py-gnuplot module on windows, and have been unable to get it to work reliably under Win2K and WinXP. By default, it uses popen(gnuplotcmd,'w'), but in some situations that consistently gets an "invalid operand" IOError when write() is called on the pipe. So I switched to subprocess. It works fine when executed...
12
10973
by: Eric_Dexter | last post by:
I am trying to modify a programming example and I am coming up with two problems... first is that I can't seem to pass along the arguments to the external command (I have been able to do that with the old module and cmd is the command I wish to try) all the output seems to be returned as one line (at least when I run the program in spe). ...
12
4515
by: bhunter | last post by:
Hi, I've used subprocess with 2.4 several times to execute a process, wait for it to finish, and then look at its output. Now I want to spawn the process separately, later check to see if it's finished, and if it is look at its output. I may want to send a signal at some point to kill the process. This seems straightforward, but it...
8
4160
by: clyfish | last post by:
In cmd, I can use find like this. C:\>netstat -an | find "445" TCP 0.0.0.0:445 0.0.0.0:0 LISTENING UDP 0.0.0.0:445 *:* C:\> And os.system is OK. TCP 0.0.0.0:445 0.0.0.0:0 LISTENING
25
2755
by: Jeremy Banks | last post by:
Hi. I wondered if anyone knew the rationale behind the naming of the Popen class in the subprocess module. Popen sounds like the a suitable name for a function that created a subprocess, but the object itself is a subprocess, not a "popen". It seems that it would be more accurate to just name the class Subprocess, can anyone explain why this...
0
1316
by: Eric Carlson | last post by:
Werner F. Bruhin wrote: Try: p = subprocess.Popen(command, shell=True, tdin=subprocess.PIPE, stdout=subprocess.PIPE) was working on xp and osx
1
8594
by: Mark Shewfelt | last post by:
Hello, I am attempting to use Popen() in a Windows service. I have a small Win32 .exe that I normally run through the os.popen2() function. I've written a class to work with the input and output parameters that are passed and captured from this exe. When I use the class outside of a service using either subprocess.Popen or os.popen2 work...
0
7726
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7636
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8150
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7700
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
8000
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5523
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5247
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3682
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
2131
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.