{"comment":{"created_at":"2011-10-17T09:06:01Z","body":"Ah, now I see.  The crash only occurs in a very particular call form:\r\n\r\n    ipnb --notebook-dir=/home/fperez/tmp\r\n\r\nworks, and\r\n\r\n    ipnb --notebook-dir ~tmp\r\n\r\nalso works, but \r\n\r\n    ipnb --notebook-dir=~tmp\r\n\r\nproduces the crash.  The reason is that in this last form, because of the = sign, the shell doesn't expand the ~ and neither do we.  Since it's a reasonable call form, we just need to call `expanduser(path)` on the input path before processing it when passed with an `=` sign, or at least fail with a more informative error message than an iternal server error.\r\n\r\nBut I'm downgrading the severity of this issue, as it's now clear that the problem is only with parsing a very particular call form.  thanks for the feedback!","updated_at":"2011-10-17T09:06:01Z","url":"https://api.github.com/repos/ipython/ipython/issues/comments/2426511","id":2426511,"user":{"gravatar_id":"95198572b00e5fbcd97fb5315215bf7a","avatar_url":"https://secure.gravatar.com/avatar/95198572b00e5fbcd97fb5315215bf7a?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","url":"https://api.github.com/users/fperez","id":57394,"login":"fperez"}},"action":"created","issue":{"number":886,"created_at":"2011-10-17T07:43:40Z","pull_request":{"diff_url":null,"patch_url":null,"html_url":null},"body":"Hi,\r\n\r\nI start a notebook server like this:\r\n<pre>\r\n$ ipython notebook --notebook-dir=\"/home/fwerner/Documents/Notebooks\" --pylab=inline\r\n</pre>\r\n\r\nAfter loading a notebook in my browser, the kernel dies instantly. This is related to the notebook-dir alias, which you can see from the traceback---here's the full console output:\r\n\r\n<pre>\r\n$ ipython notebook --notebook-dir=\"/home/fwerner/Documents/Notebooks\" --pylab=inline --log-level=DEBUG --debug\r\n[IPythonNotebookApp] Config changed:\r\n[IPythonNotebookApp] {'Application': {'log_level': 10}, 'IPKernelApp': {'pylab': u'inline'}, 'NotebookManager': {'notebook_dir': u'/home/fwerner/Documents/Notebooks'}}\r\n[IPythonNotebookApp] Using existing profile dir: u'/home/fwerner/.config/ipython/profile_default'\r\n[IPythonNotebookApp] Searching path [u'/home/fwerner/Development/ipython', u'/home/fwerner/.config/ipython/profile_default'] for config files\r\n[IPythonNotebookApp] Attempting to load config file: ipython_config.py\r\n[IPythonNotebookApp] Config file ipython_config.py not found\r\n[IPythonNotebookApp] Attempting to load config file: ipython_notebook_config.py\r\n[IPythonNotebookApp] Config file not found, skipping: ipython_notebook_config.py\r\n[IPythonNotebookApp] The port 8888 is already in use, trying another random port.\r\n[IPythonNotebookApp] The IPython Notebook is running at: http://127.0.0.1:8904\r\nWARNING:root:404 GET /static/mathjax/MathJax.js?config=TeX-AMS_HTML (127.0.0.1) 0.44ms\r\n[IPythonNotebookApp] Kernel started: e493215c-54f4-49a9-b8a9-a158ea272965\r\n[IPythonNotebookApp] Connecting to: tcp://127.0.0.1:48262\r\n[IPythonNotebookApp] Connecting to: tcp://127.0.0.1:49537\r\n[IPythonNotebookApp] Connecting to: tcp://127.0.0.1:37896\r\nWARNING: Unrecognized alias: 'notebook-dir', it will probably have no effect.Traceback (most recent call last):\r\n  File \"<string>\", line 1, in <module>\r\n  File \"IPython/zmq/ipkernel.py\", line 777, in main\r\n    app.initialize()\r\n  File \"IPython/zmq/ipkernel.py\", line 710, in initialize\r\n    super(IPKernelApp, self).initialize(argv)\r\n  File \"IPython/zmq/kernelapp.py\", line 279, in initialize\r\n    super(KernelApp, self).initialize(argv)\r\n  File \"IPython/core/application.py\", line 306, in initialize\r\n    self.parse_command_line(argv)\r\n  File \"IPython/config/application.py\", line 406, in parse_command_line\r\n    config = loader.load_config()\r\n  File \"IPython/config/loader.py\", line 575, in load_config\r\n    self._convert_to_config()\r\n  File \"IPython/config/loader.py\", line 664, in _convert_to_config\r\n    sub_parser.load_config(self.extra_args)\r\n  File \"IPython/config/loader.py\", line 496, in load_config\r\n    self._exec_config_str(lhs, rhs)\r\n  File \"IPython/config/loader.py\", line 347, in _exec_config_str\r\n    exec exec_str in locals(), globals()\r\n  File \"<string>\", line 1\r\nSyntaxError: can't assign to operator\r\n</pre>\r\n\r\nThe SyntaxError is thrown by the (assembled) statement\r\n<pre>\r\nself.config.notebook-dir=u'/home/fwerner/Documents/Notebooks'\r\n</pre>\r\n\r\nIt seems to me that IPython shouldn't even try to run statements like this---or at least catch the SyntaxError and warn the user. But I think the real issue is that the notebook-dir alias isn't known at this point. Maybe it also doesn't have to be known, and the commandline argument should have been swallowed at an earlier stage?\r\n\r\nUnfortunately, I'm not familiar enough with the codebase to proceed further.\r\n\r\nCheers,\r\n  Felix","comments":5,"title":"Notebook kernel crash when specifying --notebook-dir on commandline","updated_at":"2011-10-17T09:06:01Z","url":"https://api.github.com/repos/ipython/ipython/issues/886","id":1925889,"assignee":null,"milestone":{"number":6,"created_at":"2011-04-10T01:57:33Z","due_on":null,"title":"0.12","creator":{"gravatar_id":"95198572b00e5fbcd97fb5315215bf7a","avatar_url":"https://secure.gravatar.com/avatar/95198572b00e5fbcd97fb5315215bf7a?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","url":"https://api.github.com/users/fperez","id":57394,"login":"fperez"},"url":"https://api.github.com/repos/ipython/ipython/milestones/6","open_issues":78,"closed_issues":46,"description":"Stabilization of new apis after we get 0.11 out the door.","state":"open"},"closed_at":null,"user":{"gravatar_id":"ee3da1564c51147c7ca1cdc7f5fefc93","avatar_url":"https://secure.gravatar.com/avatar/ee3da1564c51147c7ca1cdc7f5fefc93?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","url":"https://api.github.com/users/fwerner","id":550178,"login":"fwerner"},"html_url":"https://github.com/ipython/ipython/issues/886","labels":[{"name":"htmlnotebook","url":"https://api.github.com/repos/ipython/ipython/labels/htmlnotebook","color":"381ed1"},{"name":"prio-critical","url":"https://api.github.com/repos/ipython/ipython/labels/prio-critical","color":"f50505"},{"name":"type-bug","url":"https://api.github.com/repos/ipython/ipython/labels/type-bug","color":"d9596c"}],"state":"open"},"legacy":{"issue_id":1925889,"comment_id":2426511}}