##// END OF EJS Templates
py3compat pass on Session.key...
MinRK -
Show More
@@ -42,6 +42,7 b' from IPython.frontend.qt.console import styles'
42 42 from IPython.frontend.qt.kernelmanager import QtKernelManager
43 43 from IPython.parallel.util import select_random_ports
44 44 from IPython.utils.path import filefind
45 from IPython.utils.py3compat import str_to_bytes
45 46 from IPython.utils.traitlets import (
46 47 Dict, List, Unicode, Int, CaselessStrEnum, CBool, Any
47 48 )
@@ -404,7 +405,7 b' class IPythonQtConsoleApp(BaseIPythonApplication):'
404 405 # not overridden by config or cl_args
405 406 setattr(self, name, cfg[name])
406 407 if 'key' in cfg:
407 self.config.Session.key = cfg['key']
408 self.config.Session.key = str_to_bytes(cfg['key'])
408 409
409 410 def init_ssh(self):
410 411 """set up ssh tunnels, if needed."""
@@ -15,12 +15,13 b' from zmq.utils import jsonapi as json'
15 15
16 16 # IPython imports
17 17 from IPython.utils.localinterfaces import LOCALHOST
18 from IPython.utils.py3compat import bytes_to_str
18 19
19 20 # Local imports.
20 21 from parentpoller import ParentPollerWindows
21 22
22 23 def write_connection_file(fname=None, shell_port=0, iopub_port=0, stdin_port=0, hb_port=0,
23 ip=LOCALHOST, key=''):
24 ip=LOCALHOST, key=b''):
24 25 """Generates a JSON config file, including the selection of random ports.
25 26
26 27 Parameters
@@ -79,7 +80,7 b' def write_connection_file(fname=None, shell_port=0, iopub_port=0, stdin_port=0, '
79 80 hb_port=hb_port,
80 81 )
81 82 cfg['ip'] = ip
82 cfg['key'] = key
83 cfg['key'] = bytes_to_str(key)
83 84
84 85 with open(fname, 'wb') as f:
85 86 f.write(json.dumps(cfg, indent=2))
@@ -31,6 +31,7 b' from IPython.core.application import ('
31 31 from IPython.utils import io
32 32 from IPython.utils.localinterfaces import LOCALHOST
33 33 from IPython.utils.path import filefind
34 from IPython.utils.py3compat import str_to_bytes
34 35 from IPython.utils.traitlets import (Any, Instance, Dict, Unicode, Int, Bool,
35 36 DottedObjectName)
36 37 from IPython.utils.importstring import import_item
@@ -176,7 +177,7 b' class KernelApp(BaseIPythonApplication):'
176 177 # not overridden by config or cl_args
177 178 setattr(self, name, cfg[name])
178 179 if 'key' in cfg:
179 self.config.Session.key = cfg['key']
180 self.config.Session.key = str_to_bytes(cfg['key'])
180 181
181 182 def write_connection_file(self):
182 183 """write connection info to JSON file"""
General Comments 0
You need to be logged in to leave comments. Login now