indicator-weather Cannot add location

Bug #1093769 reported by Hansen
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Weather Indicator
New
Undecided
Unassigned
indicator-weather (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

When adding a location and finishing clicking the apply button, nothing happens.

ProblemType: Bug
DistroRelease: Ubuntu 12.04
Package: indicator-weather 11.11.28-0ubuntu1.2
ProcVersionSignature: Ubuntu 3.2.0-35.55-generic-pae 3.2.34
Uname: Linux 3.2.0-35-generic-pae i686
ApportVersion: 2.0.1-0ubuntu15.1
Architecture: i386
Date: Wed Dec 26 10:42:23 2012
InstallationMedia: Ubuntu 12.04.1 LTS "Precise Pangolin" - Release i386 (20120817.3)
MarkForUpload: True
PackageArchitecture: all
SourcePackage: indicator-weather
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Hansen (moteprime) wrote :
Revision history for this message
Hansen (moteprime) wrote :

Have this issue on two machines.

summary: - Cannot add location
+ indicator-weather Cannot add location
Revision history for this message
Hansen (moteprime) wrote :

Running from console, these errors are returned:

Traceback (most recent call last):
  File "/usr/bin/indicator-weather", line 1892, in on_apply
    (location_code, location_details) = self.location.export_location_details()
  File "/usr/bin/indicator-weather", line 405, in export_location_details
    return (self.location_code, self.location_details)
AttributeError: Location instance has no attribute 'location_code'

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

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

Changed in indicator-weather (Ubuntu):
status: New → Confirmed
Revision history for this message
Roman Yepishev (rye) wrote :

This indicator evals json data (which is potentially dangerous) and the evaluated data has ['ResultSet']['Error'] as "0" (string value) while the code checks for 0, a number.
>>> '0' == 0
False

So the quick and dirty fix in this case is to modify the condition at line 367 in indicator-weather to read:
if (yahoo_woeid_result['ResultSet']['Error'] != '0') and (yahoo_woeid_result['ResultSet']['Results'] != None):

But the proper fix is to rewrite the evals using json module.

Revision history for this message
Hansen (moteprime) wrote :

Is it not going to get fixed. - i got three Ubuntu machines here and on two of them the weather indicator has this bug.

Revision history for this message
Sami Jaktholm (sjakthol) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. This particular bug has already been reported and is a duplicate of bug 821233, so it is being marked as such. Please look at the other bug report to see if there is any missing information that you can provide, or to see if there is a workaround for the bug. Additionally, any further discussion regarding the bug should occur in the other report. Feel free to continue to report any other bugs you may find.

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.