Python中的这个回溯错误是什么?

时间:2010-02-07 07:18:59

标签: python django url oauth

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-repos/hell/life/views.py" in linkedin_auth
  137.     token = oauth_linkedin.get_unauthorised_request_token()
File "/home/ea/ea-repos/hell/life/oauth_linkedin.py" in get_unauthorised_request_token
  54.     resp = fetch_response(oauth_request, connection)
File "/home/ea/ea-repos/hell/life/oauth_linkedin.py" in fetch_response
  44.         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: 

更具体地说,它出现在这个函数中:

def fetch_response(oauth_request, connection, linkedin_getinfo = False, other_url = ''):
    url = oauth_request.to_url()
    if linkedin_getinfo:
        headers = oauth_request.to_header()
        connection.request(oauth_request.http_method,other_url, headers = headers)
    else:
        connection.request(oauth_request.http_method,url)
    response = connection.getresponse()
    s = response.read()
    return s

1 个答案:

答案 0 :(得分:1)

看看这个答案,看看它是否对你有所帮助: httplib CannotSendRequest error in WSGI