python2.7 failed to import webbrowser: NameError in register_X_browsers(): global name 'Chrome' is not defined - Regression in 2.7.4~rc1-2ubuntu1

Bug #1159636 reported by Per-Inge on 2013-03-25
412
This bug affects 87 people
Affects Status Importance Assigned to Milestone
python2.7 (Debian)
Fix Released
Unknown
python2.7 (Ubuntu)
Critical
Unassigned

Bug Description

Raring
python2.7: 2.7.4~rc1-2ubuntu1

The webbrowser module from python2.7-stdlib failed to import. It seems to be a regression in python2.7 2.7.4~rc1-2ubuntu1, and it is not reproducible with python2.7 2.7.4~rc1-0ubuntu1

TEST CASE:
1. From the command line run the command:
$ python2.7 -c "import webbrowser"

ACTUAL RESULT:
$ python2.7 -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

Original report:
It seems that the Ubuntu One client will not start

ProblemType: Crash
DistroRelease: Ubuntu 13.04
Package: ubuntuone-client 4.1.92-0ubuntu1
ProcVersionSignature: Ubuntu 3.8.0-14.24-generic 3.8.4
Uname: Linux 3.8.0-14-generic x86_64
NonfreeKernelModules: nvidia
ApportVersion: 2.9.2-0ubuntu2
Architecture: amd64
Date: Mon Mar 25 07:00:34 2013
ExecutablePath: /usr/lib/ubuntuone-client/ubuntuone-syncdaemon
InstallationDate: Installed on 2012-10-28 (147 days ago)
InstallationMedia: Ubuntu 12.10 "Quantal Quetzal" - Release amd64 (20121017.5)
InterpreterPath: /usr/bin/python2.7
MarkForUpload: True
PackageArchitecture: all
ProcCmdline: /usr/bin/python /usr/lib/ubuntuone-client/ubuntuone-syncdaemon
ProcEnviron:
 SHELL=/bin/bash
 XDG_RUNTIME_DIR=<set>
 PATH=(custom, no user)
 LANG=en_US.UTF-8
PythonArgs: ['/usr/lib/ubuntuone-client/ubuntuone-syncdaemon']
SourcePackage: ubuntuone-client
Title: ubuntuone-syncdaemon crashed with NameError in register_X_browsers(): global name 'Chrome' is not defined
UbuntuOneSyncdaemonExceptionsLog:

UpgradeStatus: Upgraded to raring on 2013-02-18 (34 days ago)
UserGroups: adm cdrom dip lpadmin plugdev sambashare sudo
mtime.conffile..etc.xdg.autostart.ubuntuone.launch.desktop: 2012-11-03T09:16:45.667113

Per-Inge (per-inge-hallin) wrote :
information type: Private → Public
tags: removed: need-duplicate-check
Changed in ubuntuone-client (Ubuntu):
importance: Undecided → Medium
Launchpad Janitor (janitor) wrote :

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

Changed in ubuntuone-client (Ubuntu):
status: New → Confirmed
Léa GRIS (lea-gris) wrote :

Happened crash on session start short time after login.

I can point, I had google-chrome as default browser for some time, but switched back to Firefox as default browser.
But:
x-www-browser alternative was still pointed to /usr/bin/google-chrome
  Sélection Chemin Priorité État
------------------------------------------------------------
  0 /usr/bin/opera 200 mode automatique
  1 /usr/bin/epiphany-browser 85 mode manuel
  2 /usr/bin/firefox 40 mode manuel
* 3 /usr/bin/google-chrome 120 mode manuel
  4 /usr/bin/opera 200 mode manuel
  5 /usr/bin/xlinks2 69 mode manuel

Switching to firefox now and will see if it trigger this bug again.

Assigning to python2.7 where webbrowser.py belongs to.

summary: - ubuntuone-syncdaemon crashed with NameError in register_X_browsers():
- global name 'Chrome' is not defined
+ python2.7 failed to import webbrowser: NameError in
+ register_X_browsers(): global name 'Chrome' is not defined
affects: ubuntuone-client (Ubuntu) → python2.7 (Ubuntu)
Changed in python2.7 (Ubuntu):
importance: Medium → High
description: updated
tags: added: rls-r-incoming
summary: python2.7 failed to import webbrowser: NameError in
- register_X_browsers(): global name 'Chrome' is not defined
+ register_X_browsers(): global name 'Chrome' is not defined - Regression
+ in 2.7.4~rc1-2ubuntu1
description: updated
description: updated
xelatirdan (xelatirdan) wrote :

When I start Ubuntu One and Play on Linux:

Traceback (most recent call last):
  File "mainwindow.py", line 21, in <module>
    import os, getopt, sys, urllib, signal, string, time, webbrowser, gettext, locale, sys, shutil, subprocess
  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
/usr/share/playonlinux/playonlinux: строка 144: python2.6: команда не найдена

I delete my Chromiun and then all nice, Ubuntu One and Play on Linux run!

Changed in python2.7 (Debian):
status: Unknown → New
WalterCool (waltercool) wrote :

I can confirm this bug, doesn't replicate on Python 3 (3.3.0-2ubuntu9), webbrowser works fine, just the issue affects Python 2 (2.7.4~rc1-2ubuntu1)

Jean-Baptiste Lallement (jibel) wrote :

This patch adds the missing Chrome class

Changed in python2.7 (Ubuntu):
importance: High → Critical
assignee: nobody → Canonical Foundations Team (canonical-foundations)
Colin Watson (cjwatson) on 2013-03-25
Changed in python2.7 (Ubuntu):
assignee: Canonical Foundations Team (canonical-foundations) → Matthias Klose (doko)
Žygimantas Beručka (zygis) wrote :

Thanks, this patch fixes it.

aleandro (aleandrodasilva) wrote :

I found this bug starting Playonlinux. I believe there are many others applications involved.
Ho to apply the patch? Thanks.

Don't apply the patch, just wait for the next upload of python2.7

aleandro (aleandrodasilva) wrote :

OK but I applied the patch already and it works well. Should I remove the lines I modified?

The attachment "python2.7_2.7.4~rc1-2ubuntu1_LP1159636.diff" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
Amir Mahmoudi (a-mahmoudi-ir) wrote :

I can confirmed by that patch my problem solved too

Launchpad Janitor (janitor) wrote :

This bug was fixed in the package python2.7 - 2.7.4~rc1-2ubuntu2

---------------
python2.7 (2.7.4~rc1-2ubuntu2) raring; urgency=low

  * Fix webbrowser update. LP: #1159636.
 -- Matthias Klose <email address hidden> Mon, 25 Mar 2013 14:33:50 +0100

Changed in python2.7 (Ubuntu):
status: Confirmed → Fix Released
Dirk Bockmann (dirk-bockmann) wrote :

I don't have much to contribute. This issue appeared after I brought my system up to date last night. I also ran Chrome which I don't normally do. If there is a package I can add please let me know. All the best Dirk

Per-Inge (per-inge-hallin) wrote :

It's working now after today's updates

Changed in python2.7 (Debian):
status: New → Fix Released
Matthias Klose (doko) on 2013-03-26
Changed in python2.7 (Ubuntu):
assignee: Matthias Klose (doko) → nobody
yoad aharon (yoadaharon) wrote :

what number should i enter when using this patch p[num]?

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

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