473,387 Members | 1,611 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Subprocess timeout

I'm trying to use a threaded timeout decorator (http://
aspn.activestate.com/ASPN/Cookbook/Python/Recipe/483752) to spawn a
subprocess with a timeout. On a linux box runnning python 2.5 I get
"OSError: [Errno 10] No child processes" on wait(); running the same
program on a different box (again linux) with python 2.4 doesn't throw
an exception. Here's a sample snippet:

import os
from subprocess import Popen,PIPE

@timelimit(3)
def f(cmd):
return Popen(cmd, stdout=PIPE)
p = f('ls')
print os.getpid(), p.pid
# the next line raises OSError on 2.5 but not on 2.4
print os.waitpid(p.pid, 0)

What gives ?

George

Mar 1 '07 #1
0 1259

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

Similar topics

1
by: Greg Kuperberg | last post by:
I want to run subprocesses with limits on the execution time and the output size of the subprocess. If the subprocess exceeds limits, then the parent should kill it gracefully (SIGTERM rather than...
2
by: Jacek Popławski | last post by:
In the last week I was working to create script which will read command from socket, call it, return result, stdout, stderr and kill it after timeout. After playing with threads, processes, spawns...
3
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...
0
by: I. Myself | last post by:
I want my Python program to invoke a compiled C program, and capture the text output. Here's a fragment from a program that works, using subprocess.Popen: p = Popen(execName, stdout=PIPE)...
0
by: Corey Wallis | last post by:
Dear All, I'm currently working on a project that needs to collect the output of the JHOVE application. More information about the application is available at this website: ...
5
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...
9
by: Phoe6 | last post by:
Hi all, Consider this scenario, where in I need to use subprocess to execute a command like 'ping 127.0.0.1' which will have a continuous non- terminating output in Linux. # code # This...
10
by: JD | last post by:
Hi, I want send my jobs over a whole bunch of machines (using ssh). The jobs will need to be run in the following pattern: (Machine A) (Machine B) (Machine C) Job A1 Job B1 ...
12
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...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...

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.