diff --git a/IPython/kernel/connect.py b/IPython/kernel/connect.py index 657f5cc..c606fc9 100644 --- a/IPython/kernel/connect.py +++ b/IPython/kernel/connect.py @@ -391,7 +391,6 @@ class ConnectionFileMixin(HasTraits): _connection_file_written = Bool(False) transport = CaselessStrEnum(['tcp', 'ipc'], default_value='tcp', config=True) - signature_scheme = Unicode('') ip = Unicode(LOCALHOST, config=True, help="""Set the kernel\'s IP address [default localhost]. @@ -439,7 +438,8 @@ class ConnectionFileMixin(HasTraits): stdin_port=self.stdin_port, hb_port=self.hb_port, control_port=self.control_port, - signature_scheme=self.signature_scheme, + signature_scheme=self.session.signature_scheme, + key=self.session.key, ) def cleanup_connection_file(self): @@ -476,7 +476,7 @@ class ConnectionFileMixin(HasTraits): stdin_port=self.stdin_port, iopub_port=self.iopub_port, shell_port=self.shell_port, hb_port=self.hb_port, control_port=self.control_port, - signature_scheme=self.signature_scheme, + signature_scheme=self.session.signature_scheme, ) # write_connection_file also sets default ports: for name in port_names: diff --git a/IPython/kernel/tests/test_kernelmanager.py b/IPython/kernel/tests/test_kernelmanager.py index 15a0a8a..ad6fef4 100644 --- a/IPython/kernel/tests/test_kernelmanager.py +++ b/IPython/kernel/tests/test_kernelmanager.py @@ -47,4 +47,15 @@ class TestKernelManager(TestCase): def test_ipc_lifecycle(self): km = self._get_ipc_km() self._run_lifecycle(km) + + def test_get_connect_info(self): + km = self._get_tcp_km() + cinfo = km.get_connection_info() + keys = sorted(cinfo.keys()) + expected = sorted([ + 'ip', 'transport', + 'hb_port', 'shell_port', 'stdin_port', 'iopub_port', 'control_port', + 'key', 'signature_scheme', + ]) + self.assertEqual(keys, expected)