Skip to content
Browse files

Merge pull request #801 from takluyver/py3-notebook

Gets the notebook working under Python3.
  • Loading branch information...
2 parents 321d643 + c87e301 commit 8ffab0435a12525548f67af7b9b7207052aabb99 @fperez fperez committed Oct 7, 2011
Showing with 5 additions and 4 deletions.
  1. +1 −1 IPython/frontend/html/notebook/handlers.py
  2. +2 −2 IPython/frontend/html/notebook/notebookmanager.py
  3. +2 −1 setup3.py
View
2 IPython/frontend/html/notebook/handlers.py
@@ -172,7 +172,7 @@ def _on_zmq_reply(self, msg_list):
class AuthenticatedZMQStreamHandler(ZMQStreamHandler):
def open(self, kernel_id):
- self.kernel_id = kernel_id
+ self.kernel_id = kernel_id.decode('ascii')
self.session = Session()
self.save_on_message = self.on_message
self.on_message = self.on_first_message
View
4 IPython/frontend/html/notebook/notebookmanager.py
@@ -150,7 +150,7 @@ def save_new_notebook(self, data, name=None, format=u'json'):
raise web.HTTPError(415, u'Invalid notebook format: %s' % format)
try:
- nb = current.reads(data, format)
+ nb = current.reads(data.decode('utf-8'), format)
except:
raise web.HTTPError(400, u'Invalid JSON data')
@@ -171,7 +171,7 @@ def save_notebook(self, notebook_id, data, name=None, format=u'json'):
raise web.HTTPError(415, u'Invalid notebook format: %s' % format)
try:
- nb = current.reads(data, format)
+ nb = current.reads(data.decode('utf-8'), format)
except:
raise web.HTTPError(400, u'Invalid JSON data')
View
3 setup3.py
@@ -1,10 +1,11 @@
import os.path
from setuptools import setup
-from setupbase import (setup_args, find_scripts, find_packages)
+from setupbase import (setup_args, find_scripts, find_packages, find_package_data)
setup_args['entry_points'] = find_scripts(True, suffix='3')
setup_args['packages'] = find_packages()
+setup_args['package_data'] = find_package_data()
def main():
setup(use_2to3 = True, **setup_args)

0 comments on commit 8ffab04

Please sign in to comment.
Something went wrong with that request. Please try again.