Show More
@@ -1,10 +1,10 b'' | |||
|
1 | # coding: utf-8 | |
|
1 | 2 | """A tornado based IPython notebook server. |
|
2 | 3 | |
|
3 | 4 | Authors: |
|
4 | 5 | |
|
5 | 6 | * Brian Granger |
|
6 | 7 | """ |
|
7 | ||
|
8 | 8 | #----------------------------------------------------------------------------- |
|
9 | 9 | # Copyright (C) 2008-2011 The IPython Development Team |
|
10 | 10 | # |
@@ -65,6 +65,7 b' from IPython.zmq.ipkernel import (' | |||
|
65 | 65 | IPKernelApp |
|
66 | 66 | ) |
|
67 | 67 | from IPython.utils.traitlets import Dict, Unicode, Integer, List, Enum, Bool |
|
68 | from IPython.utils import py3compat | |
|
68 | 69 | |
|
69 | 70 | #----------------------------------------------------------------------------- |
|
70 | 71 | # Module globals |
@@ -130,6 +131,16 b' class NotebookWebApplication(web.Application):' | |||
|
130 | 131 | # allow custom overrides for the tornado web app. |
|
131 | 132 | settings.update(settings_overrides) |
|
132 | 133 | |
|
134 | # Python < 2.6.5 doesn't accept unicode keys in f(**kwargs), and | |
|
135 | # base_project_url will always be unicode, which will in turn | |
|
136 | # make the patterns unicode, and ultimately result in unicode | |
|
137 | # keys in kwargs to handler._execute(**kwargs) in tornado. | |
|
138 | # This enforces that base_project_url be ascii in that situation. | |
|
139 | # | |
|
140 | # Note that the URLs these patterns check against are escaped, | |
|
141 | # and thus guaranteed to be ASCII: 'héllo' is really 'h%C3%A9llo'. | |
|
142 | base_project_url = py3compat.unicode_to_str(base_project_url, 'ascii') | |
|
143 | ||
|
133 | 144 | # prepend base_project_url onto the patterns that we match |
|
134 | 145 | new_handlers = [] |
|
135 | 146 | for handler in handlers: |
General Comments 0
You need to be logged in to leave comments.
Login now