From f76ce1d6b9c73c12821c7f0fa6052e56b38c446e Mon Sep 17 00:00:00 2001 From: Min RK Date: Sun, 1 Mar 2015 20:21:43 -0800 Subject: [PATCH] warn about failure to bind to localhost when falling back on 127.0.0.1 --- IPython/html/notebookapp.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/IPython/html/notebookapp.py b/IPython/html/notebookapp.py index e53c52238..eca47c488 100644 --- a/IPython/html/notebookapp.py +++ b/IPython/html/notebookapp.py @@ -418,7 +418,8 @@ class NotebookApp(BaseIPythonApplication): s = socket.socket() try: s.bind(('localhost', 0)) - except socket.error: + except socket.error as e: + self.log.warn("Cannot bind to localhost, using 127.0.0.1 as default ip\n%s", e) return '127.0.0.1' else: s.close()