Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

don't crash on bad config files #659

Merged
merged 1 commit into from

3 participants

@minrk
Owner

errors in config files shouldn't crash IPython.

fixes #650

@takluyver
Owner

Does that log call produce a user-visible message by default?

@minrk
Owner

yes, log-level is WARN by default.

@fperez
Owner

+1, merge away!

@minrk minrk merged commit cc7edac into ipython:master
@ellisonbg ellisonbg referenced this pull request from a commit
Commit has since been removed from the repository and is no longer available.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Aug 1, 2011
  1. @minrk

    don't crash on bad config files

    minrk authored
This page is out of date. Refresh to see the latest.
Showing with 7 additions and 2 deletions.
  1. +7 −2 IPython/config/application.py
View
9 IPython/config/application.py
@@ -366,8 +366,13 @@ def parse_command_line(self, argv=None):
def load_config_file(self, filename, path=None):
"""Load a .py based config file by filename and path."""
loader = PyFileConfigLoader(filename, path=path)
- config = loader.load_config()
- self.update_config(config)
+ try:
+ config = loader.load_config()
+ except Exception:
+ self.log.error("Exception while loading config file %s [path=%s]"%
+ (filename, path), exc_info=True)
+ else:
+ self.update_config(config)
def generate_config_file(self):
"""generate default config file from Configurables"""
Something went wrong with that request. Please try again.