Re: Python 2.2.1 and select()

2008-03-27 Thread Derek Martin
On Wed, Mar 26, 2008 at 07:11:15PM -0700, Noah Spurrier wrote: def set_nonblock(fd): flags = fcntl.fcntl(fd, fcntl.F_GETFL) fcntl.fcntl(fd, fcntl.F_SETFL, flags | os.O_NONBLOCK) Then in the function, after calling popen: set_nonblock(io.fromchild.fileno())

Re: Python 2.2.1 and select()

2008-03-26 Thread Derek Martin
On Wed, Mar 26, 2008 at 09:49:51AM -0700, Noah Spurrier wrote: On 2008-03-24 22:03-0400, Derek Martin wrote: That's an interesting thought, but I guess I'd need you to elaborate on how the buffering mode would affect the operation of select(). I really don't see how your explanation can cover

Re: Python 2.2.1 and select()

2008-03-25 Thread Francesco Bochicchio
Il Mon, 24 Mar 2008 17:58:42 -0400, Derek Martin ha scritto: Hi kids! I've got some code that uses select.select() to capture all the output of a subprocess (both stdout and stderr, see below). This code works as expected on a variety of Fedora systems running Python 2.4.0, but on a

Python 2.2.1 and select()

2008-03-24 Thread Derek Martin
Hi kids! I've got some code that uses select.select() to capture all the output of a subprocess (both stdout and stderr, see below). This code works as expected on a variety of Fedora systems running Python 2.4.0, but on a Debian Sarge system running Python 2.2.1 it's a no-go. I'm thinking

Re: Python 2.2.1 and select()

2008-03-24 Thread Noah
On Mar 24, 2:58 pm, Derek Martin [EMAIL PROTECTED] wrote: If and only if the total amount of output is greater than the specified buffer size, then reading on this file hangs indefinitely. For what it's worth, the program whose output I need to capture with this generates about 17k of output

Re: Python 2.2.1 and select()

2008-03-24 Thread Derek Martin
On Mon, Mar 24, 2008 at 05:52:54PM -0700, Noah wrote: On Mar 24, 2:58 pm, Derek Martin [EMAIL PROTECTED] wrote: If and only if the total amount of output is greater than the specified buffer size, then reading on this file hangs indefinitely. I think this is more of a limitation with the

Re: Python 2.2.1 and select()

2008-03-24 Thread Gabriel Genellina
En Mon, 24 Mar 2008 23:03:56 -0300, Derek Martin [EMAIL PROTECTED] escribió: On Mon, Mar 24, 2008 at 05:52:54PM -0700, Noah wrote: On Mar 24, 2:58 pm, Derek Martin [EMAIL PROTECTED] wrote: If and only if the total amount of output is greater than the specified buffer size, then reading on