url
stringlengths
50
53
repository_url
stringclasses
1 value
labels_url
stringlengths
64
67
comments_url
stringlengths
59
62
events_url
stringlengths
57
60
html_url
stringlengths
38
43
id
int64
597k
2.65B
node_id
stringlengths
18
32
number
int64
1
6.83k
title
stringlengths
1
296
user
dict
labels
listlengths
0
5
state
stringclasses
2 values
locked
bool
2 classes
assignee
dict
assignees
listlengths
0
4
milestone
dict
comments
int64
0
211
created_at
stringlengths
20
20
updated_at
stringlengths
20
20
closed_at
stringlengths
20
20
author_association
stringclasses
3 values
active_lock_reason
stringclasses
4 values
body
stringlengths
0
65.6k
closed_by
dict
reactions
dict
timeline_url
stringlengths
59
62
performed_via_github_app
null
state_reason
stringclasses
3 values
draft
bool
2 classes
pull_request
dict
is_pull_request
bool
2 classes
issue_comments
listlengths
0
30
https://api.github.com/repos/psf/requests/issues/6215
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6215/labels{/name}
https://api.github.com/repos/psf/requests/issues/6215/comments
https://api.github.com/repos/psf/requests/issues/6215/events
https://github.com/psf/requests/issues/6215
1,342,857,754
I_kwDOABTKOs5QCmIa
6,215
return response from `raise_for_status`
{ "avatar_url": "https://avatars.githubusercontent.com/u/44946?v=4", "events_url": "https://api.github.com/users/soxofaan/events{/privacy}", "followers_url": "https://api.github.com/users/soxofaan/followers", "following_url": "https://api.github.com/users/soxofaan/following{/other_user}", "gists_url": "https://api.github.com/users/soxofaan/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/soxofaan", "id": 44946, "login": "soxofaan", "node_id": "MDQ6VXNlcjQ0OTQ2", "organizations_url": "https://api.github.com/users/soxofaan/orgs", "received_events_url": "https://api.github.com/users/soxofaan/received_events", "repos_url": "https://api.github.com/users/soxofaan/repos", "site_admin": false, "starred_url": "https://api.github.com/users/soxofaan/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/soxofaan/subscriptions", "type": "User", "url": "https://api.github.com/users/soxofaan", "user_view_type": "public" }
[]
closed
true
null
[]
null
4
2022-08-18T09:53:48Z
2024-02-27T12:15:03Z
2023-10-28T09:47:25Z
NONE
resolved
I'd guess this has been requested before, but couldn't find any pointers so far. (I also understand that requests does not accept feature requests, but this is code-wise a trivial one-line change, so I'm going to try anyway :smile: ). Feature request: return `self` from `Response.raise_for_status()` (instead of returning `None` implicitly). That allows using it in a compact chained/fluent manner, for example ```python data = [ requests.get(url).raise_for_status().json() for url in urls ] ``` With the current `raise_for_status` you can not use list comprehension like in this examle because you have to use separate statements for the `.get()`, `.raise_for_status()` and `.json()` . (An alternative solution could be to add some kind of `raise_for_status` opt-in option to `.get()` and alike, but that would require a lot more code changes than a simple `return self` as proposed higher)
{ "avatar_url": "https://avatars.githubusercontent.com/u/240830?v=4", "events_url": "https://api.github.com/users/sigmavirus24/events{/privacy}", "followers_url": "https://api.github.com/users/sigmavirus24/followers", "following_url": "https://api.github.com/users/sigmavirus24/following{/other_user}", "gists_url": "https://api.github.com/users/sigmavirus24/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/sigmavirus24", "id": 240830, "login": "sigmavirus24", "node_id": "MDQ6VXNlcjI0MDgzMA==", "organizations_url": "https://api.github.com/users/sigmavirus24/orgs", "received_events_url": "https://api.github.com/users/sigmavirus24/received_events", "repos_url": "https://api.github.com/users/sigmavirus24/repos", "site_admin": false, "starred_url": "https://api.github.com/users/sigmavirus24/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/sigmavirus24/subscriptions", "type": "User", "url": "https://api.github.com/users/sigmavirus24", "user_view_type": "public" }
{ "+1": 4, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 4, "url": "https://api.github.com/repos/psf/requests/issues/6215/reactions" }
https://api.github.com/repos/psf/requests/issues/6215/timeline
null
not_planned
null
null
false
[ "This project is in indefinite feature-freeze and not changing the API in ways that may be surprising for existing users. Also I'm certain this has been requested before but am on mobile and can't easily search ", "I am junior SDE, and I want to contribute to open source. This is my first time.\r\nCan I work on this ?", "> This project is in indefinite feature-freeze\r\n\r\n@sigmavirus24 Is this still true?? Why is it in a feature-freeze?", "> Why is it in a feature-freeze?\r\n\r\nIt's documented here: https://requests.readthedocs.io/en/latest/dev/contributing/#feature-requests" ]
https://api.github.com/repos/psf/requests/issues/6214
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6214/labels{/name}
https://api.github.com/repos/psf/requests/issues/6214/comments
https://api.github.com/repos/psf/requests/issues/6214/events
https://github.com/psf/requests/pull/6214
1,339,683,767
PR_kwDOABTKOs49N1pV
6,214
Update reference to "cookielib" to "cookiejar" in documentation
{ "avatar_url": "https://avatars.githubusercontent.com/u/110642?v=4", "events_url": "https://api.github.com/users/ittner/events{/privacy}", "followers_url": "https://api.github.com/users/ittner/followers", "following_url": "https://api.github.com/users/ittner/following{/other_user}", "gists_url": "https://api.github.com/users/ittner/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/ittner", "id": 110642, "login": "ittner", "node_id": "MDQ6VXNlcjExMDY0Mg==", "organizations_url": "https://api.github.com/users/ittner/orgs", "received_events_url": "https://api.github.com/users/ittner/received_events", "repos_url": "https://api.github.com/users/ittner/repos", "site_admin": false, "starred_url": "https://api.github.com/users/ittner/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/ittner/subscriptions", "type": "User", "url": "https://api.github.com/users/ittner", "user_view_type": "public" }
[]
closed
true
null
[]
null
0
2022-08-16T01:02:34Z
2024-07-30T00:03:49Z
2023-07-30T01:50:43Z
CONTRIBUTOR
resolved
Docstrings still called this module as it was in python2.7; update them to use the name from python3. Mostly useful as a reference for people who need a custom cookiejar. Code does still use the compatibility layer for a no-more-supported python2, however.
{ "avatar_url": "https://avatars.githubusercontent.com/u/5271761?v=4", "events_url": "https://api.github.com/users/nateprewitt/events{/privacy}", "followers_url": "https://api.github.com/users/nateprewitt/followers", "following_url": "https://api.github.com/users/nateprewitt/following{/other_user}", "gists_url": "https://api.github.com/users/nateprewitt/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/nateprewitt", "id": 5271761, "login": "nateprewitt", "node_id": "MDQ6VXNlcjUyNzE3NjE=", "organizations_url": "https://api.github.com/users/nateprewitt/orgs", "received_events_url": "https://api.github.com/users/nateprewitt/received_events", "repos_url": "https://api.github.com/users/nateprewitt/repos", "site_admin": false, "starred_url": "https://api.github.com/users/nateprewitt/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/nateprewitt/subscriptions", "type": "User", "url": "https://api.github.com/users/nateprewitt", "user_view_type": "public" }
{ "+1": 1, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 1, "url": "https://api.github.com/repos/psf/requests/issues/6214/reactions" }
https://api.github.com/repos/psf/requests/issues/6214/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/6214.diff", "html_url": "https://github.com/psf/requests/pull/6214", "merged_at": "2023-07-30T01:50:43Z", "patch_url": "https://github.com/psf/requests/pull/6214.patch", "url": "https://api.github.com/repos/psf/requests/pulls/6214" }
true
[]
https://api.github.com/repos/psf/requests/issues/6213
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6213/labels{/name}
https://api.github.com/repos/psf/requests/issues/6213/comments
https://api.github.com/repos/psf/requests/issues/6213/events
https://github.com/psf/requests/issues/6213
1,337,999,854
I_kwDOABTKOs5PwEHu
6,213
Other Language isn't workin as a parameter
{ "avatar_url": "https://avatars.githubusercontent.com/u/67215274?v=4", "events_url": "https://api.github.com/users/abirabedinkhan/events{/privacy}", "followers_url": "https://api.github.com/users/abirabedinkhan/followers", "following_url": "https://api.github.com/users/abirabedinkhan/following{/other_user}", "gists_url": "https://api.github.com/users/abirabedinkhan/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/abirabedinkhan", "id": 67215274, "login": "abirabedinkhan", "node_id": "MDQ6VXNlcjY3MjE1Mjc0", "organizations_url": "https://api.github.com/users/abirabedinkhan/orgs", "received_events_url": "https://api.github.com/users/abirabedinkhan/received_events", "repos_url": "https://api.github.com/users/abirabedinkhan/repos", "site_admin": false, "starred_url": "https://api.github.com/users/abirabedinkhan/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/abirabedinkhan/subscriptions", "type": "User", "url": "https://api.github.com/users/abirabedinkhan", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2022-08-13T16:13:59Z
2023-08-14T00:03:15Z
2022-08-13T16:16:26Z
NONE
resolved
Please refer to our [Stack Overflow tag](https://stackoverflow.com/questions/tagged/python-requests) for guidance. when i sending a other langueges parameters requests into a url it retuens ```বা�লাদ�শ প�রতিদিন স�বাদ পত�র``` this stuffs in python requests
{ "avatar_url": "https://avatars.githubusercontent.com/u/5271761?v=4", "events_url": "https://api.github.com/users/nateprewitt/events{/privacy}", "followers_url": "https://api.github.com/users/nateprewitt/followers", "following_url": "https://api.github.com/users/nateprewitt/following{/other_user}", "gists_url": "https://api.github.com/users/nateprewitt/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/nateprewitt", "id": 5271761, "login": "nateprewitt", "node_id": "MDQ6VXNlcjUyNzE3NjE=", "organizations_url": "https://api.github.com/users/nateprewitt/orgs", "received_events_url": "https://api.github.com/users/nateprewitt/received_events", "repos_url": "https://api.github.com/users/nateprewitt/repos", "site_admin": false, "starred_url": "https://api.github.com/users/nateprewitt/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/nateprewitt/subscriptions", "type": "User", "url": "https://api.github.com/users/nateprewitt", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/6213/reactions" }
https://api.github.com/repos/psf/requests/issues/6213/timeline
null
not_planned
null
null
false
[ "@abirabedinkhan Please don't open the same issue multiple times.\n\nIf you need assistance with this please consult the documentation and ask for assistance on StackOverflow using the python-requests tag." ]
https://api.github.com/repos/psf/requests/issues/6212
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6212/labels{/name}
https://api.github.com/repos/psf/requests/issues/6212/comments
https://api.github.com/repos/psf/requests/issues/6212/events
https://github.com/psf/requests/issues/6212
1,337,981,422
I_kwDOABTKOs5Pv_nu
6,212
বাংলাদেশ প্রতিদিন সংবাদ পত্র
{ "avatar_url": "https://avatars.githubusercontent.com/u/67215274?v=4", "events_url": "https://api.github.com/users/abirabedinkhan/events{/privacy}", "followers_url": "https://api.github.com/users/abirabedinkhan/followers", "following_url": "https://api.github.com/users/abirabedinkhan/following{/other_user}", "gists_url": "https://api.github.com/users/abirabedinkhan/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/abirabedinkhan", "id": 67215274, "login": "abirabedinkhan", "node_id": "MDQ6VXNlcjY3MjE1Mjc0", "organizations_url": "https://api.github.com/users/abirabedinkhan/orgs", "received_events_url": "https://api.github.com/users/abirabedinkhan/received_events", "repos_url": "https://api.github.com/users/abirabedinkhan/repos", "site_admin": false, "starred_url": "https://api.github.com/users/abirabedinkhan/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/abirabedinkhan/subscriptions", "type": "User", "url": "https://api.github.com/users/abirabedinkhan", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2022-08-13T14:46:11Z
2023-08-14T00:03:16Z
2022-08-13T15:04:10Z
NONE
resolved
Please refer to our [Stack Overflow tag](https://stackoverflow.com/questions/tagged/python-requests) for guidance. when i sending a other langueges parameters requests into a url it retuens ``` বাংলাদেশ প্রতিদিন সংবাদ পত্র ``` this stuffs in python requests
{ "avatar_url": "https://avatars.githubusercontent.com/u/5271761?v=4", "events_url": "https://api.github.com/users/nateprewitt/events{/privacy}", "followers_url": "https://api.github.com/users/nateprewitt/followers", "following_url": "https://api.github.com/users/nateprewitt/following{/other_user}", "gists_url": "https://api.github.com/users/nateprewitt/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/nateprewitt", "id": 5271761, "login": "nateprewitt", "node_id": "MDQ6VXNlcjUyNzE3NjE=", "organizations_url": "https://api.github.com/users/nateprewitt/orgs", "received_events_url": "https://api.github.com/users/nateprewitt/received_events", "repos_url": "https://api.github.com/users/nateprewitt/repos", "site_admin": false, "starred_url": "https://api.github.com/users/nateprewitt/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/nateprewitt/subscriptions", "type": "User", "url": "https://api.github.com/users/nateprewitt", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/6212/reactions" }
https://api.github.com/repos/psf/requests/issues/6212/timeline
null
not_planned
null
null
false
[ "Please refer to the top of the issue template. We won't be able to assist with this on this issue tracker.", "Sorry I didn't understand what u said. Can u explain a bit? What to do" ]
https://api.github.com/repos/psf/requests/issues/6211
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6211/labels{/name}
https://api.github.com/repos/psf/requests/issues/6211/comments
https://api.github.com/repos/psf/requests/issues/6211/events
https://github.com/psf/requests/issues/6211
1,327,625,146
I_kwDOABTKOs5PIfO6
6,211
Merge types-requests into psf/requests with py.typed marker
{ "avatar_url": "https://avatars.githubusercontent.com/u/947110?v=4", "events_url": "https://api.github.com/users/kkirsche/events{/privacy}", "followers_url": "https://api.github.com/users/kkirsche/followers", "following_url": "https://api.github.com/users/kkirsche/following{/other_user}", "gists_url": "https://api.github.com/users/kkirsche/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kkirsche", "id": 947110, "login": "kkirsche", "node_id": "MDQ6VXNlcjk0NzExMA==", "organizations_url": "https://api.github.com/users/kkirsche/orgs", "received_events_url": "https://api.github.com/users/kkirsche/received_events", "repos_url": "https://api.github.com/users/kkirsche/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kkirsche/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kkirsche/subscriptions", "type": "User", "url": "https://api.github.com/users/kkirsche", "user_view_type": "public" }
[]
open
false
null
[]
null
2
2022-08-03T18:24:02Z
2022-08-03T18:53:30Z
null
CONTRIBUTOR
null
This issue is to merge the existing type hints available in typeshed ([here](https://github.com/python/typeshed/tree/master/stubs/requests)) into this repository. Currently, psf/requests supports only Python 3.7+ per https://github.com/psf/requests/blob/main/setup.py#L10 As a result, type-related code would not impact usability by end users. Performance concerns related to additional imports may also be addressed by protecting the type-only imports under the `typing.TYPE_CHECKING` boolean and using the correct syntax downstream. By making this change, it will keep type information paired with the code, ensuring they get updated together, it will reduce the maintenance burden on the typeshed team (not requested, just a side effect), and will enable more users to get type-hint related information without having to install separate packages. Depending on your point of view on type hints, they also can reduce the risk of bugs caused by refactoring.
null
{ "+1": 6, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 6, "url": "https://api.github.com/repos/psf/requests/issues/6211/reactions" }
https://api.github.com/repos/psf/requests/issues/6211/timeline
null
null
null
null
false
[ "Hi @kkirsche,\r\n\r\nWe've looked at doing this before. There are a number of issues with the existing typeshed hints we found during our last review. We have a feature branch looking at getting some level of typing integrated in the future but there is currently no timeline for this.", "Understandable. Some aspects will certainly depend on your philosophies about type hints (e.g. functionally won't crash vs. expected usage) and there are some weird oddities about semantic meanings in a type checker with types like `Any` vs. `object` that weren't clear to me before starting to contribute more type hints.\r\n\r\nLet me know if there's anything you need support on for that goal :) " ]
https://api.github.com/repos/psf/requests/issues/6210
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6210/labels{/name}
https://api.github.com/repos/psf/requests/issues/6210/comments
https://api.github.com/repos/psf/requests/issues/6210/events
https://github.com/psf/requests/issues/6210
1,324,048,617
I_kwDOABTKOs5O62Dp
6,210
Python Requests Libarary Removes some Characters in URL when Sending Request
{ "avatar_url": "https://avatars.githubusercontent.com/u/61124903?v=4", "events_url": "https://api.github.com/users/nxenon/events{/privacy}", "followers_url": "https://api.github.com/users/nxenon/followers", "following_url": "https://api.github.com/users/nxenon/following{/other_user}", "gists_url": "https://api.github.com/users/nxenon/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/nxenon", "id": 61124903, "login": "nxenon", "node_id": "MDQ6VXNlcjYxMTI0OTAz", "organizations_url": "https://api.github.com/users/nxenon/orgs", "received_events_url": "https://api.github.com/users/nxenon/received_events", "repos_url": "https://api.github.com/users/nxenon/repos", "site_admin": false, "starred_url": "https://api.github.com/users/nxenon/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/nxenon/subscriptions", "type": "User", "url": "https://api.github.com/users/nxenon", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2022-08-01T08:40:01Z
2023-08-02T00:03:09Z
2022-08-01T14:01:52Z
NONE
resolved
Python **requests** library changes URL in some situations. it removes some parameters for example ` url = "https://www.example.com/test?" ` it removes `?` in the request when I see it in Burp proxy it changes to `https://www.example.com/test` because I'm pentesting web applications I need to send for example quotation mark too and other things which will be removed by library automatically. I need following path: ![image](https://user-images.githubusercontent.com/61124903/182108804-e9811743-2ba4-41d3-8266-9e6d97998e4a.png) after ? must be empty
{ "avatar_url": "https://avatars.githubusercontent.com/u/240830?v=4", "events_url": "https://api.github.com/users/sigmavirus24/events{/privacy}", "followers_url": "https://api.github.com/users/sigmavirus24/followers", "following_url": "https://api.github.com/users/sigmavirus24/following{/other_user}", "gists_url": "https://api.github.com/users/sigmavirus24/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/sigmavirus24", "id": 240830, "login": "sigmavirus24", "node_id": "MDQ6VXNlcjI0MDgzMA==", "organizations_url": "https://api.github.com/users/sigmavirus24/orgs", "received_events_url": "https://api.github.com/users/sigmavirus24/received_events", "repos_url": "https://api.github.com/users/sigmavirus24/repos", "site_admin": false, "starred_url": "https://api.github.com/users/sigmavirus24/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/sigmavirus24/subscriptions", "type": "User", "url": "https://api.github.com/users/sigmavirus24", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/6210/reactions" }
https://api.github.com/repos/psf/requests/issues/6210/timeline
null
completed
null
null
false
[ "Hi there! Thanks for opening this issue. Unfortunately, it seems this is a request for help instead of a report of a defect in the project. Please use [StackOverflow](https://stackoverflow.com) for general usage questions instead and only report defects here.\n\nIn the future, please search **closed and** open issues before creating new ones that are duplicates." ]
https://api.github.com/repos/psf/requests/issues/6209
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6209/labels{/name}
https://api.github.com/repos/psf/requests/issues/6209/comments
https://api.github.com/repos/psf/requests/issues/6209/events
https://github.com/psf/requests/pull/6209
1,323,571,494
PR_kwDOABTKOs48Yuc0
6,209
Added support for TRACE method
{ "avatar_url": "https://avatars.githubusercontent.com/u/71654184?v=4", "events_url": "https://api.github.com/users/cheehong1030/events{/privacy}", "followers_url": "https://api.github.com/users/cheehong1030/followers", "following_url": "https://api.github.com/users/cheehong1030/following{/other_user}", "gists_url": "https://api.github.com/users/cheehong1030/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/cheehong1030", "id": 71654184, "login": "cheehong1030", "node_id": "MDQ6VXNlcjcxNjU0MTg0", "organizations_url": "https://api.github.com/users/cheehong1030/orgs", "received_events_url": "https://api.github.com/users/cheehong1030/received_events", "repos_url": "https://api.github.com/users/cheehong1030/repos", "site_admin": false, "starred_url": "https://api.github.com/users/cheehong1030/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/cheehong1030/subscriptions", "type": "User", "url": "https://api.github.com/users/cheehong1030", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2022-07-31T20:44:29Z
2023-08-01T00:03:38Z
2022-07-31T22:47:55Z
NONE
resolved
- Added support for TRACE method - Added TRACE method in docs - Fix docs missing OPTIONS method
{ "avatar_url": "https://avatars.githubusercontent.com/u/240830?v=4", "events_url": "https://api.github.com/users/sigmavirus24/events{/privacy}", "followers_url": "https://api.github.com/users/sigmavirus24/followers", "following_url": "https://api.github.com/users/sigmavirus24/following{/other_user}", "gists_url": "https://api.github.com/users/sigmavirus24/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/sigmavirus24", "id": 240830, "login": "sigmavirus24", "node_id": "MDQ6VXNlcjI0MDgzMA==", "organizations_url": "https://api.github.com/users/sigmavirus24/orgs", "received_events_url": "https://api.github.com/users/sigmavirus24/received_events", "repos_url": "https://api.github.com/users/sigmavirus24/repos", "site_admin": false, "starred_url": "https://api.github.com/users/sigmavirus24/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/sigmavirus24/subscriptions", "type": "User", "url": "https://api.github.com/users/sigmavirus24", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/6209/reactions" }
https://api.github.com/repos/psf/requests/issues/6209/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/6209.diff", "html_url": "https://github.com/psf/requests/pull/6209", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/6209.patch", "url": "https://api.github.com/repos/psf/requests/pulls/6209" }
true
[ "Please check open and closed issues and pull requests in the future before opening new ones.\n\nWe will not be accepting this because we are not adding new areas to the API. This is also possible via `requests.request` or `Session.request`" ]
https://api.github.com/repos/psf/requests/issues/6208
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6208/labels{/name}
https://api.github.com/repos/psf/requests/issues/6208/comments
https://api.github.com/repos/psf/requests/issues/6208/events
https://github.com/psf/requests/issues/6208
1,323,349,335
I_kwDOABTKOs5O4LVX
6,208
Cant download big file
{ "avatar_url": "https://avatars.githubusercontent.com/u/55866633?v=4", "events_url": "https://api.github.com/users/liuweidong888/events{/privacy}", "followers_url": "https://api.github.com/users/liuweidong888/followers", "following_url": "https://api.github.com/users/liuweidong888/following{/other_user}", "gists_url": "https://api.github.com/users/liuweidong888/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/liuweidong888", "id": 55866633, "login": "liuweidong888", "node_id": "MDQ6VXNlcjU1ODY2NjMz", "organizations_url": "https://api.github.com/users/liuweidong888/orgs", "received_events_url": "https://api.github.com/users/liuweidong888/received_events", "repos_url": "https://api.github.com/users/liuweidong888/repos", "site_admin": false, "starred_url": "https://api.github.com/users/liuweidong888/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/liuweidong888/subscriptions", "type": "User", "url": "https://api.github.com/users/liuweidong888", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2022-07-31T03:11:58Z
2023-08-01T00:03:37Z
2022-07-31T03:13:25Z
NONE
resolved
Please refer to our [Stack Overflow tag](https://stackoverflow.com/questions/tagged/python-requests) for guidance. I use requests.get(url) to download a big file from our own cloud box. But the response['Content-length'] isnt right, and use 'strem=True' args is wrong, the downloaded file which is a .zip file cant be opened .
{ "avatar_url": "https://avatars.githubusercontent.com/u/5271761?v=4", "events_url": "https://api.github.com/users/nateprewitt/events{/privacy}", "followers_url": "https://api.github.com/users/nateprewitt/followers", "following_url": "https://api.github.com/users/nateprewitt/following{/other_user}", "gists_url": "https://api.github.com/users/nateprewitt/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/nateprewitt", "id": 5271761, "login": "nateprewitt", "node_id": "MDQ6VXNlcjUyNzE3NjE=", "organizations_url": "https://api.github.com/users/nateprewitt/orgs", "received_events_url": "https://api.github.com/users/nateprewitt/received_events", "repos_url": "https://api.github.com/users/nateprewitt/repos", "site_admin": false, "starred_url": "https://api.github.com/users/nateprewitt/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/nateprewitt/subscriptions", "type": "User", "url": "https://api.github.com/users/nateprewitt", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/6208/reactions" }
https://api.github.com/repos/psf/requests/issues/6208/timeline
null
completed
null
null
false
[ "Hi @liuweidong88, please refer to the guidance at the beginning of the ticket template. We unfortunately won't be able to help with this." ]
https://api.github.com/repos/psf/requests/issues/6207
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6207/labels{/name}
https://api.github.com/repos/psf/requests/issues/6207/comments
https://api.github.com/repos/psf/requests/issues/6207/events
https://github.com/psf/requests/pull/6207
1,322,996,357
PR_kwDOABTKOs48W3c6
6,207
Remove `__nonzero__` method from `models.Response`
{ "avatar_url": "https://avatars.githubusercontent.com/u/4660275?v=4", "events_url": "https://api.github.com/users/sobolevn/events{/privacy}", "followers_url": "https://api.github.com/users/sobolevn/followers", "following_url": "https://api.github.com/users/sobolevn/following{/other_user}", "gists_url": "https://api.github.com/users/sobolevn/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/sobolevn", "id": 4660275, "login": "sobolevn", "node_id": "MDQ6VXNlcjQ2NjAyNzU=", "organizations_url": "https://api.github.com/users/sobolevn/orgs", "received_events_url": "https://api.github.com/users/sobolevn/received_events", "repos_url": "https://api.github.com/users/sobolevn/repos", "site_admin": false, "starred_url": "https://api.github.com/users/sobolevn/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/sobolevn/subscriptions", "type": "User", "url": "https://api.github.com/users/sobolevn", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2022-07-30T11:17:30Z
2023-07-31T00:03:22Z
2022-07-30T19:35:29Z
NONE
resolved
`__nonzero__` was used in python2 as we now use `__bool__`. It is not used at all in python3. And since [`setup.py` says](https://github.com/psf/requests/blob/177dd90f18a8f4dc79a7d2049f0a3f4fcc5932a0/setup.py#L10) that `reqeusts` supports only `python >= 3.7`, I don't think that it is really required. I found this while working on `typeshed` types for `requests`: https://github.com/python/typeshed/blob/3fe1f5d6c46b39b8b4632aadc70477a729241d25/stubs/requests/requests/models.pyi#L107
{ "avatar_url": "https://avatars.githubusercontent.com/u/5271761?v=4", "events_url": "https://api.github.com/users/nateprewitt/events{/privacy}", "followers_url": "https://api.github.com/users/nateprewitt/followers", "following_url": "https://api.github.com/users/nateprewitt/following{/other_user}", "gists_url": "https://api.github.com/users/nateprewitt/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/nateprewitt", "id": 5271761, "login": "nateprewitt", "node_id": "MDQ6VXNlcjUyNzE3NjE=", "organizations_url": "https://api.github.com/users/nateprewitt/orgs", "received_events_url": "https://api.github.com/users/nateprewitt/received_events", "repos_url": "https://api.github.com/users/nateprewitt/repos", "site_admin": false, "starred_url": "https://api.github.com/users/nateprewitt/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/nateprewitt/subscriptions", "type": "User", "url": "https://api.github.com/users/nateprewitt", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/6207/reactions" }
https://api.github.com/repos/psf/requests/issues/6207/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/6207.diff", "html_url": "https://github.com/psf/requests/pull/6207", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/6207.patch", "url": "https://api.github.com/repos/psf/requests/pulls/6207" }
true
[ "Hi @sobolevn,\r\n\r\nThanks for the PR, but I think we’re unlikely to remove this. The use of `super().__nonzero__()` to implement `__bool__` in subclasses was quite popular when the Python 3 migration started. There’s a high chance this will be breaking if we remove the function entirely." ]
https://api.github.com/repos/psf/requests/issues/6206
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6206/labels{/name}
https://api.github.com/repos/psf/requests/issues/6206/comments
https://api.github.com/repos/psf/requests/issues/6206/events
https://github.com/psf/requests/pull/6206
1,322,037,649
PR_kwDOABTKOs48TrxE
6,206
added from_raw class method to PreparedRequest
{ "avatar_url": "https://avatars.githubusercontent.com/u/26948113?v=4", "events_url": "https://api.github.com/users/ToraNova/events{/privacy}", "followers_url": "https://api.github.com/users/ToraNova/followers", "following_url": "https://api.github.com/users/ToraNova/following{/other_user}", "gists_url": "https://api.github.com/users/ToraNova/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/ToraNova", "id": 26948113, "login": "ToraNova", "node_id": "MDQ6VXNlcjI2OTQ4MTEz", "organizations_url": "https://api.github.com/users/ToraNova/orgs", "received_events_url": "https://api.github.com/users/ToraNova/received_events", "repos_url": "https://api.github.com/users/ToraNova/repos", "site_admin": false, "starred_url": "https://api.github.com/users/ToraNova/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/ToraNova/subscriptions", "type": "User", "url": "https://api.github.com/users/ToraNova", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2022-07-29T10:14:12Z
2023-07-30T00:03:33Z
2022-07-29T15:43:16Z
NONE
resolved
Adds a class method to create PreparedRequests from raw HTTP request using Python's builtin BaseHTTPRequestHandler class. Example usage: ``` >>> from requests import PreparedRequest, Session >>> prq = PreparedRequest.from_raw('GET / HTTP/1.1\r\nHost: example.com\r\n\r\n', use_https=False) >>> res = Session().send(prq) <Response [200]> ``` This would be very useful for someone that wants to use the python requests library but with raw HTTP requests.
{ "avatar_url": "https://avatars.githubusercontent.com/u/240830?v=4", "events_url": "https://api.github.com/users/sigmavirus24/events{/privacy}", "followers_url": "https://api.github.com/users/sigmavirus24/followers", "following_url": "https://api.github.com/users/sigmavirus24/following{/other_user}", "gists_url": "https://api.github.com/users/sigmavirus24/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/sigmavirus24", "id": 240830, "login": "sigmavirus24", "node_id": "MDQ6VXNlcjI0MDgzMA==", "organizations_url": "https://api.github.com/users/sigmavirus24/orgs", "received_events_url": "https://api.github.com/users/sigmavirus24/received_events", "repos_url": "https://api.github.com/users/sigmavirus24/repos", "site_admin": false, "starred_url": "https://api.github.com/users/sigmavirus24/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/sigmavirus24/subscriptions", "type": "User", "url": "https://api.github.com/users/sigmavirus24", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/6206/reactions" }
https://api.github.com/repos/psf/requests/issues/6206/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/6206.diff", "html_url": "https://github.com/psf/requests/pull/6206", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/6206.patch", "url": "https://api.github.com/repos/psf/requests/pulls/6206" }
true
[ "Requests is not accepting feature requests or new feature additions at this time. Thank you for putting this together but we won't be accepting it" ]
https://api.github.com/repos/psf/requests/issues/6205
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6205/labels{/name}
https://api.github.com/repos/psf/requests/issues/6205/comments
https://api.github.com/repos/psf/requests/issues/6205/events
https://github.com/psf/requests/issues/6205
1,320,190,408
I_kwDOABTKOs5OsIHI
6,205
Transport adapters not honored with proxy
{ "avatar_url": "https://avatars.githubusercontent.com/u/14196171?v=4", "events_url": "https://api.github.com/users/patatetom/events{/privacy}", "followers_url": "https://api.github.com/users/patatetom/followers", "following_url": "https://api.github.com/users/patatetom/following{/other_user}", "gists_url": "https://api.github.com/users/patatetom/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/patatetom", "id": 14196171, "login": "patatetom", "node_id": "MDQ6VXNlcjE0MTk2MTcx", "organizations_url": "https://api.github.com/users/patatetom/orgs", "received_events_url": "https://api.github.com/users/patatetom/received_events", "repos_url": "https://api.github.com/users/patatetom/repos", "site_admin": false, "starred_url": "https://api.github.com/users/patatetom/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/patatetom/subscriptions", "type": "User", "url": "https://api.github.com/users/patatetom", "user_view_type": "public" }
[]
open
false
null
[]
null
0
2022-07-27T22:34:31Z
2022-08-02T07:20:27Z
null
NONE
null
hi, making a poor socks server at localhost on port 8001 with ssh/sshd running at localhost : ```console @term1$ ssh -N -D localhost:8001 localhost ``` making a self-signed certificate for testing and debuging negociations on server side with s_server@openssl : ```console @term2$ openssl req -x509 -newkey rsa:2048 -keyout key.pem -out cert.pem -days 365 -nodes while : do echo -e "HTTP/1.0 200 OK\nContent-Length: 0\n\n" | openssl s_server -4 -cert cert.pem -key key.pem -accept 4433 -msg done ``` getting `requests` informations : ```console @term3$ python -m requests.help { "chardet": { "version": "3.0.4" }, "charset_normalizer": { "version": "2.1.0" }, "cryptography": { "version": "2.8" }, "idna": { "version": "2.8" }, "implementation": { "name": "CPython", "version": "3.8.10" }, "platform": { "release": "5.10.0-1057-oem", "system": "Linux" }, "pyOpenSSL": { "openssl_version": "1010106f", "version": "19.0.0" }, "requests": { "version": "2.28.1" }, "system_ssl": { "version": "1010106f" }, "urllib3": { "version": "1.25.8" }, "using_charset_normalizer": false, "using_pyopenssl": true } ``` running `requests` simply : ```console @term3$ python <<~~~ import requests url = "https://localhost:4433/" session = requests.Session() response = session.head(url=url, verify=False) ~~~ ``` TLS1.3 by default : ```console @term2$ ... <<< TLS 1.3, Handshake [length 0034], Finished ... >>> TLS 1.3, Handshake [length 00e9], NewSessionTicket ... ``` running `requests` with transport adapter only : ```console @term3$ python <<~~~ import ssl import requests from requests.adapters import HTTPAdapter from urllib3.poolmanager import PoolManager class TestHTTPAdapter(HTTPAdapter): def init_poolmanager(self, connections, maxsize, block=False): self.poolmanager = PoolManager( num_pools=connections, maxsize=maxsize, block=block, ssl_version=ssl.PROTOCOL_TLSv1_2 ) url = "https://localhost:4433/" session = requests.Session() session.mount(url, TestHTTPAdapter()) response = session.head(url=url, verify=False) ~~~ ``` TLS1.2 is OK :slightly_smiling_face: : ```console @term2$ ... >>> TLS 1.2, Handshake [length 0010], Finished ... ``` running `requests` with transport adapter **and socks proxy** : ```console @term3$ python <<~~~ import ssl import requests from requests.adapters import HTTPAdapter from urllib3.poolmanager import PoolManager class TestHTTPAdapter(HTTPAdapter): def init_poolmanager(self, connections, maxsize, block=False): self.poolmanager = PoolManager( num_pools=connections, maxsize=maxsize, block=block, ssl_version=ssl.PROTOCOL_TLSv1_2 ) url = "https://localhost:4433/" session = requests.Session() session.mount(url, TestHTTPAdapter()) proxies={"https":"socks5://localhost:8001"} response = session.head(url=url, proxies=proxies, verify=False) ~~~ ``` TLS1.2 is **KO** :slightly_frowning_face: : ```console @term2$ ... <<< TLS 1.3, Handshake [length 0034], Finished ... >>> TLS 1.3, Handshake [length 00e9], NewSessionTicket ... ``` `requests` has the same behavior whether `pyopenssl` is present/used or not. HTTP/HTTPS proxies not tested : sorry. regards, lacsaP. --- note that `httpie` works as expected : ```console @term4$ https --verify no https://localhost:4433 HTTP/1.0 200 OK Content-Length: 0 ``` ```console @term2$ ... <<< TLS 1.3, Handshake [length 0034], Finished ... >>> TLS 1.3, Handshake [length 00e9], NewSessionTicket ... ``` ```console @term4$ https --ssl tls1.2 --verify no https://localhost:4433 HTTP/1.0 200 OK Content-Length: 0 ``` ```console @term2$ ... >>> TLS 1.2, Handshake [length 0010], Finished ... ``` ```console @term4$ https --ssl tls1.2 --verify no --proxy https:socks5://localhost:8001 https://localhost:4433 HTTP/1.0 200 OK Content-Length: 0 ``` ```console @term2$ ... >>> TLS 1.2, Handshake [length 0010], Finished ... ``` as well as `urllib3` : ```console @term5$ python <<~~~ import urllib3 https = urllib3.PoolManager(cert_reqs='CERT_NONE') r = https.request('GET', 'https://localhost:4433') ~~~ ``` ```console @term2$ ... <<< TLS 1.3, Handshake [length 0034], Finished ... >>> TLS 1.3, Handshake [length 00e9], NewSessionTicket ... ``` ```console @term5$ python <<~~~ import ssl, urllib3 https = urllib3.PoolManager(cert_reqs='CERT_NONE', ssl_version=ssl.PROTOCOL_TLSv1_2) r = https.request('GET', 'https://localhost:4433') ~~~ ``` ```console @term2$ ... >>> TLS 1.2, Handshake [length 0010], Finished ... ``` ```console @term5$ python <<~~~ import ssl from urllib3.contrib.socks import SOCKSProxyManager socks = SOCKSProxyManager('socks5h://localhost:8001/', cert_reqs='CERT_NONE', ssl_version=ssl.PROTOCOL_TLSv1_2) r = socks.request('GET', 'https://localhost:4433') ~~~ ``` ```console @term2$ ... >>> TLS 1.2, Handshake [length 0010], Finished ... ```
null
{ "+1": 1, "-1": 0, "confused": 0, "eyes": 1, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 2, "url": "https://api.github.com/repos/psf/requests/issues/6205/reactions" }
https://api.github.com/repos/psf/requests/issues/6205/timeline
null
null
null
null
false
[]
https://api.github.com/repos/psf/requests/issues/6204
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6204/labels{/name}
https://api.github.com/repos/psf/requests/issues/6204/comments
https://api.github.com/repos/psf/requests/issues/6204/events
https://github.com/psf/requests/pull/6204
1,319,697,280
PR_kwDOABTKOs48MBDq
6,204
Remove Python 2 mention on `chardet` behavior
{ "avatar_url": "https://avatars.githubusercontent.com/u/901169?v=4", "events_url": "https://api.github.com/users/DavidCain/events{/privacy}", "followers_url": "https://api.github.com/users/DavidCain/followers", "following_url": "https://api.github.com/users/DavidCain/following{/other_user}", "gists_url": "https://api.github.com/users/DavidCain/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/DavidCain", "id": 901169, "login": "DavidCain", "node_id": "MDQ6VXNlcjkwMTE2OQ==", "organizations_url": "https://api.github.com/users/DavidCain/orgs", "received_events_url": "https://api.github.com/users/DavidCain/received_events", "repos_url": "https://api.github.com/users/DavidCain/repos", "site_admin": false, "starred_url": "https://api.github.com/users/DavidCain/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/DavidCain/subscriptions", "type": "User", "url": "https://api.github.com/users/DavidCain", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2022-07-27T15:01:44Z
2023-07-29T00:03:08Z
2022-07-27T17:22:21Z
CONTRIBUTOR
resolved
`requests` no longer supports Python 2. A recent commit, 8bce583b9547c7b82d44c8e97f37cf9a16cbe758 removed the `chardet` dependency for Python 2: ```diff -'chardet>=3.0.2,<5; python_version < "3"', ``` We should edit the docs to remove mention of behavior on Py2.
{ "avatar_url": "https://avatars.githubusercontent.com/u/5271761?v=4", "events_url": "https://api.github.com/users/nateprewitt/events{/privacy}", "followers_url": "https://api.github.com/users/nateprewitt/followers", "following_url": "https://api.github.com/users/nateprewitt/following{/other_user}", "gists_url": "https://api.github.com/users/nateprewitt/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/nateprewitt", "id": 5271761, "login": "nateprewitt", "node_id": "MDQ6VXNlcjUyNzE3NjE=", "organizations_url": "https://api.github.com/users/nateprewitt/orgs", "received_events_url": "https://api.github.com/users/nateprewitt/received_events", "repos_url": "https://api.github.com/users/nateprewitt/repos", "site_admin": false, "starred_url": "https://api.github.com/users/nateprewitt/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/nateprewitt/subscriptions", "type": "User", "url": "https://api.github.com/users/nateprewitt", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/6204/reactions" }
https://api.github.com/repos/psf/requests/issues/6204/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/6204.diff", "html_url": "https://github.com/psf/requests/pull/6204", "merged_at": "2022-07-27T17:22:21Z", "patch_url": "https://github.com/psf/requests/pull/6204.patch", "url": "https://api.github.com/repos/psf/requests/pulls/6204" }
true
[ "Thank you both for the extremely speedy review! It does look like I'll need a maintainer to kick off CI though." ]
https://api.github.com/repos/psf/requests/issues/6203
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6203/labels{/name}
https://api.github.com/repos/psf/requests/issues/6203/comments
https://api.github.com/repos/psf/requests/issues/6203/events
https://github.com/psf/requests/issues/6203
1,314,046,956
I_kwDOABTKOs5OUsPs
6,203
Unable capture the exception and Existing without control from application
{ "avatar_url": "https://avatars.githubusercontent.com/u/8638634?v=4", "events_url": "https://api.github.com/users/gudipudipradeep/events{/privacy}", "followers_url": "https://api.github.com/users/gudipudipradeep/followers", "following_url": "https://api.github.com/users/gudipudipradeep/following{/other_user}", "gists_url": "https://api.github.com/users/gudipudipradeep/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/gudipudipradeep", "id": 8638634, "login": "gudipudipradeep", "node_id": "MDQ6VXNlcjg2Mzg2MzQ=", "organizations_url": "https://api.github.com/users/gudipudipradeep/orgs", "received_events_url": "https://api.github.com/users/gudipudipradeep/received_events", "repos_url": "https://api.github.com/users/gudipudipradeep/repos", "site_admin": false, "starred_url": "https://api.github.com/users/gudipudipradeep/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/gudipudipradeep/subscriptions", "type": "User", "url": "https://api.github.com/users/gudipudipradeep", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2022-07-22T02:11:31Z
2023-07-23T00:03:28Z
2022-07-22T02:15:39Z
NONE
resolved
**Getting the following error frequently sometimes and even not able to capture inside the exception block to handle the error. Please provide help on the below issue.** Jul 21 11:[2022-07-21 11:10:41,919] ERROR in resilientsession: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer')) Jul 21 11:Traceback (most recent call last): Jul 21 11:File "/var/app/venv/staging-LQM1lest/lib/python3.8/site-packages/urllib3/connectionpool.py", line 703, in urlopen Jul 21 11:httplib_response = self._make_request( Jul 21 11:File "/var/app/venv/staging-LQM1lest/lib/python3.8/site-packages/urllib3/connectionpool.py", line 449, in _make_request Jul 21 11:six.raise_from(e, None) Jul 21 11:File "<string>", line 3, in raise_from Jul 21 11:File "/var/app/venv/staging-LQM1lest/lib/python3.8/site-packages/urllib3/connectionpool.py", line 444, in _make_request Jul 21 11:httplib_response = conn.getresponse() Jul 21 11:File "/usr/lib64/python3.8/http/client.py", line 1347, in getresponse Jul 21 11:response.begin() Jul 21 11:File "/usr/lib64/python3.8/http/client.py", line 307, in begin Jul 21 11:version, status, reason = self._read_status() Jul 21 11:File "/usr/lib64/python3.8/http/client.py", line 268, in _read_status Jul 21 11:line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1") Jul 21 11:File "/usr/lib64/python3.8/socket.py", line 669, in readinto Jul 21 11:return self._sock.recv_into(b) Jul 21 11:File "/usr/lib64/python3.8/ssl.py", line 1241, in recv_into Jul 21 11:return self.read(nbytes, buffer) Jul 21 11:File "/usr/lib64/python3.8/ssl.py", line 1099, in read Jul 21 11:return self._sslobj.read(len, buffer) Jul 21 11:ConnectionResetError: [Errno 104] Connection reset by peer Jul 21 11:During handling of the above exception, another exception occurred: Jul 21 11:Traceback (most recent call last): Jul 21 11:File "/var/app/venv/staging-LQM1lest/lib/python3.8/site-packages/requests/adapters.py", line 489, in send Jul 21 11:resp = conn.urlopen( Jul 21 11:File "/var/app/venv/staging-LQM1lest/lib/python3.8/site-packages/urllib3/connectionpool.py", line 785, in urlopen Jul 21 11:retries = retries.increment( Jul 21 11:File "/var/app/venv/staging-LQM1lest/lib/python3.8/site-packages/urllib3/util/retry.py", line 550, in increment Jul 21 11:raise six.reraise(type(error), error, _stacktrace) Jul 21 11:File "/var/app/venv/staging-LQM1lest/lib/python3.8/site-packages/urllib3/packages/six.py", line 769, in reraise Jul 21 11:raise value.with_traceback(tb) Jul 21 11:File "/var/app/venv/staging-LQM1lest/lib/python3.8/site-packages/urllib3/connectionpool.py", line 703, in urlopen Jul 21 11:httplib_response = self._make_request( Jul 21 11:File "/var/app/venv/staging-LQM1lest/lib/python3.8/site-packages/urllib3/connectionpool.py", line 449, in _make_request Jul 21 11:six.raise_from(e, None) Jul 21 11:File "<string>", line 3, in raise_from Jul 21 11:File "/var/app/venv/staging-LQM1lest/lib/python3.8/site-packages/urllib3/connectionpool.py", line 444, in _make_request Jul 21 11:httplib_response = conn.getresponse() Jul 21 11:File "/usr/lib64/python3.8/http/client.py", line 1347, in getresponse Jul 21 11:response.begin() Jul 21 11:File "/usr/lib64/python3.8/http/client.py", line 307, in begin Jul 21 11:version, status, reason = self._read_status() Jul 21 11:File "/usr/lib64/python3.8/http/client.py", line 268, in _read_status Jul 21 11:line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1") Jul 21 11:File "/usr/lib64/python3.8/socket.py", line 669, in readinto Jul 21 11:return self._sock.recv_into(b) Jul 21 11:File "/usr/lib64/python3.8/ssl.py", line 1241, in recv_into Jul 21 11:return self.read(nbytes, buffer) Jul 21 11:File "/usr/lib64/python3.8/ssl.py", line 1099, in read Jul 21 11:return self._sslobj.read(len, buffer) Jul 21 11:urllib3.exceptions.ProtocolError: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer')) Jul 21 11:During handling of the above exception, another exception occurred: Jul 21 11:Traceback (most recent call last): Jul 21 11:File "/var/app/current/src/resilientsession.py", line 34, in request Jul 21 11:r = super(ResilientSession, self).request(method, url, **kwargs) Jul 21 11:File "/var/app/venv/staging-LQM1lest/lib/python3.8/site-packages/requests/sessions.py", line 587, in request Jul 21 11:resp = self.send(prep, **send_kwargs) Jul 21 11:File "/var/app/venv/staging-LQM1lest/lib/python3.8/site-packages/requests/sessions.py", line 701, in send Jul 21 11:r = adapter.send(request, **kwargs) Jul 21 11:File "/var/app/venv/staging-LQM1lest/lib/python3.8/site-packages/requests/adapters.py", line 547, in send Jul 21 11:raise ConnectionError(err, request=request) Jul 21 11:requests.exceptions.ConnectionError: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer')) Jul 21 11:[2022-07-21 11:10:41,919] ERROR in resilientsession: Got recoverable error [ConnectionError] from POST https://qaecs-wwwwww.zzzzz.com/calculations/execute?request_id=input_XXXXX_XXXSanity_35, retry #1 in 0s Jul 21 11:Traceback (most recent call last): Jul 21 11:File "/var/app/venv/staging-LQM1lest/lib/python3.8/site-packages/urllib3/connectionpool.py", line 703, in urlopen Jul 21 11:httplib_response = self._make_request( Jul 21 11:File "/var/app/venv/staging-LQM1lest/lib/python3.8/site-packages/urllib3/connectionpool.py", line 449, in _make_request Jul 21 11:six.raise_from(e, None) Jul 21 11:File "<string>", line 3, in raise_from Jul 21 11:File "/var/app/venv/staging-LQM1lest/lib/python3.8/site-packages/urllib3/connectionpool.py", line 444, in _make_request Jul 21 11:httplib_response = conn.getresponse() Jul 21 11:File "/usr/lib64/python3.8/http/client.py", line 1347, in getresponse Jul 21 11:response.begin() Jul 21 11:File "/usr/lib64/python3.8/http/client.py", line 307, in begin Jul 21 11:version, status, reason = self._read_status() Jul 21 11:File "/usr/lib64/python3.8/http/client.py", line 268, in _read_status Jul 21 11:line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1") Jul 21 11:File "/usr/lib64/python3.8/socket.py", line 669, in readinto Jul 21 11:return self._sock.recv_into(b) Jul 21 11:File "/usr/lib64/python3.8/ssl.py", line 1241, in recv_into Jul 21 11:return self.read(nbytes, buffer) Jul 21 11:File "/usr/lib64/python3.8/ssl.py", line 1099, in read Jul 21 11:return self._sslobj.read(len, buffer) Jul 21 11:ConnectionResetError: [Errno 104] Connection reset by peer Jul 21 11:During handling of the above exception, another exception occurred: Jul 21 11:Traceback (most recent call last): Jul 21 11:File "/var/app/venv/staging-LQM1lest/lib/python3.8/site-packages/requests/adapters.py", line 489, in send Jul 21 11:resp = conn.urlopen( Jul 21 11:File "/var/app/venv/staging-LQM1lest/lib/python3.8/site-packages/urllib3/connectionpool.py", line 785, in urlopen Jul 21 11:retries = retries.increment( Jul 21 11:File "/var/app/venv/staging-LQM1lest/lib/python3.8/site-packages/urllib3/util/retry.py", line 550, in increment Jul 21 11:raise six.reraise(type(error), error, _stacktrace) Jul 21 11:File "/var/app/venv/staging-LQM1lest/lib/python3.8/site-packages/urllib3/packages/six.py", line 769, in reraise Jul 21 11:raise value.with_traceback(tb) Jul 21 11:File "/var/app/venv/staging-LQM1lest/lib/python3.8/site-packages/urllib3/connectionpool.py", line 703, in urlopen Jul 21 11:httplib_response = self._make_request( Jul 21 11:File "/var/app/venv/staging-LQM1lest/lib/python3.8/site-packages/urllib3/connectionpool.py", line 449, in _make_request Jul 21 11:six.raise_from(e, None) Jul 21 11:File "<string>", line 3, in raise_from Jul 21 11:File "/var/app/venv/staging-LQM1lest/lib/python3.8/site-packages/urllib3/connectionpool.py", line 444, in _make_request Jul 21 11:httplib_response = conn.getresponse() Jul 21 11:File "/usr/lib64/python3.8/http/client.py", line 1347, in getresponse Jul 21 11:response.begin() Jul 21 11:File "/usr/lib64/python3.8/http/client.py", line 307, in begin Jul 21 11:version, status, reason = self._read_status() Jul 21 11:File "/usr/lib64/python3.8/http/client.py", line 268, in _read_status Jul 21 11:line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1") Jul 21 11:File "/usr/lib64/python3.8/socket.py", line 669, in readinto Jul 21 11:return self._sock.recv_into(b) Jul 21 11:File "/usr/lib64/python3.8/ssl.py", line 1241, in recv_into Jul 21 11:return self.read(nbytes, buffer) Jul 21 11:File "/usr/lib64/python3.8/ssl.py", line 1099, in read Jul 21 11:return self._sslobj.read(len, buffer) Jul 21 11:urllib3.exceptions.ProtocolError: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer')) Jul 21 11:During handling of the above exception, another exception occurred: Jul 21 11:Traceback (most recent call last): Jul 21 11:File "/var/app/current/src/resilientsession.py", line 34, in request Jul 21 11:r = super(ResilientSession, self).request(method, url, **kwargs) Jul 21 11:File "/var/app/venv/staging-LQM1lest/lib/python3.8/site-packages/requests/sessions.py", line 587, in request Jul 21 11:resp = self.send(prep, **send_kwargs) Jul 21 11:File "/var/app/venv/staging-LQM1lest/lib/python3.8/site-packages/requests/sessions.py", line 701, in send Jul 21 11:r = adapter.send(request, **kwargs) Jul 21 11:File "/var/app/venv/staging-LQM1lest/lib/python3.8/site-packages/requests/adapters.py", line 547, in send Jul 21 11:raise ConnectionError(err, request=request) Jul 21 11:requests.exceptions.ConnectionError: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer')) **code** from requests import Session import time import logging import requests from requests.exceptions import ConnectionError from urllib3.exceptions import MaxRetryError, ProtocolError class ResilientSession(Session): RETRY_COUNT = 4 def request(self, method, url, **kwargs): counter = 0 delay = 0 while counter < ResilientSession.RETRY_COUNT: counter += 1 try: r = super(ResilientSession, self).request(method, url, **kwargs) if r.status_code in [ 502, 503, 504 ]: delay = 10 * counter logging.warn("Got recoverable error [%s] from %s %s, retry #%s in %ss" % (r.status_code, method, url, counter, delay)) time.sleep(delay) continue except (ConnectionResetError, ConnectionError, MaxRetryError, ProtocolError ) as e: logging.exception(e) logging.exception("Got recoverable error [%s] from %s %s, retry #%s in %ss" % (type(e).__name__, method, url, counter, delay)) time.sleep(delay) if ResilientSession.RETRY_COUNT == counter: raise e continue # except (Exception, ) as e: # logging.exception(e) # logging.exception("Got unrecoverable error [%s] from %s %s, retry #%s in %ss" % (type(e).__name__, method, url, counter, delay)) # raise e return r C:\>python -m requests.help { "chardet": { "version": "3.0.4" }, "charset_normalizer": { "version": "2.0.10" }, "cryptography": { "version": "" }, "idna": { "version": "3.3" }, "implementation": { "name": "CPython", "version": "3.8.8" }, "platform": { "release": "10", "system": "Windows" }, "pyOpenSSL": { "openssl_version": "", "version": null }, "requests": { "version": "2.28.1" }, "system_ssl": { "version": "1010109f" }, "urllib3": { "version": "1.26.8" }, "using_charset_normalizer": false, "using_pyopenssl": false }
{ "avatar_url": "https://avatars.githubusercontent.com/u/5271761?v=4", "events_url": "https://api.github.com/users/nateprewitt/events{/privacy}", "followers_url": "https://api.github.com/users/nateprewitt/followers", "following_url": "https://api.github.com/users/nateprewitt/following{/other_user}", "gists_url": "https://api.github.com/users/nateprewitt/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/nateprewitt", "id": 5271761, "login": "nateprewitt", "node_id": "MDQ6VXNlcjUyNzE3NjE=", "organizations_url": "https://api.github.com/users/nateprewitt/orgs", "received_events_url": "https://api.github.com/users/nateprewitt/received_events", "repos_url": "https://api.github.com/users/nateprewitt/repos", "site_admin": false, "starred_url": "https://api.github.com/users/nateprewitt/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/nateprewitt/subscriptions", "type": "User", "url": "https://api.github.com/users/nateprewitt", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/6203/reactions" }
https://api.github.com/repos/psf/requests/issues/6203/timeline
null
not_planned
null
null
false
[ "Hi @gudipudipradeep, it looks like this is a request for help. The error being received is due to the server resetting the connection unexpectedly. Requests has no ability to affect this and we won't be able to provide assistance.\n\nWe'd recommend trying a platform like StackOverflow for questions like this." ]
https://api.github.com/repos/psf/requests/issues/6202
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6202/labels{/name}
https://api.github.com/repos/psf/requests/issues/6202/comments
https://api.github.com/repos/psf/requests/issues/6202/events
https://github.com/psf/requests/pull/6202
1,312,814,194
PR_kwDOABTKOs471MW1
6,202
Add response object to JSONDecodeError
{ "avatar_url": "https://avatars.githubusercontent.com/u/507733?v=4", "events_url": "https://api.github.com/users/bungoume/events{/privacy}", "followers_url": "https://api.github.com/users/bungoume/followers", "following_url": "https://api.github.com/users/bungoume/following{/other_user}", "gists_url": "https://api.github.com/users/bungoume/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/bungoume", "id": 507733, "login": "bungoume", "node_id": "MDQ6VXNlcjUwNzczMw==", "organizations_url": "https://api.github.com/users/bungoume/orgs", "received_events_url": "https://api.github.com/users/bungoume/received_events", "repos_url": "https://api.github.com/users/bungoume/repos", "site_admin": false, "starred_url": "https://api.github.com/users/bungoume/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/bungoume/subscriptions", "type": "User", "url": "https://api.github.com/users/bungoume", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2022-07-21T07:36:49Z
2023-08-17T00:03:09Z
2022-07-21T12:51:11Z
NONE
resolved
Add response object to JSONDecodeError. We used to use the following code, but since 2.27, errors on json parse failure are now caught as RequestException. Since there is basically `response` in the `.json()` phase, we would like to add it in JSONDecodeError for convenience. ```python def my_post(url, payload): try: res = requests.post(url, json=payload) res.raise_for_status() return res.json() except requests.exceptions.RequestException as e: logger.warning("Failed to send data %s", e.response.status_code) except Exception as e: ... ``` ``` AttributeError 'NoneType' object has no attribute 'status_code' ```
{ "avatar_url": "https://avatars.githubusercontent.com/u/240830?v=4", "events_url": "https://api.github.com/users/sigmavirus24/events{/privacy}", "followers_url": "https://api.github.com/users/sigmavirus24/followers", "following_url": "https://api.github.com/users/sigmavirus24/following{/other_user}", "gists_url": "https://api.github.com/users/sigmavirus24/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/sigmavirus24", "id": 240830, "login": "sigmavirus24", "node_id": "MDQ6VXNlcjI0MDgzMA==", "organizations_url": "https://api.github.com/users/sigmavirus24/orgs", "received_events_url": "https://api.github.com/users/sigmavirus24/received_events", "repos_url": "https://api.github.com/users/sigmavirus24/repos", "site_admin": false, "starred_url": "https://api.github.com/users/sigmavirus24/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/sigmavirus24/subscriptions", "type": "User", "url": "https://api.github.com/users/sigmavirus24", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/6202/reactions" }
https://api.github.com/repos/psf/requests/issues/6202/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/6202.diff", "html_url": "https://github.com/psf/requests/pull/6202", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/6202.patch", "url": "https://api.github.com/repos/psf/requests/pulls/6202" }
true
[ "No, thank you" ]
https://api.github.com/repos/psf/requests/issues/6201
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6201/labels{/name}
https://api.github.com/repos/psf/requests/issues/6201/comments
https://api.github.com/repos/psf/requests/issues/6201/events
https://github.com/psf/requests/pull/6201
1,309,260,510
PR_kwDOABTKOs47ozQU
6,201
Suppress context when requests.exceptions.JSONDecodeError is raised.
{ "avatar_url": "https://avatars.githubusercontent.com/u/118834?v=4", "events_url": "https://api.github.com/users/mila/events{/privacy}", "followers_url": "https://api.github.com/users/mila/followers", "following_url": "https://api.github.com/users/mila/following{/other_user}", "gists_url": "https://api.github.com/users/mila/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/mila", "id": 118834, "login": "mila", "node_id": "MDQ6VXNlcjExODgzNA==", "organizations_url": "https://api.github.com/users/mila/orgs", "received_events_url": "https://api.github.com/users/mila/received_events", "repos_url": "https://api.github.com/users/mila/repos", "site_admin": false, "starred_url": "https://api.github.com/users/mila/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/mila/subscriptions", "type": "User", "url": "https://api.github.com/users/mila", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2022-07-19T09:44:06Z
2023-10-20T00:03:12Z
2022-07-20T07:56:13Z
CONTRIBUTOR
resolved
When a JSON response cannot be parsed, requests catch json.JSONDecodeError (or simplejson.JSONDecodeError) and raise requests.exceptions.JSONDecodeError instead. Because this happens in an except block, unhandled exceptions were printed in a chain: ``` Traceback (most recent call last): ... simplejson.errors.JSONDecodeError: Expecting value: line 1 column 1 (char 0) During handling of the above exception, another exception occurred: Traceback (most recent call last): ... requests.exceptions.JSONDecodeError: [Errno Expecting value] ... ``` This seems unnecessary and it increases cognitive overhead whean examining errors. As requests.exceptions.JSONDecodeError inherits json.JSONDecodeError and we copy all atrributes from the later to the former, `raise ... from None` seems more approriate than `raise ... from e`.
{ "avatar_url": "https://avatars.githubusercontent.com/u/118834?v=4", "events_url": "https://api.github.com/users/mila/events{/privacy}", "followers_url": "https://api.github.com/users/mila/followers", "following_url": "https://api.github.com/users/mila/following{/other_user}", "gists_url": "https://api.github.com/users/mila/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/mila", "id": 118834, "login": "mila", "node_id": "MDQ6VXNlcjExODgzNA==", "organizations_url": "https://api.github.com/users/mila/orgs", "received_events_url": "https://api.github.com/users/mila/received_events", "repos_url": "https://api.github.com/users/mila/repos", "site_admin": false, "starred_url": "https://api.github.com/users/mila/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/mila/subscriptions", "type": "User", "url": "https://api.github.com/users/mila", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/6201/reactions" }
https://api.github.com/repos/psf/requests/issues/6201/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/6201.diff", "html_url": "https://github.com/psf/requests/pull/6201", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/6201.patch", "url": "https://api.github.com/repos/psf/requests/pulls/6201" }
true
[ "We don't suppress context anywhere else as far as I remember. I don't understand why it's more valuable here and less helpful elsewhere. (And, no, don't update every exception to suppress context)", "Thank you @sigmavirus24, I see now that the error handing for JSON decoding is consistent with the rest of the library.\r\n\r\n> (And, no, don't update every exception to suppress context)\r\n\r\nWhat about updating exceptions to use `raise ... from e`? We would get tracebacks with: \"The above exception was the direct cause of the following exception:\" instead of \"During handling of the above exception, another exception occurred:\".\r\n\r\nI believe that it would follow intentions in [PEP 3134](https://peps.python.org/pep-3134/). If `__cause__` (instead of `__context__`) was set, it would be more apparent that the exception chain is an expected behavior, not some bug." ]
https://api.github.com/repos/psf/requests/issues/6200
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6200/labels{/name}
https://api.github.com/repos/psf/requests/issues/6200/comments
https://api.github.com/repos/psf/requests/issues/6200/events
https://github.com/psf/requests/pull/6200
1,309,213,593
PR_kwDOABTKOs47opLU
6,200
Rephrase an outdated comment mentioning Python 2.
{ "avatar_url": "https://avatars.githubusercontent.com/u/118834?v=4", "events_url": "https://api.github.com/users/mila/events{/privacy}", "followers_url": "https://api.github.com/users/mila/followers", "following_url": "https://api.github.com/users/mila/following{/other_user}", "gists_url": "https://api.github.com/users/mila/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/mila", "id": 118834, "login": "mila", "node_id": "MDQ6VXNlcjExODgzNA==", "organizations_url": "https://api.github.com/users/mila/orgs", "received_events_url": "https://api.github.com/users/mila/received_events", "repos_url": "https://api.github.com/users/mila/repos", "site_admin": false, "starred_url": "https://api.github.com/users/mila/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/mila/subscriptions", "type": "User", "url": "https://api.github.com/users/mila", "user_view_type": "public" }
[]
closed
true
null
[]
null
0
2022-07-19T09:06:14Z
2023-08-28T00:03:22Z
2022-07-20T23:13:36Z
CONTRIBUTOR
resolved
As a first-time contributor, I was confused when I run `make test` and saw "This runs all of the tests, on both Python 2 and Python 3." in console output.
{ "avatar_url": "https://avatars.githubusercontent.com/u/5271761?v=4", "events_url": "https://api.github.com/users/nateprewitt/events{/privacy}", "followers_url": "https://api.github.com/users/nateprewitt/followers", "following_url": "https://api.github.com/users/nateprewitt/following{/other_user}", "gists_url": "https://api.github.com/users/nateprewitt/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/nateprewitt", "id": 5271761, "login": "nateprewitt", "node_id": "MDQ6VXNlcjUyNzE3NjE=", "organizations_url": "https://api.github.com/users/nateprewitt/orgs", "received_events_url": "https://api.github.com/users/nateprewitt/received_events", "repos_url": "https://api.github.com/users/nateprewitt/repos", "site_admin": false, "starred_url": "https://api.github.com/users/nateprewitt/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/nateprewitt/subscriptions", "type": "User", "url": "https://api.github.com/users/nateprewitt", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/6200/reactions" }
https://api.github.com/repos/psf/requests/issues/6200/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/6200.diff", "html_url": "https://github.com/psf/requests/pull/6200", "merged_at": "2022-07-20T23:13:36Z", "patch_url": "https://github.com/psf/requests/pull/6200.patch", "url": "https://api.github.com/repos/psf/requests/pulls/6200" }
true
[]
https://api.github.com/repos/psf/requests/issues/6199
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6199/labels{/name}
https://api.github.com/repos/psf/requests/issues/6199/comments
https://api.github.com/repos/psf/requests/issues/6199/events
https://github.com/psf/requests/pull/6199
1,309,202,441
PR_kwDOABTKOs47omzi
6,199
Fix links in docs to the kenreitz.org domain, which expired.
{ "avatar_url": "https://avatars.githubusercontent.com/u/118834?v=4", "events_url": "https://api.github.com/users/mila/events{/privacy}", "followers_url": "https://api.github.com/users/mila/followers", "following_url": "https://api.github.com/users/mila/following{/other_user}", "gists_url": "https://api.github.com/users/mila/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/mila", "id": 118834, "login": "mila", "node_id": "MDQ6VXNlcjExODgzNA==", "organizations_url": "https://api.github.com/users/mila/orgs", "received_events_url": "https://api.github.com/users/mila/received_events", "repos_url": "https://api.github.com/users/mila/repos", "site_admin": false, "starred_url": "https://api.github.com/users/mila/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/mila/subscriptions", "type": "User", "url": "https://api.github.com/users/mila", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2022-07-19T08:57:07Z
2024-01-13T00:03:37Z
2023-01-11T22:11:22Z
CONTRIBUTOR
resolved
When I was studying Contributor’s Guide, I found that links to kenreitz.org are broken. - "The Future of Python HTTP" was archived by Internet Archive, so I linked there. - "Be cordial or be on your way" was not archived, so I removed the link. - "A Kenneth Reitz Project." in a footer is broken too, but I did not touch that link.
{ "avatar_url": "https://avatars.githubusercontent.com/u/5271761?v=4", "events_url": "https://api.github.com/users/nateprewitt/events{/privacy}", "followers_url": "https://api.github.com/users/nateprewitt/followers", "following_url": "https://api.github.com/users/nateprewitt/following{/other_user}", "gists_url": "https://api.github.com/users/nateprewitt/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/nateprewitt", "id": 5271761, "login": "nateprewitt", "node_id": "MDQ6VXNlcjUyNzE3NjE=", "organizations_url": "https://api.github.com/users/nateprewitt/orgs", "received_events_url": "https://api.github.com/users/nateprewitt/received_events", "repos_url": "https://api.github.com/users/nateprewitt/repos", "site_admin": false, "starred_url": "https://api.github.com/users/nateprewitt/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/nateprewitt/subscriptions", "type": "User", "url": "https://api.github.com/users/nateprewitt", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/6199/reactions" }
https://api.github.com/repos/psf/requests/issues/6199/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/6199.diff", "html_url": "https://github.com/psf/requests/pull/6199", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/6199.patch", "url": "https://api.github.com/repos/psf/requests/pulls/6199" }
true
[ "It appears the links may have been temporarily interrupted but are working presently." ]
https://api.github.com/repos/psf/requests/issues/6198
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6198/labels{/name}
https://api.github.com/repos/psf/requests/issues/6198/comments
https://api.github.com/repos/psf/requests/issues/6198/events
https://github.com/psf/requests/issues/6198
1,304,179,023
I_kwDOABTKOs5NvDFP
6,198
Using `format` as a query parameter for certain URLs causes `requests` to miss the `?` query string separator
{ "avatar_url": "https://avatars.githubusercontent.com/u/5019367?v=4", "events_url": "https://api.github.com/users/multimeric/events{/privacy}", "followers_url": "https://api.github.com/users/multimeric/followers", "following_url": "https://api.github.com/users/multimeric/following{/other_user}", "gists_url": "https://api.github.com/users/multimeric/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/multimeric", "id": 5019367, "login": "multimeric", "node_id": "MDQ6VXNlcjUwMTkzNjc=", "organizations_url": "https://api.github.com/users/multimeric/orgs", "received_events_url": "https://api.github.com/users/multimeric/received_events", "repos_url": "https://api.github.com/users/multimeric/repos", "site_admin": false, "starred_url": "https://api.github.com/users/multimeric/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/multimeric/subscriptions", "type": "User", "url": "https://api.github.com/users/multimeric", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2022-07-14T02:44:40Z
2023-07-15T00:03:36Z
2022-07-14T03:01:54Z
NONE
resolved
<!-- Summary. --> Using `format` as a query parameter for certain URLs causes `requests` to miss the `?` query string separator ## Expected Result I expect the `?` separator to be present whenever any query parameters are provided. <!-- What you expected. --> ## Actual Result The `?` separator is not present. <!-- What happened instead. --> ## Reproduction Steps'' ```python >>> import requests >>> requests.__version__ '2.28.1' >>> requests.get("https://www.uniprot.org/uniprotkb/search", params={"format": "json"}).url 'https://rest.uniprot.org/uniprotkb/searchformat=json' >>> requests.get("https://www.uniprot.org", params={"format": "json"}).url 'https://rest.uniprot.org/format=json' >>> requests.get("https://www.uniprot.org/uniprotkb/search", params={"size": "500"}).url 'https://www.uniprot.org/uniprotkb/search?size=500' >>> requests.get("https://www.google.com", params={"format": "json"}).url 'https://www.google.com/?format=json' ``` Note how the same issue happens in different subdomains of `uniprot.org` but that it doesn't happen with `google.com` ## System Information $ python -m requests.help ```json { "chardet": { "version": null }, "charset_normalizer": { "version": "2.1.0" }, "cryptography": { "version": "" }, "idna": { "version": "3.3" }, "implementation": { "name": "CPython", "version": "3.9.7" }, "platform": { "release": "5.13.0-52-generic", "system": "Linux" }, "pyOpenSSL": { "openssl_version": "", "version": null }, "requests": { "version": "2.28.1" }, "system_ssl": { "version": "101010cf" }, "urllib3": { "version": "1.26.10" }, "using_charset_normalizer": true, "using_pyopenssl": false } ``` <!-- This command is only available on Requests v2.16.4 and greater. Otherwise, please provide some basic information about your system (Python version, operating system, &c). -->
{ "avatar_url": "https://avatars.githubusercontent.com/u/18519037?v=4", "events_url": "https://api.github.com/users/sethmlarson/events{/privacy}", "followers_url": "https://api.github.com/users/sethmlarson/followers", "following_url": "https://api.github.com/users/sethmlarson/following{/other_user}", "gists_url": "https://api.github.com/users/sethmlarson/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/sethmlarson", "id": 18519037, "login": "sethmlarson", "node_id": "MDQ6VXNlcjE4NTE5MDM3", "organizations_url": "https://api.github.com/users/sethmlarson/orgs", "received_events_url": "https://api.github.com/users/sethmlarson/received_events", "repos_url": "https://api.github.com/users/sethmlarson/repos", "site_admin": false, "starred_url": "https://api.github.com/users/sethmlarson/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/sethmlarson/subscriptions", "type": "User", "url": "https://api.github.com/users/sethmlarson", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/6198/reactions" }
https://api.github.com/repos/psf/requests/issues/6198/timeline
null
completed
null
null
false
[ "The service is returning the incorrect URL to be redirected to in the `Location` header:\r\n\r\n```python\r\nimport requests\r\n\r\nresp = requests.get(\r\n \"https://www.uniprot.org/uniprotkb/search\",\r\n params={\"format\": \"json\"},\r\n allow_redirects=False\r\n)\r\n\r\n# The response was sent to the right URL\r\nprint(resp.url) # 'https://www.uniprot.org/uniprotkb/search?format=json'\r\n\r\n# The response is indeed a redirect\r\nprint(resp.status_code) # 301\r\n\r\n# Service redirects to the incorrect URL you're seeing\r\nprint(resp.headers[\"Location\"]) # 'https://rest.uniprot.org/uniprotkb/searchformat=json'\r\n```\r\n\r\nGoing to close this as not a bug in Requests." ]
https://api.github.com/repos/psf/requests/issues/6197
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6197/labels{/name}
https://api.github.com/repos/psf/requests/issues/6197/comments
https://api.github.com/repos/psf/requests/issues/6197/events
https://github.com/psf/requests/issues/6197
1,303,363,649
I_kwDOABTKOs5Nr8BB
6,197
how to add parameters --groups X25519
{ "avatar_url": "https://avatars.githubusercontent.com/u/1232444?v=4", "events_url": "https://api.github.com/users/nmweizi/events{/privacy}", "followers_url": "https://api.github.com/users/nmweizi/followers", "following_url": "https://api.github.com/users/nmweizi/following{/other_user}", "gists_url": "https://api.github.com/users/nmweizi/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/nmweizi", "id": 1232444, "login": "nmweizi", "node_id": "MDQ6VXNlcjEyMzI0NDQ=", "organizations_url": "https://api.github.com/users/nmweizi/orgs", "received_events_url": "https://api.github.com/users/nmweizi/received_events", "repos_url": "https://api.github.com/users/nmweizi/repos", "site_admin": false, "starred_url": "https://api.github.com/users/nmweizi/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/nmweizi/subscriptions", "type": "User", "url": "https://api.github.com/users/nmweizi", "user_view_type": "public" }
[]
closed
true
null
[]
null
0
2022-07-13T12:26:14Z
2023-07-14T00:03:50Z
2022-07-13T14:36:33Z
NONE
resolved
- https://kjt.hebei.gov.cn need to use parameters --groups X25519 to be able to connect ssl. - example openssl s_client -connect kjt.hebei.gov.cn:443 --state **--groups X25519** - requests how to add openssl parameters **--groups X25519**
{ "avatar_url": "https://avatars.githubusercontent.com/u/240830?v=4", "events_url": "https://api.github.com/users/sigmavirus24/events{/privacy}", "followers_url": "https://api.github.com/users/sigmavirus24/followers", "following_url": "https://api.github.com/users/sigmavirus24/following{/other_user}", "gists_url": "https://api.github.com/users/sigmavirus24/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/sigmavirus24", "id": 240830, "login": "sigmavirus24", "node_id": "MDQ6VXNlcjI0MDgzMA==", "organizations_url": "https://api.github.com/users/sigmavirus24/orgs", "received_events_url": "https://api.github.com/users/sigmavirus24/received_events", "repos_url": "https://api.github.com/users/sigmavirus24/repos", "site_admin": false, "starred_url": "https://api.github.com/users/sigmavirus24/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/sigmavirus24/subscriptions", "type": "User", "url": "https://api.github.com/users/sigmavirus24", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/6197/reactions" }
https://api.github.com/repos/psf/requests/issues/6197/timeline
null
completed
null
null
false
[]
https://api.github.com/repos/psf/requests/issues/6196
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6196/labels{/name}
https://api.github.com/repos/psf/requests/issues/6196/comments
https://api.github.com/repos/psf/requests/issues/6196/events
https://github.com/psf/requests/issues/6196
1,301,941,461
I_kwDOABTKOs5NmgzV
6,196
Error Partially initialized module 'requests' has no attribute 'post'"
{ "avatar_url": "https://avatars.githubusercontent.com/u/7605129?v=4", "events_url": "https://api.github.com/users/werowe/events{/privacy}", "followers_url": "https://api.github.com/users/werowe/followers", "following_url": "https://api.github.com/users/werowe/following{/other_user}", "gists_url": "https://api.github.com/users/werowe/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/werowe", "id": 7605129, "login": "werowe", "node_id": "MDQ6VXNlcjc2MDUxMjk=", "organizations_url": "https://api.github.com/users/werowe/orgs", "received_events_url": "https://api.github.com/users/werowe/received_events", "repos_url": "https://api.github.com/users/werowe/repos", "site_admin": false, "starred_url": "https://api.github.com/users/werowe/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/werowe/subscriptions", "type": "User", "url": "https://api.github.com/users/werowe", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2022-07-12T11:41:49Z
2022-07-12T15:13:29Z
2022-07-12T15:13:23Z
NONE
null
If you have a file named token.py in your path you get the error: **Error Partially initialized module 'requests' has no attribute 'post'"** That is the case with Python 3.8.9 and Requests Version: 2.28.1 on Mac OS 12.4.
{ "avatar_url": "https://avatars.githubusercontent.com/u/240830?v=4", "events_url": "https://api.github.com/users/sigmavirus24/events{/privacy}", "followers_url": "https://api.github.com/users/sigmavirus24/followers", "following_url": "https://api.github.com/users/sigmavirus24/following{/other_user}", "gists_url": "https://api.github.com/users/sigmavirus24/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/sigmavirus24", "id": 240830, "login": "sigmavirus24", "node_id": "MDQ6VXNlcjI0MDgzMA==", "organizations_url": "https://api.github.com/users/sigmavirus24/orgs", "received_events_url": "https://api.github.com/users/sigmavirus24/received_events", "repos_url": "https://api.github.com/users/sigmavirus24/repos", "site_admin": false, "starred_url": "https://api.github.com/users/sigmavirus24/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/sigmavirus24/subscriptions", "type": "User", "url": "https://api.github.com/users/sigmavirus24", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/6196/reactions" }
https://api.github.com/repos/psf/requests/issues/6196/timeline
null
completed
null
null
false
[ "I don't believe we import anything directly that would cause that so it's likely an issue with a dependency it the standard libraries we rely on. Therefore, it's not a bug we can fix. Rename your file to not conflict with what (based on my memory, since I'm on my phone) is a standard library package.\n\nAlso you ignored the issue template" ]
https://api.github.com/repos/psf/requests/issues/6195
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6195/labels{/name}
https://api.github.com/repos/psf/requests/issues/6195/comments
https://api.github.com/repos/psf/requests/issues/6195/events
https://github.com/psf/requests/pull/6195
1,301,092,133
PR_kwDOABTKOs47NrPU
6,195
Adding native support for Bearer token authentication objects
{ "avatar_url": "https://avatars.githubusercontent.com/u/98620302?v=4", "events_url": "https://api.github.com/users/Karien98/events{/privacy}", "followers_url": "https://api.github.com/users/Karien98/followers", "following_url": "https://api.github.com/users/Karien98/following{/other_user}", "gists_url": "https://api.github.com/users/Karien98/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Karien98", "id": 98620302, "login": "Karien98", "node_id": "U_kgDOBeDTjg", "organizations_url": "https://api.github.com/users/Karien98/orgs", "received_events_url": "https://api.github.com/users/Karien98/received_events", "repos_url": "https://api.github.com/users/Karien98/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Karien98/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Karien98/subscriptions", "type": "User", "url": "https://api.github.com/users/Karien98", "user_view_type": "public" }
[]
closed
true
null
[]
null
3
2022-07-11T18:51:11Z
2023-07-12T00:03:14Z
2022-07-11T19:41:31Z
NONE
resolved
added to auth.py: class HTTPBearerTokenAuth(AuthBase): def _bearer_token_auth_str(token): added 1 test case to test_requests.py All tests passed locally
{ "avatar_url": "https://avatars.githubusercontent.com/u/240830?v=4", "events_url": "https://api.github.com/users/sigmavirus24/events{/privacy}", "followers_url": "https://api.github.com/users/sigmavirus24/followers", "following_url": "https://api.github.com/users/sigmavirus24/following{/other_user}", "gists_url": "https://api.github.com/users/sigmavirus24/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/sigmavirus24", "id": 240830, "login": "sigmavirus24", "node_id": "MDQ6VXNlcjI0MDgzMA==", "organizations_url": "https://api.github.com/users/sigmavirus24/orgs", "received_events_url": "https://api.github.com/users/sigmavirus24/received_events", "repos_url": "https://api.github.com/users/sigmavirus24/repos", "site_admin": false, "starred_url": "https://api.github.com/users/sigmavirus24/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/sigmavirus24/subscriptions", "type": "User", "url": "https://api.github.com/users/sigmavirus24", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/6195/reactions" }
https://api.github.com/repos/psf/requests/issues/6195/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/6195.diff", "html_url": "https://github.com/psf/requests/pull/6195", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/6195.patch", "url": "https://api.github.com/repos/psf/requests/pulls/6195" }
true
[ "I'm very excited for this new feature. Tests also passed locally for me. I'm happy to assist development on this one, please let me know if I can help.", "Duplicate of #4437", "@sigmavirus24 Thank you for your feedback. We apologize for not noticing https://github.com/psf/requests/issues/4437 , which we inadvertently duplicated, and we apologize to inadvertently reopening a contentious and previously resolved topic. Although we certainly wish this feature could be added - we would find it very useful and we're eager to get involved - we defer to your experience and judgement.\r\n\r\nIf you don't mind us asking you a couple of questions:\r\n\r\n1. This is our first attempt at contributing to open source. How did we do?\r\n\r\n2. Can you recommend other ways we could contribute to this repo?\r\n\r\nThank you." ]
https://api.github.com/repos/psf/requests/issues/6194
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6194/labels{/name}
https://api.github.com/repos/psf/requests/issues/6194/comments
https://api.github.com/repos/psf/requests/issues/6194/events
https://github.com/psf/requests/issues/6194
1,300,197,366
I_kwDOABTKOs5Nf2_2
6,194
Incorrect work of requests
{ "avatar_url": "https://avatars.githubusercontent.com/u/2187893?v=4", "events_url": "https://api.github.com/users/beqabeqa473/events{/privacy}", "followers_url": "https://api.github.com/users/beqabeqa473/followers", "following_url": "https://api.github.com/users/beqabeqa473/following{/other_user}", "gists_url": "https://api.github.com/users/beqabeqa473/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/beqabeqa473", "id": 2187893, "login": "beqabeqa473", "node_id": "MDQ6VXNlcjIxODc4OTM=", "organizations_url": "https://api.github.com/users/beqabeqa473/orgs", "received_events_url": "https://api.github.com/users/beqabeqa473/received_events", "repos_url": "https://api.github.com/users/beqabeqa473/repos", "site_admin": false, "starred_url": "https://api.github.com/users/beqabeqa473/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/beqabeqa473/subscriptions", "type": "User", "url": "https://api.github.com/users/beqabeqa473", "user_view_type": "public" }
[]
closed
true
null
[]
null
3
2022-07-11T04:40:33Z
2022-07-11T15:17:29Z
2022-07-11T11:03:50Z
NONE
null
<!-- Summary. --> For some reason, making request via requests library forces a site to return page for enterring captcha. The same request made with urllib gives expected result. ## Expected Result The same response as made with urllib, i.e. get a full page response <!-- What you expected. --> ## Actual Result Request made with requests caused to get a response with captcha <!-- What happened instead. --> ## Reproduction Steps ```python import requests url = "https://yandex.ru/pogoda/tbilisi" headers = {"Host": "yandex.ru"} resp = requests.get(url, headers=headers, verify=False) print(res.text ``` ```python import urllib.request req = urllib.request.Request("https://yandex.ru/pogoda/tbilisi") res = urllib.request.urlopen(req) print(res.read())) ``` ## System Information $ python -m requests.help ```json { "chardet": { "version": null }, "charset_normalizer": { "version": "2.1.0" }, "cryptography": { "version": "" }, "idna": { "version": "3.3" }, "implementation": { "name": "CPython", "version": "3.7.9" }, "platform": { "release": "10", "system": "Windows" }, "pyOpenSSL": { "openssl_version": "", "version": null }, "requests": { "version": "2.28.1" }, "system_ssl": { "version": "1010107f" }, "urllib3": { "version": "1.26.9" }, "using_charset_normalizer": true, "using_pyopenssl": false "paste": "here" } ``` <!-- This command is only available on Requests v2.16.4 and greater. Otherwise, please provide some basic information about your system (Python version, operating system, &c). -->
{ "avatar_url": "https://avatars.githubusercontent.com/u/5271761?v=4", "events_url": "https://api.github.com/users/nateprewitt/events{/privacy}", "followers_url": "https://api.github.com/users/nateprewitt/followers", "following_url": "https://api.github.com/users/nateprewitt/following{/other_user}", "gists_url": "https://api.github.com/users/nateprewitt/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/nateprewitt", "id": 5271761, "login": "nateprewitt", "node_id": "MDQ6VXNlcjUyNzE3NjE=", "organizations_url": "https://api.github.com/users/nateprewitt/orgs", "received_events_url": "https://api.github.com/users/nateprewitt/received_events", "repos_url": "https://api.github.com/users/nateprewitt/repos", "site_admin": false, "starred_url": "https://api.github.com/users/nateprewitt/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/nateprewitt/subscriptions", "type": "User", "url": "https://api.github.com/users/nateprewitt", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/6194/reactions" }
https://api.github.com/repos/psf/requests/issues/6194/timeline
null
completed
null
null
false
[ "I suspect it is something related with ssl, because, when i decided to capture traffic from these two methods and compare, i was using httpdebugger and their certificate.\r\nIn this case everything worked as expected.", "Hi @beqabeqa473, the service you're trying to connect to is performing user-agent fingerprinting and rejecting your requests. This is done by a number of services to prevent webscraping with common tools like Requests. We won't be able to provide help with that on this issue tracker though.", "Hello.\r\n\r\nYes, of course i know about user-agent, and i passed correct user-agent from my browser as a header, but it redirects to captcha page.\r\n\r\nI was seeing something similar earlier with requests, and in that case also, i was not able to reproduce issue with http debugger with enabled https encryption." ]
https://api.github.com/repos/psf/requests/issues/6193
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6193/labels{/name}
https://api.github.com/repos/psf/requests/issues/6193/comments
https://api.github.com/repos/psf/requests/issues/6193/events
https://github.com/psf/requests/issues/6193
1,299,817,814
I_kwDOABTKOs5NeaVW
6,193
SSLError: [SSL: BAD_ECPOINT] bad ecpoint (_ssl.c:997)
{ "avatar_url": "https://avatars.githubusercontent.com/u/1232444?v=4", "events_url": "https://api.github.com/users/nmweizi/events{/privacy}", "followers_url": "https://api.github.com/users/nmweizi/followers", "following_url": "https://api.github.com/users/nmweizi/following{/other_user}", "gists_url": "https://api.github.com/users/nmweizi/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/nmweizi", "id": 1232444, "login": "nmweizi", "node_id": "MDQ6VXNlcjEyMzI0NDQ=", "organizations_url": "https://api.github.com/users/nmweizi/orgs", "received_events_url": "https://api.github.com/users/nmweizi/received_events", "repos_url": "https://api.github.com/users/nmweizi/repos", "site_admin": false, "starred_url": "https://api.github.com/users/nmweizi/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/nmweizi/subscriptions", "type": "User", "url": "https://api.github.com/users/nmweizi", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2022-07-10T03:26:06Z
2022-07-10T22:32:41Z
2022-07-10T13:16:27Z
NONE
null
- macos,python3.10,requests 2.28.1 - request ``` requests.get("https://kjt.hebei.gov.cn/www/index_ssl/index.html",verify=False,headers={"User-Agent":"firefox"}) ``` - error info ``` SSLError: HTTPSConnectionPool(host='kjt.hebei.gov.cn', port=443): Max retries exceeded with url: /www/index_ssl/index.html (Caused by SSLError(SSLError(1, '[SSL: BAD_ECPOINT] bad ecpoint (_ssl.c:997)'))) ``` - python3.10 -m requests.help ``` { "chardet": { "version": null }, "charset_normalizer": { "version": "2.0.8" }, "cryptography": { "version": "36.0.0" }, "idna": { "version": "3.3" }, "implementation": { "name": "CPython", "version": "3.10.5" }, "platform": { "release": "21.5.0", "system": "Darwin" }, "pyOpenSSL": { "openssl_version": "101010cf", "version": "22.0.0" }, "requests": { "version": "2.28.1" }, "system_ssl": { "version": "1010111f" }, "urllib3": { "version": "1.26.7" }, "using_charset_normalizer": true, "using_pyopenssl": true } ```
{ "avatar_url": "https://avatars.githubusercontent.com/u/240830?v=4", "events_url": "https://api.github.com/users/sigmavirus24/events{/privacy}", "followers_url": "https://api.github.com/users/sigmavirus24/followers", "following_url": "https://api.github.com/users/sigmavirus24/following{/other_user}", "gists_url": "https://api.github.com/users/sigmavirus24/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/sigmavirus24", "id": 240830, "login": "sigmavirus24", "node_id": "MDQ6VXNlcjI0MDgzMA==", "organizations_url": "https://api.github.com/users/sigmavirus24/orgs", "received_events_url": "https://api.github.com/users/sigmavirus24/received_events", "repos_url": "https://api.github.com/users/sigmavirus24/repos", "site_admin": false, "starred_url": "https://api.github.com/users/sigmavirus24/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/sigmavirus24/subscriptions", "type": "User", "url": "https://api.github.com/users/sigmavirus24", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/6193/reactions" }
https://api.github.com/repos/psf/requests/issues/6193/timeline
null
completed
null
null
false
[ "Hi there! Thanks for opening this issue. Unfortunately, it seems this is a request for help instead of a report of a defect in the project. Please use [StackOverflow](https://stackoverflow.com) for general usage questions instead and only report defects here.", "may be? https://bugs.python.org/issue32882\r\nhow set_ecdh_curve(\"X25519\") in requests?" ]
https://api.github.com/repos/psf/requests/issues/6192
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6192/labels{/name}
https://api.github.com/repos/psf/requests/issues/6192/comments
https://api.github.com/repos/psf/requests/issues/6192/events
https://github.com/psf/requests/pull/6192
1,298,956,810
PR_kwDOABTKOs47Gr6i
6,192
Fix the popitem bug in cookies
{ "avatar_url": "https://avatars.githubusercontent.com/u/34425507?v=4", "events_url": "https://api.github.com/users/kianelbo/events{/privacy}", "followers_url": "https://api.github.com/users/kianelbo/followers", "following_url": "https://api.github.com/users/kianelbo/following{/other_user}", "gists_url": "https://api.github.com/users/kianelbo/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kianelbo", "id": 34425507, "login": "kianelbo", "node_id": "MDQ6VXNlcjM0NDI1NTA3", "organizations_url": "https://api.github.com/users/kianelbo/orgs", "received_events_url": "https://api.github.com/users/kianelbo/received_events", "repos_url": "https://api.github.com/users/kianelbo/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kianelbo/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kianelbo/subscriptions", "type": "User", "url": "https://api.github.com/users/kianelbo", "user_view_type": "public" }
[]
open
false
null
[]
{ "closed_at": null, "closed_issues": 0, "created_at": "2024-05-20T14:16:54Z", "creator": { "avatar_url": "https://avatars.githubusercontent.com/u/5271761?v=4", "events_url": "https://api.github.com/users/nateprewitt/events{/privacy}", "followers_url": "https://api.github.com/users/nateprewitt/followers", "following_url": "https://api.github.com/users/nateprewitt/following{/other_user}", "gists_url": "https://api.github.com/users/nateprewitt/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/nateprewitt", "id": 5271761, "login": "nateprewitt", "node_id": "MDQ6VXNlcjUyNzE3NjE=", "organizations_url": "https://api.github.com/users/nateprewitt/orgs", "received_events_url": "https://api.github.com/users/nateprewitt/received_events", "repos_url": "https://api.github.com/users/nateprewitt/repos", "site_admin": false, "starred_url": "https://api.github.com/users/nateprewitt/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/nateprewitt/subscriptions", "type": "User", "url": "https://api.github.com/users/nateprewitt", "user_view_type": "public" }, "description": "", "due_on": null, "html_url": "https://github.com/psf/requests/milestone/35", "id": 11076316, "labels_url": "https://api.github.com/repos/psf/requests/milestones/35/labels", "node_id": "MI_kwDOABTKOs4AqQLc", "number": 35, "open_issues": 3, "state": "open", "title": "2.33.0", "updated_at": "2024-05-21T12:26:27Z", "url": "https://api.github.com/repos/psf/requests/milestones/35" }
0
2022-07-08T12:27:41Z
2024-05-20T14:17:03Z
null
NONE
null
Closes #6190
null
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/6192/reactions" }
https://api.github.com/repos/psf/requests/issues/6192/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/6192.diff", "html_url": "https://github.com/psf/requests/pull/6192", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/6192.patch", "url": "https://api.github.com/repos/psf/requests/pulls/6192" }
true
[]
https://api.github.com/repos/psf/requests/issues/6191
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6191/labels{/name}
https://api.github.com/repos/psf/requests/issues/6191/comments
https://api.github.com/repos/psf/requests/issues/6191/events
https://github.com/psf/requests/issues/6191
1,297,070,638
I_kwDOABTKOs5NT7ou
6,191
[2.28.1] IncompleteRead errors on large file download using iter_content (working 2.28.0)
{ "avatar_url": "https://avatars.githubusercontent.com/u/22263247?v=4", "events_url": "https://api.github.com/users/Moandco/events{/privacy}", "followers_url": "https://api.github.com/users/Moandco/followers", "following_url": "https://api.github.com/users/Moandco/following{/other_user}", "gists_url": "https://api.github.com/users/Moandco/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Moandco", "id": 22263247, "login": "Moandco", "node_id": "MDQ6VXNlcjIyMjYzMjQ3", "organizations_url": "https://api.github.com/users/Moandco/orgs", "received_events_url": "https://api.github.com/users/Moandco/received_events", "repos_url": "https://api.github.com/users/Moandco/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Moandco/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Moandco/subscriptions", "type": "User", "url": "https://api.github.com/users/Moandco", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2022-07-07T09:10:11Z
2023-07-09T00:03:59Z
2022-07-08T06:19:04Z
NONE
resolved
Receiving ChunkedEncodingErrors with IncompleteRead while receiving a reponse with a large binary using transfer-encoding: chunked. ## Expected Result A response with a large binary body (500MB+) send using `transfer-encoding: chunked` with the appropriate header gets processed in steps using `inter_content` without error. Behavior as it was in 28.0.0. ## Actual Result The processing fails with a random number of missing bytes raising `ChunkedEncodingError (Connection Broken: IncompleteRead(X bytes read, Y bytes more expected))` ## Reproduction Steps Send a request to an endpoint returning a large binary (500MB+) in the reponse body using transfer encoding chunked. ## System Information $ python -m requests.help ```json { "chardet": { "version": "5.0.0" }, "charset_normalizer": { "version": "2.1.0" }, "cryptography": { "version": "" }, "idna": { "version": "3.3" }, "implementation": { "name": "CPython", "version": "3.9.10" }, "platform": { "release": "10", "system": "Windows" }, "pyOpenSSL": { "openssl_version": "", "version": null }, "requests": { "version": "2.28.1" }, "system_ssl": { "version": "101010df" }, "urllib3": { "version": "1.26.9" }, "using_charset_normalizer": false, "using_pyopenssl": false } ```
{ "avatar_url": "https://avatars.githubusercontent.com/u/22263247?v=4", "events_url": "https://api.github.com/users/Moandco/events{/privacy}", "followers_url": "https://api.github.com/users/Moandco/followers", "following_url": "https://api.github.com/users/Moandco/following{/other_user}", "gists_url": "https://api.github.com/users/Moandco/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Moandco", "id": 22263247, "login": "Moandco", "node_id": "MDQ6VXNlcjIyMjYzMjQ3", "organizations_url": "https://api.github.com/users/Moandco/orgs", "received_events_url": "https://api.github.com/users/Moandco/received_events", "repos_url": "https://api.github.com/users/Moandco/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Moandco/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Moandco/subscriptions", "type": "User", "url": "https://api.github.com/users/Moandco", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/6191/reactions" }
https://api.github.com/repos/psf/requests/issues/6191/timeline
null
completed
null
null
false
[ "Hi @Moandco, could you provide some more information on the issue?\r\n\r\nA few questions that are raised immediately are\r\n\r\na.) is this specific to a single server/service or broadly reproducible?\r\nb.) is this error happening consistently with every large download?\r\nc.) if it is consistent, downgrading immediately resolves the issue?\r\n\r\n\r\nThere was a minor change with iter_content in 2.28.1 but it should be largely cosmetic. The ChunkedEncodingError comes from a ProtocolError in urllib3 which has always been possible. We haven’t changed anything around that logic.", "The issue is caused by the server-side. The package upgrade was a coincidence. Thanks for your time. " ]
https://api.github.com/repos/psf/requests/issues/6190
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6190/labels{/name}
https://api.github.com/repos/psf/requests/issues/6190/comments
https://api.github.com/repos/psf/requests/issues/6190/events
https://github.com/psf/requests/issues/6190
1,293,744,958
I_kwDOABTKOs5NHPs-
6,190
requests.cookies.RequestsCookieJar: popitem() does not work
{ "avatar_url": "https://avatars.githubusercontent.com/u/4130991?v=4", "events_url": "https://api.github.com/users/fireattack/events{/privacy}", "followers_url": "https://api.github.com/users/fireattack/followers", "following_url": "https://api.github.com/users/fireattack/following{/other_user}", "gists_url": "https://api.github.com/users/fireattack/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/fireattack", "id": 4130991, "login": "fireattack", "node_id": "MDQ6VXNlcjQxMzA5OTE=", "organizations_url": "https://api.github.com/users/fireattack/orgs", "received_events_url": "https://api.github.com/users/fireattack/received_events", "repos_url": "https://api.github.com/users/fireattack/repos", "site_admin": false, "starred_url": "https://api.github.com/users/fireattack/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/fireattack/subscriptions", "type": "User", "url": "https://api.github.com/users/fireattack", "user_view_type": "public" }
[]
open
false
null
[]
null
6
2022-07-05T03:39:54Z
2022-11-16T15:53:28Z
null
NONE
null
`requests.cookies.RequestsCookieJar`'s `popitem()` method doesn't seem to work even if cookies is not empty. ## Expected Result From [the doc](https://requests.readthedocs.io/en/latest/api/#requests.cookies.RequestsCookieJar.popitem): >remove and return some (key, value) pair as a 2-tuple; but raise KeyError if D is empty. (Also, I'm not sure what exactly is "D" here. I assume it means the cookies obj itself.) ## Actual Result It always raises KeyError even when it's not empty. ## Reproduction Steps ```python import requests r = requests.get('https://google.com') print(len(r.cookies)) # = 3 r.cookies.popitem() ``` ## System Information $ python -m requests.help ```json { "chardet": { "version": "4.0.0" }, "charset_normalizer": { "version": "2.0.10" }, "cryptography": { "version": "3.4.8" }, "idna": { "version": "2.10" }, "implementation": { "name": "CPython", "version": "3.9.1" }, "platform": { "release": "10", "system": "Windows" }, "pyOpenSSL": { "openssl_version": "101010cf", "version": "20.0.1" }, "requests": { "version": "2.28.1" }, "system_ssl": { "version": "1010107f" }, "urllib3": { "version": "1.26.3" }, "using_charset_normalizer": false, "using_pyopenssl": true } ``` <!-- This command is only available on Requests v2.16.4 and greater. Otherwise, please provide some basic information about your system (Python version, operating system, &c). -->
null
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/6190/reactions" }
https://api.github.com/repos/psf/requests/issues/6190/timeline
null
null
null
null
false
[ "I found the issue and hopefully fixed it but I couldn't find the documentation entry, perhaps because `popitem` is not implemented explicitly in the code. Is there any way to improve the doc?", "Correct @kianelbo support was not intended for that method but we can't use the mapping interface without it. To be fair, exposing cookies as if they're a simple mapping was a huge design mistake. Unfortunately we're here now so I think we have to fix this unless @nateprewitt or @sethmlarson agree that we should fix the cookies design in some other backwards compatible fashion", "Yeah, I agree we should just fix it. Long term, I'm in favor of us reworking cookies entirely, as we've discussed before.\n\nFor the moment, this seems reasonably straight forward to get the inherited methods working. Can we get a quick manual pass to verify this fixes the others that come through mapping?", "@nateprewitt do you mean just making the inherited methods work for now? They're currently ok other than `popitem` which the PR fixes.", "Thanks for confirming, @kianelbo. I have your PR on the shortlist for review this week and we'll look at getting this change added.", "Hi. Any plans for reviewing the PR? I was really excited to see it merged." ]
https://api.github.com/repos/psf/requests/issues/6189
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6189/labels{/name}
https://api.github.com/repos/psf/requests/issues/6189/comments
https://api.github.com/repos/psf/requests/issues/6189/events
https://github.com/psf/requests/issues/6189
1,292,029,103
I_kwDOABTKOs5NAsyv
6,189
Werkzeug importing failed
{ "avatar_url": "https://avatars.githubusercontent.com/u/80721211?v=4", "events_url": "https://api.github.com/users/Khabibulix/events{/privacy}", "followers_url": "https://api.github.com/users/Khabibulix/followers", "following_url": "https://api.github.com/users/Khabibulix/following{/other_user}", "gists_url": "https://api.github.com/users/Khabibulix/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Khabibulix", "id": 80721211, "login": "Khabibulix", "node_id": "MDQ6VXNlcjgwNzIxMjEx", "organizations_url": "https://api.github.com/users/Khabibulix/orgs", "received_events_url": "https://api.github.com/users/Khabibulix/received_events", "repos_url": "https://api.github.com/users/Khabibulix/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Khabibulix/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Khabibulix/subscriptions", "type": "User", "url": "https://api.github.com/users/Khabibulix", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2022-07-02T10:58:08Z
2023-07-03T00:03:43Z
2022-07-02T21:47:34Z
NONE
resolved
Heya to all, I already check Internet before botherin you all. Here's the deal: i installed all the requirements.txt and i wanted to launch the tests, but i raise an _**ImportError**_ with _**werkzeug.wrappers**_. Here is the complete error: ![Sans titre](https://user-images.githubusercontent.com/80721211/176997660-9ca8d709-4610-4c1f-93f4-948b428ac946.png) Here is my Pip List: ![Sans titre](https://user-images.githubusercontent.com/80721211/176997804-cf619a8a-41f3-42ff-b6fe-4ccbc100fead.png) So i upgraded Pip, i changed the version for werkzeug, i searched Google for answers but, the solutions that i found are not correct for my case. I'll be glad if someone could help me, i really want to: - Run the tests - Contribute to Requests - Become the best programmer But just not seeing that error will make me happy. Thanks for reading and good day!
{ "avatar_url": "https://avatars.githubusercontent.com/u/18519037?v=4", "events_url": "https://api.github.com/users/sethmlarson/events{/privacy}", "followers_url": "https://api.github.com/users/sethmlarson/followers", "following_url": "https://api.github.com/users/sethmlarson/following{/other_user}", "gists_url": "https://api.github.com/users/sethmlarson/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/sethmlarson", "id": 18519037, "login": "sethmlarson", "node_id": "MDQ6VXNlcjE4NTE5MDM3", "organizations_url": "https://api.github.com/users/sethmlarson/orgs", "received_events_url": "https://api.github.com/users/sethmlarson/received_events", "repos_url": "https://api.github.com/users/sethmlarson/repos", "site_admin": false, "starred_url": "https://api.github.com/users/sethmlarson/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/sethmlarson/subscriptions", "type": "User", "url": "https://api.github.com/users/sethmlarson", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/6189/reactions" }
https://api.github.com/repos/psf/requests/issues/6189/timeline
null
completed
null
null
false
[ "Hello there,\r\n I've read your issue and the werkzeug code,\r\n there is a command in their code that might help you\r\n` .. versionchanged:: 2.0\r\n Combine ``BaseResponse`` and mixins into a single ``Response``\r\n class. Using the old classes is deprecated and will be removed\r\n in Werkzeug 2.1.`\r\nI think you should try :\r\n`from Werkzeug.wrappers import Response`\r\nHope that helps you, \r\nGoodLuck 👍🏼 ", "Unfortunately we don't have time to help people debug their developer environments. You should ask on StackOverflow or do some additional learning about managing Python environments." ]
https://api.github.com/repos/psf/requests/issues/6188
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6188/labels{/name}
https://api.github.com/repos/psf/requests/issues/6188/comments
https://api.github.com/repos/psf/requests/issues/6188/events
https://github.com/psf/requests/pull/6188
1,289,126,381
PR_kwDOABTKOs46lsGT
6,188
Fixed warnings message to suggest using secure protocol.
{ "avatar_url": "https://avatars.githubusercontent.com/u/370774?v=4", "events_url": "https://api.github.com/users/slyapustin/events{/privacy}", "followers_url": "https://api.github.com/users/slyapustin/followers", "following_url": "https://api.github.com/users/slyapustin/following{/other_user}", "gists_url": "https://api.github.com/users/slyapustin/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/slyapustin", "id": 370774, "login": "slyapustin", "node_id": "MDQ6VXNlcjM3MDc3NA==", "organizations_url": "https://api.github.com/users/slyapustin/orgs", "received_events_url": "https://api.github.com/users/slyapustin/received_events", "repos_url": "https://api.github.com/users/slyapustin/repos", "site_admin": false, "starred_url": "https://api.github.com/users/slyapustin/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/slyapustin/subscriptions", "type": "User", "url": "https://api.github.com/users/slyapustin", "user_view_type": "public" }
[]
closed
true
null
[]
null
0
2022-06-29T18:24:40Z
2023-06-30T00:03:07Z
2022-06-29T18:41:49Z
CONTRIBUTOR
resolved
Small update to suggest secure schema in the error message: > Perhaps you meant https:// Instead of > Perhaps you meant http://
{ "avatar_url": "https://avatars.githubusercontent.com/u/5271761?v=4", "events_url": "https://api.github.com/users/nateprewitt/events{/privacy}", "followers_url": "https://api.github.com/users/nateprewitt/followers", "following_url": "https://api.github.com/users/nateprewitt/following{/other_user}", "gists_url": "https://api.github.com/users/nateprewitt/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/nateprewitt", "id": 5271761, "login": "nateprewitt", "node_id": "MDQ6VXNlcjUyNzE3NjE=", "organizations_url": "https://api.github.com/users/nateprewitt/orgs", "received_events_url": "https://api.github.com/users/nateprewitt/received_events", "repos_url": "https://api.github.com/users/nateprewitt/repos", "site_admin": false, "starred_url": "https://api.github.com/users/nateprewitt/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/nateprewitt/subscriptions", "type": "User", "url": "https://api.github.com/users/nateprewitt", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/6188/reactions" }
https://api.github.com/repos/psf/requests/issues/6188/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/6188.diff", "html_url": "https://github.com/psf/requests/pull/6188", "merged_at": "2022-06-29T18:41:49Z", "patch_url": "https://github.com/psf/requests/pull/6188.patch", "url": "https://api.github.com/repos/psf/requests/pulls/6188" }
true
[]
https://api.github.com/repos/psf/requests/issues/6187
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6187/labels{/name}
https://api.github.com/repos/psf/requests/issues/6187/comments
https://api.github.com/repos/psf/requests/issues/6187/events
https://github.com/psf/requests/pull/6187
1,288,932,507
PR_kwDOABTKOs46lBJ0
6,187
refactor: prefer dictionary comphrension to loop
{ "avatar_url": "https://avatars.githubusercontent.com/u/947110?v=4", "events_url": "https://api.github.com/users/kkirsche/events{/privacy}", "followers_url": "https://api.github.com/users/kkirsche/followers", "following_url": "https://api.github.com/users/kkirsche/following{/other_user}", "gists_url": "https://api.github.com/users/kkirsche/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kkirsche", "id": 947110, "login": "kkirsche", "node_id": "MDQ6VXNlcjk0NzExMA==", "organizations_url": "https://api.github.com/users/kkirsche/orgs", "received_events_url": "https://api.github.com/users/kkirsche/received_events", "repos_url": "https://api.github.com/users/kkirsche/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kkirsche/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kkirsche/subscriptions", "type": "User", "url": "https://api.github.com/users/kkirsche", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2022-06-29T15:53:20Z
2024-07-30T00:03:47Z
2023-07-30T01:55:18Z
CONTRIBUTOR
resolved
A dictionary comprehension can create the dictionary on one line, cutting out the clutter of declaring an empty dict and then adding items. Squeezing code onto one line can make it more difficult to read, but for comprehensions this isn't the case. All of the elements that you need are nicely presented, and once you are used to the syntax it is actually more readable than the for loop version. Given the attribute names, this is still readable due to lack of conditional behavior. Another point is that the assignment is now more of an atomic operation - we're declaring what `cookie_dict` is rather than giving instructions on how to build it. This makes the code read like more of a narrative, since going forward we will care more about what `cookie_dict` is than the details of its construction. Finally comprehensions will usually execute more quickly than building the collection in a loop, which is another factor if performance is a consideration. As cookies are variable in quantity, this may be of value in this location
{ "avatar_url": "https://avatars.githubusercontent.com/u/5271761?v=4", "events_url": "https://api.github.com/users/nateprewitt/events{/privacy}", "followers_url": "https://api.github.com/users/nateprewitt/followers", "following_url": "https://api.github.com/users/nateprewitt/following{/other_user}", "gists_url": "https://api.github.com/users/nateprewitt/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/nateprewitt", "id": 5271761, "login": "nateprewitt", "node_id": "MDQ6VXNlcjUyNzE3NjE=", "organizations_url": "https://api.github.com/users/nateprewitt/orgs", "received_events_url": "https://api.github.com/users/nateprewitt/received_events", "repos_url": "https://api.github.com/users/nateprewitt/repos", "site_admin": false, "starred_url": "https://api.github.com/users/nateprewitt/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/nateprewitt/subscriptions", "type": "User", "url": "https://api.github.com/users/nateprewitt", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/6187/reactions" }
https://api.github.com/repos/psf/requests/issues/6187/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/6187.diff", "html_url": "https://github.com/psf/requests/pull/6187", "merged_at": "2023-07-30T01:55:18Z", "patch_url": "https://github.com/psf/requests/pull/6187.patch", "url": "https://api.github.com/repos/psf/requests/pulls/6187" }
true
[ "Thanks for the PR @kkirsche." ]
https://api.github.com/repos/psf/requests/issues/6186
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6186/labels{/name}
https://api.github.com/repos/psf/requests/issues/6186/comments
https://api.github.com/repos/psf/requests/issues/6186/events
https://github.com/psf/requests/pull/6186
1,288,922,045
PR_kwDOABTKOs46k-4l
6,186
refactor: prefer f-strings to format where fits within black lengths
{ "avatar_url": "https://avatars.githubusercontent.com/u/947110?v=4", "events_url": "https://api.github.com/users/kkirsche/events{/privacy}", "followers_url": "https://api.github.com/users/kkirsche/followers", "following_url": "https://api.github.com/users/kkirsche/following{/other_user}", "gists_url": "https://api.github.com/users/kkirsche/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kkirsche", "id": 947110, "login": "kkirsche", "node_id": "MDQ6VXNlcjk0NzExMA==", "organizations_url": "https://api.github.com/users/kkirsche/orgs", "received_events_url": "https://api.github.com/users/kkirsche/received_events", "repos_url": "https://api.github.com/users/kkirsche/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kkirsche/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kkirsche/subscriptions", "type": "User", "url": "https://api.github.com/users/kkirsche", "user_view_type": "public" }
[]
open
false
null
[]
null
0
2022-06-29T15:46:13Z
2022-06-29T15:46:13Z
null
CONTRIBUTOR
null
Python added f-strings in version 3.6, with [PEP 498](https://www.python.org/dev/peps/pep-0498/). F-strings are a flexible and powerful way to format strings. They make the code shorter and more readable, since the code now looks more like the output. F-Strings are also more performant than using `.format` (e.g. see [F-String Speed Considerations](https://realpython.com/lessons/f-strings-speed-considerations-performance/), [F-String Benchmarks](https://www.scivision.dev/python-f-string-speed/) for two quick examples) because the python runtime can insert the variables into the string while parsing rather than backtracking to insert them into the placeholders, reducing the number of times the lines need to be processed
null
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/6186/reactions" }
https://api.github.com/repos/psf/requests/issues/6186/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/6186.diff", "html_url": "https://github.com/psf/requests/pull/6186", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/6186.patch", "url": "https://api.github.com/repos/psf/requests/pulls/6186" }
true
[]
https://api.github.com/repos/psf/requests/issues/6185
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6185/labels{/name}
https://api.github.com/repos/psf/requests/issues/6185/comments
https://api.github.com/repos/psf/requests/issues/6185/events
https://github.com/psf/requests/pull/6185
1,288,910,937
PR_kwDOABTKOs46k8hC
6,185
refactor: use contextlib.suppress instead of empty except
{ "avatar_url": "https://avatars.githubusercontent.com/u/947110?v=4", "events_url": "https://api.github.com/users/kkirsche/events{/privacy}", "followers_url": "https://api.github.com/users/kkirsche/followers", "following_url": "https://api.github.com/users/kkirsche/following{/other_user}", "gists_url": "https://api.github.com/users/kkirsche/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kkirsche", "id": 947110, "login": "kkirsche", "node_id": "MDQ6VXNlcjk0NzExMA==", "organizations_url": "https://api.github.com/users/kkirsche/orgs", "received_events_url": "https://api.github.com/users/kkirsche/received_events", "repos_url": "https://api.github.com/users/kkirsche/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kkirsche/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kkirsche/subscriptions", "type": "User", "url": "https://api.github.com/users/kkirsche", "user_view_type": "public" }
[]
open
false
null
[]
null
0
2022-06-29T15:37:24Z
2022-06-29T15:37:24Z
null
CONTRIBUTOR
null
Use [contextlib](https://docs.python.org/3/library/contextlib.html)'s suppress method to silence a specific error, instead of passing in an exception handler. The context manager slightly shortens the code and significantly clarifies the author's intention to ignore the specific errors. The standard library feature was introduced following a [discussion](https://bugs.python.org/issue15806), where the consensus was that > A key benefit here is in the priming effect for readers... The with statement form makes it clear before you start reading the code that certain exceptions won't propagate.
null
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/6185/reactions" }
https://api.github.com/repos/psf/requests/issues/6185/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/6185.diff", "html_url": "https://github.com/psf/requests/pull/6185", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/6185.patch", "url": "https://api.github.com/repos/psf/requests/pulls/6185" }
true
[]
https://api.github.com/repos/psf/requests/issues/6184
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6184/labels{/name}
https://api.github.com/repos/psf/requests/issues/6184/comments
https://api.github.com/repos/psf/requests/issues/6184/events
https://github.com/psf/requests/pull/6184
1,288,904,216
PR_kwDOABTKOs46k7Ff
6,184
Replace bare exception handlers with contextlib.suppress
{ "avatar_url": "https://avatars.githubusercontent.com/u/947110?v=4", "events_url": "https://api.github.com/users/kkirsche/events{/privacy}", "followers_url": "https://api.github.com/users/kkirsche/followers", "following_url": "https://api.github.com/users/kkirsche/following{/other_user}", "gists_url": "https://api.github.com/users/kkirsche/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kkirsche", "id": 947110, "login": "kkirsche", "node_id": "MDQ6VXNlcjk0NzExMA==", "organizations_url": "https://api.github.com/users/kkirsche/orgs", "received_events_url": "https://api.github.com/users/kkirsche/received_events", "repos_url": "https://api.github.com/users/kkirsche/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kkirsche/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kkirsche/subscriptions", "type": "User", "url": "https://api.github.com/users/kkirsche", "user_view_type": "public" }
[]
closed
true
null
[]
null
0
2022-06-29T15:32:08Z
2023-06-30T00:03:08Z
2022-06-29T15:32:40Z
CONTRIBUTOR
resolved
Use [contextlib](https://docs.python.org/3/library/contextlib.html)'s suppress method to silence a specific error, instead of passing in an exception handler. The context manager slightly shortens the code and significantly clarifies the author's intention to ignore the specific errors. The standard library feature was introduced following a [discussion](https://bugs.python.org/issue15806), where the consensus was that > A key benefit here is in the priming effect for readers... The with statement form makes it clear before you start reading the code that certain exceptions won't propagate.
{ "avatar_url": "https://avatars.githubusercontent.com/u/947110?v=4", "events_url": "https://api.github.com/users/kkirsche/events{/privacy}", "followers_url": "https://api.github.com/users/kkirsche/followers", "following_url": "https://api.github.com/users/kkirsche/following{/other_user}", "gists_url": "https://api.github.com/users/kkirsche/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kkirsche", "id": 947110, "login": "kkirsche", "node_id": "MDQ6VXNlcjk0NzExMA==", "organizations_url": "https://api.github.com/users/kkirsche/orgs", "received_events_url": "https://api.github.com/users/kkirsche/received_events", "repos_url": "https://api.github.com/users/kkirsche/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kkirsche/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kkirsche/subscriptions", "type": "User", "url": "https://api.github.com/users/kkirsche", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/6184/reactions" }
https://api.github.com/repos/psf/requests/issues/6184/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/6184.diff", "html_url": "https://github.com/psf/requests/pull/6184", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/6184.patch", "url": "https://api.github.com/repos/psf/requests/pulls/6184" }
true
[]
https://api.github.com/repos/psf/requests/issues/6183
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6183/labels{/name}
https://api.github.com/repos/psf/requests/issues/6183/comments
https://api.github.com/repos/psf/requests/issues/6183/events
https://github.com/psf/requests/issues/6183
1,288,777,792
I_kwDOABTKOs5M0TBA
6,183
adapt `requests`' version range check to release 5.0.0 of `chardet`
{ "avatar_url": "https://avatars.githubusercontent.com/u/17925232?v=4", "events_url": "https://api.github.com/users/christian-monch/events{/privacy}", "followers_url": "https://api.github.com/users/christian-monch/followers", "following_url": "https://api.github.com/users/christian-monch/following{/other_user}", "gists_url": "https://api.github.com/users/christian-monch/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/christian-monch", "id": 17925232, "login": "christian-monch", "node_id": "MDQ6VXNlcjE3OTI1MjMy", "organizations_url": "https://api.github.com/users/christian-monch/orgs", "received_events_url": "https://api.github.com/users/christian-monch/received_events", "repos_url": "https://api.github.com/users/christian-monch/repos", "site_admin": false, "starred_url": "https://api.github.com/users/christian-monch/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/christian-monch/subscriptions", "type": "User", "url": "https://api.github.com/users/christian-monch", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2022-06-29T14:01:43Z
2023-07-02T00:03:45Z
2022-06-29T14:55:20Z
NONE
resolved
## Summary `chardet` version 5.0.0 was released on pypi on 25th of June 2022. If this version is picked up by your dependencies, `requests` version 2.28.0 will issue the following warning: ``` .../lib/python3.9/site-packages/requests/__init__.py:102: RequestsDependencyWarning: urllib3 (1.26.8) or chardet (5.0.0)/charset_normalizer (2.0.4) doesn't match a supported version!" ``` I am not sure whether version 5.0.0 of `chardet` is compatible with `requests`. According to the documentation, `requests` supports `chardet` version 4. It would be good to verify the compatibility with `chardet` version 5 and adapt the version range check accordingly ## Reproduction Steps Install the latest version of `chardet`: ```shell $ pip install --upgrade chardet ``` Import `requests` in python to trigger the warning: ```python import requests ``` ## System Information $ python -m requests.help ```json { "chardet": { "version": "5.0.0" }, "charset_normalizer": { "version": "2.0.12" }, "cryptography": { "version": "" }, "idna": { "version": "3.3" }, "implementation": { "name": "CPython", "version": "3.9.13" }, "platform": { "release": "5.3.18-150300.59.76-default", "system": "Linux" }, "pyOpenSSL": { "openssl_version": "", "version": null }, "requests": { "version": "2.27.1" }, "system_ssl": { "version": "1010104f" }, "urllib3": { "version": "1.26.9" }, "using_charset_normalizer": false, "using_pyopenssl": false } ```
{ "avatar_url": "https://avatars.githubusercontent.com/u/18519037?v=4", "events_url": "https://api.github.com/users/sethmlarson/events{/privacy}", "followers_url": "https://api.github.com/users/sethmlarson/followers", "following_url": "https://api.github.com/users/sethmlarson/following{/other_user}", "gists_url": "https://api.github.com/users/sethmlarson/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/sethmlarson", "id": 18519037, "login": "sethmlarson", "node_id": "MDQ6VXNlcjE4NTE5MDM3", "organizations_url": "https://api.github.com/users/sethmlarson/orgs", "received_events_url": "https://api.github.com/users/sethmlarson/received_events", "repos_url": "https://api.github.com/users/sethmlarson/repos", "site_admin": false, "starred_url": "https://api.github.com/users/sethmlarson/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/sethmlarson/subscriptions", "type": "User", "url": "https://api.github.com/users/sethmlarson", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/6183/reactions" }
https://api.github.com/repos/psf/requests/issues/6183/timeline
null
completed
null
null
false
[ "Closing as a duplicate of https://github.com/psf/requests/issues/6177. Please search for open and closed issues before opening a new issue.", "Thx, searched for an issue, but did not find it. Will search more intensely next time! ;-)\r\n" ]
https://api.github.com/repos/psf/requests/issues/6182
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6182/labels{/name}
https://api.github.com/repos/psf/requests/issues/6182/comments
https://api.github.com/repos/psf/requests/issues/6182/events
https://github.com/psf/requests/pull/6182
1,288,122,152
PR_kwDOABTKOs46iTiJ
6,182
v2.28.1
{ "avatar_url": "https://avatars.githubusercontent.com/u/5271761?v=4", "events_url": "https://api.github.com/users/nateprewitt/events{/privacy}", "followers_url": "https://api.github.com/users/nateprewitt/followers", "following_url": "https://api.github.com/users/nateprewitt/following{/other_user}", "gists_url": "https://api.github.com/users/nateprewitt/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/nateprewitt", "id": 5271761, "login": "nateprewitt", "node_id": "MDQ6VXNlcjUyNzE3NjE=", "organizations_url": "https://api.github.com/users/nateprewitt/orgs", "received_events_url": "https://api.github.com/users/nateprewitt/received_events", "repos_url": "https://api.github.com/users/nateprewitt/repos", "site_admin": false, "starred_url": "https://api.github.com/users/nateprewitt/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/nateprewitt/subscriptions", "type": "User", "url": "https://api.github.com/users/nateprewitt", "user_view_type": "public" }
[]
closed
true
null
[]
null
3
2022-06-29T03:22:56Z
2023-01-11T23:22:35Z
2022-06-29T15:09:12Z
MEMBER
off-topic
2.28.1 (2022-06-29) ------------------- **Improvements** - Speed optimization in `iter_content` with transition to `yield from`. (#6170) **Dependencies** - Added support for chardet 5.0.0 (#6179) - Added support for charset-normalizer 2.1.0 (#6169)
{ "avatar_url": "https://avatars.githubusercontent.com/u/5271761?v=4", "events_url": "https://api.github.com/users/nateprewitt/events{/privacy}", "followers_url": "https://api.github.com/users/nateprewitt/followers", "following_url": "https://api.github.com/users/nateprewitt/following{/other_user}", "gists_url": "https://api.github.com/users/nateprewitt/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/nateprewitt", "id": 5271761, "login": "nateprewitt", "node_id": "MDQ6VXNlcjUyNzE3NjE=", "organizations_url": "https://api.github.com/users/nateprewitt/orgs", "received_events_url": "https://api.github.com/users/nateprewitt/received_events", "repos_url": "https://api.github.com/users/nateprewitt/repos", "site_admin": false, "starred_url": "https://api.github.com/users/nateprewitt/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/nateprewitt/subscriptions", "type": "User", "url": "https://api.github.com/users/nateprewitt", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/6182/reactions" }
https://api.github.com/repos/psf/requests/issues/6182/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/6182.diff", "html_url": "https://github.com/psf/requests/pull/6182", "merged_at": "2022-06-29T15:09:12Z", "patch_url": "https://github.com/psf/requests/pull/6182.patch", "url": "https://api.github.com/repos/psf/requests/pulls/6182" }
true
[ "I'm deferring the decisions on #6159 and #6167 until we see larger data points. They have 5 and 2 user engagements respectively which seems very low for the current 2.28.x adoption rate. For the time being, there are straight forward workarounds for both.", "> I'm deferring the decisions on #6159 and #6167 until we see larger data points. They have 5 and 2 user engagements respectively which seems very low for the current 2.28.x adoption rate. For the time being, there are straight forward workarounds for both.\r\n\r\nHi, what is the workaround for #6167? I am adding \":authority\" and the request fails @nateprewitt ", "@afriedma please keep conversations constrained to relevant issues. I believe this was already [answered](https://github.com/psf/requests/issues/6167#issuecomment-1159781034) in the other issue you commented on. If you're unfamiliar with PreparedRequests, you can find them in our [documentation](https://requests.readthedocs.io/en/latest/user/advanced/#prepared-requests)." ]
https://api.github.com/repos/psf/requests/issues/6181
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6181/labels{/name}
https://api.github.com/repos/psf/requests/issues/6181/comments
https://api.github.com/repos/psf/requests/issues/6181/events
https://github.com/psf/requests/issues/6181
1,287,731,338
I_kwDOABTKOs5MwTiK
6,181
Incorrect dependency warning about chardep v5.0.0
{ "avatar_url": "https://avatars.githubusercontent.com/u/39027680?v=4", "events_url": "https://api.github.com/users/drfunjohn/events{/privacy}", "followers_url": "https://api.github.com/users/drfunjohn/followers", "following_url": "https://api.github.com/users/drfunjohn/following{/other_user}", "gists_url": "https://api.github.com/users/drfunjohn/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/drfunjohn", "id": 39027680, "login": "drfunjohn", "node_id": "MDQ6VXNlcjM5MDI3Njgw", "organizations_url": "https://api.github.com/users/drfunjohn/orgs", "received_events_url": "https://api.github.com/users/drfunjohn/received_events", "repos_url": "https://api.github.com/users/drfunjohn/repos", "site_admin": false, "starred_url": "https://api.github.com/users/drfunjohn/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/drfunjohn/subscriptions", "type": "User", "url": "https://api.github.com/users/drfunjohn", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2022-06-28T18:32:14Z
2023-06-29T00:03:31Z
2022-06-28T18:35:56Z
NONE
resolved
Warning about chardet version does not match requirements: /usr/local/lib/python3.8/site-packages/requests/__init__.py:109: RequestsDependencyWarning: urllib3 (1.26.9) or chardet (5.0.0)/charset_normalizer (2.0.12) doesn't match a supported version! warnings.warn( If install chardet==4.0.0 this warning does not appears. root@wret:/# pipdeptree -p requests requests==2.28.0 - certifi [required: >=2017.4.17, installed: 2022.6.15] - charset-normalizer [required: ~=2.0.0, installed: 2.0.12] - idna [required: >=2.5,<4, installed: 3.3] - urllib3 [required: >=1.21.1,<1.27, installed: 1.26.9] ## Expected Result No warning about dependency of chardep ## Actual Result /usr/local/lib/python3.8/site-packages/requests/__init__.py:109: RequestsDependencyWarning: urllib3 (1.26.9) or chardet (5.0.0)/charset_normalizer (2.0.12) doesn't match a supported version! warnings.warn( According pipdeptree requirements are match ## Reproduction Steps python -m requests.help ## System Information /usr/local/lib/python3.8/site-packages/requests/__init__.py:109: RequestsDependencyWarning: urllib3 (1.26.9) or chardet (5.0.0)/charset_normalizer (2.0.12) doesn't match a supported version! warnings.warn( { "chardet": { "version": "5.0.0" }, "charset_normalizer": { "version": "2.0.12" }, "cryptography": { "version": "37.0.2" }, "idna": { "version": "3.3" }, "implementation": { "name": "CPython", "version": "3.8.13" }, "platform": { "release": "5.10.104-linuxkit", "system": "Linux" }, "pyOpenSSL": { "openssl_version": "30000030", "version": "22.0.0" }, "requests": { "version": "2.28.0" }, "system_ssl": { "version": "101010ef" }, "urllib3": { "version": "1.26.9" }, "using_charset_normalizer": false, "using_pyopenssl": true } Docker image: PRETTY_NAME="Debian GNU/Linux 11 (bullseye)" NAME="Debian GNU/Linux" VERSION_ID="11" VERSION="11 (bullseye)" VERSION_CODENAME=bullseye ID=debian HOME_URL="https://www.debian.org/" SUPPORT_URL="https://www.debian.org/support" BUG_REPORT_URL="https://bugs.debian.org/"
{ "avatar_url": "https://avatars.githubusercontent.com/u/5271761?v=4", "events_url": "https://api.github.com/users/nateprewitt/events{/privacy}", "followers_url": "https://api.github.com/users/nateprewitt/followers", "following_url": "https://api.github.com/users/nateprewitt/following{/other_user}", "gists_url": "https://api.github.com/users/nateprewitt/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/nateprewitt", "id": 5271761, "login": "nateprewitt", "node_id": "MDQ6VXNlcjUyNzE3NjE=", "organizations_url": "https://api.github.com/users/nateprewitt/orgs", "received_events_url": "https://api.github.com/users/nateprewitt/received_events", "repos_url": "https://api.github.com/users/nateprewitt/repos", "site_admin": false, "starred_url": "https://api.github.com/users/nateprewitt/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/nateprewitt/subscriptions", "type": "User", "url": "https://api.github.com/users/nateprewitt", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/6181/reactions" }
https://api.github.com/repos/psf/requests/issues/6181/timeline
null
completed
null
null
false
[ "Hi @drfunjohn, please check open and closed issues before opening new ones. Dupe #6177." ]
https://api.github.com/repos/psf/requests/issues/6180
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6180/labels{/name}
https://api.github.com/repos/psf/requests/issues/6180/comments
https://api.github.com/repos/psf/requests/issues/6180/events
https://github.com/psf/requests/pull/6180
1,287,460,168
PR_kwDOABTKOs46gKXx
6,180
(Github Actions [Lint, CodeQL Analysis]) Update action versions
{ "avatar_url": "https://avatars.githubusercontent.com/u/77706434?v=4", "events_url": "https://api.github.com/users/ArjunSharda/events{/privacy}", "followers_url": "https://api.github.com/users/ArjunSharda/followers", "following_url": "https://api.github.com/users/ArjunSharda/following{/other_user}", "gists_url": "https://api.github.com/users/ArjunSharda/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/ArjunSharda", "id": 77706434, "login": "ArjunSharda", "node_id": "MDQ6VXNlcjc3NzA2NDM0", "organizations_url": "https://api.github.com/users/ArjunSharda/orgs", "received_events_url": "https://api.github.com/users/ArjunSharda/received_events", "repos_url": "https://api.github.com/users/ArjunSharda/repos", "site_admin": false, "starred_url": "https://api.github.com/users/ArjunSharda/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/ArjunSharda/subscriptions", "type": "User", "url": "https://api.github.com/users/ArjunSharda", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2022-06-28T14:43:01Z
2024-07-30T00:03:46Z
2023-07-30T01:57:46Z
NONE
resolved
Currently at the moment, Lint is behind by one version for this repository and CodeQL Analysis is behind by two versions. I've updated to the latest versions for them and have checked the repositories used in the files and have confirmed that the versions exists.
{ "avatar_url": "https://avatars.githubusercontent.com/u/5271761?v=4", "events_url": "https://api.github.com/users/nateprewitt/events{/privacy}", "followers_url": "https://api.github.com/users/nateprewitt/followers", "following_url": "https://api.github.com/users/nateprewitt/following{/other_user}", "gists_url": "https://api.github.com/users/nateprewitt/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/nateprewitt", "id": 5271761, "login": "nateprewitt", "node_id": "MDQ6VXNlcjUyNzE3NjE=", "organizations_url": "https://api.github.com/users/nateprewitt/orgs", "received_events_url": "https://api.github.com/users/nateprewitt/received_events", "repos_url": "https://api.github.com/users/nateprewitt/repos", "site_admin": false, "starred_url": "https://api.github.com/users/nateprewitt/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/nateprewitt/subscriptions", "type": "User", "url": "https://api.github.com/users/nateprewitt", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/6180/reactions" }
https://api.github.com/repos/psf/requests/issues/6180/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/6180.diff", "html_url": "https://github.com/psf/requests/pull/6180", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/6180.patch", "url": "https://api.github.com/repos/psf/requests/pulls/6180" }
true
[ "Hi @ArjunSharda,\r\n\r\nThanks for the PR. Typically, we don't accept misc infrastructure changes without notable benfits. This is to reduce PR noise and avoid incomplete updates. In the future, we'll likely constrain these files to dependabot/maintainers only.\r\n\r\nIt looks like none of the changes in setup-python or checkout are relevant to our workflows. There are some bug fixes in CodeQL that may be useful though. I've started CI and we can look at merging afterwards.", "> Hi @ArjunSharda,\r\n> \r\n> Thanks for the PR. Typically, we don't accept misc infrastructure changes without notable benfits. This is to reduce PR noise and avoid incomplete updates. In the future, we'll likely constrain these files to dependabot/maintainers only.\r\n> \r\n> It looks like none of the changes in setup-python or checkout are relevant to our workflows. There are some bug fixes in CodeQL that may be useful though. I've started CI and we can look at merging afterwards.\r\n\r\nI understand. Thank you" ]
https://api.github.com/repos/psf/requests/issues/6179
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6179/labels{/name}
https://api.github.com/repos/psf/requests/issues/6179/comments
https://api.github.com/repos/psf/requests/issues/6179/events
https://github.com/psf/requests/pull/6179
1,284,783,194
PR_kwDOABTKOs46XVub
6,179
Update Dependency with `chardet>=3.0.2,<6`
{ "avatar_url": "https://avatars.githubusercontent.com/u/780562?v=4", "events_url": "https://api.github.com/users/hswong3i/events{/privacy}", "followers_url": "https://api.github.com/users/hswong3i/followers", "following_url": "https://api.github.com/users/hswong3i/following{/other_user}", "gists_url": "https://api.github.com/users/hswong3i/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/hswong3i", "id": 780562, "login": "hswong3i", "node_id": "MDQ6VXNlcjc4MDU2Mg==", "organizations_url": "https://api.github.com/users/hswong3i/orgs", "received_events_url": "https://api.github.com/users/hswong3i/received_events", "repos_url": "https://api.github.com/users/hswong3i/repos", "site_admin": false, "starred_url": "https://api.github.com/users/hswong3i/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/hswong3i/subscriptions", "type": "User", "url": "https://api.github.com/users/hswong3i", "user_view_type": "public" }
[]
closed
true
null
[]
null
3
2022-06-26T03:02:50Z
2023-07-19T00:03:32Z
2022-06-28T02:25:59Z
CONTRIBUTOR
resolved
https://github.com/chardet/chardet/releases/tag/5.0.0 was released on 2022-06-25 with remove of Python 3.6 support, which also align with our Python > 3.6 requirement. Signed-off-by: Wong Hoi Sing Edison <[email protected]>
{ "avatar_url": "https://avatars.githubusercontent.com/u/5271761?v=4", "events_url": "https://api.github.com/users/nateprewitt/events{/privacy}", "followers_url": "https://api.github.com/users/nateprewitt/followers", "following_url": "https://api.github.com/users/nateprewitt/following{/other_user}", "gists_url": "https://api.github.com/users/nateprewitt/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/nateprewitt", "id": 5271761, "login": "nateprewitt", "node_id": "MDQ6VXNlcjUyNzE3NjE=", "organizations_url": "https://api.github.com/users/nateprewitt/orgs", "received_events_url": "https://api.github.com/users/nateprewitt/received_events", "repos_url": "https://api.github.com/users/nateprewitt/repos", "site_admin": false, "starred_url": "https://api.github.com/users/nateprewitt/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/nateprewitt/subscriptions", "type": "User", "url": "https://api.github.com/users/nateprewitt", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/6179/reactions" }
https://api.github.com/repos/psf/requests/issues/6179/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/6179.diff", "html_url": "https://github.com/psf/requests/pull/6179", "merged_at": "2022-06-28T02:25:59Z", "patch_url": "https://github.com/psf/requests/pull/6179.patch", "url": "https://api.github.com/repos/psf/requests/pulls/6179" }
true
[ "Thanks for the PR, @hswong3i. We’ll also need an update in the \\_\\_init\\_\\_.py for the version range. You can find an example [here](https://github.com/psf/requests/pull/5688/files).\r\n\r\nWe’ll also need to do some quick manual regression testing to verify there isn’t anything substantially breaking in the major version. ", "> Thanks for the PR, @hswong3i. We’ll also need an update in the __init__.py for the version range. You can find an example [here](https://github.com/psf/requests/pull/5688/files).\r\n\r\n@nateprewitt thank you for your prompt reply, and I had also discover this when running GitLab CLI.\r\n \r\n> We’ll also need to do some quick manual regression testing to verify there isn’t anything substantially breaking in the major version.\r\n\r\nAs your reference, https://github.com/python-gitlab/python-gitlab/blob/main/setup.py using request, and I got following message before apply this PR:\r\n```\r\n/usr/lib/python3/dist-packages/requests/__init__.py:109: RequestsDependencyWarning: urllib3 (1.26.9) or c\r\nhardet (5.0.0)/charset_normalizer (2.1.0) doesn't match a supported version!\r\n warnings.warn(\r\n```\r\n\r\nNow my re-packaged https://build.opensuse.org/package/show/home:alvistack/psf-requests-2.28.0 working fine with https://build.opensuse.org/package/show/home:alvistack/python-gitlab-python-gitlab-3.5.0 under Ubuntu 22.04 with Python 3.10.", "Result after running `make` and `make ci`: [report.xml.txt](https://github.com/psf/requests/files/8986052/report.xml.txt)\r\n```\r\n================================================ short test summary info =================================================\r\nFAILED tests/test_requests.py::TestTimeout::test_connect_timeout[timeout0] - Failed: The connect() request should time ...\r\nFAILED tests/test_requests.py::TestTimeout::test_connect_timeout[timeout1] - Failed: The connect() request should time ...\r\nFAILED tests/test_requests.py::TestTimeout::test_total_timeout_connect[timeout0] - requests.exceptions.ReadTimeout: HTT...\r\nFAILED tests/test_requests.py::TestTimeout::test_total_timeout_connect[timeout1] - requests.exceptions.ReadTimeout: HTT...\r\n===================== 4 failed, 575 passed, 13 skipped, 1 xfailed, 24 warnings in 172.28s (0:02:52) ======================\r\nmake: *** [Makefile:8: ci] Error 1\r\n```" ]
https://api.github.com/repos/psf/requests/issues/6178
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6178/labels{/name}
https://api.github.com/repos/psf/requests/issues/6178/comments
https://api.github.com/repos/psf/requests/issues/6178/events
https://github.com/psf/requests/issues/6178
1,284,755,036
I_kwDOABTKOs5Mk85c
6,178
very buggy chat application
{ "avatar_url": "https://avatars.githubusercontent.com/u/102113349?v=4", "events_url": "https://api.github.com/users/HiImCoder1818/events{/privacy}", "followers_url": "https://api.github.com/users/HiImCoder1818/followers", "following_url": "https://api.github.com/users/HiImCoder1818/following{/other_user}", "gists_url": "https://api.github.com/users/HiImCoder1818/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/HiImCoder1818", "id": 102113349, "login": "HiImCoder1818", "node_id": "U_kgDOBhYgRQ", "organizations_url": "https://api.github.com/users/HiImCoder1818/orgs", "received_events_url": "https://api.github.com/users/HiImCoder1818/received_events", "repos_url": "https://api.github.com/users/HiImCoder1818/repos", "site_admin": false, "starred_url": "https://api.github.com/users/HiImCoder1818/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/HiImCoder1818/subscriptions", "type": "User", "url": "https://api.github.com/users/HiImCoder1818", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2022-06-26T00:26:37Z
2023-06-27T00:03:34Z
2022-06-26T00:55:24Z
NONE
resolved
I am making a chat application and using tkinter as my gui. The chat does work, but it is very buggy and sometimes doesn't send the message or sometimes repeats the message over and over. I have reviewed the code and can't find where the error is that is causing these bugs. the code chat.py ``` from threading import Thread import time from tkinter import * import socket class ChatRoom(object): """ The GUI of the main chat room. - TK scroll bar and TK list box to display messages - antiSpam function prevents user from spamming. message cooldown 1s this is done to prevent server from breaking """ def __init__(self): self.text = "" self.text_boxY = 50 self.ip = socket.gethostbyname(socket.gethostname()) self.user = "" self.isSpamming = False self.chat = Tk() self.chat.geometry("600x700") self.scroll = Scrollbar(self.chat, width=370) self.scroll.place(x=300, y=320, anchor=CENTER, height=620) self.text_list = Listbox(self.chat, yscrollcommand=self.scroll.set, width=60) self.text_list.place(x=300, y=320, anchor=CENTER, height=620) self.chat_text = Entry(self.chat, width=40) self.chat_text.place(x=400, y=660, anchor=E) self.enter = Button(self.chat, text="enter", command=self.showText) self.enter.place(x=470, y=660, anchor=W) self.anti_spam = Thread(target=self.antiSpam) self.anti_spam.start() def start(self): self.chat.mainloop() def showText(self): """ self.ip - the private ip of the user. This is used to separate text messages self.text - the text of the user texting self.isSpamming - antispam feature to prevent server from breaking """ if not self.isSpamming: self.text = self.chat_text.get() #cannot send empty string if self.text != "": self.text_list.insert(END, f"{self.ip} - {self.text}") self.text = "" self.chat_text.delete(0, END) def antiSpam(self): """ sets self.isSpamming variable to True when message is sent cooldown 1s """ while True: if self.text == "": self.isSpamming = False else: self.isSpamming = True time.sleep(1) self.isSpamming = False def getText(self): """return text input""" return self.text def putsText(self, msg): """ add text to TK scrollbar """ self.text_list.insert(END, msg) if __name__ == '__main__': chat = ChatRoom() ``` client.py ``` import socket from threading import Thread import time import chat host = socket.gethostbyname(socket.gethostname()) port = 9000 addr = (host, port) exit_msg = "quitx" client = socket.socket(socket.AF_INET, socket.SOCK_STREAM) client.connect(addr) chat = chat.ChatRoom() def get_msg(): """ constantly checks for messages from server then puts it onto TK scroll bar """ while True: # client.recv is blocking msg = client.recv(1024).decode() chat.putsText(msg) def send_msg(): """ send message to server if chat.text is empty, do nothing if chat.text is the exit message, close the client and exit if no invalid conditions are detected, the message is sent. """ while True: if chat.text == "": pass elif chat.text == exit_msg: client.close() time.sleep(1) exit() else: client.send(chat.text.encode()) sending = Thread(target=send_msg) sending.start() get = Thread(target=get_msg) get.start() chat.start() ``` server.py ``` from threading import Thread import socket host = "0.0.0.0" port = 9000 exit_msg = "quitx" addr = (host, port) server = socket.socket(socket.AF_INET, socket.SOCK_STREAM) server.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) server.bind(addr) # all connections with the server clients = [] # listen for 3 connections only server.listen(3) def handle_clients(): """ checks for incoming connections then adds it to clients list broadcast that that client has joined with there private ip representing the user """ while True: client, addr = server.accept() clients.append(client) broadcast_msg(f"{addr[0]} has joined", client) def broadcast_msg(msg, client_sent): """ broadcast the message to all the clients msg - the message that was sent from one client client_sent - the client that sent the message this parameter is to prevent the message from the sending to the original sender """ for client in clients: if client_sent == client: pass else: # close the connection if msg equals to exit_msg (quitx) if msg == exit_msg: client.send(f"{client.getperrname()[0]} left".encode()) client.close() else: for client in clients: client.send(msg.encode()) handle = Thread(target=handle_clients) handle.daemon = True handle.start() while True: for client in clients: #client.recv is blocking. msg = client.recv(1024).decode() #when message is received, broadcast to all #clients with client as the original sender broadcast_msg(msg, client) ``` i'm using MacOS Python 3.8 conda environment (if this information helps)
{ "avatar_url": "https://avatars.githubusercontent.com/u/5271761?v=4", "events_url": "https://api.github.com/users/nateprewitt/events{/privacy}", "followers_url": "https://api.github.com/users/nateprewitt/followers", "following_url": "https://api.github.com/users/nateprewitt/following{/other_user}", "gists_url": "https://api.github.com/users/nateprewitt/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/nateprewitt", "id": 5271761, "login": "nateprewitt", "node_id": "MDQ6VXNlcjUyNzE3NjE=", "organizations_url": "https://api.github.com/users/nateprewitt/orgs", "received_events_url": "https://api.github.com/users/nateprewitt/received_events", "repos_url": "https://api.github.com/users/nateprewitt/repos", "site_admin": false, "starred_url": "https://api.github.com/users/nateprewitt/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/nateprewitt/subscriptions", "type": "User", "url": "https://api.github.com/users/nateprewitt", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/6178/reactions" }
https://api.github.com/repos/psf/requests/issues/6178/timeline
null
not_planned
null
null
false
[ "Hi @HiImCoder1818,\n\nThis issue tracker is for defects in Requests, we won't be able to help debug your code unfortunately. You can try opening a question on a platform like StackOverflow if you need further assistance." ]
https://api.github.com/repos/psf/requests/issues/6177
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6177/labels{/name}
https://api.github.com/repos/psf/requests/issues/6177/comments
https://api.github.com/repos/psf/requests/issues/6177/events
https://github.com/psf/requests/issues/6177
1,284,729,194
I_kwDOABTKOs5Mk2lq
6,177
support chardet v5.0.0
{ "avatar_url": "https://avatars.githubusercontent.com/u/13083856?v=4", "events_url": "https://api.github.com/users/copdips/events{/privacy}", "followers_url": "https://api.github.com/users/copdips/followers", "following_url": "https://api.github.com/users/copdips/following{/other_user}", "gists_url": "https://api.github.com/users/copdips/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/copdips", "id": 13083856, "login": "copdips", "node_id": "MDQ6VXNlcjEzMDgzODU2", "organizations_url": "https://api.github.com/users/copdips/orgs", "received_events_url": "https://api.github.com/users/copdips/received_events", "repos_url": "https://api.github.com/users/copdips/repos", "site_admin": false, "starred_url": "https://api.github.com/users/copdips/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/copdips/subscriptions", "type": "User", "url": "https://api.github.com/users/copdips", "user_view_type": "public" }
[]
closed
true
null
[]
null
6
2022-06-25T22:15:14Z
2023-06-30T00:03:06Z
2022-06-28T02:38:11Z
NONE
resolved
<!-- Summary. --> `chardet` just released [v5.0.0](https://github.com/chardet/chardet/releases/tag/5.0.0) which is not supported by the latest version (2.28.0) of requests: https://github.com/psf/requests/blob/da9996fe4dc63356e9467d0a5e10df3d89a8528e/requests/__init__.py#L79 Could you please add the support for the v5.0.0 of chardet ?
{ "avatar_url": "https://avatars.githubusercontent.com/u/5271761?v=4", "events_url": "https://api.github.com/users/nateprewitt/events{/privacy}", "followers_url": "https://api.github.com/users/nateprewitt/followers", "following_url": "https://api.github.com/users/nateprewitt/following{/other_user}", "gists_url": "https://api.github.com/users/nateprewitt/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/nateprewitt", "id": 5271761, "login": "nateprewitt", "node_id": "MDQ6VXNlcjUyNzE3NjE=", "organizations_url": "https://api.github.com/users/nateprewitt/orgs", "received_events_url": "https://api.github.com/users/nateprewitt/received_events", "repos_url": "https://api.github.com/users/nateprewitt/repos", "site_admin": false, "starred_url": "https://api.github.com/users/nateprewitt/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/nateprewitt/subscriptions", "type": "User", "url": "https://api.github.com/users/nateprewitt", "user_view_type": "public" }
{ "+1": 6, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 6, "url": "https://api.github.com/repos/psf/requests/issues/6177/reactions" }
https://api.github.com/repos/psf/requests/issues/6177/timeline
null
completed
null
null
false
[ "Related to this issue, I'm wondering about why `chardet` is used at all in this case. If I understand correctly, if `chardet` can be imported it is always preferred over `charset_normalizer`, even if `requests` was not installed with the `use_chardet_on_py3` extra, which could happen if another package includes it as a dependency.\r\nI understand it might not be straightforward to check whether the package was installed with the extra (perhaps through an empty meta package?), but at the least I would expect that if the version is incompatible, `charset_normalizer` is used instead. Because either this means `requests` was not installed with the extra (and chardet was not meant to be used), or there is an actual dependency conflict which could be discovered with the help of `pip check`.", "This is affecting us as well over at https://github.com/adafruit/cookiecutter-adafruit-circuitpython and possibly other projects that use requests together with some other package that installs chardet.\r\n\r\nHere's a 'reproducer' for the problem (in our case, cookiecutter depends on binaryornot depends on chardet) :\r\n```\r\n$ python3 -mvenv _env\r\n$ . _env/bin/activate\r\n$ pip install requests binaryornot\r\n$ python3 -c 'import requests'\r\n```\r\n\r\nAt the last command, this warning is produced:\r\n```\r\n/tmp/_env/lib/python3.9/site-packages/requests/__init__.py:109: RequestsDependencyWarning: urllib3 (1.26.9) or chardet (5.0.0)/charset_normalizer (2.0.12) doesn't match a supported version!\r\n warnings.warn(\r\n```\r\n\r\nWhen importing requests under pytest, it appears that the caught AssertionError and the RequestsDependencyWarning are treated as errors, as seen in this workflow excerpt:\r\n```\r\n _________________ ERROR collecting tests/test_make_cookies.py __________________\r\n../../../hostedtoolcache/Python/3.7.13/x64/lib/python3.7/site-packages/requests/__init__.py:106: in <module>\r\n urllib3.__version__, chardet_version, charset_normalizer_version\r\n../../../hostedtoolcache/Python/3.7.13/x64/lib/python3.7/site-packages/requests/__init__.py:79: in check_compatibility\r\n assert (3, 0, 2) <= (major, minor, patch) < (5, 0, 0)\r\nE AssertionError\r\nDuring handling of the above exception, another exception occurred:\r\ntests/test_make_cookies.py:11: in <module>\r\n from cookiecutter.main import cookiecutter\r\n../../../hostedtoolcache/Python/3.7.13/x64/lib/python3.7/site-packages/cookiecutter/main.py:17: in <module>\r\n from cookiecutter.repository import determine_repo_dir\r\n../../../hostedtoolcache/Python/3.7.13/x64/lib/python3.7/site-packages/cookiecutter/repository.py:7: in <module>\r\n from cookiecutter.zipfile import unzip\r\n../../../hostedtoolcache/Python/3.7.13/x64/lib/python3.7/site-packages/cookiecutter/zipfile.py:6: in <module>\r\n import requests\r\n../../../hostedtoolcache/Python/3.7.13/x64/lib/python3.7/site-packages/requests/__init__.py:114: in <module>\r\n RequestsDependencyWarning,\r\nE requests.exceptions.RequestsDependencyWarning: urllib3 (1.26.9) or chardet (5.0.0)/charset_normalizer (2.0.12) doesn't match a supported version!\r\n=========================== short test summary info ============================\r\nERROR tests/test_make_cookies.py - requests.exceptions.RequestsDependencyWarn...\r\n!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!\r\n=============================== 1 error in 0.60s ===============================\r\nError: Process completed with exit code 2.\r\n```\r\n.. this makes our CI process fail.", "We've merged #6179 which should address this. We could potentially remove the chardet check now that it's not the primary character detector but we're introducing some risk. Chardet major versions _maybe_ every 2 years, sometimes longer. If users are co-installing chardet from somewhere else, Requests currently uses it, so we should continue to be clear if there's an incompatible version being used.\r\n\r\nThere's been discussion of removing chardet entirely in previous issues (#5871) which will likely happen eventually, but I don't foresee us changing that in the immediate future. I believe our current change should mitigate issues for the immediate future though. The fix will be available in the next patch release 2.28.1. ", "What about the suggestion to use `charset_normalizer` if `chardet` is installed but has an incompatible version?", "> What about the suggestion to use charset_normalizer if chardet is installed but has an incompatible version?\r\n\r\nWhile this avoids a warning every couple years, it introduces subtle failure modes. When a new major version is released and a user unintentionally installs it, they've potentially disabled an opt-in they made previously. This results in impact on their system(s) they weren't intending and we get a long list of issues. Being explicit is what we've found to be the _least_ problematic over the lifetime of the library.", "I see, thanks for the detailed response. Making it even more explicit by detecting whether the extra was actually selected (making it opt-in only) would probably be the best of both worlds, but if there's talk of removing chardet entirely at some point I guess there's no sufficient incentive to put in that effort." ]
https://api.github.com/repos/psf/requests/issues/6176
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6176/labels{/name}
https://api.github.com/repos/psf/requests/issues/6176/comments
https://api.github.com/repos/psf/requests/issues/6176/events
https://github.com/psf/requests/issues/6176
1,284,524,026
I_kwDOABTKOs5MkEf6
6,176
[Debian Bullseye 11] Get calls take almost 3 minutes on some websites
{ "avatar_url": "https://avatars.githubusercontent.com/u/1296250?v=4", "events_url": "https://api.github.com/users/willbprog127/events{/privacy}", "followers_url": "https://api.github.com/users/willbprog127/followers", "following_url": "https://api.github.com/users/willbprog127/following{/other_user}", "gists_url": "https://api.github.com/users/willbprog127/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/willbprog127", "id": 1296250, "login": "willbprog127", "node_id": "MDQ6VXNlcjEyOTYyNTA=", "organizations_url": "https://api.github.com/users/willbprog127/orgs", "received_events_url": "https://api.github.com/users/willbprog127/received_events", "repos_url": "https://api.github.com/users/willbprog127/repos", "site_admin": false, "starred_url": "https://api.github.com/users/willbprog127/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/willbprog127/subscriptions", "type": "User", "url": "https://api.github.com/users/willbprog127", "user_view_type": "public" }
[]
closed
true
null
[]
null
4
2022-06-25T09:23:55Z
2023-06-28T00:03:34Z
2022-06-27T16:11:11Z
NONE
resolved
On Debian Linux Bullseye 11 AMD64, Requests.get() calls take almost 3 minutes on some websites. I tried several websites, but these two are good contrasts: `r = requests.get("https://www.pismotek.com")` `r = requests.get("https://www.github.com")` ## Expected Result When doing a `requests.get()` call, I expect that it should take one or two seconds for the call to complete if the website I'm trying to contact is reasonably responsive. ## Actual Result Some websites cause `requests.get()` to take almost three minutes to complete. ## Reproduction Steps This call causes a near three-minute wait until completion, and the website IS responsive and working well using other OSs: ```python import requests r = requests.get("https://www.pismotek.com") ``` I tried with `https://www.microsoft.com`, `https://www.youtube` as well as `https://www.apple.com` and they took a long time too. This call only takes about one second: ```python import requests r = requests.get("https://www.github.com") ``` ## System Information $ python -m requests.help ```json { "chardet": { "version": "4.0.0" }, "cryptography": { "version": "" }, "idna": { "version": "2.10" }, "implementation": { "name": "CPython", "version": "3.9.2" }, "platform": { "release": "5.10.0-15-amd64", "system": "Linux" }, "pyOpenSSL": { "openssl_version": "", "version": null }, "requests": { "version": "2.25.1" }, "system_ssl": { "version": "101010ef" }, "urllib3": { "version": "1.26.5" }, "using_pyopenssl": false } ``` * Debian Bullseye 11 Linux - AMD 64 * Python 3.9.2 (default, Feb 28 2021, 17:03:44) [GCC 10.2.1 20210110] on linux ### Wireshark pcapng files: I did the best I could to filter out non-relevant data, but some could be there... [requests-fail-pismotek-com.pcapng.tar.gz](https://github.com/psf/requests/files/8984259/requests-fail-pismotek-com.pcapng.tar.gz) [requests-okay-github-com.pcapng.tar.gz](https://github.com/psf/requests/files/8984260/requests-okay-github-com.pcapng.tar.gz) Thanks! :+1:
{ "avatar_url": "https://avatars.githubusercontent.com/u/1296250?v=4", "events_url": "https://api.github.com/users/willbprog127/events{/privacy}", "followers_url": "https://api.github.com/users/willbprog127/followers", "following_url": "https://api.github.com/users/willbprog127/following{/other_user}", "gists_url": "https://api.github.com/users/willbprog127/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/willbprog127", "id": 1296250, "login": "willbprog127", "node_id": "MDQ6VXNlcjEyOTYyNTA=", "organizations_url": "https://api.github.com/users/willbprog127/orgs", "received_events_url": "https://api.github.com/users/willbprog127/received_events", "repos_url": "https://api.github.com/users/willbprog127/repos", "site_admin": false, "starred_url": "https://api.github.com/users/willbprog127/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/willbprog127/subscriptions", "type": "User", "url": "https://api.github.com/users/willbprog127", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/6176/reactions" }
https://api.github.com/repos/psf/requests/issues/6176/timeline
null
completed
null
null
false
[ "Hello Will!\r\n\r\nIf you are having a interceptor running in the background (Such as WireShark or Fiddler etc) you will have to do:\r\n\r\n```python\r\nimport requests\r\n\r\nr = requests.get(\"https://www.pismotek.com\", verify=False)\r\n```\r\n\r\nor alternatively, try adding a timeout\r\n\r\n```python\r\nimport requests\r\n\r\nr = requests.get(\"https://www.pismotek.com\", timeout=5)\r\n```\r\n\r\nfinally if the solutions above do not work please do this for me:\r\n\r\nfirst just curl the url and see if the request goes through or takes a while like in Python, if it does go through fine then check if you have iPv6 enabled on your machine.\r\n\r\nTell me how it goes!", "@lovecoding32 Thanks for the reply.\r\n\r\n> If you are having a interceptor running in the background (Such as WireShark or Fiddler etc) you will have to do\r\n\r\nI don't usually have an interceptor or capture running, it was only for the benefit of reporting this issue\r\n\r\n> first just curl the url and see if the request goes through or takes a while like in Python, if it does go through fine then check if you have iPv6 enabled on your machine.\r\n\r\ncurl works fine on both example websites mentioned in the issue. Also, yes, IPv6 is enabled on the local network and internet connection.\r\n\r\nTrying with `verify=False` works near-instantaneously, but I do get this warning repeatedly. I don't know why it warns as the pismotek.com certificate is perfectly valid:\r\n```\r\n/usr/lib/python3/dist-packages/urllib3/connectionpool.py:1015: InsecureRequestWarning: Unverified HTTPS request is being made to host 'www.pismotek.com'. Adding certificate verification is strongly advised.\r\n```\r\n\r\nThank you! :smile: ", "It is because verify=False tells to skip SSL check on pismotek, however it is not recommended to use it this way unless you are sure that there is no malicious content on the site.\r\n\r\nHowever, have you installed the security package for requests?\r\n\r\n`pip3 install -U requests[security]`\r\n\r\ntry that then remove verify=False in your code.\r\n\r\nCheers.", "Hi again @lovecoding32 ,\r\n\r\nBased on your suggestion, I tried installing `python3-openssl` which then allowed me to remove the `verify=False` and now no more three-minute delays. \r\n\r\nI wish Debian had set this as a requirement along with `python3-requests` so other Debian users wouldn't run into this issue. I will close this now.\r\n\r\n@lovecoding32 , thanks so much for your help! :+1: " ]
https://api.github.com/repos/psf/requests/issues/6175
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6175/labels{/name}
https://api.github.com/repos/psf/requests/issues/6175/comments
https://api.github.com/repos/psf/requests/issues/6175/events
https://github.com/psf/requests/pull/6175
1,283,199,804
PR_kwDOABTKOs46SLpJ
6,175
Update Dependency with `charset_normalizer>=2.0.0`
{ "avatar_url": "https://avatars.githubusercontent.com/u/780562?v=4", "events_url": "https://api.github.com/users/hswong3i/events{/privacy}", "followers_url": "https://api.github.com/users/hswong3i/followers", "following_url": "https://api.github.com/users/hswong3i/following{/other_user}", "gists_url": "https://api.github.com/users/hswong3i/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/hswong3i", "id": 780562, "login": "hswong3i", "node_id": "MDQ6VXNlcjc4MDU2Mg==", "organizations_url": "https://api.github.com/users/hswong3i/orgs", "received_events_url": "https://api.github.com/users/hswong3i/received_events", "repos_url": "https://api.github.com/users/hswong3i/repos", "site_admin": false, "starred_url": "https://api.github.com/users/hswong3i/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/hswong3i/subscriptions", "type": "User", "url": "https://api.github.com/users/hswong3i", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2022-06-24T03:03:10Z
2023-06-27T00:03:34Z
2022-06-24T03:11:41Z
CONTRIBUTOR
resolved
https://github.com/Ousret/charset_normalizer/releases/tag/2.1.0 was released on 2022-06-20, with our current dependency with `charset_normalizer~=2.0.0` we couldn't upgrade to 2.1.0 accordingly. Signed-off-by: Wong Hoi Sing Edison <[email protected]>
{ "avatar_url": "https://avatars.githubusercontent.com/u/5271761?v=4", "events_url": "https://api.github.com/users/nateprewitt/events{/privacy}", "followers_url": "https://api.github.com/users/nateprewitt/followers", "following_url": "https://api.github.com/users/nateprewitt/following{/other_user}", "gists_url": "https://api.github.com/users/nateprewitt/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/nateprewitt", "id": 5271761, "login": "nateprewitt", "node_id": "MDQ6VXNlcjUyNzE3NjE=", "organizations_url": "https://api.github.com/users/nateprewitt/orgs", "received_events_url": "https://api.github.com/users/nateprewitt/received_events", "repos_url": "https://api.github.com/users/nateprewitt/repos", "site_admin": false, "starred_url": "https://api.github.com/users/nateprewitt/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/nateprewitt/subscriptions", "type": "User", "url": "https://api.github.com/users/nateprewitt", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/6175/reactions" }
https://api.github.com/repos/psf/requests/issues/6175/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/6175.diff", "html_url": "https://github.com/psf/requests/pull/6175", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/6175.patch", "url": "https://api.github.com/repos/psf/requests/pulls/6175" }
true
[ "Thanks for the PR, @hswong3i. Unfortunately this is a duplicate of #6169.", "@nateprewitt thank you for clarify and sorry for my miss. Looking forward for upstream solution get merged.\r\n\r\nIn between I give a quick dirty workaround for my packaging scripts, and it is now working with CentOS 8 + molecule 4.0.0 + charset_normalizer 2.1.0 + requests 2.28.0 (patched):\r\n* https://github.com/alvistack/psf-requests/commit/4910bb75c0122efd77e11274de2793c95e2f630b\r\n* https://build.opensuse.org/package/show/home:alvistack/psf-requests-2.28.0" ]
https://api.github.com/repos/psf/requests/issues/6174
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6174/labels{/name}
https://api.github.com/repos/psf/requests/issues/6174/comments
https://api.github.com/repos/psf/requests/issues/6174/events
https://github.com/psf/requests/issues/6174
1,280,937,580
I_kwDOABTKOs5MWY5s
6,174
python -m pip install requests==2.27.1 instead installs everything in requirements.txt besides requests.
{ "avatar_url": "https://avatars.githubusercontent.com/u/85408331?v=4", "events_url": "https://api.github.com/users/necrochancer/events{/privacy}", "followers_url": "https://api.github.com/users/necrochancer/followers", "following_url": "https://api.github.com/users/necrochancer/following{/other_user}", "gists_url": "https://api.github.com/users/necrochancer/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/necrochancer", "id": 85408331, "login": "necrochancer", "node_id": "MDQ6VXNlcjg1NDA4MzMx", "organizations_url": "https://api.github.com/users/necrochancer/orgs", "received_events_url": "https://api.github.com/users/necrochancer/received_events", "repos_url": "https://api.github.com/users/necrochancer/repos", "site_admin": false, "starred_url": "https://api.github.com/users/necrochancer/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/necrochancer/subscriptions", "type": "User", "url": "https://api.github.com/users/necrochancer", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2022-06-22T21:22:49Z
2023-06-23T00:03:31Z
2022-06-22T23:17:35Z
NONE
resolved
python -m pip install requests==2.27.1 maybe python is thinking its installing the requested stuff? please help.
{ "avatar_url": "https://avatars.githubusercontent.com/u/240830?v=4", "events_url": "https://api.github.com/users/sigmavirus24/events{/privacy}", "followers_url": "https://api.github.com/users/sigmavirus24/followers", "following_url": "https://api.github.com/users/sigmavirus24/following{/other_user}", "gists_url": "https://api.github.com/users/sigmavirus24/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/sigmavirus24", "id": 240830, "login": "sigmavirus24", "node_id": "MDQ6VXNlcjI0MDgzMA==", "organizations_url": "https://api.github.com/users/sigmavirus24/orgs", "received_events_url": "https://api.github.com/users/sigmavirus24/received_events", "repos_url": "https://api.github.com/users/sigmavirus24/repos", "site_admin": false, "starred_url": "https://api.github.com/users/sigmavirus24/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/sigmavirus24/subscriptions", "type": "User", "url": "https://api.github.com/users/sigmavirus24", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/6174/reactions" }
https://api.github.com/repos/psf/requests/issues/6174/timeline
null
completed
null
null
false
[ "Hi there! Thanks for opening this issue. Unfortunately, it seems this is a request for help instead of a report of a defect in the project. Please use [StackOverflow](https://stackoverflow.com) for general usage questions instead and only report defects here.\n\nWe aren't responsible for the behavior of pip" ]
https://api.github.com/repos/psf/requests/issues/6173
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6173/labels{/name}
https://api.github.com/repos/psf/requests/issues/6173/comments
https://api.github.com/repos/psf/requests/issues/6173/events
https://github.com/psf/requests/issues/6173
1,280,400,489
I_kwDOABTKOs5MUVxp
6,173
How can I use :authority in requests module
{ "avatar_url": "https://avatars.githubusercontent.com/u/67215274?v=4", "events_url": "https://api.github.com/users/abirabedinkhan/events{/privacy}", "followers_url": "https://api.github.com/users/abirabedinkhan/followers", "following_url": "https://api.github.com/users/abirabedinkhan/following{/other_user}", "gists_url": "https://api.github.com/users/abirabedinkhan/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/abirabedinkhan", "id": 67215274, "login": "abirabedinkhan", "node_id": "MDQ6VXNlcjY3MjE1Mjc0", "organizations_url": "https://api.github.com/users/abirabedinkhan/orgs", "received_events_url": "https://api.github.com/users/abirabedinkhan/received_events", "repos_url": "https://api.github.com/users/abirabedinkhan/repos", "site_admin": false, "starred_url": "https://api.github.com/users/abirabedinkhan/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/abirabedinkhan/subscriptions", "type": "User", "url": "https://api.github.com/users/abirabedinkhan", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2022-06-22T15:44:33Z
2023-06-23T00:03:31Z
2022-06-22T16:30:13Z
NONE
resolved
Hello, I am working on project that requires :authority header. When I put that it throws errors!!! Please HELP ME!!!!!!
{ "avatar_url": "https://avatars.githubusercontent.com/u/5271761?v=4", "events_url": "https://api.github.com/users/nateprewitt/events{/privacy}", "followers_url": "https://api.github.com/users/nateprewitt/followers", "following_url": "https://api.github.com/users/nateprewitt/following{/other_user}", "gists_url": "https://api.github.com/users/nateprewitt/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/nateprewitt", "id": 5271761, "login": "nateprewitt", "node_id": "MDQ6VXNlcjUyNzE3NjE=", "organizations_url": "https://api.github.com/users/nateprewitt/orgs", "received_events_url": "https://api.github.com/users/nateprewitt/received_events", "repos_url": "https://api.github.com/users/nateprewitt/repos", "site_admin": false, "starred_url": "https://api.github.com/users/nateprewitt/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/nateprewitt/subscriptions", "type": "User", "url": "https://api.github.com/users/nateprewitt", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/6173/reactions" }
https://api.github.com/repos/psf/requests/issues/6173/timeline
null
completed
null
null
false
[ "Hi @abirabedinkhan, this is a duplicate of #6167. Please check open and closed issues before opening new ones." ]
https://api.github.com/repos/psf/requests/issues/6172
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6172/labels{/name}
https://api.github.com/repos/psf/requests/issues/6172/comments
https://api.github.com/repos/psf/requests/issues/6172/events
https://github.com/psf/requests/pull/6172
1,278,928,229
PR_kwDOABTKOs46DhIL
6,172
Clarify setting proxies exceptions
{ "avatar_url": "https://avatars.githubusercontent.com/u/1461970?v=4", "events_url": "https://api.github.com/users/RichieB2B/events{/privacy}", "followers_url": "https://api.github.com/users/RichieB2B/followers", "following_url": "https://api.github.com/users/RichieB2B/following{/other_user}", "gists_url": "https://api.github.com/users/RichieB2B/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/RichieB2B", "id": 1461970, "login": "RichieB2B", "node_id": "MDQ6VXNlcjE0NjE5NzA=", "organizations_url": "https://api.github.com/users/RichieB2B/orgs", "received_events_url": "https://api.github.com/users/RichieB2B/received_events", "repos_url": "https://api.github.com/users/RichieB2B/repos", "site_admin": false, "starred_url": "https://api.github.com/users/RichieB2B/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/RichieB2B/subscriptions", "type": "User", "url": "https://api.github.com/users/RichieB2B", "user_view_type": "public" }
[]
open
false
null
[]
null
2
2022-06-21T19:12:01Z
2024-10-25T16:49:28Z
null
CONTRIBUTOR
null
This adds an example for the `NO_PROXY` environment variable and explains making exceptions to the proxy settings using per-host proxy entries.
null
{ "+1": 1, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 1, "url": "https://api.github.com/repos/psf/requests/issues/6172/reactions" }
https://api.github.com/repos/psf/requests/issues/6172/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/6172.diff", "html_url": "https://github.com/psf/requests/pull/6172", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/6172.patch", "url": "https://api.github.com/repos/psf/requests/pulls/6172" }
true
[ "@nateprewitt Can this be merged please? This still [confuses](https://github.com/psf/requests/pull/5596#issuecomment-1403476580) many people.", "Bumping this.\r\nI spent several days trying to sort out why a no_proxy setting wasn't working in a python system, and would have really loved to have this clarification in the docs." ]
https://api.github.com/repos/psf/requests/issues/6171
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6171/labels{/name}
https://api.github.com/repos/psf/requests/issues/6171/comments
https://api.github.com/repos/psf/requests/issues/6171/events
https://github.com/psf/requests/pull/6171
1,277,912,127
PR_kwDOABTKOs46AISb
6,171
Issue-6118: Prevent input argument mutation
{ "avatar_url": "https://avatars.githubusercontent.com/u/68326606?v=4", "events_url": "https://api.github.com/users/venkat2150/events{/privacy}", "followers_url": "https://api.github.com/users/venkat2150/followers", "following_url": "https://api.github.com/users/venkat2150/following{/other_user}", "gists_url": "https://api.github.com/users/venkat2150/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/venkat2150", "id": 68326606, "login": "venkat2150", "node_id": "MDQ6VXNlcjY4MzI2NjA2", "organizations_url": "https://api.github.com/users/venkat2150/orgs", "received_events_url": "https://api.github.com/users/venkat2150/received_events", "repos_url": "https://api.github.com/users/venkat2150/repos", "site_admin": false, "starred_url": "https://api.github.com/users/venkat2150/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/venkat2150/subscriptions", "type": "User", "url": "https://api.github.com/users/venkat2150", "user_view_type": "public" }
[]
closed
true
null
[]
null
0
2022-06-21T05:28:20Z
2023-06-22T00:03:11Z
2022-06-21T06:00:17Z
NONE
resolved
Input argument (proxy) is getting mutated and populated with OS's environment proxy variables when sending requests. Took care of other input args along with proxy, just to be safe.
{ "avatar_url": "https://avatars.githubusercontent.com/u/68326606?v=4", "events_url": "https://api.github.com/users/venkat2150/events{/privacy}", "followers_url": "https://api.github.com/users/venkat2150/followers", "following_url": "https://api.github.com/users/venkat2150/following{/other_user}", "gists_url": "https://api.github.com/users/venkat2150/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/venkat2150", "id": 68326606, "login": "venkat2150", "node_id": "MDQ6VXNlcjY4MzI2NjA2", "organizations_url": "https://api.github.com/users/venkat2150/orgs", "received_events_url": "https://api.github.com/users/venkat2150/received_events", "repos_url": "https://api.github.com/users/venkat2150/repos", "site_admin": false, "starred_url": "https://api.github.com/users/venkat2150/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/venkat2150/subscriptions", "type": "User", "url": "https://api.github.com/users/venkat2150", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/6171/reactions" }
https://api.github.com/repos/psf/requests/issues/6171/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/6171.diff", "html_url": "https://github.com/psf/requests/pull/6171", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/6171.patch", "url": "https://api.github.com/repos/psf/requests/pulls/6171" }
true
[]
https://api.github.com/repos/psf/requests/issues/6170
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6170/labels{/name}
https://api.github.com/repos/psf/requests/issues/6170/comments
https://api.github.com/repos/psf/requests/issues/6170/events
https://github.com/psf/requests/pull/6170
1,276,893,423
PR_kwDOABTKOs458pzV
6,170
Use yield from instead of looping yield
{ "avatar_url": "https://avatars.githubusercontent.com/u/947110?v=4", "events_url": "https://api.github.com/users/kkirsche/events{/privacy}", "followers_url": "https://api.github.com/users/kkirsche/followers", "following_url": "https://api.github.com/users/kkirsche/following{/other_user}", "gists_url": "https://api.github.com/users/kkirsche/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kkirsche", "id": 947110, "login": "kkirsche", "node_id": "MDQ6VXNlcjk0NzExMA==", "organizations_url": "https://api.github.com/users/kkirsche/orgs", "received_events_url": "https://api.github.com/users/kkirsche/received_events", "repos_url": "https://api.github.com/users/kkirsche/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kkirsche/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kkirsche/subscriptions", "type": "User", "url": "https://api.github.com/users/kkirsche", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2022-06-20T13:01:10Z
2023-06-30T00:03:08Z
2022-06-29T02:08:26Z
CONTRIBUTOR
resolved
This merge request updates the stream yield functionality to use `yield from` instead of `yield` within a for loop. Because this is yielding from an iterable, we can use `yield from` which is not only slightly shorter but also on average 15% more performant than using `yield` inside of a loop. This is a result of some of the optimizations included as part of [PEP 380](https://peps.python.org/pep-0380/)
{ "avatar_url": "https://avatars.githubusercontent.com/u/5271761?v=4", "events_url": "https://api.github.com/users/nateprewitt/events{/privacy}", "followers_url": "https://api.github.com/users/nateprewitt/followers", "following_url": "https://api.github.com/users/nateprewitt/following{/other_user}", "gists_url": "https://api.github.com/users/nateprewitt/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/nateprewitt", "id": 5271761, "login": "nateprewitt", "node_id": "MDQ6VXNlcjUyNzE3NjE=", "organizations_url": "https://api.github.com/users/nateprewitt/orgs", "received_events_url": "https://api.github.com/users/nateprewitt/received_events", "repos_url": "https://api.github.com/users/nateprewitt/repos", "site_admin": false, "starred_url": "https://api.github.com/users/nateprewitt/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/nateprewitt/subscriptions", "type": "User", "url": "https://api.github.com/users/nateprewitt", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/6170/reactions" }
https://api.github.com/repos/psf/requests/issues/6170/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/6170.diff", "html_url": "https://github.com/psf/requests/pull/6170", "merged_at": "2022-06-29T02:08:26Z", "patch_url": "https://github.com/psf/requests/pull/6170.patch", "url": "https://api.github.com/repos/psf/requests/pulls/6170" }
true
[ "Yep, part of splitting up https://github.com/psf/requests/pull/6165 to get past that...feedback" ]
https://api.github.com/repos/psf/requests/issues/6169
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6169/labels{/name}
https://api.github.com/repos/psf/requests/issues/6169/comments
https://api.github.com/repos/psf/requests/issues/6169/events
https://github.com/psf/requests/pull/6169
1,276,503,543
PR_kwDOABTKOs457WOD
6,169
Allow charset normalizer >=2 and <3
{ "avatar_url": "https://avatars.githubusercontent.com/u/5688939?v=4", "events_url": "https://api.github.com/users/frenzymadness/events{/privacy}", "followers_url": "https://api.github.com/users/frenzymadness/followers", "following_url": "https://api.github.com/users/frenzymadness/following{/other_user}", "gists_url": "https://api.github.com/users/frenzymadness/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/frenzymadness", "id": 5688939, "login": "frenzymadness", "node_id": "MDQ6VXNlcjU2ODg5Mzk=", "organizations_url": "https://api.github.com/users/frenzymadness/orgs", "received_events_url": "https://api.github.com/users/frenzymadness/received_events", "repos_url": "https://api.github.com/users/frenzymadness/repos", "site_admin": false, "starred_url": "https://api.github.com/users/frenzymadness/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/frenzymadness/subscriptions", "type": "User", "url": "https://api.github.com/users/frenzymadness", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2022-06-20T07:39:37Z
2023-06-30T00:03:09Z
2022-06-29T02:01:43Z
CONTRIBUTOR
resolved
The current definition `charset_normalizer~=2.0.0` does not allow charset-normalizer 2.1.0 which has been released a couple of hours ago. The newer version seems to be compatible with requests and [the compatibility check](https://github.com/psf/requests/blob/da9996fe4dc63356e9467d0a5e10df3d89a8528e/requests/__init__.py#L80-L84) suggests that requests should allow versions up to 3.0.
{ "avatar_url": "https://avatars.githubusercontent.com/u/5271761?v=4", "events_url": "https://api.github.com/users/nateprewitt/events{/privacy}", "followers_url": "https://api.github.com/users/nateprewitt/followers", "following_url": "https://api.github.com/users/nateprewitt/following{/other_user}", "gists_url": "https://api.github.com/users/nateprewitt/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/nateprewitt", "id": 5271761, "login": "nateprewitt", "node_id": "MDQ6VXNlcjUyNzE3NjE=", "organizations_url": "https://api.github.com/users/nateprewitt/orgs", "received_events_url": "https://api.github.com/users/nateprewitt/received_events", "repos_url": "https://api.github.com/users/nateprewitt/repos", "site_admin": false, "starred_url": "https://api.github.com/users/nateprewitt/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/nateprewitt/subscriptions", "type": "User", "url": "https://api.github.com/users/nateprewitt", "user_view_type": "public" }
{ "+1": 15, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 15, "url": "https://api.github.com/repos/psf/requests/issues/6169/reactions" }
https://api.github.com/repos/psf/requests/issues/6169/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/6169.diff", "html_url": "https://github.com/psf/requests/pull/6169", "merged_at": "2022-06-29T02:01:43Z", "patch_url": "https://github.com/psf/requests/pull/6169.patch", "url": "https://api.github.com/repos/psf/requests/pulls/6169" }
true
[ "All tox environments passed locally.", "Similar and duplicated fix from https://github.com/psf/requests/pull/6175#issuecomment-1165150374:\r\n\r\n> In between I give a quick dirty workaround for my packaging scripts, and it is now working with CentOS 8 + molecule 4.0.0 + charset_normalizer 2.1.0 + requests 2.28.0 (patched):\r\n> * https://github.com/alvistack/psf-requests/commit/4910bb75c0122efd77e11274de2793c95e2f630b\r\n> * https://build.opensuse.org/package/show/home:alvistack/psf-requests-2.28.0" ]
https://api.github.com/repos/psf/requests/issues/6168
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6168/labels{/name}
https://api.github.com/repos/psf/requests/issues/6168/comments
https://api.github.com/repos/psf/requests/issues/6168/events
https://github.com/psf/requests/issues/6168
1,276,035,031
I_kwDOABTKOs5MDr_X
6,168
redirect https://requests.readthedocs.io/en/master to https://requests.readthedocs.io/en/latest
{ "avatar_url": "https://avatars.githubusercontent.com/u/413772?v=4", "events_url": "https://api.github.com/users/graingert/events{/privacy}", "followers_url": "https://api.github.com/users/graingert/followers", "following_url": "https://api.github.com/users/graingert/following{/other_user}", "gists_url": "https://api.github.com/users/graingert/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/graingert", "id": 413772, "login": "graingert", "node_id": "MDQ6VXNlcjQxMzc3Mg==", "organizations_url": "https://api.github.com/users/graingert/orgs", "received_events_url": "https://api.github.com/users/graingert/received_events", "repos_url": "https://api.github.com/users/graingert/repos", "site_admin": false, "starred_url": "https://api.github.com/users/graingert/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/graingert/subscriptions", "type": "User", "url": "https://api.github.com/users/graingert", "user_view_type": "public" }
[]
closed
true
null
[]
null
5
2022-06-19T11:43:08Z
2023-06-25T00:03:43Z
2022-06-24T20:00:40Z
CONTRIBUTOR
resolved
the old https://requests.readthedocs.io/en/master page links to an old v2.26.0 with broken algolia search https://github.com/psf/requests/issues/5254 https://github.com/psf/requests/issues/6142 and is linked to by search engines and other documentation https://www.google.com/search?q=requests+readthedocs https://developer-portal.driver-vehicle-licensing.api.gov.uk/apis/vehicle-enquiry-service/code-examples.html#python-using-requests https://github.com/search?q=requests.readthedocs.io%2Fen%2Fmaster&type=code
{ "avatar_url": "https://avatars.githubusercontent.com/u/5271761?v=4", "events_url": "https://api.github.com/users/nateprewitt/events{/privacy}", "followers_url": "https://api.github.com/users/nateprewitt/followers", "following_url": "https://api.github.com/users/nateprewitt/following{/other_user}", "gists_url": "https://api.github.com/users/nateprewitt/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/nateprewitt", "id": 5271761, "login": "nateprewitt", "node_id": "MDQ6VXNlcjUyNzE3NjE=", "organizations_url": "https://api.github.com/users/nateprewitt/orgs", "received_events_url": "https://api.github.com/users/nateprewitt/received_events", "repos_url": "https://api.github.com/users/nateprewitt/repos", "site_admin": false, "starred_url": "https://api.github.com/users/nateprewitt/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/nateprewitt/subscriptions", "type": "User", "url": "https://api.github.com/users/nateprewitt", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/6168/reactions" }
https://api.github.com/repos/psf/requests/issues/6168/timeline
null
completed
null
null
false
[ "Thanks for letting us know, @graingert. I've tried a few things with prefix redirects but they don't work as one might expect. I found a pattern for exact redirects that appears to have most URLs migrated to /en/latest. The base url without a trailing slash (https://requests.readthedocs.io/en/master) doesn't appear to work with any combination though. If anyone has ideas, I'm willing to try them.\r\n\r\nGiven almost all relevant URLs appear to be forwarding correctly now, I'll resolve this.", "The first hit on Google redirects here https://readthedocs.org/projects/requests/ which doesn't seem right", "@dvla can you update your links?", "> The first hit on Google redirects here https://readthedocs.org/projects/requests/ which doesn't seem right\r\n\r\nHmm, this may be personalized based on geolocation or account. I'm seeing https://requests.readthedocs.io/en/latest/ as the first link on Google. I'm not sure what our options are to affect SEO on ranking though. If you have ideas, I'm happy to give them a try.\r\n\r\nEdit: I'm also seeing the https://developer-portal.driver-vehicle-licensing.api.gov.uk/apis/vehicle-enquiry-service/code-examples.html#python-using-requests links working correctly. Is that not what you're seeing?", "Yeah it's much much better than it was, thanks for fixing this!\r\n\r\nHopefully the SEO link juice will percolate through soon" ]
https://api.github.com/repos/psf/requests/issues/6167
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6167/labels{/name}
https://api.github.com/repos/psf/requests/issues/6167/comments
https://api.github.com/repos/psf/requests/issues/6167/events
https://github.com/psf/requests/issues/6167
1,276,016,823
I_kwDOABTKOs5MDni3
6,167
InvalidHeader exception when trying to add a ":method" header field (breaking change in 2.28.0)
{ "avatar_url": "https://avatars.githubusercontent.com/u/107793741?v=4", "events_url": "https://api.github.com/users/Alex8768765/events{/privacy}", "followers_url": "https://api.github.com/users/Alex8768765/followers", "following_url": "https://api.github.com/users/Alex8768765/following{/other_user}", "gists_url": "https://api.github.com/users/Alex8768765/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Alex8768765", "id": 107793741, "login": "Alex8768765", "node_id": "U_kgDOBmzNTQ", "organizations_url": "https://api.github.com/users/Alex8768765/orgs", "received_events_url": "https://api.github.com/users/Alex8768765/received_events", "repos_url": "https://api.github.com/users/Alex8768765/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Alex8768765/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Alex8768765/subscriptions", "type": "User", "url": "https://api.github.com/users/Alex8768765", "user_view_type": "public" }
[]
open
false
null
[]
null
16
2022-06-19T10:26:03Z
2024-04-11T14:07:41Z
null
NONE
null
My app is making a POST request enforcing some specific header fields. Among them, I was able to explicitly enforce a ":method" header field. But since 2.28.0, this now raises the following error: `requests.exceptions.InvalidHeader: Invalid leading whitespace, reserved character(s), or returncharacter(s) in header name: ':method'` Enforcing this header field is possibly a widespread practice as this is part of the requirements for sending notifications through Apple's push notification servers.
null
{ "+1": 3, "-1": 0, "confused": 0, "eyes": 3, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 6, "url": "https://api.github.com/repos/psf/requests/issues/6167/reactions" }
https://api.github.com/repos/psf/requests/issues/6167/timeline
null
null
null
null
false
[ "Hi @Alex8768765,\r\n\r\nCan you please provide the info we originally requested in the issue template? The header you're using isn't valid in the HTTP spec, so it seems unlikely this would be widespread. Python itself rejects sending a header like this in our supported versions.\r\n\r\n```python\r\n>>> requests.__version__\r\n'2.27.1'\r\n>>> r = requests.get('https://httpbin.org/get', headers={':method': 'test'})\r\nTraceback (most recent call last):\r\n File \"<stdin>\", line 1, in <module>\r\n File \"/Users/nateprewitt/.pyenv/versions/3.7.12/lib/python3.7/site-packages/requests/api.py\", line 75, in get\r\n return request('get', url, params=params, **kwargs)\r\n File \"/Users/nateprewitt/.pyenv/versions/3.7.12/lib/python3.7/site-packages/requests/api.py\", line 61, in request\r\n return session.request(method=method, url=url, **kwargs)\r\n File \"/Users/nateprewitt/.pyenv/versions/3.7.12/lib/python3.7/site-packages/requests/sessions.py\", line 529, in request\r\n resp = self.send(prep, **send_kwargs)\r\n File \"/Users/nateprewitt/.pyenv/versions/3.7.12/lib/python3.7/site-packages/requests/sessions.py\", line 645, in send\r\n r = adapter.send(request, **kwargs)\r\n File \"/Users/nateprewitt/.pyenv/versions/3.7.12/lib/python3.7/site-packages/requests/adapters.py\", line 450, in send\r\n timeout=timeout\r\n File \"/Users/nateprewitt/.pyenv/versions/3.7.12/lib/python3.7/site-packages/urllib3/connectionpool.py\", line 710, in urlopen\r\n chunked=chunked,\r\n File \"/Users/nateprewitt/.pyenv/versions/3.7.12/lib/python3.7/site-packages/urllib3/connectionpool.py\", line 398, in _make_request\r\n conn.request(method, url, **httplib_request_kw)\r\n File \"/Users/nateprewitt/.pyenv/versions/3.7.12/lib/python3.7/site-packages/urllib3/connection.py\", line 239, in request\r\n super(HTTPConnection, self).request(method, url, body=body, headers=headers)\r\n File \"/Users/nateprewitt/.pyenv/versions/3.7.12/lib/python3.7/http/client.py\", line 1281, in request\r\n self._send_request(method, url, body, headers, encode_chunked)\r\n File \"/Users/nateprewitt/.pyenv/versions/3.7.12/lib/python3.7/http/client.py\", line 1322, in _send_request\r\n self.putheader(hdr, value)\r\n File \"/Users/nateprewitt/.pyenv/versions/3.7.12/lib/python3.7/site-packages/urllib3/connection.py\", line 224, in putheader\r\n _HTTPConnection.putheader(self, header, *values)\r\n File \"/Users/nateprewitt/.pyenv/versions/3.7.12/lib/python3.7/http/client.py\", line 1249, in putheader\r\n raise ValueError('Invalid header name %r' % (header,))\r\nValueError: Invalid header name b':method'\r\n```", "Apologies, I missed that the impacted piece of code was using Requests together with a 3rd party HTTP/2 adapter. \r\n\r\n```\r\nfrom hyper.contrib import HTTP20Adapter\r\nimport requests\r\ns = requests.Session()\r\ns.mount(\"https://httpbin.org/get\", HTTP20Adapter())\r\nr = s.post(\"https://httpbin.org/get\", headers={':method': 'test'})\r\n```\r\n\r\nThat 3rd party adapter does not seem to be a maintained project as we speak, so I understand my issue is essentially finding the proper way to make HTTP/2 requests. ", "Hrmm, well that does pose a problem. While Requests only supports http/1.1, Hyper has been \"compatible\" for quite a while.\n\nI'll need to take a look at possible escape hatches. Ideally, we can update the hyper example to still use requests and bypass the header checks, but I'm not sure how/if that's accomplished.", "After a cursory look, I don’t think we can escape this at the adapter level. The immediate fix is to use the PreparedRequest workflow in the Requests docs and set the headers after the Request is prepared. This can be handed to the Session and should work.\r\n\r\nI’d like to see how often hyper is being used with Requests still before we look at merging in a code change to bypass this.", "Did you guys found any solutions", "```\r\nTraceback (most recent call last):\r\n File \"C:\\Users\\abira\\Desktop\\Bkash Marchent API\\app.py\", line 52, in <module>\r\n print(api.TableData())\r\n File \"C:\\Users\\abira\\Desktop\\Bkash Marchent API\\app.py\", line 44, in TableData\r\n data = AUTH.post('https://cpp.bka.sh/merchant-portal-backend/merchant/dashboard', json={})\r\n File \"C:\\Users\\abira\\Desktop\\Bkash Marchent API\\env\\lib\\site-packages\\requests\\sessions.py\", line 635, in post\r\n return self.request(\"POST\", url, data=data, json=json, **kwargs)\r\n File \"C:\\Users\\abira\\Desktop\\Bkash Marchent API\\env\\lib\\site-packages\\requests\\sessions.py\", line 573, in request\r\n prep = self.prepare_request(req)\r\n File \"C:\\Users\\abira\\Desktop\\Bkash Marchent API\\env\\lib\\site-packages\\requests\\sessions.py\", line 484, in prepare_request\r\n p.prepare(\r\n File \"C:\\Users\\abira\\Desktop\\Bkash Marchent API\\env\\lib\\site-packages\\requests\\models.py\", line 369, in prepare\r\n self.prepare_headers(headers)\r\n File \"C:\\Users\\abira\\Desktop\\Bkash Marchent API\\env\\lib\\site-packages\\requests\\models.py\", line 491, in prepare_headers\r\n check_header_validity(header)\r\n File \"C:\\Users\\abira\\Desktop\\Bkash Marchent API\\env\\lib\\site-packages\\requests\\utils.py\", line 1042, in check_header_validity\r\n _validate_header_part(name, \"name\", HEADER_VALIDATORS[type(name)][0])\r\n File \"C:\\Users\\abira\\Desktop\\Bkash Marchent API\\env\\lib\\site-packages\\requests\\utils.py\", line 1048, in _validate_header_part\r\n raise InvalidHeader(\r\nrequests.exceptions.InvalidHeader: Invalid leading whitespace, reserved character(s), or returncharacter(s) in header name: ':authority'\r\n```\r\nThis is what shows in my error", "replace in header '\\r' or '\\t' or '\\n' to empty symbol, this solved my problem", "> replace in header '\\r' or '\\t' or '\\n' to empty symbol, this solved my problem\r\n\r\nHi, what is the workaround for “:” I am adding \":authority\" and the request fails", "> ```\r\n> Traceback (most recent call last):\r\n> File \"C:\\Users\\abira\\Desktop\\Bkash Marchent API\\app.py\", line 52, in <module>\r\n> print(api.TableData())\r\n> File \"C:\\Users\\abira\\Desktop\\Bkash Marchent API\\app.py\", line 44, in TableData\r\n> data = AUTH.post('https://cpp.bka.sh/merchant-portal-backend/merchant/dashboard', json={})\r\n> File \"C:\\Users\\abira\\Desktop\\Bkash Marchent API\\env\\lib\\site-packages\\requests\\sessions.py\", line 635, in post\r\n> return self.request(\"POST\", url, data=data, json=json, **kwargs)\r\n> File \"C:\\Users\\abira\\Desktop\\Bkash Marchent API\\env\\lib\\site-packages\\requests\\sessions.py\", line 573, in request\r\n> prep = self.prepare_request(req)\r\n> File \"C:\\Users\\abira\\Desktop\\Bkash Marchent API\\env\\lib\\site-packages\\requests\\sessions.py\", line 484, in prepare_request\r\n> p.prepare(\r\n> File \"C:\\Users\\abira\\Desktop\\Bkash Marchent API\\env\\lib\\site-packages\\requests\\models.py\", line 369, in prepare\r\n> self.prepare_headers(headers)\r\n> File \"C:\\Users\\abira\\Desktop\\Bkash Marchent API\\env\\lib\\site-packages\\requests\\models.py\", line 491, in prepare_headers\r\n> check_header_validity(header)\r\n> File \"C:\\Users\\abira\\Desktop\\Bkash Marchent API\\env\\lib\\site-packages\\requests\\utils.py\", line 1042, in check_header_validity\r\n> _validate_header_part(name, \"name\", HEADER_VALIDATORS[type(name)][0])\r\n> File \"C:\\Users\\abira\\Desktop\\Bkash Marchent API\\env\\lib\\site-packages\\requests\\utils.py\", line 1048, in _validate_header_part\r\n> raise InvalidHeader(\r\n> requests.exceptions.InvalidHeader: Invalid leading whitespace, reserved character(s), or returncharacter(s) in header name: ':authority'\r\n> ```\r\n> \r\n> This is what shows in my error\r\n\r\nI also met this question,here is my code\r\nfrom hyper.contrib import HTTP20Adapter\r\n\r\nurl = \"https://xxxxxx.com/tag/xxxx/page/1.html\"\r\nheaders = {':authority': 'xxxxxx.com',\r\n ':method': 'GET',\r\n ':path': '/tag/xxxx/page/1',\r\n ':scheme': 'https',\r\n 'accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9',\r\n 'accept-encoding': 'gzip, deflate, br',\r\n 'accept-language': 'zh-CN,zh;q=0.9,en;q=0.8',\r\n 'Sec-Fetch-Mode':'navigate',\r\n 'Sec-Fetch-Site':'none',\r\n 'Sec-Fetch-User':'?1',\r\n 'Upgrade-Insecure-Requests':'1',\r\n 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.102 Safari/537.36'}\r\n\r\nsessions = requests.session()\r\nsessions.mount('https://xxxx.com', HTTP20Adapter())\r\nresponse = sessions.get(url = url,headers = headers)\r\n\r\nAnd I get an error like:\r\nInvalid leading whitespace, reserved character(s), or returncharacter(s) in header name: ':authority'\r\nIt made me crasy.", "same is my problem too\r\n``` \r\nheaders={'Key:'+str(self.key) : 'Sign:'+str(sign)}\r\n```\r\n\r\ni wannna do this but same error pops up", "Same problem.", "+1", "requests.exceptions.InvalidHeader: Invalid leading whitespace, reserved character(s), or returncharacter(s) in header name: ':authority'\r\n\r\n+1\r\n\r\nAny resolution found?", "+1", "> ```\r\n> Traceback (most recent call last):\r\n> File \"C:\\Users\\abira\\Desktop\\Bkash Marchent API\\app.py\", line 52, in <module>\r\n> print(api.TableData())\r\n> File \"C:\\Users\\abira\\Desktop\\Bkash Marchent API\\app.py\", line 44, in TableData\r\n> data = AUTH.post('https://cpp.bka.sh/merchant-portal-backend/merchant/dashboard', json={})\r\n> File \"C:\\Users\\abira\\Desktop\\Bkash Marchent API\\env\\lib\\site-packages\\requests\\sessions.py\", line 635, in post\r\n> return self.request(\"POST\", url, data=data, json=json, **kwargs)\r\n> File \"C:\\Users\\abira\\Desktop\\Bkash Marchent API\\env\\lib\\site-packages\\requests\\sessions.py\", line 573, in request\r\n> prep = self.prepare_request(req)\r\n> File \"C:\\Users\\abira\\Desktop\\Bkash Marchent API\\env\\lib\\site-packages\\requests\\sessions.py\", line 484, in prepare_request\r\n> p.prepare(\r\n> File \"C:\\Users\\abira\\Desktop\\Bkash Marchent API\\env\\lib\\site-packages\\requests\\models.py\", line 369, in prepare\r\n> self.prepare_headers(headers)\r\n> File \"C:\\Users\\abira\\Desktop\\Bkash Marchent API\\env\\lib\\site-packages\\requests\\models.py\", line 491, in prepare_headers\r\n> check_header_validity(header)\r\n> File \"C:\\Users\\abira\\Desktop\\Bkash Marchent API\\env\\lib\\site-packages\\requests\\utils.py\", line 1042, in check_header_validity\r\n> _validate_header_part(name, \"name\", HEADER_VALIDATORS[type(name)][0])\r\n> File \"C:\\Users\\abira\\Desktop\\Bkash Marchent API\\env\\lib\\site-packages\\requests\\utils.py\", line 1048, in _validate_header_part\r\n> raise InvalidHeader(\r\n> requests.exceptions.InvalidHeader: Invalid leading whitespace, reserved character(s), or returncharacter(s) in header name: ':authority'\r\n> ```\r\n> \r\n> This is what shows in my error\r\n\r\nI'm also receiving these and can't seem to find a solution.. Any updates?", "For those arriving here, this is not a frequently encountered issue, but the solution is in [Nate's comment](https://github.com/psf/requests/issues/6167#issuecomment-1159781034) which I will quote here:\r\n\r\n> After a cursory look, I don’t think we can escape this at the adapter level. The immediate fix is to use the PreparedRequest workflow in the Requests docs and set the headers after the Request is prepared. This can be handed to the Session and should work.\r\n> \r\n> I’d like to see how often hyper is being used with Requests still before we look at merging in a code change to bypass this.\r\n\r\nPlease read this and the documentation and do not post comments with \"+1\" or asking for updates. Further comments like this will result in locking the discussion" ]
https://api.github.com/repos/psf/requests/issues/6166
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6166/labels{/name}
https://api.github.com/repos/psf/requests/issues/6166/comments
https://api.github.com/repos/psf/requests/issues/6166/events
https://github.com/psf/requests/pull/6166
1,275,758,940
PR_kwDOABTKOs455DPD
6,166
Add union operator support to CaseInsensitiveDict (PEP 584)
{ "avatar_url": "https://avatars.githubusercontent.com/u/24359380?v=4", "events_url": "https://api.github.com/users/Cubicpath/events{/privacy}", "followers_url": "https://api.github.com/users/Cubicpath/followers", "following_url": "https://api.github.com/users/Cubicpath/following{/other_user}", "gists_url": "https://api.github.com/users/Cubicpath/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Cubicpath", "id": 24359380, "login": "Cubicpath", "node_id": "MDQ6VXNlcjI0MzU5Mzgw", "organizations_url": "https://api.github.com/users/Cubicpath/orgs", "received_events_url": "https://api.github.com/users/Cubicpath/received_events", "repos_url": "https://api.github.com/users/Cubicpath/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Cubicpath/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Cubicpath/subscriptions", "type": "User", "url": "https://api.github.com/users/Cubicpath", "user_view_type": "public" }
[]
open
false
null
[]
null
0
2022-06-18T10:46:20Z
2022-06-18T20:53:16Z
null
NONE
null
Adds support for the `|` and `|=` operators for `CaseInsensitiveDict`. This copies the functionality of `dict` from [PEP 584](https://peps.python.org/pep-0584). Even though this PEP was implemented in 3.9, the functionality implemented to `CaseInsensitiveDict` still works in all currently supported versions (3.7+). This also brings a level of consistency with other Mapping types, i.e. `OrderedDict`, `MappingProxyType`, `ChainMap`, `WeakKeyDictionary`, and more have this as supported behavior. The code itself is a slightly modified version of the [reference implementation](https://peps.python.org/pep-0584/#reference-implementation). Example usage: ```python3 session = Session() session.headers |= {'Accept', 'application/json'} ```
null
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/6166/reactions" }
https://api.github.com/repos/psf/requests/issues/6166/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/6166.diff", "html_url": "https://github.com/psf/requests/pull/6166", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/6166.patch", "url": "https://api.github.com/repos/psf/requests/pulls/6166" }
true
[]
https://api.github.com/repos/psf/requests/issues/6165
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6165/labels{/name}
https://api.github.com/repos/psf/requests/issues/6165/comments
https://api.github.com/repos/psf/requests/issues/6165/events
https://github.com/psf/requests/pull/6165
1,275,140,825
PR_kwDOABTKOs452_KO
6,165
refactor: clean up various refactorings
{ "avatar_url": "https://avatars.githubusercontent.com/u/947110?v=4", "events_url": "https://api.github.com/users/kkirsche/events{/privacy}", "followers_url": "https://api.github.com/users/kkirsche/followers", "following_url": "https://api.github.com/users/kkirsche/following{/other_user}", "gists_url": "https://api.github.com/users/kkirsche/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kkirsche", "id": 947110, "login": "kkirsche", "node_id": "MDQ6VXNlcjk0NzExMA==", "organizations_url": "https://api.github.com/users/kkirsche/orgs", "received_events_url": "https://api.github.com/users/kkirsche/received_events", "repos_url": "https://api.github.com/users/kkirsche/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kkirsche/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kkirsche/subscriptions", "type": "User", "url": "https://api.github.com/users/kkirsche", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2022-06-17T15:03:47Z
2023-06-30T00:03:07Z
2022-06-17T16:59:56Z
CONTRIBUTOR
resolved
1. Use `contextlib.suppress` rather than empty `except` 2. Prefer f-strings to `.format` and `+`-based concatenation for improved performance. 3. Remove empty `elif` via refactoring. 4. Use `yield from` instead of `yield` for 15–20% performance gain (on average) 5. Generate `list()` rather than iteration 6. Prefer generators to looped iteration
{ "avatar_url": "https://avatars.githubusercontent.com/u/240830?v=4", "events_url": "https://api.github.com/users/sigmavirus24/events{/privacy}", "followers_url": "https://api.github.com/users/sigmavirus24/followers", "following_url": "https://api.github.com/users/sigmavirus24/following{/other_user}", "gists_url": "https://api.github.com/users/sigmavirus24/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/sigmavirus24", "id": 240830, "login": "sigmavirus24", "node_id": "MDQ6VXNlcjI0MDgzMA==", "organizations_url": "https://api.github.com/users/sigmavirus24/orgs", "received_events_url": "https://api.github.com/users/sigmavirus24/received_events", "repos_url": "https://api.github.com/users/sigmavirus24/repos", "site_admin": false, "starred_url": "https://api.github.com/users/sigmavirus24/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/sigmavirus24/subscriptions", "type": "User", "url": "https://api.github.com/users/sigmavirus24", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/6165/reactions" }
https://api.github.com/repos/psf/requests/issues/6165/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/6165.diff", "html_url": "https://github.com/psf/requests/pull/6165", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/6165.patch", "url": "https://api.github.com/repos/psf/requests/pulls/6165" }
true
[ "Oops, accidentally applied a named expression. I'll fix that", "Thanks for the effort but we do not accept arbitrary refactorings of numerous disparate places in the code that aren't related. This tends to invite floods if other questionable large scale refactorings. The refactoring is usually largely subjective and unsolicited. " ]
https://api.github.com/repos/psf/requests/issues/6164
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6164/labels{/name}
https://api.github.com/repos/psf/requests/issues/6164/comments
https://api.github.com/repos/psf/requests/issues/6164/events
https://github.com/psf/requests/issues/6164
1,274,897,284
I_kwDOABTKOs5L_WOE
6,164
How to write python script setting system-wide http proxy using requests
{ "avatar_url": "https://avatars.githubusercontent.com/u/52833272?v=4", "events_url": "https://api.github.com/users/1nrho12/events{/privacy}", "followers_url": "https://api.github.com/users/1nrho12/followers", "following_url": "https://api.github.com/users/1nrho12/following{/other_user}", "gists_url": "https://api.github.com/users/1nrho12/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/1nrho12", "id": 52833272, "login": "1nrho12", "node_id": "MDQ6VXNlcjUyODMzMjcy", "organizations_url": "https://api.github.com/users/1nrho12/orgs", "received_events_url": "https://api.github.com/users/1nrho12/received_events", "repos_url": "https://api.github.com/users/1nrho12/repos", "site_admin": false, "starred_url": "https://api.github.com/users/1nrho12/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/1nrho12/subscriptions", "type": "User", "url": "https://api.github.com/users/1nrho12", "user_view_type": "public" }
[]
closed
true
null
[]
null
4
2022-06-17T11:06:52Z
2023-06-18T00:03:26Z
2022-06-17T18:13:18Z
NONE
resolved
Hello, I've written a Python script exporting http proxy: ``` import os proxy = "http://proxy:port" os.environ['http_proxy'] = proxy os.environ['HTTP_PROXY'] = proxy ``` But the thing is that I want to set the http proxy on system wide without exporting the environment variables using the requests library. How to do that? I am Python newbie.. Please help.
{ "avatar_url": "https://avatars.githubusercontent.com/u/5271761?v=4", "events_url": "https://api.github.com/users/nateprewitt/events{/privacy}", "followers_url": "https://api.github.com/users/nateprewitt/followers", "following_url": "https://api.github.com/users/nateprewitt/following{/other_user}", "gists_url": "https://api.github.com/users/nateprewitt/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/nateprewitt", "id": 5271761, "login": "nateprewitt", "node_id": "MDQ6VXNlcjUyNzE3NjE=", "organizations_url": "https://api.github.com/users/nateprewitt/orgs", "received_events_url": "https://api.github.com/users/nateprewitt/received_events", "repos_url": "https://api.github.com/users/nateprewitt/repos", "site_admin": false, "starred_url": "https://api.github.com/users/nateprewitt/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/nateprewitt/subscriptions", "type": "User", "url": "https://api.github.com/users/nateprewitt", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/6164/reactions" }
https://api.github.com/repos/psf/requests/issues/6164/timeline
null
completed
null
null
false
[ "I am using macOS by the way.", "I don't have a mac to test this but I did find this answer from [stackoverflow](https://stackoverflow.com/a/39934154).\r\nAccording to that I would set the proxy like this:\r\n`os.system(\"networksetup -setwebproxy Ethernet {} {}\".format(url, port))`\r\nYou can check the [networksetup documentation](https://keith.github.io/xcode-man-pages/networksetup.8.html) for more infos.", "Thank you for your answer. \r\nI executed the script but it has returned the following error:\r\n\r\n```\r\nTraceback (most recent call last):\r\n File \"networksetup on.py\", line 9, in <module>\r\n Proxy_on()\r\n File \"networksetup on.py\", line 7, in Proxy_on\r\n os.system('networksetup -setwebproxy Wi-Fi '+proxy+' '+port)\r\nTypeError: can only concatenate str (not \"int\") to str\r\n```\r\n\r\nThis is the script:\r\n\r\n```\r\nimport os\r\n\r\nproxy = \"http://127.0.0.1\"\r\nport = 8080\r\n\r\ndef Proxy_on():\r\n os.system('networksetup -setwebproxy Wi-Fi '+proxy+' '+port)\r\n\r\nProxy_on()\r\n```", "Hi @1nrho12, it appears this isn't related to Requests but rather a general Python question. We'd ask you move this to a platform like [StackOverflow](https://stackoverflow.com/). We try to reserve the issue tracker for Requests defects as responses to this issue emails 1400 people." ]
https://api.github.com/repos/psf/requests/issues/6163
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6163/labels{/name}
https://api.github.com/repos/psf/requests/issues/6163/comments
https://api.github.com/repos/psf/requests/issues/6163/events
https://github.com/psf/requests/pull/6163
1,270,986,204
PR_kwDOABTKOs45pJ-l
6,163
Update README.md (some better wording)
{ "avatar_url": "https://avatars.githubusercontent.com/u/77706434?v=4", "events_url": "https://api.github.com/users/ArjunSharda/events{/privacy}", "followers_url": "https://api.github.com/users/ArjunSharda/followers", "following_url": "https://api.github.com/users/ArjunSharda/following{/other_user}", "gists_url": "https://api.github.com/users/ArjunSharda/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/ArjunSharda", "id": 77706434, "login": "ArjunSharda", "node_id": "MDQ6VXNlcjc3NzA2NDM0", "organizations_url": "https://api.github.com/users/ArjunSharda/orgs", "received_events_url": "https://api.github.com/users/ArjunSharda/received_events", "repos_url": "https://api.github.com/users/ArjunSharda/repos", "site_admin": false, "starred_url": "https://api.github.com/users/ArjunSharda/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/ArjunSharda/subscriptions", "type": "User", "url": "https://api.github.com/users/ArjunSharda", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2022-06-14T15:30:57Z
2023-06-15T00:03:12Z
2022-06-14T15:38:04Z
NONE
resolved
null
{ "avatar_url": "https://avatars.githubusercontent.com/u/5271761?v=4", "events_url": "https://api.github.com/users/nateprewitt/events{/privacy}", "followers_url": "https://api.github.com/users/nateprewitt/followers", "following_url": "https://api.github.com/users/nateprewitt/following{/other_user}", "gists_url": "https://api.github.com/users/nateprewitt/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/nateprewitt", "id": 5271761, "login": "nateprewitt", "node_id": "MDQ6VXNlcjUyNzE3NjE=", "organizations_url": "https://api.github.com/users/nateprewitt/orgs", "received_events_url": "https://api.github.com/users/nateprewitt/received_events", "repos_url": "https://api.github.com/users/nateprewitt/repos", "site_admin": false, "starred_url": "https://api.github.com/users/nateprewitt/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/nateprewitt/subscriptions", "type": "User", "url": "https://api.github.com/users/nateprewitt", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/6163/reactions" }
https://api.github.com/repos/psf/requests/issues/6163/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/6163.diff", "html_url": "https://github.com/psf/requests/pull/6163", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/6163.patch", "url": "https://api.github.com/repos/psf/requests/pulls/6163" }
true
[ "Hi @ajsharda17, thanks for the PR! Unfortunately, we don't accept PRs with stylistic changes to documentation due to their subjective nature. They often result in additional churn because there is rarely consensus on what constitutes \"better\". We do appreciate the initiative though!" ]
https://api.github.com/repos/psf/requests/issues/6162
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6162/labels{/name}
https://api.github.com/repos/psf/requests/issues/6162/comments
https://api.github.com/repos/psf/requests/issues/6162/events
https://github.com/psf/requests/pull/6162
1,268,321,914
PR_kwDOABTKOs45galI
6,162
Fix HTTPS websites with system-wide HTTP proxy on Windows
{ "avatar_url": "https://avatars.githubusercontent.com/u/3054729?v=4", "events_url": "https://api.github.com/users/ValdikSS/events{/privacy}", "followers_url": "https://api.github.com/users/ValdikSS/followers", "following_url": "https://api.github.com/users/ValdikSS/following{/other_user}", "gists_url": "https://api.github.com/users/ValdikSS/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/ValdikSS", "id": 3054729, "login": "ValdikSS", "node_id": "MDQ6VXNlcjMwNTQ3Mjk=", "organizations_url": "https://api.github.com/users/ValdikSS/orgs", "received_events_url": "https://api.github.com/users/ValdikSS/received_events", "repos_url": "https://api.github.com/users/ValdikSS/repos", "site_admin": false, "starred_url": "https://api.github.com/users/ValdikSS/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/ValdikSS/subscriptions", "type": "User", "url": "https://api.github.com/users/ValdikSS", "user_view_type": "public" }
[]
open
false
null
[]
null
2
2022-06-11T16:42:34Z
2022-07-18T12:10:06Z
null
NONE
null
Due to urllib bug, requests fails to open any HTTPS websites on Windows if there's system-wide HTTP proxy configured. This is because urllib incorrectly prepends the protocol to the proxy host and port, as in: ``` {'http': 'http://host:port', 'https': 'https://host:port', 'ftp': 'ftp://host:port'} ``` Such configuration forces urllib3 to use HTTPS proxy (Secure Web Proxy, also known as TLS Proxy) for HTTPS URLs, which the configured proxy most likely does not support. Detect incorrect behavior and rewrite the protocol to http.
null
{ "+1": 1, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 1, "url": "https://api.github.com/repos/psf/requests/issues/6162/reactions" }
https://api.github.com/repos/psf/requests/issues/6162/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/6162.diff", "html_url": "https://github.com/psf/requests/pull/6162", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/6162.patch", "url": "https://api.github.com/repos/psf/requests/pulls/6162" }
true
[ "Issue #6139", "Could anyone take a look at this merge request please?" ]
https://api.github.com/repos/psf/requests/issues/6161
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6161/labels{/name}
https://api.github.com/repos/psf/requests/issues/6161/comments
https://api.github.com/repos/psf/requests/issues/6161/events
https://github.com/psf/requests/issues/6161
1,268,146,429
I_kwDOABTKOs5LlmD9
6,161
> ![Screenshot_2020-06-15-21-55-17-097_com termux](https://user-images.githubusercontent.com/66963067/84682209-f15ffc00-af52-11ea-9d3c-78b7bded9f57.jpg)
{ "avatar_url": "https://avatars.githubusercontent.com/u/107268993?v=4", "events_url": "https://api.github.com/users/7Kyra/events{/privacy}", "followers_url": "https://api.github.com/users/7Kyra/followers", "following_url": "https://api.github.com/users/7Kyra/following{/other_user}", "gists_url": "https://api.github.com/users/7Kyra/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/7Kyra", "id": 107268993, "login": "7Kyra", "node_id": "U_kgDOBmTLgQ", "organizations_url": "https://api.github.com/users/7Kyra/orgs", "received_events_url": "https://api.github.com/users/7Kyra/received_events", "repos_url": "https://api.github.com/users/7Kyra/repos", "site_admin": false, "starred_url": "https://api.github.com/users/7Kyra/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/7Kyra/subscriptions", "type": "User", "url": "https://api.github.com/users/7Kyra", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2022-06-11T03:10:10Z
2023-06-12T00:03:09Z
2022-06-11T03:17:10Z
NONE
resolved
null
{ "avatar_url": "https://avatars.githubusercontent.com/u/5271761?v=4", "events_url": "https://api.github.com/users/nateprewitt/events{/privacy}", "followers_url": "https://api.github.com/users/nateprewitt/followers", "following_url": "https://api.github.com/users/nateprewitt/following{/other_user}", "gists_url": "https://api.github.com/users/nateprewitt/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/nateprewitt", "id": 5271761, "login": "nateprewitt", "node_id": "MDQ6VXNlcjUyNzE3NjE=", "organizations_url": "https://api.github.com/users/nateprewitt/orgs", "received_events_url": "https://api.github.com/users/nateprewitt/received_events", "repos_url": "https://api.github.com/users/nateprewitt/repos", "site_admin": false, "starred_url": "https://api.github.com/users/nateprewitt/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/nateprewitt/subscriptions", "type": "User", "url": "https://api.github.com/users/nateprewitt", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/6161/reactions" }
https://api.github.com/repos/psf/requests/issues/6161/timeline
null
completed
null
null
false
[ "Hi @7Kyra, this isn't an issue with Requests but a general Python question. You'll need to ensure the key you're retrieving exists. If you have further questions please open a question on [StackOverflow](https://stackoverflow.com)." ]
https://api.github.com/repos/psf/requests/issues/6160
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6160/labels{/name}
https://api.github.com/repos/psf/requests/issues/6160/comments
https://api.github.com/repos/psf/requests/issues/6160/events
https://github.com/psf/requests/issues/6160
1,266,808,359
I_kwDOABTKOs5LgfYn
6,160
Ability/option to automatically handle `Retry-After` in responses.
{ "avatar_url": "https://avatars.githubusercontent.com/u/388671?v=4", "events_url": "https://api.github.com/users/stevecj/events{/privacy}", "followers_url": "https://api.github.com/users/stevecj/followers", "following_url": "https://api.github.com/users/stevecj/following{/other_user}", "gists_url": "https://api.github.com/users/stevecj/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/stevecj", "id": 388671, "login": "stevecj", "node_id": "MDQ6VXNlcjM4ODY3MQ==", "organizations_url": "https://api.github.com/users/stevecj/orgs", "received_events_url": "https://api.github.com/users/stevecj/received_events", "repos_url": "https://api.github.com/users/stevecj/repos", "site_admin": false, "starred_url": "https://api.github.com/users/stevecj/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/stevecj/subscriptions", "type": "User", "url": "https://api.github.com/users/stevecj", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2022-06-10T00:35:07Z
2023-06-11T00:03:25Z
2022-06-10T00:48:20Z
NONE
resolved
I am aware that "Requests is not accepting feature requests at this time." but am asking anyway. Currently, there are many APIs that use the `Retry-After` header for throttling, but API client code generally does not take that into account. When thinking about how I would suggest adding throttling to atlassian-python-api, I realized that, just like following of redirects, this might make more sense to handle at a lower level in the Requests library.
{ "avatar_url": "https://avatars.githubusercontent.com/u/5271761?v=4", "events_url": "https://api.github.com/users/nateprewitt/events{/privacy}", "followers_url": "https://api.github.com/users/nateprewitt/followers", "following_url": "https://api.github.com/users/nateprewitt/following{/other_user}", "gists_url": "https://api.github.com/users/nateprewitt/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/nateprewitt", "id": 5271761, "login": "nateprewitt", "node_id": "MDQ6VXNlcjUyNzE3NjE=", "organizations_url": "https://api.github.com/users/nateprewitt/orgs", "received_events_url": "https://api.github.com/users/nateprewitt/received_events", "repos_url": "https://api.github.com/users/nateprewitt/repos", "site_admin": false, "starred_url": "https://api.github.com/users/nateprewitt/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/nateprewitt/subscriptions", "type": "User", "url": "https://api.github.com/users/nateprewitt", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/6160/reactions" }
https://api.github.com/repos/psf/requests/issues/6160/timeline
null
completed
null
null
false
[ "Hi @stevecj, this is already possible in Requests. We don't implement any of the Retry behavior, that comes from urllib3.\r\n\r\nYou can see in our adapter that we take a [`max_retries`](https://github.com/psf/requests/blob/2a6f290bc09324406708a4d404a88a45d848ddf9/requests/adapters.py#L140) argument that take an int to instantiate a urllib3 [`Retry`](https://github.com/urllib3/urllib3/blob/23af17403c965a90d98cd13785ed385db6b022e6/src/urllib3/util/retry.py#L92) object.\r\n\r\nBy default, Requests does not retry. If you'd like to enable that functionality, create a Session, re-mount a new HTTPAdapter instance with your Retry and you're set. Note that Retry has an explicit [`respect_retry_after_header`](https://github.com/urllib3/urllib3/blob/23af17403c965a90d98cd13785ed385db6b022e6/src/urllib3/util/retry.py#L257) which is defaulted to True.\r\n\r\ne.g.\r\n```python\r\nimport requests\r\n\r\nadapter = requests.adapters.HTTPAdapter(max_retries=3)\r\ns = requests.Session()\r\ns.mount('http://', adapter)\r\ns.mount('https://', adapter)\r\n```" ]
https://api.github.com/repos/psf/requests/issues/6159
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6159/labels{/name}
https://api.github.com/repos/psf/requests/issues/6159/comments
https://api.github.com/repos/psf/requests/issues/6159/events
https://github.com/psf/requests/issues/6159
1,266,593,022
I_kwDOABTKOs5Lfqz-
6,159
Breaking change in 2.28.0 when using string enums as Headers (working in v2.27.1)
{ "avatar_url": "https://avatars.githubusercontent.com/u/37800834?v=4", "events_url": "https://api.github.com/users/bonastreyair/events{/privacy}", "followers_url": "https://api.github.com/users/bonastreyair/followers", "following_url": "https://api.github.com/users/bonastreyair/following{/other_user}", "gists_url": "https://api.github.com/users/bonastreyair/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/bonastreyair", "id": 37800834, "login": "bonastreyair", "node_id": "MDQ6VXNlcjM3ODAwODM0", "organizations_url": "https://api.github.com/users/bonastreyair/orgs", "received_events_url": "https://api.github.com/users/bonastreyair/received_events", "repos_url": "https://api.github.com/users/bonastreyair/repos", "site_admin": false, "starred_url": "https://api.github.com/users/bonastreyair/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/bonastreyair/subscriptions", "type": "User", "url": "https://api.github.com/users/bonastreyair", "user_view_type": "public" }
[]
closed
true
null
[]
{ "closed_at": "2023-05-22T03:37:11Z", "closed_issues": 3, "created_at": "2022-11-16T21:23:42Z", "creator": { "avatar_url": "https://avatars.githubusercontent.com/u/5271761?v=4", "events_url": "https://api.github.com/users/nateprewitt/events{/privacy}", "followers_url": "https://api.github.com/users/nateprewitt/followers", "following_url": "https://api.github.com/users/nateprewitt/following{/other_user}", "gists_url": "https://api.github.com/users/nateprewitt/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/nateprewitt", "id": 5271761, "login": "nateprewitt", "node_id": "MDQ6VXNlcjUyNzE3NjE=", "organizations_url": "https://api.github.com/users/nateprewitt/orgs", "received_events_url": "https://api.github.com/users/nateprewitt/received_events", "repos_url": "https://api.github.com/users/nateprewitt/repos", "site_admin": false, "starred_url": "https://api.github.com/users/nateprewitt/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/nateprewitt/subscriptions", "type": "User", "url": "https://api.github.com/users/nateprewitt", "user_view_type": "public" }, "description": "", "due_on": null, "html_url": "https://github.com/psf/requests/milestone/31", "id": 8662889, "labels_url": "https://api.github.com/repos/psf/requests/milestones/31/labels", "node_id": "MI_kwDOABTKOs4AhC9p", "number": 31, "open_issues": 0, "state": "closed", "title": "2.29.0", "updated_at": "2023-05-22T03:37:11Z", "url": "https://api.github.com/repos/psf/requests/milestones/31" }
18
2022-06-09T20:00:51Z
2024-03-03T00:03:31Z
2023-03-03T20:39:04Z
NONE
resolved
When using string enums as key values for the `headers` dict parameter with `requests.get()` function in `v2.28.0` it raises an `InvalidHeader` error but using previous version `v2.27.1` works well without any error. It seems there was an unexpected breaking change with that release. ## Expected Result Dict keys for the headers parameter when using `requests.get()` are still valid if a string enum is used. ## Actual Result Instead it raises an `InvalidHeader` error stating that: > Header must be of type `str` or `bytes`, not `enum`. ```python Traceback (most recent call last): File "/home/yair/PycharmProjects/tests/requests_error.py", line 9, in <module> requests.get("http://URL", headers={CustomEnum.TRACE_ID: "90e85293-afd1-4b48-adf0-fa6daf02359e"}) File "/home/yair/.local/lib/python3.8/site-packages/requests/api.py", line 73, in get return request("get", url, params=params, **kwargs) File "/home/yair/.local/lib/python3.8/site-packages/requests/api.py", line 59, in request return session.request(method=method, url=url, **kwargs) File "/home/yair/.local/lib/python3.8/site-packages/requests/sessions.py", line 573, in request prep = self.prepare_request(req) File "/home/yair/.local/lib/python3.8/site-packages/requests/sessions.py", line 484, in prepare_request p.prepare( File "/home/yair/.local/lib/python3.8/site-packages/requests/models.py", line 369, in prepare self.prepare_headers(headers) File "/home/yair/.local/lib/python3.8/site-packages/requests/models.py", line 491, in prepare_headers check_header_validity(header) File "/home/yair/.local/lib/python3.8/site-packages/requests/utils.py", line 1037, in check_header_validity raise InvalidHeader( requests.exceptions.InvalidHeader: Header part (<CustomEnum.TRACE_ID: 'X-B3-TraceId'>) from {<CustomEnum.TRACE_ID: 'X-B3-TraceId'>: '90e85293-afd1-4b48-adf0-fa6daf02359e'} must be of type str or bytes, not <enum 'CustomEnum'> ``` ## Reproduction Steps ```python from enum import Enum import requests class CustomEnum(str, Enum): TRACE_ID = "X-B3-TraceId" requests.get("http://URL", headers={CustomEnum.TRACE_ID: "90e85293-afd1-4b48-adf0-fa6daf02359e"}) ``` ## System Information $ python -m requests.help ```json { "chardet": { "version": "3.0.4" }, "charset_normalizer": { "version": "2.0.4" }, "cryptography": { "version": "2.8" }, "idna": { "version": "3.2" }, "implementation": { "name": "CPython", "version": "3.8.10" }, "platform": { "release": "5.13.0-48-generic", "system": "Linux" }, "pyOpenSSL": { "openssl_version": "1010106f", "version": "19.0.0" }, "requests": { "version": "2.28.0" }, "system_ssl": { "version": "1010106f" }, "urllib3": { "version": "1.26.6" }, "using_charset_normalizer": false, "using_pyopenssl": true } ``` <!-- This command is only available on Requests v2.16.4 and greater. Otherwise, please provide some basic information about your system (Python version, operating system, &c). -->
{ "avatar_url": "https://avatars.githubusercontent.com/u/18519037?v=4", "events_url": "https://api.github.com/users/sethmlarson/events{/privacy}", "followers_url": "https://api.github.com/users/sethmlarson/followers", "following_url": "https://api.github.com/users/sethmlarson/following{/other_user}", "gists_url": "https://api.github.com/users/sethmlarson/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/sethmlarson", "id": 18519037, "login": "sethmlarson", "node_id": "MDQ6VXNlcjE4NTE5MDM3", "organizations_url": "https://api.github.com/users/sethmlarson/orgs", "received_events_url": "https://api.github.com/users/sethmlarson/received_events", "repos_url": "https://api.github.com/users/sethmlarson/repos", "site_admin": false, "starred_url": "https://api.github.com/users/sethmlarson/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/sethmlarson/subscriptions", "type": "User", "url": "https://api.github.com/users/sethmlarson", "user_view_type": "public" }
{ "+1": 6, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 6, "url": "https://api.github.com/repos/psf/requests/issues/6159/reactions" }
https://api.github.com/repos/psf/requests/issues/6159/timeline
null
completed
null
null
false
[ "I know it is easily solvable by making use of the `CustomEnum.TRACE_ID.value` to use the stored string instead of using the enum directly with `CustomEnum.TRACE_ID`... but it worked before with v2.27.1, so it feels like an unexpected breaking change... :eyes: ", "Thanks for the report, @bonastreyair! So I think this is on the edge of support. Headers have always been defined to be a `str` or `bytes` and we've been programmatically enforcing that for header values for 6 years. While this worked in 2.27.1, it wasn't an intentional function of the headers param. I'd like to see how widespread this issue is before we make a decision on cases like this.\r\n\r\nIn the meantime, Requests has no special logic for Enums, so casting it to a string prior to calling Requests will not affect behavior. That would be the recommendation while we gauge impact. Otherwise, 2.27.1 will continue to work as it did originally.", "Here's another instance fwiw: https://github.com/taverntesting/tavern/issues/788\r\nIn this case it's just a subclass of str being passed in as header values: https://github.com/taverntesting/tavern/blob/ede36ca062b546cfaf3e6b0940fbac30733586a4/tavern/util/formatted_str.py", "We also have similar issues in company internal tools.\r\nIsn't the explicit check for str and byte contradicting the duck typing approach of python? At least previously the code was working fine, even though we passed e.g. xml elements that were then implicitly converted to strings.", "> We also have similar issues in company internal tools.\n> Isn't the explicit check for str and byte contradicting the duck typing approach of python? At least previously the code was working fine, even though we passed e.g. xml elements that were then implicitly converted to strings.\n\nNo. It's not contradicting that because any time we magically convert things for users, it tends to be wrong about 50% of the time. Being explicit in our documentation hasn't been effective and these validity checks are designed to help users not send junk that will almost certainly not do what they want. Much of what has been explicitly described above either for narrow cases but not for everyone. Enums for example are not required to have a string values. How does one consistently string-ify it then? Support for people subclassing built-in types notorious for breaking those subclasses is also not a logical choice because again it will surprise people who try it by breaking in a weird way it doing the opposite of what they expect", "We encountered this same issue when passing header values whose type is a subclass of `str`. Might it make sense to allow subclasses to pass validation? In this case the requests library would not be doing any conversion for the user.", "I wrote up a [patch](https://github.com/nateprewitt/requests/commit/66fcc9c88cf5a53e85322305f41006032744cbe3) for this on Friday. I've been waiting to see how widely this approach is used, because we've only had 4 reports with ~75% of downloads (50 million/week) now using 2.28.0. I think this falls into a _very_ niche usage, but I agree `bytes`/`str` subclasses did work for both name and value prior to this release.\r\n\r\nWe're going to monitor for any other issues in 2.28.0 to determine if we need a patch release. I'd be willing to merge the fix above into that with a heavy caveat that this isn't strictly supported. Any breakages due to subclasses deviating in behavior from the base `bytes`/`str` type likely won't be fixed.\r\n\r\nLong term, I think we're going to continue taking a much firmer stance on inputs because people do crazy things when the values aren't `bytes`/`str` and expect them to just work. This becomes much more problematic when the requests are being sent to systems corrupted due to incorrect \"stringification\". We can't reasonably handle every case, so we need to draw a line somewhere on what the APIs are intended to support to provide stability.", "In our case we're interacting with Salesforce, whose API consists of XML messages. We parse a session ID out of the response from the authentication endpoint using `lxml`. This value is of type `lxml.etree._ElementUnicodeResult` which is a subclass of `str`. We pass it to the constructor of a class from `salesforce-bulk`. This class uses `requests` under the covers to communicate with Salesforce. It naively assumes that the session ID we supplied can be passed to `requests` as a header value without issue.\r\n\r\nOur fix was to cast the session ID to an actual `str` before giving it to `salesforce-bulk`.", "Just want to add support for this issue by saying we are also having this issue. Our use is basically:\r\n```\r\nclass ContentType(str, Enum):\r\n JSON = \"application/json\"\r\n XML = \"text/xml\"\r\n\r\n...\r\ndef execute_request(...):\r\n...\r\n headers = {\"Content-Type\": ContentType.JSON}\r\n response = requests.request(\r\n url=url,\r\n method=method,\r\n params=params,\r\n headers=headers,\r\n data=data\r\n )", "Using enums for header names is a common (and generally regarded as a good) practice. +1.\r\n\r\nIn the `ContentType` enum given above, you have what looks like a string, acts like a string, and quacks like a string. It should be treated as a string. `requests` shouldn't be responsible for being fed misbehaving subclasses of builtin types IMO.\r\n\r\nAnyway, just trying to add one to the 'user engagement' since that was mentioned as a consideration in the 2.28.1 release.", "> Using enums for header names is a common (and generally regarded as a good) practice. +1.\r\n\r\nI don't believe anything in this change precludes the use of enums in your code. Requests is being explicit of what we accept. `enum.name` becomes `enum.name.value` and everything works fine.", "Also seeing this in an Ansible collection, since the test containers updated their requirements to allow a newer version of `requests`.\r\n- https://github.com/ansible-collections/community.hashi_vault/issues/289", "As explained in #6232 -> we use a string subclass to prevent secrets leaking in certain circumstances, i.e. in Stack Traces.\r\n\r\nJust converting them to `str` would contradict this intention. So in opposite to using Enums, there is not really a workaround for us.", "> Just converting them to str would contradict this intention\r\n\r\nTo be clear, to convert it to a `str` before passing to requests would be a problem, but requests converting it to a string isn't a problem in your eyes? That makes absolutely zero sense to me. Requests isn't doing anything special to handle your secret.\r\n\r\nAlso, you seem to be relying on this class to avoid leaking secrets in stack traces and assuming you/your colleagues will always remember to use it rather than looking for secrets in stack traces before allowing them to be printed to logs by using a formatter to ensure no secrets are printed ever (just to be safe). Defense in depth is always better than expecting a library to do something for you at one or two layers below you.", "Actually the Secret class is of course one of multiple layers. \r\nWe ensure on multiple places (i.e. using our auth libs), that secrets given are wrapped in this special class. \r\nWe simply add this test to all places in our code that accepts secrets.\r\nThis helps us also to track secrets within our code base.\r\nWe not *solely* rely on it.\r\n\r\nAnd of course we use loggers/formatters that prevent leaking secrets but enforcing that is much harder then wrapping secrets. \r\nBetter do both.\r\n\r\nAlso other libraries follow a similar approach. For instance httpx for URLs:\r\nhttps://github.com/encode/httpx/blob/master/httpx/_urls.py#L512\r\n\r\nAnd actually requests does not (as far I found) convert the special class back to a normal string.\r\n\r\n```python\r\n def test_header_validation(self, httpbin):\r\n \"\"\"Ensure prepare_headers regex isn't flagging valid header contents.\"\"\"\r\n class StringSubClass(str):\r\n def __repr__(self):\r\n return \"Secret\"\r\n\r\n valid_headers = {\r\n \"foo\": \"bar baz qux\",\r\n \"bar\": b\"fbbq\",\r\n \"baz\": \"\",\r\n \"qux\": \"1\",\r\n \"sub\": StringSubClass(\"VerySecret\")\r\n }\r\n r = requests.get(httpbin(\"get\"), headers=valid_headers)\r\n for key in valid_headers.keys():\r\n valid_headers[key] == r.request.headers[key]\r\n # Ensure type is not modified\r\n assert type(valid_headers[key]) == type(r.request.headers[key])\r\n```\r\nThis modified test works as expected.\r\n\r\nEven the function `to_native_string` called in prepare_header (and even used for keys only) in `_intnal_utils.py` does not convert a value back to a naive string. Of course some send logic could/will do convert the value i.e. to a byte. But to leak the secret a exception needs to be raised in function that is called with this converted value without being handled by the library... \r\n\r\nSo requests does not have to handle the secret any special.\r\nIt would only leak the secret in a stack trace, if the header is converted to a normal str class **before** passing it to a function that is raising the exception which is printed.\r\nYes of course that is not 100% protection against a possible leakage but good enough for us as very unlikely.\r\n\r\nConsider the opposite: We tell our devs to use the `Secret` everywhere, but then also need to tell them to wrap calls to requests to make them visible.\r\nIt like: Hey on all terminals enter your password in the input showing `****` for your input but in this special terminal just enter it in plain text.\r\nYes maybe also the terminal showing `*****` is saving the password in the *background* as plain text but that is a different story. The main point here how to teach people on how to handle a secret. \r\n\r\nTo make the case more general again:\r\n\r\nSubclasses of strings are common for a number of reason, i.e. a json/xml/yaml libary that uses it to track formatting of a string, a a string enum, mark stuff a secret etc...\r\nEnforcing stuff to be naive string class will break this things. If it is a subclass of a string, it should be good enough. \r\n\r\nI do **not** see a case in which both the `isinstance` check is okay **and** the regex matches a valid input and but the string representation is still wrong.\r\nIn this case also the output of `print(value)` will show the wrong value.\r\n\r\nI know that users of libs do crazy stuff but could you elaborate what kind of wrong \"stringification\" could happen if both checks are valid?\r\n\r\n", "@nateprewitt any news here? I really would love to see your patch applied.\r\n", "Quick ping here, looking over the proposed patch I don't see a good reason not to apply it, especially given that this kind of behavior actually violates the Python principle of 'duck typing'. It's unclear why Requests needs to be deeply coupled beyond `isinstance`. What's the use-case where limiting to the precise coordinate of `str` or `bytes` is truly necessary? And again, we aren't talking about string conversion, but simply if it says it's an instance of `str` or `bytes`, letting users be responsible for what happens if it isn't true seems reasonable, for the same reason single-underscore private methods aren't truly private in python, but a convention.", "you can resolve this issue by converting to a string before parsing it as a key to the headers directory\r\n`\r\nfrom enum import Enum\r\nclass CustomEnum(Enum):\r\nTRACE_ID = \"X-B3-TraceId\"\r\n\r\nheaders = {CustomEnum.TRACE_ID: \"90e85293-afd1-4b48-adf0-fa6daf02359e\"}\r\nrequests.get(\"http://url/\", headers=headers)" ]
https://api.github.com/repos/psf/requests/issues/6158
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6158/labels{/name}
https://api.github.com/repos/psf/requests/issues/6158/comments
https://api.github.com/repos/psf/requests/issues/6158/events
https://github.com/psf/requests/issues/6158
1,266,333,457
I_kwDOABTKOs5LercR
6,158
2.28.0: sphinx warnings `reference target not found`
{ "avatar_url": "https://avatars.githubusercontent.com/u/31284574?v=4", "events_url": "https://api.github.com/users/kloczek/events{/privacy}", "followers_url": "https://api.github.com/users/kloczek/followers", "following_url": "https://api.github.com/users/kloczek/following{/other_user}", "gists_url": "https://api.github.com/users/kloczek/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kloczek", "id": 31284574, "login": "kloczek", "node_id": "MDQ6VXNlcjMxMjg0NTc0", "organizations_url": "https://api.github.com/users/kloczek/orgs", "received_events_url": "https://api.github.com/users/kloczek/received_events", "repos_url": "https://api.github.com/users/kloczek/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kloczek/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kloczek/subscriptions", "type": "User", "url": "https://api.github.com/users/kloczek", "user_view_type": "public" }
[]
open
false
null
[]
null
1
2022-06-09T15:43:13Z
2022-06-09T15:48:06Z
null
NONE
null
On building my packages I'm using `sphinx-build` command with `-n` switch which shows warmings about missing references. These are not critical issues. Here is the output with warnings: <details> ```console + /usr/bin/sphinx-build -n -T -b man docs build/sphinx/man Running Sphinx v5.0.1 WARNING: Invalid configuration value found: 'language = None'. Update your configuration to a valid langauge code. Falling back to 'en' (English). making output directory... done loading intersphinx inventory from https://docs.python.org/3/objects.inv... loading intersphinx inventory from https://urllib3.readthedocs.io/en/latest/objects.inv... building [mo]: targets for 0 po files that are out of date building [man]: all manpages updating environment: [new config] 15 added, 0 changed, 0 removed reading sources... [100%] user/quickstart looking for now-outdated files... none found pickling environment... done checking consistency... done writing... python-requests.3 { user/install user/quickstart user/advanced user/authentication community/recommended community/faq community/out-there community/support community/vulnerabilities community/release-process community/updates api dev/contributing dev/authors } /home/tkloczko/rpmbuild/BUILD/requests-2.28.0/requests/models.py:docstring of requests.models.Response.json:: WARNING: py:exc reference target not found: requests.exceptions.JSONDecodeError /home/tkloczko/rpmbuild/BUILD/requests-2.28.0/requests/adapters.py:docstring of requests.adapters.BaseAdapter.send:3: WARNING: py:class reference target not found: PreparedRequest /home/tkloczko/rpmbuild/BUILD/requests-2.28.0/requests/adapters.py:docstring of requests.adapters.HTTPAdapter:3: WARNING: py:class reference target not found: Session /home/tkloczko/rpmbuild/BUILD/requests-2.28.0/requests/adapters.py:docstring of requests.adapters.HTTPAdapter.add_headers:9: WARNING: py:class reference target not found: PreparedRequest /home/tkloczko/rpmbuild/BUILD/requests-2.28.0/requests/adapters.py:docstring of requests.adapters.HTTPAdapter.build_response:6: WARNING: py:class reference target not found: PreparedRequest /home/tkloczko/rpmbuild/BUILD/requests-2.28.0/requests/adapters.py:docstring of requests.adapters.HTTPAdapter.get_connection:: WARNING: py:class reference target not found: urllib3.ConnectionPool /home/tkloczko/rpmbuild/BUILD/requests-2.28.0/requests/adapters.py:docstring of requests.adapters.HTTPAdapter.request_url:10: WARNING: py:class reference target not found: PreparedRequest /home/tkloczko/rpmbuild/BUILD/requests-2.28.0/requests/adapters.py:docstring of requests.adapters.HTTPAdapter.send:3: WARNING: py:class reference target not found: PreparedRequest /home/tkloczko/rpmbuild/BUILD/requests-2.28.0/requests/adapters.py:docstring of requests.adapters.HTTPAdapter.send:: WARNING: py:class reference target not found: urllib3 Timeout object /home/tkloczko/rpmbuild/BUILD/requests-2.28.0/requests/utils.py:docstring of requests.utils.add_dict_to_cookiejar:: WARNING: py:class reference target not found: CookieJar /home/tkloczko/rpmbuild/BUILD/requests-2.28.0/requests/cookies.py:docstring of requests.cookies.cookiejar_from_dict:: WARNING: py:class reference target not found: CookieJar /home/tkloczko/rpmbuild/BUILD/requests-2.28.0/requests/cookies.py:docstring of collections.abc.MutableMapping.pop:: WARNING: py:class reference target not found: v, remove specified key and return the corresponding value. /home/tkloczko/rpmbuild/BUILD/requests-2.28.0/requests/cookies.py:docstring of collections.abc.MutableMapping.popitem:: WARNING: py:class reference target not found: (k, v), remove and return some (key, value) pair /home/tkloczko/rpmbuild/BUILD/requests-2.28.0/requests/cookies.py:docstring of collections.abc.MutableMapping.setdefault:: WARNING: py:class reference target not found: D.get(k,d), also set D[k]=d if k not in D done build succeeded, 15 warnings. ``` </details> You can peak on fixes that kind of issues in other projects https://github.com/latchset/jwcrypto/pull/289 https://github.com/click-contrib/sphinx-click/commit/abc31069 https://github.com/latchset/jwcrypto/pull/289 https://github.com/RDFLib/rdflib-sqlalchemy/issues/95 https://github.com/sissaschool/elementpath/commit/bf869d9e https://github.com/jaraco/cssutils/issues/21
null
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/6158/reactions" }
https://api.github.com/repos/psf/requests/issues/6158/timeline
null
null
null
null
false
[ "Thanks @kloczek, we'll take a look." ]
https://api.github.com/repos/psf/requests/issues/6157
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6157/labels{/name}
https://api.github.com/repos/psf/requests/issues/6157/comments
https://api.github.com/repos/psf/requests/issues/6157/events
https://github.com/psf/requests/pull/6157
1,264,170,750
PR_kwDOABTKOs45Sh2j
6,157
Add GitHub action to automate linting
{ "avatar_url": "https://avatars.githubusercontent.com/u/5271761?v=4", "events_url": "https://api.github.com/users/nateprewitt/events{/privacy}", "followers_url": "https://api.github.com/users/nateprewitt/followers", "following_url": "https://api.github.com/users/nateprewitt/following{/other_user}", "gists_url": "https://api.github.com/users/nateprewitt/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/nateprewitt", "id": 5271761, "login": "nateprewitt", "node_id": "MDQ6VXNlcjUyNzE3NjE=", "organizations_url": "https://api.github.com/users/nateprewitt/orgs", "received_events_url": "https://api.github.com/users/nateprewitt/received_events", "repos_url": "https://api.github.com/users/nateprewitt/repos", "site_admin": false, "starred_url": "https://api.github.com/users/nateprewitt/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/nateprewitt/subscriptions", "type": "User", "url": "https://api.github.com/users/nateprewitt", "user_view_type": "public" }
[]
closed
true
null
[]
null
0
2022-06-08T04:19:31Z
2023-06-09T00:03:12Z
2022-06-08T19:11:11Z
MEMBER
resolved
This was intended to be a follow up to #6095 but got lost in the shuffle post PyCon. It's currently failing on a single line change that's addressed in #6154. Once that's merged this should be ready to merge and ensure we don't introduce any future inconsistencies.
{ "avatar_url": "https://avatars.githubusercontent.com/u/5271761?v=4", "events_url": "https://api.github.com/users/nateprewitt/events{/privacy}", "followers_url": "https://api.github.com/users/nateprewitt/followers", "following_url": "https://api.github.com/users/nateprewitt/following{/other_user}", "gists_url": "https://api.github.com/users/nateprewitt/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/nateprewitt", "id": 5271761, "login": "nateprewitt", "node_id": "MDQ6VXNlcjUyNzE3NjE=", "organizations_url": "https://api.github.com/users/nateprewitt/orgs", "received_events_url": "https://api.github.com/users/nateprewitt/received_events", "repos_url": "https://api.github.com/users/nateprewitt/repos", "site_admin": false, "starred_url": "https://api.github.com/users/nateprewitt/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/nateprewitt/subscriptions", "type": "User", "url": "https://api.github.com/users/nateprewitt", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/6157/reactions" }
https://api.github.com/repos/psf/requests/issues/6157/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/6157.diff", "html_url": "https://github.com/psf/requests/pull/6157", "merged_at": "2022-06-08T19:11:11Z", "patch_url": "https://github.com/psf/requests/pull/6157.patch", "url": "https://api.github.com/repos/psf/requests/pulls/6157" }
true
[]
https://api.github.com/repos/psf/requests/issues/6156
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6156/labels{/name}
https://api.github.com/repos/psf/requests/issues/6156/comments
https://api.github.com/repos/psf/requests/issues/6156/events
https://github.com/psf/requests/pull/6156
1,264,164,254
PR_kwDOABTKOs45SghV
6,156
v2.28.0
{ "avatar_url": "https://avatars.githubusercontent.com/u/5271761?v=4", "events_url": "https://api.github.com/users/nateprewitt/events{/privacy}", "followers_url": "https://api.github.com/users/nateprewitt/followers", "following_url": "https://api.github.com/users/nateprewitt/following{/other_user}", "gists_url": "https://api.github.com/users/nateprewitt/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/nateprewitt", "id": 5271761, "login": "nateprewitt", "node_id": "MDQ6VXNlcjUyNzE3NjE=", "organizations_url": "https://api.github.com/users/nateprewitt/orgs", "received_events_url": "https://api.github.com/users/nateprewitt/received_events", "repos_url": "https://api.github.com/users/nateprewitt/repos", "site_admin": false, "starred_url": "https://api.github.com/users/nateprewitt/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/nateprewitt/subscriptions", "type": "User", "url": "https://api.github.com/users/nateprewitt", "user_view_type": "public" }
[]
closed
true
null
[]
null
0
2022-06-08T04:10:18Z
2023-06-10T00:03:21Z
2022-06-09T14:42:10Z
MEMBER
resolved
2.28.0 (2022-06-09) ------------------- **Deprecations** - ⚠️ Requests has officially dropped support for Python 2.7. ⚠️ (#6091) - Requests has officially dropped support for Python 3.6 (including pypy3). (#6091) **Improvements** - Wrap JSON parsing issues in Request's JSONDecodeError for payloads without an encoding to make `json()` API consistent. (#6097) - Parse header components consistently, raising an InvalidHeader error in all invalid cases. (#6154) - Added provisional 3.11 support with current beta build. (#6155) - Requests got a makeover and we decided to paint it black. (#6095) **Bugfixes** - Fixed bug where setting `CURL_CA_BUNDLE` to an empty string would disable cert verification. All Requests 2.x versions before 2.28.0 are affected. (#6074) - Fixed urllib3 exception leak, wrapping `urllib3.exceptions.SSLError` with `requests.exceptions.SSLError` for `content` and `iter_content`. (#6057) - Fixed issue where invalid Windows registry entires caused proxy resolution to raise an exception rather than ignoring the entry. (#6149) - Fixed issue where entire payload could be included in the error message for JSONDecodeError. (#6079
{ "avatar_url": "https://avatars.githubusercontent.com/u/5271761?v=4", "events_url": "https://api.github.com/users/nateprewitt/events{/privacy}", "followers_url": "https://api.github.com/users/nateprewitt/followers", "following_url": "https://api.github.com/users/nateprewitt/following{/other_user}", "gists_url": "https://api.github.com/users/nateprewitt/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/nateprewitt", "id": 5271761, "login": "nateprewitt", "node_id": "MDQ6VXNlcjUyNzE3NjE=", "organizations_url": "https://api.github.com/users/nateprewitt/orgs", "received_events_url": "https://api.github.com/users/nateprewitt/received_events", "repos_url": "https://api.github.com/users/nateprewitt/repos", "site_admin": false, "starred_url": "https://api.github.com/users/nateprewitt/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/nateprewitt/subscriptions", "type": "User", "url": "https://api.github.com/users/nateprewitt", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 1, "laugh": 0, "rocket": 0, "total_count": 1, "url": "https://api.github.com/repos/psf/requests/issues/6156/reactions" }
https://api.github.com/repos/psf/requests/issues/6156/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/6156.diff", "html_url": "https://github.com/psf/requests/pull/6156", "merged_at": "2022-06-09T14:42:10Z", "patch_url": "https://github.com/psf/requests/pull/6156.patch", "url": "https://api.github.com/repos/psf/requests/pulls/6156" }
true
[]
https://api.github.com/repos/psf/requests/issues/6155
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6155/labels{/name}
https://api.github.com/repos/psf/requests/issues/6155/comments
https://api.github.com/repos/psf/requests/issues/6155/events
https://github.com/psf/requests/pull/6155
1,264,159,628
PR_kwDOABTKOs45SfkJ
6,155
Run 3.11 CI on all platforms
{ "avatar_url": "https://avatars.githubusercontent.com/u/5271761?v=4", "events_url": "https://api.github.com/users/nateprewitt/events{/privacy}", "followers_url": "https://api.github.com/users/nateprewitt/followers", "following_url": "https://api.github.com/users/nateprewitt/following{/other_user}", "gists_url": "https://api.github.com/users/nateprewitt/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/nateprewitt", "id": 5271761, "login": "nateprewitt", "node_id": "MDQ6VXNlcjUyNzE3NjE=", "organizations_url": "https://api.github.com/users/nateprewitt/orgs", "received_events_url": "https://api.github.com/users/nateprewitt/received_events", "repos_url": "https://api.github.com/users/nateprewitt/repos", "site_admin": false, "starred_url": "https://api.github.com/users/nateprewitt/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/nateprewitt/subscriptions", "type": "User", "url": "https://api.github.com/users/nateprewitt", "user_view_type": "public" }
[]
closed
true
null
[]
null
0
2022-06-08T04:03:55Z
2023-06-09T00:03:13Z
2022-06-08T16:12:53Z
MEMBER
resolved
Start testing 3.11-dev on both Windows and macOS since we're publishing 2.28.0 claiming support for 3.11 with our trove classifier.
{ "avatar_url": "https://avatars.githubusercontent.com/u/5271761?v=4", "events_url": "https://api.github.com/users/nateprewitt/events{/privacy}", "followers_url": "https://api.github.com/users/nateprewitt/followers", "following_url": "https://api.github.com/users/nateprewitt/following{/other_user}", "gists_url": "https://api.github.com/users/nateprewitt/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/nateprewitt", "id": 5271761, "login": "nateprewitt", "node_id": "MDQ6VXNlcjUyNzE3NjE=", "organizations_url": "https://api.github.com/users/nateprewitt/orgs", "received_events_url": "https://api.github.com/users/nateprewitt/received_events", "repos_url": "https://api.github.com/users/nateprewitt/repos", "site_admin": false, "starred_url": "https://api.github.com/users/nateprewitt/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/nateprewitt/subscriptions", "type": "User", "url": "https://api.github.com/users/nateprewitt", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/6155/reactions" }
https://api.github.com/repos/psf/requests/issues/6155/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/6155.diff", "html_url": "https://github.com/psf/requests/pull/6155", "merged_at": "2022-06-08T16:12:53Z", "patch_url": "https://github.com/psf/requests/pull/6155.patch", "url": "https://api.github.com/repos/psf/requests/pulls/6155" }
true
[]
https://api.github.com/repos/psf/requests/issues/6154
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6154/labels{/name}
https://api.github.com/repos/psf/requests/issues/6154/comments
https://api.github.com/repos/psf/requests/issues/6154/events
https://github.com/psf/requests/pull/6154
1,264,158,603
PR_kwDOABTKOs45SfWI
6,154
Add validation for header name
{ "avatar_url": "https://avatars.githubusercontent.com/u/5271761?v=4", "events_url": "https://api.github.com/users/nateprewitt/events{/privacy}", "followers_url": "https://api.github.com/users/nateprewitt/followers", "following_url": "https://api.github.com/users/nateprewitt/following{/other_user}", "gists_url": "https://api.github.com/users/nateprewitt/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/nateprewitt", "id": 5271761, "login": "nateprewitt", "node_id": "MDQ6VXNlcjUyNzE3NjE=", "organizations_url": "https://api.github.com/users/nateprewitt/orgs", "received_events_url": "https://api.github.com/users/nateprewitt/received_events", "repos_url": "https://api.github.com/users/nateprewitt/repos", "site_admin": false, "starred_url": "https://api.github.com/users/nateprewitt/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/nateprewitt/subscriptions", "type": "User", "url": "https://api.github.com/users/nateprewitt", "user_view_type": "public" }
[]
closed
true
null
[]
null
0
2022-06-08T04:02:40Z
2023-06-09T00:03:13Z
2022-06-08T18:03:56Z
MEMBER
resolved
Following up on #6083, this refactors our header validation function from 2.11.0 to consider the header name. We'd originally avoided adding header name validation because we wanted to limit the change scope to header splitting with new lines. Since then the standard library has made similar changes to ours and now raises a ValueError in `http.client`. This gives us inconsistent errors depending on which portion of the header you provide a bad value. ```python >>> requests.get("https://httpbin.org/get", headers={":bad": "header"}) Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/Users/nateprewitt/Work/OpenSource/requests/requests/api.py", line 73, in get return request("get", url, params=params, **kwargs) File "/Users/nateprewitt/Work/OpenSource/requests/requests/api.py", line 59, in request return session.request(method=method, url=url, **kwargs) File "/Users/nateprewitt/Work/OpenSource/requests/requests/sessions.py", line 587, in request resp = self.send(prep, **send_kwargs) File "/Users/nateprewitt/Work/OpenSource/requests/requests/sessions.py", line 701, in send r = adapter.send(request, **kwargs) File "/Users/nateprewitt/Work/OpenSource/requests/requests/adapters.py", line 489, in send resp = conn.urlopen( File "/Users/nateprewitt/Work/OpenSource/urllib3/src/urllib3/connectionpool.py", line 727, in urlopen httplib_response = self._make_request( File "/Users/nateprewitt/Work/OpenSource/urllib3/src/urllib3/connectionpool.py", line 433, in _make_request conn.request(method, url, **httplib_request_kw) File "/Users/nateprewitt/Work/OpenSource/urllib3/src/urllib3/connection.py", line 309, in request super().request(method, url, body=body, headers=headers) File "/Users/nateprewitt/.pyenv/versions/3.10.4/lib/python3.10/http/client.py", line 1282, in request self._send_request(method, url, body, headers, encode_chunked) File "/Users/nateprewitt/.pyenv/versions/3.10.4/lib/python3.10/http/client.py", line 1323, in _send_request self.putheader(hdr, value) File "/Users/nateprewitt/Work/OpenSource/urllib3/src/urllib3/connection.py", line 274, in putheader super().putheader(header, *values) File "/Users/nateprewitt/.pyenv/versions/3.10.4/lib/python3.10/http/client.py", line 1250, in putheader raise ValueError('Invalid header name %r' % (header,)) ValueError: Invalid header name b':bad' ``` This PR ports the [validation scheme](https://github.com/python/cpython/blob/6b9122483f1f26afb0c41bd676f9754ffe726e18/Lib/http/client.py#L139) from http.client for header names and ensures we raise an `InvalidHeader` error consistently in all supported versions.
{ "avatar_url": "https://avatars.githubusercontent.com/u/5271761?v=4", "events_url": "https://api.github.com/users/nateprewitt/events{/privacy}", "followers_url": "https://api.github.com/users/nateprewitt/followers", "following_url": "https://api.github.com/users/nateprewitt/following{/other_user}", "gists_url": "https://api.github.com/users/nateprewitt/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/nateprewitt", "id": 5271761, "login": "nateprewitt", "node_id": "MDQ6VXNlcjUyNzE3NjE=", "organizations_url": "https://api.github.com/users/nateprewitt/orgs", "received_events_url": "https://api.github.com/users/nateprewitt/received_events", "repos_url": "https://api.github.com/users/nateprewitt/repos", "site_admin": false, "starred_url": "https://api.github.com/users/nateprewitt/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/nateprewitt/subscriptions", "type": "User", "url": "https://api.github.com/users/nateprewitt", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/6154/reactions" }
https://api.github.com/repos/psf/requests/issues/6154/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/6154.diff", "html_url": "https://github.com/psf/requests/pull/6154", "merged_at": "2022-06-08T18:03:56Z", "patch_url": "https://github.com/psf/requests/pull/6154.patch", "url": "https://api.github.com/repos/psf/requests/pulls/6154" }
true
[]
https://api.github.com/repos/psf/requests/issues/6153
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6153/labels{/name}
https://api.github.com/repos/psf/requests/issues/6153/comments
https://api.github.com/repos/psf/requests/issues/6153/events
https://github.com/psf/requests/issues/6153
1,263,071,144
I_kwDOABTKOs5LSO-o
6,153
Strange difference between passing proxy as None vs an empty string
{ "avatar_url": "https://avatars.githubusercontent.com/u/3709570?v=4", "events_url": "https://api.github.com/users/xjcl/events{/privacy}", "followers_url": "https://api.github.com/users/xjcl/followers", "following_url": "https://api.github.com/users/xjcl/following{/other_user}", "gists_url": "https://api.github.com/users/xjcl/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/xjcl", "id": 3709570, "login": "xjcl", "node_id": "MDQ6VXNlcjM3MDk1NzA=", "organizations_url": "https://api.github.com/users/xjcl/orgs", "received_events_url": "https://api.github.com/users/xjcl/received_events", "repos_url": "https://api.github.com/users/xjcl/repos", "site_admin": false, "starred_url": "https://api.github.com/users/xjcl/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/xjcl/subscriptions", "type": "User", "url": "https://api.github.com/users/xjcl", "user_view_type": "public" }
[]
closed
true
null
[]
null
8
2022-06-07T10:25:12Z
2023-06-17T00:03:18Z
2022-06-08T18:22:34Z
NONE
resolved
At work we have to deal with an annoying proxy server when making automated HTTP requests, e.g. in Python. To deal with this we usually add `proxies={"http": None, "https": None}` to any request, but recently this started breaking down when we started receiving HTTP redirects (301 Moved Permanently). After struggling with this issue by trying out different versions of dependencies, we finally figured out that passing an empty string vs None produced different behavior, with the behavior of None being strictly worse. ## Reproduction Steps To reproduce this you need some kind of proxy server setup, I cannot give instructions on how to achieve this. Code snippet "empty string": ```python requests.get("https://pypi.org/pypi/pillow/9.0.0/json", proxies={"http": "", "https": ""}) ``` Code snippet "None": ```python requests.get("https://pypi.org/pypi/pillow/9.0.0/json", proxies={"http": None, "https": None}) ``` Code snippet "(no proxies)": ```python requests.get("https://pypi.org/pypi/pillow/9.0.0/json") ``` ## Expected Result Using uppercase Pillow should result in a successful HTTP request (200). Using lowercase pillow should result in a redirect to uppercase Pillow (301) which `requests` resolves with a second GET that is successful (200). ## Actual Result Unexpected result in italic: | | Pillow | pillow | | ------------- |:-------------:|:-----:| | empty string | OK | OK | | None | OK | _SSLError_ | | (no proxies) | SSLError | SSLError | I will shorten the actual very long set of 3 tracebacks we receive to: ``` File "...\python\lib\ssl.py", line 1139, in do_handshake self._sslobj.do_handshake() ssl.SSLError: [SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1076) During handling of the above exception, another exception occurred: File: "...\site-packages\urllib3\util\retry.py", line 573, in increment raise MaxRetryError(_pool, url, error or ResponseError(cause)) urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(...): Max retries exceeded with url: ... During handling of the above exception, another exception occurred: File "..\site-packages\requests\adapters.py", line 514, in send raise SSLError(e, request=request) requests.exception.SSLError: HTTPSConnectionPool(...): Max retries exceeded with url: ... ``` It is not surprising that we get an SSLError when using no proxy parameter, but I find it odd that there is a semantic difference between passing `None` and `""`, (empty string), and could not find any documentation referencing that difference. Further reading on StackOverflow: https://stackoverflow.com/a/72529216/2111778 ## System Information - chardet 4.0.0 - cryptography absent - idna 2.10 - implementation CPython 3.7.7 - platform Windows 10 - pyOpenSSL absent - requests 2.25.1 - system_ssl 1010104f - urllib3 1.26.3 - using_pyopenssl false
{ "avatar_url": "https://avatars.githubusercontent.com/u/5271761?v=4", "events_url": "https://api.github.com/users/nateprewitt/events{/privacy}", "followers_url": "https://api.github.com/users/nateprewitt/followers", "following_url": "https://api.github.com/users/nateprewitt/following{/other_user}", "gists_url": "https://api.github.com/users/nateprewitt/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/nateprewitt", "id": 5271761, "login": "nateprewitt", "node_id": "MDQ6VXNlcjUyNzE3NjE=", "organizations_url": "https://api.github.com/users/nateprewitt/orgs", "received_events_url": "https://api.github.com/users/nateprewitt/received_events", "repos_url": "https://api.github.com/users/nateprewitt/repos", "site_admin": false, "starred_url": "https://api.github.com/users/nateprewitt/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/nateprewitt/subscriptions", "type": "User", "url": "https://api.github.com/users/nateprewitt", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/6153/reactions" }
https://api.github.com/repos/psf/requests/issues/6153/timeline
null
completed
null
null
false
[ "Stepping through the code with breakpoints I noticed a difference in the function \"rebuild_proxies\" which seems to get called when a redirect occurs. In the empty string case we already have \"\" defined as http(s) proxy so nothing gets overwritten. In the None case the keys for http(s) proxies are absent so they get set using get_environ_proxies.", "Looks like the function merge_setting in the sessions.py module explicitly deletes any Nones (check the variable none_keys). This means http and https proxies end up missing from the dictionary which works fine for the first request, but rebuild_proxies tries to add them back in for the redirect.", "Hi @xjcl, this is the expected behavior and generally how the library operates. `None` values will be stripped from headers and most settings. I don't think we'd intend to change that behavior without a very strong reason.\r\n\r\nWhat you're trying to accomplish here though is already supported without trying to override the proxies with null values. If you set `trust_env` to `False` on your Session, it won't pull proxy information from your env vars or system settings. Is that not working for your case? We'd also recommend making sure the issue you're seeing is still present in the latest version (2.27.1) as proxy behavior was recently reworked.", "Going to resolve this since we haven't heard back. Feel free to reopen if you have further questions or find the recommended approach isn't working.", "@nateprewitt The use case here is to disable the proxies without the other side effects of `trust_env`. What is the recommended approach in that case?", "@jtpereyda would you mind providing a concrete example of the other side effects you're trying to avoid?", "@nateprewitt Are all the effects documented anywhere? I have read that trust_env also ignores:\r\n\r\n- Authentication information from .netrc\r\n- CA bundles defined in REQUESTS_CA_BUNDLE or CURL_CA_BUNDLE\r\n\r\nBoth of which are relevant for some of my use cases.", ".netrc info can be supplied via the `auth` parameter in this case and the ca_bundle via `verify`. If neither of those are satisfactory, the original posts details how you can disable the proxies with empty strings.\r\n\r\nThe original question was about the difference between an empty string and `None`. `None` has a semantic of \"do not use this key\" in the library, hence the difference in behavior." ]
https://api.github.com/repos/psf/requests/issues/6151
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6151/labels{/name}
https://api.github.com/repos/psf/requests/issues/6151/comments
https://api.github.com/repos/psf/requests/issues/6151/events
https://github.com/psf/requests/pull/6151
1,257,122,890
PR_kwDOABTKOs4464Kq
6,151
Use SPDX License ID correctly
{ "avatar_url": "https://avatars.githubusercontent.com/u/56723830?v=4", "events_url": "https://api.github.com/users/dmholtz/events{/privacy}", "followers_url": "https://api.github.com/users/dmholtz/followers", "following_url": "https://api.github.com/users/dmholtz/following{/other_user}", "gists_url": "https://api.github.com/users/dmholtz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/dmholtz", "id": 56723830, "login": "dmholtz", "node_id": "MDQ6VXNlcjU2NzIzODMw", "organizations_url": "https://api.github.com/users/dmholtz/orgs", "received_events_url": "https://api.github.com/users/dmholtz/received_events", "repos_url": "https://api.github.com/users/dmholtz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/dmholtz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/dmholtz/subscriptions", "type": "User", "url": "https://api.github.com/users/dmholtz", "user_view_type": "public" }
[]
closed
true
null
[]
null
9
2022-06-01T21:51:16Z
2023-06-03T00:02:53Z
2022-06-02T16:13:51Z
NONE
resolved
[Software Package Data Exchange (SPDX)](https://spdx.org/) is an open standard for communication software bill of material information. According to the [SPDX License List](https://spdx.org/licenses) `Apache-2.0` is an unambiguous short identifier for the [Apache License 2.0](https://www.apache.org/licenses/LICENSE-2.0), which holds for the requests project. This PR proposes to use this SPDX Identifier rather than `Apache 2.0` (without hyphen). Note that the proposed change does not change the license of the project but rather declares it unambiguously in a machine-readable format. As a result, the packaged version on PyPi will also be updated once requests is built again and all metadata crawlers will benefit from the change.
{ "avatar_url": "https://avatars.githubusercontent.com/u/5271761?v=4", "events_url": "https://api.github.com/users/nateprewitt/events{/privacy}", "followers_url": "https://api.github.com/users/nateprewitt/followers", "following_url": "https://api.github.com/users/nateprewitt/following{/other_user}", "gists_url": "https://api.github.com/users/nateprewitt/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/nateprewitt", "id": 5271761, "login": "nateprewitt", "node_id": "MDQ6VXNlcjUyNzE3NjE=", "organizations_url": "https://api.github.com/users/nateprewitt/orgs", "received_events_url": "https://api.github.com/users/nateprewitt/received_events", "repos_url": "https://api.github.com/users/nateprewitt/repos", "site_admin": false, "starred_url": "https://api.github.com/users/nateprewitt/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/nateprewitt/subscriptions", "type": "User", "url": "https://api.github.com/users/nateprewitt", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/6151/reactions" }
https://api.github.com/repos/psf/requests/issues/6151/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/6151.diff", "html_url": "https://github.com/psf/requests/pull/6151", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/6151.patch", "url": "https://api.github.com/repos/psf/requests/pulls/6151" }
true
[ "I'm relatively indifferent. I can't find any notable Python packages using Apache 2.0 with this approach, they're all using `Apache 2.0`. It's hard to tell if this is an alternatively established standard, or if everyone has been copying us. I'll need to do a little more digging before we merge this.", "`__license__` isn't standardized or supposed (or not supposed) to be SPDX. Likewise the license text is from the Apache foundation itself. The license field in PyPI metadata is also free form. The classifiers are what are standardized and what I believe uses SPDX. If those are right this is superfluous and unnecessary ", "Thanks a lot for your responses.\r\n\r\n@nateprewitt\r\nI've investigated license metadata of packages in a recent project and caught this issue that way. Some other Python packages do the following.\r\n* [Connexion](https://github.com/spec-first/connexion/blob/main/setup.py) declares the full name of the license `Apache License Version 2.0`, which is more verbose but also unambiguous.\r\n* [Cryptography](https://github.com/pyca/cryptography/blob/main/setup.cfg) uses a valid SPDX expression for their dual-license model: `BSD-3-Clause OR Apache-2.0`. Note that both sides of the disjunction are SPDX Identifiers.\r\n* [Packaging](https://github.com/pypa/packaging/blob/main/packaging/__about__.py) does the same thing `BSD-2-Clause or Apache-2.0`.\r\n\r\nThis is just a selection of some major packages that I frequently use and there are many more examples.\r\n\r\n@sigmavirus24 \r\nOf course, `__license__` has barely any semantics. However, the main reason why I created this PR is that [setup.py](https://github.com/psf/requests/blob/main/setup.py) refers to `__license__` and uses its content as a metadata field. As shown above, the community has (to a certain degree) agreed on using SPDX and even [Apache](https://www.apache.org/licenses/LICENSE-2.0) refers to the SPDX IDs explicitly.\r\nSPDX helps to automate SBOM creation which has a huge impact on processes in industry as well as the adaption of OS Software in Industry.\r\n\r\nImho, classifiers cannot solve this issue: Firstly, the existing classifier is not really useful, since a human must conclude which exact License Text is meant by `Apache Software License`. Secondly, [PEP 639](https://peps.python.org/pep-0639/) even deprecates the `license :: `classifiers.", "> Thanks a lot for your responses.\n> This is just a selection of some major packages that I frequently use and there are many more examples.\n\nThe fact that they are major means they've already had other people lie to them about the semantics of the license attribute in python packaging metadata.\n\n> @sigmavirus24 \n> Of course, `__license__` has barely any semantics. However, the main reason why I created this PR is that [setup.py](https://github.com/psf/requests/blob/main/setup.py) refers to `__license__` and uses its content as a metadata field. \n\nIf you read my response closely that's what I'm talking about. The license field in python packaging metadata is not SPDX and cannot be. PyPI isn't the only repository and even it allows closed source and proprietary licenses that have no SPDX classifier. It's intended to be free form text as Cryptography uses it. \n\n>As shown above, the community has (to a certain degree) agreed on using SPDX and even [Apache](https://www.apache.org/licenses/LICENSE-2.0) refers to the SPDX IDs explicitly.\n\nCheck the history of that page. I'm willing to bet it didn't when this project started using the license. \n\n> SPDX helps to automate SBOM creation which has a huge impact on processes in industry as well as the adaption of OS Software in Industry.\n\nI'm well aware of it and the fragile way most companies implement it as well as the fragile solutions sold by others.\n\n> Imho, classifiers cannot solve this issue: Firstly, the existing classifier is not really useful, since a human must conclude which exact License Text is meant by `Apache Software License`. Secondly, [PEP 639](https://peps.python.org/pep-0639/) even deprecates the `license :: `classifiers.\n\nThat's disappointing as those classifiers are the only reliable source of that information. That PEP is only a draft though. It hasn't been accepted. It may well never be accepted and had no weight on this conversation as such. Also that PEP would deprecate the license field you want us to put SPDX in. In other words, you want us to do what you want based off an unaccepted pep (from 2019) deprecating the exact thing you want us to change.\n\n\n---\nDisclaimer: responding in the middle of the night from my phone while helping anewborn connect sleep cycles. Please excuse brevity and typos ", "First of all, I have to admit that PEP 639 was really not a helpful argument. I completely missed the fact that it has not even been accepted yet. Please excuse the confusion.\r\n\r\nThe classifiers may be standardized to a certain extent but they often remain imprecise (for instance, they don't tell the exact version of a BSD License or Apache License). One can at least deduce whether a license is permissive or copy-left.\r\n\r\nWe can also agree that the `license` metadata key is just a plain string without any SPDX semantics.\r\nFor that reason, one could remain the PR to somethink like \"Make value of license key in metadata more useful\". There is obviously no _correct_ usage of that `license` metadata key.\r\n\r\nHowever, I still believe that `Apache-2.0` is more expressive than `Apache 2.0` since it is at least a standardized term. Developers who spot SPDX IDs everyday will consider this as helpful, other people will likely not care.\r\n\r\nMay I ask for what reason have you originally decided on `Apache 2.0`?\r\n\r\nFinally, I cannot resolve your initial argument: no semantics of that key -> any efforts in changing the content are \"superfluous and unnecessary\". So this PR may not the right place to discuss such fundamental question because noone will resolve this dilemma in the foreseeable future.", "> I think we can go back and forth for quite a while on the volatility/usefulness of parsing the license field. Ideally PyPI would provide exact trove-classifiers to unambiguously define the license, or we’d propose an PEP to get an alternative mechanism setup.\n\nActually trove classifiers are easy to propose, easy to adopt, and as far as I understood - low overhead for PyPI. I see no reason they couldn't be made more helpful and potentially include the appropriate SPDX information especially since I believe they're indexed for search (where license is not)\n\n> \n> That’s a long process though. For the time being, I see cryptography did recently make [this change](https://github.com/pyca/cryptography/pull/7050/files) as well. I’m fine following if this is a direction the community wants to move.\n\nI hesitate to say that it's the direction the community is moving in. \n\nQuoting the SPDX wiki: ( https://wiki.spdx.org/view/SPDX_FAQ )\n\n> How does one represent a file or package that is dual licensed (i.e., a license choice)?\n> SPDX license information can be represented using conjunctive or disjunctive regular expressions. For example, a file that is dual licensed under either the GPL-2.0 or MIT would be represented using the following disjunctive expression: (GPL-2.0 or MIT).\n> How does one represent a file that is licensed under two or more licenses?\n> SPDX license information can be represented using conjunctive or disjunctive regular expressions. For example, a file that is subject to the Apache-2.0, MIT and GPL-2.0 would be represented using the following conjunctive expression: (Apache-2.0 and MIT and GPL-2.0).\n\nAs such Cryptography would have to include parenthesis to be a valid classifier and yet that seems sufficient that some tools can handle the absence but no tools can handle a space instead of a hyphen?\n\nI'm arguing this change because every time a standard like this comes along someone wants to change the metadata and it breaks someone else. \n\nGiven there's no way to enforce this attribute is SPDX compliant in the tooling we rely on our might rely on, there's no preventing a regression. I'm okay justifying the license text with what the ASF now uses (compared to what it was when Kenneth (likely illegally) switched to it). I just see little value in encouraging PRs to tweak this every few years for a non-semantic field that may end up deprecated anyway. I'd also expect there are people that will try to edit every other reference to Apache 2.0 to the hyphenated version in a misguided effort to help. ", "Off-topic, but parenthesis in the case of cryptography are [not required](https://spdx.dev/ids/) to be a valid SPDX expression.\r\n\r\n> I think we can go back and forth for quite a while on the volatility/usefulness of parsing the license field. Ideally PyPI would provide exact trove-classifiers to unambiguously define the license, or we’d propose an PEP to get an alternative mechanism setup.\r\n\r\nThat's exactly my point.\r\n\r\nBut I also understand your concerns well for avoiding spam of PRs fixing missing hypens or introducing community trends (although I strongly believe that SPDX is more than a trend) without having a standard to follow.", "> Off-topic, but parenthesis in the case of cryptography are [not required](https://spdx.dev/ids/) to be a valid SPDX expression.\n> \n> > I think we can go back and forth for quite a while on the volatility/usefulness of parsing the license field. Ideally PyPI would provide exact trove-classifiers to unambiguously define the license, or we’d propose an PEP to get an alternative mechanism setup.\n> \n> That's exactly my point.\n> \n> But I also understand your concerns well for avoiding spam of PRs fixing missing hypens or introducing community trends (although I strongly believe that SPDX is more than a trend) without having a standard to follow.\n\nPeople said openstack wasn't a trend but it's decreasing in popularity and such while the next trend (Kiss) is on the ascent. And yes OS had quite a number of good years there just as SPDX had been gaining popularity for years now. ", "Alright, given we have some strong contention on this and as I originally said, I'm not particularly opinionated, I'm going to propose we table this PR for the time being.\r\n\r\nLet's see how PEP 639 plays out, it looks like Ofek and some other well-known maintainers are already starting to adopt. That will likely be the path going forward, and we'll have definitive guidance on what changes _need_ to be made. Thanks for starting this dicussion @dmholtz, and feel free to check back in when the PEP has a final decision." ]
https://api.github.com/repos/psf/requests/issues/6150
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6150/labels{/name}
https://api.github.com/repos/psf/requests/issues/6150/comments
https://api.github.com/repos/psf/requests/issues/6150/events
https://github.com/psf/requests/pull/6150
1,256,611,057
PR_kwDOABTKOs445BqS
6,150
Reduce lock thread runs to daily
{ "avatar_url": "https://avatars.githubusercontent.com/u/5271761?v=4", "events_url": "https://api.github.com/users/nateprewitt/events{/privacy}", "followers_url": "https://api.github.com/users/nateprewitt/followers", "following_url": "https://api.github.com/users/nateprewitt/following{/other_user}", "gists_url": "https://api.github.com/users/nateprewitt/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/nateprewitt", "id": 5271761, "login": "nateprewitt", "node_id": "MDQ6VXNlcjUyNzE3NjE=", "organizations_url": "https://api.github.com/users/nateprewitt/orgs", "received_events_url": "https://api.github.com/users/nateprewitt/received_events", "repos_url": "https://api.github.com/users/nateprewitt/repos", "site_admin": false, "starred_url": "https://api.github.com/users/nateprewitt/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/nateprewitt/subscriptions", "type": "User", "url": "https://api.github.com/users/nateprewitt", "user_view_type": "public" }
[]
closed
true
null
[]
null
0
2022-06-01T17:35:28Z
2023-06-02T00:03:16Z
2022-06-01T17:51:04Z
MEMBER
resolved
We moved the lock thread GH action to hourly to push through our initial backlog and never updated it. We're wasting a lot of compute and cluttering our action log with the existing settings. This PR will reduce the job to only run once a day going forward. We'll also update the action from v2 to v3 while we're here.
{ "avatar_url": "https://avatars.githubusercontent.com/u/5271761?v=4", "events_url": "https://api.github.com/users/nateprewitt/events{/privacy}", "followers_url": "https://api.github.com/users/nateprewitt/followers", "following_url": "https://api.github.com/users/nateprewitt/following{/other_user}", "gists_url": "https://api.github.com/users/nateprewitt/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/nateprewitt", "id": 5271761, "login": "nateprewitt", "node_id": "MDQ6VXNlcjUyNzE3NjE=", "organizations_url": "https://api.github.com/users/nateprewitt/orgs", "received_events_url": "https://api.github.com/users/nateprewitt/received_events", "repos_url": "https://api.github.com/users/nateprewitt/repos", "site_admin": false, "starred_url": "https://api.github.com/users/nateprewitt/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/nateprewitt/subscriptions", "type": "User", "url": "https://api.github.com/users/nateprewitt", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/6150/reactions" }
https://api.github.com/repos/psf/requests/issues/6150/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/6150.diff", "html_url": "https://github.com/psf/requests/pull/6150", "merged_at": "2022-06-01T17:51:04Z", "patch_url": "https://github.com/psf/requests/pull/6150.patch", "url": "https://api.github.com/repos/psf/requests/pulls/6150" }
true
[]
https://api.github.com/repos/psf/requests/issues/6149
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6149/labels{/name}
https://api.github.com/repos/psf/requests/issues/6149/comments
https://api.github.com/repos/psf/requests/issues/6149/events
https://github.com/psf/requests/pull/6149
1,256,335,834
PR_kwDOABTKOs444DV6
6,149
Tolerate bad registry entries in Windows proxy settings
{ "avatar_url": "https://avatars.githubusercontent.com/u/5271761?v=4", "events_url": "https://api.github.com/users/nateprewitt/events{/privacy}", "followers_url": "https://api.github.com/users/nateprewitt/followers", "following_url": "https://api.github.com/users/nateprewitt/following{/other_user}", "gists_url": "https://api.github.com/users/nateprewitt/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/nateprewitt", "id": 5271761, "login": "nateprewitt", "node_id": "MDQ6VXNlcjUyNzE3NjE=", "organizations_url": "https://api.github.com/users/nateprewitt/orgs", "received_events_url": "https://api.github.com/users/nateprewitt/received_events", "repos_url": "https://api.github.com/users/nateprewitt/repos", "site_admin": false, "starred_url": "https://api.github.com/users/nateprewitt/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/nateprewitt/subscriptions", "type": "User", "url": "https://api.github.com/users/nateprewitt", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2022-06-01T15:48:19Z
2023-06-02T00:03:17Z
2022-06-01T17:36:26Z
MEMBER
resolved
This PR will address #6104. Requests will now handle bad registry entries more gracefully when checking proxy settings from the host. When invalid entries are encountered, the ProxyEnabled setting will be ignored as if they didn't exist rather than throwing an exception.
{ "avatar_url": "https://avatars.githubusercontent.com/u/5271761?v=4", "events_url": "https://api.github.com/users/nateprewitt/events{/privacy}", "followers_url": "https://api.github.com/users/nateprewitt/followers", "following_url": "https://api.github.com/users/nateprewitt/following{/other_user}", "gists_url": "https://api.github.com/users/nateprewitt/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/nateprewitt", "id": 5271761, "login": "nateprewitt", "node_id": "MDQ6VXNlcjUyNzE3NjE=", "organizations_url": "https://api.github.com/users/nateprewitt/orgs", "received_events_url": "https://api.github.com/users/nateprewitt/received_events", "repos_url": "https://api.github.com/users/nateprewitt/repos", "site_admin": false, "starred_url": "https://api.github.com/users/nateprewitt/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/nateprewitt/subscriptions", "type": "User", "url": "https://api.github.com/users/nateprewitt", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/6149/reactions" }
https://api.github.com/repos/psf/requests/issues/6149/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/6149.diff", "html_url": "https://github.com/psf/requests/pull/6149", "merged_at": "2022-06-01T17:36:26Z", "patch_url": "https://github.com/psf/requests/pull/6149.patch", "url": "https://api.github.com/repos/psf/requests/pulls/6149" }
true
[ "Looks like 3.11 test failure is related to https://github.com/pytest-dev/pytest/issues/10008." ]
https://api.github.com/repos/psf/requests/issues/6148
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6148/labels{/name}
https://api.github.com/repos/psf/requests/issues/6148/comments
https://api.github.com/repos/psf/requests/issues/6148/events
https://github.com/psf/requests/issues/6148
1,254,684,336
I_kwDOABTKOs5KyPaw
6,148
<removed>
{ "avatar_url": "https://avatars.githubusercontent.com/u/76781560?v=4", "events_url": "https://api.github.com/users/CanoBot/events{/privacy}", "followers_url": "https://api.github.com/users/CanoBot/followers", "following_url": "https://api.github.com/users/CanoBot/following{/other_user}", "gists_url": "https://api.github.com/users/CanoBot/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/CanoBot", "id": 76781560, "login": "CanoBot", "node_id": "MDQ6VXNlcjc2NzgxNTYw", "organizations_url": "https://api.github.com/users/CanoBot/orgs", "received_events_url": "https://api.github.com/users/CanoBot/received_events", "repos_url": "https://api.github.com/users/CanoBot/repos", "site_admin": false, "starred_url": "https://api.github.com/users/CanoBot/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/CanoBot/subscriptions", "type": "User", "url": "https://api.github.com/users/CanoBot", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2022-06-01T02:03:40Z
2022-06-01T02:18:53Z
2022-06-01T02:07:30Z
NONE
null
Please refer to our [Stack Overflow tag](https://stackoverflow.com/questions/tagged/python-requests) for guidance. usuario@host:~$ cat /tmp/a este es un archivo de texto simple. usuario@host:~$ python xorfile.py /tmp/a Sup3rS3cr3t archivo borrado usuario@host:~$ cat /tmp/a <... algunos caracteres no imprimibles...> usuario@host:~$ python xorfile.py /tmp/a Sup3rS3cr3t archivo borrado usuario@host:~$ cat /tmp/a este es un archivo de texto simple. usuario@host:~$
{ "avatar_url": "https://avatars.githubusercontent.com/u/5271761?v=4", "events_url": "https://api.github.com/users/nateprewitt/events{/privacy}", "followers_url": "https://api.github.com/users/nateprewitt/followers", "following_url": "https://api.github.com/users/nateprewitt/following{/other_user}", "gists_url": "https://api.github.com/users/nateprewitt/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/nateprewitt", "id": 5271761, "login": "nateprewitt", "node_id": "MDQ6VXNlcjUyNzE3NjE=", "organizations_url": "https://api.github.com/users/nateprewitt/orgs", "received_events_url": "https://api.github.com/users/nateprewitt/received_events", "repos_url": "https://api.github.com/users/nateprewitt/repos", "site_admin": false, "starred_url": "https://api.github.com/users/nateprewitt/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/nateprewitt/subscriptions", "type": "User", "url": "https://api.github.com/users/nateprewitt", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/6148/reactions" }
https://api.github.com/repos/psf/requests/issues/6148/timeline
null
completed
null
null
false
[ "46ccf99e | xxd -r -p > image1.jpg; file image.jpg\nimage1.jpg: JPEG image data\n$ python XOR-hex.py hex 46ccf9ab | xxd -r -p > image2.jpg; file image.jpg\nimage.jpg: JPEG image data\n$ python XOR-hex.py hex 46ccf9a571f0ffb17e41cb84 | xxd -r -p > image3.jpg; file image3.jpg\nimage3.jpg: JPEG image data, JFIF standard 1.01, aspect ratio, density 1x1, segment length 16, progressive, precision 8, 500x500, components", "$ python XOR-hex.py hex 46ccf99e | xxd -r -p > image1.jpg; file image.jpg\nimage1.jpg: JPEG image data" ]
https://api.github.com/repos/psf/requests/issues/6147
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6147/labels{/name}
https://api.github.com/repos/psf/requests/issues/6147/comments
https://api.github.com/repos/psf/requests/issues/6147/events
https://github.com/psf/requests/issues/6147
1,253,757,614
I_kwDOABTKOs5KutKu
6,147
$ git clone git://github.com/psf/requests.git
{ "avatar_url": "https://avatars.githubusercontent.com/u/76781560?v=4", "events_url": "https://api.github.com/users/CanoBot/events{/privacy}", "followers_url": "https://api.github.com/users/CanoBot/followers", "following_url": "https://api.github.com/users/CanoBot/following{/other_user}", "gists_url": "https://api.github.com/users/CanoBot/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/CanoBot", "id": 76781560, "login": "CanoBot", "node_id": "MDQ6VXNlcjc2NzgxNTYw", "organizations_url": "https://api.github.com/users/CanoBot/orgs", "received_events_url": "https://api.github.com/users/CanoBot/received_events", "repos_url": "https://api.github.com/users/CanoBot/repos", "site_admin": false, "starred_url": "https://api.github.com/users/CanoBot/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/CanoBot/subscriptions", "type": "User", "url": "https://api.github.com/users/CanoBot", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2022-05-31T11:56:04Z
2022-05-31T12:26:27Z
2022-05-31T12:26:24Z
NONE
null
null
{ "avatar_url": "https://avatars.githubusercontent.com/u/5271761?v=4", "events_url": "https://api.github.com/users/nateprewitt/events{/privacy}", "followers_url": "https://api.github.com/users/nateprewitt/followers", "following_url": "https://api.github.com/users/nateprewitt/following{/other_user}", "gists_url": "https://api.github.com/users/nateprewitt/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/nateprewitt", "id": 5271761, "login": "nateprewitt", "node_id": "MDQ6VXNlcjUyNzE3NjE=", "organizations_url": "https://api.github.com/users/nateprewitt/orgs", "received_events_url": "https://api.github.com/users/nateprewitt/received_events", "repos_url": "https://api.github.com/users/nateprewitt/repos", "site_admin": false, "starred_url": "https://api.github.com/users/nateprewitt/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/nateprewitt/subscriptions", "type": "User", "url": "https://api.github.com/users/nateprewitt", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/6147/reactions" }
https://api.github.com/repos/psf/requests/issues/6147/timeline
null
completed
null
null
false
[ "$ python -m pip install requests\n" ]
https://api.github.com/repos/psf/requests/issues/6146
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6146/labels{/name}
https://api.github.com/repos/psf/requests/issues/6146/comments
https://api.github.com/repos/psf/requests/issues/6146/events
https://github.com/psf/requests/pull/6146
1,252,544,146
PR_kwDOABTKOs44rF2N
6,146
Create Salhazry 4456
{ "avatar_url": "https://avatars.githubusercontent.com/u/87732583?v=4", "events_url": "https://api.github.com/users/Salhazry/events{/privacy}", "followers_url": "https://api.github.com/users/Salhazry/followers", "following_url": "https://api.github.com/users/Salhazry/following{/other_user}", "gists_url": "https://api.github.com/users/Salhazry/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Salhazry", "id": 87732583, "login": "Salhazry", "node_id": "MDQ6VXNlcjg3NzMyNTgz", "organizations_url": "https://api.github.com/users/Salhazry/orgs", "received_events_url": "https://api.github.com/users/Salhazry/received_events", "repos_url": "https://api.github.com/users/Salhazry/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Salhazry/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Salhazry/subscriptions", "type": "User", "url": "https://api.github.com/users/Salhazry", "user_view_type": "public" }
[]
closed
true
null
[]
null
0
2022-05-30T10:38:31Z
2022-05-30T14:17:55Z
2022-05-30T14:17:50Z
NONE
spam
<a rel="license" href="http://creativecommons.org/licenses/by/4.0/"><img alt="Creative Commons License" style="border-width:0" src="https://i.creativecommons.org/l/by/4.0/80x15.png" /></a><br />This work is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by/4.0/">Creative Commons Attribution 4.0 International License</a>.
{ "avatar_url": "https://avatars.githubusercontent.com/u/18519037?v=4", "events_url": "https://api.github.com/users/sethmlarson/events{/privacy}", "followers_url": "https://api.github.com/users/sethmlarson/followers", "following_url": "https://api.github.com/users/sethmlarson/following{/other_user}", "gists_url": "https://api.github.com/users/sethmlarson/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/sethmlarson", "id": 18519037, "login": "sethmlarson", "node_id": "MDQ6VXNlcjE4NTE5MDM3", "organizations_url": "https://api.github.com/users/sethmlarson/orgs", "received_events_url": "https://api.github.com/users/sethmlarson/received_events", "repos_url": "https://api.github.com/users/sethmlarson/repos", "site_admin": false, "starred_url": "https://api.github.com/users/sethmlarson/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/sethmlarson/subscriptions", "type": "User", "url": "https://api.github.com/users/sethmlarson", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/6146/reactions" }
https://api.github.com/repos/psf/requests/issues/6146/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/6146.diff", "html_url": "https://github.com/psf/requests/pull/6146", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/6146.patch", "url": "https://api.github.com/repos/psf/requests/pulls/6146" }
true
[]
https://api.github.com/repos/psf/requests/issues/6145
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6145/labels{/name}
https://api.github.com/repos/psf/requests/issues/6145/comments
https://api.github.com/repos/psf/requests/issues/6145/events
https://github.com/psf/requests/issues/6145
1,251,965,071
I_kwDOABTKOs5Kn3iP
6,145
timeout parameter not applied to initial connection
{ "avatar_url": "https://avatars.githubusercontent.com/u/26042712?v=4", "events_url": "https://api.github.com/users/chatumao/events{/privacy}", "followers_url": "https://api.github.com/users/chatumao/followers", "following_url": "https://api.github.com/users/chatumao/following{/other_user}", "gists_url": "https://api.github.com/users/chatumao/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/chatumao", "id": 26042712, "login": "chatumao", "node_id": "MDQ6VXNlcjI2MDQyNzEy", "organizations_url": "https://api.github.com/users/chatumao/orgs", "received_events_url": "https://api.github.com/users/chatumao/received_events", "repos_url": "https://api.github.com/users/chatumao/repos", "site_admin": false, "starred_url": "https://api.github.com/users/chatumao/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/chatumao/subscriptions", "type": "User", "url": "https://api.github.com/users/chatumao", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2022-05-29T18:56:10Z
2023-05-30T00:02:52Z
2022-05-29T21:45:44Z
NONE
resolved
If specifying the timeout parameter to requests.get(), an exception is raised after the specified timeout. If the code is executed without an internet connection, an exception is raised immediately. Python is at 3.10. ## Expected Result It feels like the timeout should apply to this scenario as well. ## Actual Result <!-- What happened instead. --> ## Reproduction Steps ```python import requests ``` ## System Information $ python -m requests.help ```json { "paste": "here" } ``` <!-- This command is only available on Requests v2.16.4 and greater. Otherwise, please provide some basic information about your system (Python version, operating system, &c). -->
{ "avatar_url": "https://avatars.githubusercontent.com/u/5271761?v=4", "events_url": "https://api.github.com/users/nateprewitt/events{/privacy}", "followers_url": "https://api.github.com/users/nateprewitt/followers", "following_url": "https://api.github.com/users/nateprewitt/following{/other_user}", "gists_url": "https://api.github.com/users/nateprewitt/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/nateprewitt", "id": 5271761, "login": "nateprewitt", "node_id": "MDQ6VXNlcjUyNzE3NjE=", "organizations_url": "https://api.github.com/users/nateprewitt/orgs", "received_events_url": "https://api.github.com/users/nateprewitt/received_events", "repos_url": "https://api.github.com/users/nateprewitt/repos", "site_admin": false, "starred_url": "https://api.github.com/users/nateprewitt/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/nateprewitt/subscriptions", "type": "User", "url": "https://api.github.com/users/nateprewitt", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/6145/reactions" }
https://api.github.com/repos/psf/requests/issues/6145/timeline
null
completed
null
null
false
[ "Hi @chatumao, the timeout is for reads and connections. This isn't a wall clock, as specified in the docs, it's for each operation. If we cannot connect (and therefore cannot read), there's nothing for the timeout to apply to which is why we fail immediately.\n\nI don't believe we intend to change this behavior at this time.", "Ok, thanks for clearing that up." ]
https://api.github.com/repos/psf/requests/issues/6144
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6144/labels{/name}
https://api.github.com/repos/psf/requests/issues/6144/comments
https://api.github.com/repos/psf/requests/issues/6144/events
https://github.com/psf/requests/pull/6144
1,249,964,146
PR_kwDOABTKOs44iqQy
6,144
Cleanup the docs sidebar
{ "avatar_url": "https://avatars.githubusercontent.com/u/5271761?v=4", "events_url": "https://api.github.com/users/nateprewitt/events{/privacy}", "followers_url": "https://api.github.com/users/nateprewitt/followers", "following_url": "https://api.github.com/users/nateprewitt/following{/other_user}", "gists_url": "https://api.github.com/users/nateprewitt/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/nateprewitt", "id": 5271761, "login": "nateprewitt", "node_id": "MDQ6VXNlcjUyNzE3NjE=", "organizations_url": "https://api.github.com/users/nateprewitt/orgs", "received_events_url": "https://api.github.com/users/nateprewitt/received_events", "repos_url": "https://api.github.com/users/nateprewitt/repos", "site_admin": false, "starred_url": "https://api.github.com/users/nateprewitt/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/nateprewitt/subscriptions", "type": "User", "url": "https://api.github.com/users/nateprewitt", "user_view_type": "public" }
[]
closed
true
null
[]
null
0
2022-05-26T19:33:40Z
2023-05-27T00:03:06Z
2022-05-26T19:45:57Z
MEMBER
resolved
This PR should address some of the issues raised in #6142. The translation guides are mostly 10+ years out of date at this point. We're going to remove them from the sidebar for now since they're providing limited value. We're also removing the algolia search bar as it's not functioning as intended. Several features have been added to RTD since we introduced algolia, and there's better options at this point. We may look at adding something like [this](https://docs.readthedocs.io/en/stable/guides/advanced-search.html) in a future PR, but for now the quicksearch at the bottom of the sidebar should be sufficient.
{ "avatar_url": "https://avatars.githubusercontent.com/u/5271761?v=4", "events_url": "https://api.github.com/users/nateprewitt/events{/privacy}", "followers_url": "https://api.github.com/users/nateprewitt/followers", "following_url": "https://api.github.com/users/nateprewitt/following{/other_user}", "gists_url": "https://api.github.com/users/nateprewitt/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/nateprewitt", "id": 5271761, "login": "nateprewitt", "node_id": "MDQ6VXNlcjUyNzE3NjE=", "organizations_url": "https://api.github.com/users/nateprewitt/orgs", "received_events_url": "https://api.github.com/users/nateprewitt/received_events", "repos_url": "https://api.github.com/users/nateprewitt/repos", "site_admin": false, "starred_url": "https://api.github.com/users/nateprewitt/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/nateprewitt/subscriptions", "type": "User", "url": "https://api.github.com/users/nateprewitt", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/6144/reactions" }
https://api.github.com/repos/psf/requests/issues/6144/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/6144.diff", "html_url": "https://github.com/psf/requests/pull/6144", "merged_at": "2022-05-26T19:45:57Z", "patch_url": "https://github.com/psf/requests/pull/6144.patch", "url": "https://api.github.com/repos/psf/requests/pulls/6144" }
true
[]
https://api.github.com/repos/psf/requests/issues/6143
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6143/labels{/name}
https://api.github.com/repos/psf/requests/issues/6143/comments
https://api.github.com/repos/psf/requests/issues/6143/events
https://github.com/psf/requests/issues/6143
1,249,431,165
I_kwDOABTKOs5KeM59
6,143
No module named 'urllib3.exceptions'
{ "avatar_url": "https://avatars.githubusercontent.com/u/83945407?v=4", "events_url": "https://api.github.com/users/doraspocket/events{/privacy}", "followers_url": "https://api.github.com/users/doraspocket/followers", "following_url": "https://api.github.com/users/doraspocket/following{/other_user}", "gists_url": "https://api.github.com/users/doraspocket/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/doraspocket", "id": 83945407, "login": "doraspocket", "node_id": "MDQ6VXNlcjgzOTQ1NDA3", "organizations_url": "https://api.github.com/users/doraspocket/orgs", "received_events_url": "https://api.github.com/users/doraspocket/received_events", "repos_url": "https://api.github.com/users/doraspocket/repos", "site_admin": false, "starred_url": "https://api.github.com/users/doraspocket/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/doraspocket/subscriptions", "type": "User", "url": "https://api.github.com/users/doraspocket", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2022-05-26T11:10:13Z
2023-05-27T00:03:04Z
2022-05-26T20:17:26Z
NONE
resolved
from .exceptions import RequestsDependencyWarning File "/Users/ericli/venvs/venv3.10.3/lib/python3.10/site-packages/requests/exceptions.py", line 9, in <module> from urllib3.exceptions import HTTPError as BaseHTTPError ModuleNotFoundError: No module named 'urllib3.exceptions'; 'urllib3' is not a package
{ "avatar_url": "https://avatars.githubusercontent.com/u/5271761?v=4", "events_url": "https://api.github.com/users/nateprewitt/events{/privacy}", "followers_url": "https://api.github.com/users/nateprewitt/followers", "following_url": "https://api.github.com/users/nateprewitt/following{/other_user}", "gists_url": "https://api.github.com/users/nateprewitt/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/nateprewitt", "id": 5271761, "login": "nateprewitt", "node_id": "MDQ6VXNlcjUyNzE3NjE=", "organizations_url": "https://api.github.com/users/nateprewitt/orgs", "received_events_url": "https://api.github.com/users/nateprewitt/received_events", "repos_url": "https://api.github.com/users/nateprewitt/repos", "site_admin": false, "starred_url": "https://api.github.com/users/nateprewitt/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/nateprewitt/subscriptions", "type": "User", "url": "https://api.github.com/users/nateprewitt", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/6143/reactions" }
https://api.github.com/repos/psf/requests/issues/6143/timeline
null
completed
null
null
false
[ "Hi,\r\nI'm using venv, and has already installed requests, but when I was trying to import requests, It always got the error,\r\n\r\nNo module named 'urllib3.exceptions'\r\n\r\n(venv3.10.3) ➜ pyspider-urllib git:(main) ✗ pip list\r\nPackage Version\r\n------------------ -----------\r\ncertifi 2022.5.18.1\r\ncharset-normalizer 2.0.12\r\nidna 3.3\r\npip 22.0.4\r\nrequests 2.27.1\r\nsetuptools 58.1.0\r\nurllib3 1.26.9", "Hi @doraspocket, I'd recommend verifying you don't have a file named `urllib3.py` or another relative directory named `urllib3` in your path for your project. This is a configuration or pathing issue on your machine/venv that unfortunately we won't be able to assist with on this issue tracker. We'd recommend posting on [StackOverflow](https://stackoverflow.com/) for further assistance." ]
https://api.github.com/repos/psf/requests/issues/6142
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6142/labels{/name}
https://api.github.com/repos/psf/requests/issues/6142/comments
https://api.github.com/repos/psf/requests/issues/6142/events
https://github.com/psf/requests/issues/6142
1,249,190,952
I_kwDOABTKOs5KdSQo
6,142
Parts of the documentation still link to python-requests.org
{ "avatar_url": "https://avatars.githubusercontent.com/u/8050853?v=4", "events_url": "https://api.github.com/users/domdfcoding/events{/privacy}", "followers_url": "https://api.github.com/users/domdfcoding/followers", "following_url": "https://api.github.com/users/domdfcoding/following{/other_user}", "gists_url": "https://api.github.com/users/domdfcoding/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/domdfcoding", "id": 8050853, "login": "domdfcoding", "node_id": "MDQ6VXNlcjgwNTA4NTM=", "organizations_url": "https://api.github.com/users/domdfcoding/orgs", "received_events_url": "https://api.github.com/users/domdfcoding/received_events", "repos_url": "https://api.github.com/users/domdfcoding/repos", "site_admin": false, "starred_url": "https://api.github.com/users/domdfcoding/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/domdfcoding/subscriptions", "type": "User", "url": "https://api.github.com/users/domdfcoding", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2022-05-26T07:11:01Z
2023-05-27T00:03:05Z
2022-05-26T19:49:29Z
NONE
resolved
Follow up to #6140 (which is locked) In the sidebar the links to the docs in different languages point to e.g. `fr.python-requests.org`. These are specified in these files: * https://github.com/psf/requests/blob/79f2ec3acc4e24fef6e6ce31ad7b1d4e2f77be31/docs/_templates/sidebarintro.html#L65 * https://github.com/psf/requests/blob/79f2ec3acc4e24fef6e6ce31ad7b1d4e2f77be31/docs/_templates/sidebarlogo.html#L60 While there are translations of the docs on readthedocs, at least [the German docs](https://requests.readthedocs.io/de/latest/) are woefully out of date. It might be better just to remove that section of the sidebar entirely. ---------------- The search box in the sidebar (which uses algolia search) has its links pointing to pages under `https://2.python-requests.org/en/master`. I can't find where this is configured. As it stands the search is non-functional.
{ "avatar_url": "https://avatars.githubusercontent.com/u/5271761?v=4", "events_url": "https://api.github.com/users/nateprewitt/events{/privacy}", "followers_url": "https://api.github.com/users/nateprewitt/followers", "following_url": "https://api.github.com/users/nateprewitt/following{/other_user}", "gists_url": "https://api.github.com/users/nateprewitt/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/nateprewitt", "id": 5271761, "login": "nateprewitt", "node_id": "MDQ6VXNlcjUyNzE3NjE=", "organizations_url": "https://api.github.com/users/nateprewitt/orgs", "received_events_url": "https://api.github.com/users/nateprewitt/received_events", "repos_url": "https://api.github.com/users/nateprewitt/repos", "site_admin": false, "starred_url": "https://api.github.com/users/nateprewitt/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/nateprewitt/subscriptions", "type": "User", "url": "https://api.github.com/users/nateprewitt", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/6142/reactions" }
https://api.github.com/repos/psf/requests/issues/6142/timeline
null
completed
null
null
false
[ "Thanks for bringing this to our attention @domdfcoding. I've added #6144 which will be the first step in improving some of this. Many of those translations are now 8-10 years old, and given no one has volunteered to make updates in that window, I believe they're likely to remain that way.\r\n\r\nI've removed the translations links from the sidebar as well as the algolia search. There should still be the quicksearch bar at the bottom of the sidebar for now and we'll want to look at leveraging RTDs search functionality going forward.", "I'll close this out as the immediate issues are now resolved. Thanks again!" ]
https://api.github.com/repos/psf/requests/issues/6141
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6141/labels{/name}
https://api.github.com/repos/psf/requests/issues/6141/comments
https://api.github.com/repos/psf/requests/issues/6141/events
https://github.com/psf/requests/issues/6141
1,245,888,801
I_kwDOABTKOs5KQsEh
6,141
Session favors environment variable (CURL_CA_BUNDLE) over instance attribute
{ "avatar_url": "https://avatars.githubusercontent.com/u/4758960?v=4", "events_url": "https://api.github.com/users/hugocarr/events{/privacy}", "followers_url": "https://api.github.com/users/hugocarr/followers", "following_url": "https://api.github.com/users/hugocarr/following{/other_user}", "gists_url": "https://api.github.com/users/hugocarr/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/hugocarr", "id": 4758960, "login": "hugocarr", "node_id": "MDQ6VXNlcjQ3NTg5NjA=", "organizations_url": "https://api.github.com/users/hugocarr/orgs", "received_events_url": "https://api.github.com/users/hugocarr/received_events", "repos_url": "https://api.github.com/users/hugocarr/repos", "site_admin": false, "starred_url": "https://api.github.com/users/hugocarr/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/hugocarr/subscriptions", "type": "User", "url": "https://api.github.com/users/hugocarr", "user_view_type": "public" }
[]
closed
true
null
[]
null
3
2022-05-24T02:17:07Z
2023-05-25T00:02:57Z
2022-05-24T05:10:23Z
NONE
resolved
When setting the `CURL_CA_BUNDLE` environment variable, it overrides the `session.verify` attribute. It's unclear if this is expected behavior, but I thought it might be worth opening an issue as it caught me off guard. ## Expected Result ```python import requests import os os.environ["CURL_CA_BUNDLE"] = "/tmp/a_cert" s = requests.Session() s.verify = "/tmp/another_cert" # expected to be called with "/tmp/another_cert" s.get("https://my_route") ``` ## Actual Result ```python # actually gets called with "/tmp/a_cert" s.get("https://my_route") ``` ## Reproduction Steps Requires using `pdb` to step into ```python import requests import os os.environ["CURL_CA_BUNDLE"] = "/tmp/a_cert" s = requests.Session() s.verify = "/tmp/another_cert" # gets called with "/tmp/a_cert" breakpoint() s.get("https://my_route") ``` If you step into `/requests/sessions.py` ``` 515 prep = self.prepare_request(req) 516 517 proxies = proxies or {} 518 519 settings = self.merge_environment_settings( 520 prep.url, proxies, stream, verify, cert 521 ) 522 523 # Send the request. 524 send_kwargs = { 525 'timeout': timeout, 526 'allow_redirects': allow_redirects, 527 } 528 send_kwargs.update(settings) 529 -> resp = self.send(prep, **send_kwargs) 530 531 return resp (Pdb) send_kwargs {'timeout': None, 'allow_redirects': True, 'verify': '/tmp/a_cert', 'proxies': OrderedDict(), 'stream': False, 'cert': None} ``` You can see that the request is going to be sent with the certificate from the environment, instead of the one set in the object. ## System Information $ python -m requests.help ```json { "chardet": { "version": null }, "charset_normalizer": { "version": "2.0.12" }, "cryptography": { "version": "37.0.2" }, "idna": { "version": "3.3" }, "implementation": { "name": "CPython", "version": "3.8.13" }, "platform": { "release": "21.4.0", "system": "Darwin" }, "pyOpenSSL": { "openssl_version": "30000030", "version": "22.0.0" }, "requests": { "version": "2.27.1" }, "system_ssl": { "version": "101010ff" }, "urllib3": { "version": "1.26.9" }, "using_charset_normalizer": true, "using_pyopenssl": true } ``` <!-- This command is only available on Requests v2.16.4 and greater. Otherwise, please provide some basic information about your system (Python version, operating system, &c). -->
{ "avatar_url": "https://avatars.githubusercontent.com/u/5271761?v=4", "events_url": "https://api.github.com/users/nateprewitt/events{/privacy}", "followers_url": "https://api.github.com/users/nateprewitt/followers", "following_url": "https://api.github.com/users/nateprewitt/following{/other_user}", "gists_url": "https://api.github.com/users/nateprewitt/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/nateprewitt", "id": 5271761, "login": "nateprewitt", "node_id": "MDQ6VXNlcjUyNzE3NjE=", "organizations_url": "https://api.github.com/users/nateprewitt/orgs", "received_events_url": "https://api.github.com/users/nateprewitt/received_events", "repos_url": "https://api.github.com/users/nateprewitt/repos", "site_admin": false, "starred_url": "https://api.github.com/users/nateprewitt/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/nateprewitt/subscriptions", "type": "User", "url": "https://api.github.com/users/nateprewitt", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/6141/reactions" }
https://api.github.com/repos/psf/requests/issues/6141/timeline
null
completed
null
null
false
[ "Hi @hugocarr, thanks for the issue. It appears this is a dupe of #3829 and #2018. This is the current behavior and it's known. We won't be changing it though until the next major release due to it being breaking. I'll resolve this in favor of the originals.", "Gotcha, https://github.com/psf/requests/issues/3829 is centred around `REQUESTS_CA_BUNDLE` rather than `CURL_CA_BUNDLE`, which are admittedly a part of the same logic. Should I add a comment to the original ticket so that the edge case isn't lost? Or is the dupe against the original sufficient? ", "I believe the original is sufficient. If one is fixed the other will implicitly be as well. The issue is more broadly about environment variable resolution vs session resolution." ]
https://api.github.com/repos/psf/requests/issues/6140
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6140/labels{/name}
https://api.github.com/repos/psf/requests/issues/6140/comments
https://api.github.com/repos/psf/requests/issues/6140/events
https://github.com/psf/requests/issues/6140
1,244,638,913
I_kwDOABTKOs5KL67B
6,140
python-requests.org domain suspended.
{ "avatar_url": "https://avatars.githubusercontent.com/u/227768?v=4", "events_url": "https://api.github.com/users/brunns/events{/privacy}", "followers_url": "https://api.github.com/users/brunns/followers", "following_url": "https://api.github.com/users/brunns/following{/other_user}", "gists_url": "https://api.github.com/users/brunns/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/brunns", "id": 227768, "login": "brunns", "node_id": "MDQ6VXNlcjIyNzc2OA==", "organizations_url": "https://api.github.com/users/brunns/orgs", "received_events_url": "https://api.github.com/users/brunns/received_events", "repos_url": "https://api.github.com/users/brunns/repos", "site_admin": false, "starred_url": "https://api.github.com/users/brunns/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/brunns/subscriptions", "type": "User", "url": "https://api.github.com/users/brunns", "user_view_type": "public" }
[]
open
true
null
[]
null
12
2022-05-23T06:19:30Z
2022-06-16T16:52:56Z
null
NONE
resolved
http://python-requests.org/ is showing: <img width="824" alt="Screenshot 2022-05-23 at 07 15 12" src="https://user-images.githubusercontent.com/227768/169755158-3c2b0013-b869-4a84-93f3-7bddeabd9548.png"> It's the same case for subdomains, including docs.python-requests.org, which is breaking the building of sphinx documentation which refer to `requests` docs: see https://github.com/brunns/mbtest/runs/6549875114?check_suite_focus=true#step:9:31 for an example.
null
{ "+1": 12, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 12, "url": "https://api.github.com/repos/psf/requests/issues/6140/reactions" }
https://api.github.com/repos/psf/requests/issues/6140/timeline
null
null
null
null
false
[ "Hi @brunns, thanks for bringing this to our attention. The domain is still owned by Kenneth and the maintainers haven't had access to it in quite some time.\n\nWe'll reach out to Kenneth regarding the domain verification. I wanted to quickly confirm though that https://docs.python-requests.org _is_ working for you. I'm still seeing the docs rendered correctly at that subdomain.", "Strange - nope, I'm seeing that same error at https://docs.python-requests.org. I wonder if that's just me?", "It may be a CDN caching issue. My hunch would be once those expire, I'll be seeing the same.", "I can confirm this, [https://docs.python-requests.org](https://docs.python-requests.org) is not working for me, either.", "A temporary and partial fix might be to stop http://requests.readthedocs.org/ redirecting to https://docs.python-requests.org/?", "I can access https://docs.python-requests.org/en/latest/ fine, but our intersphinx links are failing due to cert domain mismatch", "FWIW, https://docs.python-requests.org/en/latest/ redirects to https://docs.python-requests.org/en/latest/ for me, which 404s. ", "For https://docs.python-requests.org/en/latest/user/quickstart/ I get an SSL error from Chrome:\r\n```\r\nThis server could not prove that it is docs.python-requests.org; \r\nits security certificate is from *.ispapi.net. \r\nThis may be caused by a misconfiguration or an attacker intercepting your connection.\r\n```\r\n\r\n...and then a 404 if I do get through.", "Hi I am seeing the same... \r\n<img width=\"654\" alt=\"image\" src=\"https://user-images.githubusercontent.com/41849932/169803126-e439982c-0e30-4249-905f-25f9018f01c2.png\">\r\n", "Going to lock this discussion to contributors-only as the issue won't be fixed any faster with additional comments. If you're interested in following when the fix happens you can subscribe to this issue.", "For those looking for alternatives, https://requests.readthedocs.io/en/latest/ should be returning docs correctly again. This has been the \"official\" location for some time as we lack controls on the python-requests domains. I'll update again once we receive a response from Kenneth.", "Providing a quick update for users following the issue. I've spoken with Kenneth, but we do not have a clear path to recovering the domain. We'd advise anyone currently blocked by this (or anyone providing resources with links to requests) to use https://requests.readthedocs.io/en/latest/ as the primary domain. This matches what has been in the public docs since 2019 and represents what the current maintainers control." ]
https://api.github.com/repos/psf/requests/issues/6139
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6139/labels{/name}
https://api.github.com/repos/psf/requests/issues/6139/comments
https://api.github.com/repos/psf/requests/issues/6139/events
https://github.com/psf/requests/issues/6139
1,244,044,304
I_kwDOABTKOs5KJpwQ
6,139
Misusing of system-wide proxy on Windows / HTTPS connections over system-wide proxy on Windows do not work
{ "avatar_url": "https://avatars.githubusercontent.com/u/3054729?v=4", "events_url": "https://api.github.com/users/ValdikSS/events{/privacy}", "followers_url": "https://api.github.com/users/ValdikSS/followers", "following_url": "https://api.github.com/users/ValdikSS/following{/other_user}", "gists_url": "https://api.github.com/users/ValdikSS/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/ValdikSS", "id": 3054729, "login": "ValdikSS", "node_id": "MDQ6VXNlcjMwNTQ3Mjk=", "organizations_url": "https://api.github.com/users/ValdikSS/orgs", "received_events_url": "https://api.github.com/users/ValdikSS/received_events", "repos_url": "https://api.github.com/users/ValdikSS/repos", "site_admin": false, "starred_url": "https://api.github.com/users/ValdikSS/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/ValdikSS/subscriptions", "type": "User", "url": "https://api.github.com/users/ValdikSS", "user_view_type": "public" }
[]
open
false
null
[]
null
2
2022-05-21T17:47:26Z
2022-06-11T15:44:35Z
null
NONE
null
<!-- Summary. --> On Windows 10 and 11, if a system-wide proxy is configured in the OS settings, Requests won't load HTTPS websites. Instead of the regular CONNECT header, Requests sends TLS request to the proxy server (ip and port). The TLS ClientHello does not have Server Name Indication field, that's why I assume that Requests misinterprets the proxy as a Secure Web Proxy (a regular proxy with TLS encapsulation on top), which Windows does not support. ## Expected Result If system-wide proxy is configured in Windows, Requests sends CONNECT header to the proxy server when HTTPS website is requested. ## Actual Result If system-wide proxy is configured in Windows, Requests sends TLS request to the proxy address when HTTPS website is requested. ## Reproduction Steps 1. Configure system-wide proxy on Windows 2. ```python import requests requests.get("https://w3.org/") ``` Result: My proxy does not respond to the packets it does not understand, and I receive the following error: `HTTPSConnectionPool(host='w3.org, port=443): Max retries exceeded with url: / (Caused by ProxyError('Cannot connect to proxy.', timeout('_ssl.c:1114: The handshake operation timed out')))` ## System Information $ python -m requests.help ```json { "chardet": { "version": null }, "charset_normalizer": { "version": "2.0.12" }, "cryptography": { "version": "" }, "idna": { "version": "3.3" }, "implementation": { "name": "CPython", "version": "3.10.4" }, "platform": { "release": "10", "system": "Windows" }, "pyOpenSSL": { "openssl_version": "", "version": null }, "requests": { "version": "2.27.1" }, "system_ssl": { "version": "101010ef" }, "urllib3": { "version": "1.26.9" }, "using_charset_normalizer": true, "using_pyopenssl": false } ``` <!-- This command is only available on Requests v2.16.4 and greater. Otherwise, please provide some basic information about your system (Python version, operating system, &c). -->
null
{ "+1": 1, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 1, "url": "https://api.github.com/repos/psf/requests/issues/6139/reactions" }
https://api.github.com/repos/psf/requests/issues/6139/timeline
null
null
null
null
false
[ "This is a Python's urllib bug, which is triggered by newer urllib3 version, thus affecting requests.\r\n\r\nhttps://bugs.python.org/issue42627\r\nhttps://github.com/python/cpython/issues/86793\r\nhttps://github.com/python/cpython/commit/9743524fc14db39e2f309cf3d372c7e8e18fc93a\r\n\r\n>This bug has existed for a very long time (since Python 2.0.1 if not earlier), but it was exposed recently when urllib3 added support for HTTPS-in-HTTPS proxies in version 1.26. Before that, an `https` prefix on the HTTPS proxy url was silently treated as `http`, accidentally resulting in the correct behavior.\r\n\r\nFixed in Python 3.10.5, all the previous versions are still affected.", "https://github.com/urllib3/urllib3/issues/2164" ]
https://api.github.com/repos/psf/requests/issues/6138
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6138/labels{/name}
https://api.github.com/repos/psf/requests/issues/6138/comments
https://api.github.com/repos/psf/requests/issues/6138/events
https://github.com/psf/requests/issues/6138
1,243,882,843
I_kwDOABTKOs5KJCVb
6,138
Does it can visit with IPV6 successfully without hard code interface name in urllib3/util/connection.py - create_connection ?
{ "avatar_url": "https://avatars.githubusercontent.com/u/29194147?v=4", "events_url": "https://api.github.com/users/k870611/events{/privacy}", "followers_url": "https://api.github.com/users/k870611/followers", "following_url": "https://api.github.com/users/k870611/following{/other_user}", "gists_url": "https://api.github.com/users/k870611/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/k870611", "id": 29194147, "login": "k870611", "node_id": "MDQ6VXNlcjI5MTk0MTQ3", "organizations_url": "https://api.github.com/users/k870611/orgs", "received_events_url": "https://api.github.com/users/k870611/received_events", "repos_url": "https://api.github.com/users/k870611/repos", "site_admin": false, "starred_url": "https://api.github.com/users/k870611/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/k870611/subscriptions", "type": "User", "url": "https://api.github.com/users/k870611", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2022-05-21T06:04:08Z
2023-06-11T00:03:26Z
2022-06-07T21:05:33Z
NONE
resolved
Dear Requests My OS is CentOS 72, with requests 2.27.1, Python3.9.0, I want to visit my page by Ipv6, but it return 400 - Bad Request Code is ``` >>> import requests >>> requests.packages.urllib3.disable_warnings() >>> url = 'https://[fe80::2ac1:3cff:fe89:a728%enp0s3]/#login' >>> res = requests.get(url, verify=False) >>> res.status_code 400 ``` Then I change url to https://[fe80::2ac1:3cff:fe89:a728]/#login, urllib3 will raise OSError: [Errno 22] Invalid argument So I hard code interface name in urllib3/util/connection.py - create_connection like this ``` family = allowed_gai_family() print('Before Change: {0}'.format(host)) host = '{0}%enp0s3'.format(host) print('After Change: {0}'.format(host)) ``` It can visit successfully ``` >>> import requests >>> requests.packages.urllib3.disable_warnings() >>> url = 'https://[fe80::2ac1:3cff:fe89:a728]/#login' >>> res = requests.get(url, verify=False) Before Change: fe80::2ac1:3cff:fe89:a728 After Change: fe80::2ac1:3cff:fe89:a728%enp0s3 >>> res.status_code 200 ``` Does it can work without hard code interface name in create_connect ?? Thanks and best regard.
{ "avatar_url": "https://avatars.githubusercontent.com/u/5271761?v=4", "events_url": "https://api.github.com/users/nateprewitt/events{/privacy}", "followers_url": "https://api.github.com/users/nateprewitt/followers", "following_url": "https://api.github.com/users/nateprewitt/following{/other_user}", "gists_url": "https://api.github.com/users/nateprewitt/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/nateprewitt", "id": 5271761, "login": "nateprewitt", "node_id": "MDQ6VXNlcjUyNzE3NjE=", "organizations_url": "https://api.github.com/users/nateprewitt/orgs", "received_events_url": "https://api.github.com/users/nateprewitt/received_events", "repos_url": "https://api.github.com/users/nateprewitt/repos", "site_admin": false, "starred_url": "https://api.github.com/users/nateprewitt/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/nateprewitt/subscriptions", "type": "User", "url": "https://api.github.com/users/nateprewitt", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/6138/reactions" }
https://api.github.com/repos/psf/requests/issues/6138/timeline
null
completed
null
null
false
[ "Hi @k870611, it sounds like you're attempting to use an ipv6 address with a zone identifier? This is currently missing functionality in urllib3 (and Requests). I'm going to resolve this in favor of the upstream tracking issue (urllib3/urllib3#1641). It's currently providing a $500 bounty for an accepted contribution, if you'd like to give it a try.", "Hi @nateprewitt \r\n\r\n- [ ] Research and document why urllib3<1.25 worked while urllib3>=1.25 doesn't work in this issue\r\n\r\n For this request I have test requests 2.27.1 + urllib3 1.24.3 & requests 2.22.0 + urllib3 1.24.3, so I don't know how does it can use with urllib3 with version less then 1.25.0.\r\n\r\n And I have read with 1.23, 1.22, 1.21, they are all similar, so I feel they can't work too, there is the code I try.\r\n```\r\nimport urllib3\r\nimport requests\r\n\r\ntry: \r\n print(urllib3.__version__)\r\n print(requests.__version__)\r\n \r\n url = 'https://[fe80::2ac1:3cff:fe89:a728%enp0s3]/#login'\r\n res = requests.get(url, verify=False) \r\n \r\n print(res.ok)\r\n print(res.status_code)\r\n # print(res.text)\r\n \r\nexcept Exception as e:\r\n print(e)\r\n\r\n[root@localhost web_test]# /usr/local/bin/python3.9 /root/ipv6.py\r\n1.24.3\r\n2.22.0\r\nFalse\r\n400\r\n\r\n[root@localhost web_test]# /usr/local/bin/python3.9 /root/ipv6.py\r\n1.24.3\r\n2.27.1\r\nFalse\r\n400\r\n```\r\n\r\nMy Code is: \r\n```\r\nimport unittest\r\nimport sys\r\nimport os\r\nimport socket\r\nfrom ipaddress import ip_address, IPv6Address\r\n\r\nimport requests\r\nimport requests.packages.urllib3.util.connection as urllib3_cn\r\n\r\nallowed_gai_family = urllib3_cn.allowed_gai_family\r\n_set_socket_options = urllib3_cn._set_socket_options\r\n\r\ndef create_connection(\r\n address,\r\n timeout=socket._GLOBAL_DEFAULT_TIMEOUT,\r\n source_address=None,\r\n socket_options=None,\r\n):\r\n \"\"\"Connect to *address* and return the socket object.\r\n\r\n Convenience function. Connect to *address* (a 2-tuple ``(host,\r\n port)``) and return the socket object. Passing the optional\r\n *timeout* parameter will set the timeout on the socket instance\r\n before attempting to connect. If no *timeout* is supplied, the\r\n global default timeout setting returned by :func:`get_default_timeout`\r\n is used. If *source_address* is set it must be a tuple of (host, port)\r\n for the socket to bind as a source address before making the connection.\r\n An host of '' or port 0 tells the OS to use the default.\r\n \"\"\"\r\n \r\n host, port = address\r\n if host.startswith(\"[\"):\r\n host = host.strip(\"[]\")\r\n \r\n err = None\r\n\r\n # Using the value from allowed_gai_family() in the context of getaddrinfo lets\r\n # us select whether to work with IPv4 DNS records, IPv6 records, or both.\r\n # The original create_connection function always returns all records.\r\n family = allowed_gai_family()\r\n \r\n if isinstance(ip_address(host), IPv6Address) and os.path.exists('/sys/class/net'):\r\n all_interface = os.listdir('/sys/class/net')\r\n hosts = ['{0}%{1}'.format(host, interface) for interface in all_interface]\r\n \r\n else:\r\n hosts = [host]\r\n \r\n for host in hosts:\r\n err = None\r\n \r\n for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):\r\n af, sock_type, proto, canon_name, sa = res\r\n sock = None\r\n try:\r\n sock = socket.socket(af, sock_type, proto)\r\n \r\n # If provided, set socket level options before connecting.\r\n _set_socket_options(sock, socket_options)\r\n\r\n if timeout is not socket._GLOBAL_DEFAULT_TIMEOUT:\r\n sock.settimeout(timeout)\r\n if source_address:\r\n sock.bind(source_address)\r\n sock.connect(sa)\r\n return sock\r\n\r\n except socket.error as e:\r\n err = e\r\n if sock is not None:\r\n sock.close()\r\n sock = None\r\n\r\n if err is not None:\r\n raise err\r\n\r\n raise socket.error(\"getaddrinfo returns an empty list\")\r\n\r\nclass test_requests(unittest.TestCase):\r\n def test_with_ipv6(self):\r\n requests.packages.urllib3.disable_warnings()\r\n urllib3_cn.create_connection = create_connection\r\n \r\n print('requests version: {0}'.format(requests.__version__))\r\n print('OS: {0}'.format(os.name))\r\n print('Sys Version: {0}'.format(sys.version))\r\n \r\n url = 'https://[fe80::2ac1:3cff:fe89:a728]/#login'\r\n res = requests.get(url, verify=False) \r\n \r\n self.assertTrue(res.ok, 'Res is not OK')\r\n print('Status Code: {0}'.format(res.status_code))\r\n \r\nif __name__ == '__main__':\r\n unittest.main()\r\n```\r\n\r\nAnd it can work both on windows & linux, stdout are\r\n```\r\n[root@localhost ~]# /usr/local/bin/python3.9 test_requests.py\r\nrequests version: 2.27.1\r\nOS: posix\r\nSys Version: 3.9.0 (default, Aug 20 2021, 21:07:34) \r\n[GCC 4.8.5 20150623 (Red Hat 4.8.5-4)]\r\nStatus Code: 200\r\n.\r\n----------------------------------------------------------------------\r\nRan 1 test in 0.197s\r\n\r\nOK\r\n\r\nC:\\Users\\fiona\\Desktop>python test_requests.py\r\nrequests version: 2.25.1\r\nOS: nt\r\nSys Version: 3.5.2 (v3.5.2:4def2a2901a5, Jun 25 2016, 22:18:55) [MSC v.1900 64 bit (AMD64)]\r\nStatus Code: 200\r\n.\r\n----------------------------------------------------------------------\r\nRan 1 test in 0.611s\r\n\r\nOK\r\n```\r\n\r\nDon't know does it work\r\nFYR\r\n\r\nThanks and best regard." ]
https://api.github.com/repos/psf/requests/issues/6137
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6137/labels{/name}
https://api.github.com/repos/psf/requests/issues/6137/comments
https://api.github.com/repos/psf/requests/issues/6137/events
https://github.com/psf/requests/pull/6137
1,242,045,051
PR_kwDOABTKOs44Imhi
6,137
Allow tests to run if HTTP proxy env variables are already present,
{ "avatar_url": "https://avatars.githubusercontent.com/u/4038023?v=4", "events_url": "https://api.github.com/users/ogayot/events{/privacy}", "followers_url": "https://api.github.com/users/ogayot/followers", "following_url": "https://api.github.com/users/ogayot/following{/other_user}", "gists_url": "https://api.github.com/users/ogayot/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/ogayot", "id": 4038023, "login": "ogayot", "node_id": "MDQ6VXNlcjQwMzgwMjM=", "organizations_url": "https://api.github.com/users/ogayot/orgs", "received_events_url": "https://api.github.com/users/ogayot/received_events", "repos_url": "https://api.github.com/users/ogayot/repos", "site_admin": false, "starred_url": "https://api.github.com/users/ogayot/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/ogayot/subscriptions", "type": "User", "url": "https://api.github.com/users/ogayot", "user_view_type": "public" }
[]
open
false
null
[]
null
0
2022-05-19T16:43:48Z
2022-05-19T16:43:48Z
null
CONTRIBUTOR
null
Hello, The following tests fail if HTTP proxy environment variables are already set: ``` FAILED tests/test_requests.py::TestRequests::test_mixed_case_scheme_acceptable FAILED tests/test_requests.py::TestRequests::test_HTTP_302_ALLOW_REDIRECT_GET FAILED tests/test_requests.py::TestRequests::test_errors[http://doesnotexist.google.com-ConnectionError] FAILED tests/test_requests.py::TestRequests::test_respect_proxy_env_on_send_self_prepared_request FAILED tests/test_requests.py::TestRequests::test_respect_proxy_env_on_send_session_prepared_request FAILED tests/test_requests.py::TestRequests::test_respect_proxy_env_on_send_with_redirects FAILED tests/test_requests.py::TestRequests::test_respect_proxy_env_on_get - ... FAILED tests/test_requests.py::TestRequests::test_respect_proxy_env_on_request ``` The variables affecting the tests are: * `http_proxy` (and `https_proxy` potentially) * `no_proxy` Fixed by overriding their value if they are already present in the environment. The `override_environ` function would fail if attempting to delete a variable that is not in the environment. Added a `suppress(KeyError)` construct around the `del` instruction to fix it. Thanks, Oilvier
null
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/6137/reactions" }
https://api.github.com/repos/psf/requests/issues/6137/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/6137.diff", "html_url": "https://github.com/psf/requests/pull/6137", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/6137.patch", "url": "https://api.github.com/repos/psf/requests/pulls/6137" }
true
[]
https://api.github.com/repos/psf/requests/issues/6136
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6136/labels{/name}
https://api.github.com/repos/psf/requests/issues/6136/comments
https://api.github.com/repos/psf/requests/issues/6136/events
https://github.com/psf/requests/pull/6136
1,241,994,247
PR_kwDOABTKOs44IbqJ
6,136
Fix output of test_lowlevel tests in case of timeout
{ "avatar_url": "https://avatars.githubusercontent.com/u/4038023?v=4", "events_url": "https://api.github.com/users/ogayot/events{/privacy}", "followers_url": "https://api.github.com/users/ogayot/followers", "following_url": "https://api.github.com/users/ogayot/following{/other_user}", "gists_url": "https://api.github.com/users/ogayot/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/ogayot", "id": 4038023, "login": "ogayot", "node_id": "MDQ6VXNlcjQwMzgwMjM=", "organizations_url": "https://api.github.com/users/ogayot/orgs", "received_events_url": "https://api.github.com/users/ogayot/received_events", "repos_url": "https://api.github.com/users/ogayot/repos", "site_admin": false, "starred_url": "https://api.github.com/users/ogayot/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/ogayot/subscriptions", "type": "User", "url": "https://api.github.com/users/ogayot", "user_view_type": "public" }
[]
closed
true
null
[]
null
0
2022-05-19T15:58:16Z
2023-06-09T00:03:14Z
2022-06-08T16:02:42Z
CONTRIBUTOR
resolved
Hello, The tests in `test_lowlevel.py` use the `testserver.server.Server` thread object. When using the object as a context manager, we wait until the server thread is ready with a timeout. Unfortunately, if the timeout is reached, we would not propagate the error. Instead, we would return from the `__enter__` method and access the `with` body with an uninitialized value for `port` (i.e., `port = 0`). Therefore, the tests would fail with: ``` E urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x7fc3a3e30a90>: Failed to establish a new connection: [Errno 111] Connection refused /usr/lib/python3/dist-packages/urllib3/connection.py:181: NewConnectionError ``` Reading this error does not make it obvious that this is the result of a timeout. Fixed by raising an error in case of timeout, which makes it more obvious: ``` if not self.ready_event.wait(self.WAIT_EVENT_TIMEOUT): > raise RuntimeError("Timeout waiting for server to be ready.") E RuntimeError: Timeout waiting for server to be ready. tests/testserver/server.py:119: RuntimeError ``` _The reason why I had a timeout on my end was because my environment was not resolving "localhost" as it should have. Requests were going through the DNS and therefore ended-up hitting the timeout_ _The name resolution taking forever was happening during this instruction (where `self.host` is `localhost`):_ ``` sock.bind((self.host, self.port)) ``` Thanks, Olivier
{ "avatar_url": "https://avatars.githubusercontent.com/u/5271761?v=4", "events_url": "https://api.github.com/users/nateprewitt/events{/privacy}", "followers_url": "https://api.github.com/users/nateprewitt/followers", "following_url": "https://api.github.com/users/nateprewitt/following{/other_user}", "gists_url": "https://api.github.com/users/nateprewitt/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/nateprewitt", "id": 5271761, "login": "nateprewitt", "node_id": "MDQ6VXNlcjUyNzE3NjE=", "organizations_url": "https://api.github.com/users/nateprewitt/orgs", "received_events_url": "https://api.github.com/users/nateprewitt/received_events", "repos_url": "https://api.github.com/users/nateprewitt/repos", "site_admin": false, "starred_url": "https://api.github.com/users/nateprewitt/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/nateprewitt/subscriptions", "type": "User", "url": "https://api.github.com/users/nateprewitt", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/6136/reactions" }
https://api.github.com/repos/psf/requests/issues/6136/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/6136.diff", "html_url": "https://github.com/psf/requests/pull/6136", "merged_at": "2022-06-08T16:02:42Z", "patch_url": "https://github.com/psf/requests/pull/6136.patch", "url": "https://api.github.com/repos/psf/requests/pulls/6136" }
true
[]
https://api.github.com/repos/psf/requests/issues/6135
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6135/labels{/name}
https://api.github.com/repos/psf/requests/issues/6135/comments
https://api.github.com/repos/psf/requests/issues/6135/events
https://github.com/psf/requests/issues/6135
1,240,431,975
I_kwDOABTKOs5J731n
6,135
Make requests work for pyright in strict mode
{ "avatar_url": "https://avatars.githubusercontent.com/u/6827922?v=4", "events_url": "https://api.github.com/users/brandonchinn178/events{/privacy}", "followers_url": "https://api.github.com/users/brandonchinn178/followers", "following_url": "https://api.github.com/users/brandonchinn178/following{/other_user}", "gists_url": "https://api.github.com/users/brandonchinn178/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/brandonchinn178", "id": 6827922, "login": "brandonchinn178", "node_id": "MDQ6VXNlcjY4Mjc5MjI=", "organizations_url": "https://api.github.com/users/brandonchinn178/orgs", "received_events_url": "https://api.github.com/users/brandonchinn178/received_events", "repos_url": "https://api.github.com/users/brandonchinn178/repos", "site_admin": false, "starred_url": "https://api.github.com/users/brandonchinn178/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/brandonchinn178/subscriptions", "type": "User", "url": "https://api.github.com/users/brandonchinn178", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2022-05-18T19:37:24Z
2023-05-19T00:03:05Z
2022-05-18T19:43:53Z
NONE
resolved
Running pyright in strict mode errors currently for requests function calls: ``` 48:19 - error: Type of "post" is partially unknown Type of "post" is "(url: str | bytes, data: str | bytes | MutableMapping[str, Any] | Iterable[Tuple[Text, str | None]] | IO[AnyStr] | None = ..., json: Any | None = ..., **kwargs) -> Response" (reportUnknownMemberType) 59:18 - error: Type of "json" is partially unknown Type of "json" is "(**kwargs) -> Any" (reportUnknownMemberType) ``` ## Expected Result Basic usage of `requests` should pass strict typechecking ## Actual Result Failure ## Reproduction Steps ```python # pyright: strict import requests r = requests.post("http://httpbin.org/post", json={"a": 1}) print(r.json()) ``` ## System Information $ python -m requests.help ```json { "chardet": { "version": null }, "charset_normalizer": { "version": "2.0.12" }, "cryptography": { "version": "" }, "idna": { "version": "3.3" }, "implementation": { "name": "CPython", "version": "3.9.12" }, "platform": { "release": "19.6.0", "system": "Darwin" }, "pyOpenSSL": { "openssl_version": "", "version": null }, "requests": { "version": "2.27.1" }, "system_ssl": { "version": "101010ff" }, "urllib3": { "version": "1.26.9" }, "using_charset_normalizer": true, "using_pyopenssl": false } ``` <!-- This command is only available on Requests v2.16.4 and greater. Otherwise, please provide some basic information about your system (Python version, operating system, &c). -->
{ "avatar_url": "https://avatars.githubusercontent.com/u/6827922?v=4", "events_url": "https://api.github.com/users/brandonchinn178/events{/privacy}", "followers_url": "https://api.github.com/users/brandonchinn178/followers", "following_url": "https://api.github.com/users/brandonchinn178/following{/other_user}", "gists_url": "https://api.github.com/users/brandonchinn178/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/brandonchinn178", "id": 6827922, "login": "brandonchinn178", "node_id": "MDQ6VXNlcjY4Mjc5MjI=", "organizations_url": "https://api.github.com/users/brandonchinn178/orgs", "received_events_url": "https://api.github.com/users/brandonchinn178/received_events", "repos_url": "https://api.github.com/users/brandonchinn178/repos", "site_admin": false, "starred_url": "https://api.github.com/users/brandonchinn178/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/brandonchinn178/subscriptions", "type": "User", "url": "https://api.github.com/users/brandonchinn178", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/6135/reactions" }
https://api.github.com/repos/psf/requests/issues/6135/timeline
null
completed
null
null
false
[ "Hi @brandonchinn178, we don't provide any typing information in requests currently. This is either being derived from pyright or a type stubbing implementation. Neither of those are in our control, so you may need to direct this elsewhere.", "ah yes, sorry, thanks!\r\n\r\nMoved to https://github.com/python/typeshed/issues/7869" ]
https://api.github.com/repos/psf/requests/issues/6133
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6133/labels{/name}
https://api.github.com/repos/psf/requests/issues/6133/comments
https://api.github.com/repos/psf/requests/issues/6133/events
https://github.com/psf/requests/pull/6133
1,235,435,125
PR_kwDOABTKOs43y7L5
6,133
Update utils.py
{ "avatar_url": "https://avatars.githubusercontent.com/u/73458493?v=4", "events_url": "https://api.github.com/users/davidshivaji/events{/privacy}", "followers_url": "https://api.github.com/users/davidshivaji/followers", "following_url": "https://api.github.com/users/davidshivaji/following{/other_user}", "gists_url": "https://api.github.com/users/davidshivaji/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/davidshivaji", "id": 73458493, "login": "davidshivaji", "node_id": "MDQ6VXNlcjczNDU4NDkz", "organizations_url": "https://api.github.com/users/davidshivaji/orgs", "received_events_url": "https://api.github.com/users/davidshivaji/received_events", "repos_url": "https://api.github.com/users/davidshivaji/repos", "site_admin": false, "starred_url": "https://api.github.com/users/davidshivaji/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/davidshivaji/subscriptions", "type": "User", "url": "https://api.github.com/users/davidshivaji", "user_view_type": "public" }
[]
closed
true
null
[]
null
0
2022-05-13T16:10:31Z
2023-05-14T00:03:10Z
2022-05-13T16:36:14Z
CONTRIBUTOR
resolved
null
{ "avatar_url": "https://avatars.githubusercontent.com/u/5271761?v=4", "events_url": "https://api.github.com/users/nateprewitt/events{/privacy}", "followers_url": "https://api.github.com/users/nateprewitt/followers", "following_url": "https://api.github.com/users/nateprewitt/following{/other_user}", "gists_url": "https://api.github.com/users/nateprewitt/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/nateprewitt", "id": 5271761, "login": "nateprewitt", "node_id": "MDQ6VXNlcjUyNzE3NjE=", "organizations_url": "https://api.github.com/users/nateprewitt/orgs", "received_events_url": "https://api.github.com/users/nateprewitt/received_events", "repos_url": "https://api.github.com/users/nateprewitt/repos", "site_admin": false, "starred_url": "https://api.github.com/users/nateprewitt/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/nateprewitt/subscriptions", "type": "User", "url": "https://api.github.com/users/nateprewitt", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/6133/reactions" }
https://api.github.com/repos/psf/requests/issues/6133/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/6133.diff", "html_url": "https://github.com/psf/requests/pull/6133", "merged_at": "2022-05-13T16:36:14Z", "patch_url": "https://github.com/psf/requests/pull/6133.patch", "url": "https://api.github.com/repos/psf/requests/pulls/6133" }
true
[]
https://api.github.com/repos/psf/requests/issues/6132
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6132/labels{/name}
https://api.github.com/repos/psf/requests/issues/6132/comments
https://api.github.com/repos/psf/requests/issues/6132/events
https://github.com/psf/requests/issues/6132
1,233,837,215
I_kwDOABTKOs5Jityf
6,132
How to handle this issue ? - [Errno 110] Connection timed out') - Max retries exceeded with url - HTTPSConnectionPool(host=..., port=443
{ "avatar_url": "https://avatars.githubusercontent.com/u/62699983?v=4", "events_url": "https://api.github.com/users/juandavidbriceno/events{/privacy}", "followers_url": "https://api.github.com/users/juandavidbriceno/followers", "following_url": "https://api.github.com/users/juandavidbriceno/following{/other_user}", "gists_url": "https://api.github.com/users/juandavidbriceno/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/juandavidbriceno", "id": 62699983, "login": "juandavidbriceno", "node_id": "MDQ6VXNlcjYyNjk5OTgz", "organizations_url": "https://api.github.com/users/juandavidbriceno/orgs", "received_events_url": "https://api.github.com/users/juandavidbriceno/received_events", "repos_url": "https://api.github.com/users/juandavidbriceno/repos", "site_admin": false, "starred_url": "https://api.github.com/users/juandavidbriceno/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/juandavidbriceno/subscriptions", "type": "User", "url": "https://api.github.com/users/juandavidbriceno", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2022-05-12T11:22:50Z
2023-05-13T00:02:53Z
2022-05-12T15:26:05Z
NONE
resolved
Good evening, After having searched in stackoverflow for answers to my question, I was not able to find any solution. Currently I'm trying to use the request package to retrieve environmental data from a gobernment site by using url get requests. When I do the request through postman it works, but surprisingly with my python (jupyter notebook) scripts it does not. It was working perfectly before but after starting using sessions ( s = requests.Session()) then it began to produce problems. This is the code: s = requests.Session() my_uri = '.....' r_metadata= s.get(my_uri, headers={'Authorization': 'ApiToken ..............'}) print(r_metadata.status_code) --------------------------------------------------------------------------------------------------------- This is the error encounter: HTTPSConnectionPool(host='.....', port=443): Max retries exceeded with url: ....... (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7ff8256a0310>: Failed to establish a new connection: [Errno 110] Connection timed out') ------------------------------------------------------------------------------------ What I think is that these persistent session from requests are still alive, and for that reason the third party server from which I'm trying to get the data, dont allow me to enter anymore and take the information(Max retries exceeded with url:). Would you mind giving me a suggestion or solution?. Cordially, Juan David Briceno Guerrero
{ "avatar_url": "https://avatars.githubusercontent.com/u/5271761?v=4", "events_url": "https://api.github.com/users/nateprewitt/events{/privacy}", "followers_url": "https://api.github.com/users/nateprewitt/followers", "following_url": "https://api.github.com/users/nateprewitt/following{/other_user}", "gists_url": "https://api.github.com/users/nateprewitt/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/nateprewitt", "id": 5271761, "login": "nateprewitt", "node_id": "MDQ6VXNlcjUyNzE3NjE=", "organizations_url": "https://api.github.com/users/nateprewitt/orgs", "received_events_url": "https://api.github.com/users/nateprewitt/received_events", "repos_url": "https://api.github.com/users/nateprewitt/repos", "site_admin": false, "starred_url": "https://api.github.com/users/nateprewitt/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/nateprewitt/subscriptions", "type": "User", "url": "https://api.github.com/users/nateprewitt", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/6132/reactions" }
https://api.github.com/repos/psf/requests/issues/6132/timeline
null
completed
null
null
false
[ "Hi @juandavidbriceno, what you're observing is likely intentional behavior from the website to prevent web scraping. Requests often ends up on fingerprinting lists which CDNs or websites can use to prevent programmatic access. The service is refusing to respond within the default connection timeout, which implies it's just rejecting the connection.\r\n\r\nYou can try extending the timeout which there is guidance for in the docs. Otherwise, I don't believe we'll be able to help because this is a server side issue." ]
https://api.github.com/repos/psf/requests/issues/6131
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6131/labels{/name}
https://api.github.com/repos/psf/requests/issues/6131/comments
https://api.github.com/repos/psf/requests/issues/6131/events
https://github.com/psf/requests/issues/6131
1,232,797,065
I_kwDOABTKOs5Jev2J
6,131
Incorrectly strips trailing dot from absolute hostnames, causing TooManyRedirects
{ "avatar_url": "https://avatars.githubusercontent.com/u/7227064?v=4", "events_url": "https://api.github.com/users/ccazabon/events{/privacy}", "followers_url": "https://api.github.com/users/ccazabon/followers", "following_url": "https://api.github.com/users/ccazabon/following{/other_user}", "gists_url": "https://api.github.com/users/ccazabon/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/ccazabon", "id": 7227064, "login": "ccazabon", "node_id": "MDQ6VXNlcjcyMjcwNjQ=", "organizations_url": "https://api.github.com/users/ccazabon/orgs", "received_events_url": "https://api.github.com/users/ccazabon/received_events", "repos_url": "https://api.github.com/users/ccazabon/repos", "site_admin": false, "starred_url": "https://api.github.com/users/ccazabon/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/ccazabon/subscriptions", "type": "User", "url": "https://api.github.com/users/ccazabon", "user_view_type": "public" }
[]
open
false
null
[]
null
1
2022-05-11T15:01:22Z
2022-06-16T21:38:11Z
null
NONE
null
requests appears to be incorrectly stripping the trailing dot on absolute hostnames (i.e. explicitly marked as in the root DNS namespace) in URLs when constructing the Host: request header, like `pyropus.ca.`. This causes redirect loops when the site chooses the absolute hostname as canonical and redirects requests without the trailing dot. The example site redirects requests with a host header of `Host: pyropus.ca` to the same URL with the host name changed to the canonical absolute version: ``` HTTP/1.1 301 Moved Permanently [...] Location: https://pyropus.ca./ ``` requests then strips the dot and resends the request, resulting in a redirect loop. The trailing dot needs to be stripped from the SNI header for https requests (required by TLS/etc spec) but it should not be stripped from the Host: header value. When fixing the SNI trailing dot issue, curl had this bug because they changed it to also affect the Host: header value, but they've fixed it by reverting that part of the change: https://github.com/curl/curl/issues/8290 Many other common user agents that I've tested handle this properly: * all GUI browers, to my knowledge, preserve the absolute domain name in the Host: header - I've tested Firefox, Chromium, Vivaldi, Konqueror, and Safari * wget also preserves the absolute domain name on redirect URLs * curl is now fixed and handles it A few less common ones have the same buggy behaviour, or did -- I haven't re-checked: * lynx, links, and elinks handle it like curl, erroring out on a redirect loop ## Expected Result Successful 200 response with content. ## Actual Result ```python Traceback (most recent call last): File "<string>", line 1, in <module> File ".../test/.venv/lib/python3.9/site-packages/requests/api.py", line 75, in get return request('get', url, params=params, **kwargs) File ".../test/.venv/lib/python3.9/site-packages/requests/api.py", line 61, in request return session.request(method=method, url=url, **kwargs) File ".../test/.venv/lib/python3.9/site-packages/requests/sessions.py", line 529, in request resp = self.send(prep, **send_kwargs) File ".../test/.venv/lib/python3.9/site-packages/requests/sessions.py", line 667, in send history = [resp for resp in gen] File ".../test/.venv/lib/python3.9/site-packages/requests/sessions.py", line 667, in <listcomp> history = [resp for resp in gen] File ".../test/.venv/lib/python3.9/site-packages/requests/sessions.py", line 166, in resolve_redirects raise TooManyRedirects('Exceeded {} redirects.'.format(self.max_redirects), response=resp) requests.exceptions.TooManyRedirects: Exceeded 30 redirects. ``` ## Reproduction Steps ```python import requests requests.get("https://pyropus.ca./") ``` ## System Information $ python -m requests.help ```json { "chardet": { "version": null }, "charset_normalizer": { "version": "2.0.12" }, "cryptography": { "version": "" }, "idna": { "version": "3.3" }, "implementation": { "name": "CPython", "version": "3.9.2" }, "platform": { "release": "5.17.5", "system": "Linux" }, "pyOpenSSL": { "openssl_version": "", "version": null }, "requests": { "version": "2.27.1" }, "system_ssl": { "version": "101010bf" }, "urllib3": { "version": "1.26.9" }, "using_charset_normalizer": true, "using_pyopenssl": false } ``` Edit: added a couple words to the summary to clarify.
null
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/6131/reactions" }
https://api.github.com/repos/psf/requests/issues/6131/timeline
null
null
null
null
false
[ "```py\r\n @property\r\n def host(self):\r\n \"\"\"\r\n Getter method to remove any trailing dots that indicate the hostname is an FQDN.\r\n\r\n In general, SSL certificates don't include the trailing dot indicating a\r\n fully-qualified domain name, and thus, they don't validate properly when\r\n checked against a domain name that includes the dot. In addition, some\r\n servers may not expect to receive the trailing dot when provided.\r\n\r\n However, the hostname with trailing dot is critical to DNS resolution; doing a\r\n lookup with the trailing dot will properly only resolve the appropriate FQDN,\r\n whereas a lookup without a trailing dot will search the system's search domain\r\n list. Thus, it's important to keep the original host around for use only in\r\n those cases where it's appropriate (i.e., when doing DNS lookup to establish the\r\n actual TCP connection across which we're going to send HTTP requests).\r\n \"\"\"\r\n return self._dns_host.rstrip(\".\")\r\n```\r\n\r\nMight be relevant, line 132 of `urllib3/connection.py` on Python 3.10.4. Following the chain of execution from `requests` down to the `urllib3` layer, it seems like the issue resides on line 467 (same file) where `_match_hostname(cert, self.assert_hostname or server_hostname)` fails, if `return self._dns_host.rstrip(\".\")` is instead changed to `return self._dns_host`.\r\nCommenting out the call to `_match_hostname` allows the request to go through, but it's effectively equivalent to doing `requests.get(\"https://pyropus.ca./\", verify=False)`. I don't think this is erroneous behaviour library though as the comment explains." ]
https://api.github.com/repos/psf/requests/issues/6125
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6125/labels{/name}
https://api.github.com/repos/psf/requests/issues/6125/comments
https://api.github.com/repos/psf/requests/issues/6125/events
https://github.com/psf/requests/pull/6125
1,229,807,885
PR_kwDOABTKOs43ge0-
6,125
Use proxy from string
{ "avatar_url": "https://avatars.githubusercontent.com/u/53352199?v=4", "events_url": "https://api.github.com/users/el1s7/events{/privacy}", "followers_url": "https://api.github.com/users/el1s7/followers", "following_url": "https://api.github.com/users/el1s7/following{/other_user}", "gists_url": "https://api.github.com/users/el1s7/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/el1s7", "id": 53352199, "login": "el1s7", "node_id": "MDQ6VXNlcjUzMzUyMTk5", "organizations_url": "https://api.github.com/users/el1s7/orgs", "received_events_url": "https://api.github.com/users/el1s7/received_events", "repos_url": "https://api.github.com/users/el1s7/repos", "site_admin": false, "starred_url": "https://api.github.com/users/el1s7/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/el1s7/subscriptions", "type": "User", "url": "https://api.github.com/users/el1s7", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2022-05-09T14:22:24Z
2023-05-10T00:02:59Z
2022-05-09T14:44:01Z
NONE
resolved
I find myself making a dict everytime I want to test some proxy, which is unnecessary. Simply create the proxies dict from the string, in case a string supplied.
{ "avatar_url": "https://avatars.githubusercontent.com/u/5271761?v=4", "events_url": "https://api.github.com/users/nateprewitt/events{/privacy}", "followers_url": "https://api.github.com/users/nateprewitt/followers", "following_url": "https://api.github.com/users/nateprewitt/following{/other_user}", "gists_url": "https://api.github.com/users/nateprewitt/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/nateprewitt", "id": 5271761, "login": "nateprewitt", "node_id": "MDQ6VXNlcjUyNzE3NjE=", "organizations_url": "https://api.github.com/users/nateprewitt/orgs", "received_events_url": "https://api.github.com/users/nateprewitt/received_events", "repos_url": "https://api.github.com/users/nateprewitt/repos", "site_admin": false, "starred_url": "https://api.github.com/users/nateprewitt/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/nateprewitt/subscriptions", "type": "User", "url": "https://api.github.com/users/nateprewitt", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/6125/reactions" }
https://api.github.com/repos/psf/requests/issues/6125/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/6125.diff", "html_url": "https://github.com/psf/requests/pull/6125", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/6125.patch", "url": "https://api.github.com/repos/psf/requests/pulls/6125" }
true
[ "Hi @el1s7, thanks for the PR. The dictionary is our established interface for proxies though, and we aren't making any modifications to the top-level APIs at this time. I think we'll have to pass on this PR." ]
https://api.github.com/repos/psf/requests/issues/6124
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6124/labels{/name}
https://api.github.com/repos/psf/requests/issues/6124/comments
https://api.github.com/repos/psf/requests/issues/6124/events
https://github.com/psf/requests/issues/6124
1,228,827,967
I_kwDOABTKOs5JPm0_
6,124
Requests taking too long or stucking ( GNU-Linux )
{ "avatar_url": "https://avatars.githubusercontent.com/u/17380530?v=4", "events_url": "https://api.github.com/users/CarloCattano/events{/privacy}", "followers_url": "https://api.github.com/users/CarloCattano/followers", "following_url": "https://api.github.com/users/CarloCattano/following{/other_user}", "gists_url": "https://api.github.com/users/CarloCattano/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/CarloCattano", "id": 17380530, "login": "CarloCattano", "node_id": "MDQ6VXNlcjE3MzgwNTMw", "organizations_url": "https://api.github.com/users/CarloCattano/orgs", "received_events_url": "https://api.github.com/users/CarloCattano/received_events", "repos_url": "https://api.github.com/users/CarloCattano/repos", "site_admin": false, "starred_url": "https://api.github.com/users/CarloCattano/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/CarloCattano/subscriptions", "type": "User", "url": "https://api.github.com/users/CarloCattano", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2022-05-08T08:36:26Z
2023-05-09T00:03:36Z
2022-05-08T17:15:26Z
NONE
resolved
requests are taking more than 1 minute to process if they succeed at all on 2 of my linux machines at home . On windows a simple : ``` >>> import requests as r >>> r.get("http://google.com") ``` takes miliseconds , on debian bullseye takes more than 1 minute for simple requests, and sometimes they are "freezing" Any hints on how to debug this welcome. I just upgraded to latest and still the issue persist
{ "avatar_url": "https://avatars.githubusercontent.com/u/5271761?v=4", "events_url": "https://api.github.com/users/nateprewitt/events{/privacy}", "followers_url": "https://api.github.com/users/nateprewitt/followers", "following_url": "https://api.github.com/users/nateprewitt/following{/other_user}", "gists_url": "https://api.github.com/users/nateprewitt/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/nateprewitt", "id": 5271761, "login": "nateprewitt", "node_id": "MDQ6VXNlcjUyNzE3NjE=", "organizations_url": "https://api.github.com/users/nateprewitt/orgs", "received_events_url": "https://api.github.com/users/nateprewitt/received_events", "repos_url": "https://api.github.com/users/nateprewitt/repos", "site_admin": false, "starred_url": "https://api.github.com/users/nateprewitt/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/nateprewitt/subscriptions", "type": "User", "url": "https://api.github.com/users/nateprewitt", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/6124/reactions" }
https://api.github.com/repos/psf/requests/issues/6124/timeline
null
completed
null
null
false
[ "This isn't debuggable without a packet capture or logs, can you provide those? You can use Wireshark to capture packets and look at the timings.", "I added a small timeout and its fixed now. Thanks for the hint" ]
https://api.github.com/repos/psf/requests/issues/6123
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6123/labels{/name}
https://api.github.com/repos/psf/requests/issues/6123/comments
https://api.github.com/repos/psf/requests/issues/6123/events
https://github.com/psf/requests/pull/6123
1,228,062,318
PR_kwDOABTKOs43bOhw
6,123
Fix error caused by invalid charset in response headers
{ "avatar_url": "https://avatars.githubusercontent.com/u/50599779?v=4", "events_url": "https://api.github.com/users/deosrc/events{/privacy}", "followers_url": "https://api.github.com/users/deosrc/followers", "following_url": "https://api.github.com/users/deosrc/following{/other_user}", "gists_url": "https://api.github.com/users/deosrc/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/deosrc", "id": 50599779, "login": "deosrc", "node_id": "MDQ6VXNlcjUwNTk5Nzc5", "organizations_url": "https://api.github.com/users/deosrc/orgs", "received_events_url": "https://api.github.com/users/deosrc/received_events", "repos_url": "https://api.github.com/users/deosrc/repos", "site_admin": false, "starred_url": "https://api.github.com/users/deosrc/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/deosrc/subscriptions", "type": "User", "url": "https://api.github.com/users/deosrc", "user_view_type": "public" }
[]
open
false
null
[]
null
2
2022-05-06T16:22:35Z
2022-05-09T09:14:37Z
null
NONE
null
Ran into an error where we were having an exception raised from the requests library: `'bool' object has no attribute 'strip'` Seems the server was returning an empty charset value in the Content-Type response header of `application/json;charset`. This was causing the line below to default the value to a boolean `True`: https://github.com/psf/requests/blob/2a6f290bc09324406708a4d404a88a45d848ddf9/requests/utils.py#L524-L529 This meant that attempting format the charset on the line below, the value was a boolean rather than a string: https://github.com/psf/requests/blob/2a6f290bc09324406708a4d404a88a45d848ddf9/requests/utils.py#L545-L548 This change adds a type check so that the charset is ignored if a value is not provided. The unit test has been modified for coverage, along with expanding the other test scenarios slightly.
null
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/6123/reactions" }
https://api.github.com/repos/psf/requests/issues/6123/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/6123.diff", "html_url": "https://github.com/psf/requests/pull/6123", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/6123.patch", "url": "https://api.github.com/repos/psf/requests/pulls/6123" }
true
[ "Thanks for the PR, @deosrc! You've chosen an interesting time to raise this. We're currently working on options for typing in Requests and this was a case where there actually appears to be a bug in the code. Note that the response the server is giving you is not a valid response though and should be fixed on their end.\r\n\r\n`True` was chosen for a default in #4442 but doesn't make sense according to the [RFC](https://datatracker.ietf.org/doc/html/rfc7231#section-3.1.1.1). A parameter is defined to be:\r\n```\r\n media-type = type \"/\" subtype *( OWS \";\" OWS parameter )\r\n parameter = token \"=\" ( token / quoted-string )\r\n```\r\n\r\nWhich means the minimum viable `parameter` is `<token>=`. If we read farther in the RFC we find that quoting in parameters is interchangeable without affecting the semantics so `<token>=` is equivalent to `<token>=\"\"`. Our default in this case should just be an empty string rather than `True`.\r\n\r\n We don't rely on value being boolean anywhere and there's no way to leave the function with the boolean and emit a successful request. The fix we'd proposed on the typing branch was to change the default. This will result in an empty `charset=` being treated as UTF-8 when decoding rather than an unhelpful ValueError.", "> Note that the response the server is giving you is not a valid response though and should be fixed on their end.\r\n\r\nAbsolutley, this has been fixed.\r\n\r\nYour response all makes sense to me and sounds like it's fixed in the typing branch. I'll leave this up to you if you want to merge it in as an fix while the typing is ready, or for those unable to use typing. Happy for it to just be closed if it's not worth it as it's a rather obscure bug." ]
https://api.github.com/repos/psf/requests/issues/6122
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6122/labels{/name}
https://api.github.com/repos/psf/requests/issues/6122/comments
https://api.github.com/repos/psf/requests/issues/6122/events
https://github.com/psf/requests/pull/6122
1,226,490,072
PR_kwDOABTKOs43WFID
6,122
Request with data which consists of empty values only sends bad request
{ "avatar_url": "https://avatars.githubusercontent.com/u/20498421?v=4", "events_url": "https://api.github.com/users/romanyakovlev/events{/privacy}", "followers_url": "https://api.github.com/users/romanyakovlev/followers", "following_url": "https://api.github.com/users/romanyakovlev/following{/other_user}", "gists_url": "https://api.github.com/users/romanyakovlev/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/romanyakovlev", "id": 20498421, "login": "romanyakovlev", "node_id": "MDQ6VXNlcjIwNDk4NDIx", "organizations_url": "https://api.github.com/users/romanyakovlev/orgs", "received_events_url": "https://api.github.com/users/romanyakovlev/received_events", "repos_url": "https://api.github.com/users/romanyakovlev/repos", "site_admin": false, "starred_url": "https://api.github.com/users/romanyakovlev/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/romanyakovlev/subscriptions", "type": "User", "url": "https://api.github.com/users/romanyakovlev", "user_view_type": "public" }
[ { "color": "e10c02", "default": false, "description": null, "id": 117744, "name": "Bug", "node_id": "MDU6TGFiZWwxMTc3NDQ=", "url": "https://api.github.com/repos/psf/requests/labels/Bug" } ]
open
false
null
[]
null
16
2022-05-05T10:28:39Z
2023-06-24T16:24:36Z
null
NONE
null
Case - request with data which consists of empty values only ```python get('http://localhost:80', data={'foo': None}) ``` Response in nginx: ``` 172.17.0.1 - - [05/May/2022:19:34:30 +0000] "GET / HTTP/1.1" 200 615 "-" "python-requests/2.27.1" "-" 172.17.0.1 - - [05/May/2022:19:34:30 +0000] "0" 400 157 "-" "-" "-" ``` So it sends second request with bad status code. Here https://github.com/psf/requests/blob/main/requests/models.py#L576 `length` will be `0` so there is no `Content-Length: 0` header in request. The problem occurs there https://github.com/psf/requests/blob/main/requests/adapters.py#L471 . Because `request.body` is `''` and 'Content-Length' not in `request.headers` it counts as `chunk=True`. Because of that it acts like it has `Transfer-Encoding: chunked` header, and here https://github.com/psf/requests/blob/main/requests/adapters.py#L523-L528 it does not send nothing but `low_conn.send(b'0\r\n\r\n')`. I guess thats why It has bad request like this: ``` apache_1 | 172.21.0.1 - - [05/May/2022:23:05:44 +0000] "0" 400 226 ``` The same behavior is happening on POST request. ```python post('http://localhost:80', data={'foo': None}) ``` gives: ``` apache_1 | 172.21.0.1 - - [05/May/2022:23:05:44 +0000] "POST / HTTP/1.1" 200 45 apache_1 | 172.21.0.1 - - [05/May/2022:23:05:44 +0000] "0" 400 226 ``` The raw request will be something like this: ```python import socket s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.connect(("localhost", 80)) s.send( b'GET / HTTP/1.1\r\n' b'Host: localhost:80\r\n' b'User-Agent: python-requests/2.27.1\r\n' b'Accept-Encoding: gzip, deflate, br\r\n' b'Accept: */*\r\n' b'Connection: keep-alive\r\n' b'\r\n' b'0\r\n\r\n' # this thing is added here https://github.com/psf/requests/blob/main/requests/adapters.py#L528 ) response = s.recv(4096) print(response) ``` so `0\r\n\r\n` is the reason of `apache_1 | 172.21.0.1 - - [05/May/2022:23:05:44 +0000] "0" 400 226` This PR fixes the problem. Tests for this case are created.
{ "avatar_url": "https://avatars.githubusercontent.com/u/20498421?v=4", "events_url": "https://api.github.com/users/romanyakovlev/events{/privacy}", "followers_url": "https://api.github.com/users/romanyakovlev/followers", "following_url": "https://api.github.com/users/romanyakovlev/following{/other_user}", "gists_url": "https://api.github.com/users/romanyakovlev/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/romanyakovlev", "id": 20498421, "login": "romanyakovlev", "node_id": "MDQ6VXNlcjIwNDk4NDIx", "organizations_url": "https://api.github.com/users/romanyakovlev/orgs", "received_events_url": "https://api.github.com/users/romanyakovlev/received_events", "repos_url": "https://api.github.com/users/romanyakovlev/repos", "site_admin": false, "starred_url": "https://api.github.com/users/romanyakovlev/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/romanyakovlev/subscriptions", "type": "User", "url": "https://api.github.com/users/romanyakovlev", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/6122/reactions" }
https://api.github.com/repos/psf/requests/issues/6122/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/6122.diff", "html_url": "https://github.com/psf/requests/pull/6122", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/6122.patch", "url": "https://api.github.com/repos/psf/requests/pulls/6122" }
true
[ "Hi @romanyakovlev, can you provide some more information about why you believe this needs to be changed? The original input data _is_ `application/x-www-form-urlencoded`, it just happens that the serialized version is an empty string in this case.\r\n\r\nI don't believe there's any specification implying you should remove the Content-Type for zero length bodies. That's likely breaking behavior for a subset of APIs. It's probably also worth noting that the semantics of a GET request body are undefined since this is non-standard behavior. What happens here cannot be \"correct\" or \"incorrect\".", "@nateprewitt the reason why I pushed this PR is the problem with nginx. When this type of request was sent to it I saw this in logs:\r\n```\r\n172.17.0.1 - - [05/May/2022:19:34:30 +0000] \"GET / HTTP/1.1\" 200 615 \"-\" \"python-requests/2.27.1\" \"-\"\r\n172.17.0.1 - - [05/May/2022:19:34:30 +0000] \"0\" 400 157 \"-\" \"-\" \"-\"\r\n```\r\nSo after `GET` request nginx also got the second request with 400 status code\r\nWith this fix everything is ok:\r\n```\r\n172.17.0.1 - - [05/May/2022:19:32:13 +0000] \"GET / HTTP/1.1\" 200 615 \"-\" \"python-requests/2.27.1\" \"-\"\r\n```\r\nThats the only reason. \r\nNginx version is 1.20.1.", "You'll want to check error logs on why nginx is throwing a 400. It's also hard to tell if this is an issue for nginx or the application it's fronting.", "Well, my mistake. The problem was not with `application/x-www-form-urlencoded` but with the `body` variable which should have `''` value to reproduce this behavior and `None` value to fix it.", "The same thing is happening on apache 2.4:\r\n```\r\napache_1 | 172.21.0.1 - - [05/May/2022:20:02:17 +0000] \"GET / HTTP/1.1\" 200 45\r\napache_1 | 172.21.0.1 - - [05/May/2022:20:02:17 +0000] \"0\" 400 226\r\n```", "@nateprewitt I'm sending request directly to nginx in docker without any other apps, the same thing is true for apache. Its hard to understand what’s wrong with the request because its just \"bad request\"", "But I'm going to investigate why this is happening and yes, I was wrong about the reason is `application/x-www-form-urlencoded`", "Alright, the error is [here](https://github.com/psf/requests/blob/main/requests/models.py#L575-L580). We do a check below to make sure we're not emitting a Content-Length for GET/HEAD requests, but not for this first check. When the body value is None, it bypasses this conditional, but an empty string does not. This results in a `Content-Length: 0` header being added.\r\n\r\nAs I said earlier, what you're trying to do with this request is outside of the realm of defined HTTP semantics. You should not be emitting a GET request with a body but we allow it because some servers do crazy things.\r\n\r\nThe issue I believe you're hitting with apache/nginx is this:\r\n\r\n> A user agent SHOULD NOT send a Content-Length header field\r\n when the request message does not contain a payload body and\r\n the method semantics do not anticipate such a body.\r\n\r\n-- [RFC 7230 3.3.2](https://datatracker.ietf.org/doc/html/rfc7230#section-3.3.2)\r\n\r\nWhile we probably shouldn't be doing this we are. It's hard to tell what may be relying on this behavior at this point and given this is a SHOULD NOT rather than a MUST NOT, I don't think this is something we'd fix in Requests 2.x.", "Okay, I got it, thanks. PR is closed.", "@nateprewitt after some research I've discovered that the problem is not about `Content-Length` header. \r\nHere https://github.com/psf/requests/blob/main/requests/models.py#L576 `length` will be `0` so there is no `Content-Length: 0` header in request. \r\nThe problem occurs there https://github.com/psf/requests/blob/main/requests/adapters.py#L471 . \r\nBecause `request.body` is `''` and `'Content-Length'` not in `request.headers` it counts as `chunk=True`. \r\nBecause of that it acts like it has `Transfer-Encoding: chunked` header, and here https://github.com/psf/requests/blob/main/requests/adapters.py#L523-L528 it does not send nothing but `low_conn.send(b'0\\r\\n\\r\\n')`. \r\nI guess thats why It has bad request like this:\r\n```\r\napache_1 | 172.21.0.1 - - [05/May/2022:23:05:44 +0000] \"0\" 400 226\r\n```\r\nAnd the most interesting thing - the same behavior is happening on `POST` request.\r\n```python\r\npost('http://localhost:80', data={'foo': None})\r\n```\r\ngives:\r\n```\r\napache_1 | 172.21.0.1 - - [05/May/2022:23:05:44 +0000] \"POST / HTTP/1.1\" 200 45\r\napache_1 | 172.21.0.1 - - [05/May/2022:23:05:44 +0000] \"0\" 400 226\r\n```\r\nThe raw request will be something like this:\r\n```python\r\nimport socket\r\ns = socket.socket(socket.AF_INET, socket.SOCK_STREAM)\r\ns.connect((\"localhost\", 80))\r\ns.send(\r\n b'GET / HTTP/1.1\\r\\n'\r\n b'Host: localhost:80\\r\\n'\r\n b'User-Agent: python-requests/2.27.1\\r\\n'\r\n b'Accept-Encoding: gzip, deflate, br\\r\\n'\r\n b'Accept: */*\\r\\n'\r\n b'Connection: keep-alive\\r\\n'\r\n b'\\r\\n'\r\n b'0\\r\\n\\r\\n' # this thing is added here https://github.com/psf/requests/blob/main/requests/adapters.py#L528\r\n)\r\n\r\nresponse = s.recv(4096)\r\nprint(response)\r\n```\r\nso `0\\r\\n\\r\\n` is the reason of \r\n```\r\napache_1 | 172.21.0.1 - - [05/May/2022:23:05:44 +0000] \"0\" 400 226\r\n```\r\n", "Changed PR description and name", "Yep, this does appear to be a bug! We shouldn't be leaving this code branch without setting `Content-Length`, `Transfer-Encoding`, or ensuring `body = None`. It's hard to know which fix is going to be the least problematic. I'm hesitant to start adding new headers to requests, but the first option would be to add `Transfer-Encoding: chunked` if our body isn't None and we didn't compute a `Content-Length`.\r\n\r\nHowever, short-circuiting this by changing the `body` from `''` back to `None` seems less impactful. It will affect the value of Request.body after calling `prepare_body` which is potentially breaking for some use cases. I think given the full flow is completely broken currently, that may be acceptable though.\r\n\r\nI wrote up a quick test for [tests/test_lowlevel.py](https://github.com/psf/requests/blob/main/tests/test_lowlevel.py) to demonstrate what we're trying to fix.\r\n\r\n```python\r\[email protected](\r\n \"method,include,exclude\",\r\n (\r\n (requests.get, [], [b\"Content-Length:\", b\"Transfer-Encoding:\"]),\r\n (requests.post, [b\"Content-Length: 0\\r\\n\"], [b\"Transfer-Encoding:\"]),\r\n )\r\n)\r\ndef test_empty_urlencoded_form_body(method, include, exclude):\r\n \"\"\"Ensure we use only the specified Host header for chunked requests.\"\"\"\r\n close_server = threading.Event()\r\n server = Server(echo_response_handler, wait_to_close_event=close_server)\r\n\r\n with server as (host, port):\r\n url = f\"http://{host}:{port}/\"\r\n resp = method(url, data=((\"a\", None,),))\r\n close_server.set() # release server block\r\n\r\n assert not resp.content.endswith(b'\\r\\n0\\r\\n\\r\\n')\r\n\r\n for header in include:\r\n assert header in resp.content\r\n\r\n for header in exclude:\r\n assert header not in resp.content\r\n```\r\n\r\nTo fix it, I think the least invasive change would be updating [this line](https://github.com/psf/requests/blob/main/requests/models.py#L559) to:\r\n```python\r\n body = self._encode_params(data) or None\r\n```\r\n\r\nLet me know what you think about that, @romanyakovlev. I'm curious to hear from @sigmavirus24 and/or @sethmlarson on their thoughts.", "My input is \"garbage in, garbage out\". The input causing the behavior is garbage so I'm not worried about this", "This is definitely an edge case, but I'm hesitant to call it garbage because the interface allows arbitrary dictionaries as input. If you're constructing your input dynamically and end up with a value of None, Requests shouldn't start emitting non-sense message framing. Ideally, we either error out or make sure we know how to send the right pieces over the wire.\r\n\r\nThis isn't scoped to None either, any empty iterable value will trigger this. I'm surprised this hasn't been raised before.", "@nateprewitt I agree, your solution looks better. Pushed it with the test to the branch.", "> This is definitely an edge case, but I'm hesitant to call it garbage because the interface allows arbitrary dictionaries as input. If you're constructing your input dynamically and end up with a value of None, Requests shouldn't start emitting non-sense message framing. Ideally, we either error out or \nmake sure we know how to send the right pieces over the wire.\n> \n\n\nIf you're constructing it this way and you're not being careful then it is garbage input. None doesn't mean anything in this context. I've always opposed the support of none in the parameter but we can't remove it.\n\n> This isn't scoped to None either, any empty iterable value will trigger this. I'm surprised this hasn't been raised before.\n\nAgain, garbage. If you're sending an empty iterable that's garbage for us to try to do our best with and no way to predict it" ]
https://api.github.com/repos/psf/requests/issues/6121
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6121/labels{/name}
https://api.github.com/repos/psf/requests/issues/6121/comments
https://api.github.com/repos/psf/requests/issues/6121/events
https://github.com/psf/requests/pull/6121
1,224,967,907
PR_kwDOABTKOs43RSRs
6,121
Add and use new exception when redirect url is invalid
{ "avatar_url": "https://avatars.githubusercontent.com/u/38295919?v=4", "events_url": "https://api.github.com/users/setla/events{/privacy}", "followers_url": "https://api.github.com/users/setla/followers", "following_url": "https://api.github.com/users/setla/following{/other_user}", "gists_url": "https://api.github.com/users/setla/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/setla", "id": 38295919, "login": "setla", "node_id": "MDQ6VXNlcjM4Mjk1OTE5", "organizations_url": "https://api.github.com/users/setla/orgs", "received_events_url": "https://api.github.com/users/setla/received_events", "repos_url": "https://api.github.com/users/setla/repos", "site_admin": false, "starred_url": "https://api.github.com/users/setla/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/setla/subscriptions", "type": "User", "url": "https://api.github.com/users/setla", "user_view_type": "public" }
[]
closed
true
null
[]
null
0
2022-05-04T06:23:48Z
2024-07-30T00:03:46Z
2023-07-30T01:58:42Z
NONE
resolved
Feature described in issue https://github.com/psf/requests/issues/6120 new `InvalidRedirectURL` inherits `InvalidURL, InvalidSchema, LocationParseError` for backward compatibility
{ "avatar_url": "https://avatars.githubusercontent.com/u/5271761?v=4", "events_url": "https://api.github.com/users/nateprewitt/events{/privacy}", "followers_url": "https://api.github.com/users/nateprewitt/followers", "following_url": "https://api.github.com/users/nateprewitt/following{/other_user}", "gists_url": "https://api.github.com/users/nateprewitt/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/nateprewitt", "id": 5271761, "login": "nateprewitt", "node_id": "MDQ6VXNlcjUyNzE3NjE=", "organizations_url": "https://api.github.com/users/nateprewitt/orgs", "received_events_url": "https://api.github.com/users/nateprewitt/received_events", "repos_url": "https://api.github.com/users/nateprewitt/repos", "site_admin": false, "starred_url": "https://api.github.com/users/nateprewitt/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/nateprewitt/subscriptions", "type": "User", "url": "https://api.github.com/users/nateprewitt", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/6121/reactions" }
https://api.github.com/repos/psf/requests/issues/6121/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/6121.diff", "html_url": "https://github.com/psf/requests/pull/6121", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/6121.patch", "url": "https://api.github.com/repos/psf/requests/pulls/6121" }
true
[]
https://api.github.com/repos/psf/requests/issues/6120
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6120/labels{/name}
https://api.github.com/repos/psf/requests/issues/6120/comments
https://api.github.com/repos/psf/requests/issues/6120/events
https://github.com/psf/requests/issues/6120
1,224,967,057
I_kwDOABTKOs5JA4OR
6,120
New exception when redirect url is invalid
{ "avatar_url": "https://avatars.githubusercontent.com/u/38295919?v=4", "events_url": "https://api.github.com/users/setla/events{/privacy}", "followers_url": "https://api.github.com/users/setla/followers", "following_url": "https://api.github.com/users/setla/following{/other_user}", "gists_url": "https://api.github.com/users/setla/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/setla", "id": 38295919, "login": "setla", "node_id": "MDQ6VXNlcjM4Mjk1OTE5", "organizations_url": "https://api.github.com/users/setla/orgs", "received_events_url": "https://api.github.com/users/setla/received_events", "repos_url": "https://api.github.com/users/setla/repos", "site_admin": false, "starred_url": "https://api.github.com/users/setla/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/setla/subscriptions", "type": "User", "url": "https://api.github.com/users/setla", "user_view_type": "public" }
[]
open
false
null
[]
null
0
2022-05-04T06:22:32Z
2022-05-04T06:22:32Z
null
NONE
null
Currently when redirect response with invalid redirect URL is returned, we receive the same error (`InvalidURL, InvalidSchema, LocationParseError`) as when passing wrong URL that is used for first request in chain. It would be good to have those cases separated (e.g. to try fix it in custom way)
null
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/6120/reactions" }
https://api.github.com/repos/psf/requests/issues/6120/timeline
null
null
null
null
false
[]
https://api.github.com/repos/psf/requests/issues/6119
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6119/labels{/name}
https://api.github.com/repos/psf/requests/issues/6119/comments
https://api.github.com/repos/psf/requests/issues/6119/events
https://github.com/psf/requests/pull/6119
1,223,720,741
PR_kwDOABTKOs43NWbG
6,119
Avoid mutation of proxies input argument
{ "avatar_url": "https://avatars.githubusercontent.com/u/1335341?v=4", "events_url": "https://api.github.com/users/milanboers/events{/privacy}", "followers_url": "https://api.github.com/users/milanboers/followers", "following_url": "https://api.github.com/users/milanboers/following{/other_user}", "gists_url": "https://api.github.com/users/milanboers/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/milanboers", "id": 1335341, "login": "milanboers", "node_id": "MDQ6VXNlcjEzMzUzNDE=", "organizations_url": "https://api.github.com/users/milanboers/orgs", "received_events_url": "https://api.github.com/users/milanboers/received_events", "repos_url": "https://api.github.com/users/milanboers/repos", "site_admin": false, "starred_url": "https://api.github.com/users/milanboers/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/milanboers/subscriptions", "type": "User", "url": "https://api.github.com/users/milanboers", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2022-05-03T05:57:40Z
2023-05-04T00:03:14Z
2022-05-03T15:05:37Z
NONE
resolved
Resolves #6118 Makes sure that the input argument to `proxies` is not mutated.
{ "avatar_url": "https://avatars.githubusercontent.com/u/5271761?v=4", "events_url": "https://api.github.com/users/nateprewitt/events{/privacy}", "followers_url": "https://api.github.com/users/nateprewitt/followers", "following_url": "https://api.github.com/users/nateprewitt/following{/other_user}", "gists_url": "https://api.github.com/users/nateprewitt/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/nateprewitt", "id": 5271761, "login": "nateprewitt", "node_id": "MDQ6VXNlcjUyNzE3NjE=", "organizations_url": "https://api.github.com/users/nateprewitt/orgs", "received_events_url": "https://api.github.com/users/nateprewitt/received_events", "repos_url": "https://api.github.com/users/nateprewitt/repos", "site_admin": false, "starred_url": "https://api.github.com/users/nateprewitt/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/nateprewitt/subscriptions", "type": "User", "url": "https://api.github.com/users/nateprewitt", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/6119/reactions" }
https://api.github.com/repos/psf/requests/issues/6119/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/6119.diff", "html_url": "https://github.com/psf/requests/pull/6119", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/6119.patch", "url": "https://api.github.com/repos/psf/requests/pulls/6119" }
true
[ "I've responded in the original issue (https://github.com/psf/requests/issues/6118#issuecomment-1116207174) with reasoning, but we don't intend to accept this at this time." ]
https://api.github.com/repos/psf/requests/issues/6118
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6118/labels{/name}
https://api.github.com/repos/psf/requests/issues/6118/comments
https://api.github.com/repos/psf/requests/issues/6118/events
https://github.com/psf/requests/issues/6118
1,223,719,666
I_kwDOABTKOs5I8Hry
6,118
`proxies` input argument is mutated
{ "avatar_url": "https://avatars.githubusercontent.com/u/1335341?v=4", "events_url": "https://api.github.com/users/milanboers/events{/privacy}", "followers_url": "https://api.github.com/users/milanboers/followers", "following_url": "https://api.github.com/users/milanboers/following{/other_user}", "gists_url": "https://api.github.com/users/milanboers/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/milanboers", "id": 1335341, "login": "milanboers", "node_id": "MDQ6VXNlcjEzMzUzNDE=", "organizations_url": "https://api.github.com/users/milanboers/orgs", "received_events_url": "https://api.github.com/users/milanboers/received_events", "repos_url": "https://api.github.com/users/milanboers/repos", "site_admin": false, "starred_url": "https://api.github.com/users/milanboers/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/milanboers/subscriptions", "type": "User", "url": "https://api.github.com/users/milanboers", "user_view_type": "public" }
[ { "color": "eb6420", "default": false, "description": null, "id": 44501256, "name": "Breaking API Change", "node_id": "MDU6TGFiZWw0NDUwMTI1Ng==", "url": "https://api.github.com/repos/psf/requests/labels/Breaking%20API%20Change" } ]
open
false
null
[]
null
5
2022-05-03T05:54:56Z
2023-03-09T05:57:50Z
null
NONE
null
The input argument to `proxies` is mutated when environment proxy variables are present. See the reproduction steps. This may be different than what users are expecting. It can lead to unexpected behavior when re-using the argument that was passed. ## Expected Result No mutation of the input argument: ``` >>> proxies = {'dummy': 'dummy'} >>> os.environ['http_proxy'] = 'http://dummy' >>> requests.get('https://python.org',proxies=proxies) <Response [200]> >>> proxies {'dummy': 'dummy'} ``` ## Actual Result / Reproduction steps ``` >>> proxies = {'dummy': 'dummy'} >>> os.environ['http_proxy'] = 'http://dummy' >>> requests.get('https://python.org',proxies=proxies) <Response [200]> >>> proxies {'dummy': 'dummy', 'http': 'http://dummy'} ``` ## System Information $ python -m requests.help ```json { "chardet": { "version": null }, "charset_normalizer": { "version": "2.0.12" }, "cryptography": { "version": "" }, "idna": { "version": "3.3" }, "implementation": { "name": "CPython", "version": "3.10.4" }, "platform": { "release": "5.10.102.1-microsoft-standard-WSL2", "system": "Linux" }, "pyOpenSSL": { "openssl_version": "", "version": null }, "requests": { "version": "2.27.1" }, "system_ssl": { "version": "30000020" }, "urllib3": { "version": "1.26.9" }, "using_charset_normalizer": true, "using_pyopenssl": false } ``` <!-- This command is only available on Requests v2.16.4 and greater. Otherwise, please provide some basic information about your system (Python version, operating system, &c). -->
{ "avatar_url": "https://avatars.githubusercontent.com/u/5271761?v=4", "events_url": "https://api.github.com/users/nateprewitt/events{/privacy}", "followers_url": "https://api.github.com/users/nateprewitt/followers", "following_url": "https://api.github.com/users/nateprewitt/following{/other_user}", "gists_url": "https://api.github.com/users/nateprewitt/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/nateprewitt", "id": 5271761, "login": "nateprewitt", "node_id": "MDQ6VXNlcjUyNzE3NjE=", "organizations_url": "https://api.github.com/users/nateprewitt/orgs", "received_events_url": "https://api.github.com/users/nateprewitt/received_events", "repos_url": "https://api.github.com/users/nateprewitt/repos", "site_admin": false, "starred_url": "https://api.github.com/users/nateprewitt/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/nateprewitt/subscriptions", "type": "User", "url": "https://api.github.com/users/nateprewitt", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/6118/reactions" }
https://api.github.com/repos/psf/requests/issues/6118/timeline
null
null
null
null
false
[ "Hi @milanboers, the behavior you're seeing is documented and standard across other HTTP tools, so I'm not sure it's broadly unexpected. We can't remove this behavior since a significant portion of users rely on it. If you don't want this functionality, you can set `trust_env` to False to disable this as documented [here](https://docs.python-requests.org/en/latest/api/#requests.Session.trust_env).", "Hi @nateprewitt , not sure if I made myself clear enough. The issue is not that proxy settings are taken from the environment, but that the input argument itself is mutated. I don't see this documented and am not aware of other tools that do the same.", "Thanks for clarifying, I agree that behavior is a bit odd in the context of the top-level apis. `merge_environment_settings` is intended to mutate the input parameters and so I don't think we'd want to change that behavior. We could potentially create a copy of the input proxies [here](https://github.com/psf/requests/blob/40956723f27daf5e0d9759208ca69cef236ab339/requests/sessions.py#L575), but I think that also has potential to be breaking.\r\n\r\nThe best option here for now may be to make sure this is documented. I'd be willing to accept a PR with this information in the proxies section.", "I see. From the code it appears unintentional though:\r\n- All other parameters to `merge_environment_settings` (`url`, `stream`, `verify`, `cert`) are not mutated, only `proxies` is. \r\n- The merged settings are returned from the function. Why return anything if the input arguments are supposed to be mutated instead?\r\n- The settings that are returned are not the same as the mutation:\r\n```\r\n>>> session.proxies['session'] = 'http://session'\r\n>>> os.environ['http_proxy'] = 'http://env'\r\n>>> proxies = {'input': 'http://input'}\r\n>>> session.merge_environment_settings('http://myurl', proxies, None, None, None)\r\n{'verify': True, 'proxies': OrderedDict([('session', 'http://session'), ('input', 'http://input'), ('http', 'http://env')]), 'stream': False, 'cert': None}\r\n>>> proxies\r\n{'input': 'http://input', 'http': 'http://env'}\r\n```", "> * All other parameters to merge_environment_settings (url, stream, verify, cert) are not mutated, only proxies is.\r\n\r\nWell, to that point, `proxies` is the only mutable argument for `merge_environment_settings`. Everything else is immutable due to booleans and strings being references.\r\n\r\n> The merged settings are returned from the function. Why return anything if the input arguments are supposed to be mutated instead?\r\n\r\nBecause not everything is mutable.\r\n\r\n> The settings that are returned are not the same as the mutation:\r\n\r\nYeah, I agree this is a bit odd, but it's been the behavior for 9 years. I'm not entirely against improving it, but as I said above, this is existing functionality in a tool the majority of the Python ecosystem relies on. We cannot change this without a major version bump which isn't on the immediate horizon.\r\n\r\nI think the actions for the moment are documentation updates. I can reopen this as a breaking tracking feature, but there isn't a current timeline for addressing it." ]
https://api.github.com/repos/psf/requests/issues/6117
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6117/labels{/name}
https://api.github.com/repos/psf/requests/issues/6117/comments
https://api.github.com/repos/psf/requests/issues/6117/events
https://github.com/psf/requests/issues/6117
1,221,683,176
I_kwDOABTKOs5I0Wfo
6,117
Cookies are not persisted to the passed CookieJar
{ "avatar_url": "https://avatars.githubusercontent.com/u/5687998?v=4", "events_url": "https://api.github.com/users/verhovsky/events{/privacy}", "followers_url": "https://api.github.com/users/verhovsky/followers", "following_url": "https://api.github.com/users/verhovsky/following{/other_user}", "gists_url": "https://api.github.com/users/verhovsky/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/verhovsky", "id": 5687998, "login": "verhovsky", "node_id": "MDQ6VXNlcjU2ODc5OTg=", "organizations_url": "https://api.github.com/users/verhovsky/orgs", "received_events_url": "https://api.github.com/users/verhovsky/received_events", "repos_url": "https://api.github.com/users/verhovsky/repos", "site_admin": false, "starred_url": "https://api.github.com/users/verhovsky/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/verhovsky/subscriptions", "type": "User", "url": "https://api.github.com/users/verhovsky", "user_view_type": "public" }
[]
closed
true
null
[]
null
3
2022-04-30T01:14:22Z
2023-05-01T00:03:15Z
2022-04-30T16:20:10Z
CONTRIBUTOR
resolved
## Expected Result When passing a CookieJar object to requests, I (and [other people on Stack Overflow](https://stackoverflow.com/a/6930182)) expected any cookies sent by the server to appear in the CookieJar object. ## Actual Result The server sends cookies, I can see them with `resp.cookies` but the CookieJar stays the same. ## Reproduction Steps ```python import requests from http.cookiejar import CookieJar, Cookie jar = CookieJar() resp = requests.get('https://www.google.com', cookies=jar) print(resp.cookies) print(jar) # stays empty ``` I also tried passing in a CookieJar with at least one Cookie ```python some_cookie = Cookie(None, 'asdf', None, '80', '80', 'www.foo.bar', None, None, '/', None, False, False, 'TestCookie', None, None, None) jar.set_cookie(some_cookie) print(len(jar)) # 1 resp = requests.get('https://www.google.com', cookies=jar) print(len(jar)) # still 1 ``` I also tried passing a `RequestsCookieJar`, with the same effect. ## Did this work before? Yes, after spinning up Debian 9 on Vultr and then running ```sh sudo apt install python3-pip python-pip ``` using these commands ```sh python2 -m pip uninstall -y requests python2 -m pip install requests==0.14.2 python2 -c "import requests; from cookielib import CookieJar; jar = CookieJar(); resp = requests.get('https://www.google.com', cookies=jar); print(len(jar))" ``` I have confirmed that this worked how I expect on Python 2 + Requests 0.6.0, 0.7.0 and 0.14.2 but stoped working in 1.0.0. I couldn't get those old versions of Requests to install on the Python 3.5 that comes with Debian 9. ## Why this happens I think before, the Session's cookies were copied into the passed CookieJar object https://github.com/psf/requests/blob/63243b1e3b435c7736acf1e51c0f6fa6666d861d/requests/sessions.py#L184 https://github.com/psf/requests/blob/63243b1e3b435c7736acf1e51c0f6fa6666d861d/requests/sessions.py#L208-L210 whereas now https://github.com/psf/requests/blob/2a6f290bc09324406708a4d404a88a45d848ddf9/requests/sessions.py#L474-L476 a new `RequestsCookieJar` object is created from the `CookieJar` instead of it being used directly.
{ "avatar_url": "https://avatars.githubusercontent.com/u/240830?v=4", "events_url": "https://api.github.com/users/sigmavirus24/events{/privacy}", "followers_url": "https://api.github.com/users/sigmavirus24/followers", "following_url": "https://api.github.com/users/sigmavirus24/following{/other_user}", "gists_url": "https://api.github.com/users/sigmavirus24/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/sigmavirus24", "id": 240830, "login": "sigmavirus24", "node_id": "MDQ6VXNlcjI0MDgzMA==", "organizations_url": "https://api.github.com/users/sigmavirus24/orgs", "received_events_url": "https://api.github.com/users/sigmavirus24/received_events", "repos_url": "https://api.github.com/users/sigmavirus24/repos", "site_admin": false, "starred_url": "https://api.github.com/users/sigmavirus24/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/sigmavirus24/subscriptions", "type": "User", "url": "https://api.github.com/users/sigmavirus24", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/6117/reactions" }
https://api.github.com/repos/psf/requests/issues/6117/timeline
null
completed
null
null
false
[ "I can't reproduce this\r\n\r\n```\r\n❯ python\r\nPython 3.10.4 (main, Mar 25 2022, 00:00:00) [GCC 11.2.1 20220127 (Red Hat 11.2.1-9)] on linux\r\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\r\n>>> import requests\r\n>>> from http.cookiejar import CookieJar, Cookie\r\n>>>\r\n>>> jar = CookieJar()\r\n>>>\r\n>>> resp = requests.get('https://www.google.com', cookies=jar)\r\n>>>\r\n>>> print(resp.cookies)\r\n<RequestsCookieJar[<Cookie 1P_JAR=2022-04-30-16 for .google.com/>, <Cookie AEC=AakniGOzKHfGhcufRrqyE81DNctkZa2aWDf1CgLpPzaNOg-WQr8HqKplcw for .google.com/>, <Cookie NID=511=gYUZryN9sfduX2FoMd4s6AveuS-6pu71iYbbn6dxXVa75Uf_GT9tP20crB7OxHQiVKgxD_8jGDCnzSHWzJctL9ARksL6hmsleP1Wu6SHV3zgTGZVPGErHfjmcsjC3M83Q7-68VkQqh37-l089Wh1WErXcHvp8qPu4SMgvxLUWPk for .google.com/>]>\r\n>>> print(jar) # stays empty\r\n<CookieJar[]>\r\n>>>\r\n❯ python -m requests.help \r\n{\r\n \"chardet\": {\r\n \"version\": null\r\n },\r\n \"charset_normalizer\": {\r\n \"version\": \"2.0.12\"\r\n },\r\n \"cryptography\": {\r\n \"version\": \"\"\r\n },\r\n \"idna\": {\r\n \"version\": \"3.3\"\r\n },\r\n \"implementation\": {\r\n \"name\": \"CPython\",\r\n \"version\": \"3.10.4\"\r\n },\r\n \"platform\": {\r\n \"release\": \"5.16.11-200.fc35.x86_64\",\r\n \"system\": \"Linux\"\r\n },\r\n \"pyOpenSSL\": {\r\n \"openssl_version\": \"\",\r\n \"version\": null\r\n },\r\n \"requests\": {\r\n \"version\": \"2.27.1\"\r\n },\r\n \"system_ssl\": {\r\n \"version\": \"101010ef\"\r\n },\r\n \"urllib3\": {\r\n \"version\": \"1.26.9\"\r\n },\r\n \"using_charset_normalizer\": true,\r\n \"using_pyopenssl\": false\r\n}\r\n```", "The CookieJar object you passed in stays empty. That's the issue. You did reproduce it.\r\n\r\nRequests populated the passed in object with the recieved cookies before 1.0.0 and it's the behavior I expected.", "Hi @verhovsky, to answer your question, the empty jar is intentional. Requests 1.0 was released a decade ago and the observed behavior has been consistent since. The reason we do not mutate the cookies in the provided jar is repeated requests are not idempotent and this may lead to unexpected behavior. If you provide a set of cookies, and the server responds with overrides for those values, a second request may result in a different response which can be surprising.\r\n\r\nInstead, we copy all received cookies into the new jar and you're free to merge them into your original or choose what happens with them. We do not intend to revert this as it's been how the library has operated for almost the entirety of its existence." ]
https://api.github.com/repos/psf/requests/issues/6116
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6116/labels{/name}
https://api.github.com/repos/psf/requests/issues/6116/comments
https://api.github.com/repos/psf/requests/issues/6116/events
https://github.com/psf/requests/pull/6116
1,221,553,985
PR_kwDOABTKOs43GfhA
6,116
Add .git-blame-ignore-revs
{ "avatar_url": "https://avatars.githubusercontent.com/u/5271761?v=4", "events_url": "https://api.github.com/users/nateprewitt/events{/privacy}", "followers_url": "https://api.github.com/users/nateprewitt/followers", "following_url": "https://api.github.com/users/nateprewitt/following{/other_user}", "gists_url": "https://api.github.com/users/nateprewitt/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/nateprewitt", "id": 5271761, "login": "nateprewitt", "node_id": "MDQ6VXNlcjUyNzE3NjE=", "organizations_url": "https://api.github.com/users/nateprewitt/orgs", "received_events_url": "https://api.github.com/users/nateprewitt/received_events", "repos_url": "https://api.github.com/users/nateprewitt/repos", "site_admin": false, "starred_url": "https://api.github.com/users/nateprewitt/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/nateprewitt/subscriptions", "type": "User", "url": "https://api.github.com/users/nateprewitt", "user_view_type": "public" }
[]
closed
true
null
[]
null
0
2022-04-29T21:21:44Z
2023-04-30T00:03:01Z
2022-04-29T21:39:22Z
MEMBER
resolved
Follow up to #6095 to add a .git-blame-ignore-revs file. This allows us to strip large cosmetic commits from the git blame history to help keep the information relevant to actual logic changes.
{ "avatar_url": "https://avatars.githubusercontent.com/u/18519037?v=4", "events_url": "https://api.github.com/users/sethmlarson/events{/privacy}", "followers_url": "https://api.github.com/users/sethmlarson/followers", "following_url": "https://api.github.com/users/sethmlarson/following{/other_user}", "gists_url": "https://api.github.com/users/sethmlarson/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/sethmlarson", "id": 18519037, "login": "sethmlarson", "node_id": "MDQ6VXNlcjE4NTE5MDM3", "organizations_url": "https://api.github.com/users/sethmlarson/orgs", "received_events_url": "https://api.github.com/users/sethmlarson/received_events", "repos_url": "https://api.github.com/users/sethmlarson/repos", "site_admin": false, "starred_url": "https://api.github.com/users/sethmlarson/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/sethmlarson/subscriptions", "type": "User", "url": "https://api.github.com/users/sethmlarson", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/6116/reactions" }
https://api.github.com/repos/psf/requests/issues/6116/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/6116.diff", "html_url": "https://github.com/psf/requests/pull/6116", "merged_at": "2022-04-29T21:39:22Z", "patch_url": "https://github.com/psf/requests/pull/6116.patch", "url": "https://api.github.com/repos/psf/requests/pulls/6116" }
true
[]
https://api.github.com/repos/psf/requests/issues/6115
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6115/labels{/name}
https://api.github.com/repos/psf/requests/issues/6115/comments
https://api.github.com/repos/psf/requests/issues/6115/events
https://github.com/psf/requests/issues/6115
1,220,894,214
I_kwDOABTKOs5IxV4G
6,115
Still cannot prevent requests library from encoding
{ "avatar_url": "https://avatars.githubusercontent.com/u/4678285?v=4", "events_url": "https://api.github.com/users/LudiusMaximus/events{/privacy}", "followers_url": "https://api.github.com/users/LudiusMaximus/followers", "following_url": "https://api.github.com/users/LudiusMaximus/following{/other_user}", "gists_url": "https://api.github.com/users/LudiusMaximus/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/LudiusMaximus", "id": 4678285, "login": "LudiusMaximus", "node_id": "MDQ6VXNlcjQ2NzgyODU=", "organizations_url": "https://api.github.com/users/LudiusMaximus/orgs", "received_events_url": "https://api.github.com/users/LudiusMaximus/received_events", "repos_url": "https://api.github.com/users/LudiusMaximus/repos", "site_admin": false, "starred_url": "https://api.github.com/users/LudiusMaximus/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/LudiusMaximus/subscriptions", "type": "User", "url": "https://api.github.com/users/LudiusMaximus", "user_view_type": "public" }
[]
open
false
null
[]
null
11
2022-04-29T13:58:44Z
2024-01-27T10:03:48Z
null
NONE
null
I have the same problem as https://github.com/psf/requests/issues/5964, but the solution does not work for me. I need to send unescaped URL requestes to a server. The purpose is to evoke response code 400 to test the firewall configuration. ## Expected Result The following code should (according to https://github.com/psf/requests/issues/5964) send the unescaped URL: ``` import requests s = requests.Session() # Using Burp Suite Proxy to examine request being sent. s.proxies = { "http" : "http://127.0.0.1:8080", "https" : "http://127.0.0.1:8080", } # Do not verify certificate. s.verify = False # Solution from https://github.com/psf/requests/issues/5964 base_url = 'https://www.example.com/search' query = '?date_range=2017-01-01|2017-03-01' req = requests.Request('GET', base_url) p = req.prepare() p.url += query resp = s.send(p) print(resp.request.url) ``` ## Actual Result The `print(resp.request.url)` prints `https://www.example.com/search?date_range=2017-01-01|2017-03-01` as expected. But what is really transmitted is the escaped URL, `https://www.example.com/search?date_range=2017-01-01%7C2017-03-01` as seen in this Burp Suite screenshot: ![image](https://user-images.githubusercontent.com/4678285/165955894-9a8d73e0-98a9-48a3-abac-6ce2c652c138.png) ## Reproduction Steps Use the python code above and a way of choice to capture the actual response being sent (e.g. Burp Suite proxy). You can also use curl to send an actually unescaped response: `curl "https://www.example.com/search?date_range=2017-01-01|2017-03-01" -x 127.0.0.1:8080 --insecure` ![image](https://user-images.githubusercontent.com/4678285/165958290-a6dfbf45-a620-453a-9054-84cba0b4f5a2.png) ## System Information $ python -m requests.help ```json { { "chardet": { "version": "3.0.4" }, "charset_normalizer": { "version": "2.0.12" }, "cryptography": { "version": "" }, "idna": { "version": "2.8" }, "implementation": { "name": "CPython", "version": "3.8.10" }, "platform": { "release": "5.14.0-1034-oem", "system": "Linux" }, "pyOpenSSL": { "openssl_version": "", "version": null }, "requests": { "version": "2.27.1" }, "system_ssl": { "version": "1010106f" }, "urllib3": { "version": "1.25.8" }, "using_charset_normalizer": false, "using_pyopenssl": false } ```
null
{ "+1": 1, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 1, "url": "https://api.github.com/repos/psf/requests/issues/6115/reactions" }
https://api.github.com/repos/psf/requests/issues/6115/timeline
null
null
null
null
false
[ "Hmm, so this appears to actually be a breakage introduced by this PR in urllib3 1.26.0. Requests is still forwarding the unencoded URL but [urllib3 now unilaterally enforces encoding](https://github.com/urllib3/urllib3/commit/691679f738ae098ce024aeae90cfdd8013b8e1e7#diff-2d5453550bf56a4666a88e9262248cea2f8ef2338695b5300b6c9a550647ee0eR631) on paths. The immediate fix would be to downgrade to urllib3 1.25.11 but that's not a great idea long term.\r\n\r\nI don't know if there's a good way to fix this now given the amount of time it's been in place. We could potentially not override the provided url and only use the parsed version where needed for the scheme. [This line](https://github.com/urllib3/urllib3/commit/691679f738ae098ce024aeae90cfdd8013b8e1e7#diff-2d5453550bf56a4666a88e9262248cea2f8ef2338695b5300b6c9a550647ee0eR651) would need to be reverted but I don't know if we've enforced the scheme will always be present at this point.", "@sethmlarson what are your thoughts here? urllib3 has become more strict with what it will emit which is generally a positive but has broken some portions of the PreparedRequests workflow over the last handful of years. Is this a use case urllib3 is willing to support?", "@nateprewitt Yes, we should be supporting this through HTTPConnectionPool.request(). I think we lost this behavior sometime but it'd be good to restore it in cases where it's safe to do so.", "This problem may be solved by hooking urllib3 like this:\r\n\r\n```python\r\nimport requests\r\nimport urllib3.util.url as urllib3_url\r\n\r\n\r\ndef hook_invalid_chars(component, allowed_chars):\r\n # handle url encode here, or do nothing\r\n return component\r\n\r\nurllib3_url._encode_invalid_chars = hook_invalid_chars\r\n\r\ns = requests.Session()\r\n\r\ns.verify = False\r\n\r\nbase_url = 'http://127.0.0.1:8080'\r\nquery = '?date_range=2017-01-01|2017-03-01'\r\nreq = requests.Request('GET', base_url)\r\np = req.prepare()\r\np.url += query\r\nresp = s.send(p)\r\nprint(resp.request.url)\r\n```\r\n\r\n![图片](https://user-images.githubusercontent.com/11925471/176877894-8b209d02-0210-48f3-8fc8-b9db8ee03991.png)\r\n\r\nSystem Information\r\n\r\n```json\r\n{\r\n \"chardet\": {\r\n \"version\": \"3.0.4\"\r\n },\r\n \"charset_normalizer\": {\r\n \"version\": \"2.0.12\"\r\n },\r\n \"cryptography\": {\r\n \"version\": \"2.8\"\r\n },\r\n \"idna\": {\r\n \"version\": \"2.8\"\r\n },\r\n \"implementation\": {\r\n \"name\": \"CPython\",\r\n \"version\": \"3.8.10\"\r\n },\r\n \"platform\": {\r\n \"release\": \"4.4.0-19041-Microsoft\",\r\n \"system\": \"Linux\"\r\n },\r\n \"pyOpenSSL\": {\r\n \"openssl_version\": \"1010106f\",\r\n \"version\": \"19.0.0\"\r\n },\r\n \"requests\": {\r\n \"version\": \"2.26.0\"\r\n },\r\n \"system_ssl\": {\r\n \"version\": \"1010106f\"\r\n },\r\n \"urllib3\": {\r\n \"version\": \"1.25.8\"\r\n },\r\n \"using_charset_normalizer\": false,\r\n \"using_pyopenssl\": true\r\n}\r\n```", "@LudiusMaximus\r\nHope you're doing well. Did you find a solution?\r\n\r\nThe solution provided by @nateprewitt on #5964 doesn't work for me either (I tested).\r\n\r\n@Lukasa provides a prepared requests example as well on #1454 at [this point in the discussion](https://github.com/psf/requests/issues/1454#issuecomment-20832874)\r\n\r\nBased on the contribution guidelines I put the details for my situation on Stack Overflow since whether this is a bug/limitation is a gray area.\r\n\r\nIn my case if the device on the other end was my web server, I'd fix it - it isn't so I'm looking for a way to interface with it.\r\n\r\nI would greatly appreciate help toward a code solution to overcome this roadblock. Thank you!\r\n\r\nhttps://stackoverflow.com/questions/77255960/python-requests-prevent-url-encoding", "hi, +1 on this being an issue. I tried LyleMi's solution and it did not work even though the url seems well formed.", "> hi, +1 on this being an issue. I tried LyleMi's solution and it did not work even though the url seems well formed.\r\n\r\n@abaruah117\r\nTLDR: You'll either need to override items within `urllib3` or use the lower-level `urllib` directly (credit to Tomi on Stack Overflow). The first one is probably frowned upon and the latter with `urllib` could be painful (requires manually handling many aspects that `requests` handles for us).\r\n\r\n(I haven't entirely chosen my path to overcome the URL roadblock I ran into here. My task to interact with an older system is on-hold until I have time.)\r\n\r\nMore Details:\r\n\r\nIt is my _impression_ that based on minimized comments (including Lyle's) and the lack of an official solution that this issue is deemed a problem the `requests` project won't be fixing (as the code causing this behavior exists in `urllib3`). Ludius' example included a pipe and mine included curly braces -- both of those do not appear to show up as \"reserved\" characters in the RFCs.\r\n\r\nYou might consider updating your reply with an example of the URL and format you're having issues with.\r\n\r\nI have a question over on Stack Overflow where a really helpful person (Tomi) decided to poke at the issue. The code forcing the URI encoding is within `urllib3` and not directly in `requests` so it isn't something `requests` will resolve (my opinion).\r\n\r\nIn [RFC 2396](https://datatracker.ietf.org/doc/html/rfc2396), pipe and curly braces (among some other symbols) are considered \"unwise\" to use in URLs. And [RFC 3986 in section 2](https://datatracker.ietf.org/doc/html/rfc3986#section-2) does not show pipe or curly braces as reserved, but then again 2396 is obsoleted or superseded by 3986. I suppose more than anything those and RFCs that obsolete even those two intend to explicitly convey the **allowed characters** and leave the prohibited/forbidden ones for inference (exception being the reserved characters that are explicitly called out).\r\n\r\nEdit: grammar", "+1 I totally understand following standards in MOST cases but there should be some way for a developer to override the default behavior. This is making things hard for us security folks. ", "> +1 I totally understand following standards in MOST cases but there should be some way for a developer to override the default behavior. This is making things hard for us security folks.\r\n\r\n@superswan \r\nWhile it can be overridden the changes won't be in `requests`, but instead `urllib3`.\r\n\r\nThere are ugly hack solutions over on Stack Overflow. _No warranties and could break unexpectedly._\r\nhttps://stackoverflow.com/questions/77255960/python-requests-prevent-url-encoding\r\n\r\nMy testing was via netcat (nc) for Stack Overflow post so hopefully this works when I get back to running it against that live legacy device.\r\n\r\nI hope this helps you as it helped me.", "@mjbear thank you. I recognize that the issue originates from urllib3. I wanted to express my concerns since this appears to be one of the few places engaging in active discussion. I have opted to use urlopen() instead.\n\nHowever, this issue also impacts the Requests library, resulting in the loss of some of its enhanced features such as error handling, header manipulation, and timeouts due to the workaround. In past versions it was possible to override this behavior from requests directly. This change has made it challenging to work with legacy code and manage use cases that fall outside of standard practices.", "As you are testing your firewall configuration you may be interested in my approach to unencode characters or even inject the payload right before the request is send, so its never modified:\r\n\r\n\r\n```\r\nimport urllib3\r\nimport requests\r\n\r\ndef custom_make_request(self, conn, method, url, timeout=urllib3.connectionpool._Default, chunked=False, **httplib_request_kw):\r\n url = url.replace(\"FUZZ\", \"TEST!/&%$=)()\")\r\n new_headers = {}\r\n for header, value in httplib_request_kw['headers'].items():\r\n new_header = header.replace(\"FUZZ\", \"TEST!/&%$=)()\")\r\n new_value = value.replace(\"FUZZ\", \"TEST!/&%§\")\r\n new_headers[new_header] = new_value\r\n httplib_request_kw['headers'] = new_headers\r\n return self._original_make_request(conn, method, url, timeout=timeout, chunked=chunked, **httplib_request_kw)\r\n\r\n# Create a reference to the original _make_request method\r\nurllib3.connectionpool.HTTPConnectionPool._original_make_request = urllib3.connectionpool.HTTPConnectionPool._make_request\r\n# Replace the _make_request method with the custom_make_request function\r\nurllib3.connectionpool.HTTPConnectionPool._make_request = custom_make_request\r\n\r\nresponse = requests.get('http://<YOUR_TEST_SERVER>/FUZZ')\r\n```" ]
https://api.github.com/repos/psf/requests/issues/6114
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6114/labels{/name}
https://api.github.com/repos/psf/requests/issues/6114/comments
https://api.github.com/repos/psf/requests/issues/6114/events
https://github.com/psf/requests/issues/6114
1,220,587,026
I_kwDOABTKOs5IwK4S
6,114
How to implement oauth token on requests library?
{ "avatar_url": "https://avatars.githubusercontent.com/u/5903577?v=4", "events_url": "https://api.github.com/users/NSH531/events{/privacy}", "followers_url": "https://api.github.com/users/NSH531/followers", "following_url": "https://api.github.com/users/NSH531/following{/other_user}", "gists_url": "https://api.github.com/users/NSH531/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/NSH531", "id": 5903577, "login": "NSH531", "node_id": "MDQ6VXNlcjU5MDM1Nzc=", "organizations_url": "https://api.github.com/users/NSH531/orgs", "received_events_url": "https://api.github.com/users/NSH531/received_events", "repos_url": "https://api.github.com/users/NSH531/repos", "site_admin": false, "starred_url": "https://api.github.com/users/NSH531/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/NSH531/subscriptions", "type": "User", "url": "https://api.github.com/users/NSH531", "user_view_type": "public" }
[]
closed
true
null
[]
null
3
2022-04-29T11:30:43Z
2022-04-29T17:08:06Z
2022-04-29T14:19:51Z
NONE
null
{ "avatar_url": "https://avatars.githubusercontent.com/u/240830?v=4", "events_url": "https://api.github.com/users/sigmavirus24/events{/privacy}", "followers_url": "https://api.github.com/users/sigmavirus24/followers", "following_url": "https://api.github.com/users/sigmavirus24/following{/other_user}", "gists_url": "https://api.github.com/users/sigmavirus24/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/sigmavirus24", "id": 240830, "login": "sigmavirus24", "node_id": "MDQ6VXNlcjI0MDgzMA==", "organizations_url": "https://api.github.com/users/sigmavirus24/orgs", "received_events_url": "https://api.github.com/users/sigmavirus24/received_events", "repos_url": "https://api.github.com/users/sigmavirus24/repos", "site_admin": false, "starred_url": "https://api.github.com/users/sigmavirus24/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/sigmavirus24/subscriptions", "type": "User", "url": "https://api.github.com/users/sigmavirus24", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/6114/reactions" }
https://api.github.com/repos/psf/requests/issues/6114/timeline
null
completed
null
null
false
[ "Hi there! Thanks for opening this issue. Unfortunately, it seems this is a request for help instead of a report of a defect in the project. Please use [StackOverflow](https://stackoverflow.com) for general usage questions instead and only report defects here.", "I'm sorry but the [stackoverflow's](http://Stackoverflow.com )account No longer accepting questions and So I write the question here and not in [STACKOVERFLOW](http://Stackoverflow.com)\r\n\r\nthanks\r\nnetanel", "Stackoverflow is definitely still accepting questions. " ]
https://api.github.com/repos/psf/requests/issues/6113
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6113/labels{/name}
https://api.github.com/repos/psf/requests/issues/6113/comments
https://api.github.com/repos/psf/requests/issues/6113/events
https://github.com/psf/requests/issues/6113
1,218,374,934
I_kwDOABTKOs5Inu0W
6,113
Git.io deprecation notice
{ "avatar_url": "https://avatars.githubusercontent.com/u/99484857?v=4", "events_url": "https://api.github.com/users/npmmirror/events{/privacy}", "followers_url": "https://api.github.com/users/npmmirror/followers", "following_url": "https://api.github.com/users/npmmirror/following{/other_user}", "gists_url": "https://api.github.com/users/npmmirror/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/npmmirror", "id": 99484857, "login": "npmmirror", "node_id": "U_kgDOBe4EuQ", "organizations_url": "https://api.github.com/users/npmmirror/orgs", "received_events_url": "https://api.github.com/users/npmmirror/received_events", "repos_url": "https://api.github.com/users/npmmirror/repos", "site_admin": false, "starred_url": "https://api.github.com/users/npmmirror/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/npmmirror/subscriptions", "type": "User", "url": "https://api.github.com/users/npmmirror", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2022-04-28T08:21:40Z
2023-04-29T00:02:48Z
2022-04-28T14:28:14Z
NONE
resolved
Hello, I've found that some of your files in this repo is still using https://git.io/, and this service will be discontinued in the future. (ref: [Git.io deprecation](https://github.blog/changelog/2022-04-25-git-io-deprecation/)) Theses files are: .github/workflows/codeql-analysis.yml > This is an automated message from NPMMirror(https://github.com/npmmirror), a bot developed by Nova Kwok(https://github.com/n0vad3v).
{ "avatar_url": "https://avatars.githubusercontent.com/u/5271761?v=4", "events_url": "https://api.github.com/users/nateprewitt/events{/privacy}", "followers_url": "https://api.github.com/users/nateprewitt/followers", "following_url": "https://api.github.com/users/nateprewitt/following{/other_user}", "gists_url": "https://api.github.com/users/nateprewitt/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/nateprewitt", "id": 5271761, "login": "nateprewitt", "node_id": "MDQ6VXNlcjUyNzE3NjE=", "organizations_url": "https://api.github.com/users/nateprewitt/orgs", "received_events_url": "https://api.github.com/users/nateprewitt/received_events", "repos_url": "https://api.github.com/users/nateprewitt/repos", "site_admin": false, "starred_url": "https://api.github.com/users/nateprewitt/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/nateprewitt/subscriptions", "type": "User", "url": "https://api.github.com/users/nateprewitt", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/6113/reactions" }
https://api.github.com/repos/psf/requests/issues/6113/timeline
null
completed
null
null
false
[ "For reference the line being flagged is a comment from the original source of this action, it's not used in the code itself.\n\nGiven there's no impact on our infrastructure, I'm going to leave the comment in place as it appears the resource will remain available as read-only." ]
https://api.github.com/repos/psf/requests/issues/6112
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6112/labels{/name}
https://api.github.com/repos/psf/requests/issues/6112/comments
https://api.github.com/repos/psf/requests/issues/6112/events
https://github.com/psf/requests/issues/6112
1,216,310,196
I_kwDOABTKOs5If2u0
6,112
What is the correct way to pass the proxy username and proxy password ?
{ "avatar_url": "https://avatars.githubusercontent.com/u/33820064?v=4", "events_url": "https://api.github.com/users/pghole/events{/privacy}", "followers_url": "https://api.github.com/users/pghole/followers", "following_url": "https://api.github.com/users/pghole/following{/other_user}", "gists_url": "https://api.github.com/users/pghole/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/pghole", "id": 33820064, "login": "pghole", "node_id": "MDQ6VXNlcjMzODIwMDY0", "organizations_url": "https://api.github.com/users/pghole/orgs", "received_events_url": "https://api.github.com/users/pghole/received_events", "repos_url": "https://api.github.com/users/pghole/repos", "site_admin": false, "starred_url": "https://api.github.com/users/pghole/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/pghole/subscriptions", "type": "User", "url": "https://api.github.com/users/pghole", "user_view_type": "public" }
[]
closed
true
null
[]
null
3
2022-04-26T18:12:02Z
2023-04-28T00:03:31Z
2022-04-26T18:31:01Z
NONE
resolved
Hey, After reading and trying out many things, I am confused how the proxy username and password is passed in the follows - proxy = {'https' : 'http://{username}:{password}@host:port', 'http': 'http://{username}:{password}@host:port' } requests.get(url, proxies=proxy) 1. Do I have to use quote() from urllib.parse to encode the username and password before making the proxy dict ? 2. My username , password having "@" sign works fine without encoding, Still do I have to encode for any other chars ? Version requests = 2.20.0 urllib3 = 1.24.2
{ "avatar_url": "https://avatars.githubusercontent.com/u/5271761?v=4", "events_url": "https://api.github.com/users/nateprewitt/events{/privacy}", "followers_url": "https://api.github.com/users/nateprewitt/followers", "following_url": "https://api.github.com/users/nateprewitt/following{/other_user}", "gists_url": "https://api.github.com/users/nateprewitt/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/nateprewitt", "id": 5271761, "login": "nateprewitt", "node_id": "MDQ6VXNlcjUyNzE3NjE=", "organizations_url": "https://api.github.com/users/nateprewitt/orgs", "received_events_url": "https://api.github.com/users/nateprewitt/received_events", "repos_url": "https://api.github.com/users/nateprewitt/repos", "site_admin": false, "starred_url": "https://api.github.com/users/nateprewitt/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/nateprewitt/subscriptions", "type": "User", "url": "https://api.github.com/users/nateprewitt", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/6112/reactions" }
https://api.github.com/repos/psf/requests/issues/6112/timeline
null
completed
null
null
false
[ "Hi @pghole,\r\n\r\nIt's not clear from the post if you're encountering an issue or asking for general information about URL syntax. You can find the relevant information on URL syntax in the [RFC](https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1). Requests will simply proxy along whatever characters you provide, so as long as they conform to the RFC 3986 specification, we'd expect them to work.", "@nateprewitt, I am interested in knowing the behaviour of request library and how the username/password is passed to the proxies dictionary\r\n\r\nFor example -(having special chars)\r\nusername = \"username@#$\"\r\npassword = \"password@#\"\r\n\r\nwhich of the following is correct ?\r\n\r\n'http://{username}:{password}@host:port'. format(username, password)\r\n\r\nOR\r\nfrom urllib.parse import quote\r\n'http://{username}:{password}@host:port'. format(quote(username), (password))", "@nateprewitt has answered your question then" ]
https://api.github.com/repos/psf/requests/issues/6111
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6111/labels{/name}
https://api.github.com/repos/psf/requests/issues/6111/comments
https://api.github.com/repos/psf/requests/issues/6111/events
https://github.com/psf/requests/issues/6111
1,214,768,448
I_kwDOABTKOs5IZ-VA
6,111
Requests retry status_forcelist is worked when 404 is occured, but shows no "retrying" logs
{ "avatar_url": "https://avatars.githubusercontent.com/u/88309796?v=4", "events_url": "https://api.github.com/users/muhammad-asn/events{/privacy}", "followers_url": "https://api.github.com/users/muhammad-asn/followers", "following_url": "https://api.github.com/users/muhammad-asn/following{/other_user}", "gists_url": "https://api.github.com/users/muhammad-asn/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/muhammad-asn", "id": 88309796, "login": "muhammad-asn", "node_id": "MDQ6VXNlcjg4MzA5Nzk2", "organizations_url": "https://api.github.com/users/muhammad-asn/orgs", "received_events_url": "https://api.github.com/users/muhammad-asn/received_events", "repos_url": "https://api.github.com/users/muhammad-asn/repos", "site_admin": false, "starred_url": "https://api.github.com/users/muhammad-asn/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/muhammad-asn/subscriptions", "type": "User", "url": "https://api.github.com/users/muhammad-asn", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2022-04-25T16:37:04Z
2023-04-26T00:03:03Z
2022-04-25T16:44:23Z
NONE
resolved
Hello everyone I want to ask, I have 2 webserver called it `172.10.10.1:8080` and `172.10.10.2:8080` that serve a static object like (image, gif, video). But sometimes it occurs `404` from the server side, here's the example using `curl` Try number 1 ``` curl -I http://172.10.10.1:8080/image_1.jpg HTTP/1.1 404 Not Found Server: nginx/1.16.1 Date: Mon, 25 Apr 2022 16:28:27 GMT Content-Length: 25 Connection: keep-alive ``` Try number 2 ``` curl -I http://172.10.10.1:8080/image_1.jpg HTTP/1.1 404 Not Found Server: nginx/1.16.1 Date: Mon, 25 Apr 2022 16:28:27 GMT Content-Length: 25 Connection: keep-alive ``` Try number 3 ``` curl -I http://172.10.10.1:8080/image_1.jpg HTTP/1.1 200 OK Server: nginx/1.16.1 Date: Mon, 25 Apr 2022 16:29:24 GMT Content-Length: 125330 Connection: keep-alive Last-Modified: Fri, 15 Nov 2013 22:17:36 GMT Accept-Ranges: bytes ``` To handle the issue I have to use the `retry` mechanism, here's the code example ``` def retry_session(retries=5, backoff_factor=0.3, session=None, status_forcelist=[404, 500, 502, 503, 504]): ''' Retry mechanism - {backoff factor} * (2 ** ({number of total retries} - 1)) ''' session = session or requests.Session() retries = Retry( total=retries, backoff_factor=backoff_factor, allowed_methods=["HEAD", "GET"], status_forcelist=status_forcelist ) session.mount('http://', HTTPAdapter(max_retries=retries)) return session ``` And here's my question **Why if I remove the `404` from the status_forcelist sometimes it shows except requests.exceptions.HTTPError, but if I add it on status_forcelist it shows no retrying logs and the requests is success?** Thank you.
{ "avatar_url": "https://avatars.githubusercontent.com/u/5271761?v=4", "events_url": "https://api.github.com/users/nateprewitt/events{/privacy}", "followers_url": "https://api.github.com/users/nateprewitt/followers", "following_url": "https://api.github.com/users/nateprewitt/following{/other_user}", "gists_url": "https://api.github.com/users/nateprewitt/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/nateprewitt", "id": 5271761, "login": "nateprewitt", "node_id": "MDQ6VXNlcjUyNzE3NjE=", "organizations_url": "https://api.github.com/users/nateprewitt/orgs", "received_events_url": "https://api.github.com/users/nateprewitt/received_events", "repos_url": "https://api.github.com/users/nateprewitt/repos", "site_admin": false, "starred_url": "https://api.github.com/users/nateprewitt/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/nateprewitt/subscriptions", "type": "User", "url": "https://api.github.com/users/nateprewitt", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/6111/reactions" }
https://api.github.com/repos/psf/requests/issues/6111/timeline
null
completed
null
null
false
[ "Hi @muhammad-asn, this appears to be a request for assistance. The Retry object is handled by urllib3 and you can find the documentation [here](https://urllib3.readthedocs.io/en/1.26.9/reference/urllib3.util.html). Requests will throw an HTTPError if the final output from the response has an issue. That would mean there's something else wrong with the 404 response unless you're calling `raise_for_status` and the Retry is avoiding that code path by waiting for the 200.\r\n\r\nThis is a question better handled for StackOverflow though as stated in the issue template." ]
https://api.github.com/repos/psf/requests/issues/6110
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6110/labels{/name}
https://api.github.com/repos/psf/requests/issues/6110/comments
https://api.github.com/repos/psf/requests/issues/6110/events
https://github.com/psf/requests/issues/6110
1,209,453,328
I_kwDOABTKOs5IFssQ
6,110
Cookies that include a port flag set to 443 aren't stored if they came from an https location without the 443 port in the URI
{ "avatar_url": "https://avatars.githubusercontent.com/u/2392229?v=4", "events_url": "https://api.github.com/users/fjcuadrado/events{/privacy}", "followers_url": "https://api.github.com/users/fjcuadrado/followers", "following_url": "https://api.github.com/users/fjcuadrado/following{/other_user}", "gists_url": "https://api.github.com/users/fjcuadrado/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/fjcuadrado", "id": 2392229, "login": "fjcuadrado", "node_id": "MDQ6VXNlcjIzOTIyMjk=", "organizations_url": "https://api.github.com/users/fjcuadrado/orgs", "received_events_url": "https://api.github.com/users/fjcuadrado/received_events", "repos_url": "https://api.github.com/users/fjcuadrado/repos", "site_admin": false, "starred_url": "https://api.github.com/users/fjcuadrado/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/fjcuadrado/subscriptions", "type": "User", "url": "https://api.github.com/users/fjcuadrado", "user_view_type": "public" }
[]
open
false
null
[]
null
4
2022-04-20T09:56:08Z
2022-05-01T12:47:35Z
null
NONE
null
When performing a request to an https location that doesn't include a port explicitly (for example: `https://localhost`) and that location returns a cookie that includes a `port` flag set to `443`, that cookie isn't stored into the cookie jar. However, this kind of cookie is stored into the cookie jar, when the port is set explicitly in the https location (for example: `https://localhost:443`). ## Expected Result A cookie that includes a `port` flag set to `443` should be stored into the cookie jar when the request is performed to an https location that doesn't include a port. ## Reproduction Steps I hope you don't mind that I've moved the Actual Result below this section. I did it because I've written a test-suite to reproduce the issue and the result of running that test-suite has been pasted in the Actual Result section. ```python import http import pytest import requests from io import BytesIO from urllib3.response import HTTPHeaderDict, HTTPResponse class OriginalResponseShim: def __init__(self, headers): self.msg = headers def isclosed(self): return True def close(self): return def make_http_response( method, url, status=requests.codes.ok, headers=None ): http_headers = HTTPHeaderDict() if headers is not None: http_headers.extend(headers) def _make_http_response(adapter, request, *args, **kwargs): http_response = HTTPResponse( status=status, reason=http.client.responses.get(status, None), body=BytesIO(b''), headers=http_headers, original_response=OriginalResponseShim(http_headers), preload_content=False, ) return adapter.build_response(request, http_response) return _make_http_response class TestCookies: @pytest.mark.parametrize('url', [ 'http://localhost', 'http://localhost:80', 'http://localhost:8080', 'https://localhost', 'https://localhost:443', 'https://localhost:8080', ]) def test_cookie_without_port(self, mocker, url): mocker.patch( 'requests.adapters.HTTPAdapter.send', new=make_http_response( 'GET', url, headers={ 'set-cookie': 'cookie=value', }, ) ) session = requests.Session() resp = session.request('GET', url) assert resp.status_code == requests.codes.ok assert 'set-cookie' in resp.headers assert 'cookie' in session.cookies cookie = next(iter(session.cookies)) assert cookie.name == 'cookie' assert cookie.value == 'value' assert cookie.port is None @pytest.mark.parametrize('url, port', [ ('http://localhost', 80), ('http://localhost:80', 80), ('http://localhost:443', 443), ('http://localhost:8080', 8080), ('https://localhost', 443), ('https://localhost:80', 80), ('https://localhost:443', 443), ('https://localhost:8080', 8080), ]) def test_cookie_with_port(self, mocker, url, port): mocker.patch( 'requests.adapters.HTTPAdapter.send', new=make_http_response( 'GET', url, headers={ 'set-cookie': f'cookie=value; port={port}', }, ) ) session = requests.Session() resp = session.request('GET', url) assert resp.status_code == requests.codes.ok assert 'set-cookie' in resp.headers assert 'cookie' in session.cookies cookie = next(iter(session.cookies)) assert cookie.name == 'cookie' assert cookie.value == 'value' assert cookie.port == f'{port}' ``` ## Actual Result ```================================== test session starts =================================== platform darwin -- Python 3.10.2, pytest-6.2.5, py-1.11.0, pluggy-1.0.0 rootdir: /Users/fran/code/requests, configfile: pytest.ini plugins: httpbin-1.0.0, mock-2.0.0, cov-3.0.0 collected 14 items tests/test_cookies.py ..........F... [100%] ======================================== FAILURES ======================================== ________________ TestCookies.test_cookie_with_port[https://localhost-443] ________________ self = <tests.test_cookies.TestCookies object at 0x10e309ff0> mocker = <pytest_mock.plugin.MockFixture object at 0x10e30a290>, url = 'https://localhost' port = 443 @pytest.mark.parametrize('url, port', [ ('http://localhost', 80), ('http://localhost:80', 80), ('http://localhost:443', 443), ('http://localhost:8080', 8080), ('https://localhost', 443), ('https://localhost:80', 80), ('https://localhost:443', 443), ('https://localhost:8080', 8080), ]) def test_cookie_with_port(self, mocker, url, port): mocker.patch( 'requests.adapters.HTTPAdapter.send', new=make_http_response( 'GET', url, headers={ 'set-cookie': f'cookie=value; port={port}', }, ) ) session = requests.Session() resp = session.request('GET', url) assert resp.status_code == requests.codes.ok assert 'set-cookie' in resp.headers > assert 'cookie' in session.cookies E AssertionError: assert 'cookie' in <RequestsCookieJar[]> E + where <RequestsCookieJar[]> = <requests.sessions.Session object at 0x10e309b10>.cookies tests/test_cookies.py:105: AssertionError ``` ## System Information $ python -m requests.help ```json { "chardet": { "version": null }, "charset_normalizer": { "version": "2.0.12" }, "cryptography": { "version": "" }, "idna": { "version": "3.3" }, "implementation": { "name": "CPython", "version": "3.10.2" }, "platform": { "release": "21.4.0", "system": "Darwin" }, "pyOpenSSL": { "openssl_version": "", "version": null }, "requests": { "version": "2.27.1" }, "system_ssl": { "version": "101010ef" }, "urllib3": { "version": "1.26.9" }, "using_charset_normalizer": true, "using_pyopenssl": false } ``` <!-- This command is only available on Requests v2.16.4 and greater. Otherwise, please provide some basic information about your system (Python version, operating system, &c). -->
null
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/6110/reactions" }
https://api.github.com/repos/psf/requests/issues/6110/timeline
null
null
null
null
false
[ "Also I wrote the following workaround to fix the issue:\r\n\r\n```diff\r\ndiff --git a/requests/cookies.py b/requests/cookies.py\r\nindex 56fccd9c..afe6f597 100644\r\n--- a/requests/cookies.py\r\n+++ b/requests/cookies.py\r\n@@ -43,7 +43,13 @@ class MockRequest(object):\r\n return self.type\r\n\r\n def get_host(self):\r\n- return urlparse(self._r.url).netloc\r\n+ url_parts = urlparse(self._r.url)\r\n+ host = url_parts.netloc\r\n+\r\n+ if url_parts.scheme == 'https' and not url_parts.port:\r\n+ host = f'{host}:443'\r\n+\r\n+ return host\r\n\r\n def get_origin_req_host(self):\r\n return self.get_host()\r\n```", "Hi @fjcuadrado, this seems like a reasonable behavior change. We'll need to do a bit of digging to make sure there isn't anything in the cookie spec explicitly preventing this. I would assume that's not the case, but we'd need to do some validating before approving anything.\r\n\r\nAs far as approach goes, we already do something very similar for authorization headers [here](https://github.com/psf/requests/blob/2a6f290bc09324406708a4d404a88a45d848ddf9/requests/sessions.py#L137-L142). We may be able to rely on a similar pattern for making these decisions.", "Adding some context to this issue, the [current RFC](https://www.rfc-editor.org/rfc/rfc6265) for cookies removes mentions of the `port` parameter and instead has:\n\n> ... cookies for a given host are shared across all the ports on that host ...", "The problem is that the [set_ok_port](https://github.com/python/cpython/blob/e7de54321952ebb58cc414f2160c9ad4f6510af2/Lib/http/cookiejar.py#L1075) function of `DefaultCookiePolicy` from the `http.cookiejar` standard library module doesn’t follow what @sethmlarson said.\r\n\r\nInstead, as you can see, it checks the port of the cookie is the same than the provided in the request host, using the 80 port as the default value when there is no port in the host." ]
https://api.github.com/repos/psf/requests/issues/6109
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6109/labels{/name}
https://api.github.com/repos/psf/requests/issues/6109/comments
https://api.github.com/repos/psf/requests/issues/6109/events
https://github.com/psf/requests/issues/6109
1,206,384,105
I_kwDOABTKOs5H5_Xp
6,109
Custom SSL context is ignored when using proxy
{ "avatar_url": "https://avatars.githubusercontent.com/u/10137?v=4", "events_url": "https://api.github.com/users/ghost/events{/privacy}", "followers_url": "https://api.github.com/users/ghost/followers", "following_url": "https://api.github.com/users/ghost/following{/other_user}", "gists_url": "https://api.github.com/users/ghost/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/ghost", "id": 10137, "login": "ghost", "node_id": "MDQ6VXNlcjEwMTM3", "organizations_url": "https://api.github.com/users/ghost/orgs", "received_events_url": "https://api.github.com/users/ghost/received_events", "repos_url": "https://api.github.com/users/ghost/repos", "site_admin": false, "starred_url": "https://api.github.com/users/ghost/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/ghost/subscriptions", "type": "User", "url": "https://api.github.com/users/ghost", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2022-04-17T14:03:31Z
2023-04-18T00:03:01Z
2022-04-17T15:17:28Z
NONE
resolved
## Summary I'm using a custom HTTPAdapter to bypass TLS fingerprinting. Without a proxy, everything works fine. However, when using a proxy, the custom cipher settings appear to be ignored and it falls back to the default `requests` SSL context. I have confirmed this with multiple non-intercepting HTTP and HTTPS proxies, and fact that the fingerprint is identical to the default `requests` one every time (despite Python or `requests` not being involved in the proxy software at all) confirms that this is not an issue with my proxy. ## Expected Result The custom SSL context settings should be respected. ## Actual Result The custom SSL context settings are ignored and the defaults are used. ## Reproduction Steps ```python #!/usr/bin/env python3 import ssl import requests PROXY = 'REDACTED' class TLSFPBypassAdapter(requests.adapters.HTTPAdapter): def init_poolmanager(self, *args, **kwargs): print('TLSFPBypassAdapter.init_poolmanager called') ctx = ssl.create_default_context() ctx.set_ciphers('ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-SHA256:AES256-SHA') ctx.check_hostname = False # For some reason, this is needed to avoid a verification error kwargs['ssl_context'] = ctx return super().init_poolmanager(*args, **kwargs) def get_tls_fingerprint(session): return session.get('https://tls.browserleaks.com/json').json()['ja3_hash'] print('Default SSL context:') session1 = requests.Session() print(get_tls_fingerprint(session1)) print() print('Default SSL context + proxy:') session2 = requests.Session() session2.proxies.update({'all': PROXY}) print(get_tls_fingerprint(session2)) print() print('Custom SSL context:') session3 = requests.Session() session3.mount('http://', TLSFPBypassAdapter()) session3.mount('https://', TLSFPBypassAdapter()) print(get_tls_fingerprint(session3)) print() print('Custom SSL context + proxy:') session4 = requests.Session() session4.mount('http://', TLSFPBypassAdapter()) session4.mount('https://', TLSFPBypassAdapter()) session4.proxies.update({'all': PROXY}) print(get_tls_fingerprint(session4)) ``` Output: ``` Default SSL context: e85f4ba10180c530d8c0dc5577f88413 Default SSL context + proxy: e85f4ba10180c530d8c0dc5577f88413 Custom SSL context: TLSFPBypassAdapter.init_poolmanager called TLSFPBypassAdapter.init_poolmanager called 5a923e30925d6e3fe0dd6ff098905a01 Custom SSL context + proxy: TLSFPBypassAdapter.init_poolmanager called TLSFPBypassAdapter.init_poolmanager called e85f4ba10180c530d8c0dc5577f88413 ``` ## System Information $ python -m requests.help ```json { "chardet": { "version": null }, "charset_normalizer": { "version": "2.0.12" }, "cryptography": { "version": "" }, "idna": { "version": "3.3" }, "implementation": { "name": "CPython", "version": "3.10.4" }, "platform": { "release": "4.19.0-18-amd64", "system": "Linux" }, "pyOpenSSL": { "openssl_version": "", "version": null }, "requests": { "version": "2.27.1" }, "system_ssl": { "version": "101010ef" }, "urllib3": { "version": "1.26.9" }, "using_charset_normalizer": true, "using_pyopenssl": false } ```
{ "avatar_url": "https://avatars.githubusercontent.com/u/240830?v=4", "events_url": "https://api.github.com/users/sigmavirus24/events{/privacy}", "followers_url": "https://api.github.com/users/sigmavirus24/followers", "following_url": "https://api.github.com/users/sigmavirus24/following{/other_user}", "gists_url": "https://api.github.com/users/sigmavirus24/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/sigmavirus24", "id": 240830, "login": "sigmavirus24", "node_id": "MDQ6VXNlcjI0MDgzMA==", "organizations_url": "https://api.github.com/users/sigmavirus24/orgs", "received_events_url": "https://api.github.com/users/sigmavirus24/received_events", "repos_url": "https://api.github.com/users/sigmavirus24/repos", "site_admin": false, "starred_url": "https://api.github.com/users/sigmavirus24/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/sigmavirus24/subscriptions", "type": "User", "url": "https://api.github.com/users/sigmavirus24", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/6109/reactions" }
https://api.github.com/repos/psf/requests/issues/6109/timeline
null
completed
null
null
false
[ "You're not telling urllib3 to use that SSL context with the proxy, you'll want to look at https://github.com/psf/requests/blob/2d5517682b3b38547634d153cea43d48fbc8cdb5/requests/adapters.py#L167", "Thanks, that fixed it." ]