weather applet crashes when you add a locality
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Weather Indicator |
Fix Released
|
Undecided
|
r |
Bug Description
I try to add a new locality and nothing append. After few minutes, apport say that something went wrong!
ProblemType: Crash
DistroRelease: Ubuntu 12.04
Package: indicator-weather 12.07.30~precise1 [origin: LP-PPA-
ProcVersionSign
Uname: Linux 3.2.0-34-generic x86_64
NonfreeKernelMo
ApportVersion: 2.0.1-0ubuntu17
Architecture: amd64
CrashDB: indicator_weather
Date: Sun Dec 16 13:16:04 2012
ExecutablePath: /usr/bin/
InstallationMedia: Ubuntu 12.04.1 LTS "Precise Pangolin" - Release amd64 (20120823.1)
InterpreterPath: /usr/bin/python2.7
MarkForUpload: True
PackageArchitec
ProcCmdline: /usr/bin/python /usr/bin/
ProcEnviron:
PATH=(custom, no user)
LANG=it_IT.UTF-8
SHELL=/bin/bash
PythonArgs: ['/usr/
SourcePackage: indicator-weather
ThirdParty: True
Title: indicator-weather crashed with AttributeError in export_
UpgradeStatus: No upgrade log present (probably fresh install)
UserGroups: adm cdrom dip lpadmin plugdev sambashare sudo
Changed in weather-indicator: | |
assignee: | nobody → gea (frost-52) |
status: | New → Fix Released |
Changed in weather-indicator: | |
assignee: | gea (frost-52) → r (rallen-34) |
Happens here as well:
Traceback (most recent call last): indicator- weather" , line 1893, in on_apply export_ location_ details( ) indicator- weather" , line 406, in export_ location_ details code, self.location_ details)
File "/usr/bin/
(location_code, location_details) = self.location.
File "/usr/bin/
return (self.location_
AttributeError: Location instance has no attribute 'location_code'
Turns out it's a problem at line 362, where it checks for errors from Yahoo:
if (yahoo_ woeid_result[ 'ResultSet' ]['Error' ] != 0) and (yahoo_ woeid_result[ 'ResultSet' ]['Results' ] != None):
is always true because yahoo_woeid_ result[ 'ResultSet' ]['Error' ] is a string; I fixed it by comparing with a string as well:
if (yahoo_ woeid_result[ 'ResultSet' ]['Error' ] != '0') and (yahoo_ woeid_result[ 'ResultSet' ]['Results' ] != None):
so it's an easy fix
However, I take a _big_ issue with this:
where s is a JSON string; you're kidding, right?