weather-yahoo plugin crashes in some locales

Bug #1091995 reported by Nuno Araujo
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
gnome15
In Progress
Medium
Nuno Araujo

Bug Description

According to the locale configuration of the computer, the weather-yahoo plugin crashes.

This happens when parsing the sunrise and sunset times.
According to the python documentation, the strptime method takes the current application locale into account when doing it's parsing. This method fails as below if e.g the LC_TIME env var is set to fr_CH.utf8

Traceback (most recent call last):
  File "/usr/share/gnome15/plugins/weather/weather.py", line 240, in refresh
    self._weather = backend.get_weather_data()
  File "/usr/share/gnome15/plugins/weather-yahoo/weather-yahoo.py", line 156, in get_weather_data
    return self._do_get_weather_data_xml()
  File "/usr/share/gnome15/plugins/weather-yahoo/weather-yahoo.py", line 228, in _do_get_weather_data_xml
    sunset = time.strptime(astronomy["sunset"], "%I:%M %p")
  File "/usr/lib/python2.7/_strptime.py", line 454, in _strptime_time
    return _strptime(data_string, format)[0]
  File "/usr/lib/python2.7/_strptime.py", line 328, in _strptime
    data_string[found.end():])
ValueError: unconverted data remains: pm

Related branches

Nuno Araujo (russo79)
Changed in gnome15:
assignee: nobody → Nuno Araujo (russo79)
importance: Undecided → Medium
status: New → Fix Committed
Nuno Araujo (russo79)
Changed in gnome15:
status: Fix Committed → In Progress
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.