From b5d2efeeae13e0b364f25cb4e3d000ce8f9d03bd Mon Sep 17 00:00:00 2001 From: Scott Sanderson Date: Mon, 6 Oct 2014 14:20:14 -0400 Subject: [PATCH] BUG: Fix unicode/str error when generating config file. --- jupyterhub/app.py | 5 +++-- requirements.txt | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/jupyterhub/app.py b/jupyterhub/app.py index d876b7ff..69a2056c 100644 --- a/jupyterhub/app.py +++ b/jupyterhub/app.py @@ -9,6 +9,7 @@ import io import logging import os from datetime import datetime +from six import text_type from subprocess import Popen try: @@ -654,8 +655,8 @@ class JupyterHubApp(Application): answer = ask() if answer.startswith('n'): return - - config_text = self.generate_config_file() + + config_text = text_type(self.generate_config_file(), 'utf8') print("Writing default config to: %s" % self.config_file) with io.open(self.config_file, encoding='utf8', mode='w') as f: f.write(config_text) diff --git a/requirements.txt b/requirements.txt index 2c43d205..063f082d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,3 +4,4 @@ jinja2 simplepam sqlalchemy requests +six