From 6c2a0b2de2f7c04324eb7f310326877024937d34 2014-11-10 22:02:20 From: Min RK Date: 2014-11-10 22:02:20 Subject: [PATCH] unicode! --- diff --git a/IPython/html/services/contents/manager.py b/IPython/html/services/contents/manager.py index 20491a9..786062b 100644 --- a/IPython/html/services/contents/manager.py +++ b/IPython/html/services/contents/manager.py @@ -204,7 +204,7 @@ class ContentsManager(LoggingConfigurable): for i in itertools.count(): name = u'{basename}{i}{ext}'.format(basename=basename, i=i, ext=ext) - if not self.file_exists('{}/{}'.format(path, name)): + if not self.file_exists(u'{}/{}'.format(path, name)): break return name @@ -213,7 +213,7 @@ class ContentsManager(LoggingConfigurable): try: validate(model['content']) except ValidationError as e: - model['message'] = 'Notebook Validation failed: {}:\n{}'.format( + model['message'] = u'Notebook Validation failed: {}:\n{}'.format( e.message, json.dumps(e.instance, indent=1, default=lambda obj: ''), ) return model @@ -245,7 +245,7 @@ class ContentsManager(LoggingConfigurable): raise HTTPError(400, "Unexpected model type: %r" % model['type']) name = self.increment_filename(untitled + ext, path) - path = '{0}/{1}'.format(path, name) + path = u'{0}/{1}'.format(path, name) model = self.save(model, path) return model @@ -276,7 +276,7 @@ class ContentsManager(LoggingConfigurable): base, ext = os.path.splitext(from_name) copy_name = u'{0}-Copy{1}'.format(base, ext) to_name = self.increment_filename(copy_name, to_path) - to_path = '{0}/{1}'.format(to_path, to_name) + to_path = u'{0}/{1}'.format(to_path, to_name) model = self.save(model, to_path) return model