tsroten/yweather

httplib.BadStatusLine:

Closed this issue · 2 comments

vegaswe = client.fetch_weather("2436704")
Traceback (most recent call last):
File "", line 1, in
File "C:\Tools\Python(x86)\Python27\lib\site-packages\yweather.py", line 180, in fetch_weather
rss = self._fetch_xml(url)
File "C:\Tools\Python(x86)\Python27\lib\site-packages\yweather.py", line 344, in _fetch_xml
with contextlib.closing(urlopen(url)) as f:
File "C:\Tools\Python(x86)\Python27\lib\urllib2.py", line 154, in urlopen
return opener.open(url, data, timeout)
File "C:\Tools\Python(x86)\Python27\lib\urllib2.py", line 429, in open
response = self._open(req, data)
File "C:\Tools\Python(x86)\Python27\lib\urllib2.py", line 447, in _open
'_open', req)
File "C:\Tools\Python(x86)\Python27\lib\urllib2.py", line 407, in _call_chain
result = func(*args)
File "C:\Tools\Python(x86)\Python27\lib\urllib2.py", line 1228, in http_open
return self.do_open(httplib.HTTPConnection, req)
File "C:\Tools\Python(x86)\Python27\lib\urllib2.py", line 1201, in do_open
r = h.getresponse(buffering=True)
File "C:\Tools\Python(x86)\Python27\lib\httplib.py", line 1136, in getresponse
response.begin()
File "C:\Tools\Python(x86)\Python27\lib\httplib.py", line 453, in begin
version, status, reason = self._read_status()
File "C:\Tools\Python(x86)\Python27\lib\httplib.py", line 417, in _read_status
raise BadStatusLine(line)
httplib.BadStatusLine: ''

I was just trying this out for the first time. This may be an easy fix because I am just a noob so please tell me if this is something I am doing thanks.

Same issue here. Any thoughts? Below is my code, the trace is nearly identical to OP.

import yweather
weather = yweather.Client()
wake_weather = weather.fetch_weather("615702")
print wake_weather["astronomy"]["sunrise"]

A note that may help is that the code below works
import yweather
weather = yweather.Client()
weather_id = weather.fetch_woeid("Chicago, Illinois")
print weather_id

@petek157 @killerdevildog11 Yahoo Weather has discontinued the RSS feed interface this library is based on. There is a new YQL Query interface: https://developer.yahoo.com/weather/

I don't plan on updating this library to use the new endpoint. Feel free to fork!