Importing `webbrowser` module gives NameError in Python 2.7.4rc1

Bug #1159737 reported by Marcin Juszkiewicz
20
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Python
New
Unknown
python2.7 (Debian)
New
Unknown
python2.7 (Ubuntu)
Confirmed
Undecided
Anatoli Yakimovich

Bug Description

http://bugs.python.org/issue17541

12:23 hrw@puchatek:lava-test-perf$ python -c "import webbrowser"
Traceback (most recent call last):
  File "<string>", 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

Real life usecase:

12:26 hrw@puchatek:lava-test-perf$ bzr lp-propose-merge
bzr: ERROR: exceptions.NameError: global name 'Chrome' is not defined

Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/bzrlib/commands.py", line 930, in exception_to_return_code
    return the_callable(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/bzrlib/commands.py", line 1121, in run_bzr
    ret = run(*run_argv)
  File "/usr/lib/python2.7/dist-packages/bzrlib/commands.py", line 673, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/usr/lib/python2.7/dist-packages/bzrlib/commands.py", line 697, in run
    return self._operation.run_simple(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/bzrlib/cleanup.py", line 136, in run_simple
    self.cleanups, self.func, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/bzrlib/cleanup.py", line 166, in _do_with_cleanups
    result = func(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/bzrlib/plugins/launchpad/cmds.py", line 328, in run
    fixes=fixes)
  File "/usr/lib/python2.7/dist-packages/bzrlib/plugins/launchpad/lp_propose.py", line 76, in __init__
    self.launchpad = lp_api.login(service)
  File "/usr/lib/python2.7/dist-packages/bzrlib/lazy_import.py", line 108, in __getattribute__
    obj = object.__getattribute__(self, '_resolve')()
  File "/usr/lib/python2.7/dist-packages/bzrlib/lazy_import.py", line 85, in _resolve
    obj = factory(self, scope, name)
  File "/usr/lib/python2.7/dist-packages/bzrlib/lazy_import.py", line 200, in _import
    module = __import__(module_python_path, scope, scope, [member], level=0)
  File "/usr/lib/python2.7/dist-packages/bzrlib/plugins/launchpad/lp_api.py", line 48, in <module>
    from launchpadlib.launchpad import (
  File "/usr/lib/python2.7/dist-packages/launchpadlib/launchpad.py", line 36, in <module>
    from launchpadlib.credentials import (
  File "/usr/lib/python2.7/dist-packages/launchpadlib/credentials.py", line 40, 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

bzr 2.6.0dev3 on python 2.7.4rc1 (Linux-3.8.0-13-generic-x86_64-with-
    Ubuntu-13.04-raring)
arguments: ['/usr/bin/bzr', 'lp-propose-merge']
plugins: bash_completion[2.6.0dev3], builddeb[2.7.0dev], builder[0.7.3],
    changelog_merge[2.6.0dev3], etckeeper[unknown], extmerge[unknown],
    fastimport[0.13.0], git[0.6.9], grep[2.6.0dev3], interactive[1.2.0],
    launchpad[2.6.0dev3], loom[2.2.0], netrc_credential_store[2.6.0dev3],
    news_merge[2.6.0dev3], pager[unknown], pipeline[1.4.0],
    po_merge[2.6.0dev3], qbzr[0.23.0], rewrite[0.6.4dev], search[1.7.0dev],
    stats[0.2.0dev], vimdiff[unknown], weave_fmt[2.6.0dev3]
encoding: 'utf-8', fsenc: 'UTF-8', lang: 'pl_PL.UTF-8'

*** Bazaar has encountered an internal error. This probably indicates a
    bug in Bazaar. You can help us fix it by filing a bug report at
        https://bugs.launchpad.net/bzr/+filebug
    including this traceback and a description of the problem.

ProblemType: Bug
DistroRelease: Ubuntu 13.04
Package: python2.7 2.7.4~rc1-2ubuntu1
ProcVersionSignature: Ubuntu 3.8.0-13.22-generic 3.8.3
Uname: Linux 3.8.0-13-generic x86_64
ApportVersion: 2.9.2-0ubuntu2
Architecture: amd64
Date: Mon Mar 25 12:26:00 2013
MarkForUpload: True
ProcEnviron:
 TERM=screen
 SHELL=/bin/bash
 PATH=(custom, no user)
 LANG=pl_PL.UTF-8
 LANGUAGE=pl:en
SourcePackage: python2.7
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Marcin Juszkiewicz (hrw) wrote :
xelatirdan (xelatirdan)
no longer affects: ubuntuone-client
Changed in python2.7 (Debian):
status: Unknown → New
Changed in python:
status: Unknown → New
Changed in python2.7 (Ubuntu):
assignee: nobody → Anatoli Yakimovich (akelav)
Revision history for this message
Daniel Holbach (dholbach) wrote :

It looks like the class definition of Chrome/Chromium in python3.3's Lib/webbrowser.py is missing.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in python2.7 (Ubuntu):
status: New → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.