[Twisted-Python] twisted.internet.stdio: wrong initialisation
![](https://secure.gravatar.com/avatar/8b6c7cbe1dc9797e675cb63dbb3f95eb.jpg?s=120&d=mm&r=g)
Hello, In twisted.internet.stdio, makeConnection is called on the protocol before the writer is set. This is Not Good(TM) because the makeConnection might write a welcome banner in some protocols (twisted.protcols.telnet, for example). This patch will fix this --- Twisted/twisted/internet/stdio.py 2003-03-31 21:31:15.000000000 +0200 +++ Twisted-1.0.5/twisted/internet/stdio.py 2003-06-01 17:55:26.000000000 +0200 @@ -82,10 +82,11 @@ _stdio_in_use = 1 self.fileno = sys.__stdin__.fileno fdesc.setNonBlocking(self.fileno()) + self.writer = StandardIOWriter() self.protocol = protocol self.protocol.makeConnection(self) self.startReading() - self.writer = StandardIOWriter() def write(self, data): """Write some data to standard output. Wladimir
![](https://secure.gravatar.com/avatar/d7875f8cfd8ba9262bfff2bf6f6f9b35.jpg?s=120&d=mm&r=g)
On Sun, 1 Jun 2003 17:59:48 +0200 "W.J." <miathan@goliath.darktech.org> wrote:
In twisted.internet.stdio, makeConnection is called on the protocol before the writer is set. This is Not Good(TM) because the makeConnection might write a welcome banner in some protocols (twisted.protcols.telnet, for example).
Done, thanks for the bug report. -- Itamar Shtull-Trauring http://itamarst.org/ http://www.zoteca.com -- Python & Twisted consulting
participants (2)
-
Itamar Shtull-Trauring
-
W.J.