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/6419
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6419/labels{/name}
https://api.github.com/repos/psf/requests/issues/6419/comments
https://api.github.com/repos/psf/requests/issues/6419/events
https://github.com/psf/requests/issues/6419
1,678,812,364
I_kwDOABTKOs5kEKTM
6,419
pypy 3.7 CI build failing
{ "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
1
2023-04-21T16:46:50Z
2024-04-23T00:03:47Z
2023-04-22T23:41:29Z
CONTRIBUTOR
resolved
pypy 3.7 fails with a core dump: ``` Fatal Python error: Aborted Stack (most recent call first, approximate line numbers): File "<frozen importlib._bootstrap>", line 220 in _call_with_frames_removed make: *** [Makefile:8: ci] Aborted (core dumped) ```
{ "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/6419/reactions" }
https://api.github.com/repos/psf/requests/issues/6419/timeline
null
completed
null
null
false
[ "Looks like it's failing due to the trustme import in the nosan_server fixture " ]
https://api.github.com/repos/psf/requests/issues/6418
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6418/labels{/name}
https://api.github.com/repos/psf/requests/issues/6418/comments
https://api.github.com/repos/psf/requests/issues/6418/events
https://github.com/psf/requests/pull/6418
1,678,740,670
PR_kwDOABTKOs5O37Ur
6,418
update GitHub actions to ubuntu 22.04
{ "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
0
2023-04-21T15:54:43Z
2024-04-23T00:03:52Z
2023-04-22T23:53:09Z
CONTRIBUTOR
resolved
refs: https://github.com/psf/requests/issues/6417 I tried running tox locally on ubuntu 22.04 and it passed
{ "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/6418/reactions" }
https://api.github.com/repos/psf/requests/issues/6418/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/6418.diff", "html_url": "https://github.com/psf/requests/pull/6418", "merged_at": "2023-04-22T23:53:09Z", "patch_url": "https://github.com/psf/requests/pull/6418.patch", "url": "https://api.github.com/repos/psf/requests/pulls/6418" }
true
[]
https://api.github.com/repos/psf/requests/issues/6417
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6417/labels{/name}
https://api.github.com/repos/psf/requests/issues/6417/comments
https://api.github.com/repos/psf/requests/issues/6417/events
https://github.com/psf/requests/issues/6417
1,678,739,581
I_kwDOABTKOs5kD4h9
6,417
github actions on ubuntu 18.04 fail to start because the image was removed
{ "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
1
2023-04-21T15:53:46Z
2024-04-23T00:03:46Z
2023-04-23T00:00:59Z
CONTRIBUTOR
resolved
github actions on ubuntu 18.04 fail to start because the image was removed: https://github.blog/changelog/2022-08-09-github-actions-the-ubuntu-18-04-actions-runner-image-is-being-deprecated-and-will-be-removed-by-12-1-22/ this might be a challenge because the tests fail with SSLError: https://github.com/psf/requests/issues/5662
{ "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/6417/reactions" }
https://api.github.com/repos/psf/requests/issues/6417/timeline
null
completed
null
null
false
[ "Resolved in #6418" ]
https://api.github.com/repos/psf/requests/issues/6416
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6416/labels{/name}
https://api.github.com/repos/psf/requests/issues/6416/comments
https://api.github.com/repos/psf/requests/issues/6416/events
https://github.com/psf/requests/pull/6416
1,678,557,230
PR_kwDOABTKOs5O3TsJ
6,416
reenable the warnings plugin
{ "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
2023-04-21T13:50:36Z
2024-04-23T00:03:51Z
2023-04-23T00:00:22Z
CONTRIBUTOR
resolved
The warnings plugin was disabled in https://github.com/psf/requests/pull/4056 but that issue is now fixed by https://github.com/pytest-dev/pytest/pull/2445
{ "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/6416/reactions" }
https://api.github.com/repos/psf/requests/issues/6416/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/6416.diff", "html_url": "https://github.com/psf/requests/pull/6416", "merged_at": "2023-04-23T00:00:22Z", "patch_url": "https://github.com/psf/requests/pull/6416.patch", "url": "https://api.github.com/repos/psf/requests/pulls/6416" }
true
[ "Thanks Thomas, I'll kick the failed test once the rest finish. If they're all working this seems fine.", "Hmm, the failure seems reproducible but unrelated. It's localized to Pypy with:\r\n\r\n```\r\nFatal Python error: Aborted\r\n\r\nStack (most recent call first, approximate line numbers):\r\n File \"<frozen importlib._bootstrap>\", line 220 in _call_with_frames_removed\r\n```\r\n\r\nWe haven't made any changes that would have affected this, so I'm assuming it's either a GH CI issue or an underlying test depenency isn't playing nicely with Pypy anymore.\r\n\r\nI'm fine ignoring for this PR while we track that separately.", "Looks like the 18.04 runners aren't getting picked up anymore: https://github.com/psf/requests/issues/6417", "> Hmm, the failure seems reproducible but unrelated. It's localized to Pypy with:\r\n> \r\n> ```\r\n> Fatal Python error: Aborted\r\n> \r\n> Stack (most recent call first, approximate line numbers):\r\n> File \"<frozen importlib._bootstrap>\", line 220 in _call_with_frames_removed\r\n> ```\r\n> \r\n> We haven't made any changes that would have affected this, so I'm assuming it's either a GH CI issue or an underlying test depenency isn't playing nicely with Pypy anymore.\r\n> \r\n> I'm fine ignoring for this PR while we track that separately.\r\n\r\n@nateprewitt I think failing due to trustme's dep on cryptography https://github.com/psf/requests/issues/6419#issuecomment-1518119021", "@nateprewitt yep it was cryptography, here's the fix https://github.com/psf/requests/pull/6421" ]
https://api.github.com/repos/psf/requests/issues/6415
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6415/labels{/name}
https://api.github.com/repos/psf/requests/issues/6415/comments
https://api.github.com/repos/psf/requests/issues/6415/events
https://github.com/psf/requests/pull/6415
1,678,220,807
PR_kwDOABTKOs5O2LRy
6,415
Improve documentation of request method in sessions
{ "avatar_url": "https://avatars.githubusercontent.com/u/37971350?v=4", "events_url": "https://api.github.com/users/sodrooome/events{/privacy}", "followers_url": "https://api.github.com/users/sodrooome/followers", "following_url": "https://api.github.com/users/sodrooome/following{/other_user}", "gists_url": "https://api.github.com/users/sodrooome/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/sodrooome", "id": 37971350, "login": "sodrooome", "node_id": "MDQ6VXNlcjM3OTcxMzUw", "organizations_url": "https://api.github.com/users/sodrooome/orgs", "received_events_url": "https://api.github.com/users/sodrooome/received_events", "repos_url": "https://api.github.com/users/sodrooome/repos", "site_admin": false, "starred_url": "https://api.github.com/users/sodrooome/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/sodrooome/subscriptions", "type": "User", "url": "https://api.github.com/users/sodrooome", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2023-04-21T09:41:02Z
2024-04-23T00:03:56Z
2023-04-21T15:34:29Z
NONE
resolved
Just a small enhancement that listing of all valid HTTP in `request()` method
{ "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/6415/reactions" }
https://api.github.com/repos/psf/requests/issues/6415/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/6415.diff", "html_url": "https://github.com/psf/requests/pull/6415", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/6415.patch", "url": "https://api.github.com/repos/psf/requests/pulls/6415" }
true
[ "Hi @sodrooome,\r\n\r\nThanks for the contribution! This is currently well documented elsewhere, and we've seen a lot of unnecessary bloat in docstrings over the last couple years. I think we'll have to pass on this one for the time being." ]
https://api.github.com/repos/psf/requests/issues/6414
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6414/labels{/name}
https://api.github.com/repos/psf/requests/issues/6414/comments
https://api.github.com/repos/psf/requests/issues/6414/events
https://github.com/psf/requests/pull/6414
1,674,443,746
PR_kwDOABTKOs5OpezY
6,414
remove beautification comment
{ "avatar_url": "https://avatars.githubusercontent.com/u/5639662?v=4", "events_url": "https://api.github.com/users/jelgun/events{/privacy}", "followers_url": "https://api.github.com/users/jelgun/followers", "following_url": "https://api.github.com/users/jelgun/following{/other_user}", "gists_url": "https://api.github.com/users/jelgun/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/jelgun", "id": 5639662, "login": "jelgun", "node_id": "MDQ6VXNlcjU2Mzk2NjI=", "organizations_url": "https://api.github.com/users/jelgun/orgs", "received_events_url": "https://api.github.com/users/jelgun/received_events", "repos_url": "https://api.github.com/users/jelgun/repos", "site_admin": false, "starred_url": "https://api.github.com/users/jelgun/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/jelgun/subscriptions", "type": "User", "url": "https://api.github.com/users/jelgun", "user_view_type": "public" }
[]
closed
true
null
[]
null
0
2023-04-19T08:35:45Z
2024-04-19T00:03:21Z
2023-04-19T13:55:45Z
NONE
resolved
This PR removes a beautification comment (i.e. a comment that includes an array of special characters for beautification).
{ "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/6414/reactions" }
https://api.github.com/repos/psf/requests/issues/6414/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/6414.diff", "html_url": "https://github.com/psf/requests/pull/6414", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/6414.patch", "url": "https://api.github.com/repos/psf/requests/pulls/6414" }
true
[]
https://api.github.com/repos/psf/requests/issues/6413
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6413/labels{/name}
https://api.github.com/repos/psf/requests/issues/6413/comments
https://api.github.com/repos/psf/requests/issues/6413/events
https://github.com/psf/requests/pull/6413
1,674,443,216
PR_kwDOABTKOs5OpesW
6,413
remove irrelevant comment
{ "avatar_url": "https://avatars.githubusercontent.com/u/5639662?v=4", "events_url": "https://api.github.com/users/jelgun/events{/privacy}", "followers_url": "https://api.github.com/users/jelgun/followers", "following_url": "https://api.github.com/users/jelgun/following{/other_user}", "gists_url": "https://api.github.com/users/jelgun/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/jelgun", "id": 5639662, "login": "jelgun", "node_id": "MDQ6VXNlcjU2Mzk2NjI=", "organizations_url": "https://api.github.com/users/jelgun/orgs", "received_events_url": "https://api.github.com/users/jelgun/received_events", "repos_url": "https://api.github.com/users/jelgun/repos", "site_admin": false, "starred_url": "https://api.github.com/users/jelgun/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/jelgun/subscriptions", "type": "User", "url": "https://api.github.com/users/jelgun", "user_view_type": "public" }
[]
closed
true
null
[]
null
0
2023-04-19T08:35:23Z
2024-04-19T00:03:22Z
2023-04-19T13:55:31Z
NONE
resolved
This PR removed an irrelevant comment (i.e. comment that is not related to code or does not add much information to explain it)
{ "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/6413/reactions" }
https://api.github.com/repos/psf/requests/issues/6413/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/6413.diff", "html_url": "https://github.com/psf/requests/pull/6413", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/6413.patch", "url": "https://api.github.com/repos/psf/requests/pulls/6413" }
true
[]
https://api.github.com/repos/psf/requests/issues/6412
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6412/labels{/name}
https://api.github.com/repos/psf/requests/issues/6412/comments
https://api.github.com/repos/psf/requests/issues/6412/events
https://github.com/psf/requests/pull/6412
1,674,442,845
PR_kwDOABTKOs5Openh
6,412
fix misleading comment
{ "avatar_url": "https://avatars.githubusercontent.com/u/5639662?v=4", "events_url": "https://api.github.com/users/jelgun/events{/privacy}", "followers_url": "https://api.github.com/users/jelgun/followers", "following_url": "https://api.github.com/users/jelgun/following{/other_user}", "gists_url": "https://api.github.com/users/jelgun/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/jelgun", "id": 5639662, "login": "jelgun", "node_id": "MDQ6VXNlcjU2Mzk2NjI=", "organizations_url": "https://api.github.com/users/jelgun/orgs", "received_events_url": "https://api.github.com/users/jelgun/received_events", "repos_url": "https://api.github.com/users/jelgun/repos", "site_admin": false, "starred_url": "https://api.github.com/users/jelgun/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/jelgun/subscriptions", "type": "User", "url": "https://api.github.com/users/jelgun", "user_view_type": "public" }
[]
closed
true
null
[]
null
0
2023-04-19T08:35:07Z
2024-04-19T00:03:23Z
2023-04-19T13:55:26Z
NONE
resolved
This PR fixes a misleading comment (i.e. a comment that incorrectly describes what the code does).
{ "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/6412/reactions" }
https://api.github.com/repos/psf/requests/issues/6412/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/6412.diff", "html_url": "https://github.com/psf/requests/pull/6412", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/6412.patch", "url": "https://api.github.com/repos/psf/requests/pulls/6412" }
true
[]
https://api.github.com/repos/psf/requests/issues/6411
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6411/labels{/name}
https://api.github.com/repos/psf/requests/issues/6411/comments
https://api.github.com/repos/psf/requests/issues/6411/events
https://github.com/psf/requests/pull/6411
1,674,441,966
PR_kwDOABTKOs5Opebf
6,411
remove obvious comment
{ "avatar_url": "https://avatars.githubusercontent.com/u/5639662?v=4", "events_url": "https://api.github.com/users/jelgun/events{/privacy}", "followers_url": "https://api.github.com/users/jelgun/followers", "following_url": "https://api.github.com/users/jelgun/following{/other_user}", "gists_url": "https://api.github.com/users/jelgun/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/jelgun", "id": 5639662, "login": "jelgun", "node_id": "MDQ6VXNlcjU2Mzk2NjI=", "organizations_url": "https://api.github.com/users/jelgun/orgs", "received_events_url": "https://api.github.com/users/jelgun/received_events", "repos_url": "https://api.github.com/users/jelgun/repos", "site_admin": false, "starred_url": "https://api.github.com/users/jelgun/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/jelgun/subscriptions", "type": "User", "url": "https://api.github.com/users/jelgun", "user_view_type": "public" }
[]
closed
true
null
[]
null
0
2023-04-19T08:34:34Z
2024-04-19T00:03:24Z
2023-04-19T13:55:20Z
NONE
resolved
This PR removes an obvious comment (i.e. comment that restates what the code does in an obvious manner). The code itself is understandable that the request is being created.
{ "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/6411/reactions" }
https://api.github.com/repos/psf/requests/issues/6411/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/6411.diff", "html_url": "https://github.com/psf/requests/pull/6411", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/6411.patch", "url": "https://api.github.com/repos/psf/requests/pulls/6411" }
true
[]
https://api.github.com/repos/psf/requests/issues/6410
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6410/labels{/name}
https://api.github.com/repos/psf/requests/issues/6410/comments
https://api.github.com/repos/psf/requests/issues/6410/events
https://github.com/psf/requests/issues/6410
1,674,441,325
I_kwDOABTKOs5jzfJt
6,410
vague comment in `help.py`
{ "avatar_url": "https://avatars.githubusercontent.com/u/5639662?v=4", "events_url": "https://api.github.com/users/jelgun/events{/privacy}", "followers_url": "https://api.github.com/users/jelgun/followers", "following_url": "https://api.github.com/users/jelgun/following{/other_user}", "gists_url": "https://api.github.com/users/jelgun/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/jelgun", "id": 5639662, "login": "jelgun", "node_id": "MDQ6VXNlcjU2Mzk2NjI=", "organizations_url": "https://api.github.com/users/jelgun/orgs", "received_events_url": "https://api.github.com/users/jelgun/received_events", "repos_url": "https://api.github.com/users/jelgun/repos", "site_admin": false, "starred_url": "https://api.github.com/users/jelgun/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/jelgun/subscriptions", "type": "User", "url": "https://api.github.com/users/jelgun", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2023-04-19T08:34:08Z
2024-04-19T00:03:18Z
2023-04-19T14:03:24Z
NONE
resolved
The comment in https://github.com/psf/requests/blob/main/requests/help.py#L60 is difficult to understand. Is it possible to provide a clear explanation?
{ "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/6410/reactions" }
https://api.github.com/repos/psf/requests/issues/6410/timeline
null
completed
null
null
false
[ "Do you mean `#Complete Guess`?", "This is a comment Kenneth made stating he shipped this without testing it. As in \"This is entirely a guess\".\n\nThis is an ancillary file not intended for use outside of Requests, so it's unlikely we'll make an material changes to what's in there." ]
https://api.github.com/repos/psf/requests/issues/6409
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6409/labels{/name}
https://api.github.com/repos/psf/requests/issues/6409/comments
https://api.github.com/repos/psf/requests/issues/6409/events
https://github.com/psf/requests/issues/6409
1,674,439,707
I_kwDOABTKOs5jzewb
6,409
`test_request_recovery` fails when using pytest-xdist
{ "avatar_url": "https://avatars.githubusercontent.com/u/5639662?v=4", "events_url": "https://api.github.com/users/jelgun/events{/privacy}", "followers_url": "https://api.github.com/users/jelgun/followers", "following_url": "https://api.github.com/users/jelgun/following{/other_user}", "gists_url": "https://api.github.com/users/jelgun/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/jelgun", "id": 5639662, "login": "jelgun", "node_id": "MDQ6VXNlcjU2Mzk2NjI=", "organizations_url": "https://api.github.com/users/jelgun/orgs", "received_events_url": "https://api.github.com/users/jelgun/received_events", "repos_url": "https://api.github.com/users/jelgun/repos", "site_admin": false, "starred_url": "https://api.github.com/users/jelgun/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/jelgun/subscriptions", "type": "User", "url": "https://api.github.com/users/jelgun", "user_view_type": "public" }
[]
closed
true
null
[]
null
0
2023-04-19T08:33:07Z
2024-04-19T00:03:20Z
2023-04-19T13:57:24Z
NONE
resolved
This issue was created as a result of removing a TODO comment in https://github.com/psf/requests/pull/6406. ``` # TODO: figure out why this sometimes fails when using pytest-xdist. ```
{ "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/6409/reactions" }
https://api.github.com/repos/psf/requests/issues/6409/timeline
null
not_planned
null
null
false
[]
https://api.github.com/repos/psf/requests/issues/6408
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6408/labels{/name}
https://api.github.com/repos/psf/requests/issues/6408/comments
https://api.github.com/repos/psf/requests/issues/6408/events
https://github.com/psf/requests/issues/6408
1,674,240,695
I_kwDOABTKOs5jyuK3
6,408
equests.exceptions.HTTPError: 400 Client Error: Bad Request for url: https://login.cac1.pure.cloud/oauth/token
{ "avatar_url": "https://avatars.githubusercontent.com/u/30565416?v=4", "events_url": "https://api.github.com/users/bilalahmed381/events{/privacy}", "followers_url": "https://api.github.com/users/bilalahmed381/followers", "following_url": "https://api.github.com/users/bilalahmed381/following{/other_user}", "gists_url": "https://api.github.com/users/bilalahmed381/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/bilalahmed381", "id": 30565416, "login": "bilalahmed381", "node_id": "MDQ6VXNlcjMwNTY1NDE2", "organizations_url": "https://api.github.com/users/bilalahmed381/orgs", "received_events_url": "https://api.github.com/users/bilalahmed381/received_events", "repos_url": "https://api.github.com/users/bilalahmed381/repos", "site_admin": false, "starred_url": "https://api.github.com/users/bilalahmed381/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/bilalahmed381/subscriptions", "type": "User", "url": "https://api.github.com/users/bilalahmed381", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2023-04-19T06:17:21Z
2024-04-19T00:03:19Z
2023-04-19T14:00:35Z
NONE
resolved
<!-- Summary. --> **Issue:** I'm using airflow httphook to get authentication token. But I'm facing bad request error, status response 400. I verified the payload and header is correct. If I use ```response: requests.Response = requests.post("https://login.cac1.pure.cloud/oauth/token", headers=request_headers, data=request_body)``` response status is 200. However, on using ```response: requests.Response = HttpHook(http_conn_id="genesys_login", method="POST").run(endpoint="/oauth/token", headers=request_headers, data=request_body)``` it gives bad response error. **Request Payload and Header:** ``` authorization = base64.b64encode(bytes(<client_id> + ":" + <client_secret>, "ISO-8859-1")).decode("ascii") request_headers = { "Authorization": f"Basic {authorization}", "Content-Type": "application/x-www-form-urlencoded", } request_body = {"grant_type": "client_credentials"} ``` After debugging this line `self.prepare_auth(auth, url))` in models.py if I log `self.headers` I can see Authorization key is corrupted in header which I don't understand why. **Corrupted Authorization Key:** `{'User-Agent': 'python-requests/2.28.2', 'Accept-Encoding': 'gzip, deflate, br', 'Accept': '*/*', 'Connection': 'keep-alive', 'Authorization': 'Basic YWRtaW46Z1F3ZG9YN3U5bVU5V2Nzb3ZzY3Q=', 'Content-Type': 'application/x-www-form-urlencoded', 'Content-Length': '29'}` **Error Log:** ``` [2023-04-17, 14:42:03 MST] {taskinstance.py:1280} INFO - Starting attempt 1 of 1 [2023-04-17, 14:42:03 MST] {taskinstance.py:1281} INFO - -------------------------------------------------------------------------------- [2023-04-17, 14:42:03 MST] {taskinstance.py:1300} INFO - Executing <Task(_PythonDecoratedOperator): token_validation.update_token> on 2023-04-17 21:41:56.901593+00:00 [2023-04-17, 14:42:03 MST] {standard_task_runner.py:55} INFO - Started process 13621 to run task [2023-04-17, 14:42:03 MST] {standard_task_runner.py:82} INFO - Running: ['airflow', 'tasks', 'run', 'monitor_email', 'token_validation.update_token', 'manual__2023-04-17T21:41:56.901593+00:00', '--job-id', '21422', '--raw', '--subdir', 'DAGS_FOLDER/genesys_integration.py', '--cfg-path', '/tmp/tmpqa3air9p'] [2023-04-17, 14:42:03 MST] {standard_task_runner.py:83} INFO - Job 21422: Subtask token_validation.update_token [2023-04-17, 14:42:03 MST] {task_command.py:388} INFO - Running <TaskInstance: monitor_email.token_validation.update_token manual__2023-04-17T21:41:56.901593+00:00 [running]> on host lxapp-cp-jup15 [2023-04-17, 14:42:03 MST] {logging_mixin.py:137} WARNING - /home/e92215/miniforge3/envs/airflow/lib/python3.10/site-packages/airflow/models/renderedtifields.py:238 RemovedIn20Warning: ORDER BY columns added implicitly due to DISTINCT is deprecated and will be removed in SQLAlchemy 2.0. SELECT statements with DISTINCT should be written to explicitly include the appropriate columns in the columns clause (Background on SQLAlchemy 2.0 at: https://sqlalche.me/e/b8d9) [2023-04-17, 14:42:03 MST] {taskinstance.py:1507} INFO - Exporting the following env vars: AIRFLOW_CTX_DAG_OWNER=airflow AIRFLOW_CTX_DAG_ID=monitor_email AIRFLOW_CTX_TASK_ID=token_validation.update_token AIRFLOW_CTX_EXECUTION_DATE=2023-04-17T21:41:56.901593+00:00 AIRFLOW_CTX_TRY_NUMBER=1 AIRFLOW_CTX_DAG_RUN_ID=manual__2023-04-17T21:41:56.901593+00:00 [2023-04-17, 14:42:03 MST] {genesys_token_validate.py:138} INFO - Validating token with HTTP request [2023-04-17, 14:42:03 MST] {base.py:73} INFO - Using connection ID 'genesys_login' for task execution. [2023-04-17, 14:42:04 MST] {http.py:163} ERROR - HTTP error: Bad Request [2023-04-17, 14:42:04 MST] {http.py:164} ERROR - {"error":"invalid_client","description":"client not found","error_description":"client not found"} [2023-04-17, 14:42:04 MST] {taskinstance.py:1768} ERROR - Task failed with exception Traceback (most recent call last): File "/home/e92215/miniforge3/envs/airflow/lib/python3.10/site-packages/airflow/providers/http/hooks/http.py", line 161, in check_response response.raise_for_status() File "/home/e92215/miniforge3/envs/airflow/lib/python3.10/site-packages/requests/models.py", line 1021, in raise_for_status raise HTTPError(http_error_msg, response=self) requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: https://login.cac1.pure.cloud/oauth/token During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/e92215/miniforge3/envs/airflow/lib/python3.10/site-packages/airflow/decorators/base.py", line 217, in execute return_value = super().execute(context) File "/home/e92215/miniforge3/envs/airflow/lib/python3.10/site-packages/airflow/operators/python.py", line 175, in execute return_value = self.execute_callable() File "/home/e92215/miniforge3/envs/airflow/lib/python3.10/site-packages/airflow/operators/python.py", line 192, in execute_callable return self.python_callable(*self.op_args, **self.op_kwargs) File "/home/e92215/airflow/dags/authentication/genesys_token_validate.py", line 140, in update_token response: requests.Response = HttpHook(http_conn_id="genesys_login", method="POST").run( File "/home/e92215/miniforge3/envs/airflow/lib/python3.10/site-packages/airflow/providers/http/hooks/http.py", line 151, in run return self.run_and_check(session, prepped_request, extra_options) File "/home/e92215/miniforge3/envs/airflow/lib/python3.10/site-packages/airflow/providers/http/hooks/http.py", line 204, in run_and_check self.check_response(response) File "/home/e92215/miniforge3/envs/airflow/lib/python3.10/site-packages/airflow/providers/http/hooks/http.py", line 165, in check_response raise AirflowException(str(response.status_code) + ":" + response.reason) airflow.exceptions.AirflowException: 400:Bad Request [2023-04-17, 14:42:04 MST] {taskinstance.py:1318} INFO - Marking task as FAILED. dag_id=monitor_email, task_id=token_validation.update_token, execution_date=20230417T214156, start_date=20230417T214203, end_date=20230417T214204 [2023-04-17, 14:42:04 MST] {standard_task_runner.py:100} ERROR - Failed to execute job 21422 for task token_validation.update_token (400:Bad Request; 13621) [2023-04-17, 14:42:04 MST] {local_task_job.py:208} INFO - Task exited with return code 1 [2023-04-17, 14:42:04 MST] {taskinstance.py:2578} INFO - 0 downstream tasks scheduled from follow-on schedule check ``` ## Expected Result <!-- What you expected. --> response= 200 ## Actual Result response= 400 ## Reproduction Steps ```python import requests ``` ## System Information $ python -m requests.help ```json { "chardet": { "version": "4.0.0" }, "charset_normalizer": { "version": "2.1.1" }, "cryptography": { "version": "38.0.4" }, "idna": { "version": "3.4" }, "implementation": { "name": "CPython", "version": "3.10.10" }, "platform": { "release": "5.14.21-150400.24.55-default", "system": "Linux" }, "pyOpenSSL": { "openssl_version": "30000070", "version": "22.1.0" }, "requests": { "version": "2.28.2" }, "system_ssl": { "version": "30100000" }, "urllib3": { "version": "1.26.15" }, "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/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/6408/reactions" }
https://api.github.com/repos/psf/requests/issues/6408/timeline
null
completed
null
null
false
[ "Hi @bilalahmed381, from what you've provided. You've confirmed the request worked with Requests.\n\nFor questions about Airflow's abstractions, you may consider reaching out to their issue tracker or posting on StackOverflow. I don't believe we'll be able to help here." ]
https://api.github.com/repos/psf/requests/issues/6407
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6407/labels{/name}
https://api.github.com/repos/psf/requests/issues/6407/comments
https://api.github.com/repos/psf/requests/issues/6407/events
https://github.com/psf/requests/issues/6407
1,673,429,053
I_kwDOABTKOs5jvoA9
6,407
Server redirect containing neither body nor content-length header can result in delays/timeouts
{ "avatar_url": "https://avatars.githubusercontent.com/u/55152140?v=4", "events_url": "https://api.github.com/users/jayaddison/events{/privacy}", "followers_url": "https://api.github.com/users/jayaddison/followers", "following_url": "https://api.github.com/users/jayaddison/following{/other_user}", "gists_url": "https://api.github.com/users/jayaddison/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/jayaddison", "id": 55152140, "login": "jayaddison", "node_id": "MDQ6VXNlcjU1MTUyMTQw", "organizations_url": "https://api.github.com/users/jayaddison/orgs", "received_events_url": "https://api.github.com/users/jayaddison/received_events", "repos_url": "https://api.github.com/users/jayaddison/repos", "site_admin": false, "starred_url": "https://api.github.com/users/jayaddison/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/jayaddison/subscriptions", "type": "User", "url": "https://api.github.com/users/jayaddison", "user_view_type": "public" }
[]
closed
true
null
[]
null
15
2023-04-18T16:00:22Z
2024-05-17T00:03:19Z
2023-04-19T14:53:07Z
NONE
resolved
When `requests` v2.28.1 follows an HTTP redirect, it attempts to [consume the content of the server response](https://github.com/psf/requests/blob/4d394574f5555a8ddcc38f707e0c9f57f55d9a3b/requests/sessions.py#L185-L188), and then [closes the response](https://github.com/psf/requests/blob/4d394574f5555a8ddcc38f707e0c9f57f55d9a3b/requests/sessions.py#L195-L196), allowing the socket to be re-used for other requests. When that occurs for a server that sends an HTTP redirect (say, HTTP 302) without a content body -- and also without a `Content-Length` header (seemingly an optional header, particularly for responses that do not contain a response body), then `requests` can get stuck -- and/or timeout if a timeout is configured -- attempting to [read the body contents](https://github.com/psf/requests/blob/4d394574f5555a8ddcc38f707e0c9f57f55d9a3b/requests/sessions.py#L186) (more specifically: when [iterating the body contents](https://github.com/psf/requests/blob/4d394574f5555a8ddcc38f707e0c9f57f55d9a3b/requests/models.py#L899)). ## Expected Result I'm not an expert in this area, so I'm not completely certain. I feel like it might be possible to detect the absence of a `content-length` header field during the redirect logic, and also perhaps attempt to read the content (to empty the socket buffer), but perhaps with an immediate-skip if the content-length is missing (meaning: the server didn't say there is any body content, and there doesn't seem to be any body content from a brief check, so let's consider the content consumed already). ## Actual Result When a timeout is configured for the request, then that timeout will be reached. If no timeout is configured, then the request may remain open indefinitely. ## Reproduction Steps ```python # Sample code derived from: https://docs.python.org/3/library/http.server.html#http.server.SimpleHTTPRequestHandler and sphinx: https://github.com/sphinx-doc/sphinx.git from contextlib import contextmanager from http.server import SimpleHTTPRequestHandler, ThreadingHTTPServer from threading import Thread import requests class RedirectHandler(SimpleHTTPRequestHandler): protocol_version = "HTTP/1.1" def do_GET(self): if self.path == "/origin": self.send_response(302, "Found") self.send_header("Location", "http://127.0.0.1:8000/destination") self.end_headers() if self.path == "/destination": self.send_response(200, "OK") self.end_headers() class RedirectServer(Thread): def __init__(self): super().__init__() self.server = ThreadingHTTPServer(("127.0.0.1", 8000), RedirectHandler) def run(self): self.server.serve_forever(poll_interval=0.001) def close(self): self.server.shutdown() @contextmanager def redirect_server(): server = RedirectServer() server.start() try: yield server finally: server.close() with redirect_server(): requests.get(url="http://127.0.0.1:8000/origin", allow_redirects=True, timeout=1) ``` ## System Information $ python -m requests.help ```json { "chardet": { "version": "5.1.0" }, "charset_normalizer": { "version": "3.0.1" }, "cryptography": { "version": "" }, "idna": { "version": "3.3" }, "implementation": { "name": "CPython", "version": "3.11.2" }, "platform": { "release": "6.1.0-7-amd64", "system": "Linux" }, "pyOpenSSL": { "openssl_version": "", "version": null }, "requests": { "version": "2.28.1" }, "system_ssl": { "version": "30000080" }, "urllib3": { "version": "1.26.12" }, "using_charset_normalizer": false, "using_pyopenssl": false } ``` Edit: use a `requests.Session` object in the sample code Edit #2: undo the previous edit
{ "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/6407/reactions" }
https://api.github.com/repos/psf/requests/issues/6407/timeline
null
not_planned
null
null
false
[ "Hi @jayaddison,\n\nIf the server doesn't send an appropriate Content-Length or Transfer-Encoding header in the response, it's difficult for clients to know when the response is complete.\n\nWhat Requests is doing here is correct to spec. We will try to read until the server closes the connection. I don't think we want to broadly change this as it's likely to break existing cases.\n\nReference [RFC 7230](https://www.rfc-editor.org/rfc/rfc7230#section-3.3.3) (This should also be reflected in 9110)\n\n> 7. Otherwise, this is a response message without a declared message body length, so the message body length is determined by the number of octets received prior to the server closing the connection.", "I agree with @nateprewitt heartily. As such I'm inclined to close this", "@nateprewitt isn't rule six the applicable one from RFC 7230 in this case?\r\n\r\n> If this is a request message and [none of the above](https://www.rfc-editor.org/rfc/rfc7230#section-3.3.3) are true, then\r\n> the message body length is zero (no message body is present).", "It's a response, not a request message.", "Off-topic, so only if interested: do either of you have any idea why RFC-7230 might have added that distinction between requests and responses at the end of the section 3.3.3 checklist?\r\n\r\n(I have a half-baked and probably incorrect theory, and haven't yet found any relevant history on the web.. so I might hold onto that idea for now)", "Never mind - I've found the answer in RFC-7230's predecessor: [RFC-2616, section 4.4](https://www.rfc-editor.org/rfc/rfc2616#section-4.4). The final clause in the corresponding checklist there is/was:\r\n\r\n> By the server closing the connection. (Closing the connection cannot be used to indicate the end of a request body, since that would leave no possibility for the server to send back a response.)", "Despite all that, if an HTTP/1.1 server provides neither a `Content-Length` response header, nor a `Transfer-Encoding` declaration, then it feels to me like it should be valid for a client to return the underlying socket/connection to the pool.\r\n\r\nIt could require a flag/attribute to indicate that the socket is pending-content-read-completion -- but completing those reads feels like it should be performed asynchronously or in a separate thread, allowing the client to follow the redirect without delay (at the slight cost of an additional held-open socket on the client if the server is acting strangely. probably better than blocking the client completely, though).\r\n\r\nNot sure I'll have the time or inclination to write a suitable test case and implementation, but if I do, this comment is the notes I'll refer back to (and probably find that I misunderstood something, anyway).", "> then it feels to me like it should be valid for a client to return the underlying socket/connection to the pool.\r\n\r\n(this approach would only be possible within a `requests.Session`-based context, I think. I'll edit the code sample accordingly for future (self-)reference)", "> Despite all that, if an HTTP/1.1 server provides neither a `Content-Length` response header, nor a `Transfer-Encoding` declaration, then it feels to me like it should be valid for a client to return the underlying socket/connection to the pool.\n\nSemantically we can't be certain that's a reasonable assumption. There are lots of server implementations and no way of knowing what they think it means semantically. \n\n> It could require a flag/attribute to indicate that the socket is pending-content-read-completion -- but completing those reads feels like it should be performed asynchronously or in a separate thread, allowing the client to follow the redirect without delay (at the slight cost of an additional held-open socket on the client if the server is acting strangely. probably better than blocking the client completely, though).\n\nThis library cannot safely use threading. The ways and systems on which people use it are too varied for us to be able to confidently pick a solution there. We could implement a clock timeout on requests otherwise if we could pick something that would easily work for everyone without issues. We can't pick one of multiprocessing or threading because neither are consistently available across implementation, OS, etc. \n\n> Not sure I'll have the time or inclination to write a suitable test case and implementation, but if I do, this comment is the notes I'll refer back to (and probably find that I misunderstood something, anyway).\n\nI closed this as not planned meaning we have no intention of \"fixing\" it. Why do you want to send a pull request we won't accept? \n", "Thanks - yep, I'm familiar with the idea of disparate and fragmented server dialects, and I realize that it can be risky to integrate changes that could cause communication problems, or cause applications to develop an expectation that diverges from spec.\r\n\r\n> Why do you want to send a pull request we won't accept?\r\n\r\nI'm not sure whether I'll get around to it, but the reason would be to document some progress towards a goal that other people might find useful too (either in understanding the limitations of a fix, or to adopt locally for their own testing, etc).", "Please unsubscribe from this thread if this seems spammy; I'm likely to keep waffling on for a while.\r\n\r\nI'm wondering if it'd be reasonable for a client that is following a server-issued redirect _not_ to wait to consume response body content if the server has not indicated `Content-Length`.\r\n\r\nWe could do that by issuing a zero-timeout read on the client socket. If there's content there, then we could continue to wait until we have a complete response (basically: it looks like the server sent _something_, so let's read it). That wouldn't require any threading or async.\r\n\r\nIt's possible the zero-timeout read would return no data -- in that case, the situation's a bit more ambiguous. Is it just chance that the last packet(s) received didn't contain any of a response body that the server is _going_ to send? Would it be reasonable to close the client-side socket in that case? (requiring a new connection sometimes; perhaps with an emitted low-severity warning message)\r\n\r\nNone of that would require a session-based context, because it wouldn't involve the way-more-complicated idea of returning the connection to the pool and using another one while the redirect request is blocking.\r\n\r\nWe'd shift some of the potential resource-wastage from the client to the server, and that's certainly a tradeoff. The benefit would be that in (hopefully rare) cases where servers don't include the `Content-Length` on a redirect response, clients should be able to proceed faster.", "> We could do that by issuing a zero-timeout read on the client socket. If there's content there, then we could continue to wait until we have a complete response (basically: it looks like the server sent something, so let's read it). That wouldn't require any threading or async.\r\n\r\nA change of this kind is likely to require code that calls `urllib3`. Some notes:\r\n\r\n* There is an existing [`is_connection_dropped` utility function in `urllib3`](https://github.com/urllib3/urllib3/blob/95ca35211d23d8baf7646e1f60aa31e3650178a8/src/urllib3/util/connection.py#L11-L30) that performs a zero-timeout read using platform-specific socket handling\r\n* The `HTTPResponse.read` implementation in `urllib3` has some [special-case handling](https://github.com/urllib3/urllib3/blob/95ca35211d23d8baf7646e1f60aa31e3650178a8/src/urllib3/response.py#L572-L593) that relates to [Python bug 16298](https://bugs.python.org/issue16298) around closing connections when reading empty HTTP responses\r\n\r\nThose aren't guaranteed to be relevant, but there's a chance that the utility method could be reusable here, and the Python bug is worth bearing in mind.", "> Please unsubscribe from this thread if this seems spammy\n\nIf you're concerned about seeming spammy, maybe don't use an issue tracker on a repository with I don't remember how many subscribers as a notebook for stream of consciousness. ", "I'd like to suggest that `requests` could follow [RFC 9110 section 9.3.2](https://httpwg.org/specs/rfc9110.html#HEAD) and [RFC 9112 section 6.3, item 1](https://httpwg.org/specs/rfc9112.html#message.body.length)\\* to avoid blocking unnecessarily when a response body is not anticipated from the server during redirect-following of HTTP HEAD requests, and/or when encountering HTTP 1xx, 204 and 304 status code responses.\r\n\r\nPlease let me know whether a change of that kind would be acceptable.\r\n\r\n\\* broadly compatible with [RFC 7230 section 3.3.3, item 1](https://www.rfc-editor.org/rfc/rfc7230#section-3.3.3)", "@jayaddison:\r\n> Please let me know whether a change of that kind would be acceptable.\r\n\r\nNever mind: no change is required, evidently:\r\n\r\nBy adjusting the `requests.get` to `requests.head`, and `do_GET` to `do_HEAD` in the repro code, it's apparent that `requests` _does not_ block when an HTTP HEAD request is used and is directed by the server to follow an HTTP 302 redirect. This was confirmed using `requests==2.30.0` and `urllib3` versions `1.25.11`, `1.26.15` and `2.0.2` (and that version list is not to imply that I believe other versions are affected, simply that those are the versions I've checked).\r\n\r\nSo: the behaviour here is to-spec, both for the `GET` and `HEAD` requests. I should have tested that before asking about a possible change." ]
https://api.github.com/repos/psf/requests/issues/6406
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6406/labels{/name}
https://api.github.com/repos/psf/requests/issues/6406/comments
https://api.github.com/repos/psf/requests/issues/6406/events
https://github.com/psf/requests/pull/6406
1,671,928,193
PR_kwDOABTKOs5OhGWa
6,406
remove task comment
{ "avatar_url": "https://avatars.githubusercontent.com/u/5639662?v=4", "events_url": "https://api.github.com/users/jelgun/events{/privacy}", "followers_url": "https://api.github.com/users/jelgun/followers", "following_url": "https://api.github.com/users/jelgun/following{/other_user}", "gists_url": "https://api.github.com/users/jelgun/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/jelgun", "id": 5639662, "login": "jelgun", "node_id": "MDQ6VXNlcjU2Mzk2NjI=", "organizations_url": "https://api.github.com/users/jelgun/orgs", "received_events_url": "https://api.github.com/users/jelgun/received_events", "repos_url": "https://api.github.com/users/jelgun/repos", "site_admin": false, "starred_url": "https://api.github.com/users/jelgun/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/jelgun/subscriptions", "type": "User", "url": "https://api.github.com/users/jelgun", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2023-04-17T20:34:58Z
2024-04-19T00:03:25Z
2023-04-19T13:54:58Z
NONE
resolved
This PR removes a task comment (i.e. a comment referring to a work that could/should be done in the future or was already done).
{ "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/6406/reactions" }
https://api.github.com/repos/psf/requests/issues/6406/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/6406.diff", "html_url": "https://github.com/psf/requests/pull/6406", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/6406.patch", "url": "https://api.github.com/repos/psf/requests/pulls/6406" }
true
[ "Hi @jelgun, we generally won't accept PRs with minor/subjective changes. I'm going to close out the batch you provided today for that reason.\n\nFor future cases, if you have found a legitimate bug please open an issue before providing the PR. Thanks!" ]
https://api.github.com/repos/psf/requests/issues/6405
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6405/labels{/name}
https://api.github.com/repos/psf/requests/issues/6405/comments
https://api.github.com/repos/psf/requests/issues/6405/events
https://github.com/psf/requests/issues/6405
1,671,383,220
I_kwDOABTKOs5jn0i0
6,405
requests.exceptions.ConnectionError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))
{ "avatar_url": "https://avatars.githubusercontent.com/u/57814047?v=4", "events_url": "https://api.github.com/users/maritogaleano/events{/privacy}", "followers_url": "https://api.github.com/users/maritogaleano/followers", "following_url": "https://api.github.com/users/maritogaleano/following{/other_user}", "gists_url": "https://api.github.com/users/maritogaleano/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/maritogaleano", "id": 57814047, "login": "maritogaleano", "node_id": "MDQ6VXNlcjU3ODE0MDQ3", "organizations_url": "https://api.github.com/users/maritogaleano/orgs", "received_events_url": "https://api.github.com/users/maritogaleano/received_events", "repos_url": "https://api.github.com/users/maritogaleano/repos", "site_admin": false, "starred_url": "https://api.github.com/users/maritogaleano/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/maritogaleano/subscriptions", "type": "User", "url": "https://api.github.com/users/maritogaleano", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2023-04-17T14:58:09Z
2024-04-17T00:03:28Z
2023-04-17T21:34:39Z
NONE
resolved
When trying to post to an API I get the following error: ` raise ConnectionError(err, request=request) requests.exceptions.ConnectionError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response')) [17/Apr/2023 10:52:46] "POST /Depositos/crear HTTP/1.1" 500 187142`. The code I'm trying to run is: `x = session.post(url, data = json.dumps(data)) message = x.json() print(message) if x.status_code == 201: sweetify.success(request, 'Deposito creado correctamente') return redirect('deposito_nuevo') else: sweetify.error(request, 'Ha ocurrido un error', text=message["error"]["message"]["value"]) return redirect('deposito_nuevo')` The libraries that I am using are the following: sgiref 3.6.0 certifi 2020.6.20 chardet 3.0.4 charset-normalizer 3.1.0 Django 4.1.7 django-simple-history 3.3.0 django-widget-tweaks 1.4.8 gunicorn 20.0.4 idna 2.10 pip 23.0.1 psycopg2 2.9.5 psycopg2-binary 2.9.5 pytz 2020.1 requests 2.28.2 setuptools 67.6.0 six 1.15.0 sqlparse 0.3.1 sweetify 2.3.1 tzdata 2022.7 urllib3 1.25.9 wheel 0.38.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/6405/reactions" }
https://api.github.com/repos/psf/requests/issues/6405/timeline
null
not_planned
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\nNote that the remote end is closing the socket in violation of the protocol. This isn't a bug in requests " ]
https://api.github.com/repos/psf/requests/issues/6404
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6404/labels{/name}
https://api.github.com/repos/psf/requests/issues/6404/comments
https://api.github.com/repos/psf/requests/issues/6404/events
https://github.com/psf/requests/pull/6404
1,665,510,534
PR_kwDOABTKOs5OLzAg
6,404
Try charset_normalizer first
{ "avatar_url": "https://avatars.githubusercontent.com/u/67641?v=4", "events_url": "https://api.github.com/users/martinthomson/events{/privacy}", "followers_url": "https://api.github.com/users/martinthomson/followers", "following_url": "https://api.github.com/users/martinthomson/following{/other_user}", "gists_url": "https://api.github.com/users/martinthomson/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/martinthomson", "id": 67641, "login": "martinthomson", "node_id": "MDQ6VXNlcjY3NjQx", "organizations_url": "https://api.github.com/users/martinthomson/orgs", "received_events_url": "https://api.github.com/users/martinthomson/received_events", "repos_url": "https://api.github.com/users/martinthomson/repos", "site_admin": false, "starred_url": "https://api.github.com/users/martinthomson/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/martinthomson/subscriptions", "type": "User", "url": "https://api.github.com/users/martinthomson", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2023-04-13T01:23:31Z
2024-04-13T00:03:30Z
2023-04-13T03:14:49Z
NONE
resolved
The newer `charset_normalizer` is installed as a dependency in a lot of cases, so there isn't much point in going to `chardet` as a first stop. It might even be possible to switch to an unconditional import.
{ "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/6404/reactions" }
https://api.github.com/repos/psf/requests/issues/6404/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/6404.diff", "html_url": "https://github.com/psf/requests/pull/6404", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/6404.patch", "url": "https://api.github.com/repos/psf/requests/pulls/6404" }
true
[ "Hi @martinthomson, this is a breaking change. We won't be able to accept this PR. Thanks for the suggestion though." ]
https://api.github.com/repos/psf/requests/issues/6403
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6403/labels{/name}
https://api.github.com/repos/psf/requests/issues/6403/comments
https://api.github.com/repos/psf/requests/issues/6403/events
https://github.com/psf/requests/issues/6403
1,665,097,746
I_kwDOABTKOs5jP2AS
6,403
no cookies returned when executing on AIX.
{ "avatar_url": "https://avatars.githubusercontent.com/u/45187098?v=4", "events_url": "https://api.github.com/users/bonkeydcow/events{/privacy}", "followers_url": "https://api.github.com/users/bonkeydcow/followers", "following_url": "https://api.github.com/users/bonkeydcow/following{/other_user}", "gists_url": "https://api.github.com/users/bonkeydcow/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/bonkeydcow", "id": 45187098, "login": "bonkeydcow", "node_id": "MDQ6VXNlcjQ1MTg3MDk4", "organizations_url": "https://api.github.com/users/bonkeydcow/orgs", "received_events_url": "https://api.github.com/users/bonkeydcow/received_events", "repos_url": "https://api.github.com/users/bonkeydcow/repos", "site_admin": false, "starred_url": "https://api.github.com/users/bonkeydcow/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/bonkeydcow/subscriptions", "type": "User", "url": "https://api.github.com/users/bonkeydcow", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2023-04-12T19:07:40Z
2024-04-13T00:03:28Z
2023-04-12T20:47:01Z
NONE
resolved
Summary. Connecting to an API that returns cookies is not returning cookies if the script is executed from an AIX environment. ## Expected Result I expected response.cookies to contain data. If I execute the identical code, on identical python version, identical package versions on window and linux, it works fine. ## Actual Result reponse.cookies=<RequestsCookieJar[]> An empty CookieJar ## Reproduction Steps ```python import requests response = requests.request('POST', url=url, verify=False, json=body) print(f'cookies={response.cookies}') ``` ## System Information $ python -m requests.help ``` { "chardet": { "version": "3.0.4" }, "charset_normalizer": { "version": "2.1.1" }, "cryptography": { "version": "" }, "idna": { "version": "2.8" }, "implementation": { "name": "CPython", "version": "3.7.3" }, "platform": { "release": "1", "system": "AIX" }, "pyOpenSSL": { "openssl_version": "", "version": null }, "requests": { "version": "2.28.2" }, "system_ssl": { "version": "1000212f" }, "urllib3": { "version": "1.25.3" }, "using_charset_normalizer": false, "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/45187098?v=4", "events_url": "https://api.github.com/users/bonkeydcow/events{/privacy}", "followers_url": "https://api.github.com/users/bonkeydcow/followers", "following_url": "https://api.github.com/users/bonkeydcow/following{/other_user}", "gists_url": "https://api.github.com/users/bonkeydcow/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/bonkeydcow", "id": 45187098, "login": "bonkeydcow", "node_id": "MDQ6VXNlcjQ1MTg3MDk4", "organizations_url": "https://api.github.com/users/bonkeydcow/orgs", "received_events_url": "https://api.github.com/users/bonkeydcow/received_events", "repos_url": "https://api.github.com/users/bonkeydcow/repos", "site_admin": false, "starred_url": "https://api.github.com/users/bonkeydcow/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/bonkeydcow/subscriptions", "type": "User", "url": "https://api.github.com/users/bonkeydcow", "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/6403/reactions" }
https://api.github.com/repos/psf/requests/issues/6403/timeline
null
completed
null
null
false
[ "I did a lot of manual debugging with PDB.\r\n\r\nI found that where it is failing is on the check for the session expiration. On AIX it calculates that the session is expired. This appears to be an issue with the conversion of the date/time string to epoch.", "Nevermind, time was off on the aix server." ]
https://api.github.com/repos/psf/requests/issues/6402
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6402/labels{/name}
https://api.github.com/repos/psf/requests/issues/6402/comments
https://api.github.com/repos/psf/requests/issues/6402/events
https://github.com/psf/requests/issues/6402
1,662,016,374
I_kwDOABTKOs5jEFt2
6,402
SOCKS5 proxies are not being used when specified - results to using machine IP address
{ "avatar_url": "https://avatars.githubusercontent.com/u/30209138?v=4", "events_url": "https://api.github.com/users/bloxploits/events{/privacy}", "followers_url": "https://api.github.com/users/bloxploits/followers", "following_url": "https://api.github.com/users/bloxploits/following{/other_user}", "gists_url": "https://api.github.com/users/bloxploits/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/bloxploits", "id": 30209138, "login": "bloxploits", "node_id": "MDQ6VXNlcjMwMjA5MTM4", "organizations_url": "https://api.github.com/users/bloxploits/orgs", "received_events_url": "https://api.github.com/users/bloxploits/received_events", "repos_url": "https://api.github.com/users/bloxploits/repos", "site_admin": false, "starred_url": "https://api.github.com/users/bloxploits/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/bloxploits/subscriptions", "type": "User", "url": "https://api.github.com/users/bloxploits", "user_view_type": "public" }
[]
closed
true
null
[]
null
4
2023-04-11T08:35:50Z
2024-04-13T00:03:29Z
2023-04-11T13:53:23Z
NONE
resolved
Today I was testing proxies and was able to use them effectively at the start of the day, however after re-running the code a few hours later, the proxies stopped working. Before anyone asks, I have checked the proxies are still functioning, I know this through my paid proxy provider and checking my proxy IP in a browser using foxyproxy (a browser extension which allows you to login to a proxy). I also am 100% certain that the proxies are in the correct format. (socks5://user:pass@ip:port) I find this extremely weird, since the same code was used a few hours prior and now it suddenly has stopped working. ## Expected Result {"ip": **THE PROXY IP**} ## Actual Result {"ip": **MY HOME IP**} ## Reproduction Steps ```python import requests proxy = {'http': 'socks5://user:pass@ip:port', 'https:': 'socks5://user:pass@ip:port'} r = requests.get("https://api64.ipify.org?format=json", proxies=proxy) print(r.text) ``` ## System Information $ python -m requests.help ```json { "chardet": { "version": null }, "charset_normalizer": { "version": "3.0.1" }, "cryptography": { "version": "" }, "idna": { "version": "3.4" }, "implementation": { "name": "CPython", "version": "3.11.1" }, "platform": { "release": "21.6.0", "system": "Darwin" }, "pyOpenSSL": { "openssl_version": "", "version": null }, "requests": { "version": "2.28.2" }, "system_ssl": { "version": "1010111f" }, "urllib3": { "version": "1.26.14" }, "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/6402/reactions" }
https://api.github.com/repos/psf/requests/issues/6402/timeline
null
completed
null
null
false
[ "We don't have a feature to rewrite our code for socks proxy users after a few hours of use.\n\nThis sounds like a provider rate limiting your access via requests since some get complaints of people using the proxy to bypass access restrictions and scrape content. ", "To be extra clear, this sounds like an issue between you and your proxy. Whether that's something in your machine's environment or something between you and your proxy, or something your proxy has decided to do to your Requests usage based on connection characteristics, that's not a bug in Requests. If you want help diagnosing your proxy's issues you're better served talking to your provider who you're paying for this service.\n\nBy your own admission, requests properly utilizes your proxy until something outside of requests changes. This this isn't a bug in requests ", "curl -x socks5://user:pass@ip:port 'https://api64.ipify.org?format=json' works completely fine. Its just python that doesn't work. Do you have any idea on where to look to fix this. It could be something to do with my machine. Thanks", "Sorry, about that \"'https:':\" that where i went wrong :(" ]
https://api.github.com/repos/psf/requests/issues/6401
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6401/labels{/name}
https://api.github.com/repos/psf/requests/issues/6401/comments
https://api.github.com/repos/psf/requests/issues/6401/events
https://github.com/psf/requests/pull/6401
1,660,646,346
PR_kwDOABTKOs5N7WeA
6,401
request/cookies.py -> RequestCookieJar inheritance update from collections
{ "avatar_url": "https://avatars.githubusercontent.com/u/85517013?v=4", "events_url": "https://api.github.com/users/shadmeoli/events{/privacy}", "followers_url": "https://api.github.com/users/shadmeoli/followers", "following_url": "https://api.github.com/users/shadmeoli/following{/other_user}", "gists_url": "https://api.github.com/users/shadmeoli/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/shadmeoli", "id": 85517013, "login": "shadmeoli", "node_id": "MDQ6VXNlcjg1NTE3MDEz", "organizations_url": "https://api.github.com/users/shadmeoli/orgs", "received_events_url": "https://api.github.com/users/shadmeoli/received_events", "repos_url": "https://api.github.com/users/shadmeoli/repos", "site_admin": false, "starred_url": "https://api.github.com/users/shadmeoli/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/shadmeoli/subscriptions", "type": "User", "url": "https://api.github.com/users/shadmeoli", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2023-04-10T11:20:55Z
2024-04-10T00:03:23Z
2023-04-10T12:46:59Z
NONE
resolved
I have updated the RequestCookieJar class to be compatible with python3.10^ on Linux machines using python3.10^ as the default versions and also compatibility with pymongo. **The error** ``` module 'collections' has no attribute 'MutableMapping' ``` <details> <summary>Pymongo full error</summary> >You can add text within a collapsed section. You can add an image or a code block, too. ```python File "<root-folder>/<app/folder>", line 4, in <module> from pymongo import MongoClient File "<root-folder>/.local/lib/python3.10/site-packages/pymongo/__init__.py", line 92, in <module> from pymongo.mongo_client import MongoClient File "<root-folder>/.local/lib/python3.10/site-packages/pymongo/mongo_client.py", line 59, in <module> from pymongo import ( File "<root-folder>/.local/lib/python3.10/site-packages/pymongo/uri_parser.py", line 32, in <module> from pymongo.srv_resolver import _HAVE_DNSPYTHON, _SrvResolver File "<root-folder>/.local/lib/python3.10/site-packages/pymongo/srv_resolver.py", line 21, in <module> from dns import resolver File "<root-folder>/.local/lib/python3.10/site-packages/dns/resolver.py", line 39, in <module> import dns.query File "<root-folder>/.local/lib/python3.10/site-packages/dns/query.py", line 47, in <module> import requests File "<root-folder>/.local/lib/python3.10/site-packages/requests/__init__.py", line 63, in <module> from . import utils File "<root-folder>/.local/lib/python3.10/site-packages/requests/utils.py", line 27, in <module> from .cookies import RequestsCookieJar, cookiejar_from_dict File "<root-folder>/.local/lib/python3.10/site-packages/requests/cookies.py", line 172, in <module> class RequestsCookieJar(cookielib.CookieJar, collections.MutableMapping): AttributeError: module 'collections' has no attribute 'MutableMapping' ``` </details>
{ "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": 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/6401/reactions" }
https://api.github.com/repos/psf/requests/issues/6401/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/6401.diff", "html_url": "https://github.com/psf/requests/pull/6401", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/6401.patch", "url": "https://api.github.com/repos/psf/requests/pulls/6401" }
true
[ "The Cookie Jar already inherits from `collections.abc.MutableMapping`. it is imported correctly in the compat module.\n\nI suspect you're using a version of requests that's too old" ]
https://api.github.com/repos/psf/requests/issues/6400
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6400/labels{/name}
https://api.github.com/repos/psf/requests/issues/6400/comments
https://api.github.com/repos/psf/requests/issues/6400/events
https://github.com/psf/requests/pull/6400
1,654,506,335
PR_kwDOABTKOs5Nnkxj
6,400
Codespell: workflow, config + 1 typo fixed
{ "avatar_url": "https://avatars.githubusercontent.com/u/39889?v=4", "events_url": "https://api.github.com/users/yarikoptic/events{/privacy}", "followers_url": "https://api.github.com/users/yarikoptic/followers", "following_url": "https://api.github.com/users/yarikoptic/following{/other_user}", "gists_url": "https://api.github.com/users/yarikoptic/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/yarikoptic", "id": 39889, "login": "yarikoptic", "node_id": "MDQ6VXNlcjM5ODg5", "organizations_url": "https://api.github.com/users/yarikoptic/orgs", "received_events_url": "https://api.github.com/users/yarikoptic/received_events", "repos_url": "https://api.github.com/users/yarikoptic/repos", "site_admin": false, "starred_url": "https://api.github.com/users/yarikoptic/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/yarikoptic/subscriptions", "type": "User", "url": "https://api.github.com/users/yarikoptic", "user_view_type": "public" }
[]
open
false
null
[]
null
1
2023-04-04T20:06:32Z
2023-11-22T22:07:49Z
null
NONE
null
My humble contribution to keep requests so typos free as it is proudly is now.
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/6400/reactions" }
https://api.github.com/repos/psf/requests/issues/6400/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/6400.diff", "html_url": "https://github.com/psf/requests/pull/6400", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/6400.patch", "url": "https://api.github.com/repos/psf/requests/pulls/6400" }
true
[ "rebased/updated (config now to pyproject.toml). Typo was already fixed independently in d3d504436ef0c2ac7ec8af13738b04dcc8c694be" ]
https://api.github.com/repos/psf/requests/issues/6398
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6398/labels{/name}
https://api.github.com/repos/psf/requests/issues/6398/comments
https://api.github.com/repos/psf/requests/issues/6398/events
https://github.com/psf/requests/pull/6398
1,650,407,460
PR_kwDOABTKOs5NZ-jF
6,398
Title: Add "Setting Up a Local Development Environment" to README
{ "avatar_url": "https://avatars.githubusercontent.com/u/56711352?v=4", "events_url": "https://api.github.com/users/APolevanov/events{/privacy}", "followers_url": "https://api.github.com/users/APolevanov/followers", "following_url": "https://api.github.com/users/APolevanov/following{/other_user}", "gists_url": "https://api.github.com/users/APolevanov/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/APolevanov", "id": 56711352, "login": "APolevanov", "node_id": "MDQ6VXNlcjU2NzExMzUy", "organizations_url": "https://api.github.com/users/APolevanov/orgs", "received_events_url": "https://api.github.com/users/APolevanov/received_events", "repos_url": "https://api.github.com/users/APolevanov/repos", "site_admin": false, "starred_url": "https://api.github.com/users/APolevanov/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/APolevanov/subscriptions", "type": "User", "url": "https://api.github.com/users/APolevanov", "user_view_type": "public" }
[]
closed
false
null
[]
null
0
2023-04-01T10:22:59Z
2024-06-16T07:32:45Z
2024-06-16T07:32:45Z
NONE
null
This pull request adds a new section titled "Setting Up a Local Development Environment" to the README.md file. This section provides clear instructions for contributors on how to set up a local development environment for the Requests project. The addition of this section will make it easier for new contributors to get started with the project and ensure a smooth onboarding process. The new section includes: Instructions on installing necessary dependencies Cloning the repository Creating and activating a virtual environment Installing project requirements Running tests By providing this information in the README.md, we aim to lower the barrier to entry for potential contributors and make the project more accessible to developers of all experience levels. Please review the changes and let me know if you have any suggestions or require further modifications. I'm more than happy to make any necessary adjustments. Thank you for considering this contribution!
{ "avatar_url": "https://avatars.githubusercontent.com/u/56711352?v=4", "events_url": "https://api.github.com/users/APolevanov/events{/privacy}", "followers_url": "https://api.github.com/users/APolevanov/followers", "following_url": "https://api.github.com/users/APolevanov/following{/other_user}", "gists_url": "https://api.github.com/users/APolevanov/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/APolevanov", "id": 56711352, "login": "APolevanov", "node_id": "MDQ6VXNlcjU2NzExMzUy", "organizations_url": "https://api.github.com/users/APolevanov/orgs", "received_events_url": "https://api.github.com/users/APolevanov/received_events", "repos_url": "https://api.github.com/users/APolevanov/repos", "site_admin": false, "starred_url": "https://api.github.com/users/APolevanov/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/APolevanov/subscriptions", "type": "User", "url": "https://api.github.com/users/APolevanov", "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/6398/reactions" }
https://api.github.com/repos/psf/requests/issues/6398/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/6398.diff", "html_url": "https://github.com/psf/requests/pull/6398", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/6398.patch", "url": "https://api.github.com/repos/psf/requests/pulls/6398" }
true
[]
https://api.github.com/repos/psf/requests/issues/6397
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6397/labels{/name}
https://api.github.com/repos/psf/requests/issues/6397/comments
https://api.github.com/repos/psf/requests/issues/6397/events
https://github.com/psf/requests/pull/6397
1,647,867,731
PR_kwDOABTKOs5NRmwT
6,397
chore: move coverage config to `pyproject.toml`
{ "avatar_url": "https://avatars.githubusercontent.com/u/61241031?v=4", "events_url": "https://api.github.com/users/SauravMaheshkar/events{/privacy}", "followers_url": "https://api.github.com/users/SauravMaheshkar/followers", "following_url": "https://api.github.com/users/SauravMaheshkar/following{/other_user}", "gists_url": "https://api.github.com/users/SauravMaheshkar/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/SauravMaheshkar", "id": 61241031, "login": "SauravMaheshkar", "node_id": "MDQ6VXNlcjYxMjQxMDMx", "organizations_url": "https://api.github.com/users/SauravMaheshkar/orgs", "received_events_url": "https://api.github.com/users/SauravMaheshkar/received_events", "repos_url": "https://api.github.com/users/SauravMaheshkar/repos", "site_admin": false, "starred_url": "https://api.github.com/users/SauravMaheshkar/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/SauravMaheshkar/subscriptions", "type": "User", "url": "https://api.github.com/users/SauravMaheshkar", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2023-03-30T15:37:31Z
2024-03-30T00:03:12Z
2023-03-30T19:26:49Z
NONE
resolved
This PR aims to minimize the number of configuration files for the project. Instead of a separate `.coveragerc` for configuring coverage, we now would have the required configuration within the `pyproject.toml` file leading to a overall minimal code structure.
{ "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/6397/reactions" }
https://api.github.com/repos/psf/requests/issues/6397/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/6397.diff", "html_url": "https://github.com/psf/requests/pull/6397", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/6397.patch", "url": "https://api.github.com/repos/psf/requests/pulls/6397" }
true
[ "We don't accept cosmetic changes. Thanks for thinking of us though" ]
https://api.github.com/repos/psf/requests/issues/6396
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6396/labels{/name}
https://api.github.com/repos/psf/requests/issues/6396/comments
https://api.github.com/repos/psf/requests/issues/6396/events
https://github.com/psf/requests/issues/6396
1,643,980,265
I_kwDOABTKOs5h_SXp
6,396
Request() not defined
{ "avatar_url": "https://avatars.githubusercontent.com/u/123341980?v=4", "events_url": "https://api.github.com/users/ferrariaria/events{/privacy}", "followers_url": "https://api.github.com/users/ferrariaria/followers", "following_url": "https://api.github.com/users/ferrariaria/following{/other_user}", "gists_url": "https://api.github.com/users/ferrariaria/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/ferrariaria", "id": 123341980, "login": "ferrariaria", "node_id": "U_kgDOB1oMnA", "organizations_url": "https://api.github.com/users/ferrariaria/orgs", "received_events_url": "https://api.github.com/users/ferrariaria/received_events", "repos_url": "https://api.github.com/users/ferrariaria/repos", "site_admin": false, "starred_url": "https://api.github.com/users/ferrariaria/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/ferrariaria/subscriptions", "type": "User", "url": "https://api.github.com/users/ferrariaria", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2023-03-28T13:41:15Z
2024-03-28T00:03:41Z
2023-03-28T13:44:56Z
NONE
resolved
<!-- Summary. --> I have been using the Request() function for months in this form: req = Request( url=url_c, headers={'User-Agent': 'Mozilla/5.0'}) with urlopen(req) as response: webpage=response.read() soup = BeautifulSoup(webpage) Until yesterday, my code above returned a beautiful soup object and then all of a sudden yesterday the Request() function just stopped working. <!-- What you expected. --> It returned this name error: NameError: name 'Request' is not defined I tried re-importing and reinstalling requests and restarting my kernel several times but to no avail. I am using Python 3.10.8- and requests version 2.28.1 I see that that there is a requests.get function but I want to know why the function was working fine for months and then all of a sudden it wasn't recognized anymore.
{ "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/6396/reactions" }
https://api.github.com/repos/psf/requests/issues/6396/timeline
null
completed
null
null
false
[ "hi @ferrariaria, nothing has changed with Requests. I would suggest double checking your local environment and code again. If Request is not defined, you've failed to import it properly. Unfortunately we aren't able to help with setup debugging on this issue tracker, we recommend posting on [StackOverflow](https://stackoverflow.com/) with further questions. Thanks!" ]
https://api.github.com/repos/psf/requests/issues/6395
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6395/labels{/name}
https://api.github.com/repos/psf/requests/issues/6395/comments
https://api.github.com/repos/psf/requests/issues/6395/events
https://github.com/psf/requests/pull/6395
1,642,629,600
PR_kwDOABTKOs5M_9n3
6,395
🛠 fix: Adapter overwrite passed-in retry
{ "avatar_url": "https://avatars.githubusercontent.com/u/23290356?v=4", "events_url": "https://api.github.com/users/tomy0000000/events{/privacy}", "followers_url": "https://api.github.com/users/tomy0000000/followers", "following_url": "https://api.github.com/users/tomy0000000/following{/other_user}", "gists_url": "https://api.github.com/users/tomy0000000/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/tomy0000000", "id": 23290356, "login": "tomy0000000", "node_id": "MDQ6VXNlcjIzMjkwMzU2", "organizations_url": "https://api.github.com/users/tomy0000000/orgs", "received_events_url": "https://api.github.com/users/tomy0000000/received_events", "repos_url": "https://api.github.com/users/tomy0000000/repos", "site_admin": false, "starred_url": "https://api.github.com/users/tomy0000000/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/tomy0000000/subscriptions", "type": "User", "url": "https://api.github.com/users/tomy0000000", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2023-03-27T18:47:13Z
2024-03-28T00:03:43Z
2023-03-28T05:59:02Z
NONE
resolved
According to the API reference of `max_retries` of `requests.adapters.HTTPAdapter` > The maximum number of retries each connection should attempt. Note, this applies only to failed DNS lookups, socket connections and connection timeouts, never to requests where data has made it to the server. By default, Requests does not retry failed connections. If you need granular control over the conditions under which we retry a request, **import urllib3’s Retry class and pass that instead.** A widely used example can be found in this [StackOverflow answer](https://stackoverflow.com/a/35504626/10325430) and is also under review in #6258. However, the current source code does not really accept the passed-in `Retry` instance. Instead, it will silently discard and replace it with the default `Retry` instance. This 2-line fix intends to fix the bug and restore its behavior to expect.
{ "avatar_url": "https://avatars.githubusercontent.com/u/23290356?v=4", "events_url": "https://api.github.com/users/tomy0000000/events{/privacy}", "followers_url": "https://api.github.com/users/tomy0000000/followers", "following_url": "https://api.github.com/users/tomy0000000/following{/other_user}", "gists_url": "https://api.github.com/users/tomy0000000/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/tomy0000000", "id": 23290356, "login": "tomy0000000", "node_id": "MDQ6VXNlcjIzMjkwMzU2", "organizations_url": "https://api.github.com/users/tomy0000000/orgs", "received_events_url": "https://api.github.com/users/tomy0000000/received_events", "repos_url": "https://api.github.com/users/tomy0000000/repos", "site_admin": false, "starred_url": "https://api.github.com/users/tomy0000000/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/tomy0000000/subscriptions", "type": "User", "url": "https://api.github.com/users/tomy0000000", "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/6395/reactions" }
https://api.github.com/repos/psf/requests/issues/6395/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/6395.diff", "html_url": "https://github.com/psf/requests/pull/6395", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/6395.patch", "url": "https://api.github.com/repos/psf/requests/pulls/6395" }
true
[ "You haven't provided evidence that this isn't working. The `from_int` classmethod returns the Retry instance if it's already a Retry ", "My mistake. Turns out I used the wrong scheme (`http://` should be `https://`) when mounting in my previous test.\r\n\r\nClosing this PR, but do look into #6258 and get it merged. Took me a while to get this snippet that should've been in official docs." ]
https://api.github.com/repos/psf/requests/issues/6394
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6394/labels{/name}
https://api.github.com/repos/psf/requests/issues/6394/comments
https://api.github.com/repos/psf/requests/issues/6394/events
https://github.com/psf/requests/issues/6394
1,640,962,427
I_kwDOABTKOs5hzxl7
6,394
Failure to fetch data / requests.get returns 503 while curl is 200
{ "avatar_url": "https://avatars.githubusercontent.com/u/46412574?v=4", "events_url": "https://api.github.com/users/Hu1buerger/events{/privacy}", "followers_url": "https://api.github.com/users/Hu1buerger/followers", "following_url": "https://api.github.com/users/Hu1buerger/following{/other_user}", "gists_url": "https://api.github.com/users/Hu1buerger/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Hu1buerger", "id": 46412574, "login": "Hu1buerger", "node_id": "MDQ6VXNlcjQ2NDEyNTc0", "organizations_url": "https://api.github.com/users/Hu1buerger/orgs", "received_events_url": "https://api.github.com/users/Hu1buerger/received_events", "repos_url": "https://api.github.com/users/Hu1buerger/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Hu1buerger/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Hu1buerger/subscriptions", "type": "User", "url": "https://api.github.com/users/Hu1buerger", "user_view_type": "public" }
[]
closed
true
null
[]
null
5
2023-03-26T15:43:42Z
2024-03-28T00:03:40Z
2023-03-26T17:23:42Z
NONE
resolved
requests.get fails to fetch page, while curl on the same machine gets a 200. Additionaly the same code runs on macos 13.0.1 ## Expected Result ```py import requests # with version 2.28.2 res = requests.get("https://www.reichelt.com/raspberry-pi-zero-2-w-4x-1-ghz-512-mb-ram-wlan-bt-rasp-pi-zero2-w-p313902.html?CCOUNTRY=445&LANGUAGE=de") assert res.status_code == 200 ``` with `curl "https://www.reichelt.com/raspberry-pi-zero-2-w-4x-1-ghz-512-mb-ram-wlan-bt-rasp-pi-zero2-w-p313902.html?CCOUNTRY=445&LANGUAGE=de"` which returns the expected page. Both ran on the same machine with python 3.10. ## Actual Result `requests.get` returns http `503` ## Reproduction Steps see above. ## System Information $ python -m requests.help ```json { "chardet": { "version": "4.0.0" }, "charset_normalizer": { "version": "3.1.0" }, "cryptography": { "version": "3.4.8" }, "idna": { "version": "3.4" }, "implementation": { "name": "CPython", "version": "3.10.6" }, "platform": { "release": "5.15.0-1025-raspi", "system": "Linux" }, "pyOpenSSL": { "openssl_version": "30000020", "version": "21.0.0" }, "requests": { "version": "2.28.2" }, "system_ssl": { "version": "30000020" }, "urllib3": { "version": "1.26.15" }, "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). --> Pi 4 with Ubuntu 22.04.2 LTS
{ "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/6394/reactions" }
https://api.github.com/repos/psf/requests/issues/6394/timeline
null
completed
null
null
false
[ "Hi @Hu1buerger, a 503 is a server side error. There's nothing we can do about this in Requests. You'll need to determine what's failing on the server in this case and whether it's intentional to block web scraping.\n\nI'm going to resolve this as we can't take any action with the current info.", "@nateprewitt thats what i am refering to. I am assuming this is a clientside issue, as curling from the server is working fine. also running the same code on macos is working.\r\n\r\nWhy i believe this to be the case:\r\n\r\nThe server gets the same request headers (i.e. UserAgent), and assumingly the same content from the same source ip.\r\nThere should not be any destinguishing features between either request (send by requests on mac, requests on linux and curl on linux). All requests are send roughly at the same time (ie. rate limiting, spam protection)", "> I am assuming this is a clientside issue\n\nYes, it may be due to a client side behavior, but we cannot debug all server implementations on the web.\n\nIf there is a root cause for the server side failure and clear indication of a defect in Requests, we can potentially investigate that.", "@nateprewitt imo the following test should be satisfied. especially as it works on macos but not on linux\r\n\r\n```py\r\nimport subprocess\r\nimport unittest\r\n\r\nimport requests\r\n\r\nREICHELT_URL = \"https://www.reichelt.com/raspberry-pi-zero-2-w-4x-1-ghz-512-mb-ram-wlan-bt-rasp-pi-zero2-w-p313902.html?CCOUNTRY=445&LANGUAGE=de\"\r\n\r\n\r\nclass MyTestCase(unittest.TestCase):\r\n\r\n def test_requests(self):\r\n res = requests.get(REICHELT_URL)\r\n self.assertEqual(res.status_code, 200)\r\n\r\n def test_curl_should_be_200(self):\r\n cmd = \"curl -s -o /dev/null -w \\\"%{http_code}\\\"\" + f\" \\\"{REICHELT_URL}\\\"\"\r\n res = subprocess.check_output(cmd, shell=True)\r\n http_status = int(res)\r\n self.assertEqual(http_status, 200)\r\n\r\n\r\nif __name__ == '__main__':\r\n unittest.main()\r\n\r\n```", "TLDR; it was a security check; see ` 'Security Check' in res.text`" ]
https://api.github.com/repos/psf/requests/issues/6393
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6393/labels{/name}
https://api.github.com/repos/psf/requests/issues/6393/comments
https://api.github.com/repos/psf/requests/issues/6393/events
https://github.com/psf/requests/issues/6393
1,640,538,373
I_kwDOABTKOs5hyKEF
6,393
I need send a message and photo to the telegram in one message
{ "avatar_url": "https://avatars.githubusercontent.com/u/53192689?v=4", "events_url": "https://api.github.com/users/MYHMYH/events{/privacy}", "followers_url": "https://api.github.com/users/MYHMYH/followers", "following_url": "https://api.github.com/users/MYHMYH/following{/other_user}", "gists_url": "https://api.github.com/users/MYHMYH/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/MYHMYH", "id": 53192689, "login": "MYHMYH", "node_id": "MDQ6VXNlcjUzMTkyNjg5", "organizations_url": "https://api.github.com/users/MYHMYH/orgs", "received_events_url": "https://api.github.com/users/MYHMYH/received_events", "repos_url": "https://api.github.com/users/MYHMYH/repos", "site_admin": false, "starred_url": "https://api.github.com/users/MYHMYH/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/MYHMYH/subscriptions", "type": "User", "url": "https://api.github.com/users/MYHMYH", "user_view_type": "public" }
[]
closed
true
null
[]
null
0
2023-03-25T14:29:10Z
2024-03-26T00:03:17Z
2023-03-25T15:58:38Z
NONE
resolved
Please refer to our [Stack Overflow tag](https://stackoverflow.com/questions/tagged/python-requests) for guidance.
{ "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/6393/reactions" }
https://api.github.com/repos/psf/requests/issues/6393/timeline
null
completed
null
null
false
[]
https://api.github.com/repos/psf/requests/issues/6392
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6392/labels{/name}
https://api.github.com/repos/psf/requests/issues/6392/comments
https://api.github.com/repos/psf/requests/issues/6392/events
https://github.com/psf/requests/issues/6392
1,639,962,979
I_kwDOABTKOs5hv9lj
6,392
requests prepare_request Valid on MacOS but not on Linux
{ "avatar_url": "https://avatars.githubusercontent.com/u/48439183?v=4", "events_url": "https://api.github.com/users/ssrsec/events{/privacy}", "followers_url": "https://api.github.com/users/ssrsec/followers", "following_url": "https://api.github.com/users/ssrsec/following{/other_user}", "gists_url": "https://api.github.com/users/ssrsec/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/ssrsec", "id": 48439183, "login": "ssrsec", "node_id": "MDQ6VXNlcjQ4NDM5MTgz", "organizations_url": "https://api.github.com/users/ssrsec/orgs", "received_events_url": "https://api.github.com/users/ssrsec/received_events", "repos_url": "https://api.github.com/users/ssrsec/repos", "site_admin": false, "starred_url": "https://api.github.com/users/ssrsec/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/ssrsec/subscriptions", "type": "User", "url": "https://api.github.com/users/ssrsec", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2023-03-24T19:59:56Z
2024-03-28T00:03:42Z
2023-03-28T13:23:01Z
NONE
resolved
I referred to https://github.com/psf/requests/issues/6385 , using PrepareRequest workflow to implement the method of retaining original characters in urls The following code, which I run on my local MacOS, actually sends a URL of ' http://example.com/?unix:abc | http://127.0.0.1/ ', but when I ran it on Linux, the actual URL changed to' http://example.com/?unix:abc%7Chttp://127.0.0.1/ ', I checked that the versions of the requests library are the same, they are all 2.28.2. Why ``` import requests s = requests.Session() prepped = s.prepare_request(requests.Request('POST', 'http://example.com/', data={"a":"1"}, headers={'User-Agent':'test'})) prepped.url = 'http://example.com/?unix:abc|http://127.0.0.1/' res = s.send(prepped,proxies={'http': '127.0.0.1:8080', 'https': '127.0.0.1:8080'}) ``` <img width="502" alt="image" src="https://user-images.githubusercontent.com/48439183/227627197-01ef12d5-2a25-411c-8a60-f3aa714c7369.png">
{ "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/6392/reactions" }
https://api.github.com/repos/psf/requests/issues/6392/timeline
null
not_planned
null
null
false
[ "I have found the reason. Requests rely on urllib3 to process urls. urllib3=1.22 can meet my requirements, but the new version won't work. Therefore, when using the new version of urllib3, it is still necessary for me to https://github.com/psf/requests/issues/6385 Suggestions", "If it's necessary for you to use a pipe like that unencoded something you're interacting with isn't a well implemented server that respects how it should behave. Requests can only give you so much ability to do the wrong thing. At this point requests has no way to prevent urllib3 from also doing the right thing (nor do we really want to prevent it from doing the right thing)." ]
https://api.github.com/repos/psf/requests/issues/6391
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6391/labels{/name}
https://api.github.com/repos/psf/requests/issues/6391/comments
https://api.github.com/repos/psf/requests/issues/6391/events
https://github.com/psf/requests/issues/6391
1,639,735,708
I_kwDOABTKOs5hvGGc
6,391
Requests + Asyncio
{ "avatar_url": "https://avatars.githubusercontent.com/u/13957883?v=4", "events_url": "https://api.github.com/users/dorg188/events{/privacy}", "followers_url": "https://api.github.com/users/dorg188/followers", "following_url": "https://api.github.com/users/dorg188/following{/other_user}", "gists_url": "https://api.github.com/users/dorg188/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/dorg188", "id": 13957883, "login": "dorg188", "node_id": "MDQ6VXNlcjEzOTU3ODgz", "organizations_url": "https://api.github.com/users/dorg188/orgs", "received_events_url": "https://api.github.com/users/dorg188/received_events", "repos_url": "https://api.github.com/users/dorg188/repos", "site_admin": false, "starred_url": "https://api.github.com/users/dorg188/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/dorg188/subscriptions", "type": "User", "url": "https://api.github.com/users/dorg188", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2023-03-24T16:55:57Z
2024-03-26T00:03:19Z
2023-03-24T17:30:54Z
NONE
resolved
Isn't it about time? Please don't make me use aiohttp, it sucks so much...
{ "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/6391/reactions" }
https://api.github.com/repos/psf/requests/issues/6391/timeline
null
not_planned
null
null
false
[ "In the future, please search **closed and** open issues before creating new ones that are duplicates." ]
https://api.github.com/repos/psf/requests/issues/6390
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6390/labels{/name}
https://api.github.com/repos/psf/requests/issues/6390/comments
https://api.github.com/repos/psf/requests/issues/6390/events
https://github.com/psf/requests/issues/6390
1,639,399,837
I_kwDOABTKOs5ht0Gd
6,390
Strange behavior of requests, adding newlines and commas
{ "avatar_url": "https://avatars.githubusercontent.com/u/1096270?v=4", "events_url": "https://api.github.com/users/ignition42/events{/privacy}", "followers_url": "https://api.github.com/users/ignition42/followers", "following_url": "https://api.github.com/users/ignition42/following{/other_user}", "gists_url": "https://api.github.com/users/ignition42/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/ignition42", "id": 1096270, "login": "ignition42", "node_id": "MDQ6VXNlcjEwOTYyNzA=", "organizations_url": "https://api.github.com/users/ignition42/orgs", "received_events_url": "https://api.github.com/users/ignition42/received_events", "repos_url": "https://api.github.com/users/ignition42/repos", "site_admin": false, "starred_url": "https://api.github.com/users/ignition42/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/ignition42/subscriptions", "type": "User", "url": "https://api.github.com/users/ignition42", "user_view_type": "public" }
[]
closed
true
null
[]
null
5
2023-03-24T13:30:30Z
2024-04-07T00:03:33Z
2023-04-06T21:04:41Z
NONE
resolved
When making a request using `requests` library and passing params as an argument, it URL encodes the parameters leaving the query part of the URL like so: `https://rest.uniprot.org/uniprotkb/search?query=%28ec%3A%2A%29&size=500&format=json&cursor=i6v0ks5l9w7z9bvjh2h9riak0edmthh17oyjd2k0` This shouldn't be a problem and if you query using `curl`, `wget` or even the web browser, you get the json file as normal. Even with different **cursor** parameter with `requests` is not a problem either. But with this specific cursor the content is splitted in 500 lines (due to the size parameter I guess) with a newline plus a comma, making json parse impossible. ## Expected Result I expect the contents in a single line without adding newlines or commas ## Actual Result The content is splitted in 500 lines (due to the size parameter I guess) with a newline plus a comma, making json parse impossible. ## Reproduction Steps I don't know for how long these cursors are going to work. I have only found this cursor to not work properly. With this code can be seen: ```python import requests params = { 'query': '(ec:*)', 'size': 500, 'format': 'json', 'cursor': 'i6v0ks5l9w7z9bvjh2h9riak0edmthh17oyjd2k0' } response = requests.get('https://rest.uniprot.org/uniprotkb/search', params) response.text[12865:12885] # >>> 'UPI0000099733"}},\n,{' response.text.count(',\n,') # >>> 499 ``` This cursor doesn't present the same problem: _i6v1q9nglzhbl5g7sq9l9fvt8n5crpjx8gxbio1d_ ```python import requests params = { 'query': '(ec:*)', 'size': 500, 'format': 'json', 'cursor': 'i6v1q9nglzhbl5g7sq9l9fvt8n5crpjx8gxbio1d' } response = requests.get('https://rest.uniprot.org/uniprotkb/search', params) response.text.count(',\n,') # >>> 0 ``` `urllib.request` doesn't have this problem either: ```python import urllib.request url = 'https://rest.uniprot.org/uniprotkb/search?query=%28ec%3A%2A%29&size=500&format=json&cursor=i6v0ks5l9w7z9bvjh2h9riak0edmthh17oyjd2k0' r = urllib.request.urlopen(url) content = r.read() text = content.decode('utf-8') text[12865:12885] # >>> 'UPI0000099733"}},{"e' r.close() ``` And if you pass the query directly in the url, requests will not http encode it, and the problem is not present: ```python import requests params = { 'size': 500, 'format': 'json', 'cursor': 'i6v0ks5l9w7z9bvjh2h9riak0edmthh17oyjd2k0' } response = requests.get('https://rest.uniprot.org/uniprotkb/search?query=(ec:*)', params) response.text[12865:12885] # >>> 'UPI0000099733"}},\n,{' response.text.count(',\n,') # >>> 499 ``` ## System Information $ python -m requests.help ```json { "chardet": { "version": "4.0.0" }, "charset_normalizer": { "version": "3.0.1" }, "cryptography": { "version": "" }, "idna": { "version": "3.4" }, "implementation": { "name": "CPython", "version": "3.10.6" }, "platform": { "release": "5.19.0-35-generic", "system": "Linux" }, "pyOpenSSL": { "openssl_version": "", "version": null }, "requests": { "version": "2.28.2" }, "system_ssl": { "version": "30000020" }, "urllib3": { "version": "1.26.14" }, "using_charset_normalizer": false, "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/6390/reactions" }
https://api.github.com/repos/psf/requests/issues/6390/timeline
null
not_planned
null
null
false
[ "Requests doesn't alter response bodies at all. The behaviour you're observing is happening on the server side. If you check other metadata like the content-length header you'll be able to confirm the for yourself", "Maybe, but there is no Content-Length on the headers, probably because Content-Encoding is gzip. But I can test the following:\r\n\r\n```python\r\n# test.py\r\nimport gzip\r\nimport urllib.request\r\nimport requests\r\n\r\nurl = 'https://rest.uniprot.org/uniprotkb/search?query=%28ec%3A%2A%29&size=500&format=json&cursor=i6v0ks5l9w7z9bvjh2h9riak0edmthh17oyjd2k0'\r\nresponse = requests.get(url)\r\nwith open('requests.json', 'w') as f:\r\n f.write(response.text)\r\n\r\nwith urllib.request.urlopen(url) as r:\r\n with open('urllib.json', 'wb') as f:\r\n f.write(r.read())\r\n\r\nwith requests.get(url, stream=True) as r:\r\n with open('requests_gzip.json', 'wb') as f:\r\n with gzip.open(r.raw) as g:\r\n f.write(g.read())\r\n```\r\n\r\nAnd on the terminal:\r\n```bash\r\npython test.py\r\nwget 'https://rest.uniprot.org/uniprotkb/search?query=%28ec%3A%2A%29&size=500&format=json&cursor=i6v0ks5l9w7z9bvjh2h9riak0edmthh17oyjd2k0' -O wget.json\r\ncurl 'https://rest.uniprot.org/uniprotkb/search?query=%28ec%3A%2A%29&size=500&format=json&cursor=i6v0ks5l9w7z9bvjh2h9riak0edmthh17oyjd2k0' > curl.json\r\nsha256sum wget.json \r\n> e2afb55fcc54de947fe655dc9a246e46d64bad6bfaf55f19b99f30413d23f07b wget.json\r\nsha256sum curl.json \r\n> e2afb55fcc54de947fe655dc9a246e46d64bad6bfaf55f19b99f30413d23f07b curl.json\r\nsha256sum urllib.json \r\n> e2afb55fcc54de947fe655dc9a246e46d64bad6bfaf55f19b99f30413d23f07b urllib.json\r\nsha256sum requests.json \r\n> 886d788b3d219ad9fa23fa43787277511aa5e8e888bbca0d07dbb6eee5ca2f49 requests.json\r\nsha256sum requests_gzip.json \r\n> 886d788b3d219ad9fa23fa43787277511aa5e8e888bbca0d07dbb6eee5ca2f49 requests_gzip.json\r\n```\r\n\r\nEdit: I added the `gzip` version and it seems strange that gives the unexpected result with the newlines. I don't know what `wget`, `curl`, and `urllib` are doing in order to get the expected result.", "```py\r\n#!/usr/bin/env python3\r\nimport requests\r\n\r\nparams = {\r\n 'query': '(ec:*)',\r\n 'size': 500,\r\n 'format': 'json',\r\n 'cursor': 'i6v0ks5l9w7z9bvjh2h9riak0edmthh17oyjd2k0'\r\n}\r\n\r\na = requests.get('https://rest.uniprot.org/uniprotkb/search', params)\r\na.text[12865:12885]\r\n\r\na.text.count(',\\n')\r\nwith open('requests.json', 'w') as f:\r\n f.write(a.text)\r\nprint(a.text)\r\n```\r\n\r\n\r\n\r\n```bash\r\npc@gpuslave:~/Documents/rq$ sha3sum curl.json \r\n597e92de5bc3631af24039ad74d64db09a1927e88a240e2359bea8d3 curl.json\r\npc@gpuslave:~/Documents/rq$ sha3sum requests.json \r\n597e92de5bc3631af24039ad74d64db09a1927e88a240e2359bea8d3 requests.json\r\n```\r\nI don't know what I changed but it produces the same sha3sum for me.", "> Maybe, but there is no Content-Length on the headers, probably because Content-Encoding is gzip. But I can test the following:\n> \n> ```python\n> # test.py\n> import gzip\n> import urllib.request\n> import requests\n> \n> url = 'https://rest.uniprot.org/uniprotkb/search?query=%28ec%3A%2A%29&size=500&format=json&cursor=i6v0ks5l9w7z9bvjh2h9riak0edmthh17oyjd2k0'\n> response = requests.get(url)\n> with open('requests.json', 'w') as f:\n> f.write(response.text)\n> \n> with urllib.request.urlopen(url) as r:\n> with open('urllib.json', 'wb') as f:\n> f.write(r.read())\n> \n> with requests.get(url, stream=True) as r:\n> with open('requests_gzip.json', 'wb') as f:\n> with gzip.open(r.raw) as g:\n> f.write(g.read())\n> ```\n> \n> And on the terminal:\n> ```bash\n> python test.py\n> wget 'https://rest.uniprot.org/uniprotkb/search?query=%28ec%3A%2A%29&size=500&format=json&cursor=i6v0ks5l9w7z9bvjh2h9riak0edmthh17oyjd2k0' -O wget.json\n> curl 'https://rest.uniprot.org/uniprotkb/search?query=%28ec%3A%2A%29&size=500&format=json&cursor=i6v0ks5l9w7z9bvjh2h9riak0edmthh17oyjd2k0' > curl.json\n> sha256sum wget.json \n> > e2afb55fcc54de947fe655dc9a246e46d64bad6bfaf55f19b99f30413d23f07b wget.json\n> sha256sum curl.json \n> > e2afb55fcc54de947fe655dc9a246e46d64bad6bfaf55f19b99f30413d23f07b curl.json\n> sha256sum urllib.json \n> > e2afb55fcc54de947fe655dc9a246e46d64bad6bfaf55f19b99f30413d23f07b urllib.json\n> sha256sum requests.json \n> > 886d788b3d219ad9fa23fa43787277511aa5e8e888bbca0d07dbb6eee5ca2f49 requests.json\n> sha256sum requests_gzip.json \n> > 886d788b3d219ad9fa23fa43787277511aa5e8e888bbca0d07dbb6eee5ca2f49 requests_gzip.json\n> ```\n> \n> Edit: I added the `gzip` version and it seems strange that gives the unexpected result with the newlines. I don't know what `wget`, `curl`, and `urllib` are doing in order to get the expected result.\n\nThe gzip version shows that this is happening on the server side. The server is responding in a way that creates this behavior. This isn't a bug in requests. You can have requests only accept non-gzip compression encoding by specifying the Accept-Encoding header yourself if you feel that's the issue, but requests isn't generating the response body and you got the raw data directly with the same problem. ", "@sigmavirus24 Indeed, I agree. Thanks for the idea to specify json in the Accept-Encoding. I think it could have worked and I didn't think of it myself. Now it's too late though, the response is returning non-gzip already by default, maybe they realized of the problem and it looks it was related to the compression mechanism, because the problem vanished. Or not because I specified gzip as Accept-Encoding, forcing the server to return the content gzipped, and to my surprise the problem is not present either.\r\n\r\nSo @PwnedDev, now I'm not able to reproduce the error anymore either." ]
https://api.github.com/repos/psf/requests/issues/6389
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6389/labels{/name}
https://api.github.com/repos/psf/requests/issues/6389/comments
https://api.github.com/repos/psf/requests/issues/6389/events
https://github.com/psf/requests/pull/6389
1,638,424,401
PR_kwDOABTKOs5MyGG0
6,389
Corrected copyright roman numeral in footer
{ "avatar_url": "https://avatars.githubusercontent.com/u/77130613?v=4", "events_url": "https://api.github.com/users/trag1c/events{/privacy}", "followers_url": "https://api.github.com/users/trag1c/followers", "following_url": "https://api.github.com/users/trag1c/following{/other_user}", "gists_url": "https://api.github.com/users/trag1c/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/trag1c", "id": 77130613, "login": "trag1c", "node_id": "MDQ6VXNlcjc3MTMwNjEz", "organizations_url": "https://api.github.com/users/trag1c/orgs", "received_events_url": "https://api.github.com/users/trag1c/received_events", "repos_url": "https://api.github.com/users/trag1c/repos", "site_admin": false, "starred_url": "https://api.github.com/users/trag1c/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/trag1c/subscriptions", "type": "User", "url": "https://api.github.com/users/trag1c", "user_view_type": "public" }
[]
closed
true
null
[]
null
0
2023-03-23T22:22:33Z
2024-05-22T00:03:26Z
2023-05-22T01:09:36Z
NONE
resolved
I'm quite convinced the current one (`MMXVIX`) is invalid, or at the very least, ambiguous (online converters say it's either 2014, 2024, or invalid). I made this change assuming it was supposed to mean 2014.
{ "avatar_url": "https://avatars.githubusercontent.com/u/77130613?v=4", "events_url": "https://api.github.com/users/trag1c/events{/privacy}", "followers_url": "https://api.github.com/users/trag1c/followers", "following_url": "https://api.github.com/users/trag1c/following{/other_user}", "gists_url": "https://api.github.com/users/trag1c/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/trag1c", "id": 77130613, "login": "trag1c", "node_id": "MDQ6VXNlcjc3MTMwNjEz", "organizations_url": "https://api.github.com/users/trag1c/orgs", "received_events_url": "https://api.github.com/users/trag1c/received_events", "repos_url": "https://api.github.com/users/trag1c/repos", "site_admin": false, "starred_url": "https://api.github.com/users/trag1c/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/trag1c/subscriptions", "type": "User", "url": "https://api.github.com/users/trag1c", "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/6389/reactions" }
https://api.github.com/repos/psf/requests/issues/6389/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/6389.diff", "html_url": "https://github.com/psf/requests/pull/6389", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/6389.patch", "url": "https://api.github.com/repos/psf/requests/pulls/6389" }
true
[]
https://api.github.com/repos/psf/requests/issues/6388
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6388/labels{/name}
https://api.github.com/repos/psf/requests/issues/6388/comments
https://api.github.com/repos/psf/requests/issues/6388/events
https://github.com/psf/requests/pull/6388
1,636,884,109
PR_kwDOABTKOs5Ms4tZ
6,388
Document that a Response is a context manager
{ "avatar_url": "https://avatars.githubusercontent.com/u/365236?v=4", "events_url": "https://api.github.com/users/Hawk777/events{/privacy}", "followers_url": "https://api.github.com/users/Hawk777/followers", "following_url": "https://api.github.com/users/Hawk777/following{/other_user}", "gists_url": "https://api.github.com/users/Hawk777/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Hawk777", "id": 365236, "login": "Hawk777", "node_id": "MDQ6VXNlcjM2NTIzNg==", "organizations_url": "https://api.github.com/users/Hawk777/orgs", "received_events_url": "https://api.github.com/users/Hawk777/received_events", "repos_url": "https://api.github.com/users/Hawk777/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Hawk777/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Hawk777/subscriptions", "type": "User", "url": "https://api.github.com/users/Hawk777", "user_view_type": "public" }
[]
open
false
null
[]
null
0
2023-03-23T05:37:45Z
2023-03-23T05:37:45Z
null
NONE
null
This is mentioned in the Advanced Usage page, but not in the API reference. It is mentioned in the API reference for `Session`, so it seems reasonable that it should be mentioned for `Response` as well. It looks like this capability was added in GH-4137, which made the change to the former documentation but not the latter.
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/6388/reactions" }
https://api.github.com/repos/psf/requests/issues/6388/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/6388.diff", "html_url": "https://github.com/psf/requests/pull/6388", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/6388.patch", "url": "https://api.github.com/repos/psf/requests/pulls/6388" }
true
[]
https://api.github.com/repos/psf/requests/issues/6387
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6387/labels{/name}
https://api.github.com/repos/psf/requests/issues/6387/comments
https://api.github.com/repos/psf/requests/issues/6387/events
https://github.com/psf/requests/pull/6387
1,635,703,544
PR_kwDOABTKOs5Mo9Hh
6,387
docs: Remove non needed spacing
{ "avatar_url": "https://avatars.githubusercontent.com/u/72306953?v=4", "events_url": "https://api.github.com/users/albertocerrone/events{/privacy}", "followers_url": "https://api.github.com/users/albertocerrone/followers", "following_url": "https://api.github.com/users/albertocerrone/following{/other_user}", "gists_url": "https://api.github.com/users/albertocerrone/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/albertocerrone", "id": 72306953, "login": "albertocerrone", "node_id": "MDQ6VXNlcjcyMzA2OTUz", "organizations_url": "https://api.github.com/users/albertocerrone/orgs", "received_events_url": "https://api.github.com/users/albertocerrone/received_events", "repos_url": "https://api.github.com/users/albertocerrone/repos", "site_admin": false, "starred_url": "https://api.github.com/users/albertocerrone/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/albertocerrone/subscriptions", "type": "User", "url": "https://api.github.com/users/albertocerrone", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2023-03-22T12:47:54Z
2024-03-22T00:03:15Z
2023-03-22T17:06:00Z
NONE
resolved
I'm sorry for my OCD 😅 There is some extra spacing. This doesn't match the spacing of the badge `downloads/month` ![image](https://user-images.githubusercontent.com/72306953/226908616-73cdf003-4d45-4199-a8c4-0731b9e0a551.png)
{ "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/6387/reactions" }
https://api.github.com/repos/psf/requests/issues/6387/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/6387.diff", "html_url": "https://github.com/psf/requests/pull/6387", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/6387.patch", "url": "https://api.github.com/repos/psf/requests/pulls/6387" }
true
[ "We don't accept cosmetic changes. Thanks for sending this" ]
https://api.github.com/repos/psf/requests/issues/6386
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6386/labels{/name}
https://api.github.com/repos/psf/requests/issues/6386/comments
https://api.github.com/repos/psf/requests/issues/6386/events
https://github.com/psf/requests/issues/6386
1,634,823,621
I_kwDOABTKOs5hcW3F
6,386
charset_normalizer Warning Filter added by requests.packages.py breaks mysql connector's ability to issue DB warnings using warnings.warn()
{ "avatar_url": "https://avatars.githubusercontent.com/u/32966025?v=4", "events_url": "https://api.github.com/users/bthom1/events{/privacy}", "followers_url": "https://api.github.com/users/bthom1/followers", "following_url": "https://api.github.com/users/bthom1/following{/other_user}", "gists_url": "https://api.github.com/users/bthom1/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/bthom1", "id": 32966025, "login": "bthom1", "node_id": "MDQ6VXNlcjMyOTY2MDI1", "organizations_url": "https://api.github.com/users/bthom1/orgs", "received_events_url": "https://api.github.com/users/bthom1/received_events", "repos_url": "https://api.github.com/users/bthom1/repos", "site_admin": false, "starred_url": "https://api.github.com/users/bthom1/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/bthom1/subscriptions", "type": "User", "url": "https://api.github.com/users/bthom1", "user_view_type": "public" }
[]
closed
true
null
[]
null
4
2023-03-21T23:13:47Z
2024-03-23T00:03:17Z
2023-03-22T17:02:36Z
NONE
resolved
The mysql connector encounters the following exception when trying to issue DB warnings via `warnings.warn()` due to the warnings.filter() added by the requests.packages.py module. This occurs when chardet is not installed and importing both mysql-connector-python and requests, where mysql connector is not using the C extension. When mysql connector tries to issue a DB warning `TypeError: expected string or bytes-like object DB warnings ` when requests adds this Warning Filter In requests.packages.py ``` try: import chardet except ImportError: import warnings import charset_normalizer as chardet warnings.filterwarnings("ignore", "Trying to detect", module="charset_normalizer") ``` ## Expected Result requests does not insert Warning Filters that impact the ability of other libraries to execute warnings.warn(). Specifically mysql connector can issue DB warnings without error. ## Actual Result When the following code from mysql-connector-python cursor.py is executed, the following error is encountered `TypeError: expected string or bytes-like object DB warnings ` ## Reproduction Steps ```import warnings import mysql.connector def simulate_db_warning(): # This is the code that is called inside mysql connector when a DB warning is issued # see mysql.connector.cursor _handle_warnings err = mysql.connector.cursor.get_mysql_exception(1062, "Test DB warning", warning=True) print(f"type(err): {type(err)}") print(f"err: {err}") warnings.warn(err, stacklevel=4) print("Test before import requests") simulate_db_warning() # succeeds import requests print("\nTest after import requests") simulate_db_warning() # TypeError ``` ## System Information note: mysql-connector-python==8.0.32 $ python -m requests.help ```json { "chardet": { "version": null }, "charset_normalizer": { "version": "3.1.0" }, "cryptography": { "version": "" }, "idna": { "version": "3.4" }, "implementation": { "name": "CPython", "version": "3.8.12" }, "platform": { "release": "21.6.0", "system": "Darwin" }, "pyOpenSSL": { "openssl_version": "", "version": null }, "requests": { "version": "2.28.2" }, "system_ssl": { "version": "101010ff" }, "urllib3": { "version": "1.26.15" }, "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/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/6386/reactions" }
https://api.github.com/repos/psf/requests/issues/6386/timeline
null
not_planned
null
null
false
[ "Please provide the full stack trace ", "> Please provide the full stack trace\r\n\r\n@sigmavirus24 I've added output with stacktrace to Actual Results above.\r\n\r\nAlso I've found a simpler way to illustrate the issue...\r\n\r\n```\r\n❯ python3\r\nPython 3.8.5 (v3.8.5:580fbb018f, Jul 20 2020, 12:11:27)\r\n[Clang 6.0 (clang-600.0.57)] on darwin\r\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\r\n>>> import warnings\r\n>>> e = Exception()\r\n>>>\r\n>>> # this works when passed an Exception, similar to how mysql issues warnings \r\n>>> warnings.warn(e, stacklevel=4)\r\nsys:1: UserWarning:\r\n>>>\r\n>>> # simulate the filter added by importing requests.packages.py module\r\n>>> # now warnings.warn() raises TypeError when passed an Exception\r\n>>> warnings.filterwarnings(\"ignore\", \"Trying to detect\", module=\"charset_normalizer\")\r\n>>> warnings.warn(e, stacklevel=4)\r\nTraceback (most recent call last):\r\n File \"<stdin>\", line 1, in <module>\r\nTypeError: expected string or bytes-like object\r\n>>> quit()\r\n\r\n```\r\n", "What you've shown is that the MySQL library you're using is doing the wrong thing. Exceptions shouldn't be sent to the warnings module as the message. The first parameter is always a string message and the second is a warning class (which inherits from Exception). \n\nThis is all well documented in the standard library. Filtering warnings is common and causes no issues for libraries using the warnings module correctly. We can't adjust things just because people may do something incorrectly elsewhere ", "@sigmavirus24 Thanks for the follow up.\r\n\r\nI'm not very familiar with the warnings module. I looked at the docs and unless I'm misunderstanding, the message arg to warnings.warn() can be a Warning instance (which inherits from Exception).\r\n\r\nfrom: https://docs.python.org/3/library/warnings.html#warnings.warn\r\n\r\n> warnings.**warn**(message, category=None, stacklevel=1, source=None)\r\n\r\n> Issue a warning, or maybe ignore it or raise an exception. The category argument, if given, must be a [warning category \r\n class](https://docs.python.org/3/library/warnings.html#warning-categories); it defaults to [UserWarning](https://docs.python.org/3/library/exceptions.html#UserWarning). Alternatively, message can be a [Warning](https://docs.python.org/3/library/exceptions.html#Warning) instance, in which case category will be ignored and message.__class__ will be used. In this case, the message text will be str(message).\r\n\r\nIf the message arg to warnings.warn() can be a Warning instance, and mysql is passing a Warning instance to warn(), then can you help me understand exactly what the MySQL library is doing wrong so that I can be clear in filing a bug with the MySQL python library? " ]
https://api.github.com/repos/psf/requests/issues/6385
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6385/labels{/name}
https://api.github.com/repos/psf/requests/issues/6385/comments
https://api.github.com/repos/psf/requests/issues/6385/events
https://github.com/psf/requests/issues/6385
1,634,430,402
I_kwDOABTKOs5ha23C
6,385
Can choose whether to perform automatic url encoding and decoding
{ "avatar_url": "https://avatars.githubusercontent.com/u/48439183?v=4", "events_url": "https://api.github.com/users/ssrsec/events{/privacy}", "followers_url": "https://api.github.com/users/ssrsec/followers", "following_url": "https://api.github.com/users/ssrsec/following{/other_user}", "gists_url": "https://api.github.com/users/ssrsec/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/ssrsec", "id": 48439183, "login": "ssrsec", "node_id": "MDQ6VXNlcjQ4NDM5MTgz", "organizations_url": "https://api.github.com/users/ssrsec/orgs", "received_events_url": "https://api.github.com/users/ssrsec/received_events", "repos_url": "https://api.github.com/users/ssrsec/repos", "site_admin": false, "starred_url": "https://api.github.com/users/ssrsec/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/ssrsec/subscriptions", "type": "User", "url": "https://api.github.com/users/ssrsec", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2023-03-21T17:45:27Z
2024-03-26T00:03:18Z
2023-03-21T21:47:55Z
NONE
resolved
When I request with get, the content in the url will be automatically encoded or decoded or some other processing will be performed Here are two examples: [Example 1] My real need is to send ' http://examole.com/1.jsp ;? Id=1 ', but in this example, the'; 'in the url Will be automatically ignored ``` import requests url = ' http://examole.com/1.jsp ;? id=1' res = requests.get(url, proxies={'http': '127.0.0.1:8080', 'https': '127.0.0.1:8080'}) ``` When I try to manually encode the url first, the actual request becomes' http://examole.com/1.jsp%3b%3fid%3d1 ' ``` url = ' http://examole.com/%31%2e%6a%73%70%3b%3f%69%64%3d%31 ' res = requests.get(url, proxies={'http': '127.0.0.1:8080', 'https': '127.0.0.1:8080'}) ``` [Example 2] My real need is to send ' http://examole.com/1.jsp?id=1 |Tid=2 ', in this example,' | 'will be encoded as'% 7C' ``` import requests url = ' http://examole.com/1.jsp?id=1 |tid=2' res = requests.get(url, proxies={'http': '127.0.0.1:8080', 'https': '127.0.0.1:8080'}) ``` When I try to manually encode the url first, the actual request becomes' http://examole.com/1.jsp%3fid%3d1%7ctid%3d2 ' ``` url = ' http://examole.com/%31%2e%6a%73%70%3f%69%64%3d%31%7c%74%69%64%3d%32 ' res = requests.get(url, proxies={'http': '127.0.0.1:8080', 'https': '127.0.0.1:8080'}) ``` I cannot modify the source code of requests because it will affect the functionality of other businesses. Therefore, I hope you can provide an optional parameter to determine whether to send the original URL request. For example: ``` res = requests.get(url, no_encode=False,proxies={'http': '127.0.0.1:8080', 'https': '127.0.0.1:8080'}) ``` When no_ The default value of encode is True, which has the same effect as the current version. If no_ Encode=False, then the original url is sent without any processing.
{ "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/6385/reactions" }
https://api.github.com/repos/psf/requests/issues/6385/timeline
null
completed
null
null
false
[ "Hi @heikanet, this is already possible with the PrepareRequest workflow described in our docs.\n\nhttps://docs.python-requests.org/en/latest/user/advanced/#prepared-requests" ]
https://api.github.com/repos/psf/requests/issues/6384
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6384/labels{/name}
https://api.github.com/repos/psf/requests/issues/6384/comments
https://api.github.com/repos/psf/requests/issues/6384/events
https://github.com/psf/requests/issues/6384
1,634,090,276
I_kwDOABTKOs5hZj0k
6,384
requests chardet and charset dependency causing import issue in huggingface library
{ "avatar_url": "https://avatars.githubusercontent.com/u/9413090?v=4", "events_url": "https://api.github.com/users/ani0075saha/events{/privacy}", "followers_url": "https://api.github.com/users/ani0075saha/followers", "following_url": "https://api.github.com/users/ani0075saha/following{/other_user}", "gists_url": "https://api.github.com/users/ani0075saha/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/ani0075saha", "id": 9413090, "login": "ani0075saha", "node_id": "MDQ6VXNlcjk0MTMwOTA=", "organizations_url": "https://api.github.com/users/ani0075saha/orgs", "received_events_url": "https://api.github.com/users/ani0075saha/received_events", "repos_url": "https://api.github.com/users/ani0075saha/repos", "site_admin": false, "starred_url": "https://api.github.com/users/ani0075saha/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/ani0075saha/subscriptions", "type": "User", "url": "https://api.github.com/users/ani0075saha", "user_view_type": "public" }
[]
closed
true
null
[]
null
3
2023-03-21T14:48:17Z
2023-06-29T13:59:00Z
2023-03-22T01:23:42Z
NONE
null
requests chardet and charset dependency causing import issue in huggingface library ## Expected Result no import error ## Actual Result ```code >>> from requests import HTTPError Traceback (most recent call last): File "/<redacted>/anaconda3/envs/huggingface-bug-test/lib/python3.9/site-packages/requests/compat.py", line 11, in <module> import chardet ModuleNotFoundError: No module named 'chardet' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/<redacted>/anaconda3/envs/huggingface-bug-test/lib/python3.9/site-packages/requests/__init__.py", line 45, in <module> from .exceptions import RequestsDependencyWarning File "/<redacted>/anaconda3/envs/huggingface-bug-test/lib/python3.9/site-packages/requests/exceptions.py", line 9, in <module> from .compat import JSONDecodeError as CompatJSONDecodeError File "/<redacted>/anaconda3/envs/huggingface-bug-test/lib/python3.9/site-packages/requests/compat.py", line 13, in <module> import charset_normalizer as chardet File "/<redacted>/anaconda3/envs/huggingface-bug-test/lib/python3.9/site-packages/charset_normalizer/__init__.py", line 23, in <module> from charset_normalizer.api import from_fp, from_path, from_bytes, normalize File "/<redacted>/anaconda3/envs/huggingface-bug-test/lib/python3.9/site-packages/charset_normalizer/api.py", line 10, in <module> from charset_normalizer.md import mess_ratio File "charset_normalizer/md.py", line 5, in <module> ImportError: cannot import name 'COMMON_SAFE_ASCII_CHARACTERS' from 'charset_normalizer.constant' (/<redacted>/anaconda3/envs/huggingface-bug-test/lib/python3.9/site-packages/charset_normalizer/constant.py) ``` ```code >>> from requests import Response Traceback (most recent call last): File "/<redacted>/anaconda3/envs/huggingface-bug-test/lib/python3.9/site-packages/requests/compat.py", line 11, in <module> import chardet ModuleNotFoundError: No module named 'chardet' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/<redacted>/anaconda3/envs/huggingface-bug-test/lib/python3.9/site-packages/requests/__init__.py", line 45, in <module> from .exceptions import RequestsDependencyWarning File "/<redacted>/anaconda3/envs/huggingface-bug-test/lib/python3.9/site-packages/requests/exceptions.py", line 9, in <module> from .compat import JSONDecodeError as CompatJSONDecodeError File "/<redacted>/anaconda3/envs/huggingface-bug-test/lib/python3.9/site-packages/requests/compat.py", line 13, in <module> import charset_normalizer as chardet File "/<redacted>/anaconda3/envs/huggingface-bug-test/lib/python3.9/site-packages/charset_normalizer/__init__.py", line 23, in <module> from charset_normalizer.api import from_fp, from_path, from_bytes, normalize File "/<redacted>/anaconda3/envs/huggingface-bug-test/lib/python3.9/site-packages/charset_normalizer/api.py", line 10, in <module> from charset_normalizer.md import mess_ratio AttributeError: partially initialized module 'charset_normalizer' has no attribute 'md__mypyc' (most likely due to a circular import) ``` ## Reproduction Steps ```python from requests import Response from requests import HTTPError ``` ## System Information $ python -m requests.help doesn't work if chardet not installed ``` (huggingface-bug-test) anisaha1:~$ python -m requests.help Traceback (most recent call last): File "/<redacted>/anaconda3/envs/huggingface-bug-test/lib/python3.9/site-packages/requests/compat.py", line 11, in <module> import chardet ModuleNotFoundError: No module named 'chardet' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/<redacted>/anaconda3/envs/huggingface-bug-test/lib/python3.9/runpy.py", line 188, in _run_module_as_main mod_name, mod_spec, code = _get_module_details(mod_name, _Error) File "/<redacted>/anaconda3/envs/huggingface-bug-test/lib/python3.9/runpy.py", line 111, in _get_module_details __import__(pkg_name) File "/<redacted>/anaconda3/envs/huggingface-bug-test/lib/python3.9/site-packages/requests/__init__.py", line 45, in <module> from .exceptions import RequestsDependencyWarning File "/<redacted>/anaconda3/envs/huggingface-bug-test/lib/python3.9/site-packages/requests/exceptions.py", line 9, in <module> from .compat import JSONDecodeError as CompatJSONDecodeError File "/<redacted>/anaconda3/envs/huggingface-bug-test/lib/python3.9/site-packages/requests/compat.py", line 13, in <module> import charset_normalizer as chardet File "/<redacted>/anaconda3/envs/huggingface-bug-test/lib/python3.9/site-packages/charset_normalizer/__init__.py", line 23, in <module> from charset_normalizer.api import from_fp, from_path, from_bytes, normalize File "/<redacted>/anaconda3/envs/huggingface-bug-test/lib/python3.9/site-packages/charset_normalizer/api.py", line 10, in <module> from charset_normalizer.md import mess_ratio File "charset_normalizer/md.py", line 5, in <module> ImportError: cannot import name 'COMMON_SAFE_ASCII_CHARACTERS' from 'charset_normalizer.constant' (/<redacted>/anaconda3/envs/huggingface-bug-test/lib/python3.9/site-packages/charset_normalizer/constant.py) ``` pasting info from another environment which has chardet installed ```json { "chardet": { "version": "4.0.0" }, "charset_normalizer": { "version": "2.0.4" }, "cryptography": { "version": "37.0.1" }, "idna": { "version": "3.3" }, "implementation": { "name": "CPython", "version": "3.9.13" }, "platform": { "release": "4.18.0-425.13.1.el8_7.x86_64", "system": "Linux" }, "pyOpenSSL": { "openssl_version": "101010ef", "version": "22.0.0" }, "requests": { "version": "2.28.1" }, "system_ssl": { "version": "1010111f" }, "urllib3": { "version": "1.26.11" }, "using_charset_normalizer": false, "using_pyopenssl": true } ``` https://github.com/huggingface/transformers/issues/21858
{ "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/6384/reactions" }
https://api.github.com/repos/psf/requests/issues/6384/timeline
null
not_planned
null
null
false
[ "charset normalizer is its own project. We don't manage bugs for it. We literally just import the top level and it's not set up properly. Please ask them for support and to fix this. Also I cannot reproduce this. So there's something else in your dependencies likely creating this issue and from the other issue there are quite a lot", "For anybody finding this thread, see the issue https://github.com/Ousret/charset_normalizer/issues/253", "Updating `requests` and `charset_normalizer` to their latest version fixed the issue for me." ]
https://api.github.com/repos/psf/requests/issues/6383
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6383/labels{/name}
https://api.github.com/repos/psf/requests/issues/6383/comments
https://api.github.com/repos/psf/requests/issues/6383/events
https://github.com/psf/requests/pull/6383
1,631,149,287
PR_kwDOABTKOs5MZoZY
6,383
Clarify docs for multipart file uploads
{ "avatar_url": "https://avatars.githubusercontent.com/u/3236864?v=4", "events_url": "https://api.github.com/users/SyntaxColoring/events{/privacy}", "followers_url": "https://api.github.com/users/SyntaxColoring/followers", "following_url": "https://api.github.com/users/SyntaxColoring/following{/other_user}", "gists_url": "https://api.github.com/users/SyntaxColoring/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/SyntaxColoring", "id": 3236864, "login": "SyntaxColoring", "node_id": "MDQ6VXNlcjMyMzY4NjQ=", "organizations_url": "https://api.github.com/users/SyntaxColoring/orgs", "received_events_url": "https://api.github.com/users/SyntaxColoring/received_events", "repos_url": "https://api.github.com/users/SyntaxColoring/repos", "site_admin": false, "starred_url": "https://api.github.com/users/SyntaxColoring/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/SyntaxColoring/subscriptions", "type": "User", "url": "https://api.github.com/users/SyntaxColoring", "user_view_type": "public" }
[]
open
false
null
[]
null
3
2023-03-19T22:54:22Z
2023-06-02T14:29:09Z
null
NONE
null
This makes some documentation changes that clarify the `files` argument of `requests.post()` et. al. ## Be more precise when we say "multiple files" The `files` argument can either be a dict: ```python files = { "field_1": file_1, "field_2": file_2, } ``` Or a list of tuples: ```python files = [ ("field_1": file_1), ("field_2": file_2), ] ``` A few places implied that to "upload multiple files in one request," you had to use the list-of-tuples syntax. But the dict syntax supports multiple files just fine. The added power in the list-of-tuples syntax seems to be that you can upload multiple files *to the same form field.* So, we now say that. ## Update the reference docs The API reference documentation did not completely describe what values were acceptable for `files`, and in some cases it was misleading. * It didn't mention the list-of-tuples syntax at all. * It said you could pass a "dictionary of `'name': file-like-objects`". The pluralization there makes it look like you can do something like `{"name": [file_1, file_2]}`, but that's not correct. * It didn't describe what you were allowed to provide as a "`fileobj`". (It can be a file-like object, or `str` contents, or `bytes` contents.) * It said `name` to refer to the value that Requests uses as the form field name. This could be misconstrued as the file name. [RFC 7578](https://www.rfc-editor.org/rfc/rfc7578) and other examples within Requests call it the "field name" or "form field name." My sources for these changes: * The existing [POST a Multipart-Encoded File](https://github.com/psf/requests/blob/7f694b79e114c06fac5ec06019cada5a61e5570f/docs/user/quickstart.rst?plain=1#L300) section. * The existing [POST Multiple Multipart-Encoded Files](https://github.com/psf/requests/blob/7f694b79e114c06fac5ec06019cada5a61e5570f/docs/user/advanced.rst?plain=1#L391) section. * [Request's type stubs](https://github.com/python/typeshed/blob/8080e491d2fa92b1b1390c87fac23a1a38dcd919/stubs/requests/requests/sessions.pyi#L91). It's difficult to describe this API concisely because it accepts so many different input shapes, and these additions do make the rendered docs feel a bit crowded.
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/6383/reactions" }
https://api.github.com/repos/psf/requests/issues/6383/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/6383.diff", "html_url": "https://github.com/psf/requests/pull/6383", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/6383.patch", "url": "https://api.github.com/repos/psf/requests/pulls/6383" }
true
[ "The primary benefit of using list of tuples is that order is preserved which is important for some servers that expect fields in a very specific ordering which is way more than it should be", "@sigmavirus24 Thanks. To be clear, do you think some of this PR needs to change to reflect that, or were you just commenting to lend context?", "Bump. Are any changes needed for this?" ]
https://api.github.com/repos/psf/requests/issues/6382
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6382/labels{/name}
https://api.github.com/repos/psf/requests/issues/6382/comments
https://api.github.com/repos/psf/requests/issues/6382/events
https://github.com/psf/requests/issues/6382
1,627,272,003
I_kwDOABTKOs5g_jND
6,382
Not possible to specify positional params in URLs
{ "avatar_url": "https://avatars.githubusercontent.com/u/56254406?v=4", "events_url": "https://api.github.com/users/ghpqans/events{/privacy}", "followers_url": "https://api.github.com/users/ghpqans/followers", "following_url": "https://api.github.com/users/ghpqans/following{/other_user}", "gists_url": "https://api.github.com/users/ghpqans/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/ghpqans", "id": 56254406, "login": "ghpqans", "node_id": "MDQ6VXNlcjU2MjU0NDA2", "organizations_url": "https://api.github.com/users/ghpqans/orgs", "received_events_url": "https://api.github.com/users/ghpqans/received_events", "repos_url": "https://api.github.com/users/ghpqans/repos", "site_admin": false, "starred_url": "https://api.github.com/users/ghpqans/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/ghpqans/subscriptions", "type": "User", "url": "https://api.github.com/users/ghpqans", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2023-03-16T11:25:35Z
2024-03-16T00:03:10Z
2023-03-16T12:13:42Z
NONE
resolved
Currently it's not possible to supply values for positional only parameters in request URLs. E.g Http requests like this are not supported: `URL?param1=value,some_other_param` Currently it is possible to specify a key-value pair for `param1` but not only a value for `some_other_param`. It's possible to concatenate the URL by oneself, but I doubt this is the recommended way to do so. ## Expected Result Example: `req = requests.get(URL, {"param1": "value1"}, positional_params = ["some_other_param"])` ## Actual Result Only possible to concatenate the URL by oneself: `req = requests.get(f"URL?param1={value},some_other_param")`, which is OK for simple requests but not OK for complex requests. The same goes for POST 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/6382/reactions" }
https://api.github.com/repos/psf/requests/issues/6382/timeline
null
not_planned
null
null
false
[ "In the future, please search **closed and** open issues before creating new ones that are duplicates." ]
https://api.github.com/repos/psf/requests/issues/6380
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6380/labels{/name}
https://api.github.com/repos/psf/requests/issues/6380/comments
https://api.github.com/repos/psf/requests/issues/6380/events
https://github.com/psf/requests/pull/6380
1,625,587,828
PR_kwDOABTKOs5MHBfb
6,380
Clarified Section Header for passing data
{ "avatar_url": "https://avatars.githubusercontent.com/u/17177271?v=4", "events_url": "https://api.github.com/users/jenshb/events{/privacy}", "followers_url": "https://api.github.com/users/jenshb/followers", "following_url": "https://api.github.com/users/jenshb/following{/other_user}", "gists_url": "https://api.github.com/users/jenshb/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/jenshb", "id": 17177271, "login": "jenshb", "node_id": "MDQ6VXNlcjE3MTc3Mjcx", "organizations_url": "https://api.github.com/users/jenshb/orgs", "received_events_url": "https://api.github.com/users/jenshb/received_events", "repos_url": "https://api.github.com/users/jenshb/repos", "site_admin": false, "starred_url": "https://api.github.com/users/jenshb/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/jenshb/subscriptions", "type": "User", "url": "https://api.github.com/users/jenshb", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2023-03-15T13:59:46Z
2024-07-30T00:03:53Z
2023-07-30T01:11:38Z
NONE
resolved
This section applies not only to POST request, but all REST methods with data. Furthermore, a POST request with json body ist not complicated, but standard.
{ "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/6380/reactions" }
https://api.github.com/repos/psf/requests/issues/6380/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/6380.diff", "html_url": "https://github.com/psf/requests/pull/6380", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/6380.patch", "url": "https://api.github.com/repos/psf/requests/pulls/6380" }
true
[ "Thanks for the PR, @jenshb. This may be a bit subjective depending on the reader. We typically won't accept PRs that are making stylistic changes in the docs/code, so I believe we'll pass on this one." ]
https://api.github.com/repos/psf/requests/issues/6379
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6379/labels{/name}
https://api.github.com/repos/psf/requests/issues/6379/comments
https://api.github.com/repos/psf/requests/issues/6379/events
https://github.com/psf/requests/pull/6379
1,624,096,115
PR_kwDOABTKOs5MB_2D
6,379
fix issue #6377
{ "avatar_url": "https://avatars.githubusercontent.com/u/70511123?v=4", "events_url": "https://api.github.com/users/Ren-hongchen/events{/privacy}", "followers_url": "https://api.github.com/users/Ren-hongchen/followers", "following_url": "https://api.github.com/users/Ren-hongchen/following{/other_user}", "gists_url": "https://api.github.com/users/Ren-hongchen/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Ren-hongchen", "id": 70511123, "login": "Ren-hongchen", "node_id": "MDQ6VXNlcjcwNTExMTIz", "organizations_url": "https://api.github.com/users/Ren-hongchen/orgs", "received_events_url": "https://api.github.com/users/Ren-hongchen/received_events", "repos_url": "https://api.github.com/users/Ren-hongchen/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Ren-hongchen/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Ren-hongchen/subscriptions", "type": "User", "url": "https://api.github.com/users/Ren-hongchen", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2023-03-14T18:41:18Z
2024-03-26T00:03:20Z
2023-03-14T21:30:30Z
NONE
resolved
fix #6377 The reason why the file is not overwritten is that the test file in the TMP directory is not cleared after the test is run for the first time, and the directory and filename of the temporary file are the same after each test run. This code skips overwriting when it finds that the file already exists: `if not os.path.exists(extracted_path):` in utils.extract_zipped_paths() **This means that calling this function twice in a row will not be able to detect changes in compressed files?** So i thought that judgment might be redundant, so I removed it.
{ "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/6379/reactions" }
https://api.github.com/repos/psf/requests/issues/6379/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/6379.diff", "html_url": "https://github.com/psf/requests/pull/6379", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/6379.patch", "url": "https://api.github.com/repos/psf/requests/pulls/6379" }
true
[ "This will dramatically kill performance for people using certifi and requests from zip files. We won't be accepting it", "> This will dramatically kill performance for people using certifi and requests from zip files. We won't be accepting it\r\n\r\nSorry, I'm a noob. @sigmavirus24 \r\nIs it acceptable to use MD5 to compare existing files in a temporary directory with the compressed file to detect if the contents of the file have changed?\r\n\r\n```\r\nimport hashlib\r\n\r\ndef extract_zipped_paths():\r\n ...\r\n if os.path.exists(extracted_path):\r\n with open(extracted_path, \"rb\") as file_handler:\r\n file_content = file_handler.read()\r\n file_hash = hashlib.md5(file_content).hexdigest()\r\n zip_file_hash = hashlib.md5(zip_file.read(member)).hexdigest()\r\n \r\n if file_hash == zip_file_hash:\r\n return extracted_path\r\n \r\n # use read + write to avoid the creating nested folders, we only want the file, avoids mkdir racing condition\r\n with atomic_open(extracted_path) as file_handler:\r\n file_handler.write(zip_file.read(member))\r\n```\r\n" ]
https://api.github.com/repos/psf/requests/issues/6378
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6378/labels{/name}
https://api.github.com/repos/psf/requests/issues/6378/comments
https://api.github.com/repos/psf/requests/issues/6378/events
https://github.com/psf/requests/issues/6378
1,620,082,886
I_kwDOABTKOs5gkIDG
6,378
How to setup local dev environment and run the tests?
{ "avatar_url": "https://avatars.githubusercontent.com/u/48833?v=4", "events_url": "https://api.github.com/users/szabgab/events{/privacy}", "followers_url": "https://api.github.com/users/szabgab/followers", "following_url": "https://api.github.com/users/szabgab/following{/other_user}", "gists_url": "https://api.github.com/users/szabgab/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/szabgab", "id": 48833, "login": "szabgab", "node_id": "MDQ6VXNlcjQ4ODMz", "organizations_url": "https://api.github.com/users/szabgab/orgs", "received_events_url": "https://api.github.com/users/szabgab/received_events", "repos_url": "https://api.github.com/users/szabgab/repos", "site_admin": false, "starred_url": "https://api.github.com/users/szabgab/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/szabgab/subscriptions", "type": "User", "url": "https://api.github.com/users/szabgab", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2023-03-11T17:22:01Z
2024-06-01T00:04:04Z
2023-06-01T22:37:11Z
NONE
resolved
As I have not seen any details about it (beyond the cloning of the repo) in the README I put together a short blog posts on [Development environment for the Python requests package](https://dev.to/szabgab/development-environment-for-the-python-requests-package-eae) If you are interested, I'd be glad to send a PR for the README file to include some similar information.
{ "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/6378/reactions" }
https://api.github.com/repos/psf/requests/issues/6378/timeline
null
completed
null
null
false
[ "To set up a local development environment for the Python Requests library and run tests, you can follow these steps:\r\nFork the Requests repository (https://github.com/psf/requests) on GitHub.\r\ngit clone https://github.com/<your_username>/requests.git\r\ncd requests\r\npython -m venv venv\r\npython -m venv venv\r\nsource venv/bin/activate\r\npip install -r requirements.txt\r\npip install -e .\r\npip install -r requirements-dev.txt\r\npytest\r\n" ]
https://api.github.com/repos/psf/requests/issues/6377
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6377/labels{/name}
https://api.github.com/repos/psf/requests/issues/6377/comments
https://api.github.com/repos/psf/requests/issues/6377/events
https://github.com/psf/requests/issues/6377
1,618,801,708
I_kwDOABTKOs5gfPQs
6,377
test_zipped_paths_extracted fails if test file has been modified since last run
{ "avatar_url": "https://avatars.githubusercontent.com/u/28623?v=4", "events_url": "https://api.github.com/users/DRMacIver/events{/privacy}", "followers_url": "https://api.github.com/users/DRMacIver/followers", "following_url": "https://api.github.com/users/DRMacIver/following{/other_user}", "gists_url": "https://api.github.com/users/DRMacIver/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/DRMacIver", "id": 28623, "login": "DRMacIver", "node_id": "MDQ6VXNlcjI4NjIz", "organizations_url": "https://api.github.com/users/DRMacIver/orgs", "received_events_url": "https://api.github.com/users/DRMacIver/received_events", "repos_url": "https://api.github.com/users/DRMacIver/repos", "site_admin": false, "starred_url": "https://api.github.com/users/DRMacIver/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/DRMacIver/subscriptions", "type": "User", "url": "https://api.github.com/users/DRMacIver", "user_view_type": "public" }
[]
open
false
null
[]
null
0
2023-03-10T11:07:01Z
2023-03-10T11:07:01Z
null
NONE
null
If you run `python -m pytest tests/test_utils.py -ktest_zipped_paths_extracted` this test will pass normally. If you run it again, it will pass again. If, however, you make any modifications to the file, the test will now fail and keep failing: ``` assert filecmp.cmp(extracted_path, __file__) E AssertionError: assert False E + where False = <function cmp at 0x7f4ea6d4dab0>('/tmp/test_utils.py', '/home/david/project-reducer/scratch/requests/tests/test_utils.py') E + where <function cmp at 0x7f4ea6d4dab0> = filecmp.cmp ``` The reason for this is that the last time the test ran, the contents of `__file__` were written to `/tmp/test_utils.py` and when `extract_zipped_paths` is next called, it doesn't overwrite the existing file, so the filecmp fails because it's now comparing against the old version of the file. ## Expected Result The test should run successfully when modifications to the file are made. ## Actual Result Modifications to the test file that are unrelated to the test in question cause it to fail. ## Reproduction Steps ```bash python -m pytest tests/test_utils.py -ktest_zipped_paths_extracted echo -n '# modification' >> tests/test_utils.py python -m pytest tests/test_utils.py -ktest_zipped_paths_extracted ``` ## System Information $ python -m requests.help ```json { "chardet": { "version": "5.1.0" }, "charset_normalizer": { "version": "3.0.1" }, "cryptography": { "version": "" }, "idna": { "version": "3.4" }, "implementation": { "name": "CPython", "version": "3.10.8" }, "platform": { "release": "5.15.90.1-microsoft-standard-WSL2", "system": "Linux" }, "pyOpenSSL": { "openssl_version": "", "version": null }, "requests": { "version": "2.28.2" }, "system_ssl": { "version": "1010106f" }, "urllib3": { "version": "1.26.14" }, "using_charset_normalizer": false, "using_pyopenssl": false } ```
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/6377/reactions" }
https://api.github.com/repos/psf/requests/issues/6377/timeline
null
null
null
null
false
[]
https://api.github.com/repos/psf/requests/issues/6376
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6376/labels{/name}
https://api.github.com/repos/psf/requests/issues/6376/comments
https://api.github.com/repos/psf/requests/issues/6376/events
https://github.com/psf/requests/issues/6376
1,617,146,669
I_kwDOABTKOs5gY7Mt
6,376
requests.get with stream=True never returns on 403
{ "avatar_url": "https://avatars.githubusercontent.com/u/1196252?v=4", "events_url": "https://api.github.com/users/mattpr/events{/privacy}", "followers_url": "https://api.github.com/users/mattpr/followers", "following_url": "https://api.github.com/users/mattpr/following{/other_user}", "gists_url": "https://api.github.com/users/mattpr/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/mattpr", "id": 1196252, "login": "mattpr", "node_id": "MDQ6VXNlcjExOTYyNTI=", "organizations_url": "https://api.github.com/users/mattpr/orgs", "received_events_url": "https://api.github.com/users/mattpr/received_events", "repos_url": "https://api.github.com/users/mattpr/repos", "site_admin": false, "starred_url": "https://api.github.com/users/mattpr/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/mattpr/subscriptions", "type": "User", "url": "https://api.github.com/users/mattpr", "user_view_type": "public" }
[]
closed
true
null
[]
null
6
2023-03-09T12:34:57Z
2024-06-01T00:04:03Z
2023-06-01T22:37:58Z
NONE
resolved
I have a case where a url I was using requests to fetch (image so using `stream=True` to download to local file) started returning 403 errors with some html...and some very old code stopped working. The 403 isn't the problem. The issue is a requests call that hangs. We didn't notice for a while because it didn't crash/error, it just hung. Apparently for a couple weeks (need more monitoring coverage for other signals there). Running it manually it also hangs for at least a few minutes (as long as I waited). This shouldn't be a timeout case anyway as the server responds right away with the 403. If I manipulate headers (adding `headers=...` to the `requests.get(` call), I can make the 403 go away and the code runs fine again. But that isn't a solution. The issue for me here is the hang because I can't handle or report there is an issue (e.g. getting a 403). Looking through the docs, I don't see anything about this behaviour but I might have missed it. Any idea what I missed? ``` # python3 --version Python 3.8.10 # pip3 list | grep requests requests 2.28.2 ``` curl of offending url (redacted) ``` # curl -s -D - https://example.com/some/path/file.jpg HTTP/2 403 mime-version: 1.0 content-type: text/html content-length: 310 expires: Thu, 09 Mar 2023 12:22:13 GMT cache-control: max-age=0, no-cache pragma: no-cache date: Thu, 09 Mar 2023 12:22:13 GMT server-timing: cdn-cache; desc=HIT server-timing: edge; dur=1 server-timing: ak_p; desc="466212_388605830_176004165_24_6476_12_0";dur=1 <HTML><HEAD> <TITLE>Access Denied</TITLE> </HEAD><BODY> <H1>Access Denied</H1> You don't have permission to access "XXXXXXXXXX" on this server.<P> XXXXX </BODY> </HTML> ``` Excerpt of the hanging code. `res = requests.get(url, stream=True)` never returns. ```python local_file = "/tmp/file.jpg" url = "https://example.com/some/path/file.jpg" res = requests.get(url, stream=True) # <-- hangs print("I never print.") if res.status_code == 200: try: with open(local_file, 'wb') as fd: for chunk in res.iter_content(chunk_size=128): fd.write(chunk) except EnvironmentError as e: print("Received error when attempting to download {0}.".format(url)) print(e) return False return True else: print("Received {0} status when attempting to download {1}.".format(res.status_code, url)) return 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/6376/reactions" }
https://api.github.com/repos/psf/requests/issues/6376/timeline
null
completed
null
null
false
[ "> Running it manually it also hangs for at least a few minutes (as long as I waited).\n\nWith it hanging where you claim, I can't think of why it would be hanging there. Is there a stack trace from when you ran it manually that you can share? It might give us a better idea of what might be happening. Without that, this doesn't seem like something we can fix or investigate as there's very little information to go on", "Good point. I let it hang and then aborted. Here is the relevant stack... appears to be related to ssl? \r\n\r\nWhen I add some http headers to the request the 403 goes away and the request.get works. \r\n\r\nSo unless the server is doing some conditional ssl/tls stuff based on HTTP (doesn't make any sense to me as http happens after tls), I'm not sure what is up there.\r\n\r\nIn any case, I would expect an ssl problem (timeout, hangup, whatever) to be surfaced...but maybe the problem is in python rather than requests. \r\n\r\n```\r\n ^CTraceback (most recent call last):\r\n ...\r\n File \"/opt/script.py\", line 96, in downloadImageToFile\r\n res = requests.get(url, stream=True)\r\n File \"/usr/local/lib/python3.8/dist-packages/requests/api.py\", line 73, in get\r\n return request(\"get\", url, params=params, **kwargs)\r\n File \"/usr/local/lib/python3.8/dist-packages/requests/api.py\", line 59, in request\r\n return session.request(method=method, url=url, **kwargs)\r\n File \"/usr/local/lib/python3.8/dist-packages/requests/sessions.py\", line 587, in request\r\n resp = self.send(prep, **send_kwargs)\r\n File \"/usr/local/lib/python3.8/dist-packages/requests/sessions.py\", line 701, in send\r\n r = adapter.send(request, **kwargs)\r\n File \"/usr/local/lib/python3.8/dist-packages/requests/adapters.py\", line 489, in send\r\n resp = conn.urlopen(\r\n File \"/usr/local/lib/python3.8/dist-packages/urllib3/connectionpool.py\", line 703, in urlopen\r\n httplib_response = self._make_request(\r\n File \"/usr/local/lib/python3.8/dist-packages/urllib3/connectionpool.py\", line 449, in _make_request\r\n six.raise_from(e, None)\r\n File \"<string>\", line 3, in raise_from\r\n File \"/usr/local/lib/python3.8/dist-packages/urllib3/connectionpool.py\", line 444, in _make_request\r\n httplib_response = conn.getresponse()\r\n File \"/usr/lib/python3.8/http/client.py\", line 1348, in getresponse\r\n response.begin()\r\n File \"/usr/lib/python3.8/http/client.py\", line 316, in begin\r\n version, status, reason = self._read_status()\r\n File \"/usr/lib/python3.8/http/client.py\", line 277, in _read_status\r\n line = str(self.fp.readline(_MAXLINE + 1), \"iso-8859-1\")\r\n File \"/usr/lib/python3.8/socket.py\", line 669, in readinto\r\n return self._sock.recv_into(b)\r\n File \"/usr/lib/python3.8/ssl.py\", line 1241, in recv_into\r\n return self.read(nbytes, buffer)\r\n File \"/usr/lib/python3.8/ssl.py\", line 1099, in read\r\n return self._sslobj.read(len, buffer)\r\nKeyboardInterrupt\r\n```", "So we're hanging trying to read the very first line which would be the HTTP version Status code Status reason information.\n\nWhat headers are you adding?\n\nMany servers have started blocking requests user agent strings because of abusive and malicious actors using requests. It's possible this server thinks you're acting maliciously and doing something similar.\n\nThis could be solved with a default timeout which we have an open issue for, but you can also set a read timeout to do the same thing yourself.\n\nI don't believe this is a bug we can fix (see also discussion on the timeout issue) in the near term. ", "> What headers are you adding?\r\n\r\n```\r\nheaders ={\r\n 'accept': 'image/avif,image/webp,image/apng,image/svg+xml,image/*,*/*;q=0.8',\r\n 'accept-language': 'en-US,en;q=0.9',\r\n 'referer': 'https://example.com/path/to/file/index.html',\r\n 'user-agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/110.0.0.0 Safari/537.36',\r\n}\r\n```\r\n\r\n> Many servers have started blocking requests user agent strings because of abusive and malicious actors using requests. It's possible this server thinks you're acting maliciously and doing something similar.\r\n\r\nUnderstandable. I expect that is why I get the 403 (visible in curl...goes away once I add headers...including user-agent). user-agent and referer are the only headers they might be switching on (whether I get a 403 or not). \r\n\r\nBut SSL/TLS breaking is weird as the only http-related stuff available at TLS handshake is the server-name-indication which is just the requested hostname...no http headers. So to break ssl it would have to allow ssl until the http request was received/parsed and then maybe from the http-layer just orphan off the request without responding...but I would expect their webserver to have some upstream timeout or something at some point...I can't imagine their server left the tcp connection open for weeks with no traffic. So at some point the tcp connection should have timed out or got a `FIN` from their end at which point the connection has failed and some kind of error should surface somewhere on the requesting client's side. \r\n\r\nAs it stands now, it looks like we were sitting there for 2 weeks waiting for a response without the tcp connection closing or timing out. I can't imagine that is what is actually happening, but maybe it is and a timeout is the remedy.\r\n\r\nPlus this is another level beyond the 403 which isn't super logical to me...\r\n\r\n- 200 - okay (with user-agent and referer)\r\n- 403 - no auth (curl without user-agent and referer)\r\n- tls/ssl hang - (requests without user-agent and referer)\r\n\r\nI did my tcpdump troubleshooting already for the month but maybe if I get fired up I'll do some more on this topic in the interest of getting the underlying issue identified (e.g. is a FIN being ignored or is the tcp connection really staying open this long?).\r\n\r\n> This could be solved with a default timeout which we have an open issue for, but you can also set a read timeout to do the same thing yourself.\r\n\r\nThis one?\r\nhttps://github.com/psf/requests/issues/3070\r\n\r\nI will try to work around this by specifying a timeout so at least we don't hang without failing for weeks on end...but I suspect there is something that should be fixed here (although it might be in urllib3 or python's http, socket or ssl).\r\n\r\nJust for kicks I thought I'd try again with `curl` using requests' user-agent to see if I could get the server to not respond. Still get the 403. \r\n\r\n```\r\n# curl -s -D - -H 'User-Agent: python-requests/2.28.2' https://example.com/some/path/file.jpg\r\nHTTP/2 403\r\nmime-version: 1.0\r\ncontent-type: text/html\r\ncontent-length: 310\r\nexpires: Thu, 09 Mar 2023 16:29:48 GMT\r\ncache-control: max-age=0, no-cache\r\npragma: no-cache\r\ndate: Thu, 09 Mar 2023 16:29:48 GMT\r\nserver-timing: cdn-cache; desc=HIT\r\nserver-timing: edge; dur=1\r\nserver-timing: ak_p; desc=\"466216_388605857_42742355_25_6766_11_0\";dur=1\r\n\r\n<HTML><HEAD>\r\n<TITLE>Access Denied</TITLE>\r\n</HEAD><BODY>\r\n<H1>Access Denied</H1>\r\n\r\nYou don't have permission to access \"XXXXXXX\" on this server.<P>\r\nXXXXXXXXXX\r\n</BODY>\r\n</HTML>\r\n```", "Do not use Requests, use PycURL\r\n\r\nThis is a known issue, documented [here](https://github.com/psf/requests/issues/5425) and [here](https://github.com/requests/toolbelt/issues/292).", "If in fact the server is responding immediately before we can write anything it is possible it's related to the issues @dkorsunsky linked. It's not a requests but in so much as we rely on the standard library http.client which cannot handle early responses. In other words, as long as we rely on the standard library, there's no fix here for requests " ]
https://api.github.com/repos/psf/requests/issues/6375
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6375/labels{/name}
https://api.github.com/repos/psf/requests/issues/6375/comments
https://api.github.com/repos/psf/requests/issues/6375/events
https://github.com/psf/requests/pull/6375
1,616,697,687
PR_kwDOABTKOs5LpYmN
6,375
Update adapters.py
{ "avatar_url": "https://avatars.githubusercontent.com/u/42906760?v=4", "events_url": "https://api.github.com/users/missing64001/events{/privacy}", "followers_url": "https://api.github.com/users/missing64001/followers", "following_url": "https://api.github.com/users/missing64001/following{/other_user}", "gists_url": "https://api.github.com/users/missing64001/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/missing64001", "id": 42906760, "login": "missing64001", "node_id": "MDQ6VXNlcjQyOTA2NzYw", "organizations_url": "https://api.github.com/users/missing64001/orgs", "received_events_url": "https://api.github.com/users/missing64001/received_events", "repos_url": "https://api.github.com/users/missing64001/repos", "site_admin": false, "starred_url": "https://api.github.com/users/missing64001/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/missing64001/subscriptions", "type": "User", "url": "https://api.github.com/users/missing64001", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2023-03-09T08:36:54Z
2024-07-30T00:03:51Z
2023-07-30T01:15:22Z
NONE
resolved
requests.put() does not respect timeout when data is chunked
{ "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/6375/reactions" }
https://api.github.com/repos/psf/requests/issues/6375/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/6375.diff", "html_url": "https://github.com/psf/requests/pull/6375", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/6375.patch", "url": "https://api.github.com/repos/psf/requests/pulls/6375" }
true
[ "fix issue #6292 ", "Resolving as this should be addressed in Requests 2.30.0 and we've removed this code path from Requests." ]
https://api.github.com/repos/psf/requests/issues/6374
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6374/labels{/name}
https://api.github.com/repos/psf/requests/issues/6374/comments
https://api.github.com/repos/psf/requests/issues/6374/events
https://github.com/psf/requests/pull/6374
1,616,684,633
PR_kwDOABTKOs5LpVvh
6,374
refactor: Replace text symbol with unicode emoji
{ "avatar_url": "https://avatars.githubusercontent.com/u/101031214?v=4", "events_url": "https://api.github.com/users/H4ppy-04/events{/privacy}", "followers_url": "https://api.github.com/users/H4ppy-04/followers", "following_url": "https://api.github.com/users/H4ppy-04/following{/other_user}", "gists_url": "https://api.github.com/users/H4ppy-04/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/H4ppy-04", "id": 101031214, "login": "H4ppy-04", "node_id": "U_kgDOBgWdLg", "organizations_url": "https://api.github.com/users/H4ppy-04/orgs", "received_events_url": "https://api.github.com/users/H4ppy-04/received_events", "repos_url": "https://api.github.com/users/H4ppy-04/repos", "site_admin": false, "starred_url": "https://api.github.com/users/H4ppy-04/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/H4ppy-04/subscriptions", "type": "User", "url": "https://api.github.com/users/H4ppy-04", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2023-03-09T08:29:08Z
2024-03-10T00:03:26Z
2023-03-09T11:13:21Z
NONE
resolved
My reasoning is thus: emojis are cool
{ "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/6374/reactions" }
https://api.github.com/repos/psf/requests/issues/6374/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/6374.diff", "html_url": "https://github.com/psf/requests/pull/6374", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/6374.patch", "url": "https://api.github.com/repos/psf/requests/pulls/6374" }
true
[ "This isn't a rescue and we don't accept cosmetic changes like this " ]
https://api.github.com/repos/psf/requests/issues/6373
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6373/labels{/name}
https://api.github.com/repos/psf/requests/issues/6373/comments
https://api.github.com/repos/psf/requests/issues/6373/events
https://github.com/psf/requests/issues/6373
1,614,399,692
I_kwDOABTKOs5gOcjM
6,373
ddg-api.herokuapp.com return 500
{ "avatar_url": "https://avatars.githubusercontent.com/u/53258301?v=4", "events_url": "https://api.github.com/users/Darkluna999/events{/privacy}", "followers_url": "https://api.github.com/users/Darkluna999/followers", "following_url": "https://api.github.com/users/Darkluna999/following{/other_user}", "gists_url": "https://api.github.com/users/Darkluna999/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Darkluna999", "id": 53258301, "login": "Darkluna999", "node_id": "MDQ6VXNlcjUzMjU4MzAx", "organizations_url": "https://api.github.com/users/Darkluna999/orgs", "received_events_url": "https://api.github.com/users/Darkluna999/received_events", "repos_url": "https://api.github.com/users/Darkluna999/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Darkluna999/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Darkluna999/subscriptions", "type": "User", "url": "https://api.github.com/users/Darkluna999", "user_view_type": "public" }
[]
closed
true
null
[]
null
0
2023-03-07T23:57:54Z
2024-03-08T00:03:27Z
2023-03-08T01:48:26Z
NONE
resolved
<!-- Summary. --> ## Expected Result 200 <!-- What you expected. --> ## Actual Result 500 <!-- 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/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/6373/reactions" }
https://api.github.com/repos/psf/requests/issues/6373/timeline
null
not_planned
null
null
false
[]
https://api.github.com/repos/psf/requests/issues/6372
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6372/labels{/name}
https://api.github.com/repos/psf/requests/issues/6372/comments
https://api.github.com/repos/psf/requests/issues/6372/events
https://github.com/psf/requests/issues/6372
1,613,615,949
I_kwDOABTKOs5gLdNN
6,372
InvalidHeader exception when using subclass of str or bytes
{ "avatar_url": "https://avatars.githubusercontent.com/u/58784889?v=4", "events_url": "https://api.github.com/users/hpierre001/events{/privacy}", "followers_url": "https://api.github.com/users/hpierre001/followers", "following_url": "https://api.github.com/users/hpierre001/following{/other_user}", "gists_url": "https://api.github.com/users/hpierre001/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/hpierre001", "id": 58784889, "login": "hpierre001", "node_id": "MDQ6VXNlcjU4Nzg0ODg5", "organizations_url": "https://api.github.com/users/hpierre001/orgs", "received_events_url": "https://api.github.com/users/hpierre001/received_events", "repos_url": "https://api.github.com/users/hpierre001/repos", "site_admin": false, "starred_url": "https://api.github.com/users/hpierre001/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/hpierre001/subscriptions", "type": "User", "url": "https://api.github.com/users/hpierre001", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2023-03-07T14:49:34Z
2024-03-07T00:02:47Z
2023-03-07T16:15:56Z
NONE
resolved
An InvalidHeader is raised while preparing a request using a subclass of `str` instead of `str` or `bytes` in headers. ## Origin This is due to type checking in check_header_validity in utils.py. This type check uses `type` instead of `isinstance`. ## Context The need of using subclass of str instead of str comes from the need to have 2 "Authorization" header and not just one with 2 tokens separeated by a comma. PS: I didn't build the API i am requesting, don't blame 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/6372/reactions" }
https://api.github.com/repos/psf/requests/issues/6372/timeline
null
completed
null
null
false
[ "A correction could be:\r\n```python\r\ndef check_header_validity(header):\r\n \"\"\"Verifies that header parts don't contain leading whitespace\r\n reserved characters, or return characters.\r\n\r\n :param header: tuple, in the format (name, value).\r\n \"\"\"\r\n \r\n name, value = header\r\n types = {}\r\n\r\n for part in header:\r\n for valid_type in HEADER_VALIDATORS:\r\n if isinstance(part, valid_type):\r\n types[part] = valid_type\r\n break\r\n else:\r\n raise InvalidHeader(\r\n f\"Header part ({part!r}) from {{{name!r}: {value!r}}} must be \"\r\n f\"of type str, bytes or subclasses of them, not {type(part)}\"\r\n )\r\n\r\n _validate_header_part(name, \"name\", HEADER_VALIDATORS[types[name]][0])\r\n _validate_header_part(value, \"value\", HEADER_VALIDATORS[types[value]][1])\r\n```", "Hi @hpierre001, please check open and closed issues before creating new ones. Thanks!" ]
https://api.github.com/repos/psf/requests/issues/6371
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6371/labels{/name}
https://api.github.com/repos/psf/requests/issues/6371/comments
https://api.github.com/repos/psf/requests/issues/6371/events
https://github.com/psf/requests/issues/6371
1,608,621,741
I_kwDOABTKOs5f4Z6t
6,371
Chunked upload fails when using HTTP proxy
{ "avatar_url": "https://avatars.githubusercontent.com/u/5994867?v=4", "events_url": "https://api.github.com/users/sveint/events{/privacy}", "followers_url": "https://api.github.com/users/sveint/followers", "following_url": "https://api.github.com/users/sveint/following{/other_user}", "gists_url": "https://api.github.com/users/sveint/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/sveint", "id": 5994867, "login": "sveint", "node_id": "MDQ6VXNlcjU5OTQ4Njc=", "organizations_url": "https://api.github.com/users/sveint/orgs", "received_events_url": "https://api.github.com/users/sveint/received_events", "repos_url": "https://api.github.com/users/sveint/repos", "site_admin": false, "starred_url": "https://api.github.com/users/sveint/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/sveint/subscriptions", "type": "User", "url": "https://api.github.com/users/sveint", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2023-03-03T13:20:03Z
2024-03-03T00:03:32Z
2023-03-03T13:26:04Z
NONE
resolved
Not sure whether this is actually a `requests` bug, but trying here first as it's here it manifests. I'm using a http proxy for https traffic, and it works fine for normal GET, POST and PUT requests using `requests`. However, if enabled chunked uploads, it fails with `requests.exceptions.ConnectionError: [SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1131)` From googling it appears to be trying to access the http proxy using https. I'm fully aware of the normal "problem" where people confuse the protocols and use "https://" for their http proxy, but as can be seen in the example below this is not the problem in this case. I've been digging into `adapters.py` and the `low_conn` connection it uses _appears_ to have the correct proxy set (with "http" as protocol), but this is outside my expertise. ## Expected Result Request to go through proxy like for non-chunked uploads without errors. ## Actual Result ``` Traceback (most recent call last): File "/usr/local/lib/python3.8/dist-packages/requests/adapters.py", line 521, in send low_conn.endheaders() File "/usr/lib/python3.8/http/client.py", line 1251, in endheaders self._send_output(message_body, encode_chunked=encode_chunked) File "/usr/lib/python3.8/http/client.py", line 1011, in _send_output self.send(msg) File "/usr/lib/python3.8/http/client.py", line 951, in send self.connect() File "/usr/local/lib/python3.8/dist-packages/urllib3/connection.py", line 414, in connect self.sock = ssl_wrap_socket( File "/usr/local/lib/python3.8/dist-packages/urllib3/util/ssl_.py", line 449, in ssl_wrap_socket ssl_sock = _ssl_wrap_socket_impl( File "/usr/local/lib/python3.8/dist-packages/urllib3/util/ssl_.py", line 493, in _ssl_wrap_socket_impl return ssl_context.wrap_socket(sock, server_hostname=server_hostname) File "/usr/lib/python3.8/ssl.py", line 500, in wrap_socket return self.sslsocket_class._create( File "/usr/lib/python3.8/ssl.py", line 1040, in _create self.do_handshake() File "/usr/lib/python3.8/ssl.py", line 1309, in do_handshake self._sslobj.do_handshake() ssl.SSLError: [SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1131) ``` ## Reproduction Steps Run script below with and without proxy. Without proxy it works fine, with http proxy it gives above error. ```python import requests with open('test', 'w') as f: f.write('test') with open('test', 'rb') as f: resp = requests.put('https://www.google.com', data=f) assert resp.status_code == 405 def x(): yield "test".encode('utf-8') resp = requests.put('https://www.google.com', data=x()) assert resp.status_code == 405 ``` ## System Information $ python -m requests.help ```json { "chardet": { "version": null }, "charset_normalizer": { "version": "3.0.1" }, "cryptography": { "version": "" }, "idna": { "version": "3.4" }, "implementation": { "name": "CPython", "version": "3.8.10" }, "platform": { "release": "4.18.0-425.10.1.el8_7.x86_64", "system": "Linux" }, "pyOpenSSL": { "openssl_version": "", "version": null }, "requests": { "version": "2.28.2" }, "system_ssl": { "version": "1010106f" }, "urllib3": { "version": "1.26.14" }, "using_charset_normalizer": true, "using_pyopenssl": false } ```
{ "avatar_url": "https://avatars.githubusercontent.com/u/5994867?v=4", "events_url": "https://api.github.com/users/sveint/events{/privacy}", "followers_url": "https://api.github.com/users/sveint/followers", "following_url": "https://api.github.com/users/sveint/following{/other_user}", "gists_url": "https://api.github.com/users/sveint/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/sveint", "id": 5994867, "login": "sveint", "node_id": "MDQ6VXNlcjU5OTQ4Njc=", "organizations_url": "https://api.github.com/users/sveint/orgs", "received_events_url": "https://api.github.com/users/sveint/received_events", "repos_url": "https://api.github.com/users/sveint/repos", "site_admin": false, "starred_url": "https://api.github.com/users/sveint/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/sveint/subscriptions", "type": "User", "url": "https://api.github.com/users/sveint", "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/6371/reactions" }
https://api.github.com/repos/psf/requests/issues/6371/timeline
null
not_planned
null
null
false
[ "I did look first but missed the other issue. This is a duplicate of https://github.com/psf/requests/issues/6279" ]
https://api.github.com/repos/psf/requests/issues/6370
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6370/labels{/name}
https://api.github.com/repos/psf/requests/issues/6370/comments
https://api.github.com/repos/psf/requests/issues/6370/events
https://github.com/psf/requests/pull/6370
1,607,913,540
PR_kwDOABTKOs5LMBGj
6,370
Upgrade lint.yml action
{ "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
2023-03-03T04:17:06Z
2024-03-03T00:03:35Z
2023-03-03T04:45:27Z
MEMBER
resolved
Fix https://github.com/PyCQA/isort/issues/2083 and update linting infrastructure.
{ "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/6370/reactions" }
https://api.github.com/repos/psf/requests/issues/6370/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/6370.diff", "html_url": "https://github.com/psf/requests/pull/6370", "merged_at": "2023-03-03T04:45:27Z", "patch_url": "https://github.com/psf/requests/pull/6370.patch", "url": "https://api.github.com/repos/psf/requests/pulls/6370" }
true
[]
https://api.github.com/repos/psf/requests/issues/6369
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6369/labels{/name}
https://api.github.com/repos/psf/requests/issues/6369/comments
https://api.github.com/repos/psf/requests/issues/6369/events
https://github.com/psf/requests/issues/6369
1,607,707,432
I_kwDOABTKOs5f06so
6,369
Problem with data parameter in request.post()
{ "avatar_url": "https://avatars.githubusercontent.com/u/70597936?v=4", "events_url": "https://api.github.com/users/zhu-yifang/events{/privacy}", "followers_url": "https://api.github.com/users/zhu-yifang/followers", "following_url": "https://api.github.com/users/zhu-yifang/following{/other_user}", "gists_url": "https://api.github.com/users/zhu-yifang/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/zhu-yifang", "id": 70597936, "login": "zhu-yifang", "node_id": "MDQ6VXNlcjcwNTk3OTM2", "organizations_url": "https://api.github.com/users/zhu-yifang/orgs", "received_events_url": "https://api.github.com/users/zhu-yifang/received_events", "repos_url": "https://api.github.com/users/zhu-yifang/repos", "site_admin": false, "starred_url": "https://api.github.com/users/zhu-yifang/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/zhu-yifang/subscriptions", "type": "User", "url": "https://api.github.com/users/zhu-yifang", "user_view_type": "public" }
[]
closed
true
null
[]
null
3
2023-03-02T23:46:21Z
2024-03-02T00:03:11Z
2023-03-02T23:50:29Z
CONTRIBUTOR
resolved
<!-- Summary. --> ## Expected Result When assign `data` as a `dict` type, it should work. <!-- What you expected. --> ## Actual Result When I input a dict to `data` parameter, it doesn't work. <!-- What happened instead. --> ## Reproduction Steps ```python import requests import json url = 'https://simple-books-api.glitch.me/api-clients' payload = { "clientName": "Gnafiy", "clientEmail": "[email protected]" } r = requests.post(url, data=payload) print(r.request.body) # this will print something like bookId=2&customerName=John+Smith print(r.text) # this suppose to print "error": "API client already registered. Try a different email." but it's printing "error":"Invalid or missing client name." ``` ## System Information $ python -m requests.help ```json { "chardet": { "version": null }, "charset_normalizer": { "version": "2.1.1" }, "cryptography": { "version": "" }, "idna": { "version": "3.4" }, "implementation": { "name": "CPython", "version": "3.10.7" }, "platform": { "release": "21.6.0", "system": "Darwin" }, "pyOpenSSL": { "openssl_version": "", "version": null }, "requests": { "version": "2.28.1" }, "system_ssl": { "version": "1010111f" }, "urllib3": { "version": "1.26.12" }, "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/6369/reactions" }
https://api.github.com/repos/psf/requests/issues/6369/timeline
null
not_planned
null
null
false
[ "You should pass the `payload` using `json` parameter instead of `data`.\r\n\r\n```\r\nr = requests.post(url, json=payload)\r\n```", "@zhu-yifang, I'm going to have to ask you please read the docs before posting new issues. This is all answered for you. Pinging 1000+ people isn't a productive use of time.\n\nIf you have usage questions please check Stack Overflow and the python-requests tag.", "Thank you @Mariatta for the quick response." ]
https://api.github.com/repos/psf/requests/issues/6368
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6368/labels{/name}
https://api.github.com/repos/psf/requests/issues/6368/comments
https://api.github.com/repos/psf/requests/issues/6368/events
https://github.com/psf/requests/pull/6368
1,607,697,719
PR_kwDOABTKOs5LLTQ_
6,368
Changed the comment so it's less confusing
{ "avatar_url": "https://avatars.githubusercontent.com/u/70597936?v=4", "events_url": "https://api.github.com/users/zhu-yifang/events{/privacy}", "followers_url": "https://api.github.com/users/zhu-yifang/followers", "following_url": "https://api.github.com/users/zhu-yifang/following{/other_user}", "gists_url": "https://api.github.com/users/zhu-yifang/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/zhu-yifang", "id": 70597936, "login": "zhu-yifang", "node_id": "MDQ6VXNlcjcwNTk3OTM2", "organizations_url": "https://api.github.com/users/zhu-yifang/orgs", "received_events_url": "https://api.github.com/users/zhu-yifang/received_events", "repos_url": "https://api.github.com/users/zhu-yifang/repos", "site_admin": false, "starred_url": "https://api.github.com/users/zhu-yifang/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/zhu-yifang/subscriptions", "type": "User", "url": "https://api.github.com/users/zhu-yifang", "user_view_type": "public" }
[]
closed
true
null
[]
null
0
2023-03-02T23:36:36Z
2024-03-03T00:03:34Z
2023-03-03T05:32:49Z
CONTRIBUTOR
resolved
The comment for `json` parameter was really confusing and I changed it to make it consistent and clear.
{ "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/6368/reactions" }
https://api.github.com/repos/psf/requests/issues/6368/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/6368.diff", "html_url": "https://github.com/psf/requests/pull/6368", "merged_at": "2023-03-03T05:32:49Z", "patch_url": "https://github.com/psf/requests/pull/6368.patch", "url": "https://api.github.com/repos/psf/requests/pulls/6368" }
true
[]
https://api.github.com/repos/psf/requests/issues/6367
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6367/labels{/name}
https://api.github.com/repos/psf/requests/issues/6367/comments
https://api.github.com/repos/psf/requests/issues/6367/events
https://github.com/psf/requests/issues/6367
1,607,662,061
I_kwDOABTKOs5f0vnt
6,367
Problem with data and json parameters in requests.post()
{ "avatar_url": "https://avatars.githubusercontent.com/u/70597936?v=4", "events_url": "https://api.github.com/users/zhu-yifang/events{/privacy}", "followers_url": "https://api.github.com/users/zhu-yifang/followers", "following_url": "https://api.github.com/users/zhu-yifang/following{/other_user}", "gists_url": "https://api.github.com/users/zhu-yifang/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/zhu-yifang", "id": 70597936, "login": "zhu-yifang", "node_id": "MDQ6VXNlcjcwNTk3OTM2", "organizations_url": "https://api.github.com/users/zhu-yifang/orgs", "received_events_url": "https://api.github.com/users/zhu-yifang/received_events", "repos_url": "https://api.github.com/users/zhu-yifang/repos", "site_admin": false, "starred_url": "https://api.github.com/users/zhu-yifang/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/zhu-yifang/subscriptions", "type": "User", "url": "https://api.github.com/users/zhu-yifang", "user_view_type": "public" }
[]
closed
true
null
[]
null
3
2023-03-02T23:04:58Z
2024-03-02T00:03:12Z
2023-03-02T23:22:50Z
CONTRIBUTOR
resolved
<!-- Summary. --> ## Expected Result `data` parameter should be able to take in a `dict` and convert it into a json format string automatically in the request, and `json` parameter should be able to take in a json string. According to the comments on the code, > :param data: (optional) Dictionary, list of tuples, bytes, or file-like object to send in the body of the :class:`Request`. :param json: (optional) json data to send in the body of the :class:`Request`. <!-- What you expected. --> ## Actual Result When I input a dict to `data` parameter, it doesn't convert it into a json format string, it only works if I give it a json format string. And for `json` parameter, it doesn't work if I input a json format string, but works with a `dict` input. <!-- What happened instead. --> ## Reproduction Steps ```python import requests import json url = 'https://simple-books-api.glitch.me/api-clients' payload = { "bookId": 2, "customerName": "John Smith" } r = requests.post(url, data=payload) print(r.request.body) # this will print something like bookId=2&customerName=John+Smith r = requests.post(url, data=json.dumps(payload)) print(r.request.body) # this will print a normal json format string ``` ## System Information $ python -m requests.help ```json { "chardet": { "version": null }, "charset_normalizer": { "version": "2.1.1" }, "cryptography": { "version": "" }, "idna": { "version": "3.4" }, "implementation": { "name": "CPython", "version": "3.10.7" }, "platform": { "release": "21.6.0", "system": "Darwin" }, "pyOpenSSL": { "openssl_version": "", "version": null }, "requests": { "version": "2.28.1" }, "system_ssl": { "version": "1010111f" }, "urllib3": { "version": "1.26.12" }, "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/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/6367/reactions" }
https://api.github.com/repos/psf/requests/issues/6367/timeline
null
not_planned
null
null
false
[ "Hi @zhu-yifang, it seems like there's assumptions being made that are not present in the doc strings you referenced.\n\nData is form-encoded as specified in the [getting started](https://docs.python-requests.org/en/latest/user/quickstart/#more-complicated-post-requests) docs. It is not json, hence the json parameters existence which is also explained in this section.\n\nThe json parameter is defined as \"A JSON serializable Python object to send in the body of the Request.\" on the [top-level request](https://docs.python-requests.org/en/latest/api/#requests.request) API. Nowhere does it state this data is a string.", "But it says \r\n\r\n> To do this, simply pass a dictionary to the data argument. Your dictionary of data will automatically be form-encoded when the request is made:\r\n\r\nLook at requests/api.py, line 107 - 109, it says\r\n\r\n> :param data: (optional) Dictionary, list of tuples, bytes, or file-like object to send in the body of the :class:`Request`.\r\n> :param json: (optional) json data to send in the body of the :class:`Request`.\r\n\r\nI think you guys need to change the description here so it makes less confusion\r\n", "Hey, my issue hasn't been solved yet. Don't close it, please." ]
https://api.github.com/repos/psf/requests/issues/6366
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6366/labels{/name}
https://api.github.com/repos/psf/requests/issues/6366/comments
https://api.github.com/repos/psf/requests/issues/6366/events
https://github.com/psf/requests/issues/6366
1,607,625,119
I_kwDOABTKOs5f0mmf
6,366
Race Condition in session.adapters: OrderedDict mutated during iteration
{ "avatar_url": "https://avatars.githubusercontent.com/u/20261699?v=4", "events_url": "https://api.github.com/users/TheTechromancer/events{/privacy}", "followers_url": "https://api.github.com/users/TheTechromancer/followers", "following_url": "https://api.github.com/users/TheTechromancer/following{/other_user}", "gists_url": "https://api.github.com/users/TheTechromancer/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/TheTechromancer", "id": 20261699, "login": "TheTechromancer", "node_id": "MDQ6VXNlcjIwMjYxNjk5", "organizations_url": "https://api.github.com/users/TheTechromancer/orgs", "received_events_url": "https://api.github.com/users/TheTechromancer/received_events", "repos_url": "https://api.github.com/users/TheTechromancer/repos", "site_admin": false, "starred_url": "https://api.github.com/users/TheTechromancer/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/TheTechromancer/subscriptions", "type": "User", "url": "https://api.github.com/users/TheTechromancer", "user_view_type": "public" }
[]
closed
true
null
[]
null
5
2023-03-02T22:39:49Z
2024-08-15T00:03:45Z
2023-03-03T02:41:55Z
NONE
resolved
## Expected Result This race condition happens between `session.mount()` and `session.get_adapter()`. If one thread calls `session.mount()` while `session.get_adapter()` is executing, a `RuntimeError` will be thrown. The proposed fix, in order to make it thread-safe, is to use a `threading.Lock()` when accessing or iterating `session.adapters`. ## Actual Result ```python Traceback (most recent call last): File "/home/user/requests_bug.py", line 23, in <module> result = future.result() File "/usr/lib/python3.10/concurrent/futures/_base.py", line 451, in result return self.__get_result() File "/usr/lib/python3.10/concurrent/futures/_base.py", line 403, in __get_result raise self._exception File "/usr/lib/python3.10/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, **self.kwargs) File "/home/user/requests_bug.py", line 15, in get_url response = session.request("GET", url) File "/home/user/.local/lib/python3.10/site-packages/requests/sessions.py", line 587, in request resp = self.send(prep, **send_kwargs) File "/home/user/.local/lib/python3.10/site-packages/requests/sessions.py", line 695, in send adapter = self.get_adapter(url=request.url) File "/home/user/.local/lib/python3.10/site-packages/requests/sessions.py", line 786, in get_adapter for (prefix, adapter) in self.adapters.items(): RuntimeError: OrderedDict mutated during iteration ``` ## Reproduction Steps This is reproducible using the following script (against the local `python -m http.server`) ```python import random import requests from requests.adapters import HTTPAdapter from concurrent.futures import ThreadPoolExecutor, as_completed session = requests.Session() retry_adapter = HTTPAdapter(max_retries=0) def get_url(url): session.mount(f"{random.randint(0,9999)}://", retry_adapter) response = session.request("GET", url) futures = [] with ThreadPoolExecutor(max_workers=100) as executor: for i in range(10000): futures.append(executor.submit(get_url, "http://127.0.0.1:8000")) for future in as_completed(futures): result = future.result() ``` ## System Information ```json { "chardet": { "version": "3.0.4" }, "charset_normalizer": { "version": "2.0.11" }, "cryptography": { "version": "38.0.1" }, "idna": { "version": "3.4" }, "implementation": { "name": "CPython", "version": "3.10.9" }, "platform": { "release": "6.2.1-arch1-1", "system": "Linux" }, "pyOpenSSL": { "openssl_version": "30000050", "version": "22.0.0" }, "requests": { "version": "2.28.2" }, "system_ssl": { "version": "30000080" }, "urllib3": { "version": "1.26.8" }, "using_charset_normalizer": false, "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": 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/6366/reactions" }
https://api.github.com/repos/psf/requests/issues/6366/timeline
null
not_planned
null
null
false
[ "Requests does it's level best to be thread safe but this is not a common or even reasonable use of the library in a threaded context. We won't be adding a lock here. If you want this to be thread safe without having to change your usage, I suggest using a thread safe dictionary implementation instead of the ordered dictionary ", "@sigmavirus24 Agreed that the above example is wildly unrealistic. But it is designed to reliably coax out a bug that we are seeing in production code -- yes, the chance of it happening is very small, but it still makes appearances. Because it's a race condition it only happens once in a blue moon, but I don't see that as a reason not to fix it. If I submit a pull request, will it be considered?", "It will not be considered. Threading Locks will likely significantly harm 99.9% of people's experience using Requests. ", "I see your point; threading locks can be troublesome when not used correctly. But in this specific case, it seems to me that due to the extremely small chance of this bug triggering, implementing a lock for the associated object would have virtually no impact on performance. The only time a performance impact would be introduced would be when there is concurrent access on the object, i.e. when the risk of triggering the race condition is highest.\r\n\r\n", "I'm seeing this in production code too, though \"once in a blue moon\" is likely an accurate estimation of how rare this is.\r\n\r\nIf this won't be solved in `requests` by default, I assume the recommendation might be to make the code interacting with `session.mount()` to be thread-safe instead?" ]
https://api.github.com/repos/psf/requests/issues/6365
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6365/labels{/name}
https://api.github.com/repos/psf/requests/issues/6365/comments
https://api.github.com/repos/psf/requests/issues/6365/events
https://github.com/psf/requests/pull/6365
1,600,908,885
PR_kwDOABTKOs5K0UdD
6,365
Response.raw.read() returns bytes
{ "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
0
2023-02-27T10:33:32Z
2024-02-28T00:03:12Z
2023-02-27T15:31:17Z
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/6365/reactions" }
https://api.github.com/repos/psf/requests/issues/6365/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/6365.diff", "html_url": "https://github.com/psf/requests/pull/6365", "merged_at": "2023-02-27T15:31:17Z", "patch_url": "https://github.com/psf/requests/pull/6365.patch", "url": "https://api.github.com/repos/psf/requests/pulls/6365" }
true
[]
https://api.github.com/repos/psf/requests/issues/6364
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6364/labels{/name}
https://api.github.com/repos/psf/requests/issues/6364/comments
https://api.github.com/repos/psf/requests/issues/6364/events
https://github.com/psf/requests/issues/6364
1,600,528,057
I_kwDOABTKOs5fZh65
6,364
Python requests and ms sql
{ "avatar_url": "https://avatars.githubusercontent.com/u/98638527?v=4", "events_url": "https://api.github.com/users/RB11293/events{/privacy}", "followers_url": "https://api.github.com/users/RB11293/followers", "following_url": "https://api.github.com/users/RB11293/following{/other_user}", "gists_url": "https://api.github.com/users/RB11293/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/RB11293", "id": 98638527, "login": "RB11293", "node_id": "U_kgDOBeEavw", "organizations_url": "https://api.github.com/users/RB11293/orgs", "received_events_url": "https://api.github.com/users/RB11293/received_events", "repos_url": "https://api.github.com/users/RB11293/repos", "site_admin": false, "starred_url": "https://api.github.com/users/RB11293/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/RB11293/subscriptions", "type": "User", "url": "https://api.github.com/users/RB11293", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2023-02-27T05:56:42Z
2023-02-27T10:30:58Z
2023-02-27T05:58:03Z
NONE
null
Please refer to our [Stack Overflow tag](https://stackoverflow.com/questions/tagged/python-requests) for guidance. How to automate the process of taking information so that I do not manually register user, pass, KodDoc, dateStart, dateEnd in xml, and this information was taken from ms sql, and exactly as many times as I have users in the database. For example, I have 60 users and I want to create 60 xml files, or to create 1 file with information for 60 users`your text` `import requests # SOAP request URL url = "http://" # structured XML payload = """<?xml version="1.0" encoding="utf-8"?> <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> <getForm30 xmlns="http://tempuri.org/"> <user>string</user> <pass>string</pass> <KodDoc>string</KodDoc> <dateStart>01.01.2022</dateStart> <dateEnd>31.12.2022</dateEnd> </getForm30> </soap:Body> </soap:Envelope>""" payload1 = """<?xml version="1.0" encoding="utf-8"?> <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> <getForm30 xmlns="http://tempuri.org/"> <user>string</user> <pass>string</pass> <KodDoc>string</KodDoc> <dateStart>01.01.2022</dateStart> <dateEnd>31.12.2022</dateEnd> </getForm30> </soap:Body> </soap:Envelope>""" # headers headers = { 'Content-Type': 'text/xml; charset=utf-8' } # POST request response = requests.request("POST", url, headers=headers, data=payload.encode('utf-8')) response1 = requests.request("POST", url, headers=headers, data=payload1.encode('utf-8')) # prints the response #print(response.text) #print(response) file = open('D://bdseo.xml','w') file.write(response.text) file.close() file = open('D://bdseo1.xml','w') file.write(response1.text) file.close()`
{ "avatar_url": "https://avatars.githubusercontent.com/u/98638527?v=4", "events_url": "https://api.github.com/users/RB11293/events{/privacy}", "followers_url": "https://api.github.com/users/RB11293/followers", "following_url": "https://api.github.com/users/RB11293/following{/other_user}", "gists_url": "https://api.github.com/users/RB11293/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/RB11293", "id": 98638527, "login": "RB11293", "node_id": "U_kgDOBeEavw", "organizations_url": "https://api.github.com/users/RB11293/orgs", "received_events_url": "https://api.github.com/users/RB11293/received_events", "repos_url": "https://api.github.com/users/RB11293/repos", "site_admin": false, "starred_url": "https://api.github.com/users/RB11293/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/RB11293/subscriptions", "type": "User", "url": "https://api.github.com/users/RB11293", "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/6364/reactions" }
https://api.github.com/repos/psf/requests/issues/6364/timeline
null
completed
null
null
false
[ "import requests\r\n\r\n\r\nurl = \"http://\"\r\n\r\n\r\npayload = \"\"\"<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<soap:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">\r\n <soap:Body>\r\n <getForm30 xmlns=\"http://tempuri.org/\">\r\n <user>string</user>\r\n <pass>string</pass>\r\n <KodDoc>string</KodDoc>\r\n <dateStart>01.01.2022</dateStart>\r\n <dateEnd>31.12.2022</dateEnd>\r\n </getForm30>\r\n </soap:Body>\r\n</soap:Envelope>\"\"\"\r\n\r\npayload1 = \"\"\"<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<soap:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">\r\n <soap:Body>\r\n <getForm30 xmlns=\"http://tempuri.org/\">\r\n <user>string</user>\r\n <pass>string</pass>\r\n <KodDoc>string</KodDoc>\r\n <dateStart>01.01.2022</dateStart>\r\n <dateEnd>31.12.2022</dateEnd>\r\n </getForm30>\r\n </soap:Body>\r\n</soap:Envelope>\"\"\"\r\n\r\n\r\n\r\n\r\nheaders = {\r\n 'Content-Type': 'text/xml; charset=utf-8'\r\n}\r\n\r\nresponse = requests.request(\"POST\", url, headers=headers, data=payload.encode('utf-8'))\r\nresponse1 = requests.request(\"POST\", url, headers=headers, data=payload1.encode('utf-8'))\r\n\r\n\r\n#print(response.text)\r\n#print(response)\r\n\r\nfile = open('D://bdseo.xml','w')\r\nfile.write(response.text)\r\nfile.close()\r\n\r\nfile = open('D://bdseo1.xml','w')\r\nfile.write(response1.text)\r\nfile.close()`\r\n\r\n\r\nimport requests\r\n\r\n\r\nurl = \"http://\"\r\n\r\n\r\npayload = \"\"\"<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<soap:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">\r\n <soap:Body>\r\n <getForm30 xmlns=\"http://tempuri.org/\">\r\n <user>string</user>\r\n <pass>string</pass>\r\n <KodDoc>string</KodDoc>\r\n <dateStart>01.01.2022</dateStart>\r\n <dateEnd>31.12.2022</dateEnd>\r\n </getForm30>\r\n </soap:Body>\r\n</soap:Envelope>\"\"\"\r\n\r\npayload1 = \"\"\"<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<soap:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">\r\n <soap:Body>\r\n <getForm30 xmlns=\"http://tempuri.org/\">\r\n <user>string</user>\r\n <pass>string</pass>\r\n <KodDoc>string</KodDoc>\r\n <dateStart>01.01.2022</dateStart>\r\n <dateEnd>31.12.2022</dateEnd>\r\n </getForm30>\r\n </soap:Body>\r\n</soap:Envelope>\"\"\"\r\n\r\n\r\n\r\n\r\nheaders = {\r\n 'Content-Type': 'text/xml; charset=utf-8'\r\n}\r\n\r\nresponse = requests.request(\"POST\", url, headers=headers, data=payload.encode('utf-8'))\r\nresponse1 = requests.request(\"POST\", url, headers=headers, data=payload1.encode('utf-8'))\r\n\r\n\r\n#print(response.text)\r\n#print(response)\r\n\r\nfile = open('D://bdseo.xml','w')\r\nfile.write(response.text)\r\nfile.close()\r\n\r\nfile = open('D://bdseo1.xml','w')\r\nfile.write(response1.text)\r\nfile.close()", "123" ]
https://api.github.com/repos/psf/requests/issues/6363
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6363/labels{/name}
https://api.github.com/repos/psf/requests/issues/6363/comments
https://api.github.com/repos/psf/requests/issues/6363/events
https://github.com/psf/requests/pull/6363
1,599,860,380
PR_kwDOABTKOs5Kw5pl
6,363
Parse cookies set by Django app
{ "avatar_url": "https://avatars.githubusercontent.com/u/209551?v=4", "events_url": "https://api.github.com/users/jazzdev/events{/privacy}", "followers_url": "https://api.github.com/users/jazzdev/followers", "following_url": "https://api.github.com/users/jazzdev/following{/other_user}", "gists_url": "https://api.github.com/users/jazzdev/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/jazzdev", "id": 209551, "login": "jazzdev", "node_id": "MDQ6VXNlcjIwOTU1MQ==", "organizations_url": "https://api.github.com/users/jazzdev/orgs", "received_events_url": "https://api.github.com/users/jazzdev/received_events", "repos_url": "https://api.github.com/users/jazzdev/repos", "site_admin": false, "starred_url": "https://api.github.com/users/jazzdev/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/jazzdev/subscriptions", "type": "User", "url": "https://api.github.com/users/jazzdev", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2023-02-25T22:27:42Z
2024-07-30T00:03:50Z
2023-07-30T01:46:54Z
NONE
resolved
I'm using requests to automate a custom Django app. The Django app sets cookies that are not parsed by requests. This addresses two issues that keep requests from parsing the cookies: 1. A Set-Cookie header with multiple cookies will fail to parse 2. A Set-Cookie with a Max-Age attribute that is a floating point number will fail to parse Django does both of these things. This PR handles multiple cookies by replacing a single Set-Cookie header with multiple cookies with multiple Set-Cookie headers with one cookie each. This PR rounds down Max-Age to an int. 4 new tests are added.
{ "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/6363/reactions" }
https://api.github.com/repos/psf/requests/issues/6363/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/6363.diff", "html_url": "https://github.com/psf/requests/pull/6363", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/6363.patch", "url": "https://api.github.com/repos/psf/requests/pulls/6363" }
true
[ "I believe this would be an issue with any HTTP client using the standard library for cookie parsing. I'm not sure that makes it appropriate to fix here", "Hi @jazzdev, looking over the PR, it seems Django may be doing the wrong thing in this case. It's not clear from what's been provided whether this is due to user input or a defect in Django. Requests uses the standard library to parse cookies and I'm not sure we want to start building out our own parsing.\r\n\r\nThis is what I see in the specifications regarding what you're seeing (emphasis mine):\r\n\r\n<blockquote>\r\n If the attribute-name case-insensitively matches the string \"Max-\r\n Age\", the user agent MUST process the cookie-av as follows.\r\n \r\n If the first character of the attribute-value is not a DIGIT or a \"-\"\r\n character, ignore the cookie-av.\r\n\r\n **If the remainder of attribute-value contains a non-DIGIT character,\r\n ignore the cookie-av.**\r\n\r\n Let delta-seconds be the attribute-value converted to an integer.\r\n</blockquote>\r\n\r\n\\- [RFC 6265 5.2.2](https://www.rfc-editor.org/rfc/rfc6265.txt)\r\n\r\nA value containing anything other than a DIGIT or a \"-\" character means the entire value is ignored.\r\n\r\nFor bundling multiple cookies into a single `Set-Cookie` header, it's not strictly a spec violation but definitely goes against what's advised.\r\n\r\n> Origin servers SHOULD NOT fold multiple Set-Cookie header fields into\r\n a single header field.\r\n \r\nThe latest HTTP/1.1 RFC (9110) takes it a step farther stating they mechanically cannot be combined due to parsing implementation issues like you're seeing. Regarding collapsing cookies based on matching keys:\r\n\r\n> Since it cannot be combined into a single field value, recipients ought to handle \"Set-Cookie\" as a special case while processing fields.\r\n[RFC 9110 5.3](https://www.rfc-editor.org/rfc/rfc9110#section-5.3-4.1)\r\n\r\n--\r\n\r\nFor those reasons, I think we're not inclined to add this functionality. It's going to move us into an awkward position where we cannot do the correct thing in all cases. Trying to support violations of the RFCs has bitten us previously so ideally this should be fixed either in the app or Django depending on the origin of the issue." ]
https://api.github.com/repos/psf/requests/issues/6362
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6362/labels{/name}
https://api.github.com/repos/psf/requests/issues/6362/comments
https://api.github.com/repos/psf/requests/issues/6362/events
https://github.com/psf/requests/issues/6362
1,599,844,698
I_kwDOABTKOs5fW7Fa
6,362
Please consider making a public interface for `requests.utils._parse_content_type_header`
{ "avatar_url": "https://avatars.githubusercontent.com/u/7465503?v=4", "events_url": "https://api.github.com/users/nboullis/events{/privacy}", "followers_url": "https://api.github.com/users/nboullis/followers", "following_url": "https://api.github.com/users/nboullis/following{/other_user}", "gists_url": "https://api.github.com/users/nboullis/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/nboullis", "id": 7465503, "login": "nboullis", "node_id": "MDQ6VXNlcjc0NjU1MDM=", "organizations_url": "https://api.github.com/users/nboullis/orgs", "received_events_url": "https://api.github.com/users/nboullis/received_events", "repos_url": "https://api.github.com/users/nboullis/repos", "site_admin": false, "starred_url": "https://api.github.com/users/nboullis/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/nboullis/subscriptions", "type": "User", "url": "https://api.github.com/users/nboullis", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2023-02-25T21:16:13Z
2024-02-27T00:03:22Z
2023-02-26T15:43:00Z
NONE
resolved
Hi, I have some code using `requests` where I want to check that the response the response has the expected content-type, but I don’t care about the encoding. Parsing the Content-Type header is not very complicated, but `requests` already does it in its `requests.utils._parse_content_type_header` function, that is used to find the encoding in `requests.utils.get_encoding_from_headers`. I’d rather not reinvent the wheel. However, as far as I can tell, that `requests.utils._parse_content_type_header` function is undocumented and, given its name starts with an underscore, it looks like a private function that might be removed in a future release. It seems to me it that it is a common need to parse a Content-Type header and, given `requests` already had a function to do so, would you consider making a public interface for this?
{ "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/6362/reactions" }
https://api.github.com/repos/psf/requests/issues/6362/timeline
null
not_planned
null
null
false
[ "Requests is in feature freeze at the moment and not expanding or changing the public API. As such, we will not guarantee the stability of availability of that function, nor will we be making it public " ]
https://api.github.com/repos/psf/requests/issues/6361
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6361/labels{/name}
https://api.github.com/repos/psf/requests/issues/6361/comments
https://api.github.com/repos/psf/requests/issues/6361/events
https://github.com/psf/requests/issues/6361
1,598,691,062
I_kwDOABTKOs5fShb2
6,361
Response class does not pickle _next attribute
{ "avatar_url": "https://avatars.githubusercontent.com/u/13723037?v=4", "events_url": "https://api.github.com/users/peterezzo/events{/privacy}", "followers_url": "https://api.github.com/users/peterezzo/followers", "following_url": "https://api.github.com/users/peterezzo/following{/other_user}", "gists_url": "https://api.github.com/users/peterezzo/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/peterezzo", "id": 13723037, "login": "peterezzo", "node_id": "MDQ6VXNlcjEzNzIzMDM3", "organizations_url": "https://api.github.com/users/peterezzo/orgs", "received_events_url": "https://api.github.com/users/peterezzo/received_events", "repos_url": "https://api.github.com/users/peterezzo/repos", "site_admin": false, "starred_url": "https://api.github.com/users/peterezzo/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/peterezzo/subscriptions", "type": "User", "url": "https://api.github.com/users/peterezzo", "user_view_type": "public" }
[]
closed
true
null
[]
null
5
2023-02-24T14:00:33Z
2024-06-01T00:04:02Z
2023-06-01T22:38:21Z
NONE
resolved
When using requests without following redirects the Response objects do not retain the _next PreparedRequest when pickled. ## Actual Result ``` >>> res = pickle.loads(pickle.dumps(requests.Response())) >>> res.next Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/Users/pete/Library/Python/3.9/lib/python/site-packages/requests/models.py", line 788, in next return self._next AttributeError: 'Response' object has no attribute '_next' ``` ## Fix? ``` >>> requests.models.Response.__attrs__ += ['_next'] >>> res = pickle.loads(pickle.dumps(requests.Response())) >>> res.next >>> ```
{ "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/6361/reactions" }
https://api.github.com/repos/psf/requests/issues/6361/timeline
null
completed
null
null
false
[ "What you have here is a bug without a use case to motivate it. Why are you pickling responses and trying to follow redirects in another place after unpickling? The next attribute would be unwise to try to pickle and unpickle.\n\nIn short, we almost certainly don't want to support this. But you haven't told us why you think we should ", "I have a script that makes requests without following redirects and caches the objects for offline replay. It's not transferring responses to another place. It does consume the Response.next.url if it is present.\r\n\r\nIf you don't want to make it pickleable, you could just init the _next attribute in __setstate__ like raw.", "Next is deprecated because it should never have been implemented. You want the value of the Location header", "Did you just make that up? Anyway, I just thought you should know.", "The issue tracker has plenty of bugs including one with a plan to get rid of the attribute. No I didn't just make it up. " ]
https://api.github.com/repos/psf/requests/issues/6360
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6360/labels{/name}
https://api.github.com/repos/psf/requests/issues/6360/comments
https://api.github.com/repos/psf/requests/issues/6360/events
https://github.com/psf/requests/pull/6360
1,595,906,765
PR_kwDOABTKOs5Kjl4w
6,360
cache proxy configuration to get 12.5% speedup
{ "avatar_url": "https://avatars.githubusercontent.com/u/14973?v=4", "events_url": "https://api.github.com/users/SonOfLilit/events{/privacy}", "followers_url": "https://api.github.com/users/SonOfLilit/followers", "following_url": "https://api.github.com/users/SonOfLilit/following{/other_user}", "gists_url": "https://api.github.com/users/SonOfLilit/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/SonOfLilit", "id": 14973, "login": "SonOfLilit", "node_id": "MDQ6VXNlcjE0OTcz", "organizations_url": "https://api.github.com/users/SonOfLilit/orgs", "received_events_url": "https://api.github.com/users/SonOfLilit/received_events", "repos_url": "https://api.github.com/users/SonOfLilit/repos", "site_admin": false, "starred_url": "https://api.github.com/users/SonOfLilit/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/SonOfLilit/subscriptions", "type": "User", "url": "https://api.github.com/users/SonOfLilit", "user_view_type": "public" }
[]
closed
true
null
[]
null
4
2023-02-22T22:06:22Z
2024-02-23T00:03:15Z
2023-02-22T22:43:40Z
NONE
resolved
I didn't plan to submit a PR, I was just playing around, but the speedup I got (granted, on a very superficial benchmark) was so high that I just had to try. On my Macbook Air M1, 12.5% of runtime of a simplistic benchmark (see below) was spent on calls to `should_bypass_proxies()` which seems to call some OS-dependent code to get proxy bypass config, and I figure in most use cases it will be called repeatedly with a small number of hostnames and it's 100% ok to cache it (*is it?* I'm not an expert in `requests` use cases and maybe some people expect the OS config to change while the process is running and would consider this a breaking change). Did my best to write clear code and document it well. Wrote tests. Code passes tox (except for py3.7 that I don't have installed). Before: ``` 1145706 function calls (1139516 primitive calls) in 1.041 seconds Ordered by: internal time List reduced from 1546 to 10 due to restriction <10> ncalls tottime percall cumtime percall filename:lineno(function) 800 0.261 0.000 0.261 0.000 {method 'recv_into' of '_socket.socket' objects} 100 0.060 0.001 0.060 0.001 encoder.py:204(iterencode) 200 0.056 0.000 0.057 0.000 {built-in method _socket.getaddrinfo} 200 0.053 0.000 0.053 0.000 {built-in method _socket.gethostbyname} 100 0.042 0.000 0.042 0.000 decoder.py:343(raw_decode) 200 0.041 0.000 0.041 0.000 {built-in method _scproxy._get_proxy_settings} 3800 0.034 0.000 0.041 0.000 shlex.py:133(read_token) 200 0.030 0.000 0.030 0.000 {built-in method _scproxy._get_proxies} 200 0.028 0.000 0.028 0.000 {method 'connect' of '_socket.socket' objects} 200 0.024 0.000 0.025 0.000 {built-in method io.open} ``` After: ``` 916904 function calls (910715 primitive calls) in 0.920 seconds Ordered by: internal time List reduced from 1533 to 10 due to restriction <10> ncalls tottime percall cumtime percall filename:lineno(function) 800 0.258 0.000 0.258 0.000 {method 'recv_into' of '_socket.socket' objects} 200 0.064 0.000 0.064 0.000 {built-in method _socket.getaddrinfo} 100 0.061 0.001 0.061 0.001 encoder.py:204(iterencode) 100 0.042 0.000 0.042 0.000 decoder.py:343(raw_decode) 200 0.035 0.000 0.035 0.000 {built-in method _scproxy._get_proxies} 3800 0.034 0.000 0.041 0.000 shlex.py:133(read_token) 200 0.026 0.000 0.026 0.000 {method 'connect' of '_socket.socket' objects} 200 0.025 0.000 0.026 0.000 {built-in method io.open} 26/22 0.021 0.001 0.023 0.001 {built-in method _imp.create_dynamic} 1 0.015 0.015 0.799 0.799 bench.py:3(test) ``` Note these lines in particular: ``` 200 0.064 0.000 0.064 0.000 {built-in method _socket.getaddrinfo} 200 0.041 0.000 0.041 0.000 {built-in method _scproxy._get_proxy_settings} ``` This is the benchmark I used: `bench.py`: ```python3 import requests def test(): for _ in (range(10)): session = requests.Session() for _ in range(10): response = session.get('http://localhost:8000/home', params={'q': 'who are you?'}) response.raise_for_status() response.content response = session.post('http://localhost:8000/api', json={'type': 'query', 'data': list(range(10000))}) response.raise_for_status() response.json() if __name__ == '__main__': test() ``` `bench_server.py`: ```python3 from flask import Flask, request app = Flask(__name__) @app.route('/home') def home(): return 'Hello, World! ' + 'A' * 10000 @app.route('/api', methods=['POST']) def api(): return request.json if __name__ == '__main__': app.run(port=8000) ``` ``` gunicorn bench_server:app ``` ``` python -m timeit 'import bench; bench.test()' ``` ``` (requests) ➜ requests git:(cache-proxy-config) ✗ ./toxin.sh -e py38-default "python -m timeit 'import bench; bench.test()'" 1 loop, best of 5: 654 msec per loop (requests) ➜ requests git:(cache-proxy-config) ✗ ./toxin.sh -e py38-default "python -m timeit 'import bench; bench.test()'" 1 loop, best of 5: 664 msec per loop (requests) ➜ requests git:(cache-proxy-config) ✗ ./toxin.sh -e py38-default "python -m timeit 'import bench; bench.test()'" 1 loop, best of 5: 685 msec per loop (requests) ➜ requests git:(cache-proxy-config) ✗ ./toxin.sh -e py38-default "python -m timeit 'import bench; bench.test()'" 1 loop, best of 5: 750 msec per loop (requests) ➜ requests git:(cache-proxy-config) ✗ ./toxin.sh -e py38-default "python -m timeit 'import bench; bench.test()'" 1 loop, best of 5: 759 msec per loop (requests) ➜ requests git:(cache-proxy-config) ✗ ./toxin.sh -e py38-default "python -m timeit 'import bench; bench.test()'" 1 loop, best of 5: 770 msec per loop (requests) ➜ requests git:(cache-proxy-config) ✗ python -c 'print(1 - 664/759)' 0.12516469038208167```
{ "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/6360/reactions" }
https://api.github.com/repos/psf/requests/issues/6360/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/6360.diff", "html_url": "https://github.com/psf/requests/pull/6360", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/6360.patch", "url": "https://api.github.com/repos/psf/requests/pulls/6360" }
true
[ "Hi @SonOfLilit,\r\n\r\nThanks for the suggestion! I'm not sure I'm seeing conclusive data for the improvements claim though. Requests has a fairly diverse user population. There are several variables we'd need to weigh including frequency of underlying configuration changes, number of proxies/configurations used and operating system before we can make any conclusions on performance.\r\n\r\nThere may be some minor performance improvements to be had, but introduction of a cache also introduces a new set of problems. Any changes in the underlying OS configurations may be ignored and there's no reasonable way to force cache eviction with this approach. We're also largely under a feature freeze, so I think it's unlikely we'll accept this at this time.", "Thanks for the quick response.\r\n\r\nEviction is not reasonable to support here, but I don't see any reason to - would developers expect an existing session to react to changes in proxy bypass OS configuration? I'd expect to need to restart the process in this case, not just the session.\r\n\r\nThe performance claims are indeed Mac-only at this time. If I try this on Windows and Linux and see consistent >10% gains, will it make a difference?\r\n\r\nAlso, need help maintaining this project? It's my favorite python package since the day it came out, I can find some time in my day to do some code reviews.", "> Eviction is not reasonable to support here, but I don't see any reason to [...] I'd expect to need to restart the process in this case, not just the session.\r\n\r\nSo that's an assumption, but it's not a data point without validation. The first concerns would be resolution from the[ Windows Registry](https://github.com/psf/requests/blob/main/requests/utils.py#L68-L116) and macOS system configurations via [SCDynamicCopyStoreProxies](https://developer.apple.com/documentation/systemconfiguration/1517088-scdynamicstorecopyproxies) ([cpython ref](https://github.com/python/cpython/blob/main/Modules/_scproxy.c#L171-L216)). I'm not claiming these are dynamic during a process' lifecycle because I haven't tested it. It would not surprise me if both are queried in real time and subject to change.\r\n\r\n> The performance claims are indeed Mac-only at this time.\r\n\r\nThe data currently is for a fairly naive idea of how proxy configurations work. They demonstrate a single use-case experiences improvement at the potential cost of incorrect data. We'll always optimize for correctness over speed.\r\n\r\nThere's likely an eventuality where we could work through this to reach a conclusion but I don't think it's worth the time trade-off to do it right.\r\n\r\n> Also, need help maintaining this project?\r\n\r\nWe appreciate the offer but I don't think code reviewing is the current bottleneck. All changes need to be weighed for potential impact and added complexity to the library. For the time being, we're relatively OK with the libraries current functionality and don't intend to make any significant changes.", "On Thu, Feb 23, 2023, 01:20 Nate Prewitt ***@***.***> wrote:\n\n> Eviction is not reasonable to support here, but I don't see any reason to\n> [...] I'd expect to need to restart the process in this case, not just the\n> session.\n>\n> So that's an assumption, but it's not a data point without validation.\n> [..] I'm not claiming these are dynamic during a process' lifecycle because\n> I haven't tested it. It would not surprise me if both are queried in real\n> time and subject to change.\n>\nOh no, I'm almost sure they're queried in real time and subject to change.\nThe assumption is about user expectations. I'm essentially saying \"the\ncurrent behavior is probably perceived as a bit more buggy than the\nproposed change\". I know this is an always-wrong thing to say, but I'd be\nsurprised if any users ever considered what behavior they want in this\ncase, other than an obligatory xkcd.com/1172 guy of course.\n\nWe appreciate the offer but I don't think code reviewing is the current\n> bottleneck. All changes need to be weighed for potential impact and added\n> complexity to the library.\n>\nYeah, that's what I meant by code review for a library that the entire\nsoftware world depends on.\n\nAlright, I'll stop taking your time, thanks for doing all this!\n\n> —\n> Reply to this email directly, view it on GitHub\n> <https://github.com/psf/requests/pull/6360#issuecomment-1440989131>, or\n> unsubscribe\n> <https://github.com/notifications/unsubscribe-auth/AAADU7NMXZNNR6WSALOSF5LWY2NMXANCNFSM6AAAAAAVE4DRTQ>\n> .\n> You are receiving this because you were mentioned.Message ID:\n> ***@***.***>\n>\n" ]
https://api.github.com/repos/psf/requests/issues/6359
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6359/labels{/name}
https://api.github.com/repos/psf/requests/issues/6359/comments
https://api.github.com/repos/psf/requests/issues/6359/events
https://github.com/psf/requests/issues/6359
1,593,638,865
I_kwDOABTKOs5e_P_R
6,359
Requests sends NUL characters in headers.
{ "avatar_url": "https://avatars.githubusercontent.com/u/325643?v=4", "events_url": "https://api.github.com/users/CharString/events{/privacy}", "followers_url": "https://api.github.com/users/CharString/followers", "following_url": "https://api.github.com/users/CharString/following{/other_user}", "gists_url": "https://api.github.com/users/CharString/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/CharString", "id": 325643, "login": "CharString", "node_id": "MDQ6VXNlcjMyNTY0Mw==", "organizations_url": "https://api.github.com/users/CharString/orgs", "received_events_url": "https://api.github.com/users/CharString/received_events", "repos_url": "https://api.github.com/users/CharString/repos", "site_admin": false, "starred_url": "https://api.github.com/users/CharString/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/CharString/subscriptions", "type": "User", "url": "https://api.github.com/users/CharString", "user_view_type": "public" }
[]
closed
true
null
[]
null
5
2023-02-21T15:03:55Z
2024-02-24T00:03:15Z
2023-02-23T16:46:15Z
NONE
resolved
https://www.rfc-editor.org/rfc/rfc9110#section-5 ## Expected Result Some ValueError when I pass a NUL in header. ## Actual Result ``` < 00000000 47 45 54 20 2f 20 48 54 54 50 2f 31 2e 31 0d 0a # GET / HTTP/1.1.. < 00000010 48 6f 73 74 3a 20 31 32 37 2e 30 2e 30 2e 31 3a # Host: 127.0.0.1: < 00000020 39 39 39 39 0d 0a 55 73 65 72 2d 41 67 65 6e 74 # 9999..User-Agent < 00000030 3a 20 70 79 74 68 6f 6e 2d 72 65 71 75 65 73 74 # : python-request < 00000040 73 2f 32 2e 32 38 2e 32 0d 0a 41 63 63 65 70 74 # s/2.28.2..Accept < 00000050 2d 45 6e 63 6f 64 69 6e 67 3a 20 67 7a 69 70 2c # -Encoding: gzip, < 00000060 20 64 65 66 6c 61 74 65 0d 0a 41 63 63 65 70 74 # deflate..Accept < 00000070 3a 20 2a 2f 2a 0d 0a 43 6f 6e 6e 65 63 74 69 6f # : */*..Connectio < 00000080 6e 3a 20 6b 65 65 70 2d 61 6c 69 76 65 0d 0a 66 # n: keep-alive..f < 00000090 6f 6f 20 3a 20 74 65 73 74 00 74 65 73 74 0d 0a # oo : test.test.. < 000000a0 0d 0a # .. ``` Note the `00` between the `test`s. ## Reproduction Steps In a shell, start a netcat to listen ```sh $ nc -l -p 9999 -o /dev/stderr >/dev/null ``` ```python import requests requests.get('http://127.0.0.1:9999', headers = {'foo ': 'test\x00test'}) ``` ## System Information $ python -m requests.help ```json { "chardet": { "version": null }, "charset_normalizer": { "version": "3.0.1" }, "cryptography": { "version": "" }, "idna": { "version": "3.4" }, "implementation": { "name": "CPython", "version": "3.10.8" }, "platform": { "release": "6.0.0-0.deb11.6-amd64", "system": "Linux" }, "pyOpenSSL": { "openssl_version": "", "version": null }, "requests": { "version": "2.28.2" }, "system_ssl": { "version": "101010ef" }, "urllib3": { "version": "1.26.14" }, "using_charset_normalizer": true, "using_pyopenssl": false } ```
{ "avatar_url": "https://avatars.githubusercontent.com/u/325643?v=4", "events_url": "https://api.github.com/users/CharString/events{/privacy}", "followers_url": "https://api.github.com/users/CharString/followers", "following_url": "https://api.github.com/users/CharString/following{/other_user}", "gists_url": "https://api.github.com/users/CharString/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/CharString", "id": 325643, "login": "CharString", "node_id": "MDQ6VXNlcjMyNTY0Mw==", "organizations_url": "https://api.github.com/users/CharString/orgs", "received_events_url": "https://api.github.com/users/CharString/received_events", "repos_url": "https://api.github.com/users/CharString/repos", "site_admin": false, "starred_url": "https://api.github.com/users/CharString/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/CharString/subscriptions", "type": "User", "url": "https://api.github.com/users/CharString", "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/6359/reactions" }
https://api.github.com/repos/psf/requests/issues/6359/timeline
null
completed
null
null
false
[ "So there's a difference between generating header names or values with nul characters and users sending them.\n\nIn the past when we've tried to make rules like this more restrictive we've encountered significant push back as people use requests for penetration testing and other security tasks where being able to send invalid information is valuable.\n\nI think we could fix this, but it would only serve to further reduce time to work on the project since about 2 of us ever manage to respond to issues and that takes up most of our time. This would generate more issues complaining that we closed this issue with user generated data ", "I was using requests to send requests to OpenAPI services. Putting user input into the request headers, when I noticed this.\r\nI hope the vast majority of users is trying to behave well and uses requests to package good behaviour in an easy to grok package. The burden for misbehaviour should be on the ones wanting such malice, the default should follow spec.\r\n\r\nFeel free to close this issue as noise if you disagree. I'm sorry for the inconvenience, I was just trying to follow [the robustness principle](https://www.rfc-editor.org/rfc/rfc1122.html#page-12) and be a good netizen. I would have been willing to write code to solve this, but I trust you know your user base better than I do.", "In all candor, what you're describing is how security breaks down in practice. \"I shouldn't have to worry about X because the underlying libraries must handle that for me at all costs.\" Unfortunately, requests is _old_ and has too many users to introduce behaviour like this without careful consideration and planning. We could add a warning if we detect this that it'll be deprecated and actually introduce an exception for this in a few minor releases from now, but that will not fix your existing issue on a timescale that I expect you'll find reasonable.\r\n\r\n> The burden for misbehaviour should be on the ones wanting such malice\r\n\r\nPenetration testing isn't a malicious act. Many people do it proactively to understand the behaviour of their systems under unexpected inputs. There are many layers to verifying that you do the correct thing with the input to your system, but no one builds an application entirely from the TCP layer up any longer. We all stand on the shoulders of someone else, and testing te entire stack is very valuable work. It's different from someone looking for a weakness to exploit to get sensitive data.", "I'm fine with it deemed out of scope for the library. I bumped into this, saw that there was code in place making sure the header values fall in the latin-1 codespace, and thought this was an oversight and reported it.\r\n\r\nI'm familiar with pen testing. I just think the default behaviour of a general purpose library should fall within spec and let Red Team tools explicitly opt-in to out of spec behaviour.", "The problem is red teams already using it in that way will probably be surprised by this and in the current state of technology units, likely underfunded to do the work to fix things. I'm not opposed to fixing this, but I want to be clear that it's not possible to do this fast and easy" ]
https://api.github.com/repos/psf/requests/issues/6358
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6358/labels{/name}
https://api.github.com/repos/psf/requests/issues/6358/comments
https://api.github.com/repos/psf/requests/issues/6358/events
https://github.com/psf/requests/issues/6358
1,592,486,445
I_kwDOABTKOs5e62ot
6,358
I get confused using python documentation HELP
{ "avatar_url": "https://avatars.githubusercontent.com/u/62204061?v=4", "events_url": "https://api.github.com/users/abhijit420kb/events{/privacy}", "followers_url": "https://api.github.com/users/abhijit420kb/followers", "following_url": "https://api.github.com/users/abhijit420kb/following{/other_user}", "gists_url": "https://api.github.com/users/abhijit420kb/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/abhijit420kb", "id": 62204061, "login": "abhijit420kb", "node_id": "MDQ6VXNlcjYyMjA0MDYx", "organizations_url": "https://api.github.com/users/abhijit420kb/orgs", "received_events_url": "https://api.github.com/users/abhijit420kb/received_events", "repos_url": "https://api.github.com/users/abhijit420kb/repos", "site_admin": false, "starred_url": "https://api.github.com/users/abhijit420kb/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/abhijit420kb/subscriptions", "type": "User", "url": "https://api.github.com/users/abhijit420kb", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2023-02-20T21:54:06Z
2024-02-21T00:03:15Z
2023-02-20T22:03:21Z
NONE
resolved
for an example: https://docs.python-requests.org/en/latest/api/#requests.cookies.RequestsCookieJar.set `set(name, value, **kwargs)` `Dict-like set() that also supports optional domain and path args in order to resolve naming collisions from using one cookie jar over multiple domains.` But where I found `**kwargs` information's like what other arguments its take :-( I mean about these arguments domain, path, expires, max_age, secure, httponly All other functions are same as like this, I got total confused what to pass as parameters. I am sorry for NOOB like question. but I am really straggle with it a lot. in php.net they are describe all parameters properly. Where I found all parameters are hidden with `**kwargs`. 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/6358/reactions" }
https://api.github.com/repos/psf/requests/issues/6358/timeline
null
completed
null
null
false
[ "Hi @abhijit420kb,\r\n\r\nThis is specified at the top of the class:\r\n\r\n```\r\nCompatibility class; is a cookielib.CookieJar, but exposes a dict interface.\r\n```\r\n\r\nYou can find the parameters supported by default in the constructor for Python's [Cookie](https://github.com/python/cpython/blob/3.11/Lib/http/cookiejar.py#L743-L801). This may vary depending on Python version/underlying CookieJar implementation which is why this information is defined to be optional `**kwargs`." ]
https://api.github.com/repos/psf/requests/issues/6357
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6357/labels{/name}
https://api.github.com/repos/psf/requests/issues/6357/comments
https://api.github.com/repos/psf/requests/issues/6357/events
https://github.com/psf/requests/issues/6357
1,590,708,982
I_kwDOABTKOs5e0Er2
6,357
`logging` module cause error due to `format`
{ "avatar_url": "https://avatars.githubusercontent.com/u/390889?v=4", "events_url": "https://api.github.com/users/mmahmoudian/events{/privacy}", "followers_url": "https://api.github.com/users/mmahmoudian/followers", "following_url": "https://api.github.com/users/mmahmoudian/following{/other_user}", "gists_url": "https://api.github.com/users/mmahmoudian/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/mmahmoudian", "id": 390889, "login": "mmahmoudian", "node_id": "MDQ6VXNlcjM5MDg4OQ==", "organizations_url": "https://api.github.com/users/mmahmoudian/orgs", "received_events_url": "https://api.github.com/users/mmahmoudian/received_events", "repos_url": "https://api.github.com/users/mmahmoudian/repos", "site_admin": false, "starred_url": "https://api.github.com/users/mmahmoudian/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/mmahmoudian/subscriptions", "type": "User", "url": "https://api.github.com/users/mmahmoudian", "user_view_type": "public" }
[]
closed
true
null
[]
null
3
2023-02-19T14:30:49Z
2024-02-21T00:03:16Z
2023-02-20T14:34:35Z
NONE
resolved
First and foremost, thanks for this package. I am trying to use this package for some GET queries but it creates error if I have set the `format` for the logging module. Have these example snippets: This will work just fine ```python import requests import logging logging.basicConfig(filename = 'log.txt', encoding = 'utf-8', level = logging.DEBUG) resp = requests.get("https://ifconfig.io/") ``` This will throw error ```python import requests import logging logging.basicConfig(filename = 'log.txt', encoding = 'utf-8', format = '%(asctime)s;%(function)s;%(message)s', level = logging.DEBUG) resp = requests.get("https://ifconfig.io/") ``` <details> <summary>To see the output error, expand this</summary> ``` --- Logging error --- Traceback (most recent call last): File "/usr/lib/python3.10/logging/__init__.py", line 440, in format return self._format(record) File "/usr/lib/python3.10/logging/__init__.py", line 436, in _format return self._fmt % values KeyError: 'function' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/lib/python3.10/logging/__init__.py", line 1100, in emit msg = self.format(record) File "/usr/lib/python3.10/logging/__init__.py", line 943, in format return fmt.format(record) File "/usr/lib/python3.10/logging/__init__.py", line 681, in format s = self.formatMessage(record) File "/usr/lib/python3.10/logging/__init__.py", line 650, in formatMessage return self._style.format(record) File "/usr/lib/python3.10/logging/__init__.py", line 442, in format raise ValueError('Formatting field not found in record: %s' % e) ValueError: Formatting field not found in record: 'function' Call stack: File "<stdin>", line 1, in <module> File "/home/mehrad/Documents/git_repos/projectX/Python/venv/lib/python3.10/site-packages/requests/api.py", line 73, in get return request("get", url, params=params, **kwargs) File "/home/mehrad/Documents/git_repos/projectX/Python/venv/lib/python3.10/site-packages/requests/api.py", line 59, in request return session.request(method=method, url=url, **kwargs) File "/home/mehrad/Documents/git_repos/projectX/Python/venv/lib/python3.10/site-packages/requests/sessions.py", line 587, in request resp = self.send(prep, **send_kwargs) File "/home/mehrad/Documents/git_repos/projectX/Python/venv/lib/python3.10/site-packages/requests/sessions.py", line 701, in send r = adapter.send(request, **kwargs) File "/home/mehrad/Documents/git_repos/projectX/Python/venv/lib/python3.10/site-packages/requests/adapters.py", line 489, in send resp = conn.urlopen( File "/home/mehrad/Documents/git_repos/projectX/Python/venv/lib/python3.10/site-packages/urllib3/connectionpool.py", line 692, in urlopen conn = self._get_conn(timeout=pool_timeout) File "/home/mehrad/Documents/git_repos/projectX/Python/venv/lib/python3.10/site-packages/urllib3/connectionpool.py", line 281, in _get_conn return conn or self._new_conn() File "/home/mehrad/Documents/git_repos/projectX/Python/venv/lib/python3.10/site-packages/urllib3/connectionpool.py", line 1003, in _new_conn log.debug( Message: 'Starting new HTTPS connection (%d): %s:%s' Arguments: (1, 'ifconfig.io', 443) --- Logging error --- Traceback (most recent call last): File "/usr/lib/python3.10/logging/__init__.py", line 440, in format return self._format(record) File "/usr/lib/python3.10/logging/__init__.py", line 436, in _format return self._fmt % values KeyError: 'function' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/lib/python3.10/logging/__init__.py", line 1100, in emit msg = self.format(record) File "/usr/lib/python3.10/logging/__init__.py", line 943, in format return fmt.format(record) File "/usr/lib/python3.10/logging/__init__.py", line 681, in format s = self.formatMessage(record) File "/usr/lib/python3.10/logging/__init__.py", line 650, in formatMessage return self._style.format(record) File "/usr/lib/python3.10/logging/__init__.py", line 442, in format raise ValueError('Formatting field not found in record: %s' % e) ValueError: Formatting field not found in record: 'function' Call stack: File "<stdin>", line 1, in <module> File "/home/mehrad/Documents/git_repos/projectX/Python/venv/lib/python3.10/site-packages/requests/api.py", line 73, in get return request("get", url, params=params, **kwargs) File "/home/mehrad/Documents/git_repos/projectX/Python/venv/lib/python3.10/site-packages/requests/api.py", line 59, in request return session.request(method=method, url=url, **kwargs) File "/home/mehrad/Documents/git_repos/projectX/Python/venv/lib/python3.10/site-packages/requests/sessions.py", line 587, in request resp = self.send(prep, **send_kwargs) File "/home/mehrad/Documents/git_repos/projectX/Python/venv/lib/python3.10/site-packages/requests/sessions.py", line 701, in send r = adapter.send(request, **kwargs) File "/home/mehrad/Documents/git_repos/projectX/Python/venv/lib/python3.10/site-packages/requests/adapters.py", line 489, in send resp = conn.urlopen( File "/home/mehrad/Documents/git_repos/projectX/Python/venv/lib/python3.10/site-packages/urllib3/connectionpool.py", line 703, in urlopen httplib_response = self._make_request( File "/home/mehrad/Documents/git_repos/projectX/Python/venv/lib/python3.10/site-packages/urllib3/connectionpool.py", line 456, in _make_request log.debug( Message: '%s://%s:%s "%s %s %s" %s %s' Arguments: ('https', 'ifconfig.io', 443, 'GET', '/', 'HTTP/1.1', 200, None) ``` </details> And of course the error can be bypassed by changing the logging level to for example `logging.INFO`, but that is besides the point. I'm now that savvy in python world to know if this should be treated as a bug of this package or there is a correct way to handle this in my own code. To me it seems that this is a bug as `requests` should be able to change the format internally on the fly and set it back to user defined. But again, I'm not that pro, so any guidance and suggestions is very welcome.
{ "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/6357/reactions" }
https://api.github.com/repos/psf/requests/issues/6357/timeline
null
not_planned
null
null
false
[ "I don't see anything that should be populating the function variable for you. Python doesn't have a way to log the function name but can log the module name via `name`. This appears to be an issue in the format string you chose, not this library (which itself contains no log statements) or its dependencies ", "@sigmavirus24 Thanks for your answer but:\r\n\r\n## 1 \r\n\r\n> this library (which itself contains no log statements) or its dependencies\r\n\r\na simple `rg` says otherwise:\r\n\r\nhttps://github.com/psf/requests/blob/15585909c3dd3014e4083961c8a404709450151c/requests/__init__.py#L145\r\n\r\nhttps://github.com/psf/requests/blob/15585909c3dd3014e4083961c8a404709450151c/requests/__init__.py#L177\r\n\r\n-------\r\n\r\n## 2\r\n\r\n> This appears to be an issue in the format string you chose\r\n\r\nI should be able to use whatever format string that I see fit for my project, and dependencies (i.e `requests` should not either dictate a format to the project nor they should fail. What am I missing? Also, my project works just fine if I don't try to use anything from `requests` package. the moment I start using this package I get the error that I mentioned above.\r\n\r\n-------\r\n\r\n## 3\r\n\r\n> Python doesn't have a way to log the function name but can log the module name via name.\r\n\r\nI think you are misunderstanding what I mean. the `%(function)` in the format is something that I'm passing as string to the logging. It has nothing to do with this. but if you are curious, I do this in python to get the function that have called my logging function:\r\n\r\n```python\r\ntmp_caller = sys._getframe().f_back.f_code.co_name\r\ntmp_caller={'function': tmp_caller}\r\nlogging.critical(\"some stuff here\", extra = tmp_caller)\r\n```\r\n\r\nand you can see that it works if you replace the string in the \"tmp_caller\" as the following:\r\n\r\n```python\r\nimport logging\r\nlogging.basicConfig(filename = 'log.txt',\r\n encoding = 'utf-8',\r\n format = '%(asctime)s;%(function)s;%(message)s',\r\n level = logging.DEBUG)\r\n\r\ntmp_caller = \"func_blah_blah\"\r\ntmp_caller = {'function': tmp_caller}\r\nlogging.critical(\"some stuff here\", extra = tmp_caller)\r\n```\r\n", "> simple rg says otherwise\n\nYou didn't understand me. There's an import and a handler registered but we don't log anything. If you look at your stack trace the module the exception is coming from is not requests but our dependency urllib3. \n\n> I should be able to use whatever format string that I see fit for my project, and dependencies (i.e requests should not either dictate a format to the project nor they should fail. What am I missing?\n\nWhat you're missing is that you're configuring that string for everything running in the process, that's what `basicConfig` does. For that to work, every dependency needs to provide `function` to be formatted into the log record. Most will certainly not do that. You could create your own LogRecord class so it's created with a function value always. \n\nOtherwise, if you want to overwrite all other configuration of how log messages must be formatted, you need to ensure the values you want templated exist everywhere. \n\n> I think you are misunderstanding what I mean. the %(function) in the format is something that I'm passing as string to the logging. It has nothing to do with this. \n\nNo, I'm not. Please read the stdlib documentation. I've already given you pointers to make this work, but the problem is 100% on your end. You're not understanding what you're doing and you haven't validated your expectations. Other libraries may work fine because they're not logging anything. That doesn't imply a big in this library or it's dependencies" ]
https://api.github.com/repos/psf/requests/issues/6356
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6356/labels{/name}
https://api.github.com/repos/psf/requests/issues/6356/comments
https://api.github.com/repos/psf/requests/issues/6356/events
https://github.com/psf/requests/pull/6356
1,589,611,175
PR_kwDOABTKOs5KO2Pd
6,356
Allow str/bytes subclasses to be used as header parts
{ "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" }
[]
closed
true
null
[]
null
2
2023-02-17T16:19:43Z
2024-03-03T00:03:33Z
2023-03-03T20:39:03Z
MEMBER
resolved
Closes https://github.com/psf/requests/issues/6159 Adapted from https://github.com/nateprewitt/requests/commit/66fcc9c88cf5a53e85322305f41006032744cbe3 but also supports mixed type tuples.
{ "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": 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/6356/reactions" }
https://api.github.com/repos/psf/requests/issues/6356/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/6356.diff", "html_url": "https://github.com/psf/requests/pull/6356", "merged_at": "2023-03-03T20:39:03Z", "patch_url": "https://github.com/psf/requests/pull/6356.patch", "url": "https://api.github.com/repos/psf/requests/pulls/6356" }
true
[ "If you can rebase this onto the linting change, I think this is set.", "@nateprewitt Done, ready for review!" ]
https://api.github.com/repos/psf/requests/issues/6355
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6355/labels{/name}
https://api.github.com/repos/psf/requests/issues/6355/comments
https://api.github.com/repos/psf/requests/issues/6355/events
https://github.com/psf/requests/issues/6355
1,589,258,303
I_kwDOABTKOs5euig_
6,355
[BUG]: Requests post is blocking in python code, but server is receiving the data (Not sure if it is bug)
{ "avatar_url": "https://avatars.githubusercontent.com/u/43678329?v=4", "events_url": "https://api.github.com/users/mai1x9/events{/privacy}", "followers_url": "https://api.github.com/users/mai1x9/followers", "following_url": "https://api.github.com/users/mai1x9/following{/other_user}", "gists_url": "https://api.github.com/users/mai1x9/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/mai1x9", "id": 43678329, "login": "mai1x9", "node_id": "MDQ6VXNlcjQzNjc4MzI5", "organizations_url": "https://api.github.com/users/mai1x9/orgs", "received_events_url": "https://api.github.com/users/mai1x9/received_events", "repos_url": "https://api.github.com/users/mai1x9/repos", "site_admin": false, "starred_url": "https://api.github.com/users/mai1x9/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/mai1x9/subscriptions", "type": "User", "url": "https://api.github.com/users/mai1x9", "user_view_type": "public" }
[]
closed
true
null
[]
null
6
2023-02-17T12:06:18Z
2023-02-18T12:11:06Z
2023-02-18T12:11:06Z
NONE
null
Code: Below post request is run from separate thread with `daemon=True` set ``` print("Sending request to: ", LOG_AUTH_SERVER_URL) r = requests.post(url=LOG_AUTH_SERVER_URL, json={ "clientid": "a12hello", }, timeout=5, headers={ 'Connection': 'close' }) print("After request ...") ``` After sending the request, the print statement ``` print("After request ...") ``` is never executed at all. I could see the url is hit to server as it clearly logged and sent 200. However, in python code the print statement is never executed. After debugging for hours, I could see that I am importing `pygame` in one of the python file as shown below, ``` try: import contextlib os.environ['PYGAME_HIDE_SUPPORT_PROMPT'] = "hide" with contextlib.redirect_stdout(None): import pygame.camera import pygame import pygame.image is_pygame = True except ImportError: is_pygame = False raise Exception( "pygame import error, install pygame and linux/windows dev dependencies. " ) ``` When I have removed `import contextlib` and only imported `pygame`, the code has worked without blocking and the print statement got executed successfully. After modifcation: ``` os.environ['PYGAME_HIDE_SUPPORT_PROMPT'] = "hide" import pygame.camera import pygame import pygame.image ``` it has worked, But i am not sure what exaclty is happening and why the code got blocked. If I sleep for 1 second before post request it does work if `contextlib` was used earlier.
{ "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/6355/reactions" }
https://api.github.com/repos/psf/requests/issues/6355/timeline
null
not_planned
null
null
false
[ "## Bug details\r\n### Code: the name of the file `httpcore.py`\r\n\r\n![Screenshot (651)](https://user-images.githubusercontent.com/43678329/219650320-30f575c3-9b81-48c9-b9d1-577962beeecd.png)\r\n\r\n-------------\r\n### Code for pygame is in another file, `main.py` as shown below,\r\n\r\n![Screenshot (652)](https://user-images.githubusercontent.com/43678329/219650480-658197db-3cf9-4756-aa35-6dbe42c5f316.png)\r\n\r\n\r\n----------\r\n### Now running the project, which puts the post request, the output is:\r\n\r\n![Screenshot (653)](https://user-images.githubusercontent.com/43678329/219650678-11bf5d5a-47d5-4826-a836-0761ba00ad6d.png)\r\n\r\nIt shows request is sent, but the next print statement is never executed.\r\n```\r\nprint(\"Request Send successfully\", r.status_code, r.text)\r\n```\r\n\r\n\r\n----------------\r\n### After Editing pygame import as shown below, (commented contextlib)\r\n![Screenshot (654)](https://user-images.githubusercontent.com/43678329/219650883-e2ee1f4c-6f82-4a4e-a0e1-dcd0ad57d47f.png)\r\n\r\nand then reran the code, the output is,\r\n\r\n![Screenshot (655)](https://user-images.githubusercontent.com/43678329/219651119-ab8ececb-87db-4694-9637-547a3c4afcc0.png)\r\n\r\nClearly the next print statement is executed with status code and the response data.\r\n```\r\nprint(\"Request Send successfully\", r.status_code, r.text)\r\n\r\n```\r\n\r\n\r\n----------\r\n### If sleep used, as shown below,\r\n![Screenshot (657)](https://user-images.githubusercontent.com/43678329/219651339-2dc59b00-738d-4690-b934-1f85cb483afd.png)\r\n\r\neven if `contextlib` used, i could get the response\r\n\r\n-----------\r\n\r\n## Observations\r\n- Is it bug, surely it is something to do with `contextlib`\r\n- The code was ran many times to reproduce the issue and using context lib indeed reproduced the issue of blocking many times (out of 10 consider 7 to 8)\r\n- However removing contextlib did not reproduce issue, but i am not sure is it really the cause\r\n- using sleep before post request when contextlib used indeed worked but again not sure if it fixes all time\r\n- Any one with internals of request module, is there some sort of locking which had caused the requests to block forever instead of returning due to contextlib usage or some GIL Lock not sure what exactly it is ??\r\n\r\n\r\n@kennethreitz ", "@mai1x9\r\nIt's likely that the contextlib.redirect_stdout(None) call is the source of the problem. This call is redirecting the output of stdout to None, effectively suppressing any output to the console. Since print() statements write to stdout, they are being blocked as well.\r\n\r\n<edit> though why the first print statement before the request is still working...\r\n\r\nwhen you add the sleep WITH contextlib are you still using it with redirect_stdout(None)?", "@michaeltempesta thank you for quick reply. I was worried if my question gets unanswered and I need to hurdle around. A sign of relief since `contextlib` could be an issue. \r\n\r\n\r\n> though why the first print statement before the request is still working...\r\n\r\n\r\nNot just first print statement, all print statements in main thread works. In other words the requests post runs on daemon thread-A but gets blocked. The contextlib with `redirect_sdtout(None)` runs on main thread. In fact main thread will lauch multiple processes using multi processing so we used multi processing spawn and freezed app (just in case if this info might be useful. I have come across scenario where **multiprocessing sometimes blocks logging module forever when written to logs**)\r\n\r\nI could see print statements written in main thread even after contextlib redirect was called all of them executed. However the thread-A with requests post got blocked strangely. \r\n\r\n\r\n> when you add the sleep WITH contextlib are you still using it with redirect_stdout(None)?\r\n\r\nTrue, initially when I didn't knew contextlib could be culprit, I tried out sleeping for second before post request and it did worked even if contextlib with redirect_stdout(None) used. Then after debugging and figuring out contextlib was culprit, I could sense that possibly since requests running on thread-A and contextlib running on Main thread looks like some sort of locking might be happening such that when contextlib std out called from main thread, exaclty then from thread A, requests post is called and a lock (not sure if lock or what else??) might be occurred freezing the subsequent request module. \r\n", "@michaeltempesta Found out, after you have hinted\r\n\r\n> This call is redirecting the output of stdout to None, effectively suppressing any output to the console. Since print() statements write to stdout, they are being blocked as well\r\n\r\n\r\nI can conclude `redirect_stdout(None)` is culprit, after digging into documentation, https://docs.python.org/3/library/contextlib.html?highlight=context#contextlib.redirect_stdout I could see 3 important points\r\n\r\n> Context manager for temporarily redirecting [sys.stdout](https://docs.python.org/3/library/sys.html#sys.stdout) to another file or file-like object.\r\n\r\n> Note that the global side effect on [sys.stdout](https://docs.python.org/3/library/sys.html#sys.stdout) means that this context manager is not suitable for use in library code and most threaded applications. and\r\n\r\nand\r\n\r\n> This context manager is [reentrant](https://docs.python.org/3/library/contextlib.html?highlight=context#reentrant-cms).\r\n\r\nSo clearly, when \r\n```\r\n with contextlib.redirect_stdout(None):\r\n import pygame.camera\r\n import pygame\r\n import pygame.image\r\n```\r\n`with` blocked called, during the same time requests post have given output and all print statements got suppressed since `with` block is not released yet, I could not see print statements after request post giving false **output that the code is blocking.**. Once the `with` block is executed the print statements are executed as usual hence I could see other print statements. I have tried to keep sleep after requests posts,\r\n```\r\nr = requests.post(url=LOG_AUTH_SERVER_URL, json={\r\n \"clientid\": self.clientid\r\n }, timeout=5, headers={\r\n 'Connection': 'close'\r\n }) # timeout 60 seconds\r\n sleep(1)\r\n print(\"======\\n\", r.status_code)\r\n```\r\nNow clearly the `with` block as been executed and hence sleeping for a second indeed printed the output. Overall It has just suppressed the output while `with` block is executed. \r\n\r\nAlso the doc mentioned,\r\n\r\n> Note also that being reentrant is not the same thing as being thread safe. [redirect_stdout()](https://docs.python.org/3/library/contextlib.html?highlight=context#contextlib.redirect_stdout), for example, is definitely not thread safe, as it makes a global modification to the system state by binding [sys.stdout](https://docs.python.org/3/library/sys.html#sys.stdout) to a different stream.\r\n\r\n\r\n**Concluding, it was just the sys stdout got suppressed globally throughout the application blocking all print statements not to print until the `with` block is finished and subsequently other print calls were made and output is visible.**\r\n\r\n\r\nLet me know if I am wrong anywhere in justifying the answer.\r\n\r\nThank you very much.\r\n\r\n\r\n", "(looks like i took too long with my reply ^_^) here's my guess for what may be useful to you, cheers\r\n\r\ni'm going to guess that your threading is creating a race condition between the contextlib imports and the request, std_out(none) kicking in after the pre request print statement and and post request being nullified because of it. \r\nim not confident i can help with this but (i think) your sleep solution is working because it gives the imports time to finish and re-open std_out.\r\n\r\nprint statements on main working because they process after the with context block is closed.\r\n\r\nthe request is working just not printing. \r\nif it really is just a matter of time to wait for the with context block to finish and this is an isolated otherwise incident... make the request in main after the with block?\r\n\r\nmy apologizes but this is me regurgitating chatgpt for using threading.Lock (im not well versed):\r\n`import threading\r\nimport contextlib\r\nimport requests\r\n\r\n# Create a lock object\r\nlock = threading.Lock()\r\n\r\ndef main():\r\n # Acquire the lock before the contextlib block\r\n lock.acquire()\r\n\r\n with contextlib.redirect_stdout(None):\r\n # Perform some output suppression\r\n print(\"This output will not be printed\")\r\n\r\n # Release the lock after the contextlib block\r\n lock.release()\r\n\r\ndef thread_a():\r\n # Acquire the lock before making the request\r\n lock.acquire()\r\n\r\n # Make the request\r\n r = requests.post(url=LOG_AUTH_SERVER_URL, json={\r\n \"clientid\": \"a12hello\",\r\n }, timeout=5, headers={\r\n 'Connection': 'close'\r\n })\r\n\r\n # Release the lock after the request is done\r\n lock.release()\r\n\r\nif __name__ == '__main__':\r\n t = threading.Thread(target=thread_a)\r\n t.start()\r\n\r\n main()\r\n\r\n t.join()\r\n`\r\n\r\ndrop a lock.acquire() in main before the with block and lock.release() after... same for before and after the request?\r\n\r\nhope this helps\r\n", "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." ]
https://api.github.com/repos/psf/requests/issues/6354
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6354/labels{/name}
https://api.github.com/repos/psf/requests/issues/6354/comments
https://api.github.com/repos/psf/requests/issues/6354/events
https://github.com/psf/requests/issues/6354
1,585,305,484
I_kwDOABTKOs5efdeM
6,354
TCP Keep Alive doesn't seem to be enabled by default
{ "avatar_url": "https://avatars.githubusercontent.com/u/67745584?v=4", "events_url": "https://api.github.com/users/ltshb/events{/privacy}", "followers_url": "https://api.github.com/users/ltshb/followers", "following_url": "https://api.github.com/users/ltshb/following{/other_user}", "gists_url": "https://api.github.com/users/ltshb/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/ltshb", "id": 67745584, "login": "ltshb", "node_id": "MDQ6VXNlcjY3NzQ1NTg0", "organizations_url": "https://api.github.com/users/ltshb/orgs", "received_events_url": "https://api.github.com/users/ltshb/received_events", "repos_url": "https://api.github.com/users/ltshb/repos", "site_admin": false, "starred_url": "https://api.github.com/users/ltshb/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/ltshb/subscriptions", "type": "User", "url": "https://api.github.com/users/ltshb", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2023-02-15T06:38:20Z
2024-02-16T00:03:22Z
2023-02-15T13:52:37Z
NONE
resolved
In the documentation, it stated the TCP Keep Alive are enabled by default when using `requests`, but looking at the code it doesn't seem to be the case. ## Expected Result TCP Keep Alive be enable by default. ## Actual Result I could not find anywhere in the code where the TCP Keep Alive are enabled. Maybe I missed something ? In the urllib3 library it seems to me that TCP Keep Alive are not enabled by default, see https://github.com/urllib3/urllib3/blob/5a24dc55d86e4c5ca7fe0bd496da768caf617591/src/urllib3/connection.py#L109. It would also be good to have the possibility to pass socket arguments to the `HTTPAdapter`, for my use case where I needed TCP keep alive, I had to overwrite the `HTTPAdapter` like this in order to pass socket options: ```python class HTTPKeepAliveAdapter(HTTPAdapter): def __init__(self, max_retries): self._pool_kwargs = { 'socket_options': HTTPConnection.default_socket_options + [ (socket.SOL_SOCKET, socket.SO_KEEPALIVE, 1), # enable keep alive (socket.SOL_TCP, socket.TCP_KEEPIDLE, 120), # idle time 120s (socket.SOL_TCP, socket.TCP_KEEPINTVL, 120) ] # interval time 120s } super().__init__(pool_connections=40, pool_maxsize=60, max_retries=max_retries) self.init_poolmanager( self._pool_connections, self._pool_maxsize, block=self._pool_block, **self._pool_kwargs ) def __setstate__(self, state): super().__init__(state) self.init_poolmanager( self._pool_connections, self._pool_maxsize, block=self._pool_block, **self._pool_kwargs ) ``` But I may have missed something as well ?
{ "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/6354/reactions" }
https://api.github.com/repos/psf/requests/issues/6354/timeline
null
completed
null
null
false
[ "If you'd like to specify custom socket options more conveniently, https://toolbelt.readthedocs.io/en/latest/adapters.html#socketoptionsadapter\r\n\r\nI believe TCP Keep-Alive caused more issues than benefits but the references in the docs were never removed. There's also: https://toolbelt.readthedocs.io/en/latest/adapters.html#requests_toolbelt.adapters.socket_options.TCPKeepAliveAdapter to make this easier for folks who know they need it" ]
https://api.github.com/repos/psf/requests/issues/6353
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6353/labels{/name}
https://api.github.com/repos/psf/requests/issues/6353/comments
https://api.github.com/repos/psf/requests/issues/6353/events
https://github.com/psf/requests/issues/6353
1,583,049,332
I_kwDOABTKOs5eW2p0
6,353
Actualización
{ "avatar_url": "https://avatars.githubusercontent.com/u/54210709?v=4", "events_url": "https://api.github.com/users/Perico22/events{/privacy}", "followers_url": "https://api.github.com/users/Perico22/followers", "following_url": "https://api.github.com/users/Perico22/following{/other_user}", "gists_url": "https://api.github.com/users/Perico22/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Perico22", "id": 54210709, "login": "Perico22", "node_id": "MDQ6VXNlcjU0MjEwNzA5", "organizations_url": "https://api.github.com/users/Perico22/orgs", "received_events_url": "https://api.github.com/users/Perico22/received_events", "repos_url": "https://api.github.com/users/Perico22/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Perico22/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Perico22/subscriptions", "type": "User", "url": "https://api.github.com/users/Perico22", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2023-02-13T20:57:33Z
2023-02-13T20:59:18Z
2023-02-13T20:59:15Z
NONE
null
Requests is not accepting feature requests at this time. Escribiendo...
{ "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/6353/reactions" }
https://api.github.com/repos/psf/requests/issues/6353/timeline
null
not_planned
null
null
false
[ "Escribiendo..." ]
https://api.github.com/repos/psf/requests/issues/6352
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6352/labels{/name}
https://api.github.com/repos/psf/requests/issues/6352/comments
https://api.github.com/repos/psf/requests/issues/6352/events
https://github.com/psf/requests/issues/6352
1,581,355,663
I_kwDOABTKOs5eQZKP
6,352
Request don't return value while curl does
{ "avatar_url": "https://avatars.githubusercontent.com/u/50611130?v=4", "events_url": "https://api.github.com/users/Ohadkaiser/events{/privacy}", "followers_url": "https://api.github.com/users/Ohadkaiser/followers", "following_url": "https://api.github.com/users/Ohadkaiser/following{/other_user}", "gists_url": "https://api.github.com/users/Ohadkaiser/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Ohadkaiser", "id": 50611130, "login": "Ohadkaiser", "node_id": "MDQ6VXNlcjUwNjExMTMw", "organizations_url": "https://api.github.com/users/Ohadkaiser/orgs", "received_events_url": "https://api.github.com/users/Ohadkaiser/received_events", "repos_url": "https://api.github.com/users/Ohadkaiser/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Ohadkaiser/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Ohadkaiser/subscriptions", "type": "User", "url": "https://api.github.com/users/Ohadkaiser", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2023-02-12T18:10:00Z
2024-02-13T00:03:25Z
2023-02-12T22:10:42Z
NONE
resolved
Hi, I have an issue while making a post request. I'm doing the following curl: curl -X POST MY_ADDRESS -d SOME_JSON --connect-timeout 2000 After 15 minutes I get the response from the server but when I try to do so in python, nothing returns (request was timed out).
{ "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/6352/reactions" }
https://api.github.com/repos/psf/requests/issues/6352/timeline
null
not_planned
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." ]
https://api.github.com/repos/psf/requests/issues/6351
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6351/labels{/name}
https://api.github.com/repos/psf/requests/issues/6351/comments
https://api.github.com/repos/psf/requests/issues/6351/events
https://github.com/psf/requests/issues/6351
1,581,017,124
I_kwDOABTKOs5ePGgk
6,351
Please reopen #6295.
{ "avatar_url": "https://avatars.githubusercontent.com/u/1838534?v=4", "events_url": "https://api.github.com/users/CachingFoX/events{/privacy}", "followers_url": "https://api.github.com/users/CachingFoX/followers", "following_url": "https://api.github.com/users/CachingFoX/following{/other_user}", "gists_url": "https://api.github.com/users/CachingFoX/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/CachingFoX", "id": 1838534, "login": "CachingFoX", "node_id": "MDQ6VXNlcjE4Mzg1MzQ=", "organizations_url": "https://api.github.com/users/CachingFoX/orgs", "received_events_url": "https://api.github.com/users/CachingFoX/received_events", "repos_url": "https://api.github.com/users/CachingFoX/repos", "site_admin": false, "starred_url": "https://api.github.com/users/CachingFoX/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/CachingFoX/subscriptions", "type": "User", "url": "https://api.github.com/users/CachingFoX", "user_view_type": "public" }
[]
closed
true
null
[]
null
0
2023-02-11T21:12:07Z
2024-02-12T00:03:24Z
2023-02-11T21:13:26Z
NONE
resolved
@sethmlarson please check my issue #6295. You close it with a reference to an issue about problems in the GIT history. https://github.com/psf/requests/issues/2690 But I report a problem with history attribute/method of a request. Thank you very much CachingFoX
{ "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/6351/reactions" }
https://api.github.com/repos/psf/requests/issues/6351/timeline
null
completed
null
null
false
[]
https://api.github.com/repos/psf/requests/issues/6350
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6350/labels{/name}
https://api.github.com/repos/psf/requests/issues/6350/comments
https://api.github.com/repos/psf/requests/issues/6350/events
https://github.com/psf/requests/issues/6350
1,580,285,017
I_kwDOABTKOs5eMTxZ
6,350
@albayraktaroglu Same story. Upgrading `pyopenssl` does not works for me. 👎
{ "avatar_url": "https://avatars.githubusercontent.com/u/102162057?v=4", "events_url": "https://api.github.com/users/gabrielgarciae/events{/privacy}", "followers_url": "https://api.github.com/users/gabrielgarciae/followers", "following_url": "https://api.github.com/users/gabrielgarciae/following{/other_user}", "gists_url": "https://api.github.com/users/gabrielgarciae/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/gabrielgarciae", "id": 102162057, "login": "gabrielgarciae", "node_id": "U_kgDOBhbeiQ", "organizations_url": "https://api.github.com/users/gabrielgarciae/orgs", "received_events_url": "https://api.github.com/users/gabrielgarciae/received_events", "repos_url": "https://api.github.com/users/gabrielgarciae/repos", "site_admin": false, "starred_url": "https://api.github.com/users/gabrielgarciae/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/gabrielgarciae/subscriptions", "type": "User", "url": "https://api.github.com/users/gabrielgarciae", "user_view_type": "public" }
[]
closed
true
null
[]
null
0
2023-02-10T20:32:26Z
2024-02-11T00:03:49Z
2023-02-10T20:47:41Z
NONE
resolved
@albayraktaroglu Same story. Upgrading `pyopenssl` does not works for me. 👎 _Originally posted by @maldil in https://github.com/psf/requests/issues/4246#issuecomment-695162681_ I fixed it by inserting "verify=False" response = session.get(url, params=parameters, verify=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/6350/reactions" }
https://api.github.com/repos/psf/requests/issues/6350/timeline
null
completed
null
null
false
[]
https://api.github.com/repos/psf/requests/issues/6349
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6349/labels{/name}
https://api.github.com/repos/psf/requests/issues/6349/comments
https://api.github.com/repos/psf/requests/issues/6349/events
https://github.com/psf/requests/issues/6349
1,580,283,690
I_kwDOABTKOs5eMTcq
6,349
@albayraktaroglu Same story. Upgrading `pyopenssl` does not works for me. 👎
{ "avatar_url": "https://avatars.githubusercontent.com/u/102162057?v=4", "events_url": "https://api.github.com/users/gabrielgarciae/events{/privacy}", "followers_url": "https://api.github.com/users/gabrielgarciae/followers", "following_url": "https://api.github.com/users/gabrielgarciae/following{/other_user}", "gists_url": "https://api.github.com/users/gabrielgarciae/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/gabrielgarciae", "id": 102162057, "login": "gabrielgarciae", "node_id": "U_kgDOBhbeiQ", "organizations_url": "https://api.github.com/users/gabrielgarciae/orgs", "received_events_url": "https://api.github.com/users/gabrielgarciae/received_events", "repos_url": "https://api.github.com/users/gabrielgarciae/repos", "site_admin": false, "starred_url": "https://api.github.com/users/gabrielgarciae/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/gabrielgarciae/subscriptions", "type": "User", "url": "https://api.github.com/users/gabrielgarciae", "user_view_type": "public" }
[]
closed
true
null
[]
null
0
2023-02-10T20:31:34Z
2024-02-11T00:03:50Z
2023-02-10T20:47:34Z
NONE
resolved
I fixed it by inserting "verify=False" response = session.get(url, params=parameters, verify=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/6349/reactions" }
https://api.github.com/repos/psf/requests/issues/6349/timeline
null
completed
null
null
false
[]
https://api.github.com/repos/psf/requests/issues/6348
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6348/labels{/name}
https://api.github.com/repos/psf/requests/issues/6348/comments
https://api.github.com/repos/psf/requests/issues/6348/events
https://github.com/psf/requests/pull/6348
1,575,411,691
PR_kwDOABTKOs5JfQBm
6,348
python 3 language updates
{ "avatar_url": "https://avatars.githubusercontent.com/u/14829262?v=4", "events_url": "https://api.github.com/users/marksmayo/events{/privacy}", "followers_url": "https://api.github.com/users/marksmayo/followers", "following_url": "https://api.github.com/users/marksmayo/following{/other_user}", "gists_url": "https://api.github.com/users/marksmayo/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/marksmayo", "id": 14829262, "login": "marksmayo", "node_id": "MDQ6VXNlcjE0ODI5MjYy", "organizations_url": "https://api.github.com/users/marksmayo/orgs", "received_events_url": "https://api.github.com/users/marksmayo/received_events", "repos_url": "https://api.github.com/users/marksmayo/repos", "site_admin": false, "starred_url": "https://api.github.com/users/marksmayo/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/marksmayo/subscriptions", "type": "User", "url": "https://api.github.com/users/marksmayo", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2023-02-08T03:44:16Z
2024-02-09T00:03:32Z
2023-02-08T12:39:46Z
NONE
resolved
Fix some f-strings Remove u-prefix from strings
{ "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/6348/reactions" }
https://api.github.com/repos/psf/requests/issues/6348/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/6348.diff", "html_url": "https://github.com/psf/requests/pull/6348", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/6348.patch", "url": "https://api.github.com/repos/psf/requests/pulls/6348" }
true
[ "Thanks for thinking of us but we don't accept cosmetic changes to the project given it's current maintenance status. " ]
https://api.github.com/repos/psf/requests/issues/6347
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6347/labels{/name}
https://api.github.com/repos/psf/requests/issues/6347/comments
https://api.github.com/repos/psf/requests/issues/6347/events
https://github.com/psf/requests/pull/6347
1,574,264,336
PR_kwDOABTKOs5Jba48
6,347
Use context manager to open files
{ "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
1
2023-02-07T12:45:21Z
2023-11-29T14:03:11Z
null
CONTRIBUTOR
null
In the documentation for `POST a Multipart-Encoded File` the example code opens the file inline but never closes it. This leaves the file open until the script ends. It is better to use a context manager even in example code. Original: ``` >>> url = 'https://httpbin.org/post' >>> files = {'file': open('report.xls', 'rb')} >>> r = requests.post(url, files=files) >>> r.text ``` Replace with: ``` >>> url = 'https://httpbin.org/post' >>> with open('report.xls', 'rb') as fd: ... files = {'file': fd} ... r = requests.post(url, files=files) ... r.text ```
null
{ "+1": 1, "-1": 1, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 2, "url": "https://api.github.com/repos/psf/requests/issues/6347/reactions" }
https://api.github.com/repos/psf/requests/issues/6347/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/6347.diff", "html_url": "https://github.com/psf/requests/pull/6347", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/6347.patch", "url": "https://api.github.com/repos/psf/requests/pulls/6347" }
true
[ "I've just got bitten by this example, and was just about to create a PR for this too 😃 \r\n\r\n(Maybe\r\n```python\r\n ... r = requests.post(url, files=multiple_files)\r\n ... r.text\r\n```\r\ncould be\r\n```python\r\n ... r = requests.post(url, files=multiple_files)\r\n ... \r\n >>> r.text\r\n```\r\n" ]
https://api.github.com/repos/psf/requests/issues/6346
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6346/labels{/name}
https://api.github.com/repos/psf/requests/issues/6346/comments
https://api.github.com/repos/psf/requests/issues/6346/events
https://github.com/psf/requests/issues/6346
1,566,595,241
I_kwDOABTKOs5dYFip
6,346
Dwnloading Big Files,It Stops Dowloanding Without Error
{ "avatar_url": "https://avatars.githubusercontent.com/u/66516635?v=4", "events_url": "https://api.github.com/users/thisiseddy-ab/events{/privacy}", "followers_url": "https://api.github.com/users/thisiseddy-ab/followers", "following_url": "https://api.github.com/users/thisiseddy-ab/following{/other_user}", "gists_url": "https://api.github.com/users/thisiseddy-ab/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/thisiseddy-ab", "id": 66516635, "login": "thisiseddy-ab", "node_id": "MDQ6VXNlcjY2NTE2NjM1", "organizations_url": "https://api.github.com/users/thisiseddy-ab/orgs", "received_events_url": "https://api.github.com/users/thisiseddy-ab/received_events", "repos_url": "https://api.github.com/users/thisiseddy-ab/repos", "site_admin": false, "starred_url": "https://api.github.com/users/thisiseddy-ab/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/thisiseddy-ab/subscriptions", "type": "User", "url": "https://api.github.com/users/thisiseddy-ab", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2023-02-01T18:24:36Z
2024-06-01T00:04:01Z
2023-06-01T22:38:38Z
NONE
resolved
I Need to download monthly Open Library Data Dumps files, they are some big files: [https://openlibrary.org/data/ol_dump_authors_latest.txt.gz](https://openlibrary.org/data/ol_dump_authors_latest.txt.gz) [https://openlibrary.org/data/ol_dump_works_latest.txt.gz](https://openlibrary.org/data/ol_dump_works_latest.txt.gz) [https://openlibrary.org/data/ol_dump_editions_latest.txt.gz](https://openlibrary.org/data/ol_dump_editions_latest.txt.gz) It hangs downlaoding at worker and edition file because they are big files,the problem i dont get no exception that connection failed.It Just stops Downloading,i know that because the file size wont change for hours #### First Try ```py dump_url = "https://openlibrary.org/data/ol_dump_editions_latest.txt.gz" dump_path = "temp_file/ol_dump_editions_latest.txt.gz" session = requests.Session() with session.get(dump_url, stream=True) as r: r.raise_for_status() with open(dump_path, 'wb') as f: for chunk in r.iter_content(chunk_size=1024*1024): f.write(chunk) ``` #### Second Try ```py dump_url = "https://openlibrary.org/data/ol_dump_editions_latest.txt.gz" dump_path = "temp_file/ol_dump_editions_latest.txt.gz" session = requests.Session() with session.get(dump_url, stream=True) as r: r.raise_for_status() with open(dump_path, 'wb') as f: shutil.copyfileobj(r.raw, f) ```
{ "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/6346/reactions" }
https://api.github.com/repos/psf/requests/issues/6346/timeline
null
completed
null
null
false
[ "I got the solutuion, u use timeout and resume download \r\n\r\n##### Main Function\r\n```py\r\nimport requests \r\nfrom requests.exceptions import ConnectionError\r\nimport os\r\n\r\ndef download_ol_dump_editions_latest(dump_url,dump_path):\r\n max_download_resumes_count = 0\r\n with requests.Session() as s:\r\n try:\r\n with s.get(dump_url,stream=True,allow_redirects=True,timeout=300) as r:\r\n r.raise_for_status()\r\n with open(dump_path, 'wb') as f:\r\n last_file_size = None\r\n for chunk in r.iter_content(chunk_size=1024*1024):\r\n f.write(chunk)\r\n f.flush()\r\n os.fsync(f.fileno())\r\n except ConnectionError as to:\r\n print(\"Here is Suppose to Timeout\")\r\n resume_download_ol_dump_editions_latest(dump_url=dump_url,dump_path=dump_path,max_d_r_c=max_download_resumes_count)\r\n```\r\n\r\n##### Resume Download Function\r\nI put a maximume of downlaod resumes so i dosnt run in a ifint loop\r\n```py\r\ndef resume_download_ol_dump_editions_latest(dump_url,dump_path,max_d_r_c):\r\n print(\"Im Resuming the Download\")\r\n max_download_resumes = 30\r\n if max_d_r_c < max_download_resumes:\r\n max_d_r_c += 1\r\n print(f\"Number of times i resumed: {max_d_r_c}\" )\r\n with open(dump_path, 'ab') as f:\r\n position = f.tell()\r\n pos_header = {\"Range\": f\"bytes={position}-\"}\r\n \r\n with requests.Session() as s:\r\n try:\r\n with s.get(dump_url,headers=pos_header,stream=True,allow_redirects=True,timeout=300) as r:\r\n r.raise_for_status()\r\n with open(dump_path, 'ab') as f:\r\n for chunk in r.iter_content(chunk_size=1024*1024):\r\n f.write(chunk)\r\n f.flush()\r\n os.fsync(f.fileno())\r\n except ConnectionError as to:\r\n print(\"Here is Suppose to Timeout\")\r\n resume_download_ol_dump_editions_latest(dump_url=dump_url,dump_path=dump_path,max_d_r_c=max_d_r_c)\r\n```\r\nAt the end just run the function \r\n```py\r\ndump_url = \"https://openlibrary.org/data/ol_dump_editions_latest.txt.gz\"\r\n dump_path = \"temp_file/ol_dump_editions_latest.txt.gz\"\r\n download_ol_dump_editions_latest(dump_url=dump_url, dump_path=dump_path)\r\n```" ]
https://api.github.com/repos/psf/requests/issues/6345
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6345/labels{/name}
https://api.github.com/repos/psf/requests/issues/6345/comments
https://api.github.com/repos/psf/requests/issues/6345/events
https://github.com/psf/requests/issues/6345
1,562,006,789
I_kwDOABTKOs5dGlUF
6,345
Help defeat requests. Only urllib3 works.
{ "avatar_url": "https://avatars.githubusercontent.com/u/123472948?v=4", "events_url": "https://api.github.com/users/SkillS63/events{/privacy}", "followers_url": "https://api.github.com/users/SkillS63/followers", "following_url": "https://api.github.com/users/SkillS63/following{/other_user}", "gists_url": "https://api.github.com/users/SkillS63/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/SkillS63", "id": 123472948, "login": "SkillS63", "node_id": "U_kgDOB1wMNA", "organizations_url": "https://api.github.com/users/SkillS63/orgs", "received_events_url": "https://api.github.com/users/SkillS63/received_events", "repos_url": "https://api.github.com/users/SkillS63/repos", "site_admin": false, "starred_url": "https://api.github.com/users/SkillS63/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/SkillS63/subscriptions", "type": "User", "url": "https://api.github.com/users/SkillS63", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2023-01-30T09:00:03Z
2024-06-01T00:04:00Z
2023-06-01T22:39:50Z
NONE
resolved
[pcapng.zip](https://github.com/psf/requests/files/10534054/pcapng.zip) [Please refer to our [Stack Overflow tag](https://stackoverflow.com/questions/tagged/python-requests) for guidance.](https://stackoverflow.com/questions/75147860/post-request-to-send-file-file-fw-not-working) Good afternoon! I have been unable to make a working POST request to send the firmware for many months now. Works only through urllib3: ``` import urllib3 http = urllib3.PoolManager() ip="10.254.255.105" name_file="boot_v1.5_app_v2.27.8.fw" uri = "/firmware/update_from_page.htm" with open(name_file, 'rb') as fp: file_data = fp.read() send = http.request( 'POST', 'http://' + ip + uri, fields={'new_firmware': (name_file, file_data),} )` ``` Problem line for the requests library: ``` send = requests.post( url='http://'+ip+uri, data={'new_firmware': (name_file, file_data),}, ) ``` Tried using it in different ways: 1) using sessions 2) Adding headers, including from the working request urllib3 3) Adding various parameters verify = False, allow_redirects=True\False 4) Changing data= to files= resets the connection I also did Wireshark dumps, maybe this will help determine the differences in requests. At first glance, they differ in size (requests are twice as large) When using the requests library, the process does not stop, the connection is not interrupted. Only after the script is forced to stop, the device restores availability.
{ "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/6345/reactions" }
https://api.github.com/repos/psf/requests/issues/6345/timeline
null
completed
null
null
false
[ "Did you try to open the file before sending the POST request ? \nlike this:\n```\n\nimport requests\n\nurl = '<your url>'\nyourfiles = {'file': open('<name off file>' ,'rb')}\n#You can also add a timeout parameter \nsend= requests.post(url, files = myfiles,timeout=5)\n\n\n```" ]
https://api.github.com/repos/psf/requests/issues/6344
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6344/labels{/name}
https://api.github.com/repos/psf/requests/issues/6344/comments
https://api.github.com/repos/psf/requests/issues/6344/events
https://github.com/psf/requests/issues/6344
1,560,963,030
I_kwDOABTKOs5dCmfW
6,344
Cookies returned in Set-Cookie header not added to RequestsCookieJar
{ "avatar_url": "https://avatars.githubusercontent.com/u/48943001?v=4", "events_url": "https://api.github.com/users/helmstedt/events{/privacy}", "followers_url": "https://api.github.com/users/helmstedt/followers", "following_url": "https://api.github.com/users/helmstedt/following{/other_user}", "gists_url": "https://api.github.com/users/helmstedt/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/helmstedt", "id": 48943001, "login": "helmstedt", "node_id": "MDQ6VXNlcjQ4OTQzMDAx", "organizations_url": "https://api.github.com/users/helmstedt/orgs", "received_events_url": "https://api.github.com/users/helmstedt/received_events", "repos_url": "https://api.github.com/users/helmstedt/repos", "site_admin": false, "starred_url": "https://api.github.com/users/helmstedt/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/helmstedt/subscriptions", "type": "User", "url": "https://api.github.com/users/helmstedt", "user_view_type": "public" }
[]
open
false
null
[]
null
7
2023-01-28T18:31:30Z
2023-08-01T17:38:48Z
null
NONE
null
I am making a post request where the response object has a 'Set-Cookie' with cookie data when inspecting response.headers, but where response.cookies has an empty cookie jar. My request contains a number of parameters which I am reproducing here, but I doubt the issue has to do with the parameters passed: ```response = requests.post(url, headers=headers, cookies=cookies, data=data, allow_redirects=False)``` I suspect that the cookies returned in the header might contain non-standard syntax or are too long. I have tried logging in to the site in question using both Firefox and Chrome with Javascript off. Both browsers store the cookies for the response in question and submit the cookies for subsequent requests to the site in question. ## Expected Result My response object contains the following headers. I have edited a few alphanumeric characters in the values for safety reasons, but in terms of length and syntax nothing has been touched: response.headers >> {'Cache-Control': 'no-cache,no-store', 'Pragma': 'no-cache', 'Expires': 'Thu, 01 Jan 1970 00:00:00 GMT', 'Location': '/', 'Set-Cookie': '.AspNetCore.Correlation.jF47v6lTv_fiF9L6IoIRm_NyIwGokyQGecjNK4J6Qyc=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/signin-oidc; secure; samesite=none; httponly, .AspNetCore.OpenIdConnect.Nonce.CfDJ8N0wv-Ekr1hBgNlqS3YOmQRnE85Vk8rRFKjF8vB02JU-Q7_OtSCXPp_ukzPNIjKavJA13Ndwb9b7dDzR82gSyrHRa6edkcAUq4WxoL8KIz7ZkSN0BY0Fi6BPPDjZT-tog2HzormhD982Lioo2hYSu1oh6UHBHoVMwrEQfLxN54ySXY45aE2p-TmjBbSI4_LpLpodpubI46HtsrBX_h0x9Qys7bRitwhjX9aH4zHd9hxAWwZ9NQbyfKl7uAxEr8rs5dsz5y410uiMrlwEfPJKnCM=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/signin-oidc; secure; samesite=none; httponly, .AspNetCore.Cookies.V2=chunks-2; domain=; path=/; secure; samesite=lax; httponly, .AspNetCore.Cookies.V2C1=CfDJ8N0wv-Ekr1hBgNlqS3YOmQRfOKeY0UmP1Odn0-2suN0E5YV2JDz7dlW5ZIRp2WEOVpjLDknFkmvAxZrV7zy8Mz7wJerKsjKXvlm37iIoM8CmkvXXug4_BFXiPJtPPLa4GDaMlh7MdIf_i2wavk9OrDxlyQi0LVFNURifPuL1-AQne1MpbiOshDP7Ap71SKh9FiNiY4bzGe8LJfPBCMGU-k-CXNz3WlRuKM6I6WuuPZ-F_6mbL1s9E4ecdvqLNhthnOgHzyNZtlfZoYaJSSGQQonQXKo0cI1Png7Kh6RRaGBa43b39XgilTDHPqwsUgYzSuaUBhJ2vW0MfYckMKKsrVK77jVg5oEKqpCCBOvQ4mkYWgIQ6v4TdtLT3IwLp_V_NcovbybhDlWmWfZIGqvPN7jqKcmrYD00blVCKtmUSQh1qF4cuy458Tk64gAp7rcwQQ6m0ye84iGJDuzXBe_qqoUOLiVqVTmZiSENuH-9_9ltF5gnp9IdPHsLFbQqtr8ahlKnyvmRjQSEbpNBSf1N0xga83ZfLeQTRKop-qLiQW4wTNHtJlTIJAuYGF-yuUmHApo-45yOh5qN7naiXejfG0oFP-adnRS9mUu4hErwzM3_QhORBvXjPsSlK-PNoNvNpsqwFq69Z321x4qwSrdBnUd0W7SphPh0tMCurcg4AHSY2uMRX9QXwL8dEGvtvBhF3Omt_g14rhYMoeNDKegTvRFGG_q6DUdf_t9Jn4rhw3uxfC9UUIUfYKsbLlWvr6_Bz4cSu1H287nRCeIONQFjTCnR2C1DFwFaeOwip5GYKeJGJbVlu5nCx4X1rdIhuTpko83IvQaAYP5okESCGm215bST0higylflnG0uChRgTyI6ABusBKLyHYVeBTuqZkF-GebWSoD2iLp8SoNZ8GVfvCQMbEwotPTfiycMG3dfI_03h9X3rJD8AHruOFwJsaly4xxorXwKlbALJ_Ym4jLISaJJEjJ3CpIE_6pch32cxQ-t3GvnduCdfkc3oFRB2cakuW_W5-Bqj3wyF6mqNzfy9rwslGNOrkPiLCcCqbq4KjvzXIYPOw-eP7iPU8OO_a7TJsTOX_QIgMEWuufdxNlA8okiNL-9dqGee3rOrwQpCxr2vWUu29dSisVZwQtQF0Bbn3gAyPtHS3lL0pSeRjupVpC4BMZZzYUdy3oy1TYASBT2uIp9SbvnYd2j65xNutTtgONLY_Zf9p4KewFRRfnZzttX02YFt3yjRsa6IGqUaDMtpy9KaKN9nk_IhrWbTpqwkYYAtrsKpwNoJfyIT2WAJAE6NbrqGbLxNqJBHYDnJRY2yCon0dmHFzzKp5YWPVabopHEtHV6OcpX_0zH0Dt_1Lz61FDHJiQcPg0yCr63q8lzku5MDt8mgrTJoWF4MYr9Bg4R-dzTOBVCaCBytfH2k18IdImmWRjthQR1sBsgyQjh6LeeY4lDClfqmgGEs_dOofsQAc6QcQN2VdD7o3TZR5drOPk2zLsVv25mGs9f9rKM5rMWcHAdGmZ5kzucxPN9S7WbuxR3Iw_BXVx0lgR1aw88jLcWDiC6EmOD07l43EDLxt8Jq3ZARfXxcvVOnaY5Rg9pu1U7ex2WSkowzIRo6XXhe1I-NuFVjZq5wE-GP3NoQznhYbZEF2sMYwvKm7nDArt8TcFbxXy_ZUudiiRQ8zU89m4rzlaSQdyz6qDmx2sYUU61RirfSZDsdhZKtC4_nXRVb-GdfJJDAIpwYwqcoEETodgmrjBa1Vw1uxbdA0F5GnU_pMRrep1hywy9SidcMmeqvCTCkThqaiZ-3DV2RVaLn8vugggtZtAxpxE0POUfEVxmTfZQKZsQ9Ec57AEsJhMsfN7gJJyocjm9j1-GKzrplor76zy3DcxoaQSCZ7pfUG7cIxEVFhQD_cKdSldHnHfAK6S3TYmi7Whn-Y10aANTLlZDzgKkpYugMjpq1RqPE7NfOT-mChe9Wda0lpWh44cxgHA6FUAu1KGfTl-EGg6frYHuYSgoMl3cmDaLJPme2SlrYdjr0rKoM3kWlWFEf9YxstbGgoGoLqSG6A2BJuiRaq5nxT3lLkUinaeqFs42YzeRAouTRrdJhSvVwIU6EEZeDeC6GXl7lC2U_EDdejgBMnANf-uSntMENJF8N4_p4YInxhG-AKLYJRK15MTMVUjg-Qir43SHB02sBbKyDPltr4Ripm5KVnRORahPfVMH8HsYwRc4CSyyebl-Nyl6RajQdVBP2OzT6iFAhCyNbWckkoIhzGtP9HF2v_ilyh4iqEakJnuKzDdicNi0f0LE2-GPo9td4NrFQSePz9wRkvqbsePq6nLlVeljYwtjagPlS6T-y0xAKOceQH-wOmehidWsx__yLytKL9QMXWykdDGrPyB6EarA-BqySWDWIKr0VgQiy8XcAxdJgWltvA3X7qGLYnWO9DmyWovAYt60H7V0pXDESkr8BKnklrVk4ALzEnCWvY1jY-39pxqiAsFKjKDoxFRUSp7zThjRTvPZ5LoNE3BAZU0zHv5ZTNca-qFgwEaMNgD0OmCdPE3VflBxb4_No4Md-LsezU_m4nZvwv3QbmQ4wgMSmIBFJ_JJzjVSo6bJcIdrrNiIQsYbCVIDGb2ZlTSqnBtBlze3MEYhCdBIJWsOyWSTOMygtH5aQ5D4yP4W1k_9eNNP-s9RdwRGvFfuFNO5T8FDZgWKYGUnhtRuhAIALbzIlZuSjd11qNxVtXtEtHMbWoYGHQqjVlvodTEAXVyA5-G-MjSBZzBO5b2mrDAvlKrHT0s8qAii9GBDM4Hrjhts6Q4zuCqV-34GrovkEKVokNDuSotRPycjCdeOLQDHtWsBy9VK_3jrxlSqTq2RHHpKhgeURd6--cjIjX9gMkUc3NRj1zCRkF4_LsGLQcaIkybZjUP4Fh1G9viOqJYlZGlkLQMV1vIIIPN6uFRAVz_QwKbK00R1OAS2HiqTP8dMD_6S4jYNKSbyFBku6bZG5GkG2NxefJx5Y9fFnX7AkzKOK9GNbcYqO9g5uv_yqFEtH0tYpjtumVRcU8lTUQoVZJdC1I12qDfGZ5KOIWOZmnS_IA-rDUYFp2IYtOyLuNvFVIyiOMRKGlTo5i1nAZXK-dF_kAoiIz9SmJa5q_uBliyo_G1iyNcCECtK_B3C4YmFYAOKDiUcStIiPo5DQjRe_94dr2Q-D4RPnxHrE1jKh9SbZpDLHserbTUGXwyHnO0wmoZRrrLleV8bzG2x2KJJyDBKwfXn5MKN51_DesTY95Ek7o-PEJTtAwTFchweH1DbEogvTn7uPJZwkU30ez3XsIJLEFvmXI8Vz0S7tvstpzg0SdtOEcFSkiRT1ONyC1k2fq8CTVH8quVXEmVXbwrSh1K_AH_kc9gMtrPmcIxjnekvDS1-O8HzufgAz8N6fWg4JyLSAn-MlnMfBYGiFNRcJxic2yr6ypGwALcDCHPRsjj-1Hm50LiTSi-FUpTVSuKpnmkt_ECmWVbt86OdfR88j76Pj0f_y3Usa9kq8AL0d8gRzXnxq-73_3pTa71KlGrwPdKbMU04XX6xBsMyMPXDX_Ahh29TlUTLkBDQW_YgTbLL16mOt4s8mVl79zb9yM6zDuSZQ6DL4LuPRSvOushld390_85f2RND0z_yDAB44QXtghPHOM1oyUI3obpnhKp-1canAdsFR6truMIjDceN1IImqXgWzjMzN106wJjadsFyWc5qbZfvpHUSiwNLJDYgwHQI-dUs2mbdNcyotCWmvzUxRoDvJwWXNX4b7FBmfIsZEeqkt3vOs1F5Xz6bXM5-XwQUELdK5m18hfCkhZ2CEhaLd7Nwn-1bQpvjbHg4f0ftMPYxGnSFsePWOFmaUQgUOmE9qr2EgHmWzRe837KWHsqAW3N89TKmlrxecbf3ekxsuqKm7GHHQyzGOz2eHkI6M_k5Ix0eGLN6-E4Gywpbvxfgqgtkv_2cMKuYJtp; domain=; path=/; secure; samesite=lax; httponly, .AspNetCore.Cookies.V2C2=wQS0WKB4ajMPd7QaJarvKMBSR6cvj4d80LSzHJEe1GXtS49K9t2HHcEYjBOG4rtkA4tzE5ZRzuY0hbxxi9jLF1CDzsE7_jG6eCWPVpkNITF-vteDH52CYywJi-RHZ68Yq7UFNCYlf8dw8U9irplfv33IDTt_-1Uy3JcB4DPYYp0wPZAuZAg3GzvnJB6T2LXcxJ-P7a8gwV2Tz0w2BAmbUaD1gL4Jq2abwgkE3NqGDyKsfISega78J9jLgaZvyBFQ86yetjuaPuCZ-ZiM3CPyiIg3Bvv15FK0sGi6blVKxfSsf_RMYxNptMgn39Xh5idQYxW4GwMIvojANiufWmAhNr959CiRm-dVaYjs4FBPG7CwyYf5RSFFoR1bMYv_moTbmct0ttAAY2zv6IifJyEDt7bkrL0dQkI8vAH868hG06huqd8ihFpi0GUyinx1Qgp1LakCesausD8B_cHSNmzYXReQn1Ttu8vCD8T4mLXtBW-J535ybMlKnv49LiIzUG41HLzhkRqqpgst-7hGFIeZUcbM3Gs6J1MkSsEJx8StFxSddn3apbZx2nT9429j4Rq1jk-4SBgOt1y7fTcAknLPMl9aoSbTL7mfIG8yqZuvzJMKWxy0jhtkpfa0lpHnk8bf6ZToQlJInvksRKRmbKTWGEKhSEobN3ONmM_zT1KUf64O6JHj95uh6_xooguHRuQhVnV4N1uIZodzBm-_N_SvAPt3U0qvcWJ7WJykc5B8kKSNz9Dk3nWzSEfXygd88r-aV_3bLIZf1kM6qzB8wd9zEZasb9ud6lIosoQx_riquJxkh4PjRkxKjOvZp9ESaPTISeNBc1tHC-UEy5UglJ95sQ6os7bO7YBz5lXcvoH4kFTj4D-h_DFq3wdQ-hFFiUSuNafF0Vs0vwQmq1er9MVeLmyrEs8mO1M6MsExJ0UIB2jG4qcEc0YVtOaayEXAsQU_02zHJyV96IuXOzh3bYx6K6ztHvECl0XfMjgRFLtAiyByf0zRGWxxf_lfKJMKW2CY1HWcieaaaUsnMQbXSXlCPuEVnnisRTH3eVgjHsP5Vz3uuVJ_e5ZBDVpvuwBuVcinxLKIfaCJjooQKk3Hxwu04cC0OmUOf9NXWzRuWEX-UkXxEE8SiaLzzDFlawHBTRDWD2WNC_4zP_oGI6y9AgM-h3iY8MWApimSUxKClBl9mhmgABM0q7UTApAYr5gkaGxl7nqcEj0wjSk6q0pyV78_OAU4E6c2w0LEOPvlCvdVulMe8T9-x3P37zWzTwNv0s-kJ62KfNqBPuLmzNti9qQObw9TQtOYVGEG1jnemgHSjPggcE5YEN4SnOsdgoI7IKNogzE4_3_zVTsv0pZ-Uhj56guc5G9gOEjDITTigm-6sFvsAIgf4Id3lRdoUmtyW1LhpIh2r87XLPaAPNvBpSHIapWRr7R3uPfqunMvcXagRbOtfHoTCdKq8JClybnonwR6nYTK6tnVXRTPfvLzC2jyWP2YbsNvV0zKLcB3iOhgf; domain=; path=/; secure; samesite=lax; httponly', 'X-Content-Type-Options': 'nosniff', 'X-Robots-Tag': 'noindex, nofollow', 'Strict-Transport-Security': 'max-age=31536000; includeSubDomains', 'Content-Security-Policy': "report-uri https://csp-report.browser-intake-datadoghq.eu/api/v2/logs?dd-api-key=pubd9330f91e9b3979f9a62f277730740cb&dd-evp-origin=content-security-policy&ddsource=csp-report&ddtags=env%3aproduction%2cversion%3a58610%2cservice%3aDinero.Frontend;default-src 'none';script-src *.chargebee.com *.chargebeestatic.com *.adyen.com connect.facebook.net www.google.com googleads.g.doubleclick.net www.googleadservices.com www.google-analytics.com www.googletagmanager.com ajax.googleapis.com maps.googleapis.com *.linkedin.com snap.licdn.com bat.bing.com 'self' *.dinero.dk *.workbox.dk 'unsafe-eval' 'unsafe-inline' trackcmp.net https://cdneu.net/app.js https://storage.googleapis.com/snowplow-cto-office-tracker-bucket/2.15.0/sp.js analytics.twitter.com static.ads-twitter.com js.userflow.com disutgh7q0ncc.cloudfront.net *.zopim.com *.zendesk.com *.zdassets.com;style-src *.chargebee.com 'self' *.dinero.dk *.workbox.dk data: 'unsafe-inline' js.userflow.com;img-src www.facebook.com www.google.dk www.google.com stats.g.doubleclick.net www.google-analytics.com www.googletagmanager.com *.googleapis.com maps.googleapis.com *.ggpht.com maps.gstatic.com *.linkedin.com bat.bing.com 'self' *.dinero.dk *.workbox.dk data: blob: *.visma.com cb-prod-eu-c1-invoice-logos.s3.eu-central-1.amazonaws.com gallery.mailchimp.com www.partner-ads.com analytics.twitter.com t.co js.userflow.com cdn.nordicapigateway.com nagpublic.blob.core.windows.net *.zopim.com *.zopim.io;font-src 'self' *.dinero.dk *.workbox.dk data: *.zopim.com;child-src 'none';connect-src *.algolia.net https://*.browser-intake-datadoghq.eu dawa.aws.dk www.facebook.com stats.g.doubleclick.net www.google-analytics.com *.oribi.io bat.bing.com 'self' dinero.dk *.dinero.dk *.workbox.dk ws: wss: *.visma.com https://cdneu.net/app.js https://capture-api.eu.autopilotapp.com/ js.userflow.com *.wootric.eu wootric-eligibility.herokuapp.com *.zopim.com *.zopim.io *.zdassets.com wss://*.zopim.com wss://dinero.zendesk.com;worker-src blob:;media-src *.zopim.com;frame-src *.chargebee.com *.adyen.com *.dinero.dk *.workbox.dk player.vimeo.com;frame-ancestors https://connect.visma.com;form-action adfs.mylogbuy.com 'self' https://connect.visma.com;object-src 'none';", 'Date': 'Sat, 28 Jan 2023 17:34:56 GMT', 'Content-Length': '0', 'Via': '1.1 google', 'Alt-Svc': 'h3=":443"; ma=2592000,h3-29=":443"; ma=2592000'} I would expect my response.cookies to contain the cookie data in response.headers['Set-Cookie']. ## Actual Result Instead of containing the cookies from the response headers, the response cookie jar is empty: response.cookies >> <RequestsCookieJar[]> I have tried logging in to the site in question using both Firefox and Chrome with Javascript off. Both browsers store the cookies for the response in question and submit the cookies for subsequent requests to the site in question. ## Reproduction Steps I am unable to provide reproduction steps in the bug report, since a complete reproduction includes user credentials for the site in question. I hope that someone with more in-depth knowledge of Requests is able to reproduce the issue by parsing the Set-Cookie part of the header above with the relevant class or functions in Requests. I would be happy to provide a bug fixer with test credentials and code to reproduce the issue on the site returning the response. Just reach out to me. ## System Information ```json { "chardet": { "version": null }, "charset_normalizer": { "version": "2.0.9" }, "cryptography": { "version": "36.0.0" }, "idna": { "version": "3.3" }, "implementation": { "name": "CPython", "version": "3.10.1" }, "platform": { "release": "10", "system": "Windows" }, "pyOpenSSL": { "openssl_version": "101010cf", "version": "22.0.0" }, "requests": { "version": "2.28.2" }, "system_ssl": { "version": "101010cf" }, "urllib3": { "version": "1.26.7" }, "using_charset_normalizer": true, "using_pyopenssl": true } ```
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/6344/reactions" }
https://api.github.com/repos/psf/requests/issues/6344/timeline
null
null
null
null
false
[ "Many of those cookies (I didn't check them all while on my phone) were set to expire in the year 1970. Thus they will never end up in the Jar. The server is misconfigured ", "I can see that some of the cookies are set to expire. The ones I would expect to be added to the cookie jar, and which do not have an expiry date, as far as I can see, are:\r\n\r\n.AspNetCore.Cookies.V2\r\n.AspNetCore.Cookies.V2C1\r\n.AspNetCore.Cookies.V2C2\r\n\r\nThese are the ones that Firefox and Chrome save and use for subsequent requests.\r\n\r\nI have created a test account on the site in question and here is code that should be able to reproduce the issue.:\r\n\r\n```\r\n# Script to login to dinero.dk\r\nimport requests\r\nfrom bs4 import BeautifulSoup\r\n\r\nusername = '[email protected]'\r\npassword = '52GeGAMZeN7NwNsUfoE8!'\r\n\r\nheaders = {\r\n 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; rv:109.0) Gecko/20100101 Firefox/109.0',\r\n 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8',\r\n 'Accept-Language': 'en',\r\n 'DNT': '1',\r\n 'Connection': 'keep-alive',\r\n 'Upgrade-Insecure-Requests': '1',\r\n 'Sec-Fetch-Dest': 'document',\r\n 'Sec-Fetch-Mode': 'navigate',\r\n 'Sec-Fetch-Site': 'none',\r\n 'Sec-Fetch-User': '?1',\r\n 'Pragma': 'no-cache',\r\n 'Cache-Control': 'no-cache',\r\n}\r\n\r\nheaders['Host'] = 'app.dinero.dk'\r\nlogin_page_url = 'https://app.dinero.dk/'\r\nvisit_login_page = requests.get(login_page_url, allow_redirects=False, headers=headers)\r\ndinero_dk_cookies = dict(visit_login_page.cookies)\r\n\r\nif visit_login_page.status_code == 302:\r\n headers['Host'] = 'connect.visma.com'\r\n second_page_url = visit_login_page.headers['Location']\r\n visit_second_page = requests.get(second_page_url, allow_redirects=False, headers=headers)\r\n if visit_second_page.status_code == 302:\r\n third_page_url = visit_second_page.headers['Location']\r\n visit_third_page = requests.get(third_page_url, allow_redirects=False, headers=headers)\r\n if visit_third_page.status_code == 200:\r\n connect_visma_cookies = dict(visit_third_page.cookies)\r\n login_soup = BeautifulSoup(visit_third_page.text, 'lxml')\r\n username_form = login_soup.find('form', {'class': 'form-connect-login'})\r\n username_form_data = {}\r\n for input in username_form.find_all('input'):\r\n try:\r\n username_form_data[input['name']] = input['value']\r\n except:\r\n pass\r\n username_form_data['Username'] = username\r\n\r\nconnect_url = 'https://connect.visma.com/'\r\nheaders['Referer'] = third_page_url\r\nheaders['Content-Type'] = 'application/x-www-form-urlencoded'\r\npost_username = requests.post(connect_url, allow_redirects=False, headers=headers, cookies=connect_visma_cookies, data=username_form_data)\r\nif post_username.status_code == 302:\r\n post_username_cookies = dict(post_username.cookies)\r\n connect_visma_cookies['rememberUsername'] = post_username_cookies['rememberUsername']\r\n del headers['Content-Type']\r\n password_page_url = 'https://connect.visma.com' + post_username.headers['Location']\r\n get_password_page = requests.get(password_page_url, allow_redirects=False, headers=headers, cookies=connect_visma_cookies)\r\n if get_password_page.status_code == 200:\r\n username_submitted_soup = BeautifulSoup(get_password_page.text, 'lxml')\r\n password_form = username_submitted_soup.find('form', {'class': 'form-connect-login'})\r\n password_form_data = {}\r\n for input in password_form.find_all('input'):\r\n try:\r\n password_form_data[input['name']] = input['value']\r\n except:\r\n pass\r\n password_form_data['password'] = password\r\n\r\npassword_submit_url = 'https://connect.visma.com/password'\r\nheaders['Referer'] = password_page_url\r\nheaders['Content-Type'] = 'application/x-www-form-urlencoded'\r\npost_password = requests.post(password_submit_url, allow_redirects=False, headers=headers, cookies=connect_visma_cookies, data=password_form_data)\r\nif post_password.status_code == 302:\r\n post_password_cookies = dict(post_password.cookies)\r\n for key, value in connect_visma_cookies.items():\r\n if '.AspNetCore.Antiforgery' in key:\r\n post_password_cookies[key] = value\r\n del headers['Content-Type']\r\n callback_page_url = 'https://connect.visma.com' + post_password.headers['Location']\r\n get_callback_page = requests.get(callback_page_url, allow_redirects=False, headers=headers, cookies=post_password_cookies)\r\n get_callback_page_cookies = dict(get_callback_page.cookies)\r\n password_submitted_soup = BeautifulSoup(get_callback_page.text, 'lxml')\r\n redirect_form = password_submitted_soup.find('form')\r\n redirect_form_data = {}\r\n for input in redirect_form.find_all('input'):\r\n try:\r\n redirect_form_data[input['name']] = input['value']\r\n except:\r\n pass\r\n redirect_form_data['scope'] = redirect_form_data['scope'].replace(\" \",\"+\")\r\n redirect_url = redirect_form['action']\r\n\r\nsignin_url = redirect_url\r\nheaders['Content-Type'] = 'application/x-www-form-urlencoded'\r\nheaders['Referer'] = 'https://connect.visma.com/'\r\nheaders['Origin'] = 'https://connect.visma.com/'\r\nheaders['Host'] = 'app.dinero.dk'\r\npost_signin = requests.post(signin_url, allow_redirects=False, headers=headers, cookies=dinero_dk_cookies, data=redirect_form_data)\r\npost_signin_header_cookies = post_signin.headers['Set-Cookie']\r\n\r\nprint('Cookie jar has no cookies:')\r\nprint(post_signin.cookies)\r\nprint('---')\r\nprint('Set-Cookie header contains cookies:')\r\nprint(post_signin_header_cookies)\r\n```", "I'm able to reproduce this behavior. If I pull the `Set-Cookie` header out the response and pass it into `http.cookies.SimpleCookie`, I can fetch the value perfectly fine.\r\n\r\nThe code I use if fairly simple:\r\n```python\r\nres = requests.post(\r\n URL,\r\n data=JSON,\r\n headers={\"Host\": \"localhost\"},\r\n)\r\n\r\nres.cookies[\"testcookie\"] # throws a `KeyError`\r\njar = http.cookies.SimpleCookie(res.headers[\"Set-Cookie\"])\r\njar[\"testcookie\"].value # works fine\r\n```\r\n\r\nthe `Set-Cookie` header in question looks like this:\r\n```plain\r\ntestcookie=\"hello\"; Domain=localhost; expires=Fri, 07 Apr 2023 19:57:22 GMT; HttpOnly; Path=/\r\n```\r\n\r\nThis only seems to happen when the `domain` of the cookie is set to `localhost`, though. Providing other values for the `domain` and `Host`, everything works as I would expect.", "Thanks for exploring the issue. I notice that the cookies from my response are missing a domain value. Here is one copied from headers['Set-Cookie'] (my reproduction code above still works):\r\n\r\n`.AspNetCore.Cookies.V2C2=JCRw_3JmNIVpBQ4l4uz951pzrOzWzN9wnsV8f16Dr50QLz7pg55IY01Msaw31FZWMfkxHXqgMgygan99Lsj84YYEYMKguAfAEmCcNsNewq3wYkm14mmaZTQXi44Yw-nWHA0HZwxzmMX13dN5DDEdEjq9Lc-rtURh1d3nhhKlGUst8r7CFtrnRhLSOfJYFTrzZSBYpRypuHcvvPnOxQYvyQXl0vNTbb-GaZB5i1ZPtH05a1xDfhtmUWSfyBONgpdDlBN7_hoElvq-nftkuglgfhN4MSwSfnINxwNm1jAKEJMv3UwC0uqJ9JNMo6CHEmxYHJUfke0w0tN4xtZt7WhUXXl_vPZR7B98fcPtUsa1aa_KzhGjl4584qGH30czopfrpBMTWcH20gFi0t1qVY6fYZxxHTNSG1JnFarGGUuyYY2pr5xq5Vw5WYL7KXUWIZx5GudbSKP8ZdNmNaj-JLIxsOH483zUs2XPbaDERn8NCtJRTEFXcXfDcK3q9Ifw_9rfKXSCShQotwK6fRuRjoryeUiN_I4JQ8Qz6IMOeP3pEHG9e1faHM0Lh0PQQBX30YScU3payh6ImbIr000b1moeI-O0YI9cTQIICL5WPVE1mCc-NShq7eICWMF5fH2XVBAvaD5cw7SA6PeyNwxMvfkLsoeaSeidA6NpRBAWGCHRxAKPFvhVsIPUPrgCNql3v1GavvwIkJSEW8eBXiMWPw2cn2HjmxRaDBUgMUoKAXCcSKvdgVndixtn7TbP2bKmJI_xado6sPbx8mpTiAu5ks7B_26j9rVYfmqWv31J1ZwOSG7Y9z_meTSQZSim74H26u5mwSFGTZEsF_aR5zEzNragUJAO-Yix854zWuva_Czg2g-iTTYuvrPFX-VcDQdfLRcSw-KMZTmydUebV1nQfCmfpOVamlmTzuSkB29wzbPUb0G21hGP2MdEfblfhD0CQN-thWRceOmcgOMll5WW2aZ8jxIK87iyHZuRvfccAhnXjFT6P0rx_q1CKhx1-MO6CJ0lTaR5DY3w_Bz1E3bUxMUjzWkhVuQRExQJHPPNi4zSzR3rspXxI0mCAixWag_GIdBQ2nX2O_MM6Z1RYY-ymouf7aSBeIzOTyJAbJ1u4IsNFJcXl0_i_jNe1ynFfIqqkkM2eHVeCJO8JH3EmxaT76CeggpwM4uiT5Hx_fnpxPVUY3v1IDc6Mly8e6CUdzQp9XvwtK6QRI4Gr5LaYndM5OX0-ElkH7QMgmXw4u1zZO_cOc5aLyDPGeGW6HokGBBSCAk-KBzl7P8Mz5kPTB176qxjs7AsrK3a6rUhqD7HinhwoEX_7CntzkQYu7agS5LxreJ_CiDr52Y27KwSNQHM6NKc9mYuCOBX2DvXkiTfm8SrDEjsEYyXK_65E9xuYh3Yj1xPtsX9Ay1qONVdeZ_gO5XYtXLTFhZgugAxosNsrYbGRFGerfTXTzEIloEqLspLmIjKIlkbTwoXXmfsicDuZRIVRBprbq5z0ZhPlgzLoVoQ7; domain=; path=/; secure; samesite=lax; httponly`", "Likely this issue is the same as https://github.com/psf/requests/issues/6245", "> Likely this issue is the same as #6245\r\n\r\nPerhaps it extends beyond missing domains and has something to do with not FQ domains? Because in my case, it doesn't work if it is set to `localhost` either.", "I can also reproduce this issue with a `localhost` cookie. I found this:\r\n\r\n> Fixed in https://github.com/python/cpython/pull/30108 for 3.11.\r\n\r\nfrom https://github.com/python/cpython/issues/90233\r\n\r\nSo I would try 3.11 and see if that helps. For me, it did get the cookie, but decided to set it with a domain of `.localhost` instead of `localhost`, which wasn't accepted by the server. So I ended up with something like this to fake it:\r\n\r\n```python\r\nif s.cookies.get(cookie_name, domain=\"localhost\") is None:\r\n cookie_value = s.cookies.get(cookie_name)\r\n s.cookies.clear(name=cookie_name)\r\n s.cookies.set(cookie_name, cookie_value, domain=\"\")\r\n\r\n```\r\n\r\nIt seems like allowing localhost cookies at all may be a nonstandard extension, it just happens to be one that is supported by any browser I've tested with as well as other http client libraries.\r\n\r\n> > ...domains must have at least two (2) or three (3) periods in them to prevent domains of the form: \".com\", \".edu\", and \"va.us\". Any domain that fails within one of the seven special top level domains listed below only require two periods. Any other domain requires at least three. The seven special top level domains are: \"COM\", \"EDU\", \"NET\", \"ORG\", \"GOV\", \"MIL\", and \"INT\".\r\n\r\n> Note that the number of periods above probably assumes that a leading period is required. This period is however [ignored in modern browsers](https://stackoverflow.com/a/20884869/81595) and it should probably read...\r\n\r\n> > at least one (1) or two (2) periods\r\n\r\n\r\n<https://stackoverflow.com/questions/1134290/cookies-on-localhost-with-explicit-domain/32210291#32210291>" ]
https://api.github.com/repos/psf/requests/issues/6343
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6343/labels{/name}
https://api.github.com/repos/psf/requests/issues/6343/comments
https://api.github.com/repos/psf/requests/issues/6343/events
https://github.com/psf/requests/issues/6343
1,559,954,086
I_kwDOABTKOs5c-wKm
6,343
no_proxy env doesn't handle '*' in domain name
{ "avatar_url": "https://avatars.githubusercontent.com/u/273684?v=4", "events_url": "https://api.github.com/users/paulfariello/events{/privacy}", "followers_url": "https://api.github.com/users/paulfariello/followers", "following_url": "https://api.github.com/users/paulfariello/following{/other_user}", "gists_url": "https://api.github.com/users/paulfariello/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/paulfariello", "id": 273684, "login": "paulfariello", "node_id": "MDQ6VXNlcjI3MzY4NA==", "organizations_url": "https://api.github.com/users/paulfariello/orgs", "received_events_url": "https://api.github.com/users/paulfariello/received_events", "repos_url": "https://api.github.com/users/paulfariello/repos", "site_admin": false, "starred_url": "https://api.github.com/users/paulfariello/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/paulfariello/subscriptions", "type": "User", "url": "https://api.github.com/users/paulfariello", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2023-01-27T15:29:10Z
2024-02-04T00:03:43Z
2023-02-03T17:04:52Z
NONE
resolved
It is common to use `*` in no_proxy env var to avoid using proxy for whole range of subdomain. Current implementation doesn't handle `*`. ## Expected Result Avoid proxy when url match no_proxy with a `*` in it. ``` >>> import requests >>> requests.utils.should_bypass_proxies("https://requests.readthedocs.io", "*.readthedocs.io") True ``` ## Actual Result Use proxy even if no_proxy contains a value that would match domain with a `*`. ``` >>> import requests >>> requests.utils.should_bypass_proxies("https://requests.readthedocs.io", "*.readthedocs.io") False ``` ## Reproduction Steps ```python import requests requests.utils.should_bypass_proxies("https://requests.readthedocs.io", "*.readthedocs.io") ``` ## System Information $ python -m requests.help ```json { "chardet": { "version": "4.0.0" }, "charset_normalizer": { "version": "2.0.4" }, "cryptography": { "version": "3.3.2" }, "idna": { "version": "2.10" }, "implementation": { "name": "CPython", "version": "3.9.2" }, "platform": { "release": "5.10.0-19-amd64", "system": "Linux" }, "pyOpenSSL": { "openssl_version": "1010109f", "version": "20.0.1" }, "requests": { "version": "2.26.0" }, "system_ssl": { "version": "101010ef" }, "urllib3": { "version": "1.26.5" }, "using_charset_normalizer": false, "using_pyopenssl": true } ```
{ "avatar_url": "https://avatars.githubusercontent.com/u/273684?v=4", "events_url": "https://api.github.com/users/paulfariello/events{/privacy}", "followers_url": "https://api.github.com/users/paulfariello/followers", "following_url": "https://api.github.com/users/paulfariello/following{/other_user}", "gists_url": "https://api.github.com/users/paulfariello/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/paulfariello", "id": 273684, "login": "paulfariello", "node_id": "MDQ6VXNlcjI3MzY4NA==", "organizations_url": "https://api.github.com/users/paulfariello/orgs", "received_events_url": "https://api.github.com/users/paulfariello/received_events", "repos_url": "https://api.github.com/users/paulfariello/repos", "site_admin": false, "starred_url": "https://api.github.com/users/paulfariello/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/paulfariello/subscriptions", "type": "User", "url": "https://api.github.com/users/paulfariello", "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/6343/reactions" }
https://api.github.com/repos/psf/requests/issues/6343/timeline
null
completed
null
null
false
[ "It must be `.readthedocs.io`" ]
https://api.github.com/repos/psf/requests/issues/6342
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6342/labels{/name}
https://api.github.com/repos/psf/requests/issues/6342/comments
https://api.github.com/repos/psf/requests/issues/6342/events
https://github.com/psf/requests/issues/6342
1,558,567,392
I_kwDOABTKOs5c5dng
6,342
session.verify not working when variable 'REQUESTS_CA_BUNDLE', is set
{ "avatar_url": "https://avatars.githubusercontent.com/u/3055578?v=4", "events_url": "https://api.github.com/users/ggmoura/events{/privacy}", "followers_url": "https://api.github.com/users/ggmoura/followers", "following_url": "https://api.github.com/users/ggmoura/following{/other_user}", "gists_url": "https://api.github.com/users/ggmoura/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/ggmoura", "id": 3055578, "login": "ggmoura", "node_id": "MDQ6VXNlcjMwNTU1Nzg=", "organizations_url": "https://api.github.com/users/ggmoura/orgs", "received_events_url": "https://api.github.com/users/ggmoura/received_events", "repos_url": "https://api.github.com/users/ggmoura/repos", "site_admin": false, "starred_url": "https://api.github.com/users/ggmoura/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/ggmoura/subscriptions", "type": "User", "url": "https://api.github.com/users/ggmoura", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2023-01-26T18:16:56Z
2024-01-28T00:03:55Z
2023-01-27T11:54:21Z
NONE
resolved
I defined the verify parameter to False in the session object, I have the env 'REQEUSTS_CA_BUNDLE' defined as './ca_bondle.cer', in the request, it should respect the value that was assigned in the session object ## Use the verify parameter that was defined in the session object, which should be mandatory when I assign a value to the verify parameter of the session object, the api should use this parameter to make the request, and not the value that was defined in the environment variable 'REQUESTS_CA_BOUNDLE' ## It is currently using the 'REQUESTS_CA_BOUNDLE' environment variable to define the value of the verify parameter during the request Usou a variável de ambiente 'REQUESTS_CA_BOUNDLE', para definir o valor do parâmetro verify durante a requisição ## Define the 'REQUESTS_CA_BUNDLE' environment variable and make two requests, one that must use the certificate, and the second that must not be used, before making the second request, define the verify parameter of the session object as False, this value should be respected , however, the api is using the parameter that was defined in the environment variable, damaging the request! ```python import requests conf={'url': required(KAFKA_REGISTRY), 'ssl.ca.location': False} session = Session() session.verify = False response = session.request(method, url="/".join([self.base_url, url]), headers=headers, data=body, params=query) ``` in the sessions.py line 532 ```python verify = merge_setting(verify, self.verify) ``` in the sessions.py line 532 ```python settings = self.merge_environment_settings( prep.url, proxies, stream, verify, cert ) ``` in the sessions.py line 701 ```python verify = merge_setting(verify, self.verify) ``` in the sessions.py line 717 ```python if verify is True or verify is None: verify = (os.environ.get('REQUESTS_CA_BUNDLE') or os.environ.get('CURL_CA_BUNDLE')) ``` in the sessions.py line 724 ```python verify = merge_setting(verify, self.verify) ``` in the sessions.py line 50 the session_setting is not null, need return this value ```python if session_setting is None: return request_setting if request_setting is None: return session_setting # Bypass if not a dictionary (e.g. verify) if not ( isinstance(session_setting, Mapping) and isinstance(request_setting, Mapping) ): return request_setting ``` ## System Information $ python -m requests.help ```json { "paste": "here" } ``` - Requests v2.26.0 - Python 3.7
{ "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/6342/reactions" }
https://api.github.com/repos/psf/requests/issues/6342/timeline
null
completed
null
null
false
[ "In the future, please search **closed and** open issues before creating new ones that are duplicates." ]
https://api.github.com/repos/psf/requests/issues/6341
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6341/labels{/name}
https://api.github.com/repos/psf/requests/issues/6341/comments
https://api.github.com/repos/psf/requests/issues/6341/events
https://github.com/psf/requests/issues/6341
1,556,274,752
I_kwDOABTKOs5cwt5A
6,341
Requoting does not unquote `%27`
{ "avatar_url": "https://avatars.githubusercontent.com/u/8515462?v=4", "events_url": "https://api.github.com/users/albertvillanova/events{/privacy}", "followers_url": "https://api.github.com/users/albertvillanova/followers", "following_url": "https://api.github.com/users/albertvillanova/following{/other_user}", "gists_url": "https://api.github.com/users/albertvillanova/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/albertvillanova", "id": 8515462, "login": "albertvillanova", "node_id": "MDQ6VXNlcjg1MTU0NjI=", "organizations_url": "https://api.github.com/users/albertvillanova/orgs", "received_events_url": "https://api.github.com/users/albertvillanova/received_events", "repos_url": "https://api.github.com/users/albertvillanova/repos", "site_admin": false, "starred_url": "https://api.github.com/users/albertvillanova/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/albertvillanova/subscriptions", "type": "User", "url": "https://api.github.com/users/albertvillanova", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2023-01-25T08:56:35Z
2024-01-28T00:03:56Z
2023-01-25T13:32:35Z
NONE
resolved
When requoting a redirection URL, the single quotation mark does not get unquoted: `%27` => `%27`: ```python In [1]: from requests.utils import requote_uri In [2]: url = "https://netloc/path?param=param%27%27value" In [3]: print(url) Out[3]: 'https://netloc/path?param=param%27%27value' In [4]: print(requote_uri(url)) Out[4]: 'https://netloc/path?param=param%27%27value' ``` However, the `aiohttp` library uses `yarl.ULR` and this does unquote `%27`: `%27` => `'` ```python In [5]: from yarl import URL In [6]: print(url) Out[6]: 'https://netloc/path?param=param%27%27value' In [7]: print(str(URL(url))) Out[7]: "https://netloc/path?param=param''value" ``` ## Expected Result I think both libraries should have the same behavior. ## Actual Result The `requests` library does not unquote `%27`, whereas the `aiohttp` library (that uses `yarl`) does unquote `%27`. ## Reproduction Steps ```python from requests.utils import requote_uri from yarl import URL url = "https://netloc/path?param=param%27%27value" print(url) print(requote_uri(url)) print(URL(url)) ``` ## System Information $ python -m requests.help ```json { "chardet": { "version": null }, "charset_normalizer": { "version": "2.0.8" }, "cryptography": { "version": "" }, "idna": { "version": "2.10" }, "implementation": { "name": "CPython", "version": "3.9.7" }, "platform": { "release": "5.14.0-1055-oem", "system": "Linux" }, "pyOpenSSL": { "openssl_version": "", "version": null }, "requests": { "version": "2.26.0" }, "system_ssl": { "version": "101010cf" }, "urllib3": { "version": "1.26.7" }, "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/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/6341/reactions" }
https://api.github.com/repos/psf/requests/issues/6341/timeline
null
not_planned
null
null
false
[ "Arguably the RFCs are in Requests' favor. It's _safer_ to leave those quotes because they should be quoted by RFC 3986 and even the What WG URL spec suggests they should be. Not all servers are going to reject aiohttp's behavior but some will. It's safer to be conservative in what is sent (quote reserved characters, etc.) then it is not to. ", "Thank you for your explanation @sigmavirus24.\r\n\r\nIndeed, we found this discrepancy between `requests` and `aiohttp` when we got a 403 error from our server at Hugging Face in streaming mode (that uses `aiohttp`) and no error in non-streaming mode (that uses `requests`)\r\n\r\nSee:\r\n- huggingface/datasets#5459" ]
https://api.github.com/repos/psf/requests/issues/6340
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6340/labels{/name}
https://api.github.com/repos/psf/requests/issues/6340/comments
https://api.github.com/repos/psf/requests/issues/6340/events
https://github.com/psf/requests/issues/6340
1,555,668,885
I_kwDOABTKOs5cuZ-V
6,340
Using requests to get a file with the contents 1.1.1 on windows fails
{ "avatar_url": "https://avatars.githubusercontent.com/u/42205980?v=4", "events_url": "https://api.github.com/users/Jachdich/events{/privacy}", "followers_url": "https://api.github.com/users/Jachdich/followers", "following_url": "https://api.github.com/users/Jachdich/following{/other_user}", "gists_url": "https://api.github.com/users/Jachdich/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Jachdich", "id": 42205980, "login": "Jachdich", "node_id": "MDQ6VXNlcjQyMjA1OTgw", "organizations_url": "https://api.github.com/users/Jachdich/orgs", "received_events_url": "https://api.github.com/users/Jachdich/received_events", "repos_url": "https://api.github.com/users/Jachdich/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Jachdich/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Jachdich/subscriptions", "type": "User", "url": "https://api.github.com/users/Jachdich", "user_view_type": "public" }
[]
closed
true
null
[]
null
3
2023-01-24T21:07:35Z
2024-01-26T00:03:20Z
2023-01-24T23:29:02Z
NONE
resolved
On windows using urllib, I get the correct result. On linux using requests, I get the correct result. It seems to be a specific requests + windows issue. ## Expected Result I expect to get the string "1.1.1" ## Actual Result I get some garbage, non-ascii data that I cannot paste here accurately. ## Reproduction Steps - Create a file on a http server somewhere - Put in it exactly the characters "1.1.1" - Try to get that file with requests ```python import requests r = requests.get("http://your.url/here") print(r.text) ``` - Change the text of the file to read anything else, such as "1.1.2" - The previous code succeeds now, and prints `1.1.2`. In case it makes any difference, I tested it with the url `http://<myserver>.com/asdfasdf` The following things cause this bug not to occur: - Running the code on Linux - Using `urllib.requests` instead of `requests` - Opening the URL in a browser (this shows the file contents is in fact the correct value) ## System Information $ python -m requests.help ```json { "chardet": { "version": null }, "charset_normalizer": { "version": "3.0.1" }, "cryptography": { "version": "" }, "idna": { "version": "3.4" }, "implementation": { "name": "CPython", "version": "3.11.1" }, "platform": { "release": "10", "system": "Windows" }, "pyOpenSSL": { "openssl_version": "", "version": null }, "requests": { "version": "2.28.2" }, "system_ssl": { "version": "1010111f" }, "urllib3": { "version": "1.26.14" }, "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/6340/reactions" }
https://api.github.com/repos/psf/requests/issues/6340/timeline
null
not_planned
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.", "@sigmavirus24 I'm struggling to see how this *isn't* a defect in this project, since it's a specific file contents causing weird and unpredictable behaviour in the library. I have exhausted every possibility other than a bug in requests, or some windows API that I am unaware of. Sorry if i missed anything, but it definitely seems like a bug. I'll edit the issue for some clarification, too.", "There are probably close to 100 issues of \"works in Linux, doesn't work in Windows\" both here and on stack overflow. They are all environmental problems in your setup, not bugs in the library. That's why it's not a defect." ]
https://api.github.com/repos/psf/requests/issues/6338
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6338/labels{/name}
https://api.github.com/repos/psf/requests/issues/6338/comments
https://api.github.com/repos/psf/requests/issues/6338/events
https://github.com/psf/requests/issues/6338
1,552,106,355
I_kwDOABTKOs5cg0Nz
6,338
Can't properly DL this particular image although it works with urllib
{ "avatar_url": "https://avatars.githubusercontent.com/u/1932338?v=4", "events_url": "https://api.github.com/users/stephanebruckert/events{/privacy}", "followers_url": "https://api.github.com/users/stephanebruckert/followers", "following_url": "https://api.github.com/users/stephanebruckert/following{/other_user}", "gists_url": "https://api.github.com/users/stephanebruckert/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/stephanebruckert", "id": 1932338, "login": "stephanebruckert", "node_id": "MDQ6VXNlcjE5MzIzMzg=", "organizations_url": "https://api.github.com/users/stephanebruckert/orgs", "received_events_url": "https://api.github.com/users/stephanebruckert/received_events", "repos_url": "https://api.github.com/users/stephanebruckert/repos", "site_admin": false, "starred_url": "https://api.github.com/users/stephanebruckert/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/stephanebruckert/subscriptions", "type": "User", "url": "https://api.github.com/users/stephanebruckert", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2023-01-22T12:53:53Z
2024-01-23T00:03:47Z
2023-01-22T14:09:59Z
NONE
resolved
This code would normally work for other images but for this [specific image URL](https://i.discogs.com/UzkDSQACNmbykQvWO0B9JGVajps7_MULzdwP9RK-o94/rs:fit/g:sm/q:90/h:591/w:589/czM6Ly9kaXNjb2dz/LWRhdGFiYXNlLWlt/YWdlcy9MLTk3NzE1/LTE2MjA2NjkwNzQt/MjMxMS5qcGVn.jpeg) it doesn't. The image is downloaded but the file is corrupt. ```python url = "https://i.discogs.com/UzkDSQACNmbykQvWO0B9JGVajps7_MULzdwP9RK-o94/rs:fit/g:sm/q:90/h:591/w:589/czM6Ly9kaXNjb2dz/LWRhdGFiYXNlLWlt/YWdlcy9MLTk3NzE1/LTE2MjA2NjkwNzQt/MjMxMS5qcGVn.jpeg" # doesn't work with requests import requests # 2.28.1 img_data = requests.get(url).content with open('image_requests.jpeg', 'wb') as handler: handler.write(img_data) # it works with urllib import urllib urllib.request.urlretrieve(url, "image_urllib.jpeg") ``` Result: <img width="562" alt="Screenshot 2023-01-22 at 12 52 00" src="https://user-images.githubusercontent.com/1932338/213916740-0611c0c3-3660-47b9-a15f-a8c4d54b5aac.png"> We can see the `requests` one doesn't have a preview and doesn't have the same size. <img width="372" alt="Screenshot 2023-01-22 at 12 52 46" src="https://user-images.githubusercontent.com/1932338/213916766-fde189c4-5390-40ca-a3de-09dadaef67f8.png"> Here are other examples: - https://i.discogs.com/O0MU8c-zTjW0H_YWugum_KKdJzk1UNZok1xbeY0C1wo/rs:fit/g:sm/q:90/h:580/w:580/czM6Ly9kaXNjb2dz/LWRhdGFiYXNlLWlt/YWdlcy9MLTg4OTQ5/LTE0MzQ2NDQ2MTct/Nzc1Mi5qcGVn.jpeg - https://i.discogs.com/b9vVXUMd_KhK8fZsoZ9nZR47HQ15m_t0fmG1GqHjl2Q/rs:fit/g:sm/q:90/h:356/w:472/czM6Ly9kaXNjb2dz/LWRhdGFiYXNlLWlt/YWdlcy9MLTQ4LTE2/MTAwNTEzNjgtOTQ4/OS5qcGVn.jpeg
{ "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/6338/reactions" }
https://api.github.com/repos/psf/requests/issues/6338/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." ]
https://api.github.com/repos/psf/requests/issues/6337
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6337/labels{/name}
https://api.github.com/repos/psf/requests/issues/6337/comments
https://api.github.com/repos/psf/requests/issues/6337/events
https://github.com/psf/requests/issues/6337
1,551,722,687
I_kwDOABTKOs5cfWi_
6,337
urllib3 breaking changes
{ "avatar_url": "https://avatars.githubusercontent.com/u/1411530?v=4", "events_url": "https://api.github.com/users/mkozakov/events{/privacy}", "followers_url": "https://api.github.com/users/mkozakov/followers", "following_url": "https://api.github.com/users/mkozakov/following{/other_user}", "gists_url": "https://api.github.com/users/mkozakov/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/mkozakov", "id": 1411530, "login": "mkozakov", "node_id": "MDQ6VXNlcjE0MTE1MzA=", "organizations_url": "https://api.github.com/users/mkozakov/orgs", "received_events_url": "https://api.github.com/users/mkozakov/received_events", "repos_url": "https://api.github.com/users/mkozakov/repos", "site_admin": false, "starred_url": "https://api.github.com/users/mkozakov/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/mkozakov/subscriptions", "type": "User", "url": "https://api.github.com/users/mkozakov", "user_view_type": "public" }
[]
closed
true
null
[]
null
3
2023-01-21T07:18:21Z
2024-01-25T00:03:39Z
2023-01-21T19:29:19Z
NONE
resolved
<!-- Summary. --> The Requests library does not pin urllib3 to a version, but it exposes its classes. this means that if you use the exposed classes you might get different behavior, depending on which urllib3 version you have installed. Specifically, google Colab has an old version of urllib3 installed, so when using imports from `requests.adapters` it broke our library ## Expected Result No error when using the `allowed_methods` param with Retry ## Actual Result `TypeError: unexpected keyword argument 'allowed_methods' ## Reproduction Steps ``` pip install urllib3==1.24.3 # the version that Google Colab uses pip install requests ``` ```python from requests.adapters import Retry Retry(allowed_methods=['GET']) # a param that replaced `method_whitelist` in one of the versions of urllib3 ```
{ "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/6337/reactions" }
https://api.github.com/repos/psf/requests/issues/6337/timeline
null
completed
null
null
false
[ "> The Requests library does not pin urllib3 to a version, _but it exposes its classes_.\r\n\r\nHi @mkozakov, I'm not sure this statement makes sense. Requests does [pin urllib3](https://github.com/psf/requests/blob/main/setup.py#L64) to a supported range. Requests imports a class into the adapters module for internal use within the module. That's how any import works. We explicitly document if you want to change retries you should import `Retry` from urllib3 and pass it to the adapter. That's a dependency that you need to manage within your code at that point.\r\n\r\n> If you need granular control over the conditions under which we retry a request, import urllib3's ``Retry`` class and pass that instead.\r\n\r\nUsing transitive imports of undocumented classes is a high risk decision and will likely lead to unexpected breakages like this. If this is code you've written, I'd advise following our documentation and ensure you're pinning for your API requirements. If this is managed by Google, you'll need to reach out to them for adjustments.", "@nateprewitt got it. Should I not be importing `HTTPAdapter` either?\r\nThis is how we added retries, but maybe that's wrong? \r\n\r\n```python\r\nfrom requests.adapters import HTTPAdapter, Retry\r\n\r\nsession = requests.Session()\r\nretries = Retry(\r\n total=self.max_retries,\r\n backoff_factor=0.5,\r\n allowed_methods=['POST', 'GET'],\r\n status_forcelist=[429, 500, 502, 503, 504]\r\n)\r\nsession.mount('https://', HTTPAdapter(max_retries=retries))\r\nsession.mount('http://', HTTPAdapter(max_retries=retries))\r\n\r\nresponse = session.request('POST', url, headers=headers, json=json, **self.request_dict)\r\n```", "Our documentation clearly states what is our code and safe to import. Anything not documented you shouldn't be importing. We will not answer questions one by one about what you're importing and whether or not it's safe" ]
https://api.github.com/repos/psf/requests/issues/6336
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6336/labels{/name}
https://api.github.com/repos/psf/requests/issues/6336/comments
https://api.github.com/repos/psf/requests/issues/6336/events
https://github.com/psf/requests/pull/6336
1,551,279,318
PR_kwDOABTKOs5IPGUv
6,336
Support missing SNIMissingWarning in tests
{ "avatar_url": "https://avatars.githubusercontent.com/u/42327?v=4", "events_url": "https://api.github.com/users/pquentin/events{/privacy}", "followers_url": "https://api.github.com/users/pquentin/followers", "following_url": "https://api.github.com/users/pquentin/following{/other_user}", "gists_url": "https://api.github.com/users/pquentin/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/pquentin", "id": 42327, "login": "pquentin", "node_id": "MDQ6VXNlcjQyMzI3", "organizations_url": "https://api.github.com/users/pquentin/orgs", "received_events_url": "https://api.github.com/users/pquentin/received_events", "repos_url": "https://api.github.com/users/pquentin/repos", "site_admin": false, "starred_url": "https://api.github.com/users/pquentin/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/pquentin/subscriptions", "type": "User", "url": "https://api.github.com/users/pquentin", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2023-01-20T18:26:35Z
2024-01-22T00:03:48Z
2023-01-21T08:44:33Z
CONTRIBUTOR
resolved
urllib3 2.0 only supports OpenSSL 1.1.1+ which means SNI is mandatory, and removed the warning altogether.
{ "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/6336/reactions" }
https://api.github.com/repos/psf/requests/issues/6336/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/6336.diff", "html_url": "https://github.com/psf/requests/pull/6336", "merged_at": "2023-01-21T08:44:33Z", "patch_url": "https://github.com/psf/requests/pull/6336.patch", "url": "https://api.github.com/repos/psf/requests/pulls/6336" }
true
[ "Looks like there's a small linting issue. Could you update the PR using our pre-commit hooks?\n\nAlthough where it's moving the test import doesn't look right to me 👀. I'll investigate that separately.", "Oops, sorry about that. Fixed the lint.\r\n\r\n> Although where it's moving the test import doesn't look right to me 👀. I'll investigate that separately.\r\n\r\nThis is because I used `from tests import X` instead of `from . import X` and isort does not know that `tests` is a [known first party](https://pycqa.github.io/isort/docs/configuration/options.html#known-first-party). I switched back to `from . import X`." ]
https://api.github.com/repos/psf/requests/issues/6335
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6335/labels{/name}
https://api.github.com/repos/psf/requests/issues/6335/comments
https://api.github.com/repos/psf/requests/issues/6335/events
https://github.com/psf/requests/pull/6335
1,549,958,229
PR_kwDOABTKOs5IKtNy
6,335
Add `mime_type` property to response object
{ "avatar_url": "https://avatars.githubusercontent.com/u/107761433?v=4", "events_url": "https://api.github.com/users/MarkusHammer/events{/privacy}", "followers_url": "https://api.github.com/users/MarkusHammer/followers", "following_url": "https://api.github.com/users/MarkusHammer/following{/other_user}", "gists_url": "https://api.github.com/users/MarkusHammer/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/MarkusHammer", "id": 107761433, "login": "MarkusHammer", "node_id": "U_kgDOBmxPGQ", "organizations_url": "https://api.github.com/users/MarkusHammer/orgs", "received_events_url": "https://api.github.com/users/MarkusHammer/received_events", "repos_url": "https://api.github.com/users/MarkusHammer/repos", "site_admin": false, "starred_url": "https://api.github.com/users/MarkusHammer/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/MarkusHammer/subscriptions", "type": "User", "url": "https://api.github.com/users/MarkusHammer", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2023-01-19T21:19:47Z
2024-01-20T00:03:15Z
2023-01-19T21:22:46Z
NONE
resolved
Added a `mime_type` property to the response object to allow for quick figuring out of the type of content of a response. This is a tiny QOL improvement, as it makes it easier to extract the mime type from the header without having to clutter up code just to extract it.
{ "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/6335/reactions" }
https://api.github.com/repos/psf/requests/issues/6335/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/6335.diff", "html_url": "https://github.com/psf/requests/pull/6335", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/6335.patch", "url": "https://api.github.com/repos/psf/requests/pulls/6335" }
true
[ "Hi @MarkusHammer, this is pretty specific behavior that I don't believe has a broadly applicable use case.\n\nThe end goal can be accomplished with a few lines of user written code when needed, so I think we'll stick with that as our advisement for now. Thanks!" ]
https://api.github.com/repos/psf/requests/issues/6334
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6334/labels{/name}
https://api.github.com/repos/psf/requests/issues/6334/comments
https://api.github.com/repos/psf/requests/issues/6334/events
https://github.com/psf/requests/pull/6334
1,548,508,870
PR_kwDOABTKOs5IFxRk
6,334
Remove <4 from python_requires
{ "avatar_url": "https://avatars.githubusercontent.com/u/57299612?v=4", "events_url": "https://api.github.com/users/edsonibarra/events{/privacy}", "followers_url": "https://api.github.com/users/edsonibarra/followers", "following_url": "https://api.github.com/users/edsonibarra/following{/other_user}", "gists_url": "https://api.github.com/users/edsonibarra/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/edsonibarra", "id": 57299612, "login": "edsonibarra", "node_id": "MDQ6VXNlcjU3Mjk5NjEy", "organizations_url": "https://api.github.com/users/edsonibarra/orgs", "received_events_url": "https://api.github.com/users/edsonibarra/received_events", "repos_url": "https://api.github.com/users/edsonibarra/repos", "site_admin": false, "starred_url": "https://api.github.com/users/edsonibarra/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/edsonibarra/subscriptions", "type": "User", "url": "https://api.github.com/users/edsonibarra", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2023-01-19T04:47:31Z
2024-01-20T00:03:17Z
2023-01-19T05:23:42Z
NONE
resolved
Fix for #6332
{ "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/6334/reactions" }
https://api.github.com/repos/psf/requests/issues/6334/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/6334.diff", "html_url": "https://github.com/psf/requests/pull/6334", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/6334.patch", "url": "https://api.github.com/repos/psf/requests/pulls/6334" }
true
[ "I believe there's already a PR for this in #6333. Please be sure to check open PRs before creating new ones, thanks!" ]
https://api.github.com/repos/psf/requests/issues/6333
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6333/labels{/name}
https://api.github.com/repos/psf/requests/issues/6333/comments
https://api.github.com/repos/psf/requests/issues/6333/events
https://github.com/psf/requests/pull/6333
1,548,143,957
PR_kwDOABTKOs5IEiqD
6,333
fix: Remove '<4' from python_requires
{ "avatar_url": "https://avatars.githubusercontent.com/u/5142394?v=4", "events_url": "https://api.github.com/users/matthewfeickert/events{/privacy}", "followers_url": "https://api.github.com/users/matthewfeickert/followers", "following_url": "https://api.github.com/users/matthewfeickert/following{/other_user}", "gists_url": "https://api.github.com/users/matthewfeickert/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/matthewfeickert", "id": 5142394, "login": "matthewfeickert", "node_id": "MDQ6VXNlcjUxNDIzOTQ=", "organizations_url": "https://api.github.com/users/matthewfeickert/orgs", "received_events_url": "https://api.github.com/users/matthewfeickert/received_events", "repos_url": "https://api.github.com/users/matthewfeickert/repos", "site_admin": false, "starred_url": "https://api.github.com/users/matthewfeickert/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/matthewfeickert/subscriptions", "type": "User", "url": "https://api.github.com/users/matthewfeickert", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2023-01-18T21:37:47Z
2024-01-20T00:03:16Z
2023-01-19T05:37:25Z
CONTRIBUTOR
resolved
Resolves #6332 The https://github.com/psf/requests/blob/61c324da43dd8b775d3930d76265538b3ca27bc1/setup.py#L97 cap was added in PR #6091. As discussed in https://discuss.python.org/t/use-of-less-than-next-major-version-e-g-4-in-python-requires-setup-py/1066 and [other places](https://iscinumpy.dev/post/bound-version-constraints/) by the PyPA, use of upper bounds with `python_requires` for _future_ versions of Python is unintended use of `python_requires` and actively discouraged. c.f. https://github.com/pypa/packaging.python.org/pull/850 for further detail.
{ "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/6333/reactions" }
https://api.github.com/repos/psf/requests/issues/6333/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/6333.diff", "html_url": "https://github.com/psf/requests/pull/6333", "merged_at": "2023-01-19T05:37:25Z", "patch_url": "https://github.com/psf/requests/pull/6333.patch", "url": "https://api.github.com/repos/psf/requests/pulls/6333" }
true
[ "This is ready for review.", "It looks like this is a pretty consistent standard you've helped drive across projects. Given the comments in the discussion from the other PyPA maintainers, I think this is reasonable. Thanks @matthewfeickert!" ]
https://api.github.com/repos/psf/requests/issues/6332
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6332/labels{/name}
https://api.github.com/repos/psf/requests/issues/6332/comments
https://api.github.com/repos/psf/requests/issues/6332/events
https://github.com/psf/requests/issues/6332
1,548,134,137
I_kwDOABTKOs5cRqb5
6,332
Remove '<4' from python_requires
{ "avatar_url": "https://avatars.githubusercontent.com/u/5142394?v=4", "events_url": "https://api.github.com/users/matthewfeickert/events{/privacy}", "followers_url": "https://api.github.com/users/matthewfeickert/followers", "following_url": "https://api.github.com/users/matthewfeickert/following{/other_user}", "gists_url": "https://api.github.com/users/matthewfeickert/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/matthewfeickert", "id": 5142394, "login": "matthewfeickert", "node_id": "MDQ6VXNlcjUxNDIzOTQ=", "organizations_url": "https://api.github.com/users/matthewfeickert/orgs", "received_events_url": "https://api.github.com/users/matthewfeickert/received_events", "repos_url": "https://api.github.com/users/matthewfeickert/repos", "site_admin": false, "starred_url": "https://api.github.com/users/matthewfeickert/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/matthewfeickert/subscriptions", "type": "User", "url": "https://api.github.com/users/matthewfeickert", "user_view_type": "public" }
[]
closed
true
null
[]
null
0
2023-01-18T21:29:35Z
2024-01-20T00:03:14Z
2023-01-19T05:37:26Z
CONTRIBUTOR
resolved
## Summary As discussed in the discuss.python topic ["Use of “less-than next-major-version” (e.g., `<4`) in `python_requires` (setup.py)"](https://discuss.python.org/t/use-of-less-than-next-major-version-e-g-4-in-python-requires-setup-py/1066) and [other places](https://iscinumpy.dev/post/bound-version-constraints/) there can be some side effects of adding `<4` to a library's `python_requires`. Following these discussions the use of `<4` for `python_requires` was removed from the PyPA's packaging guide in https://github.com/pypa/packaging.python.org/pull/850. While https://github.com/psf/requests/blob/61c324da43dd8b775d3930d76265538b3ca27bc1/setup.py#L97 doesn't pose an immediate breaking threat in 2023, it would be good to remove this upper cap and is using `python_requires` in a way that was not intended.
{ "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/6332/reactions" }
https://api.github.com/repos/psf/requests/issues/6332/timeline
null
completed
null
null
false
[]
https://api.github.com/repos/psf/requests/issues/6331
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6331/labels{/name}
https://api.github.com/repos/psf/requests/issues/6331/comments
https://api.github.com/repos/psf/requests/issues/6331/events
https://github.com/psf/requests/issues/6331
1,532,309,427
I_kwDOABTKOs5bVS-z
6,331
Recent version 2.28.2 cannot be used in PyInstaller because of missing charset_normalizer files
{ "avatar_url": "https://avatars.githubusercontent.com/u/921251?v=4", "events_url": "https://api.github.com/users/ikus060/events{/privacy}", "followers_url": "https://api.github.com/users/ikus060/followers", "following_url": "https://api.github.com/users/ikus060/following{/other_user}", "gists_url": "https://api.github.com/users/ikus060/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/ikus060", "id": 921251, "login": "ikus060", "node_id": "MDQ6VXNlcjkyMTI1MQ==", "organizations_url": "https://api.github.com/users/ikus060/orgs", "received_events_url": "https://api.github.com/users/ikus060/received_events", "repos_url": "https://api.github.com/users/ikus060/repos", "site_admin": false, "starred_url": "https://api.github.com/users/ikus060/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/ikus060/subscriptions", "type": "User", "url": "https://api.github.com/users/ikus060", "user_view_type": "public" }
[]
closed
true
null
[]
null
5
2023-01-13T13:29:49Z
2024-04-28T00:04:14Z
2023-01-13T14:08:53Z
NONE
resolved
Requests is not working in PyInstaller packages because of missing file from `charset_normalizer` module. ## Expected Result I'm expecting `requests` to be working within PyInstaller package. ## Actual Result Once the package is compile within an executable, the executable fail to start as follow: ``` Traceback (most recent call last): File "requests\compat.py", line 11, in <module> ModuleNotFoundError: No module named 'chardet' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "minarca_client\main.py", line 15, in <module> from minarca_client.core import ( File "PyInstaller\loader\pyimod03_importers.py", line 495, in exec_module File "minarca_client\core\__init__.py", line 23, in <module> import requests File "PyInstaller\loader\pyimod03_importers.py", line 495, in exec_module File "requests\__init__.py", line 45, in <module> File "PyInstaller\loader\pyimod03_importers.py", line 495, in exec_module File "requests\exceptions.py", line 9, in <module> File "PyInstaller\loader\pyimod03_importers.py", line 495, in exec_module File "requests\compat.py", line 13, in <module> File "PyInstaller\loader\pyimod03_importers.py", line 495, in exec_module File "charset_normalizer\__init__.py", line 24, in <module> File "PyInstaller\loader\pyimod03_importers.py", line 495, in exec_module File "charset_normalizer\api.py", line 5, in <module> File "PyInstaller\loader\pyimod03_importers.py", line 495, in exec_module File "charset_normalizer\cd.py", line 9, in <module> ModuleNotFoundError: No module named 'charset_normalizer.md__mypyc' ``` ## Reproduction Steps test.py: ``` import requests print(requests.get('http://example.com')) ``` ``` pip install requests==2.28.2 charset-normalizer==3.0.1 pyinstaller pyinstaller test.py dist/test/test ``` ## System Information $ python -m requests.help ```json { "chardet": { "version": null }, "charset_normalizer": { "version": "3.0.1" }, "cryptography": { "version": "" }, "idna": { "version": "3.3" }, "implementation": { "name": "CPython", "version": "3.10.6" }, "platform": { "release": "6.0.12-76060006-generic", "system": "Linux" }, "pyOpenSSL": { "openssl_version": "", "version": null }, "requests": { "version": "2.28.2" }, "system_ssl": { "version": "30000020" }, "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/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/6331/reactions" }
https://api.github.com/repos/psf/requests/issues/6331/timeline
null
not_planned
null
null
false
[ "Charset normalizer is a dependency of requests, not a project maintained by us. This presents another good reason to ditch it though and stop trying to auto detect character sets.\n\nWe can't fix this for you since it's not our code. Closing as a result ", "I'm disagree that this can't be fixed in requests code. The issue seems to be that the try except block around importing the charset_normalizer module doesn't work as intended under pyinstaller builds.\r\n\r\nSpecifically, in compat.py\r\n\r\n```\r\ntry:\r\n import chardet\r\nexcept ImportError:\r\n import charset_normalizer as chardet\r\n```\r\n\r\nI see this throw a `ModuleNotFoundError` instead of `ImportError` so it doesn't even look for the charset_normalizer when it should.", "> I see this throw a ModuleNotFoundError instead of ImportError so it doesn't even look for the charset_normalizer when it should.\r\n\r\nIt's generally good practice to validate assumptions before asserting them as fact. It avoids unnecessary tangents and wasted time.\r\n\r\n```python\r\ntry:\r\n raise ModuleNotFoundError('module not found')\r\nexcept ImportError as e:\r\n print(f\"Error Type: {type(e)}, {e}\")\r\n```\r\n\r\nThe stack trace provided shows we are handling the `ModuleNotFoundError` correctly because the call stack has moved into `import charset_normalizer as chardet`.\r\n\r\nDuring the handling of that import, PyInstaller is unable to resolve `charset_normalizer.md__mypyc` for the reasons mentioned in the PyInstaller ticket. It looks like they're working on a fix from their end. I don't believe there's anything else to be done here.", "> This presents another good reason to ditch it though and stop trying to auto detect character sets.\r\n\r\nOohh, please do. If an API is using a non UTF8 encoding without sending a `Content-Encoding` header then I'd rather requests just let my know by erroring out rather than guessing.", "for other people frantically trying to google this issue for PyInstaller, see the workaround in this comment https://github.com/pyinstaller/pyinstaller-hooks-contrib/issues/534#issuecomment-1382115687\r\n\r\n~~still broken for me in PyInstaller 5.10.1, but was reported against 5.7~~\r\n**Edit:** the actual solution was upgrade `pyinstaller-hooks-contrib`, perhaps I did not pip upgrade properly when I updated PyInstaller. But the workaround worked too.\r\n\r\nThanks requests devs for all your hard work!" ]
https://api.github.com/repos/psf/requests/issues/6330
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6330/labels{/name}
https://api.github.com/repos/psf/requests/issues/6330/comments
https://api.github.com/repos/psf/requests/issues/6330/events
https://github.com/psf/requests/pull/6330
1,531,625,586
PR_kwDOABTKOs5HS2Q9
6,330
Add example and improve docs for RequestException
{ "avatar_url": "https://avatars.githubusercontent.com/u/76045667?v=4", "events_url": "https://api.github.com/users/edward70/events{/privacy}", "followers_url": "https://api.github.com/users/edward70/followers", "following_url": "https://api.github.com/users/edward70/following{/other_user}", "gists_url": "https://api.github.com/users/edward70/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/edward70", "id": 76045667, "login": "edward70", "node_id": "MDQ6VXNlcjc2MDQ1NjY3", "organizations_url": "https://api.github.com/users/edward70/orgs", "received_events_url": "https://api.github.com/users/edward70/received_events", "repos_url": "https://api.github.com/users/edward70/repos", "site_admin": false, "starred_url": "https://api.github.com/users/edward70/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/edward70/subscriptions", "type": "User", "url": "https://api.github.com/users/edward70", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2023-01-13T02:41:11Z
2024-08-12T00:06:14Z
2023-08-12T18:34:42Z
NONE
resolved
I added a brief example of exception handling for `RequestException` and documented the `request` and `response` attributes. PR does not overlap with #6237
{ "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/6330/reactions" }
https://api.github.com/repos/psf/requests/issues/6330/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/6330.diff", "html_url": "https://github.com/psf/requests/pull/6330", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/6330.patch", "url": "https://api.github.com/repos/psf/requests/pulls/6330" }
true
[ "Hi @edward70,\r\n\r\nThanks for the contribution! While this is all correct, it's also information that can be understood reading the code. We try to reserve usage comments for areas that are particularly complex or unintuitive, otherwise it can make code harder to follow due to comment clutter. For that reason, I think we'll pass on this PR for the moment." ]
https://api.github.com/repos/psf/requests/issues/6329
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6329/labels{/name}
https://api.github.com/repos/psf/requests/issues/6329/comments
https://api.github.com/repos/psf/requests/issues/6329/events
https://github.com/psf/requests/pull/6329
1,529,816,381
PR_kwDOABTKOs5HMtdQ
6,329
v2.28.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" }
[]
closed
true
null
[]
null
0
2023-01-11T22:39:35Z
2023-01-12T16:45:01Z
2023-01-12T16:16:12Z
MEMBER
resolved
2.28.2 (2023-01-12) ------------------- **Dependencies** - Requests now supports charset\_normalizer 3.x. (#6261) **Bugfixes** - Updated MissingSchema exception to suggest https scheme rather than http. (#6188)
{ "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/6329/reactions" }
https://api.github.com/repos/psf/requests/issues/6329/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/6329.diff", "html_url": "https://github.com/psf/requests/pull/6329", "merged_at": "2023-01-12T16:16:12Z", "patch_url": "https://github.com/psf/requests/pull/6329.patch", "url": "https://api.github.com/repos/psf/requests/pulls/6329" }
true
[]
https://api.github.com/repos/psf/requests/issues/6328
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6328/labels{/name}
https://api.github.com/repos/psf/requests/issues/6328/comments
https://api.github.com/repos/psf/requests/issues/6328/events
https://github.com/psf/requests/issues/6328
1,528,845,431
I_kwDOABTKOs5bIFR3
6,328
Please do not put upper bounds on your requirements constraints
{ "avatar_url": "https://avatars.githubusercontent.com/u/675997?v=4", "events_url": "https://api.github.com/users/pombredanne/events{/privacy}", "followers_url": "https://api.github.com/users/pombredanne/followers", "following_url": "https://api.github.com/users/pombredanne/following{/other_user}", "gists_url": "https://api.github.com/users/pombredanne/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/pombredanne", "id": 675997, "login": "pombredanne", "node_id": "MDQ6VXNlcjY3NTk5Nw==", "organizations_url": "https://api.github.com/users/pombredanne/orgs", "received_events_url": "https://api.github.com/users/pombredanne/received_events", "repos_url": "https://api.github.com/users/pombredanne/repos", "site_admin": false, "starred_url": "https://api.github.com/users/pombredanne/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/pombredanne/subscriptions", "type": "User", "url": "https://api.github.com/users/pombredanne", "user_view_type": "public" }
[]
closed
true
null
[]
null
4
2023-01-11T11:08:00Z
2024-01-12T00:03:25Z
2023-01-11T11:59:15Z
CONTRIBUTOR
resolved
See https://iscinumpy.dev/post/bound-version-constraints/ as for why this is a problem. This is a source of byzantine issues such as https://github.com/nexB/scancode-toolkit/issues/3195
{ "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/6328/reactions" }
https://api.github.com/repos/psf/requests/issues/6328/timeline
null
completed
null
null
false
[ "For reference these are looking like this for now https://github.com/psf/requests/blob/2745db131a667a3d5457957cb3ed6adeb9b9949a/setup.py#L61:L65\r\n```\r\nrequires = [\r\n \"charset_normalizer>=2,<4\",\r\n \"idna>=2.5,<4\",\r\n \"urllib3>=1.21.1,<1.27\",\r\n \"certifi>=2017.4.17\",\r\n```", "In the future, please search **closed and** open issues before creating new ones that are duplicates.", "@sigmavirus24 sorry for the churn then! I guess you meant this https://github.com/psf/requests/issues/6328#event-8200957254 , repasted here for reference:\r\n\r\n> To be clear, jessemyers our position is the following:\r\n> \r\n> - Requests is critical infrastructure for many projects and the larger Python community (pip, pipenv, twine, and so many other core workflows rely on it).\r\n> \r\n> - urllib3 has the right to make minorly breaking changes to itself in between releases. Requests digs into urllib3 in certain places for certain workflows. Given that, we have to ensure things don't break when a new version of urllib3 came out, and we no longer vendor urllib3 into Requests, we need to be certain that the rest of the world won't burst into flames.\r\n> \r\n> No software can guarantee future proof compatibility. We're very explicitly stating what we support. We could leave the upper bound off but we'd be implicitly supporting everything urllib3 releases. And when that would break, it would inevitably end up with us being painted as the worst people in the world.\r\n> \r\n> Furthermore, there are two of us working on this project actively and both of us have very little time to keep up with other projects' release schedules. The most honest way we can communicate what we are capable of supporting at a given time is with these version constraints. We're far from the only open source project to take this stance. It would seem, then, that the more projects your project(s) use, the more they will encounter this and the more you will need to take a more measured approach to upgrading your dependencies.\r\n[...]\r\n", "There are _many_ past discussions of this. That's but one" ]
https://api.github.com/repos/psf/requests/issues/6327
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6327/labels{/name}
https://api.github.com/repos/psf/requests/issues/6327/comments
https://api.github.com/repos/psf/requests/issues/6327/events
https://github.com/psf/requests/issues/6327
1,527,242,047
I_kwDOABTKOs5bB90_
6,327
Update dependencies
{ "avatar_url": "https://avatars.githubusercontent.com/u/41735311?v=4", "events_url": "https://api.github.com/users/celestinoxp/events{/privacy}", "followers_url": "https://api.github.com/users/celestinoxp/followers", "following_url": "https://api.github.com/users/celestinoxp/following{/other_user}", "gists_url": "https://api.github.com/users/celestinoxp/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/celestinoxp", "id": 41735311, "login": "celestinoxp", "node_id": "MDQ6VXNlcjQxNzM1MzEx", "organizations_url": "https://api.github.com/users/celestinoxp/orgs", "received_events_url": "https://api.github.com/users/celestinoxp/received_events", "repos_url": "https://api.github.com/users/celestinoxp/repos", "site_admin": false, "starred_url": "https://api.github.com/users/celestinoxp/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/celestinoxp/subscriptions", "type": "User", "url": "https://api.github.com/users/celestinoxp", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2023-01-10T11:39:10Z
2024-01-11T00:03:19Z
2023-01-10T12:55:58Z
NONE
resolved
requests 2.28.1 requires charset-normalizer<3,>=2, but you have charset-normalizer 3.0.1 which is incompatible. this problem persists for a long time and requests should release a new update.
{ "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/6327/reactions" }
https://api.github.com/repos/psf/requests/issues/6327/timeline
null
completed
null
null
false
[ "In the future, please search **closed and** open issues before creating new ones that are duplicates." ]
https://api.github.com/repos/psf/requests/issues/6326
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6326/labels{/name}
https://api.github.com/repos/psf/requests/issues/6326/comments
https://api.github.com/repos/psf/requests/issues/6326/events
https://github.com/psf/requests/pull/6326
1,524,679,434
PR_kwDOABTKOs5G7XxO
6,326
Fix exception causes in utils.py
{ "avatar_url": "https://avatars.githubusercontent.com/u/56778?v=4", "events_url": "https://api.github.com/users/cool-RR/events{/privacy}", "followers_url": "https://api.github.com/users/cool-RR/followers", "following_url": "https://api.github.com/users/cool-RR/following{/other_user}", "gists_url": "https://api.github.com/users/cool-RR/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/cool-RR", "id": 56778, "login": "cool-RR", "node_id": "MDQ6VXNlcjU2Nzc4", "organizations_url": "https://api.github.com/users/cool-RR/orgs", "received_events_url": "https://api.github.com/users/cool-RR/received_events", "repos_url": "https://api.github.com/users/cool-RR/repos", "site_admin": false, "starred_url": "https://api.github.com/users/cool-RR/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/cool-RR/subscriptions", "type": "User", "url": "https://api.github.com/users/cool-RR", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2023-01-08T21:06:36Z
2024-01-09T00:03:52Z
2023-01-08T21:43:43Z
NONE
resolved
More context for this change here: https://blog.ram.rachum.com/post/621791438475296768/improving-python-exception-chaining-with
{ "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/6326/reactions" }
https://api.github.com/repos/psf/requests/issues/6326/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/6326.diff", "html_url": "https://github.com/psf/requests/pull/6326", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/6326.patch", "url": "https://api.github.com/repos/psf/requests/pulls/6326" }
true
[ "I don't believe we have dropped 2.7 support yet. Even still we don't accept minor refactorings " ]
https://api.github.com/repos/psf/requests/issues/6325
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6325/labels{/name}
https://api.github.com/repos/psf/requests/issues/6325/comments
https://api.github.com/repos/psf/requests/issues/6325/events
https://github.com/psf/requests/pull/6325
1,522,865,806
PR_kwDOABTKOs5G1b9X
6,325
Switch to Python 3.11 final on CI and add to tox file
{ "avatar_url": "https://avatars.githubusercontent.com/u/861044?v=4", "events_url": "https://api.github.com/users/browniebroke/events{/privacy}", "followers_url": "https://api.github.com/users/browniebroke/followers", "following_url": "https://api.github.com/users/browniebroke/following{/other_user}", "gists_url": "https://api.github.com/users/browniebroke/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/browniebroke", "id": 861044, "login": "browniebroke", "node_id": "MDQ6VXNlcjg2MTA0NA==", "organizations_url": "https://api.github.com/users/browniebroke/orgs", "received_events_url": "https://api.github.com/users/browniebroke/received_events", "repos_url": "https://api.github.com/users/browniebroke/repos", "site_admin": false, "starred_url": "https://api.github.com/users/browniebroke/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/browniebroke/subscriptions", "type": "User", "url": "https://api.github.com/users/browniebroke", "user_view_type": "public" }
[]
closed
true
null
[]
null
0
2023-01-06T16:53:02Z
2024-01-07T00:03:54Z
2023-01-06T18:32:31Z
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": 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/6325/reactions" }
https://api.github.com/repos/psf/requests/issues/6325/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/6325.diff", "html_url": "https://github.com/psf/requests/pull/6325", "merged_at": "2023-01-06T18:32:31Z", "patch_url": "https://github.com/psf/requests/pull/6325.patch", "url": "https://api.github.com/repos/psf/requests/pulls/6325" }
true
[]
https://api.github.com/repos/psf/requests/issues/6324
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6324/labels{/name}
https://api.github.com/repos/psf/requests/issues/6324/comments
https://api.github.com/repos/psf/requests/issues/6324/events
https://github.com/psf/requests/pull/6324
1,521,163,093
PR_kwDOABTKOs5GvmA3
6,324
Correct docstring in requests._internal_utils module
{ "avatar_url": "https://avatars.githubusercontent.com/u/97637908?v=4", "events_url": "https://api.github.com/users/masterr314/events{/privacy}", "followers_url": "https://api.github.com/users/masterr314/followers", "following_url": "https://api.github.com/users/masterr314/following{/other_user}", "gists_url": "https://api.github.com/users/masterr314/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/masterr314", "id": 97637908, "login": "masterr314", "node_id": "U_kgDOBdHWFA", "organizations_url": "https://api.github.com/users/masterr314/orgs", "received_events_url": "https://api.github.com/users/masterr314/received_events", "repos_url": "https://api.github.com/users/masterr314/repos", "site_admin": false, "starred_url": "https://api.github.com/users/masterr314/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/masterr314/subscriptions", "type": "User", "url": "https://api.github.com/users/masterr314", "user_view_type": "public" }
[]
closed
true
null
[]
null
0
2023-01-05T18:09:26Z
2024-01-06T00:03:14Z
2023-01-05T19:08:57Z
NONE
resolved
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/6324/reactions" }
https://api.github.com/repos/psf/requests/issues/6324/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/6324.diff", "html_url": "https://github.com/psf/requests/pull/6324", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/6324.patch", "url": "https://api.github.com/repos/psf/requests/pulls/6324" }
true
[]
https://api.github.com/repos/psf/requests/issues/6323
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6323/labels{/name}
https://api.github.com/repos/psf/requests/issues/6323/comments
https://api.github.com/repos/psf/requests/issues/6323/events
https://github.com/psf/requests/issues/6323
1,520,870,668
I_kwDOABTKOs5apqUM
6,323
From Expecting value: line 1 column 1 (char 0) to Response content not in json format
{ "avatar_url": "https://avatars.githubusercontent.com/u/108686425?v=4", "events_url": "https://api.github.com/users/hasnainhakim/events{/privacy}", "followers_url": "https://api.github.com/users/hasnainhakim/followers", "following_url": "https://api.github.com/users/hasnainhakim/following{/other_user}", "gists_url": "https://api.github.com/users/hasnainhakim/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/hasnainhakim", "id": 108686425, "login": "hasnainhakim", "node_id": "U_kgDOBnpsWQ", "organizations_url": "https://api.github.com/users/hasnainhakim/orgs", "received_events_url": "https://api.github.com/users/hasnainhakim/received_events", "repos_url": "https://api.github.com/users/hasnainhakim/repos", "site_admin": false, "starred_url": "https://api.github.com/users/hasnainhakim/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/hasnainhakim/subscriptions", "type": "User", "url": "https://api.github.com/users/hasnainhakim", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2023-01-05T14:49:33Z
2024-01-06T00:03:12Z
2023-01-05T15:22:25Z
NONE
resolved
Hi Please run: res = self.session.post(url=self.url, data=json.dumps(data), headers=self.h, verify=False) try: js = res.json() token = js['token'] self.cookie['reese84'] = token print(fg + ' (success)') return token except ValueError: print("Response content is not valid JSON") I am getting this : [*] Fetching TokenResponse content is not valid JSON
{ "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/6323/reactions" }
https://api.github.com/repos/psf/requests/issues/6323/timeline
null
completed
null
null
false
[ "We can't help you debug general Python code, this issue tracker is only for defects in the Requests library. I recommend trying stackoverflow.com/ or the [Python Discord](https://www.pythondiscord.com/)." ]
https://api.github.com/repos/psf/requests/issues/6322
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6322/labels{/name}
https://api.github.com/repos/psf/requests/issues/6322/comments
https://api.github.com/repos/psf/requests/issues/6322/events
https://github.com/psf/requests/issues/6322
1,514,163,029
I_kwDOABTKOs5aQEtV
6,322
Allow charset-normalizer 3.x
{ "avatar_url": "https://avatars.githubusercontent.com/u/1259628?v=4", "events_url": "https://api.github.com/users/JayBazuzi/events{/privacy}", "followers_url": "https://api.github.com/users/JayBazuzi/followers", "following_url": "https://api.github.com/users/JayBazuzi/following{/other_user}", "gists_url": "https://api.github.com/users/JayBazuzi/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/JayBazuzi", "id": 1259628, "login": "JayBazuzi", "node_id": "MDQ6VXNlcjEyNTk2Mjg=", "organizations_url": "https://api.github.com/users/JayBazuzi/orgs", "received_events_url": "https://api.github.com/users/JayBazuzi/received_events", "repos_url": "https://api.github.com/users/JayBazuzi/repos", "site_admin": false, "starred_url": "https://api.github.com/users/JayBazuzi/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/JayBazuzi/subscriptions", "type": "User", "url": "https://api.github.com/users/JayBazuzi", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2022-12-30T01:03:30Z
2023-12-31T00:03:51Z
2022-12-30T01:15:36Z
NONE
resolved
requests does not work with charset-normalizer 3.0.0 or 3.0.1, blocking users of requests from updating to the latest charset-normalizer. ## Expected Result <!-- What you expected. --> ## 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/6322/reactions" }
https://api.github.com/repos/psf/requests/issues/6322/timeline
null
completed
null
null
false
[ "Duplicate #6261. Please check existing issues before opening new ones, thanks." ]
https://api.github.com/repos/psf/requests/issues/6321
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6321/labels{/name}
https://api.github.com/repos/psf/requests/issues/6321/comments
https://api.github.com/repos/psf/requests/issues/6321/events
https://github.com/psf/requests/issues/6321
1,514,045,225
I_kwDOABTKOs5aPn8p
6,321
Validation of header type makes it imposible to use a str subclass
{ "avatar_url": "https://avatars.githubusercontent.com/u/2127598?v=4", "events_url": "https://api.github.com/users/startmat/events{/privacy}", "followers_url": "https://api.github.com/users/startmat/followers", "following_url": "https://api.github.com/users/startmat/following{/other_user}", "gists_url": "https://api.github.com/users/startmat/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/startmat", "id": 2127598, "login": "startmat", "node_id": "MDQ6VXNlcjIxMjc1OTg=", "organizations_url": "https://api.github.com/users/startmat/orgs", "received_events_url": "https://api.github.com/users/startmat/received_events", "repos_url": "https://api.github.com/users/startmat/repos", "site_admin": false, "starred_url": "https://api.github.com/users/startmat/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/startmat/subscriptions", "type": "User", "url": "https://api.github.com/users/startmat", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2022-12-29T20:52:56Z
2023-12-30T00:03:02Z
2022-12-29T22:52:25Z
NONE
resolved
Hi, the validation of header type makes it impossible to use a str subclass. code of validation: https://github.com/psf/requests/blob/ec553c275fe915ab8c179a530907b564892d2922/requests/utils.py#L1036 I am rendering a the header by using the Django Template engine which returns a django.utils.safestring.SafeString. When using this as a header I get the requests.exceptions.InvalidHeader: Header part ('application/xml') from {'accept': 'application/xml'} must be of type str or bytes, not <class 'django.utils.safestring.SafeString'> exception. May be using a construct with isinstance(ret, tuple(HEADER_VALIDATORS)): could solve the problem. thx & br Matthias
{ "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/6321/reactions" }
https://api.github.com/repos/psf/requests/issues/6321/timeline
null
completed
null
null
false
[ "In the future, please search **closed and** open issues before creating new ones that are duplicates." ]
https://api.github.com/repos/psf/requests/issues/6320
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6320/labels{/name}
https://api.github.com/repos/psf/requests/issues/6320/comments
https://api.github.com/repos/psf/requests/issues/6320/events
https://github.com/psf/requests/issues/6320
1,513,929,932
I_kwDOABTKOs5aPLzM
6,320
Bump certifi dependencie to v2022.12.7 or higher due to Security Vulnerability
{ "avatar_url": "https://avatars.githubusercontent.com/u/527738?v=4", "events_url": "https://api.github.com/users/MefhigosetH/events{/privacy}", "followers_url": "https://api.github.com/users/MefhigosetH/followers", "following_url": "https://api.github.com/users/MefhigosetH/following{/other_user}", "gists_url": "https://api.github.com/users/MefhigosetH/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/MefhigosetH", "id": 527738, "login": "MefhigosetH", "node_id": "MDQ6VXNlcjUyNzczOA==", "organizations_url": "https://api.github.com/users/MefhigosetH/orgs", "received_events_url": "https://api.github.com/users/MefhigosetH/received_events", "repos_url": "https://api.github.com/users/MefhigosetH/repos", "site_admin": false, "starred_url": "https://api.github.com/users/MefhigosetH/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/MefhigosetH/subscriptions", "type": "User", "url": "https://api.github.com/users/MefhigosetH", "user_view_type": "public" }
[]
closed
true
null
[]
null
4
2022-12-29T17:40:19Z
2024-01-06T00:03:13Z
2022-12-29T17:43:17Z
NONE
resolved
Affected versions of certifi<=2022.12.7 package are vulnerable to Insufficient Verification of Data Authenticity resulting in Certifi root certificate removal from TrustCor. The root certificates are being removed pursuant to an investigation prompted by media reporting that TrustCor's ownership also operated a business that produced spyware. ## Expected Result You must update the `certifi` version in `requests` dependencies. ## Actual Result "certifi>=2017.4.17" in https://github.com/psf/requests/blob/ec553c275fe915ab8c179a530907b564892d2922/setup.py#L65 ## More info See: https://security.snyk.io/vuln/SNYK-PYTHON-CERTIFI-3164749 See: https://groups.google.com/a/mozilla.org/g/dev-security-policy/c/oxX69KFvsm4/m/yLohoVqtCgAJ
{ "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": 1, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 1, "url": "https://api.github.com/repos/psf/requests/issues/6320/reactions" }
https://api.github.com/repos/psf/requests/issues/6320/timeline
null
completed
null
null
false
[ "Hi @MefhigosetH, Requests already supports the patched version of Certifi. Raising the floor will unnecessarily break users as they may be unaffected by the TrustCor issue.", "Hey there, I contacted privately not having seen this and didn't want raise an issue as it was linked to a vuln (_albeit, moderate_) so apologies for the unnecessary message Nate. So I've been trying to upgrade to the patched version of Certifi on one of our projects but get `Because requests (2.28.1) depends on certifi (2022.12.07) which doesn't match any versions, requests is forbidden`. Where could I go from here?", "Hi @Masquerainsley, looking at the screenshot you provided, it appears you need to update your poetry.lock file. certifi `2022.12.7` (note 7 not 07) is available on [PyPI](https://pypi.org/project/certifi/2022.12.7/) with the fix. Requests will use that or any other version you install. You'll want to make sure you're using Python 3.6+ and running `poetry upgrade` to get the latest version.", "I changed it to 7 instead of 07 after checking the PyPi site and still got the same error, I was in the process of upgrading the lock file when this happened. Turns out I had some weird caching thing - deleted and regenerated the file and it's fine now! thanks for your support :). " ]
https://api.github.com/repos/psf/requests/issues/6319
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6319/labels{/name}
https://api.github.com/repos/psf/requests/issues/6319/comments
https://api.github.com/repos/psf/requests/issues/6319/events
https://github.com/psf/requests/issues/6319
1,513,482,451
I_kwDOABTKOs5aNejT
6,319
Print better "reason" for raise_for_status error message.
{ "avatar_url": "https://avatars.githubusercontent.com/u/42677721?v=4", "events_url": "https://api.github.com/users/gk-patel/events{/privacy}", "followers_url": "https://api.github.com/users/gk-patel/followers", "following_url": "https://api.github.com/users/gk-patel/following{/other_user}", "gists_url": "https://api.github.com/users/gk-patel/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/gk-patel", "id": 42677721, "login": "gk-patel", "node_id": "MDQ6VXNlcjQyNjc3NzIx", "organizations_url": "https://api.github.com/users/gk-patel/orgs", "received_events_url": "https://api.github.com/users/gk-patel/received_events", "repos_url": "https://api.github.com/users/gk-patel/repos", "site_admin": false, "starred_url": "https://api.github.com/users/gk-patel/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/gk-patel/subscriptions", "type": "User", "url": "https://api.github.com/users/gk-patel", "user_view_type": "public" }
[]
closed
true
null
[]
null
3
2022-12-29T07:58:32Z
2024-01-20T00:03:13Z
2023-01-19T05:41:39Z
NONE
resolved
<!-- Summary. --> Sometimes proper reason is missing in the Error thrown by the raise_for_status method. `Exception has occurred: HTTPError 405 Client Error: for url: https://bla.com` This is becasue the `reason` is an empty string on [#Line1010](https://github.com/psf/requests/blob/bda7f0171f8bba17989d3a2c28dfa9a9261b1b65/requests/models.py#L1010) But it would be helpful to maybe try and deduct a reason, if not provided by the server (i.e. just a status code is provided) My very ugly implementation of this would look like (just before Line1010) ``` from http import HTTPStatus # somewhere on top .... if not reason: for msg, code in HTTPStatus.__dict__.items(): if code == self.status_code: reason = msg break ``` I am sure you guys will find a one liner. <!-- What you expected. --> I would expect a more clear error message as follows `Exception has occurred: HTTPError 405 Client Error: METHOD_NOT_ALLOWED for url: https://bla.com` <!-- What happened instead. --> ## Reproduction Steps Simply try sending a POST message to a server that does not accept POST. The server should return a proper status_code back but the reason should/could be empty. This might not be an edge case and can be see in some popular servers (eg. I saw this in Jira REST API). ## System Information $ python -m requests.help ``` { "chardet": { "version": null }, "charset_normalizer": { "version": "2.1.1" }, "cryptography": { "version": "" }, "idna": { "version": "3.4" }, "implementation": { "name": "CPython", "version": "3.10.9" }, "platform": { "release": "10", "system": "Windows" }, "pyOpenSSL": { "openssl_version": "", "version": null }, "requests": { "version": "2.28.1" }, "system_ssl": { "version": "1010111f" }, "urllib3": { "version": "1.26.13" }, "using_charset_normalizer": true, "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/6319/reactions" }
https://api.github.com/repos/psf/requests/issues/6319/timeline
null
not_planned
null
null
false
[ "Hey @gk-patel, I can see the reason in response for the method not allowed for jira rest api as well. Check the screenshot attached. Else can you give more brief on steps to reproduce \r\n![image](https://user-images.githubusercontent.com/86048085/210485415-5658d858-fd52-4eb0-930e-bd3e18bd2fa0.png)\r\n", "Hi @ravi-kale, \r\n\r\nMaybe its a problem with our enterprise Jira, unfortunately it does not return _r.reason_. \r\nThe sample error message I printed above was a real example from our enterprise Jira.\r\nI am just suggesting a fall back improvement. I dont think it should interfere with currently available behavior.\r\n\r\nBest Regards,\r\nG. K. Patel\r\n\r\n", "Hi @gk-patel, we generally won't try to infer what a server is intending or mutate what we've received. Reasons are optional metadata from the server and allowed to be omitted. What each status codes means is widely published. If a user needs a textual reminder, it should be quick to look up from the codes list as you've shown.\r\n\r\nI think we'll close this as I don't see it being an accepted feature. Thanks for the suggestion." ]
https://api.github.com/repos/psf/requests/issues/6318
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6318/labels{/name}
https://api.github.com/repos/psf/requests/issues/6318/comments
https://api.github.com/repos/psf/requests/issues/6318/events
https://github.com/psf/requests/issues/6318
1,511,132,821
I_kwDOABTKOs5aEg6V
6,318
Result from browser JS blocked site does not replicate iin Requests
{ "avatar_url": "https://avatars.githubusercontent.com/u/6791269?v=4", "events_url": "https://api.github.com/users/Beeblebrox-BSD/events{/privacy}", "followers_url": "https://api.github.com/users/Beeblebrox-BSD/followers", "following_url": "https://api.github.com/users/Beeblebrox-BSD/following{/other_user}", "gists_url": "https://api.github.com/users/Beeblebrox-BSD/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Beeblebrox-BSD", "id": 6791269, "login": "Beeblebrox-BSD", "node_id": "MDQ6VXNlcjY3OTEyNjk=", "organizations_url": "https://api.github.com/users/Beeblebrox-BSD/orgs", "received_events_url": "https://api.github.com/users/Beeblebrox-BSD/received_events", "repos_url": "https://api.github.com/users/Beeblebrox-BSD/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Beeblebrox-BSD/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Beeblebrox-BSD/subscriptions", "type": "User", "url": "https://api.github.com/users/Beeblebrox-BSD", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2022-12-26T18:09:58Z
2023-12-27T00:03:25Z
2022-12-26T18:42:12Z
NONE
resolved
I'm having trouble understanding a java issue. My browser has javascript blocker extension, and the site comes up normal with JS fully blocked. When using requests, however I get 403. I know Selenium should be used for Java driven sites, but my understanding is that Requests should work if the site comes up with al JS blocked in browser? Perhaps it's a cookies issue? But the initial / first request can't have any cookies, so... Also, does `requests.Session()` automatically retain cookies through iterations or do cookies need to be extracted and passed-on in the next iteration? EDIT: Perhaps this issue is caused by an https problem? I notice that only system_ssl is populated in System Information below. ## PY Code ``` session = requests.Session() session.headers.update(headers) cookies = '' response = session.get(url, cookies =cookies, headers=headers) ``` ## Actual Result <403 forbidden> Enable JavaScript and cookies to continue ## System Information ``` { "chardet": { "version": "4.0.0" }, "charset_normalizer": { "version": "2.1.1" }, "cryptography": { "version": "" }, "idna": { "version": "3.4" }, "implementation": { "name": "CPython", "version": "3.10.7" }, "platform": { "release": "5.19.0-26-generic", "system": "Linux" }, "pyOpenSSL": { "openssl_version": "", "version": null }, "requests": { "version": "2.28.1" }, "system_ssl": { "version": "30000050" }, "urllib3": { "version": "1.26.9" }, "using_charset_normalizer": false, "using_pyopenssl": false } ``` Thank you.
{ "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/6318/reactions" }
https://api.github.com/repos/psf/requests/issues/6318/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." ]
https://api.github.com/repos/psf/requests/issues/6317
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6317/labels{/name}
https://api.github.com/repos/psf/requests/issues/6317/comments
https://api.github.com/repos/psf/requests/issues/6317/events
https://github.com/psf/requests/pull/6317
1,510,442,243
PR_kwDOABTKOs5GLOIX
6,317
Update flake8 repo and version
{ "avatar_url": "https://avatars.githubusercontent.com/u/108201575?v=4", "events_url": "https://api.github.com/users/ch-iv/events{/privacy}", "followers_url": "https://api.github.com/users/ch-iv/followers", "following_url": "https://api.github.com/users/ch-iv/following{/other_user}", "gists_url": "https://api.github.com/users/ch-iv/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/ch-iv", "id": 108201575, "login": "ch-iv", "node_id": "U_kgDOBnMGZw", "organizations_url": "https://api.github.com/users/ch-iv/orgs", "received_events_url": "https://api.github.com/users/ch-iv/received_events", "repos_url": "https://api.github.com/users/ch-iv/repos", "site_admin": false, "starred_url": "https://api.github.com/users/ch-iv/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/ch-iv/subscriptions", "type": "User", "url": "https://api.github.com/users/ch-iv", "user_view_type": "public" }
[]
closed
true
null
[]
null
0
2022-12-25T23:39:31Z
2023-12-27T00:03:27Z
2022-12-26T04:24:16Z
CONTRIBUTOR
resolved
Closes #6316
{ "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/6317/reactions" }
https://api.github.com/repos/psf/requests/issues/6317/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/6317.diff", "html_url": "https://github.com/psf/requests/pull/6317", "merged_at": "2022-12-26T04:24:16Z", "patch_url": "https://github.com/psf/requests/pull/6317.patch", "url": "https://api.github.com/repos/psf/requests/pulls/6317" }
true
[]