Missing parameter in is_day_now, applet crashes on initialization for Weather Underground

Bug #1337940 reported by Martin D. Weinberg
56
This bug affects 11 people
Affects Status Importance Assigned to Milestone
my-weather-indicator
Fix Released
Critical
Lorenzo Carbonell

Bug Description

In 0.6.8-0extras14.04.5, applet crashes owing to a missing parameter. I've attached a patch.

Terminal output follows:

#####################################################
LSB Version: security-4.0-amd64:security-4.0-noarch:security-4.1-amd64:security-4.1-noarch
Distributor ID: Ubuntu
Description: Ubuntu 14.04 LTS
Release: 14.04
Codename: trusty
Version: x86_64
#####################################################

My-Weather-Indicator version: 0.6.8-0extras14.04.5
#####################################################
/home/weinberg/.config/my-weather-indicator/my-weather-indicator.conf True
****** Requesting timezone identificacion
--- Updating data in location 1 ---
****** Updating weather
****** Calculating rawOffset
********************************************************
********************************************************
05:19 << 13:53 << 20:31
********************************************************
********************************************************
Traceback (most recent call last):
  File "/opt/extras.ubuntu.com/my-weather-indicator/bin/my-weather-indicator", line 50, in <module>
    mwi=MWI()
  File "/opt/extras.ubuntu.com/my-weather-indicator/share/my-weather-indicator/myweatherindicator.py", line 135, in __init__
    self.load_preferences()
  File "/opt/extras.ubuntu.com/my-weather-indicator/share/my-weather-indicator/myweatherindicator.py", line 368, in load_preferences
    self.work()
  File "/opt/extras.ubuntu.com/my-weather-indicator/share/my-weather-indicator/myweatherindicator.py", line 192, in work
    self.set_menu()
  File "/opt/extras.ubuntu.com/my-weather-indicator/share/my-weather-indicator/myweatherindicator.py", line 504, in set_menu
    weather = self.weatherservice1.get_weather()
  File "/opt/extras.ubuntu.com/my-weather-indicator/share/my-weather-indicator/wundergroundapi.py", line 146, in get_weather
    weather_data = self._get_weather()
  File "/opt/extras.ubuntu.com/my-weather-indicator/share/my-weather-indicator/wundergroundapi.py", line 85, in _get_weather
    if weatherservice.is_day_now(weather_data['current_conditions']['sunrise_time_utc'],weather_data['current_conditions']['sunset_time_utc']):
TypeError: is_day_now() missing 1 required positional argument: 'rawOffset'
tmp.tmp (END)

Revision history for this message
Martin D. Weinberg (martin-weinberg-5) wrote :
summary: Missing parameter in is_day_now, applet crashes on initialization for
- weatherundergraound
+ Weather Underground
Revision history for this message
Felipe Castillo (fcastillo.ec) wrote :

I was about to report this same buy. Thanks for that patch! It's simple enough to be understood and applied manually until an update comes from the PPA.

Revision history for this message
mst3kharris (harrisk3) wrote :

I apologize for this very basic question, but I'm very very new to Linux. I think I understand that I need to replace some of the source code for my-weather-indicator with the patch code but I'm not sure where to find my-weather-indicator.py. Do I download the source from somewhere, apply the patch, and then run a make and install? I'm doing some research to see if I can figure it out on my own but I thought I'd ask in case my google skills fail me. Sorry for the inconvenience!

Revision history for this message
Presianbg (presianbg) wrote :

@Katherine Harris (harrisk3)

No you don't need to download any source and patch...

1. Install my-weather-indicator from ppa;
2. sudo gedit /opt/extras.ubuntu.com/my-weather-indicator/share/my-weather-indicator/weatherservice.py
3. edit line 333, which is
def is_day_now(sunrise,sunset,rawOffset):
and should be :
def is_day_now(sunrise,sunset,rawOffset=0):

Restart the app !

That is it :) Remember you can use vim or any of your favorite text redactors to edit weatherservice.py

Revision history for this message
Cavia Porcellus (caviaporcellus) wrote :

Yes, the patch works great. Thanks!

Changed in my-weather-indicator:
assignee: nobody → Lorenzo Carbonell (lorenzo-carbonell)
importance: Undecided → Critical
status: New → Fix Released
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.