We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ceaf1c1 commit 1901eeaCopy full SHA for 1901eea
notebook/base/handlers.py
@@ -35,7 +35,7 @@
35
36
from traitlets.config import Application
37
from ipython_genutils.path import filefind
38
-from ipython_genutils.py3compat import string_types
+from ipython_genutils.py3compat import string_types, PY3
39
40
import notebook
41
from notebook._tz import utcnow
@@ -427,6 +427,10 @@ def check_host(self):
427
if host.startswith('[') and host.endswith(']'):
428
host = host[1:-1]
429
430
+ if not PY3:
431
+ # ip_address only accepts unicode on Python 2
432
+ host = host.decode('utf8', 'replace')
433
+
434
try:
435
addr = ipaddress.ip_address(host)
436
except ValueError:
0 commit comments