Crash at startup with Yahoo weather service set

Bug #1135921 reported by Hansen
112
This bug affects 28 people
Affects Status Importance Assigned to Milestone
my-weather-indicator
Fix Released
Critical
Lorenzo Carbonell

Bug Description

Ubuntu quantal 12.10 Desktop x86_64
My-Weather-Indicator version: 0.6.1.2.quantal.1
Crashes on startup:

 /opt/extras.ubuntu.com/my-weather-indicator/bin/my-weather-indicator
/home/mads
<gettext.GNUTranslations object at 0x7f492460ad10>
No LSB modules are available.
#####################################################
Distributor ID: Ubuntu
Description: Ubuntu 12.10
Release: 12.10
Codename: quantal
Version: x86_64
#####################################################

My-Weather-Indicator version: 0.6.1.2.quantal.1
#####################################################
/home/mads/.config/my-weather-indicator/my-weather-indicator.conf True
b'{"time":"2013-02-28 16:45","countryName":"Denmark","sunset":"2013-02-28 17:50","rawOffset":1,"dstOffset":2,"countryCode":"DK","gmtOffset":1,"lng":10.2107620239258,"sunrise":"2013-02-28 07:14","timezoneId":"Europe/Copenhagen","lat":56.1567365813134}'
Searching url: http://where.yahooapis.com/geocode?q=56.1567365813134,+10.2107620239258&gflags=R&flags=J&appid=_slN0oHV34Exg09kl5EASmbGBs5y3GJES1N.Oon0wd5Lnh6E5hGdtQmx_MdxpOxKAzftS1dB0yNI_NzTpWaKFXEm
GID HTTP Error 404: Not Found
Yahoo Weather Service, not found woeid
Traceback (most recent call last):
  File "/opt/extras.ubuntu.com/my-weather-indicator/bin/my-weather-indicator", line 46, in <module>
    mwi=MWI()
  File "/opt/extras.ubuntu.com/my-weather-indicator/share/my-weather-indicator/myweatherindicator.py", line 136, in __init__
    self.load_preferences()
  File "/opt/extras.ubuntu.com/my-weather-indicator/share/my-weather-indicator/myweatherindicator.py", line 363, in load_preferences
    self.work()
  File "/opt/extras.ubuntu.com/my-weather-indicator/share/my-weather-indicator/myweatherindicator.py", line 196, in work
    self.set_menu()
  File "/opt/extras.ubuntu.com/my-weather-indicator/share/my-weather-indicator/myweatherindicator.py", line 465, in set_menu
    temporal_current_conditions = weather['current_conditions']
TypeError: 'NoneType' object is not subscriptable

Revision history for this message
Luigi R. (xluigi84) wrote :

It happens to me when my router is on, so wifi is up but the connection to the server is not established yet. In fact if the network-manager is down an I run my-weather-indicator in the terminal I can see that it waiting for an internet connection. Sometimes it happens that I turn on my computer and my router at the same time, so the wifi is on, the network manager is connected to the router but internet is still down.

Revision history for this message
galen (galen-technomage) wrote :

Same here ! My-weather-indicator works with open weather map but not with yahoo.

/opt/extras.ubuntu.com/my-weather-indicator/bin/my-weather-indicator
/mnt/DOWNLOADS
<gettext.GNUTranslations object at 0x7f5a0e627a50>
No LSB modules are available.
#####################################################
Distributor ID: Ubuntu
Description: Ubuntu Raring Ringtail (development branch)
Release: 13.04
Codename: raring
Version: x86_64
#####################################################

My-Weather-Indicator version: 0.6.1.2.quantal.1
#####################################################
/home/galen/.config/my-weather-indicator/my-weather-indicator.conf True
b'{"time":"2013-04-02 18:19","countryName":"France","sunset":"2013-04-02 20:33","rawOffset":1,"dstOffset":2,"countryCode":"FR","gmtOffset":1,"lng":-0.8840369293213409,"sunrise":"2013-04-02 07:41","timezoneId":"Europe/Paris","lat":47.05705355395874}'
Timezone Error unsupported operand type(s) for /: 'str' and 'float'
Searching url: http://where.yahooapis.com/geocode?q=47.05705355395874,+-0.8840369293213409&gflags=R&flags=J&appid=_slN0oHV34Exg09kl5EASmbGBs5y3GJES1N.Oon0wd5Lnh6E5hGdtQmx_MdxpOxKAzftS1dB0yNI_NzTpWaKFXEm
GID HTTP Error 404: Not Found
Yahoo Weather Service, not found woeid
Traceback (most recent call last):
  File "/opt/extras.ubuntu.com/my-weather-indicator/bin/my-weather-indicator", line 46, in <module>
    mwi=MWI()
  File "/opt/extras.ubuntu.com/my-weather-indicator/share/my-weather-indicator/myweatherindicator.py", line 136, in __init__
    self.load_preferences()
  File "/opt/extras.ubuntu.com/my-weather-indicator/share/my-weather-indicator/myweatherindicator.py", line 363, in load_preferences
    self.work()
  File "/opt/extras.ubuntu.com/my-weather-indicator/share/my-weather-indicator/myweatherindicator.py", line 196, in work
    self.set_menu()
  File "/opt/extras.ubuntu.com/my-weather-indicator/share/my-weather-indicator/myweatherindicator.py", line 465, in set_menu
    temporal_current_conditions = weather['current_conditions']
TypeError: 'NoneType' object is not subscriptable

Revision history for this message
Laloi (llaloi) wrote :

I had the same problem today, after choosing Yahoo forecast, The program crashed.I coudn't reopen it to reverse to another forecast service.

uninstalled completely and reinstalled, but couldn't open it to set forecast preferences.got the same message internal error

Revision history for this message
Sergio (choromoro) wrote :

To reverse to another forecast service, go to ~/.config/my-weather-indicator and delete my-weather-indicator.conf. Run the program again and the configuration window should appear. Choose the appropiate weather service.

Revision history for this message
Hansen (moteprime) wrote :

@Sergio. Will this stop the crashing at every startup?

Revision history for this message
Rocko (rockorequin) wrote :

Removing the config file does stop it crashing at each startup, presumably at least until you choose Yahoo again as the data source.

However, it would be preferable if my-weather-indicator handled this error more gracefully so you could modify the data source from the GUI instead of having to dig around in the file system.

Changed in my-weather-indicator:
status: New → Confirmed
Revision history for this message
Hansen (moteprime) wrote :

Like you said, it stopped the crashing until i choose Yahoo again.
Could the bug not easily get fixed?

Revision history for this message
Damir Butmir (d4m1r2) wrote :

I had this same problem under Ubuntu 12.04 LTS (x64). I did NOT update Ubuntu or my-weather-indicator for weeks, and just one day it stopped working randomly....Even a reinstall of the app did NOT work. I had to go to ~./config/my-weather-indicator and manually delete the .conf file. I was then able to start the application without it crashed and pick another weather service apart from Yahoo.

Revision history for this message
Cas (calumlind) wrote :

The simplest solution is to edit the conf file to reset the weather service.

Find the following in ~./config/my-weather-indicator/my-weather-indicator.conf

    "weather-service": "yahoo"

and replace with:

   "weather-service": "openweathermap"

summary: - My-weather-indicator 0.6.1.2.quantal.1 crashes at startup
+ Crash at startup with Yahoo weather service set
Revision history for this message
Hansen (moteprime) wrote :

@Cas. Changening to openweathermap is not really a solution, just a workaround to stop the crashes.
openweathermap are not very usefull, it's data are way of half the times.

Revision history for this message
Cas (calumlind) wrote :

@Hansen I meant solution to deleting entire config.

The reason for this bug is that Yahoo has closed down the geocode lookup service and replaced it with a premium version however there is an alternative option using YQL (http://developer.yahoo.com/boss/geo/docs/free_YQL.html) and I have created a patch that will fix this issue: https://gist.github.com/cas--/5412453

Revision history for this message
Hansen (moteprime) wrote :

@Cas. I am sorry, i misunderstood your post. Did not mean to be rude or anything.
Should i test your patch?

Revision history for this message
Bob (bbrazie) wrote :

Where do I find this geocode on my system?

Revision history for this message
Cas (calumlind) wrote :

You can use the `locate` command to find it:

    locate geocodeapi.py

For Precise PPA install it returns:

    /opt/extras.ubuntu.com/my-weather-indicator/share/my-weather-indicator/geocodeapi.py

Changed in my-weather-indicator:
assignee: nobody → Lorenzo Carbonell (lorenzo-carbonell)
status: Confirmed → In Progress
importance: Undecided → Critical
Changed in my-weather-indicator:
status: In Progress → Fix Released
Revision history for this message
Hansen (moteprime) wrote :

I can confirm the released fix solves bug.
Thank you.

Revision history for this message
Lorenzo Carbonell (lorenzo-carbonell) wrote :

Thanks Hansen

lively (doratheexplorer)
no longer affects: ubuntu
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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