Python中的此追溯错误是什么

Python中的此追溯错误是什么

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

最佳答案

查看此答案,看是否对您有帮助:
httplib CannotSendRequest error in WSGI

关于python - Python中的此追溯错误是什么?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/2216259/

10-09 07:39