当我在Python中使用httplib作为我的OAUTH时,我总是得到“CannotSendRequest”然后“

时间:2010-02-22 10:13:15

标签: python django connection oauth httplib

Traceback:
File "/usr/local/lib/python2.6/dist-packages/django/core/handlers/base.py" in get_response
  92.                 response = callback(request, *callback_args, **callback_kwargs)
File "/home/ea/ea/hell/life/views.py" in linkedin_auth
  274.     token = oauth_linkedin.get_unauthorised_request_token()
File "/home/ea/ea/hell/life/oauth_linkedin.py" in get_unauthorised_request_token
  52.     resp = fetch_response(oauth_request, connection)
File "/home/ea/ea/hell/life/oauth_linkedin.py" in fetch_response
  42.         connection.request(oauth_request.http_method,url)
File "/usr/lib/python2.6/httplib.py" in request
  874.             self._send_request(method, url, body, headers)
File "/usr/lib/python2.6/httplib.py" in _send_request
  891.         self.putrequest(method, url, **skips)
File "/usr/lib/python2.6/httplib.py" in putrequest
  778.             raise CannotSendRequest()

Exception Type: CannotSendRequest at /linkedin/auth
Exception Value: 

然后,有时我得到: BadStatusLine 错误而非此错误。

这很随意。我不知道他们何时或为何发生。 当我运行Django开发服务器时更频繁地发生(在APACHE2中更少发生......但它仍然在随机时间发生)。发生此错误时,我必须重新启动服务器。

1 个答案:

答案 0 :(得分:0)