ipython/ipython — Issue #1282: CommandLineConfigLoader fails on e.g. --notebook-dir=bin
Author: jordens
Created: 2012-01-17 18:54:37+00:00
State: open

Since `CommandLineConfigLoader._exec_config_str()` succeeds if `exec "lhs = rhs"` succeeds, it happily assigns all local and global variables to options. That is confusing since then pretty common things like `--notebook-dir=bin` fail but awkward workarounds like `--notebook-dir=bin/` or `--notebook-dir="'bin'"` work fine.

$ python ipython.py notebook --notebook-dir=bin --debug
[NotebookApp] Bad config encountered during initialization:
[NotebookApp] The 'notebook_dir' trait of a NotebookManager instance must be a unicode string, but a value of was specified.
[NotebookApp] Config at the time: {'Application': {'log_level': 10}, 'Session': {'key': '72a23f1c-679f-4190-8dc4-279b71a36731'}, 'ProfileDir': {}, 'NotebookManager': {'notebook_dir': }}
[NotebookApp] Exiting application: ipython-notebook