CrazeeIvan / python-weather-api

Automatically exported from code.google.com/p/python-weather-api
MIT License
0 stars 0 forks source link

AttributeError: 'NoneType' object has no attribute 'data' #39

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. The problem is random and only arises when the 'wind' attribute is empty.
2. n/a
3. n/a

What is the expected output? What do you see instead?

Traceback (most recent call last):
  File "weather.py", line 386, in <module>
    myDisp.UpdateWeather()
  File "weather.py", line 91, in UpdateWeather
    w = pywapi.get_weather_from_weather_com( '16601', units='imperial' )
  File "/usr/local/lib/python2.7/dist-packages/pywapi.py", line 239, in get_weather_from_weather_com
    'wind')[0].getElementsByTagName(tag2)[0].firstChild.data
AttributeError: 'NoneType' object has no attribute 'data'

What version of the product are you using? On what operating system?

pywapi-0.3.8 on both Ubuntu 14.04 and Raspberry Pi Debian Wheezy

Please provide any additional information below.

This error does not appear 100% of the time. It only pops up when the 'wind' 
tag is empty/missing.

Original issue reported on code.google.com by chad.mo...@gmail.com on 21 Jul 2014 at 10:08

GoogleCodeExporter commented 8 years ago
Here is the log for Python 3.2. Same issue

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.2/dist-packages/pywapi.py", line 239, in get_weat                                                                                                                                                             her_from_weather_com
    'wind')[0].getElementsByTagName(tag2)[0].firstChild.data
AttributeError: 'NoneType' object has no attribute 'data'

Original comment by andreask...@gmail.com on 22 Jul 2014 at 8:22

GoogleCodeExporter commented 8 years ago
I als recieve the same error at randon times.
latest raspian 20/07/2014

Original comment by t1su...@hotmail.co.uk on 3 Aug 2014 at 7:00