[Twisted-Python] ClientFactory.connectionLost(connector, reason)
Hi. I've been groaning about how Twisted loses the actual errors, and does not allow programs to accurately report them to the user. Here is some progress on fixing that.. ClientFactory's connectionLost() method will get a new parameter "reason", which will be a failure.Failure(SomeException()). There will be no backwards compatibility; I will fix atleast the code in the main tree that has tests (that succeeded before the patch!). If you want to ensure compatibility, start using "def connectionLost(connector, reason=None)" right now. At a later stage, Protocol's connectionLost will get an extra argument also, a reason as above. There will be backwards compatibility, but having a non-reason-taking Protocol will be deprecated from that moment on, with a warning message. Now, what I need from you guys is 1) review the patch 2) write TCP/Connector/ClientFactory/Protocol tests about connectionLost (and ClientFactory.connectionFailed) 3) fix cReactor 4) fix win32eventreactor 5) fix kqreactor 6) test qtreactor 7) test gtkreactor My current working patch is attached. -- tv@{{hq.yok.utu,havoc,gaeshido}.fi,{debian,wanderer}.org,stonesoft.com} double a,b=4,c;main(){for(;++a<2e6;c-=(b=-b)/a++);printf("%f\n",c);}
Tommi Virtanen wrote:
Hi. I've been groaning about how Twisted loses the actual errors, and does not allow programs to accurately report them to the user. Here is some progress on fixing that..
I've checked in an updated version of this patch. Please take a look in CVS!
participants (2)
-
Itamar Shtull-Trauring
-
Tommi Virtanen