Skip to content
This repository

don't crash on bad config files #659

Merged
merged 1 commit into from over 2 years ago

3 participants

Min RK Thomas Kluyver Fernando Perez
Min RK
Owner

errors in config files shouldn't crash IPython.

fixes #650

Thomas Kluyver
Collaborator

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

Min RK
Owner

yes, log-level is WARN by default.

Fernando Perez
Owner

+1, merge away!

Min RK minrk merged commit cc7edac into from
Min RK minrk closed this
Brian E. Granger 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

Showing 1 unique commit by 1 author.

Aug 01, 2011
Min RK don't crash on bad config files 0aa0be7
This page is out of date. Refresh to see the latest.

Showing 1 changed file with 7 additions and 2 deletions. Show diff stats Hide diff stats

  1. 9  IPython/config/application.py
9  IPython/config/application.py
@@ -366,8 +366,13 @@ def parse_command_line(self, argv=None):
366 366
     def load_config_file(self, filename, path=None):
367 367
         """Load a .py based config file by filename and path."""
368 368
         loader = PyFileConfigLoader(filename, path=path)
369  
-        config = loader.load_config()
370  
-        self.update_config(config)
  369
+        try:
  370
+            config = loader.load_config()
  371
+        except Exception:
  372
+            self.log.error("Exception while loading config file %s [path=%s]"%
  373
+                            (filename, path), exc_info=True)
  374
+        else:
  375
+            self.update_config(config)
371 376
     
372 377
     def generate_config_file(self):
373 378
         """generate default config file from Configurables"""
Commit_comment_tip

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.