Skip to content

Conversation

@aburgm
Copy link

@aburgm aburgm commented Aug 19, 2015

If a connection file is specified with an absolute path via the '-f'
command line option, ipykernel still makes sure that the default connection
directory exists, even though it is not needed. Instead, simply create the
directory for the path to the connection file that we end up actually
using.

This introduces a slight change in behaviour in that if one specifies a
connection file via the '-f' option and the given directory does not
exist, it will be created instead of an error being generated.

In my case, I am specifying a different path to the connection file because the default path is not writable. While I could (and probably should) change the default path with the corresponding environment variables, it still left me wondering whether the default connection directory should be created even if it is not going to be used.

@minrk
Copy link
Member

minrk commented Aug 19, 2015

The test failure looks like there is another case where the directory needs to be created.

If a connection file is specified with an absolute path via the '-f'
command line option, ipykernel still makes sure that the default connection
directory exists, even though it is not needed. Instead, simply create the
directory for the path to the connection file that we end up actually
using.

This introduces a slight change in behaviour in that if one specifies a
connection file via the '-f' option and the given directory does not
exist, it will be created instead of an error being generated.
@aburgm
Copy link
Author

aburgm commented Aug 20, 2015

Indeed... I updated the commit so it creates the directory already during initialization, instead of when the file is actually written.

minrk added a commit that referenced this pull request Aug 20, 2015
Avoid creating default connection dir if not needed
@minrk minrk merged commit 71b0c82 into ipython:master Aug 20, 2015
@minrk minrk added this to the 4.1 milestone Aug 20, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants