Skip to content
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

Merged
merged 1 commit into from
Jun 13, 2015

Conversation

SylvainCorlay
Copy link
Member

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.

@@ -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')
Copy link
Member

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

Copy link
Member Author

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.

Copy link
Member Author

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.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since what IPython version?

Copy link
Member Author

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.

Copy link
Member

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

@ccordoba12 ccordoba12 added this to the v2.3.5 milestone Jun 13, 2015
@ccordoba12 ccordoba12 changed the title Remove unnecessary changes for filename Remove unnecessary changes to detected kernel json file Jun 13, 2015
@ccordoba12 ccordoba12 changed the title Remove unnecessary changes to detected kernel json file Remove unnecessary changes to detected kernel json file when connecting to external kernels Jun 13, 2015
ccordoba12 added a commit that referenced this pull request Jun 13, 2015
Remove unnecessary changes to detected kernel json file when connecting to external kernels
@ccordoba12 ccordoba12 merged commit a36ba4c into spyder-ide:master Jun 13, 2015
ccordoba12 added a commit that referenced this pull request Jun 13, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

'Connect to existing kernel' fails if json file not in PWD
2 participants