Skip to content
This repository has been archived by the owner on Nov 27, 2018. It is now read-only.

Invalid Location HTTP header #4

Open
karlcow opened this issue Aug 16, 2012 · 0 comments
Open

Invalid Location HTTP header #4

karlcow opened this issue Aug 16, 2012 · 0 comments
Labels

Comments

@karlcow
Copy link
Owner

karlcow commented Aug 16, 2012

The site www.118114.cn redirects to a bogus Location: HTTP header

Location: www.118114.cn:

Note the colon at the end. The trace of the crash.

Traceback (most recent call last):
  File "survey/core.py", line 319, in <module>
    main()
  File "survey/core.py", line 271, in main
    htmltext, finaluri = req.getContent(uri, UAREF)
  File "survey/core.py", line 68, in getContent
    r = requests.get(uri, headers=headers)
  File "/Library/Python/2.7/site-packages/requests/api.py", line 54, in get
    return request('get', url, **kwargs)
  File "/Library/Python/2.7/site-packages/requests/safe_mode.py", line 37, in wrapped
    return function(method, url, **kwargs)
  File "/Library/Python/2.7/site-packages/requests/api.py", line 42, in request
    return s.request(method=method, url=url, **kwargs)
  File "/Library/Python/2.7/site-packages/requests/sessions.py", line 230, in request
    r.send(prefetch=prefetch)
  File "/Library/Python/2.7/site-packages/requests/models.py", line 609, in send
    self._build_response(r)
  File "/Library/Python/2.7/site-packages/requests/models.py", line 296, in _build_response
    request.send()
  File "/Library/Python/2.7/site-packages/requests/models.py", line 533, in send
    raise InvalidURL(e)
requests.exceptions.InvalidURL: (LocationParseError(...), 'Failed to parse: Failed to parse: www.118114.cn:')
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant