Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

TerminalIPythonApp configuration fails without ipython_config.py #2693

Closed
pavoljuhas opened this Issue · 2 comments

3 participants

@pavoljuhas

I have a small application that can optionally start IPython shell
using the following code:

from IPython.frontend.terminal.ipapp import TerminalIPythonApp 
app = TerminalIPythonApp.instance() 
app.config.TerminalIPythonApp.pylab = 'auto' 
app.config.TerminalIPythonApp.pylab_import_all = True 
app.initialize(argv=[]) 
app.shell.mainloop() 

However, the configuration settings for pylab and pylab_import_all are
ignored unless the ipython_config.py file exists and it sets some
configuration parameter. I would expect the configuration commands
above to be effective regardless of the existence of ipython_config.py.

For more details about this issue and for a workaround see
http://goo.gl/VX0OA.

@takluyver
Owner

As a reminder to anyone else reading this, the correct way to configure an IPython instance is to create a config object first, set values on it, and pass it in when the instance is created. After instantiation, you change values directly on the app and shell objects, not in their config (but that doesn't work for config values which are only checked at startup, like in this example).

But it's still bizarre that the behaviour is affected by the existence of a config file, hence this issue.

@minrk
Owner

I'm going to close this, because it's just a misuse / misunderstanding of config.

The reason creating a config file has an effect on this particular code is that loading a config file will load the config from the file file, then reload prior config (which would normally come from the command-line), in order to ensure the right priority. It's that reload for priority that makes this case 'work'.

@minrk minrk closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.