]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
use '%s' formatting instead of '%d' for fds in IOLoop log messages 401/head
authorMinRK <benjaminrk@gmail.com>
Tue, 22 Nov 2011 23:48:46 +0000 (15:48 -0800)
committerMinRK <benjaminrk@gmail.com>
Tue, 22 Nov 2011 23:48:46 +0000 (15:48 -0800)
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

index 6286ddc844412f2be1853b66c6439fa223e1b74a..6fd29a029f061d561d561158d59ef93cb2a4312e 100644 (file)
@@ -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