473,659 Members | 2,671 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.wr ite(data)
pipe.tochild.cl ose()
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 1141

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

Similar topics

2
1801
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 Tkinter python script. The script uses the threading module to separate out the heavy processing. The worker thread uses popen4 to run the C++ program and capture its standard output. This output is sent to the master thread through a queue...
1
2656
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'): --------------------- #!/usr/bin/env python import sys
0
1344
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 negative numbers as errors int main() { return -1; }
2
3199
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 what I've read so far, I've figured that I need to do something like: f_in, f_out = popen4("python -u script.py") where I have extracted the text from the editor and put it in "script.py". (However, see below).
0
8332
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
8525
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 most users, this new feature is actually very convenient. If you want to control the update process,...
0
7356
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6179
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5649
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4175
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4335
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2750
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
2
1975
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.