From c99935556ef807cc96d384a798706b2dca1498b7 Mon Sep 17 00:00:00 2001 From: Thomas Kluyver Date: Mon, 25 Jun 2018 17:26:51 +0200 Subject: [PATCH] Decode IP addresses on Windows --- notebook/notebookapp.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/notebook/notebookapp.py b/notebook/notebookapp.py index 2b0c8c209..27cbaa702 100755 --- a/notebook/notebookapp.py +++ b/notebook/notebookapp.py @@ -857,8 +857,10 @@ class NotebookApp(JupyterApp): except ValueError: # Address is a hostname for info in socket.getaddrinfo(self.ip, self.port, 0, socket.SOCK_STREAM): - addr = ipaddress.ip_address(info[4][0]) - if not addr.is_loopback: + addr = info[4][0] + if not py3compat.PY3: + addr = addr.decode('ascii') + if not ipaddress.ip_address(addr).is_loopback: return True return False else: