[Twisted-Python] twisted.spread PB over a ProcessProtocol

exarkun at twistedmatrix.com exarkun at twistedmatrix.com
Mon Aug 17 21:50:05 EDT 2009


On 15 Aug, 12:36 pm, thomas at apestaart.org wrote:
>[snip]
>
>c) on hitting ctrl-c, tracebacks are generated, due to this block of
>code:
>        # At least on OS X 10.4, exiting while stdout is non-blocking
>can
>        # result in data loss.  For some reason putting the file
>descriptor
>        # back into blocking mode seems to resolve this issue.
>        fdesc.setBlocking(self.fd)
>
>The exception is EBADF.
>
>That code looks suspicious to me - shouldn't it be at least checking 
>for
>exceptions there ? the fd could already be closed IMO.

I think the code was written with the assumption that the fd couldn't 
possibly by closed by that point.  If you have an example where this 
assumption is invalid, cool!  Any chance of shortening the code to just 
highlight this point?

Jean-Paul



More information about the Twisted-Python mailing list