no response object captured in error of endless redirect chain and confusing message
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 54.3k
- Forks
- 10.4k
- Avg merge
- 16h 43m
- Merged PRs (30d)
- 3
Description
I found an incredibly bad URL that causes a handful of issues. the url below jumps between a bunch of SocialFlow (trib.al) and Bitly url shorteners for tracking, then ends up on a connection timeout that also looks like a max retries exceeded (which makes no sense to me)
The exception that is raised under Py2 and Py3 does not have a response object, although one should exist – there are a long history of redirects that gets lost and makes this difficult to debug the url's problem.
HTTPSConnectionPool(host='this.cm', port=443): Max retries exceeded with url: /slate/follow (Caused by ConnectTimeoutError(<urllib3.connection.VerifiedHTTPSConnection object at 0x1021788d0>, 'Connection to this.cm timed out. (connect timeout=2)'))
import requests
try:
url = 'http://slate.me/1KDocND'
r = requests.get(url, timeout=2)
print("success")
print(r.response)
except Exception as error:
print("error")
print(error)
print(type(error.response))
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by running the Python reproduction snippet against the redirecting URL and trace how the redirect chain ends in a connection timeout. Inspect the exception path to determine whether the response and redirect history are available there. Done means the resulting error exposes the available response information and presents a less confusing failure message.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- networking
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100