Page 1 of 1

NameError: global name 'Chrome' is not defined [Ubuntu]

Posted: March 25th, 2013, 1:54 pm
by sander
I can't start SABnzbd. See below. Seems to be browser related, but "-b 0" doesn't help.

I have no Chrome; I've Chromium

Ubuntu 13.04 daily.

Code: Select all

sander@appelboor:~$ sabnzbdplus 
Traceback (most recent call last):
  File "/usr/bin/sabnzbdplus", line 67, in <module>
    import sabnzbd
  File "/usr/share/sabnzbdplus/sabnzbd/__init__.py", line 73, in <module>
    from sabnzbd.nzbqueue import NzbQueue
  File "/usr/share/sabnzbdplus/sabnzbd/nzbqueue.py", line 32, in <module>
    from sabnzbd.panic import panic_queue
  File "/usr/share/sabnzbdplus/sabnzbd/panic.py", line 24, in <module>
    import webbrowser
  File "/usr/lib/python2.7/webbrowser.py", line 505, in <module>
    register_X_browsers()
  File "/usr/lib/python2.7/webbrowser.py", line 489, in register_X_browsers
    register(browser, None, Chrome(browser))
NameError: global name 'Chrome' is not defined
sander@appelboor:~$ 


sander@appelboor:~$ 
sander@appelboor:~$ sabnzbdplus -b 0
Traceback (most recent call last):
  File "/usr/bin/sabnzbdplus", line 67, in <module>
    import sabnzbd
  File "/usr/share/sabnzbdplus/sabnzbd/__init__.py", line 73, in <module>
    from sabnzbd.nzbqueue import NzbQueue
  File "/usr/share/sabnzbdplus/sabnzbd/nzbqueue.py", line 32, in <module>
    from sabnzbd.panic import panic_queue
  File "/usr/share/sabnzbdplus/sabnzbd/panic.py", line 24, in <module>
    import webbrowser
  File "/usr/lib/python2.7/webbrowser.py", line 505, in <module>
    register_X_browsers()
  File "/usr/lib/python2.7/webbrowser.py", line 489, in register_X_browsers
    register(browser, None, Chrome(browser))
NameError: global name 'Chrome' is not defined
sander@appelboor:~$ 

Re: NameError: global name 'Chrome' is not defined [Ubuntu]

Posted: March 25th, 2013, 1:58 pm
by shypike
Eh, Ubuntu daily version? Doesn't sound very stable to me :)

This is a mismatch between Python and the operating system.
"webbrowser" is a standard Python library which should "just work".

Re: NameError: global name 'Chrome' is not defined [Ubuntu]

Posted: March 25th, 2013, 1:59 pm
by sander
Seems to be a bug in Ubuntu 13.04 https://bugs.launchpad.net/ubuntu/+sour ... ug/1159854

(and debian too? http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=703872 )

Code: Select all

sander@appelboor:~$ software-center
Traceback (most recent call last):
  File "/usr/bin/software-center", line 128, in <module>
    from softwarecenter.ui.gtk3.app import SoftwareCenterAppGtk3
  File "/usr/share/software-center/softwarecenter/ui/gtk3/app.py", line 37, in <module>
    import webbrowser
  File "/usr/lib/python2.7/webbrowser.py", line 505, in <module>
    register_X_browsers()
  File "/usr/lib/python2.7/webbrowser.py", line 489, in register_X_browsers
    register(browser, None, Chrome(browser))
NameError: global name 'Chrome' is not defined
sander@appelboor:~$

Re: NameError: global name 'Chrome' is not defined [Ubuntu]

Posted: March 25th, 2013, 2:13 pm
by sander
http://bugs.python.org/issue17541

Just this one command triggers it:

Code: Select all

sander@appelboor:~$ python
Python 2.7.4rc1 (default, Mar 25 2013, 00:30:40) 
[GCC 4.7.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import webbrowser
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.7/webbrowser.py", line 505, in <module>
    register_X_browsers()
  File "/usr/lib/python2.7/webbrowser.py", line 489, in register_X_browsers
    register(browser, None, Chrome(browser))
NameError: global name 'Chrome' is not defined
>>>

Re: NameError: global name 'Chrome' is not defined [Ubuntu]

Posted: March 25th, 2013, 2:17 pm
by sander
As a workaround, I commented-out the "import webbrowser" in sabnzbd/panic.py and started

./SABnzbd.py -b0

... and that works ... :-)

Re: NameError: global name 'Chrome' is not defined [Ubuntu]

Posted: March 25th, 2013, 3:26 pm
by sander
... and after yet another update it's solved.