From b170c5dee0f6b34b4013e238a02bd97227c5d7a1 Mon Sep 17 00:00:00 2001 From: Zachary Sailer Date: Sun, 21 Jul 2013 15:50:18 -0700 Subject: [PATCH] allow notebook names with spaces --- IPython/html/notebook/handlers.py | 3 +++ IPython/html/tree/handlers.py | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/IPython/html/notebook/handlers.py b/IPython/html/notebook/handlers.py index 7df96f17f..be27df50e 100644 --- a/IPython/html/notebook/handlers.py +++ b/IPython/html/notebook/handlers.py @@ -22,6 +22,7 @@ HTTPError = web.HTTPError from ..base.handlers import IPythonHandler from ..utils import url_path_join +from urllib import quote #----------------------------------------------------------------------------- # Handlers @@ -50,6 +51,8 @@ class NamedNotebookHandler(IPythonHandler): def get(self, notebook_path): nbm = self.notebook_manager name, path = nbm.named_notebook_path(notebook_path) + if name != None: + name = quote(name) if path == None: project = self.project + '/' + name else: diff --git a/IPython/html/tree/handlers.py b/IPython/html/tree/handlers.py index 0ceabad23..cb97f3838 100644 --- a/IPython/html/tree/handlers.py +++ b/IPython/html/tree/handlers.py @@ -53,7 +53,7 @@ class ProjectPathDashboardHandler(IPythonHandler): project=project, project_component=project.split('/'), notebook_path=path, - notebook_name=name)) + notebook_name=quote(name))) class TreeRedirectHandler(IPythonHandler):