From: MinRK Date: Tue, 22 Nov 2011 23:48:46 +0000 (-0800) Subject: use '%s' formatting instead of '%d' for fds in IOLoop log messages X-Git-Tag: v2.2.0~75 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F401%2Fhead;p=thirdparty%2Ftornado.git use '%s' formatting instead of '%d' for fds in IOLoop log messages In case some poller implementations accept sockets or values other than integer file descriptors, this prevents tornado's log messages from raising errors. --- diff --git a/tornado/ioloop.py b/tornado/ioloop.py index 6286ddc84..6fd29a029 100644 --- a/tornado/ioloop.py +++ b/tornado/ioloop.py @@ -172,7 +172,7 @@ class IOLoop(object): try: os.close(fd) except Exception: - logging.debug("error closing fd %d", fd, exc_info=True) + logging.debug("error closing fd %s", fd, exc_info=True) self._waker.close() self._impl.close() @@ -312,10 +312,10 @@ class IOLoop(object): # Happens when the client closes the connection pass else: - logging.error("Exception in I/O handler for fd %d", + logging.error("Exception in I/O handler for fd %s", fd, exc_info=True) except Exception: - logging.error("Exception in I/O handler for fd %d", + logging.error("Exception in I/O handler for fd %s", fd, exc_info=True) # reset the stopped flag so another start/stop pair can be issued self._stopped = False