[Twisted-Python] internet.app reports worng errors on bind()ing

Doobee R. Tzeck drt at un.bewaff.net
Fri Feb 15 16:50:09 EST 2002

internet.app assumed 'port already bound' is the only error which
can happen wen bind()ing. What's about 'premission denied' and
all the others. This patch fixes that.



app gives a misleading errormessage when a error while binding to
a port occures. This patch logs the error which actually has happended.
 --drt at un.bewaff.net - http://c0re.jp/
diff -u -r Twisted-0.15.0/twisted/internet/app.py Twisted/twisted/internet/app.py
--- Twisted-0.15.0/twisted/internet/app.py      Wed Jan 23
    04:09:39 2002
+++ Twisted/twisted/internet/app.py     Fri Feb 15 22:35:05 2002
@@ -348,8 +348,8 @@
             for port in self.ports:
-                except socket.error:
-                    log.msg('port %s already bound' % port.port)
+                except socket.error, msg:
+                    log.msg('port %s: error: %s' % (port.port, msg[1]))
             for connector in self.connectors:

teenage mutant ninja hero coders from da c0re - http://c0re.jp/
me                                  - http://koeln.ccc.de/~drt/

More information about the Twisted-Python mailing list