473,508 Members | 2,226 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

popen4 hanging on write

I'm having trouble with Popen4 locking up on me. It appears to be
unrelated to the actual command I'm running, because I made the command
just "cat" (I'm on UNIX) to echo whatever input I sent it, and it's still
locking. The trick is, it works for small amounts of data. After roughly
1.5K of input, it locks up and will not write any more data to the pipe.
I assume a buffer got full somewhere, and it's blocking the write call.

Meanwhile, I can't read the output, because if I do that, that blocks,
too.

Anybody know how to resolve this problem? Here is my current code:

import popen2
pipe = popen2.Popen4("cat")
pipe.tochild.write(data)
pipe.tochild.close()
output = pipe.fromchild.read()
print output

Again, when data is just a few lines, it works, but not if it's maybe 1500
bytes or more. No documentation I can find addresses this problem; the
above is theoretically supposed to just work. I don't get it.

Thanks for any help anyone can give me.

Jul 18 '05 #1
0 1134

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
1797
by: Patrick L. Nolan | last post by:
We have an application that works on Linux. It has to be ported to Windows XP, and there's one bug that's driving me crazy. There's a number-crunching program written in C++. It is invoked by a...
1
2646
by: Vivien Mallet | last post by:
Hello, I use popen2.Popen4 and I experienced problems with it. Let me show you with an example. The following script is called "lines" (it prints lines of 'X'): ---------------------...
0
1340
by: Roman Yakovenko | last post by:
Hi. May be I found bug may be not, but I definitely could not find answer in documentation and GOOGLE. Environment: Windows XP and Python 2.3 Description: I have program that returns...
2
3188
by: André | last post by:
Short description: Using a wxPython based app, I would like to take a python script in an editor window, invoke the python interpreter and use another window as stdin/stdout/stderr. Based on...
0
7123
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...
0
7383
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...
1
7046
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...
0
4707
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...
0
3194
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...
0
3182
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1557
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 ...
1
766
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
418
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.