Error detect the location result from Yahoo

Bug #1087910 reported by bbiao
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Weather Indicator
New
Undecided
Unassigned

Bug Description

The original codes in indicator-weather
if (yahoo_woeid_result['ResultSet']['Error'] != 0) and (yahoo_woeid_result['ResultSet']['Results'] != None):

Yahoo return yahoo_woeid_result['ResultSet']['Error'] as a string, so it will never be equal to 0. After apply the location it will crashes, and error messages are:
AttributeError in export_location_details(): Location instance has no attribute 'location_code' (as reported here: https://bugs.launchpad.net/ubuntu/+source/indicator-weather/+bug/821233)

above code should modify to

if (yahoo_woeid_result['ResultSet']['Error'] != '0') and (yahoo_woeid_result['ResultSet']['Results'] != None):

Platform: Ubuntu 12.10 + Unity
Version: 12.07.30 'Cloudy 10'
After the patch, it works fine for me

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.