[Twisted-Python] Problem w/ TNPE Example on Windows

Abe Fettig abe at fettig.net
Mon Dec 19 22:52:15 EST 2005

Itamar Shtull-Trauring wrote:
> On Mon, 2005-12-19 at 11:23 -0500, Abe Fettig wrote:
>>And unfortunately I failed to notice this while writing the book.
>>Apologies to Windows users. Is it really impossible to do asynchronous
>>IO on stdin/out on Windows? Anybody have any ideas for working around
>>the lack of fcntl? I'd be happy to contribute to an effort to make
>>twisted.internet.stdio run on Windows.
> *mumble* *mumble* *blush*. That's my fault, since I did know that. 

No, it's my fault. Don't worry about it. The buck stops here. You can
make it up to me by helping make twisted.internet.stdio work on Windows
though :-)

> It may be possible to do stdio on Windows using the IOCP reactor.

According to the inline docs, twisted.internet.stdio is:

  unstable (pending deprecation in favor of a reactor-based API)
  Future Plans:
    support for stderr, perhaps
    Rewrite to use the reactor instead of an ad-hoc
        mechanism for connecting
        protocols to transport.

So for now, stdio in Twisted isn't reactor specific. As we're discussing
here, though, it only works on Unixy operating systems. Would it be sane
to try and import the fcntl module, and if that fails fall back to using
threads to fake async stdio?


More information about the Twisted-Python mailing list