From da7838402af64bb3265fb23d76260057af24659c Mon Sep 17 00:00:00 2001 From: MinRK Date: Tue, 22 Nov 2011 15:48:46 -0800 Subject: [PATCH] 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. --- tornado/ioloop.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 -- 2.47.2