Skip to content

Commit

Permalink
be more explicit about how --browser value is used
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanov committed Feb 14, 2012
1 parent 373129a commit 2a436ae
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions IPython/frontend/html/notebook/notebookapp.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,11 +291,11 @@ def _ip_changed(self, name, old, new):
""")

browser = Unicode(u'', config=True,
help="""Specify which browser to use when opening the
notebook. If not specified, the default browser will be
determined by the `webbrowser` standard library module,
which allows setting of the BROWSER environment variable
to override it.
help="""Specify what command to use to invoke a web
browser when opening the notebook. If not specified, the
default browser will be determined by the `webbrowser`
standard library module, which allows setting of the
BROWSER environment variable to override it.
""")

read_only = Bool(False, config=True,
Expand Down Expand Up @@ -441,7 +441,7 @@ def start(self):

if self.open_browser:
ip = self.ip or '127.0.0.1'
if len(self.browser) == 0:
if self.browser:

This comment has been minimized.

Copy link
@juliantaylor

juliantaylor Feb 20, 2012

Contributor

this should probably be
if not self.browser:

currently you get this traceback:

  File "/scratch/jtaylor/progs/localinst/lib/python2.6/site-packages/IPython/frontend/html/notebook/notebookapp.py", line 448, in start
    browser = webbrowser.get(self.browser)
...
  File "/usr/lib/python2.6/webbrowser.py", line 84, in _synthesize
    cmd = browser.split()[0]
IndexError: list index out of range

This comment has been minimized.

Copy link
@minrk

minrk Feb 20, 2012

Member

Yes, of course it should. I'll push this right now.

browser = webbrowser.get()
else:
browser = webbrowser.get(self.browser)
Expand Down

0 comments on commit 2a436ae

Please sign in to comment.