UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 394: ordinal not in range(128)

Bug #1396896 reported by Antonis Sidiropoulos
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
my-weather-indicator
Fix Released
Undecided
Unassigned

Bug Description

Sometimes (probably it depends from the weather)
my-weather-indicator crashes.
Running it from command line I get the messages:
<gettext.GNUTranslations instance at 0xb51262ac>
No LSB modules are available.
#####################################################
Distributor ID: Ubuntu
Description: Ubuntu 14.04.1 LTS
Release: 14.04
Codename: trusty
Version: i686
#####################################################

My-Weather-Indicator version: 0.6.3
#####################################################
('/home/asidirop/.config/my-weather-indicator/my-weather-indicator.conf', True)
{"sunrise":"2014-11-27 07:27","lng":22.9594444,"countryCode":"GR","gmtOffset":2,"rawOffset":2,"sunset":"2014-11-27 17:03","timezoneId":"Europe/Athens","dstOffset":3,"countryName":"Greece","time":"2014-11-27 09:44","lat":40.6405556}
{"sunrise":"2014-11-27 07:28","lng":22.510520935059233,"countryCode":"GR","gmtOffset":2,"rawOffset":2,"sunset":"2014-11-27 17:06","timezoneId":"Europe/Athens","dstOffset":3,"countryName":"Greece","time":"2014-11-27 09:44","lat":40.268809791460896}
Timezone Error unsupported operand type(s) for /: 'unicode' and 'float'
North
(<type 'str'>, u'9 \xb0C')
################
mwi-wind00.png
Traceback (most recent call last):
  File "/opt/extras.ubuntu.com/my-weather-indicator/bin/my-weather-indicator", line 45, in <module>
    mwi=MWI()
  File "/opt/extras.ubuntu.com/my-weather-indicator/share/my-weather-indicator/myweatherindicator.py", line 134, in __init__
    self.load_preferences()
  File "/opt/extras.ubuntu.com/my-weather-indicator/share/my-weather-indicator/myweatherindicator.py", line 361, in load_preferences
    self.work()
  File "/opt/extras.ubuntu.com/my-weather-indicator/share/my-weather-indicator/myweatherindicator.py", line 199, in work
    self.set_menu2()
  File "/opt/extras.ubuntu.com/my-weather-indicator/share/my-weather-indicator/myweatherindicator.py", line 543, in set_menu2
    weather = self.weatherservice2.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 81, in _get_weather
    parsed_json = json.loads(json_string.decode())
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 394: ordinal not in range(128)

Revision history for this message
Andy Russell (icarusr) wrote :

Also will not start for me, get same error, though from a different line.
Terminal output ....

andy@Zebedee:~$ /usr/bin/python /opt/extras.ubuntu.com/my-weather-indicator/bin/my-weather-indicator
<gettext.GNUTranslations instance at 0xb5e6c3cc>
#####################################################
System: Linux
Machine: i686
Node: Zebedee
Release: 3.13.0-48-generic
Version: #80-Ubuntu SMP Thu Mar 12 11:16:18 UTC 2015
Platform: Linux-3.13.0-48-generic-i686-with-Ubuntu-14.04-trusty
#####################################################

My-Weather-Indicator version: 0.6.9-0extras14.04.2
#####################################################
('/home/andy/.config/my-weather-indicator/my-weather-indicator.conf', True)
****** Requesting timezone identificacion
///////////////////////////////////////////////////////
///////////////////////////////////////////////////////
time.time() = 1427657032
self.actualization_time = 0
(time.time()-self.actualization_time) = 1427657032
self.refresh*3600 = 1800
///////////////////////////////////////////////////////
///////////////////////////////////////////////////////
--- Updating data in location 1 ---
****** Updating weather
****** Calculating rawOffset
********************************************************
********************************************************
06:45 << 20:23 << 19:31
********************************************************
********************************************************
-------------------------------------------------------
-------------------------------------------------------
OpenWeatherMap Weather Service url:http://api.openweathermap.org/data/2.5/weather?lat=52.0368911630209&lon=-0.8047341231537324
-------------------------------------------------------
-------------------------------------------------------
****** Updated weather
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 376, in load_preferences
    self.work()
  File "/opt/extras.ubuntu.com/my-weather-indicator/share/my-weather-indicator/myweatherindicator.py", line 200, in work
    self.set_menu()
  File "/opt/extras.ubuntu.com/my-weather-indicator/share/my-weather-indicator/myweatherindicator.py", line 524, in set_menu
    self.menu_temperature.set_label(_('Temperature')+': {0}{1:c}'.format(self.current_conditions['temperature'],176))
UnicodeDecodeError: 'ascii' codec can't decode byte 0xb0 in position 3: ordinal not in range(128)

Changed in my-weather-indicator:
status: New → Fix Released
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.