Quickstart timeout example shows HTTP connection for HTTPS request
Nobody has claimed this yet.
Assessment
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Newbie friendliness
- 85/100
- Issue type
- Documentation
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- python
- Domain
- documentation
Research direction
The problem is in the Timeouts section of the Requests Quickstart page, linked in the issue. Its sample traceback shows HTTPConnectionPool on port 80 for an https://github.com/ URL, but the library reports HTTPSConnectionPool on port 443. Reproduce with the snippet in the issue (timeout=0.001) and update the documented output to match. Done when the shown exception and port agree with the https URL in the example.
Written by the indexing model from the issue text.
Description
The Requests Quickstart documentation differs from the Timeouts section as the example given uses an HTTPS URL, but the traceback shows a HTTP connection on port 80 instead of port 443.
I tested the example and received a different result than the expected result shown in the Quickstart documentation.
Referring to the sample https://github.com, an HTTPS connection should use port 443. The traceback should be the same.
The Quickstart documentation shows HTTPConnectionPool(host='github.com', port=80
I tried the example on my MacBook using Requests 2.32.3 and got a ConnectTimeout that said HTTPSConnectionPool(host='github.com', port=443
The current documentation seems to be outdated and does not have the correct traceback.
Documentation link:
https://requests.readthedocs.io/en/latest/user/quickstart/#timeouts
I made a Python file on Visual Studio Code and wrote this code:
import requests
print("Requests version:", requests.__version__)
try:
requests.get("https://github.com/", timeout=0.001)
except requests.exceptions.RequestException as error:
print("Exception type:", type(error).__name__)
print("Error:", error)
I used Mac OS, Python 3.12, Requests 2.32.3 and Visual Studio Code.
{
"chardet": {
"version": null
},
"charset_normalizer": {
"version": "3.4.7"
},
"cryptography": {
"version": ""
},
"idna": {
"version": "3.14"
},
"implementation": {
"name": "CPython",
"version": "3.12.3"
},
"platform": {
"release": "23.5.0",
"system": "Darwin"
},
"pyOpenSSL": {
"openssl_version": "",
"version": null
},
"requests": {
"version": "2.32.3"
},
"system_ssl": {
"version": "300000d0"
},
"urllib3": {
"version": "2.7.0"
},
"using_charset_normalizer": true,
"using_pyopenssl": false
}
- Dominant language
- Python
- Stars
- 54.7k
- Forks
- 10.8k
- Avg merge
- 18m
- Merged PRs (30d)
- 1
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing 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.
More from psf/requests
-
`iter_lines(decode_unicode=True, delimiter=<str>)` raises `TypeError` when `Response.encoding` is `None`May be free again A pull request for this issue was closed without being merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
-
get_encoding_from_headers treats any content type containing 'text' as text/* (ISO-8859-1)Possibly taken @suyashgitt claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Invalid `params` type (e.g. int) raises misleading "TypeError: Cannot mix str and non-str arguments"Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
OCA/account-invoicing#2529 ·
Maintainers usually reply within 1 day
-
area/ci
Difficulty 1/5 Under an hour Newbie friendliness 62/100
Maintainers usually reply within 1 day
-
ImageGen generate-batch aborts valid JSONL jobs containing a Unicode line separator in poster textOpenbug imagen skills
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Email validation accepts a trailing newlinePossibly taken @marcello-pichini claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day