wikipedia: Does not import simplejson, triggering Ubuntu crash dialog on error

Bug #994059 reported by Arnel A. Borja
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
One Hundred Scopes
Fix Released
Low
David Callé

Bug Description

When opening the dash when my netbook is not connected to the internet, the Ubuntu crash dialog shows up. I tried finding the error, and this is what it shows:

kyoushuu@kyoushuu-netbook:~$ /usr/lib/unity-lens-wikipedia/unity-lens-wikipedia
Search changed to ""
Traceback (most recent call last):
  File "/usr/lib/unity-lens-wikipedia/unity-lens-wikipedia", line 67, in on_search_changed
    self.update_results_model(model, search_string)
  File "/usr/lib/unity-lens-wikipedia/unity-lens-wikipedia", line 74, in update_results_model
    for i in self.wikipedia_query(search):
  File "/usr/lib/unity-lens-wikipedia/unity-lens-wikipedia", line 100, in wikipedia_query
    except (IOError, KeyError, urllib2.URLError, urllib2.HTTPError, simplejson.JSONDecodeError):
NameError: global name 'simplejson' is not defined
^CTraceback (most recent call last):
  File "/usr/lib/unity-lens-wikipedia/unity-lens-wikipedia", line 122, in <module>
    daemon = Daemon()
KeyboardInterrupt

It happens when trying to show a JSON error, but since simplejson is not imported but used, it triggers another error.
This is what is shown when simplejson is imported.

kyoushuu@kyoushuu-netbook:~$ /usr/lib/unity-lens-wikipedia/unity-lens-wikipedia
Search changed to ""
Error : Unable to search Wikipedia

Revision history for this message
David Callé (davidc3) wrote :

Nice catch.

Changed in onehundredscopes:
status: New → Fix Released
importance: Undecided → Low
assignee: nobody → David Callé (davidc3)
Revision history for this message
David Callé (davidc3) wrote :

Sorry, I've not used your branch as I'm not using simplejson anymore, and just forgot to remove the error catching. But thanks for proposing it :-)
Currently building in the PPA, the fix should land in a few hours.

Revision history for this message
Arnel A. Borja (kyoushuu) wrote :

It's ok, I thought that that error catching is still needed, so I reported a bug.

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.