Quickstart timeout example shows HTTP connection for HTTPS request
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 1/5
- Thời gian dự kiến
- Dưới một giờ
- Mức phù hợp với người mới
- 85/100
- Loại issue
- Tài liệu
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- python
- Lĩnh vực
- documentation
Hướng nghiên cứu
Vấn đề nằm ở phần Timeouts của trang Requests Quickstart được liên kết trong issue. Traceback mẫu trong tài liệu hiển thị HTTPConnectionPool ở cổng 80 cho URL https://github.com/, nhưng thư viện báo HTTPSConnectionPool ở cổng 443. Hãy tái tạo lỗi bằng đoạn mã trong issue (timeout=0.001) và cập nhật kết quả được ghi trong tài liệu cho khớp. Hoàn thành khi ngoại lệ hiển thị và cổng khớp với URL https trong ví dụ.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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
}
- Ngôn ngữ chính
- Python
- Star
- 54.7k
- Fork
- 10.8k
- Merge trung bình
- 18 phút
- Pull request đã merge (30 ngày)
- 1
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của psf/requests
-
`iter_lines(decode_unicode=True, delimiter=<str>)` raises `TypeError` when `Response.encoding` is `None`Có thể làm lại được Pull request cho issue này đã bị đóng mà không được merge. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
-
get_encoding_from_headers treats any content type containing 'text' as text/* (ISO-8859-1)Có thể đã có người làm @suyashgitt đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
Invalid `params` type (e.g. int) raises misleading "TypeError: Cannot mix str and non-str arguments"Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
OCA/account-invoicing#2529 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area/ci
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 62/100
Maintainer thường phản hồi trong vòng 1 ngày
-
ImageGen generate-batch aborts valid JSONL jobs containing a Unicode line separator in poster textĐang mởbug imagen skills
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Email validation accepts a trailing newlineCó thể đã có người làm @marcello-pichini đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày