Re: nosepipe error

2016-02-23 Thread Chris Angelico
On Wed, Feb 24, 2016 at 5:11 AM, Dan Stromberg  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
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: nosepipe error

2016-02-23 Thread Dan Stromberg
On Tue, Feb 23, 2016 at 9:43 AM, Chris Angelico  wrote:
> On Wed, Feb 24, 2016 at 4:36 AM, Dan Stromberg  wrote:
>> Message: Unhandled exception in thread started by
>> sys.excepthook is missing
>> lost sys.stderr
>>
>> That 1433299041 looks like ASCII:
> hex(1433299041)
>> '0x556e6861'
> chr(0x55) + chr(0x6e) + chr(0x68) + chr(0x61)
>> 'Unha'
>>
>> ...but I'm not sure where to go with that from there.
>
> My eye sees those characters as being the beginning of "Unhandled
> exception in thread". You could be dealing with multiple levels of
> cascading exceptions.

Agreed - at least "Unhandled exception".

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.

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.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: nosepipe error

2016-02-23 Thread Chris Angelico
On Wed, Feb 24, 2016 at 4:36 AM, Dan Stromberg  wrote:
> Message: Unhandled exception in thread started by
> sys.excepthook is missing
> lost sys.stderr
>
> That 1433299041 looks like ASCII:
 hex(1433299041)
> '0x556e6861'
 chr(0x55) + chr(0x6e) + chr(0x68) + chr(0x61)
> 'Unha'
>
> ...but I'm not sure where to go with that from there.

My eye sees those characters as being the beginning of "Unhandled
exception in thread". You could be dealing with multiple levels of
cascading exceptions.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list