Skip to content

Loading…

don't crash on bad config files #659

Merged
merged 1 commit into from

3 participants

@minrk
IPython: interactive computing in Python member

errors in config files shouldn't crash IPython.

fixes #650

@takluyver
IPython: interactive computing in Python member

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

@minrk
IPython: interactive computing in Python member

yes, log-level is WARN by default.

@fperez
IPython: interactive computing in Python member

+1, merge away!

@minrk minrk merged commit cc7edac into ipython:master
@ellisonbg ellisonbg referenced this pull request
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 committed
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.