pyfoo / python-twitter

Automatically exported from code.google.com/p/python-twitter
Apache License 2.0
0 stars 0 forks source link

api.GetFollowers() => HTTPError: HTTP Error 502: Bad Gateway #146

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
>>> api.GetFollowers()
Traceback (most recent call last):
  File "<input>", line 1, in <module>
  File "/usr/local/lib/python2.6/dist-packages/python_twitter-0.7_devel
-py2.6.egg/twitter.py", line 1853, in GetFollowers
    json = self._FetchUrl(url, parameters=parameters)
  File "/usr/local/lib/python2.6/dist-packages/python_twitter-0.7_devel
-py2.6.egg/twitter.py", line 2458, in _FetchUrl
    response = opener.open(url, encoded_post_data)
  File "/usr/lib/python2.6/urllib2.py", line 397, in open
    response = meth(req, response)
  File "/usr/lib/python2.6/urllib2.py", line 510, in http_response
    'http', request, response, code, msg, hdrs)
  File "/usr/lib/python2.6/urllib2.py", line 435, in error
    return self._call_chain(*args)
  File "/usr/lib/python2.6/urllib2.py", line 369, in _call_chain
    result = func(*args)
  File "/usr/lib/python2.6/urllib2.py", line 518, in http_error_default

    raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
HTTPError: HTTP Error 502: Bad Gateway

uname -a
Linux ubuntu 2.6.32-21-generic-pae #32-Ubuntu SMP Fri Apr 16 09:39:35 UTC 2010 
i686 GNU/Linux

Version Details :
Python 2.6.5
python-twitter-0.6

Original issue reported on code.google.com by hemanth...@gmail.com on 1 Jul 2010 at 5:05

GoogleCodeExporter commented 9 years ago
I've seen this many times myself, and it sure seems to be a twitter glitch. 
Retrying the request usually succeeds.  I've seen it from GetFollowers and 
GetFriends, and maybe other API calls.

I have been retrying the GetFollowers call in my code, but coding the retry 
within FetchURL might be warranted if it affects many other API calls as well.

Original comment by snaplogi...@gmail.com on 1 Jul 2010 at 6:17

GoogleCodeExporter commented 9 years ago
This may also have been an issue with the base url used, which was just fixed 
in changeset 241:dca91beb7418

Original comment by bear42 on 3 Dec 2011 at 11:24