CrazeeIvan / python-weather-api

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

AttributeError when parsing empty latitude/longitude in Yahoo Weather data #23

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Call pywapi.get_weather_from_yahoo('CAXX1978')

What is the expected output? What do you see instead?
Expect correctly-parsed weather data to be returned. Instead, pywapi crashes 
with traceback:

File "/usr/lib/python2.7/dist-packages/pywapi.py", line 317, in 
get_weather_from_yahoo
    weather_data['geo']['lat'] = dom.getElementsByTagName('geo:lat')[0].firstChild.data
AttributeError: 'NoneType' object has no attribute 'data'

This has been fixed as of 0.3.1, reporting here for posterity.

Original issue reported on code.google.com by jtas...@gmail.com on 24 May 2013 at 6:41