Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #103413 > unrolled thread

Re: nosepipe error

Started byChris Angelico <rosuav@gmail.com>
First post2016-02-24 05:42 +1100
Last post2016-02-24 05:42 +1100
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: nosepipe error Chris Angelico <rosuav@gmail.com> - 2016-02-24 05:42 +1100

#103413 — Re: nosepipe error

FromChris Angelico <rosuav@gmail.com>
Date2016-02-24 05:42 +1100
SubjectRe: nosepipe error
Message-ID<mailman.78.1456252938.20994.python-list@python.org>
On Wed, Feb 24, 2016 at 5:11 AM, Dan Stromberg <drsalists@gmail.com> wrote:
> I'm seeing, in the nosepipe code:
>         # we use stdout for IPC, so block all other output
>         self._stream = sys.__stdout__
>
> I'm not sure using stdout/stdin for IPC is a great thing; a lot of
> tests write to stdout or stderr, whether intentionally or
> unintentionally.

Using standard streams for IPC is well recognized. If it's known in
advance, it shouldn't be a problem - writing to stdout/stderr would
simply result in a test failure.

> I'm attempting to replace the use of stdout/stdin with os.pipe(), but
> so far I'm not having much luck.  I get three write()'s, and then a
> hang.  So far, I'm ignoring the fact that os.read() and os.write()
> might split or aggregate chunks over a socket, since this is a
> socketpair communicating on the same machine.

Sounds like the buffer's full. You'll need to have another thread
reading before you start writing, to prevent that.

ChrisA

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web