Can't use exec_file in config file #566

Closed
jstenar opened this Issue Jul 11, 2011 · 1 comment

Comments

Projects
None yet
2 participants
@jstenar
Member

jstenar commented Jul 11, 2011

I have an empty python file called empty.py in my .ipython directory and I have enabled the following line in my default_profile/ipython_config.py:

c.TerminalIPythonApp.exec_files = ['empty.py']

When starting ipython I get the following error:

[TerminalIPythonApp] Unknown error in handling IPythonApp.exec_files:
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
c:\python\external\ipython-js\IPython\core\shellapp.pyc in _exec_file(self, fname
    192         # were run from a system shell.

    193         save_argv = sys.argv
--> 194         sys.argv = sys.argv[sys.argv.index(fname):]
    195         try:
    196             if os.path.isfile(full_filename):

ValueError: list.index(x): x not in list

If I change the filename empty.py to a non-existing filename I get an unknown file error.

/Jörgen

@minrk

This comment has been minimized.

Show comment
Hide comment
@minrk

minrk Jul 11, 2011

Member

Ah, I forgot that files could be specified not on the command-line, sorry.

Should be fixed.

Member

minrk commented Jul 11, 2011

Ah, I forgot that files could be specified not on the command-line, sorry.

Should be fixed.

@minrk minrk closed this in d306e58 Jul 11, 2011

mattvonrocketstein pushed a commit to mattvonrocketstein/ipython that referenced this issue Nov 3, 2014

exec_files works when specified in config file
also don't treat IOError (file not found) as an unknown failure.

closes gh-566
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment