BUG: Fix unicode/str error when generating config file.

This commit is contained in:
Scott Sanderson
2014-10-06 14:20:14 -04:00
parent b24df4f104
commit b5d2efeeae
2 changed files with 4 additions and 2 deletions

View File

@@ -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)