-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove unnecessary changes to detected kernel json file when connecting to external kernels #2484
Remove unnecessary changes to detected kernel json file when connecting to external kernels #2484
Conversation
@@ -1058,8 +1058,6 @@ def _create_client_for_kernel(self, cf, hostname, kf, pw): | |||
# Verifying if the connection file exists | |||
cf = osp.basename(cf) | |||
try: | |||
if not cf.startswith('kernel') and not cf.endswith('json'): | |||
cf = to_text_string('kernel-' + cf + '.json') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The idea is to pass the kernel id (like just 4779
) to this field and be able to connect to that kernel, instead of writing kernel-4779.json
.
That's why these lines are here and I find this feature really useful :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This feature is there without these lines.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
find_connection_file already does precisely what you are describing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since what IPython version?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It has been the case for a while AFAIK. Here is the function find_conneciton_file in 0.13.2.
If the argument does not match an existing file, it will be interpreted as a fileglob, and the matching file in the profile's security dir with the latest access time will be used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Sylvain. I wasn't aware of that ;-)
Remove unnecessary changes to detected kernel json file when connecting to external kernels
… file when connecting to external kernels
Fixes #2468
It is unnecessary to prefix the connection file with
kernel-
and add the.json
extension. IPython's find_connection_file already does that for you.Besides, by doing it forcibly, we prevent the use of kernel files named otherwise than kernel-*.json, which occurs quite often when connecting to a remote kernel.