@@ -40,6 +40,7 @@ def write_connection_file(
40
40
transport : str = "tcp" ,
41
41
signature_scheme : str = "hmac-sha256" ,
42
42
kernel_name : str = "" ,
43
+ ** kwargs : Any ,
43
44
) -> Tuple [str , KernelConnectionInfo ]:
44
45
"""Generates a JSON config file, including the selection of random ports.
45
46
@@ -140,6 +141,7 @@ def write_connection_file(
140
141
cfg ["transport" ] = transport
141
142
cfg ["signature_scheme" ] = signature_scheme
142
143
cfg ["kernel_name" ] = kernel_name
144
+ cfg .update (kwargs )
143
145
144
146
# Only ever write this file as user read/writeable
145
147
# This would otherwise introduce a vulnerability as a file has secrets
@@ -483,7 +485,7 @@ def cleanup_random_ports(self) -> None:
483
485
484
486
self .cleanup_connection_file ()
485
487
486
- def write_connection_file (self ) -> None :
488
+ def write_connection_file (self , ** kwargs : Any ) -> None :
487
489
"""Write connection info to JSON dict in self.connection_file."""
488
490
if self ._connection_file_written and os .path .exists (self .connection_file ):
489
491
return
@@ -500,6 +502,7 @@ def write_connection_file(self) -> None:
500
502
control_port = self .control_port ,
501
503
signature_scheme = self .session .signature_scheme ,
502
504
kernel_name = self .kernel_name ,
505
+ ** kwargs ,
503
506
)
504
507
# write_connection_file also sets default ports:
505
508
self ._record_random_port_names ()
0 commit comments