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/4964
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4964/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4964/comments
|
https://api.github.com/repos/psf/requests/issues/4964/events
|
https://github.com/psf/requests/issues/4964
| 407,256,395 |
MDU6SXNzdWU0MDcyNTYzOTU=
| 4,964 |
phython error
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/47377273?v=4",
"events_url": "https://api.github.com/users/achyuthachu/events{/privacy}",
"followers_url": "https://api.github.com/users/achyuthachu/followers",
"following_url": "https://api.github.com/users/achyuthachu/following{/other_user}",
"gists_url": "https://api.github.com/users/achyuthachu/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/achyuthachu",
"id": 47377273,
"login": "achyuthachu",
"node_id": "MDQ6VXNlcjQ3Mzc3Mjcz",
"organizations_url": "https://api.github.com/users/achyuthachu/orgs",
"received_events_url": "https://api.github.com/users/achyuthachu/received_events",
"repos_url": "https://api.github.com/users/achyuthachu/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/achyuthachu/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/achyuthachu/subscriptions",
"type": "User",
"url": "https://api.github.com/users/achyuthachu",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 1 |
2019-02-06T14:18:06Z
|
2021-09-05T00:07:03Z
|
2019-02-06T14:29:47Z
|
NONE
|
resolved
|
Summary.
## Expected Result
output should run without any error or exception
What you expected.
## Actual Result
Can please resolve this issue??
ConnectionRefusedError: [WinError 10061] No connection could be made because the target machine actively refused it
During handling of the above exception, another exception occurred:
self, "Failed to establish a new connection: %s" % e)
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x02D87DB0>: Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it
During handling of the above exception, another exception occurred:
|
{
"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": 1,
"confused": 1,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 2,
"url": "https://api.github.com/repos/psf/requests/issues/4964/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4964/timeline
| null |
completed
| null | null | false |
[
"This is not a Requests bug. "
] |
https://api.github.com/repos/psf/requests/issues/4963
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4963/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4963/comments
|
https://api.github.com/repos/psf/requests/issues/4963/events
|
https://github.com/psf/requests/issues/4963
| 407,086,311 |
MDU6SXNzdWU0MDcwODYzMTE=
| 4,963 |
problem in python
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/47377273?v=4",
"events_url": "https://api.github.com/users/achyuthachu/events{/privacy}",
"followers_url": "https://api.github.com/users/achyuthachu/followers",
"following_url": "https://api.github.com/users/achyuthachu/following{/other_user}",
"gists_url": "https://api.github.com/users/achyuthachu/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/achyuthachu",
"id": 47377273,
"login": "achyuthachu",
"node_id": "MDQ6VXNlcjQ3Mzc3Mjcz",
"organizations_url": "https://api.github.com/users/achyuthachu/orgs",
"received_events_url": "https://api.github.com/users/achyuthachu/received_events",
"repos_url": "https://api.github.com/users/achyuthachu/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/achyuthachu/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/achyuthachu/subscriptions",
"type": "User",
"url": "https://api.github.com/users/achyuthachu",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 0 |
2019-02-06T05:28:47Z
|
2021-09-05T00:07:04Z
|
2019-02-06T12:32:40Z
|
NONE
|
resolved
|
Can please resolve this issue??
ConnectionRefusedError: [WinError 10061] No connection could be made because the target machine actively refused it
During handling of the above exception, another exception occurred:
self, "Failed to establish a new connection: %s" % e)
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x02D87DB0>: Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it
During handling of the above exception, another exception occurred:
|
{
"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": 1,
"confused": 1,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 2,
"url": "https://api.github.com/repos/psf/requests/issues/4963/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4963/timeline
| null |
completed
| null | null | false |
[] |
https://api.github.com/repos/psf/requests/issues/4962
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4962/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4962/comments
|
https://api.github.com/repos/psf/requests/issues/4962/events
|
https://github.com/psf/requests/issues/4962
| 406,947,123 |
MDU6SXNzdWU0MDY5NDcxMjM=
| 4,962 |
Requests.get producing different JSON than curl
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/30030760?v=4",
"events_url": "https://api.github.com/users/MikeFindsThings/events{/privacy}",
"followers_url": "https://api.github.com/users/MikeFindsThings/followers",
"following_url": "https://api.github.com/users/MikeFindsThings/following{/other_user}",
"gists_url": "https://api.github.com/users/MikeFindsThings/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/MikeFindsThings",
"id": 30030760,
"login": "MikeFindsThings",
"node_id": "MDQ6VXNlcjMwMDMwNzYw",
"organizations_url": "https://api.github.com/users/MikeFindsThings/orgs",
"received_events_url": "https://api.github.com/users/MikeFindsThings/received_events",
"repos_url": "https://api.github.com/users/MikeFindsThings/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/MikeFindsThings/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/MikeFindsThings/subscriptions",
"type": "User",
"url": "https://api.github.com/users/MikeFindsThings",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 5 |
2019-02-05T19:50:53Z
|
2021-09-05T00:07:04Z
|
2019-02-05T21:55:48Z
|
NONE
|
resolved
|
When making a get request requests.get and curl, the returned JSON object is identical in every way, except with requests.get leading digits in an "id":# kv pair are omitted.
## Expected Result
cURL and requests.get returned JSON objects should be identical
## Actual Result
requests.get returns
`"id":12345`
Whereas curl returns
`"id":10000000000012345`
## Reproduction Steps
```python
import requests
HEADERS = {'Authorization': f'Bearer {args.api_key}'}
API_URL = f'https://canvas.instructure.com/api/v1'
STUDENT = requests.get(f'{API_URL}/courses/', params=None, headers=HEADERS)
studnetlst = STUDENT.json()
print(studnetlst)
```
## System Information
$ python -m requests.help
```
{
"chardet": {
"version": "3.0.4"
},
"cryptography": {
"version": ""
},
"idna": {
"version": "2.8"
},
"implementation": {
"name": "CPython",
"version": "3.7.2"
},
"platform": {
"release": "10",
"system": "Windows"
},
"pyOpenSSL": {
"openssl_version": "",
"version": null
},
"requests": {
"version": "2.21.0"
},
"system_ssl": {
"version": "101000af"
},
"urllib3": {
"version": "1.24.1"
},
"using_pyopenssl": false
}
```
More info: https://stackoverflow.com/questions/54527648/pythons-requests-get-producing-different-json-than-api-client
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/4962/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4962/timeline
| null |
completed
| null | null | false |
[
"Can you share the relevant bit from `STUDENT.content`?",
"`STUDENT.content`:\r\n\r\n`b'[{\"id\":12345,\"name\":\"Class1\",\"account_id\":188,\"uuid\":\"itsadifferentsecret\",\"start_at\":\"2019-01-13T17:33:04Z\",\"grading_standard_id\":null}]'`\r\n\r\nthe desired result should look like:\r\n\r\n`b'[{\"id\":10000000000012345,\"name\":\"Class1\",\"account_id\":188,\"uuid\":\"itsadifferentsecret\",\"start_at\":\"2019-01-13T17:33:04Z\",\"grading_standard_id\":null}]'`\r\n",
"So this shows that Canvas is responding with incorrect data. Literally the bytes we receive from the server do no thave the digits you're looking for and there's nothing Requests can do.\r\n\r\nOften times, this is the result of the server introspecting user-agent headers so I suspect you try sending a different one.\r\n\r\nCheers,\r\nIan",
"But if I change the user-agent to the same as one that runs successfully I have the same problem. ",
"@sigmavirus24 does adding `'User-Agent': 'adifferentagent'` actually change the header? From captured frames in Wireshark it appears to, just checking my understanding."
] |
https://api.github.com/repos/psf/requests/issues/4961
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4961/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4961/comments
|
https://api.github.com/repos/psf/requests/issues/4961/events
|
https://github.com/psf/requests/issues/4961
| 406,537,271 |
MDU6SXNzdWU0MDY1MzcyNzE=
| 4,961 |
OpenSSL.SSL.Error raised with invalid client cert and openssl 1.1.1.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/308610?v=4",
"events_url": "https://api.github.com/users/jaraco/events{/privacy}",
"followers_url": "https://api.github.com/users/jaraco/followers",
"following_url": "https://api.github.com/users/jaraco/following{/other_user}",
"gists_url": "https://api.github.com/users/jaraco/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/jaraco",
"id": 308610,
"login": "jaraco",
"node_id": "MDQ6VXNlcjMwODYxMA==",
"organizations_url": "https://api.github.com/users/jaraco/orgs",
"received_events_url": "https://api.github.com/users/jaraco/received_events",
"repos_url": "https://api.github.com/users/jaraco/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/jaraco/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jaraco/subscriptions",
"type": "User",
"url": "https://api.github.com/users/jaraco",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 15 |
2019-02-04T21:56:01Z
|
2021-11-05T03:00:28Z
|
2021-08-07T02:30:33Z
|
CONTRIBUTOR
|
resolved
|
In https://github.com/cherrypy/cheroot/issues/173, we discovered that with the release of cryptography 2.5, built against OpenSSL 1.1.1a, a [call to requests.get](https://github.com/cherrypy/cheroot/blob/e616c2542d5fb0a414344fd5c8864e5c970444e0/cheroot/test/test_ssl.py#L272-L281) with a client certificate referencing an unknown CA will raise an `OpenSSL.SSL.Error` not wrapped in a `requests.exceptions.SSLError`, whereas with cryptography < 2.5 (openssl 1.1.0), the error is wrapped.
Due to the complexities of this situation, I've not yet been able to put together an isolated test case that replicates the issue. It's possible there are other factors in the cheroot test suite that are affecting this behavior.
I wanted to raise this issue here to see if the requests maintainers have some insight into this issue - either how the situation above might arise or how one might be able to simply replicate the conditions that lead to situation so further investigation could be done. Any advice is appreciated.
|
{
"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/4961/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4961/timeline
| null |
completed
| null | null | false |
[
"This is probably something for urllib3 instead of requests?",
"@sethmlarson so it's plausible urllib3 isn't catching/re-raising that exception appropriately. It sounds like we're also missing the bit where `pyOpenSSL` is used here (as that's the only time an `OpenSSL.SSL.Error` would occur. Once urllib3 raises the right error, we should be able to handle it and raise `requests.exceptions.SSLError`.\r\n\r\nFurther, we have no information beyond cryptography and openssl, so we don't know which versions of requests/urllib3/pyOpenSSl are affected by this or how we might even begin investigating this.",
"In the downstream issue, the issue occurs with pyOpenSSL 18 and 19. The version of requests used is 2.21.0. I'd love to provide a minimal example, but I've yet been unable to do so. Here's a [complete set of dependencies](https://github.com/cherrypy/cheroot/issues/173#issuecomment-460411259) that were present when the issue occurred, which we used to determine that the version of cryptography is the key factor in eliciting the behavior.\r\n\r\nIn [the original report](https://github.com/cherrypy/cheroot/issues/173#issue-406515214), you can see the stack trace when the pyOpenSSL error is raised and requests and urllib are in the trace. Does that provide a hint as to where the issue might lie?\r\n\r\nI'm hoping to avoid putting together an isolated test case due to the complexities of setting up a suitable TLS-enabled web server with client certificate support (I did try using badssl.com, but couldn't replicate the issue there).",
"So looking at master briefly, it seems we're not handling any OpenSSL errors in https://github.com/urllib3/urllib3/blob/4239a6d9edbc617439726c7e38cdaf7b24725a29/src/urllib3/connectionpool.py#L597 or in `_make_request`? I'm not sure if we need to add that handle, or how we've missed it thus far.",
"But that's in urllib3's stack so 🤷♂️ ",
"That's what I noticed too. I wonder if this is due to TLS 1.3 doing certificate verification differently than versions before it? Either way, us not handling that error as a retryable error is not good.",
"> But that's in urllib3's stack so\r\n\r\n...we should file the ticket upstream? Or maybe just move this ticket to that project (requires admin on one or both)?",
"Can't move issues cross-org (yet?) could you reopen an issue and include the exact Python, pyOpenSSL, cryptography versions and cert you're using so I can reproduce exactly what you're seeing? I appreciate your effort looking into this issue.",
"FTR https://github.com/urllib3/urllib3/pull/1496 must've fixed this. But needs validation...",
"FTR `urllib==1.24.2` has been released 5 days ago.",
"This should be fixed in urllib3==1.25.",
"@sethmlarson not in `1.24.2`? I thought it's there...",
"Nope, 1.24.2 didn't contain any new features only three fixes on the 1.24.x releases.",
"Oh, thanks for the clarification!",
"This was resolved in urllib v1.25.0."
] |
https://api.github.com/repos/psf/requests/issues/4960
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4960/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4960/comments
|
https://api.github.com/repos/psf/requests/issues/4960/events
|
https://github.com/psf/requests/pull/4960
| 406,330,404 |
MDExOlB1bGxSZXF1ZXN0MjUwMDUxNzcx
| 4,960 |
docs: correct error in 'merge_environment_settings' usage
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/715421?v=4",
"events_url": "https://api.github.com/users/andrewbonney/events{/privacy}",
"followers_url": "https://api.github.com/users/andrewbonney/followers",
"following_url": "https://api.github.com/users/andrewbonney/following{/other_user}",
"gists_url": "https://api.github.com/users/andrewbonney/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/andrewbonney",
"id": 715421,
"login": "andrewbonney",
"node_id": "MDQ6VXNlcjcxNTQyMQ==",
"organizations_url": "https://api.github.com/users/andrewbonney/orgs",
"received_events_url": "https://api.github.com/users/andrewbonney/received_events",
"repos_url": "https://api.github.com/users/andrewbonney/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/andrewbonney/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/andrewbonney/subscriptions",
"type": "User",
"url": "https://api.github.com/users/andrewbonney",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 1 |
2019-02-04T13:30:48Z
|
2021-08-31T00:07:26Z
|
2019-02-04T15:22:41Z
|
CONTRIBUTOR
|
resolved
|
This resolves a very minor documentation issue for the proxies argument in 'merge_environment_settings' See #4959
|
{
"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/4960/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4960/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/4960.diff",
"html_url": "https://github.com/psf/requests/pull/4960",
"merged_at": "2019-02-04T15:22:41Z",
"patch_url": "https://github.com/psf/requests/pull/4960.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/4960"
}
| true |
[
"# [Codecov](https://codecov.io/gh/requests/requests/pull/4960?src=pr&el=h1) Report\n> Merging [#4960](https://codecov.io/gh/requests/requests/pull/4960?src=pr&el=desc) into [master](https://codecov.io/gh/requests/requests/commit/64bde6582d9b49e9345d9b8df16aaa26dc372d13?src=pr&el=desc) will **not change** coverage.\n> The diff coverage is `n/a`.\n\n[](https://codecov.io/gh/requests/requests/pull/4960?src=pr&el=tree)\n\n```diff\n@@ Coverage Diff @@\n## master #4960 +/- ##\n=======================================\n Coverage 66.89% 66.89% \n=======================================\n Files 15 15 \n Lines 1577 1577 \n=======================================\n Hits 1055 1055 \n Misses 522 522\n```\n\n\n\n------\n\n[Continue to review full report at Codecov](https://codecov.io/gh/requests/requests/pull/4960?src=pr&el=continue).\n> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)\n> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`\n> Powered by [Codecov](https://codecov.io/gh/requests/requests/pull/4960?src=pr&el=footer). Last update [64bde65...827bbe2](https://codecov.io/gh/requests/requests/pull/4960?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).\n"
] |
https://api.github.com/repos/psf/requests/issues/4959
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4959/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4959/comments
|
https://api.github.com/repos/psf/requests/issues/4959/events
|
https://github.com/psf/requests/issues/4959
| 406,272,001 |
MDU6SXNzdWU0MDYyNzIwMDE=
| 4,959 |
Exception when calling 'merge_environment_settings' as documented
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/715421?v=4",
"events_url": "https://api.github.com/users/andrewbonney/events{/privacy}",
"followers_url": "https://api.github.com/users/andrewbonney/followers",
"following_url": "https://api.github.com/users/andrewbonney/following{/other_user}",
"gists_url": "https://api.github.com/users/andrewbonney/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/andrewbonney",
"id": 715421,
"login": "andrewbonney",
"node_id": "MDQ6VXNlcjcxNTQyMQ==",
"organizations_url": "https://api.github.com/users/andrewbonney/orgs",
"received_events_url": "https://api.github.com/users/andrewbonney/received_events",
"repos_url": "https://api.github.com/users/andrewbonney/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/andrewbonney/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/andrewbonney/subscriptions",
"type": "User",
"url": "https://api.github.com/users/andrewbonney",
"user_view_type": "public"
}
|
[
{
"color": "fad8c7",
"default": false,
"description": null,
"id": 136616769,
"name": "Documentation",
"node_id": "MDU6TGFiZWwxMzY2MTY3Njk=",
"url": "https://api.github.com/repos/psf/requests/labels/Documentation"
},
{
"color": "69ccdb",
"default": false,
"description": null,
"id": 773540467,
"name": "PR(s) Wanted",
"node_id": "MDU6TGFiZWw3NzM1NDA0Njc=",
"url": "https://api.github.com/repos/psf/requests/labels/PR(s)%20Wanted"
}
] |
closed
| true | null |
[] | null | 1 |
2019-02-04T10:48:55Z
|
2021-09-06T00:06:30Z
|
2019-02-04T15:23:10Z
|
CONTRIBUTOR
|
resolved
|
When calling `merge_environment_settings` as documented in http://docs.python-requests.org/en/master/user/advanced/#prepared-requests an exception occurs. There appears to be a conflict between the code and the documentation.
## Expected Result
Calling `merge_environment_settings` on a Session object with 'None' in all arguments except the first proceeds without error.
## Actual Result
An exception occurs: `'NoneType' object has no attribute 'setdefault'`. This is caused by https://github.com/requests/requests/blob/eaab47f033cae3bd443abb6707dfc30ae3482c36/requests/sessions.py#L702 when the 'proxies' argument is set to 'None'.
## Reproduction Steps
As-per the documentation example
```python
from requests import Request, Session
s = Session()
url = "https://google.com"
req = Request('GET', url)
prepped = s.prepare_request(req)
settings = s.merge_environment_settings(prepped.url, None, None, None, None)
```
## System Information
```
Python 3.5
Requests 2.9.1
Ubuntu Xenial
```
|
{
"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/4959/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4959/timeline
| null |
completed
| null | null | false |
[
"Yes, the documentation is out of date. I'd be happy to merge a pull request that updates it."
] |
https://api.github.com/repos/psf/requests/issues/4958
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4958/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4958/comments
|
https://api.github.com/repos/psf/requests/issues/4958/events
|
https://github.com/psf/requests/pull/4958
| 406,093,740 |
MDExOlB1bGxSZXF1ZXN0MjQ5ODgwNzcy
| 4,958 |
Delegate chunked encoding handling to urllib
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/3791127?v=4",
"events_url": "https://api.github.com/users/leamingrad/events{/privacy}",
"followers_url": "https://api.github.com/users/leamingrad/followers",
"following_url": "https://api.github.com/users/leamingrad/following{/other_user}",
"gists_url": "https://api.github.com/users/leamingrad/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/leamingrad",
"id": 3791127,
"login": "leamingrad",
"node_id": "MDQ6VXNlcjM3OTExMjc=",
"organizations_url": "https://api.github.com/users/leamingrad/orgs",
"received_events_url": "https://api.github.com/users/leamingrad/received_events",
"repos_url": "https://api.github.com/users/leamingrad/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/leamingrad/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/leamingrad/subscriptions",
"type": "User",
"url": "https://api.github.com/users/leamingrad",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 2 |
2019-02-03T14:29:23Z
|
2021-08-29T00:06:59Z
|
2020-03-17T09:50:18Z
|
NONE
|
resolved
|
This MR removes the custom handling of sending chunked HTTP requests from requests to delegate to the equivalent logic in urllib3 (https://github.com/urllib3/urllib3/blob/4325867d1ae0d139a11c8689c2d2a5ba2c666c83/src/urllib3/connectionpool.py#L351).
As far as I can tell this has a couple of advantages:
* Remove code that is duplicated between the two libraries
* Allow fixes for outstanding issues in this area to be made in urllib3 so that users of both libraries benefit (I noticed #4445 when having a quick trawl of the issues but I guess there are more)
* All requests are now logged by the urllib3 debug logger (which was the issue I was originally trying to diagnose)
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/3791127?v=4",
"events_url": "https://api.github.com/users/leamingrad/events{/privacy}",
"followers_url": "https://api.github.com/users/leamingrad/followers",
"following_url": "https://api.github.com/users/leamingrad/following{/other_user}",
"gists_url": "https://api.github.com/users/leamingrad/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/leamingrad",
"id": 3791127,
"login": "leamingrad",
"node_id": "MDQ6VXNlcjM3OTExMjc=",
"organizations_url": "https://api.github.com/users/leamingrad/orgs",
"received_events_url": "https://api.github.com/users/leamingrad/received_events",
"repos_url": "https://api.github.com/users/leamingrad/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/leamingrad/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/leamingrad/subscriptions",
"type": "User",
"url": "https://api.github.com/users/leamingrad",
"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/4958/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4958/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/4958.diff",
"html_url": "https://github.com/psf/requests/pull/4958",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/4958.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/4958"
}
| true |
[
"Quick note on testing that I forgot to put in the description: I haven't added any specific tests to cover this feature, but I think that the code is covered by existing tests from what I can see - if there are extras that would be helpful I am happy to add them.",
"# [Codecov](https://codecov.io/gh/requests/requests/pull/4958?src=pr&el=h1) Report\n> Merging [#4958](https://codecov.io/gh/requests/requests/pull/4958?src=pr&el=desc) into [master](https://codecov.io/gh/requests/requests/commit/64bde6582d9b49e9345d9b8df16aaa26dc372d13?src=pr&el=desc) will **decrease** coverage by `0.23%`.\n> The diff coverage is `100%`.\n\n[](https://codecov.io/gh/requests/requests/pull/4958?src=pr&el=tree)\n\n```diff\n@@ Coverage Diff @@\n## master #4958 +/- ##\n==========================================\n- Coverage 66.89% 66.66% -0.24% \n==========================================\n Files 15 15 \n Lines 1577 1554 -23 \n==========================================\n- Hits 1055 1036 -19 \n+ Misses 522 518 -4\n```\n\n\n| [Impacted Files](https://codecov.io/gh/requests/requests/pull/4958?src=pr&el=tree) | Coverage Δ | |\n|---|---|---|\n| [requests/adapters.py](https://codecov.io/gh/requests/requests/pull/4958/diff?src=pr&el=tree#diff-cmVxdWVzdHMvYWRhcHRlcnMucHk=) | `68.84% <100%> (-1.43%)` | :arrow_down: |\n\n------\n\n[Continue to review full report at Codecov](https://codecov.io/gh/requests/requests/pull/4958?src=pr&el=continue).\n> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)\n> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`\n> Powered by [Codecov](https://codecov.io/gh/requests/requests/pull/4958?src=pr&el=footer). Last update [64bde65...5ac5caa](https://codecov.io/gh/requests/requests/pull/4958?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).\n"
] |
https://api.github.com/repos/psf/requests/issues/4957
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4957/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4957/comments
|
https://api.github.com/repos/psf/requests/issues/4957/events
|
https://github.com/psf/requests/issues/4957
| 405,873,041 |
MDU6SXNzdWU0MDU4NzMwNDE=
| 4,957 |
Unsatisfiable byte range request (416), but iter_content() still provides data
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/37048747?v=4",
"events_url": "https://api.github.com/users/Jacob-Stevens-Haas/events{/privacy}",
"followers_url": "https://api.github.com/users/Jacob-Stevens-Haas/followers",
"following_url": "https://api.github.com/users/Jacob-Stevens-Haas/following{/other_user}",
"gists_url": "https://api.github.com/users/Jacob-Stevens-Haas/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Jacob-Stevens-Haas",
"id": 37048747,
"login": "Jacob-Stevens-Haas",
"node_id": "MDQ6VXNlcjM3MDQ4NzQ3",
"organizations_url": "https://api.github.com/users/Jacob-Stevens-Haas/orgs",
"received_events_url": "https://api.github.com/users/Jacob-Stevens-Haas/received_events",
"repos_url": "https://api.github.com/users/Jacob-Stevens-Haas/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Jacob-Stevens-Haas/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Jacob-Stevens-Haas/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Jacob-Stevens-Haas",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 1 |
2019-02-01T21:05:31Z
|
2021-09-06T00:06:31Z
|
2019-02-02T14:50:04Z
|
NONE
|
resolved
|
## Summary
I accidentally requested a byte range that was out of the targeted resource's range, but iter_content() still provided bytes despite receiving a 416 error code. Apparently, in addition to the 416 error code, the server is returning an unrequested html document describing a 416 error code. I've read [Since RFC 7233](https://tools.ietf.org/html/rfc7233), but I'm unable to tell what should happen.
## Expected Result
Either
* (a) the server is allowed to return something like that, and `requests` is behaving correctly by receiving the data. The off-by-one error that caused the bad request was my fault, and I should have been more diligent about checking status codes. Close the issue, and I can go sit in the corner of shame.
* (b) the server is not allowed to return unrelated content with a 416, and `requests` should be catching the error
* (c) the server is allowed to return unrelated content with a 416, but it's such bad form that `requests`, as "HTTP for Humans," should warn or throw an error.
## Actual Result
I was streaming a zip file, and i accidentally requested a start and end past the end of the file. I appended the results from iter_content() to my file (Windows ended up ignoring the extra bytes, but that's not the point).
The reproduction code shows the extra data that I received in a 416:
```
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>416 Requested Range Not Satisfiable</title>
</head><body>
<h1>Requested Range Not Satisfiable</h1>
<p>None of the range-specifier values in the Range
request-header field overlap the current extent
of the selected resource.</p>
</body></html>
```
## Reproduction Steps
```python
import requests
import sys
ais = 'https://coast.noaa.gov/htdata/CMSP/AISDataHandler/2017/AIS_2017_01_Zone10.zip'
requests.get(url=ais, stream=True)
#Out[4]: <Response [200]>
requests.get(url=ais, stream=True).headers['content-length']
#Out[5]: '941900127'
header={'Range':'bytes=%s-%s' % (941900127,941900127)}
req = requests.get(url=ais, stream=True, headers=header)
for chunk in req.iter_content(chunk_size=1):
if chunk:
sys.stdout.write(chunk)
```
## System Information
```
C:\Users\600301>python -m requests.help
{
"chardet": {
"version": "3.0.4"
},
"cryptography": {
"version": "2.4.2"
},
"idna": {
"version": "2.6"
},
"implementation": {
"name": "CPython",
"version": "3.6.5"
},
"platform": {
"release": "10",
"system": "Windows"
},
"pyOpenSSL": {
"openssl_version": "1010101f",
"version": "18.0.0"
},
"requests": {
"version": "2.18.4"
},
"system_ssl": {
"version": "100020bf"
},
"urllib3": {
"version": "1.22"
},
"using_pyopenssl": true
}
```
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/240830?v=4",
"events_url": "https://api.github.com/users/sigmavirus24/events{/privacy}",
"followers_url": "https://api.github.com/users/sigmavirus24/followers",
"following_url": "https://api.github.com/users/sigmavirus24/following{/other_user}",
"gists_url": "https://api.github.com/users/sigmavirus24/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/sigmavirus24",
"id": 240830,
"login": "sigmavirus24",
"node_id": "MDQ6VXNlcjI0MDgzMA==",
"organizations_url": "https://api.github.com/users/sigmavirus24/orgs",
"received_events_url": "https://api.github.com/users/sigmavirus24/received_events",
"repos_url": "https://api.github.com/users/sigmavirus24/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/sigmavirus24/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/sigmavirus24/subscriptions",
"type": "User",
"url": "https://api.github.com/users/sigmavirus24",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/4957/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4957/timeline
| null |
completed
| null | null | false |
[
"Requests does not and can not (within reason) protect you from yourself or a misbehaving server. We don't introspect headers to guess what you're trying to do (in this case a range request) and we don't automagically raise exceptions for error-class status codes. We expect users to check status codes or use `raise_for_status()` if they want an exception in those cases.\r\n\r\nUnfortunately, there's not much we can reasonably improve for your use-case without causing immensely frustrating bugs for someone else. (I've investigated) Part of what makes the Requests API so appealing to so many is what makes it so frustratingly difficult to do things that might be convenient to a narrower percentage of our users, like in this very case."
] |
https://api.github.com/repos/psf/requests/issues/4956
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4956/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4956/comments
|
https://api.github.com/repos/psf/requests/issues/4956/events
|
https://github.com/psf/requests/issues/4956
| 405,545,488 |
MDU6SXNzdWU0MDU1NDU0ODg=
| 4,956 |
Content-Length is not checked, resulting in short reads with no error
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/40829765?v=4",
"events_url": "https://api.github.com/users/debugmiller/events{/privacy}",
"followers_url": "https://api.github.com/users/debugmiller/followers",
"following_url": "https://api.github.com/users/debugmiller/following{/other_user}",
"gists_url": "https://api.github.com/users/debugmiller/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/debugmiller",
"id": 40829765,
"login": "debugmiller",
"node_id": "MDQ6VXNlcjQwODI5NzY1",
"organizations_url": "https://api.github.com/users/debugmiller/orgs",
"received_events_url": "https://api.github.com/users/debugmiller/received_events",
"repos_url": "https://api.github.com/users/debugmiller/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/debugmiller/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/debugmiller/subscriptions",
"type": "User",
"url": "https://api.github.com/users/debugmiller",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 9 |
2019-02-01T04:17:37Z
|
2024-07-24T00:03:29Z
|
2023-07-24T22:07:39Z
|
NONE
|
resolved
|
Currently, requests does not detect when the length of a response body does not match the `Content-Length` header. This behavior results in undetected failures when a TCP connection is closed early (for example) and is contrary to the behavior of other tools (e.g. `curl`) and libraries (e.g. `reqwest`) which fail if a body length does not match `Content-Length` [3]. It is also contrary to the HTTP 1.1 RFC [5]. Frustration with this behavior is well documented ([1][2][3][4]) and was first reported as a bug 5 years ago [5]. In [1] it was agreed that the underlying checking should be done in urllib3. This was implemented in urllib3 v1.17 with the `enforce_content_length` setting [6]. However the setting defaults to False. At the time this was implemented in urllib3, there was a merge on requests:proposed/3.0.0 [7] that set `enforce_content_length` to True so that short reads would be detected (~~it was later reverted~~ edit: it wasn't reverted), but no such merge happened on requests 2.x branch.
Requests master now requires urllib3>=1.21 so we are guaranteed to have enforce_content_length. There is a strong argument to be made that `enforce_content_length=True` should be the default but at the very least it should be possible for a user to opt into this.
[1] https://github.com/requests/requests/pull/2833
[2] https://github.com/requests/requests/issues/2275
[3] https://blog.petrzemek.net/2018/04/22/on-incomplete-http-reads-and-the-requests-library-in-python/
[4] https://news.ycombinator.com/item?id=16896899
[5] https://github.com/requests/requests/issues/1855
[6] https://github.com/urllib3/urllib3/pull/949
[7] https://github.com/requests/requests/pull/3563.
## Expected Result
HTTP bodies that do not match the HTTP `Content-Length` header should be detected
## Actual Result
HTTP bodies that do not match the HTTP `Content-Length` header are not detected.
## Reproduction Steps
https://github.com/requests/requests/pull/2833#issuecomment-148813870
## System Information
```
$ python -m requests.help
{
"chardet": {
"version": "3.0.4"
},
"cryptography": {
"version": ""
},
"idna": {
"version": "2.7"
},
"implementation": {
"name": "CPython",
"version": "3.7.0"
},
"platform": {
"release": "18.2.0",
"system": "Darwin"
},
"pyOpenSSL": {
"openssl_version": "",
"version": null
},
"requests": {
"version": "2.21.0"
},
"system_ssl": {
"version": "1000211f"
},
"urllib3": {
"version": "1.24"
},
"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": 17,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 1,
"total_count": 18,
"url": "https://api.github.com/repos/psf/requests/issues/4956/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4956/timeline
| null |
completed
| null | null | false |
[
"I should also add that I'm happy to port over https://github.com/requests/requests/pull/3563 but I'm unclear on why it was reverted or if the approach applies to requests 2.x",
"I have realized it wasn't reverted, I misread the PR that I thought reverted it.",
"I can confirm that Requests ignores `Content-Length` despite the fact that both `urllib3` and the built-in `http` module check it, when used in the most obvious possible ways (and despite the fact that unrelated tools for making HTTP requests, like Curl, check it).\r\n\r\nFor a simple demonstration, first install Flask, copy the following code into a file, and run it:\r\n\r\n```\r\nfrom flask import Flask, make_response\r\n\r\napp = Flask(__name__)\r\n\r\[email protected]('/test', methods=['GET', 'POST'])\r\ndef send_incomplete_response():\r\n response = make_response('fourteen chars')\r\n response.headers['Content-Length'] = '10000'\r\n return response\r\n\r\napp.run()\r\n```\r\n\r\nYou're now running a server on localhost that, when you make a request to http://localhost:5000/test, returns a response with a 14-byte-long body but with a Content-Length header claiming that the body contains 10000 bytes. Now observe how different tools handle making a request to that endpoint:\r\n\r\n```\r\nmark@fractal:~$ curl http://localhost:5000/test\r\ncurl: (18) transfer closed with 9986 bytes remaining to read\r\nfourteen charsmark@fractal:~$ \r\nmark@fractal:~$ python3.8\r\nPython 3.8.0 (default, Oct 28 2019, 16:14:01) \r\n[GCC 9.2.1 20191008] on linux\r\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\r\n>>> import http.client\r\n>>> conn = http.client.HTTPConnection('localhost', 5000)\r\n>>> conn.request('GET', '/test')\r\n>>> response = conn.getresponse()\r\n>>> response.read()\r\nTraceback (most recent call last):\r\n File \"<stdin>\", line 1, in <module>\r\n File \"/usr/lib/python3.8/http/client.py\", line 467, in read\r\n s = self._safe_read(self.length)\r\n File \"/usr/lib/python3.8/http/client.py\", line 610, in _safe_read\r\n raise IncompleteRead(data, amt-len(data))\r\nhttp.client.IncompleteRead: IncompleteRead(14 bytes read, 9986 more expected)\r\n>>> \r\n>>> import urllib3\r\n>>> pool_manager = urllib3.PoolManager()\r\n>>> response = pool_manager.request('GET', 'http://localhost:5000/test')\r\nTraceback (most recent call last):\r\n File \"/usr/local/lib/python3.8/dist-packages/urllib3/response.py\", line 425, in _error_catcher\r\n yield\r\n File \"/usr/local/lib/python3.8/dist-packages/urllib3/response.py\", line 503, in read\r\n data = self._fp.read() if not fp_closed else b\"\"\r\n File \"/usr/lib/python3.8/http/client.py\", line 467, in read\r\n s = self._safe_read(self.length)\r\n File \"/usr/lib/python3.8/http/client.py\", line 610, in _safe_read\r\n raise IncompleteRead(data, amt-len(data))\r\nhttp.client.IncompleteRead: IncompleteRead(14 bytes read, 9986 more expected)\r\n\r\nDuring handling of the above exception, another exception occurred:\r\n\r\nTraceback (most recent call last):\r\n File \"/usr/local/lib/python3.8/dist-packages/urllib3/connectionpool.py\", line 685, in urlopen\r\n response = self.ResponseCls.from_httplib(\r\n File \"/usr/local/lib/python3.8/dist-packages/urllib3/response.py\", line 589, in from_httplib\r\n resp = ResponseCls(\r\n File \"/usr/local/lib/python3.8/dist-packages/urllib3/response.py\", line 258, in __init__\r\n self._body = self.read(decode_content=decode_content)\r\n File \"/usr/local/lib/python3.8/dist-packages/urllib3/response.py\", line 529, in read\r\n raise IncompleteRead(self._fp_bytes_read, self.length_remaining)\r\n File \"/usr/lib/python3.8/contextlib.py\", line 131, in __exit__\r\n self.gen.throw(type, value, traceback)\r\n File \"/usr/local/lib/python3.8/dist-packages/urllib3/response.py\", line 443, in _error_catcher\r\n raise ProtocolError(\"Connection broken: %r\" % e, e)\r\nurllib3.exceptions.ProtocolError: ('Connection broken: IncompleteRead(14 bytes read, 9986 more expected)', IncompleteRead(14 bytes read, 9986 more expected))\r\n\r\nDuring handling of the above exception, another exception occurred:\r\n\r\nTraceback (most recent call last):\r\n File \"<stdin>\", line 1, in <module>\r\n File \"/usr/local/lib/python3.8/dist-packages/urllib3/request.py\", line 75, in request\r\n return self.request_encode_url(\r\n File \"/usr/local/lib/python3.8/dist-packages/urllib3/request.py\", line 97, in request_encode_url\r\n return self.urlopen(method, url, **extra_kw)\r\n File \"/usr/local/lib/python3.8/dist-packages/urllib3/poolmanager.py\", line 330, in urlopen\r\n response = conn.urlopen(method, u.request_uri, **kw)\r\n File \"/usr/local/lib/python3.8/dist-packages/urllib3/connectionpool.py\", line 747, in urlopen\r\n return self.urlopen(\r\n File \"/usr/local/lib/python3.8/dist-packages/urllib3/connectionpool.py\", line 747, in urlopen\r\n return self.urlopen(\r\n File \"/usr/local/lib/python3.8/dist-packages/urllib3/connectionpool.py\", line 747, in urlopen\r\n return self.urlopen(\r\n File \"/usr/local/lib/python3.8/dist-packages/urllib3/connectionpool.py\", line 719, in urlopen\r\n retries = retries.increment(\r\n File \"/usr/local/lib/python3.8/dist-packages/urllib3/util/retry.py\", line 436, in increment\r\n raise MaxRetryError(_pool, url, error or ResponseError(cause))\r\nurllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=5000): Max retries exceeded with url: /test (Caused by ProtocolError('Connection broken: IncompleteRead(14 bytes read, 9986 more expected)', IncompleteRead(14 bytes read, 9986 more expected)))\r\n>>> \r\n>>> import requests\r\n>>> response = requests.get('http://localhost:5000/test')\r\n>>> response.text\r\n'fourteen chars'\r\n```\r\n\r\nUsed in the most straightforward possible way:\r\n\r\n* Curl outputs the response, but warns us about the content length not matching what was claimed in the header\r\n* `http.client` raises an `IncompleteRead`\r\n* `urllib3` raises a `MaxRetryError` caused by an `IncompleteRead`\r\n* `requests` happily gives us the incomplete response with no indication that anything went wrong.\r\n\r\nWhoops. So, why did this happen? Requests is built on top of `urllib3` which is built on top of `http.client`, and Requests isn't explicitly catching and discarding an `IncompleteRead` error anywhere, so how can it fail to catch an error that the others emit?\r\n\r\nThe answer is that there are possible ways to use both `http.client` and `urllib3` that prevent this error from being raised, and Requests is using them. Starting from the bottom...\r\n\r\n### How `http` is broken:\r\n\r\nWhile `http` raises an `IncompleteRead` if you call `.read()` with no argument on an incomplete `http.client.HTTPResponse` object, it *doesn't* do so if you pass an argument to `.read()`. This is true whether you're reading a bit at a time or everything at once:\r\n\r\n```\r\n>>> import http.client\r\n>>> \r\n>>> conn = http.client.HTTPConnection('localhost', 5000)\r\n>>> conn.request('GET', '/test')\r\n>>> response = conn.getresponse()\r\n>>> response.read(1000)\r\nb'fourteen chars'\r\n>>> \r\n>>> conn = http.client.HTTPConnection('localhost', 5000)\r\n>>> conn.request('GET', '/test')\r\n>>> response = conn.getresponse()\r\n>>> while True:\r\n... next_byte = response.read(1)\r\n... if next_byte == b'':\r\n... break\r\n... print(next_byte)\r\n... \r\nb'f'\r\nb'o'\r\nb'u'\r\nb'r'\r\nb't'\r\nb'e'\r\nb'e'\r\nb'n'\r\nb' '\r\nb'c'\r\nb'h'\r\nb'a'\r\nb'r'\r\nb's'\r\n```\r\n\r\nThis was a deliberate decision; the handling of reads like this was apparently even more broken before (per https://bugs.python.org/issue15633, back in 2013 they not only wouldn't raise but also wouldn't mark the connection as closed), and @pitrou *partially* fixed it in\r\nhttps://github.com/python/cpython/commit/beec61ae4e811f55f58d0197c8af994e252ab9ae#diff-b1e875fb060aa473c57a8e87bf903a76R514-R517 but refrained from raising over it to avoid breaking backwards compatibility - presumably with programs that were relying on the old behaviour to be able to request stuff from servers that spit out erroneous `Content-Length` headers.\r\n\r\n### How `urllib3` is broken\r\n\r\n`urllib3` used to always fail to raise an `IncompleteRead` error in this situation, because it calls the aforementioned `http.client.HTTPResponse.read(...)` method with an argument rather than reading everything at once.\r\n\r\nThis was understood and then *sort of* fixed by @nateprewitt in https://github.com/urllib3/urllib3/pull/949, by having `urllib3` independently check, in the `.read()` method of the `urllib3.response.HTTPResponse` class, whether the number of bytes read matches the `Content-Length` header, and explicitly raise a `urllib3.exceptions.IncompleteRead` otherwise.\r\n\r\n*(Edit note: next paragraph and everything after it rewritten. I got some stuff quite wrong here at first.)*\r\n\r\nBut that check isn't enabled by default; in `urllib3`, `enforce_content_length` defaults to `False`. So, unless you explicitly ask for it, the check is never applied. However, you get *some* protection from the fact that, by default, a `HTTPResponse` ins constructed with `preload_content=True`, which causes it to call `self.read()` without an argument, which in turn calls `http.client.HTTPResponse.read()` without an argument, which is the scenario in which `http.client.HTTPResponse.read()` enforces `Content-Length` properly.\r\n\r\nHowever, things go wrong when we use the `.stream()` method. If we construct a response object with `preload_content=False`, we can call `.stream()` on it, which defers to `.read()`, but calls it with a length argument. This length argument gets passed through to `http.client.HTTPResponse.read()`, thus invoking the scenario where `http.client` does *not* enforce `Content-Length`. Thus, for a user who isn't using `enforce_content_length`, using `.stream()` instead of `.read()` effectively disables `Content-Length` enforcement: \r\n\r\n```\r\n>>> import urllib3\r\n>>> pool_manager = urllib3.PoolManager()\r\n>>> response = pool_manager.request(\r\n... 'GET',\r\n... 'http://localhost:5000/test',\r\n... preload_content=False\r\n... )\r\n>>> list(response.stream())\r\n[b'fourteen chars']\r\n```\r\n\r\n### How Requests is broken\r\n\r\nUnfortunately, `requests.models.Response.iter_content()`, which is invoked under the hood by e.g. the `.text` property, uses `preload_content=True`, does *not* pass `enforce_content_length=True`, and calls `self.raw.stream()`, which is precisely the awful combination of details needed to bypass both the incomplete read check in `http.client` *and* the incomplete read check in `urllib3`. This means that Requests fails to perform this check even in completely ordinary usage scenarios.\r\n\r\n## The fix\r\n\r\nI think `urllib3` should just make `enforce_content_length=True` by default. I can't really see a good reason for it to default to False, besides the (rather weak, IMO) point about backwards-compatibility that motivated not checking for this in `http.client`. There's no sane reason why `Content-Length` checking should be enabled when calling `.read()` but disabled when calling `.read(999999)`, which is the status quo, and if anybody really does need that behaviour for some strange reason they can always change their code to explicitly pass `enforce_content_length=False`. @nateprewitt, as the author of the PR that added `enforce_content_length` to urllib3, what do you think?\r\n\r\nIf `urllib3` makes that change, then Requests can simply bump their minimum required `urllib3` version to whatever release includes the change, and be done.\r\n\r\nFailing that, Requests should pass `enforce_content_length=True` explicitly.\r\n\r\n(Edit note: I've rewritten this significantly to fix mistakes, and deleted some comments I left subsequently after integrating their content into here. I also realised after writing that @debugmiller had already pointed out that `enforce_content_length` was the thing that matters here; I started writing this up before finding this issue, and didn't scrutinise it properly before posting. Still, maybe this overview is still helpful. To anyone I spammed with emails from my multiple comments: sorry that I didn't get my ducks in a row before posting!)",
"It looks like the audit trail was followed for the most part here. We did merge this into Requests in #3563, but it's in a separate branch that was intended for 3.0. Adding the flag is a breaking change for the 2.x branch, so we're unable to resolve this until the next major version.",
"Just providing an update, I've opened urllib3/urllib3#2514 to change the default here in urllib3 2.0.",
"It's great the next versions of both urllib3 and requests have the fixes. But those branches seem to have a very unpredictable timeplan before they can be released. _\"[Before PyCon 2020](https://3.python-requests.org/)\" ?_ \r\n\r\nAny suggestion how to work around this effectively for us mortals still on the released versions? \r\n\r\nRight now we are looking at wrapping every file downloaded with requests, using our own content length and checksum checking to be safe. Which is a good idea anyway, but not always possible since you don't always have this side-channel data.\r\n\r\nConsidering the severity of this bug (silent corrupted files), is there any chance of getting this into the 2.x branch?\r\nWhat's worse is that this bug also affects many middle-layer libraries today, which would all need similar increase in major version of requests, meaning rollout would take even longer or possibly never. Until then, any library using requests under the hood when downloading big files without being aware of this limitation (likely many), could return corrupted downloads to the main application without notice. ",
"I ran into this problem today and found no fix in requests 2.x and no 3.x release to upgrade to. \r\n\r\nI found this blog article that offers a solution in 2.x\r\nhttps://blog.petrzemek.net/2018/04/22/on-incomplete-http-reads-and-the-requests-library-in-python/\r\n\r\nI'm still torn between treating json parsing errors the same as transport errors, putting in the above blogs quick fix in a custom session, or trying out httpx instead.",
"I guess the release of urllib3 2.0 fixes this, via https://github.com/urllib3/urllib3/pull/2514?\r\n\r\n(I'm slightly reluctant to mention this, because if you're happy to let it be fixed in a minor release via urllib3... then it seems to me that you might just as well have fixed it directly in requests long ago. So I'm worried you're now going to feel the need to break it again, for compatibility. Please don't!)",
"@dimbleby, yes, it is fixed in urllib3 2. We're aware of the change as we made it :) Users are free to upgrade to 2.0 as we made no mandated changes in Requests which is why this is acceptable within a minor version. Requests is still compatible with 1.26.x, as well as 2.x which includes this change.\r\n\r\nI'll close this out now since there's a path forward for users with this issue."
] |
https://api.github.com/repos/psf/requests/issues/4955
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4955/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4955/comments
|
https://api.github.com/repos/psf/requests/issues/4955/events
|
https://github.com/psf/requests/issues/4955
| 404,813,179 |
MDU6SXNzdWU0MDQ4MTMxNzk=
| 4,955 |
requests.post taking integer as string
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/16844254?v=4",
"events_url": "https://api.github.com/users/amruizva/events{/privacy}",
"followers_url": "https://api.github.com/users/amruizva/followers",
"following_url": "https://api.github.com/users/amruizva/following{/other_user}",
"gists_url": "https://api.github.com/users/amruizva/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/amruizva",
"id": 16844254,
"login": "amruizva",
"node_id": "MDQ6VXNlcjE2ODQ0MjU0",
"organizations_url": "https://api.github.com/users/amruizva/orgs",
"received_events_url": "https://api.github.com/users/amruizva/received_events",
"repos_url": "https://api.github.com/users/amruizva/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/amruizva/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/amruizva/subscriptions",
"type": "User",
"url": "https://api.github.com/users/amruizva",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 1 |
2019-01-30T15:04:24Z
|
2021-09-06T00:06:31Z
|
2019-01-30T16:05:51Z
|
NONE
|
resolved
|
There is something I am not able to understand using the **requests.post** method,
Having this set of parameters, the requests.post works perfect.
params = {
"profiles": 123456789,
"date_start": 2019-01-01,
"date_end": 2019-01-10,
"fields": [
"attachments",
"author_id",
"comments",
"created_time",
"id",
"interactions",
"likes",
"message",
"post_labels",
"type",
"insights_engagement",
"insights_impressions",
"insights_reach",
"insights_saved",
"insights_video_views",
"url"
],
}
However, when I add a key as an **integer**, I am getting a response that is taken as a **string**
Here is the example adding the new key:
params = {
"profiles": 123456789,
"date_start": 2019-01-01,
"date_end": 2019-01-10,
"fields": [
"attachments",
"author_id",
"comments",
"created_time",
"id",
"interactions",
"likes",
"message",
"post_labels",
"type",
"insights_engagement",
"insights_impressions",
"insights_reach",
"insights_saved",
"insights_video_views",
"url"
],
"limit": 500
}
|
{
"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/4955/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4955/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/4954
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4954/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4954/comments
|
https://api.github.com/repos/psf/requests/issues/4954/events
|
https://github.com/psf/requests/pull/4954
| 404,678,570 |
MDExOlB1bGxSZXF1ZXN0MjQ4ODAzMzMy
| 4,954 |
[fix] Remove extra blank line
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/26180963?v=4",
"events_url": "https://api.github.com/users/zengjuchen/events{/privacy}",
"followers_url": "https://api.github.com/users/zengjuchen/followers",
"following_url": "https://api.github.com/users/zengjuchen/following{/other_user}",
"gists_url": "https://api.github.com/users/zengjuchen/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/zengjuchen",
"id": 26180963,
"login": "zengjuchen",
"node_id": "MDQ6VXNlcjI2MTgwOTYz",
"organizations_url": "https://api.github.com/users/zengjuchen/orgs",
"received_events_url": "https://api.github.com/users/zengjuchen/received_events",
"repos_url": "https://api.github.com/users/zengjuchen/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/zengjuchen/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/zengjuchen/subscriptions",
"type": "User",
"url": "https://api.github.com/users/zengjuchen",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 3 |
2019-01-30T09:32:01Z
|
2021-08-31T00:07:27Z
|
2019-01-30T12:13:37Z
|
NONE
|
resolved
|
1. The removed blank line was added at commit 8a2014e26 by Kenneth Reitz at
2017-05-26 22:51:40.
The blank line under it was created at 2012, there is a 5 year gap
between them.
2. It has conflict with the style used on line 63.
So I assume it was misadded and 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/4954/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4954/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/4954.diff",
"html_url": "https://github.com/psf/requests/pull/4954",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/4954.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/4954"
}
| true |
[
"# [Codecov](https://codecov.io/gh/requests/requests/pull/4954?src=pr&el=h1) Report\n> Merging [#4954](https://codecov.io/gh/requests/requests/pull/4954?src=pr&el=desc) into [master](https://codecov.io/gh/requests/requests/commit/64bde6582d9b49e9345d9b8df16aaa26dc372d13?src=pr&el=desc) will **not change** coverage.\n> The diff coverage is `n/a`.\n\n[](https://codecov.io/gh/requests/requests/pull/4954?src=pr&el=tree)\n\n```diff\n@@ Coverage Diff @@\n## master #4954 +/- ##\n=======================================\n Coverage 66.89% 66.89% \n=======================================\n Files 15 15 \n Lines 1577 1577 \n=======================================\n Hits 1055 1055 \n Misses 522 522\n```\n\n\n\n------\n\n[Continue to review full report at Codecov](https://codecov.io/gh/requests/requests/pull/4954?src=pr&el=continue).\n> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)\n> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`\n> Powered by [Codecov](https://codecov.io/gh/requests/requests/pull/4954?src=pr&el=footer). Last update [64bde65...94936d0](https://codecov.io/gh/requests/requests/pull/4954?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).\n",
"Hi there,\r\n\r\nThanks for sending a PR to requests. Unfortunately, we have no style guide that shows one thing to be right or the other to be wrong. As such, PRs that adjust style in one way or another are not accepted.",
"> Hi there,\r\n> \r\n> Thanks for sending a PR to requests. Unfortunately, we have no style guide that shows one thing to be right or the other to be wrong. As such, PRs that adjust style in one way or another are not accepted.\r\n\r\nI understand your principles, but style is very important element in Python. And `Requests` package is famous of its beautiful coding. If you review the `compat.py` file now, you can see the style conflict (blank line in import area) between its `is_py2` and `is_py3` import part(in line 47, there are 2 blank lines, and in line 64, same logic, only 1 blank line). I found it was caused by the action of \r\n commit `7fd9267b3bab1d` didn't fully revert the change induced in `8a2014e265d6c`.\r\n\r\nEven though this PR can't be accepted as an official PR. I think this issue should be solved in other functional PRs.\r\n\r\nWith all my respects."
] |
https://api.github.com/repos/psf/requests/issues/4953
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4953/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4953/comments
|
https://api.github.com/repos/psf/requests/issues/4953/events
|
https://github.com/psf/requests/issues/4953
| 404,438,032 |
MDU6SXNzdWU0MDQ0MzgwMzI=
| 4,953 |
Unable to call API on a system using unsigned SSL cert
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/22796280?v=4",
"events_url": "https://api.github.com/users/espressobeanies/events{/privacy}",
"followers_url": "https://api.github.com/users/espressobeanies/followers",
"following_url": "https://api.github.com/users/espressobeanies/following{/other_user}",
"gists_url": "https://api.github.com/users/espressobeanies/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/espressobeanies",
"id": 22796280,
"login": "espressobeanies",
"node_id": "MDQ6VXNlcjIyNzk2Mjgw",
"organizations_url": "https://api.github.com/users/espressobeanies/orgs",
"received_events_url": "https://api.github.com/users/espressobeanies/received_events",
"repos_url": "https://api.github.com/users/espressobeanies/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/espressobeanies/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/espressobeanies/subscriptions",
"type": "User",
"url": "https://api.github.com/users/espressobeanies",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 2 |
2019-01-29T18:57:05Z
|
2021-09-06T00:06:32Z
|
2019-01-29T21:38:06Z
|
NONE
|
resolved
|
I'm not able to call an API on a system using an unsigned SSL certificate
## Expected Result
JSON output data
## Actual Result
`requests.exceptions.SSLError: HTTPSConnectionPool(host='apitest.internal', port=443): Max retries exceeded with url: /login/oauth2/token (Caused by SSLError(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:847)')`,))
## Reproduction Steps
```python
from oauthlib.oauth2 import BackendApplicationClient
from requests.auth import HTTPBasicAuth
from requests_oauthlib import OAuth2Session
import requests, json
def client_credentials(client_id, client_secret, token_uri):
auth = HTTPBasicAuth(client_id, client_secret)
client = BackendApplicationClient(client_id=client_id)
oauth = OAuth2Session(client=client)
token = oauth.fetch_token(token_url=token_uri, auth=auth)
return token
storecreds=client_credentials(client_id, client_secret, token_uri)
print(storecreds)
```
## System Information
$ python3 -m requests.help
```
{
"chardet": {
"version": "3.0.4"
},
"cryptography": {
"version": ""
},
"idna": {
"version": "2.6"
},
"implementation": {
"name": "CPython",
"version": "3.6.7"
},
"platform": {
"release": "4.15.0-43-generic",
"system": "Linux"
},
"pyOpenSSL": {
"openssl_version": "",
"version": null
},
"requests": {
"version": "2.20.0"
},
"system_ssl": {
"version": "1010007f"
},
"urllib3": {
"version": "1.23"
},
"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/4953/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4953/timeline
| null |
completed
| null | null | false |
[
"Same issue if I install pyOpenSSL and upgrade PIP to 18.0\r\n\r\n`{\r\n \"chardet\": {\r\n \"version\": \"3.0.4\"\r\n },\r\n \"cryptography\": {\r\n \"version\": \"2.5\"\r\n },\r\n \"idna\": {\r\n \"version\": \"2.6\"\r\n },\r\n \"implementation\": {\r\n \"name\": \"CPython\",\r\n \"version\": \"3.6.7\"\r\n },\r\n \"platform\": {\r\n \"release\": \"4.15.0-43-generic\",\r\n \"system\": \"Linux\"\r\n },\r\n \"pyOpenSSL\": {\r\n \"openssl_version\": \"1010101f\",\r\n \"version\": \"19.0.0\"\r\n },\r\n \"requests\": {\r\n \"version\": \"2.20.0\"\r\n },\r\n \"system_ssl\": {\r\n \"version\": \"1010007f\"\r\n },\r\n \"urllib3\": {\r\n \"version\": \"1.23\"\r\n },\r\n \"using_pyopenssl\": true\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/4952
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4952/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4952/comments
|
https://api.github.com/repos/psf/requests/issues/4952/events
|
https://github.com/psf/requests/issues/4952
| 404,296,059 |
MDU6SXNzdWU0MDQyOTYwNTk=
| 4,952 |
About the difference of requests.get and requests.session().get
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/32119584?v=4",
"events_url": "https://api.github.com/users/zhongxinghong/events{/privacy}",
"followers_url": "https://api.github.com/users/zhongxinghong/followers",
"following_url": "https://api.github.com/users/zhongxinghong/following{/other_user}",
"gists_url": "https://api.github.com/users/zhongxinghong/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/zhongxinghong",
"id": 32119584,
"login": "zhongxinghong",
"node_id": "MDQ6VXNlcjMyMTE5NTg0",
"organizations_url": "https://api.github.com/users/zhongxinghong/orgs",
"received_events_url": "https://api.github.com/users/zhongxinghong/received_events",
"repos_url": "https://api.github.com/users/zhongxinghong/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/zhongxinghong/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/zhongxinghong/subscriptions",
"type": "User",
"url": "https://api.github.com/users/zhongxinghong",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 1 |
2019-01-29T13:40:36Z
|
2021-09-06T00:06:32Z
|
2019-01-29T13:43:26Z
|
NONE
|
resolved
|
Hai ! In your `api.py` file, the function `get` declare the para `params`, and assign a default value to it, then we can use the `get` func like `requests.get(url, {"k1":"v1", "k2":"v2"})` without pointing out the key `params` of the second para. But in your `sessions.py` file, the method `get` of the class `Session` didn't declare the para `params`, so we must use the `Session.get` method like `s.get(url, params={"k1":"v1", "k2":"v2"})`, or it will raise a TypeError `TypeError: get() takes 2 positional arguments but 3 were given`. I checked all request methods defined under the class `Session` and all requests API in the `api.py` file, and found that only the `get` method has this little difference. It used to bother me. Could you please eliminate this little difference? :) Good Luck !
|
{
"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/4952/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4952/timeline
| null |
completed
| null | null | false |
[
"I don't think this warrants an update. Keyword parameters are better and as soon as we can get on Python 3 only I think we should switch everything except URL to be a keyword-only parameter. This just nudges people in the right direction sooner. We could, however, make `params` be a keyword argument in the functional API but that'd be backwards incompatible so we won't do that either."
] |
https://api.github.com/repos/psf/requests/issues/4951
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4951/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4951/comments
|
https://api.github.com/repos/psf/requests/issues/4951/events
|
https://github.com/psf/requests/issues/4951
| 404,226,225 |
MDU6SXNzdWU0MDQyMjYyMjU=
| 4,951 |
Allow redirects not configurable in sessions
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/6770124?v=4",
"events_url": "https://api.github.com/users/Paradoxis/events{/privacy}",
"followers_url": "https://api.github.com/users/Paradoxis/followers",
"following_url": "https://api.github.com/users/Paradoxis/following{/other_user}",
"gists_url": "https://api.github.com/users/Paradoxis/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Paradoxis",
"id": 6770124,
"login": "Paradoxis",
"node_id": "MDQ6VXNlcjY3NzAxMjQ=",
"organizations_url": "https://api.github.com/users/Paradoxis/orgs",
"received_events_url": "https://api.github.com/users/Paradoxis/received_events",
"repos_url": "https://api.github.com/users/Paradoxis/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Paradoxis/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Paradoxis/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Paradoxis",
"user_view_type": "public"
}
|
[] |
open
| false | null |
[] | null | 0 |
2019-01-29T10:39:05Z
|
2019-01-29T10:39:05Z
| null |
NONE
| null |
I have an application I need to reach behind a firewall, I've set up a tunnel to this application via SSH running on my machine which forwards all connections from `127.0.0.1:1234` to `192.168.1.10:80`. Whenever I make a request to my application, it redirects me to a login page first.
The issue with this is that all redirect URL's have the `192.168.1.10` hostname, which requests tries to follow and inevitably crashes (as this host does not exist on *my* network).
I tried to set `allow_redirects` to `False` on my session by overriding the `request` method, but the session source hard-codes the `allow_redirects` option to `True` if it isn't explicitly set when calling `get`, `head` and `options` ([source](https://github.com/requests/requests/blob/master/requests/sessions.py#L545))
## Expected Result
I expected no redirect to be followed, but rather that that the request ends after the first response. I expected the `allow_redirects` option to be configurable in sessions like the `verify` flag is ([source](https://github.com/requests/requests/blob/master/requests/sessions.py#L625))
## Actual Result
The 302 was resolved, and attempted to redirect me to a nonexistent host, leading to a connection error exception.
## Reproduction Steps
```python
import requests
class Example(requests.Session):
def __init__(self, allow_redirects=False, *args, **kwargs):
super(Example, self).__init__(*args, **kwargs)
self.allow_redirects = allow_redirects
def request(self, *args, **kwargs):
kwargs.setdefault('allow_redirects', self.allow_redirects)
return super(Example, self).request(*args, **kwargs)
sess = Example()
sess.get('http://127.0.0.1:1234') # ConnectionError ... 192.168.1.10 connection refused (redirected)
```
## System Information
$ python -m requests.help
```
{
"chardet": {
"version": "3.0.4"
},
"cryptography": {
"version": ""
},
"idna": {
"version": "2.8"
},
"implementation": {
"name": "CPython",
"version": "3.6.0"
},
"platform": {
"release": "10",
"system": "Windows"
},
"pyOpenSSL": {
"openssl_version": "",
"version": null
},
"requests": {
"version": "2.21.0"
},
"system_ssl": {
"version": "100020af"
},
"urllib3": {
"version": "1.24.1"
},
"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/4951/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4951/timeline
| null | null | null | null | false |
[] |
https://api.github.com/repos/psf/requests/issues/4950
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4950/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4950/comments
|
https://api.github.com/repos/psf/requests/issues/4950/events
|
https://github.com/psf/requests/issues/4950
| 404,149,337 |
MDU6SXNzdWU0MDQxNDkzMzc=
| 4,950 |
post multipart form data with additional parameters inContent-Disposition
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/5386998?v=4",
"events_url": "https://api.github.com/users/LeiYangGH/events{/privacy}",
"followers_url": "https://api.github.com/users/LeiYangGH/followers",
"following_url": "https://api.github.com/users/LeiYangGH/following{/other_user}",
"gists_url": "https://api.github.com/users/LeiYangGH/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/LeiYangGH",
"id": 5386998,
"login": "LeiYangGH",
"node_id": "MDQ6VXNlcjUzODY5OTg=",
"organizations_url": "https://api.github.com/users/LeiYangGH/orgs",
"received_events_url": "https://api.github.com/users/LeiYangGH/received_events",
"repos_url": "https://api.github.com/users/LeiYangGH/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/LeiYangGH/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/LeiYangGH/subscriptions",
"type": "User",
"url": "https://api.github.com/users/LeiYangGH",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 1 |
2019-01-29T07:02:06Z
|
2021-09-06T00:06:32Z
|
2019-01-29T12:57:52Z
|
NONE
|
resolved
|
This question is a bit special but I cannot find the solution anywhere.
I've posted the same question in stackoverflow but there's no answer yet.https://stackoverflow.com/questions/54209711/python-requests-post-multipart-form-data-with-additional-parameters-in-content-d
I have curl data like this(it's working)
--message_boundary_0001--
Content-Disposition: form-data; name="RequestData"
Content-Type: application/json; charset=utf-8
{
"appKey": "525348e77144a9cee9a7471a8b67c50ea85b9e3eb377a3c1a3a23db88f9150eefe76e6a339fdbc62b817595f53d72549d9ebe36438f8c2619846b963e9f43a93",
"appId": "SAMPLE_DEBUG_NMAID_TO_BE_REPLACED",
"outCodec": "OPUS_16K",
"cmdName": "NVC_TTS_CMD",
"cmdDict": {
"tts_language":"eng-USA",
"tts_voice":"ava-ml",
"tts_log_level": "FULL",
"supportedTtsFeature":{
"tts_multi_logic_stream_flag": "true",
"tts_early_emission_flag": "true"
}
}
}
--message_boundary_0001--
Content-Disposition: form-data; name="TtsParameter"; **paramName**="TEXT_TO_READ"
Content-Type: application/json; charset=utf-8
{
"tts_type": "native_text",
"tts_input":"The result will be millions of Americans who have insurance who did not have it before. Thats the goal. And the goal is not about the website. The goal is that the American people who have been shut out of affordable health care options in the past have those options available to them."
}
--message_boundary_0001--
but I don't know how to convert it to requests code.
## Expected Result
python3 requests library should be able to post above data. the main difficulty is there's special Content-Disposition.
Content-Disposition: form-data; name="RequestData"
Content-Disposition: form-data; name="TtsParameter"; **paramName**="TEXT_TO_READ"
please note the second one is called 'paramName', instead of 'filename', which can be solved by another solved issue: _Can't set headers per part of multipart requests_
https://github.com/requests/requests/issues/1495
## What you expected.
Some python code sample to convert my curl data.
## Actual Result
my code not work. always got 403, or connection timeout error.
## Reproduction Steps
Since I'm in private network you cannot debug directly.
`import requests
from requests_toolbelt import MultipartEncoder
RequestData = '''{
"appKey": "525348e77144a9cee9a7471a8b67c50ea85b9e3eb377a3c1a3a23db88f9150eefe76e6a339fdbc62b817595f53d72549d9ebe36438f8c2619846b963e9f43a93",
"appId": "SAMPLE_DEBUG_NMAID_TO_BE_REPLACED",
"outCodec": "OPUS_16K",
"cmdName": "NVC_TTS_CMD",
"cmdDict": {
"tts_language":"eng-USA",
"tts_voice":"ava-ml",
"supportedTtsFeature":{
"tts_multi_logic_stream_flag": "true",
"tts_early_emission_flag": "true"
}
}
}'''
TtsParameter_TEXT_TO_READ = '''{
"tts_type": "native_text",
"tts_input":"9 The result will be millions of Americans who have insurance who did not have it before.
"
}'''
multipart_data = MultipartEncoder(
fields={
'RequestData': (None, RequestData, 'application/json; charset=utf-8'),
'TtsParameter': ('TEXT_TO_READ', TtsParameter_TEXT_TO_READ, 'application/json; charset=utf-8')
}
)
#url = 'https://httpbin.org/post'
url = 'http://10.3.65.142:21857/NmspServlet/'
headers = {
'Accept': 'audio/ogg;codecs=opus;',
'Connection': 'keep-alive'
}
resp = requests.post(url,
data=multipart_data,
headers=headers,
timeout=6)
print(resp.status_code)
print(resp.content.decode('utf-8'))
#requests.exceptions.ReadTimeout`
## System Information
Windows 10, python3.6
|
{
"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/4950/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4950/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.\r\n\r\nYou already have a question on StackOverflow so please be patient. Cross-posting here is not productive."
] |
https://api.github.com/repos/psf/requests/issues/4949
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4949/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4949/comments
|
https://api.github.com/repos/psf/requests/issues/4949/events
|
https://github.com/psf/requests/issues/4949
| 402,644,148 |
MDU6SXNzdWU0MDI2NDQxNDg=
| 4,949 |
chardet/urllib3 warnings
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/27003?v=4",
"events_url": "https://api.github.com/users/till/events{/privacy}",
"followers_url": "https://api.github.com/users/till/followers",
"following_url": "https://api.github.com/users/till/following{/other_user}",
"gists_url": "https://api.github.com/users/till/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/till",
"id": 27003,
"login": "till",
"node_id": "MDQ6VXNlcjI3MDAz",
"organizations_url": "https://api.github.com/users/till/orgs",
"received_events_url": "https://api.github.com/users/till/received_events",
"repos_url": "https://api.github.com/users/till/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/till/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/till/subscriptions",
"type": "User",
"url": "https://api.github.com/users/till",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 3 |
2019-01-24T10:39:02Z
|
2021-09-05T00:06:53Z
|
2019-01-24T12:50:23Z
|
NONE
|
resolved
|
While debugging a bug in Ansible, I noticed these warnings:
```
RequestsDependencyWarning: urllib3 (1.24.1) or chardet (2.2.1) doesn't match a supported version!
RequestsDependencyWarning)
```
I spent some time trying to get rid off them, but to no avail. What are the exact/supported dependencies?
Here is a list of installed packages:
```
# pip list
backports.ssl-match-hostname (3.5.0.1)
cached-property (1.5.1)
certifi (2018.11.29)
chardet (3.0.4)
configobj (4.7.2)
decorator (3.4.0)
docker (3.7.0)
docker-compose (1.23.2)
docker-pycreds (0.4.0)
dockerpty (0.4.1)
docopt (0.6.2)
enum34 (1.1.6)
functools32 (3.2.3.post2)
idna (2.7)
iniparse (0.4)
ipaddress (1.0.16)
IPy (0.75)
jsonschema (2.6.0)
kitchen (1.1.1)
perf (0.1)
pip (8.1.2)
policycoreutils-default-encoding (0.1)
pycurl (7.19.0)
pygobject (3.22.0)
pygpgme (0.3)
pyliblzma (0.5.3)
python-linux-procfs (0.4.9)
pyudev (0.15)
pyxattr (0.5.1)
PyYAML (3.13)
requests (2.21.0)
schedutils (0.4)
seobject (0.1)
sepolicy (1.1)
setuptools (0.9.8)
six (1.12.0)
slip (0.4.0)
slip.dbus (0.4.0)
texttable (0.9.1)
urlgrabber (3.10)
urllib3 (1.24.1)
websocket-client (0.54.0)
yum-metadata-parser (1.1.4)
```
## Expected Result
No warning.
## Actual Result
Warning.
## System Information
$ python -m requests.help
```
# python -m requests.help
/usr/lib/python2.7/site-packages/requests/__init__.py:91: RequestsDependencyWarning: urllib3 (1.24.1) or chardet (2.2.1) doesn't match a supported version!
RequestsDependencyWarning)
{
"chardet": {
"version": "2.2.1"
},
"cryptography": {
"version": ""
},
"idna": {
"version": "2.7"
},
"implementation": {
"name": "CPython",
"version": "2.7.5"
},
"platform": {
"release": "3.10.0-957.el7.x86_64",
"system": "Linux"
},
"pyOpenSSL": {
"openssl_version": "",
"version": null
},
"requests": {
"version": "2.21.0"
},
"system_ssl": {
"version": "100020bf"
},
"urllib3": {
"version": "1.24.1"
},
"using_pyopenssl": false
}
```
OS:
```
# cat /etc/redhat-release
CentOS Linux release 7.6.1810 (Core)
```
|
{
"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/4949/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4949/timeline
| null |
completed
| null | null | false |
[
"Should have read the source:\r\nhttps://github.com/requests/requests/blob/master/requests/__init__.py#L57-L71\r\n\r\n - urllib3: < 1.23\r\n - charded: < 3.0.0\r\n\r\nAny reason why this is not enforced via `requirements.txt`? (I am new to Python, so excuse my ignorance.) ",
"It is enforced via Python packaging methods but downstream redistributors do whatever they want. :man_shrugging: ",
"As an update to Till's list for future googlers, here's the current version spec:\r\n\r\n urllib3 >= 1.21.1, <= 1.24\r\n chardet >= 3.0.2, < 3.1.0\r\n\r\nNotably, `chardet` is in the early 3.x range. You can copy/paste that into your requirements.txt, no changes needed.\r\n\r\nFollow the source to see what has changed since I posted this: https://github.com/requests/requests/blob/master/requests/__init__.py#L57-L71\r\n"
] |
https://api.github.com/repos/psf/requests/issues/4948
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4948/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4948/comments
|
https://api.github.com/repos/psf/requests/issues/4948/events
|
https://github.com/psf/requests/issues/4948
| 401,707,086 |
MDU6SXNzdWU0MDE3MDcwODY=
| 4,948 |
gevent 1.4.0 and urllib3 1.22 does not work with requests 2.20.1
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/46923905?v=4",
"events_url": "https://api.github.com/users/a82singh/events{/privacy}",
"followers_url": "https://api.github.com/users/a82singh/followers",
"following_url": "https://api.github.com/users/a82singh/following{/other_user}",
"gists_url": "https://api.github.com/users/a82singh/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/a82singh",
"id": 46923905,
"login": "a82singh",
"node_id": "MDQ6VXNlcjQ2OTIzOTA1",
"organizations_url": "https://api.github.com/users/a82singh/orgs",
"received_events_url": "https://api.github.com/users/a82singh/received_events",
"repos_url": "https://api.github.com/users/a82singh/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/a82singh/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/a82singh/subscriptions",
"type": "User",
"url": "https://api.github.com/users/a82singh",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 3 |
2019-01-22T10:53:55Z
|
2021-09-06T00:06:33Z
|
2019-01-22T18:52:12Z
|
NONE
|
resolved
|
## Expected Result
My python module is executed successfully with the following:
gevent 1.4.0, urllib3 1.22 work with requests 2.10.0 with no error
## Actual Result
but with
gevent 1.4.0, urllib3 1.22 with requests 2.20.1 gives
File "/home/abc/xyz/lib/python2.7/site-packages/urllib3/util/wait.py", line 33, in wait_for_read
return _wait_for_io_events(socks, EVENT_READ, timeout)
File "/home/abc/xyz/lib/python2.7/site-packages/urllib3/util/wait.py", line 22, in _wait_for_io_events
with DefaultSelector() as selector:
File "/home/abc/xyz/lib/python2.7/site-packages/urllib3/util/selectors.py", line 581, in DefaultSelector
return _DEFAULT_SELECTOR()
File "/home/abc/xyz/lib/python2.7/site-packages/urllib3/util/selectors.py", line 394, in __init__
self._epoll = select.epoll()
AttributeError: 'module' object has no attribute 'epoll'
There is absolutely no changes in our code and gevent.monkey.patch_all() is the first statement before any imports.
## System Information
$ python -m requests.help
{
"chardet": {
"version": "3.0.4"
},
"cryptography": {
"version": ""
},
"idna": {
"version": "2.6"
},
"implementation": {
"name": "CPython",
"version": "2.7.15"
},
"platform": {
"release": "3.10.0-693.2.2.el7.x86_64",
"system": "Linux"
},
"pyOpenSSL": {
"openssl_version": "",
"version": null
},
"requests": {
"version": "2.21.0"
},
"system_ssl": {
"version": "1000105f"
},
"urllib3": {
"version": "1.22"
},
"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/4948/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4948/timeline
| null |
completed
| null | null | false |
[
"You should try upgrading to a newer version of urllib3. When we first added selectors we had many people coming to us with monkey-patching problems. Essentially due to incorrect import ordering urllib3 used to detect that `select.epoll` was available but then gevent patches it out and then when we go to use `select.epoll` it's no longer there and we get this error. This is fixed in newer versions of urllib3 (even though it's not *really* our fault).",
"2.20.1 isn't supported any longer",
"Works with the following:\r\n\r\n\"requests\": {\r\n \"version\": \"2.21.0\"\r\n }, \r\n \"urllib3\": {\r\n \"version\": \"1.24.1\"\r\n },\r\n \"gevent\": {\r\n \"version\": \"1.4.0\"\r\n } \r\n\r\nThanks !"
] |
https://api.github.com/repos/psf/requests/issues/4947
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4947/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4947/comments
|
https://api.github.com/repos/psf/requests/issues/4947/events
|
https://github.com/psf/requests/pull/4947
| 401,427,141 |
MDExOlB1bGxSZXF1ZXN0MjQ2MzUwMTI2
| 4,947 |
Docstring explaining when HTTPError is/is not raised
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/322909?v=4",
"events_url": "https://api.github.com/users/jerojasro/events{/privacy}",
"followers_url": "https://api.github.com/users/jerojasro/followers",
"following_url": "https://api.github.com/users/jerojasro/following{/other_user}",
"gists_url": "https://api.github.com/users/jerojasro/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/jerojasro",
"id": 322909,
"login": "jerojasro",
"node_id": "MDQ6VXNlcjMyMjkwOQ==",
"organizations_url": "https://api.github.com/users/jerojasro/orgs",
"received_events_url": "https://api.github.com/users/jerojasro/received_events",
"repos_url": "https://api.github.com/users/jerojasro/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/jerojasro/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jerojasro/subscriptions",
"type": "User",
"url": "https://api.github.com/users/jerojasro",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 3 |
2019-01-21T16:26:24Z
|
2021-08-27T00:08:46Z
|
2021-02-20T14:51:02Z
|
NONE
|
resolved
|
This is mostly to tell the reader about when HTTP error must be handled, and to better link to the other places in the doc. where this is explained.
|
{
"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/4947/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4947/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/4947.diff",
"html_url": "https://github.com/psf/requests/pull/4947",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/4947.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/4947"
}
| true |
[
"# [Codecov](https://codecov.io/gh/requests/requests/pull/4947?src=pr&el=h1) Report\n> Merging [#4947](https://codecov.io/gh/requests/requests/pull/4947?src=pr&el=desc) into [master](https://codecov.io/gh/requests/requests/commit/67a9ed47aec4f9f8280e58e4e05e3a753f62ae15?src=pr&el=desc) will **not change** coverage.\n> The diff coverage is `n/a`.\n\n[](https://codecov.io/gh/requests/requests/pull/4947?src=pr&el=tree)\n\n```diff\n@@ Coverage Diff @@\n## master #4947 +/- ##\n=======================================\n Coverage 66.89% 66.89% \n=======================================\n Files 15 15 \n Lines 1577 1577 \n=======================================\n Hits 1055 1055 \n Misses 522 522\n```\n\n\n| [Impacted Files](https://codecov.io/gh/requests/requests/pull/4947?src=pr&el=tree) | Coverage Δ | |\n|---|---|---|\n| [requests/exceptions.py](https://codecov.io/gh/requests/requests/pull/4947/diff?src=pr&el=tree#diff-cmVxdWVzdHMvZXhjZXB0aW9ucy5weQ==) | `17.14% <ø> (ø)` | :arrow_up: |\n\n------\n\n[Continue to review full report at Codecov](https://codecov.io/gh/requests/requests/pull/4947?src=pr&el=continue).\n> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)\n> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`\n> Powered by [Codecov](https://codecov.io/gh/requests/requests/pull/4947?src=pr&el=footer). Last update [67a9ed4...fea839f](https://codecov.io/gh/requests/requests/pull/4947?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).\n",
"Thanks for the contribution @jerojasro and trying to improve the documentation!\r\n\r\nPersonally, I'm not sure I understand _why_ this change is helpful. From what I can understand from the analytics of the requests documentation, most people don't read up on exceptions first and instead can understand the content of this from the examples and documentation already available. I feel like this is a solution in search of a problem. I'm going to close this due to its age but it can be re-opened if you want to help me understand your reasoning here and maybe workshop a different update\r\n",
"hello @sigmavirus24 ; my goal here is to better explain what is (and isn't) an HTTPError, since I think the current docstring is way too terse.\r\n\r\nReading back what I wrote, perhaps the last paragraph is unnecessary, but I think the change to the main sentence (An HTTP error (status code >= 400) occurred.) is what's important. I added that because to me (and I'm assuming here also to any non HTTP-protocol experts) is not immediately obvious what is meant by HTTP error, whether that includes timeouts, network issues, TLS issues, etc., which to a beginner might all land in the same category, even though for request's authors they do not."
] |
https://api.github.com/repos/psf/requests/issues/4946
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4946/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4946/comments
|
https://api.github.com/repos/psf/requests/issues/4946/events
|
https://github.com/psf/requests/issues/4946
| 401,313,830 |
MDU6SXNzdWU0MDEzMTM4MzA=
| 4,946 |
CURL command works from command line but fails when using requests
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/11543287?v=4",
"events_url": "https://api.github.com/users/elilurie/events{/privacy}",
"followers_url": "https://api.github.com/users/elilurie/followers",
"following_url": "https://api.github.com/users/elilurie/following{/other_user}",
"gists_url": "https://api.github.com/users/elilurie/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/elilurie",
"id": 11543287,
"login": "elilurie",
"node_id": "MDQ6VXNlcjExNTQzMjg3",
"organizations_url": "https://api.github.com/users/elilurie/orgs",
"received_events_url": "https://api.github.com/users/elilurie/received_events",
"repos_url": "https://api.github.com/users/elilurie/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/elilurie/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/elilurie/subscriptions",
"type": "User",
"url": "https://api.github.com/users/elilurie",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 2 |
2019-01-21T11:38:22Z
|
2021-09-06T00:06:33Z
|
2019-01-21T13:47:43Z
|
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/11543287?v=4",
"events_url": "https://api.github.com/users/elilurie/events{/privacy}",
"followers_url": "https://api.github.com/users/elilurie/followers",
"following_url": "https://api.github.com/users/elilurie/following{/other_user}",
"gists_url": "https://api.github.com/users/elilurie/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/elilurie",
"id": 11543287,
"login": "elilurie",
"node_id": "MDQ6VXNlcjExNTQzMjg3",
"organizations_url": "https://api.github.com/users/elilurie/orgs",
"received_events_url": "https://api.github.com/users/elilurie/received_events",
"repos_url": "https://api.github.com/users/elilurie/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/elilurie/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/elilurie/subscriptions",
"type": "User",
"url": "https://api.github.com/users/elilurie",
"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/4946/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4946/timeline
| null |
completed
| null | null | false |
[
"Using CURL POST works in UBUNTU command line works but does not work from a python script \r\n**Curl command:**\r\n```\r\ncurl -X POST \\\r\n https://wstest3.edensprings.com/API/mobile/GetData \\\r\n -H 'cache-control: no-cache' \\\r\n -H 'content-type: application/json' \\\r\n -H 'postman-token: GGGGG-HHHHH' \\\r\n -d '{\r\n \"ApplicationName\": \"AAAAA\",\r\n \"ApplicationCode\": \"BBBBB\",\r\n \"LanguageCode\": \"HE\",\r\n \"Country\": \"IL\",\r\n \"Market\": \"IL\",\r\n \"CustomerNumber\" : \"CCCCC\",\r\n \"PhoneNumber\" : \"DDDDD\",\r\n \"Last4Digits\" : \"EEEEE\",\r\n \"AddressID\": \"FFFFF\"\r\n }'\r\n\r\n```\r\n**Python script**\r\n```\r\nurl='https://wstest3.edensprings.com/API/mobile/GetData'\r\npayload ={'ApplicationName':'AAAAA',\r\n 'ApplicationCode': 'BBBBB',\r\n 'LanguageCode': 'HE',\r\n 'Country': 'IL',\r\n 'Market': 'IL',\r\n 'CustomerNumber' : 'CCCCC',\r\n 'PhoneNumber' : 'DDDDD',\r\n 'Last4Digits' : 'EEEEE',\r\n 'AddressID': 'FFFFF'\r\n }\r\nheaders={'cache-control': 'no-cache',\r\n 'content-type': 'application/json',\r\n 'postman-token': 'GGGGG-HHHHH'}\r\nr = requests.post(url, data=payload, headers=headers)\r\n\r\n```\r\n**The error that is returned by a remote server to the requests.post() is :**\r\n{\"Message\":\"An error has occurred.\",\"ExceptionMessage\":\"Object reference not set to an instance of an object.\",\"ExceptionType\":\"System.NullReferenceException\",\"StackTrace\":\" at EdenSprings.Gateway.WebApiControllerBase.Process[RequestType,ResponseType](String MethodName, RequestType Request, Action`2 Method, Boolean UseAuthentication) .....\r\n\r\n",
"The problem was solved. It was encoding utf8 reasons..."
] |
https://api.github.com/repos/psf/requests/issues/4945
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4945/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4945/comments
|
https://api.github.com/repos/psf/requests/issues/4945/events
|
https://github.com/psf/requests/issues/4945
| 401,282,598 |
MDU6SXNzdWU0MDEyODI1OTg=
| 4,945 |
API reference doesn't include Response.raw
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/500451?v=4",
"events_url": "https://api.github.com/users/pfalcon/events{/privacy}",
"followers_url": "https://api.github.com/users/pfalcon/followers",
"following_url": "https://api.github.com/users/pfalcon/following{/other_user}",
"gists_url": "https://api.github.com/users/pfalcon/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/pfalcon",
"id": 500451,
"login": "pfalcon",
"node_id": "MDQ6VXNlcjUwMDQ1MQ==",
"organizations_url": "https://api.github.com/users/pfalcon/orgs",
"received_events_url": "https://api.github.com/users/pfalcon/received_events",
"repos_url": "https://api.github.com/users/pfalcon/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/pfalcon/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/pfalcon/subscriptions",
"type": "User",
"url": "https://api.github.com/users/pfalcon",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 1 |
2019-01-21T10:18:29Z
|
2021-09-04T00:06:16Z
|
2019-08-24T02:09:11Z
|
NONE
|
resolved
|
Look under http://docs.python-requests.org/en/master/api/#requests.Response - `raw` attribute is not listed, even though it's described in http://docs.python-requests.org/en/master/user/quickstart/#raw-response-content , etc.
## Expected Result
The API reference should be complete.
## Actual Result
See above.
## Reproduction Steps
See above.
## System Information
The model.py has it like this (f37daf25006a4b475b1bea90fecdd035146dbc3b):
~~~
#: File-like object representation of response (for advanced usage).
#: Use of ``raw`` requires that ``stream=True`` be set on the request.
# This requirement does not apply for use internally to Requests.
self.raw = None
~~~
Note that last comment line doesn't start with `#:`. Maybe that causes the entire comment block to **not** be treated as doc-comment and the field is excluded from docs.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4",
"events_url": "https://api.github.com/users/kennethreitz/events{/privacy}",
"followers_url": "https://api.github.com/users/kennethreitz/followers",
"following_url": "https://api.github.com/users/kennethreitz/following{/other_user}",
"gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/kennethreitz",
"id": 119893,
"login": "kennethreitz",
"node_id": "MDQ6VXNlcjExOTg5Mw==",
"organizations_url": "https://api.github.com/users/kennethreitz/orgs",
"received_events_url": "https://api.github.com/users/kennethreitz/received_events",
"repos_url": "https://api.github.com/users/kennethreitz/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions",
"type": "User",
"url": "https://api.github.com/users/kennethreitz",
"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/4945/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4945/timeline
| null |
completed
| null | null | false |
[
"Ping?\r\n"
] |
https://api.github.com/repos/psf/requests/issues/4944
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4944/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4944/comments
|
https://api.github.com/repos/psf/requests/issues/4944/events
|
https://github.com/psf/requests/pull/4944
| 401,180,680 |
MDExOlB1bGxSZXF1ZXN0MjQ2MTYyMTEz
| 4,944 |
Fixes: TestSuperLen class
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/28245482?v=4",
"events_url": "https://api.github.com/users/deepio/events{/privacy}",
"followers_url": "https://api.github.com/users/deepio/followers",
"following_url": "https://api.github.com/users/deepio/following{/other_user}",
"gists_url": "https://api.github.com/users/deepio/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/deepio",
"id": 28245482,
"login": "deepio",
"node_id": "MDQ6VXNlcjI4MjQ1NDgy",
"organizations_url": "https://api.github.com/users/deepio/orgs",
"received_events_url": "https://api.github.com/users/deepio/received_events",
"repos_url": "https://api.github.com/users/deepio/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/deepio/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/deepio/subscriptions",
"type": "User",
"url": "https://api.github.com/users/deepio",
"user_view_type": "public"
}
|
[
{
"color": "e11d21",
"default": false,
"description": null,
"id": 78002701,
"name": "Do Not Merge",
"node_id": "MDU6TGFiZWw3ODAwMjcwMQ==",
"url": "https://api.github.com/repos/psf/requests/labels/Do%20Not%20Merge"
}
] |
closed
| true | null |
[] | null | 3 |
2019-01-21T03:32:28Z
|
2021-08-31T00:07:25Z
|
2019-02-08T12:39:21Z
|
NONE
|
resolved
|
Pytest itself would fail, until I fixed the semantics of the pytest params in the decorator for `test_io_streams`. I am not certain unittests are being used currently, as many tests failed prior to changing anything. Am I not using them correctly?
I also wanted to start a discussion and share thoughts on default_ports, I believe it should be written in the same manner as default_headers.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/28245482?v=4",
"events_url": "https://api.github.com/users/deepio/events{/privacy}",
"followers_url": "https://api.github.com/users/deepio/followers",
"following_url": "https://api.github.com/users/deepio/following{/other_user}",
"gists_url": "https://api.github.com/users/deepio/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/deepio",
"id": 28245482,
"login": "deepio",
"node_id": "MDQ6VXNlcjI4MjQ1NDgy",
"organizations_url": "https://api.github.com/users/deepio/orgs",
"received_events_url": "https://api.github.com/users/deepio/received_events",
"repos_url": "https://api.github.com/users/deepio/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/deepio/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/deepio/subscriptions",
"type": "User",
"url": "https://api.github.com/users/deepio",
"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/4944/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4944/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/4944.diff",
"html_url": "https://github.com/psf/requests/pull/4944",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/4944.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/4944"
}
| true |
[
"# [Codecov](https://codecov.io/gh/requests/requests/pull/4944?src=pr&el=h1) Report\n> Merging [#4944](https://codecov.io/gh/requests/requests/pull/4944?src=pr&el=desc) into [master](https://codecov.io/gh/requests/requests/commit/64bde6582d9b49e9345d9b8df16aaa26dc372d13?src=pr&el=desc) will **not change** coverage.\n> The diff coverage is `50%`.\n\n[](https://codecov.io/gh/requests/requests/pull/4944?src=pr&el=tree)\n\n```diff\n@@ Coverage Diff @@\n## master #4944 +/- ##\n=======================================\n Coverage 66.89% 66.89% \n=======================================\n Files 15 15 \n Lines 1577 1577 \n=======================================\n Hits 1055 1055 \n Misses 522 522\n```\n\n\n| [Impacted Files](https://codecov.io/gh/requests/requests/pull/4944?src=pr&el=tree) | Coverage Δ | |\n|---|---|---|\n| [requests/sessions.py](https://codecov.io/gh/requests/requests/pull/4944/diff?src=pr&el=tree#diff-cmVxdWVzdHMvc2Vzc2lvbnMucHk=) | `76.76% <50%> (ø)` | :arrow_up: |\n\n------\n\n[Continue to review full report at Codecov](https://codecov.io/gh/requests/requests/pull/4944?src=pr&el=continue).\n> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)\n> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`\n> Powered by [Codecov](https://codecov.io/gh/requests/requests/pull/4944?src=pr&el=footer). Last update [64bde65...41e92c4](https://codecov.io/gh/requests/requests/pull/4944?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).\n",
"@sigmavirus24 Can you provide more information?",
"Closed due to no feedback."
] |
https://api.github.com/repos/psf/requests/issues/4943
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4943/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4943/comments
|
https://api.github.com/repos/psf/requests/issues/4943/events
|
https://github.com/psf/requests/issues/4943
| 401,108,264 |
MDU6SXNzdWU0MDExMDgyNjQ=
| 4,943 |
Replace the license file with license full text, because GitHub doesn't detect the license in the current state of the repo
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/240344?v=4",
"events_url": "https://api.github.com/users/KOLANICH/events{/privacy}",
"followers_url": "https://api.github.com/users/KOLANICH/followers",
"following_url": "https://api.github.com/users/KOLANICH/following{/other_user}",
"gists_url": "https://api.github.com/users/KOLANICH/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/KOLANICH",
"id": 240344,
"login": "KOLANICH",
"node_id": "MDQ6VXNlcjI0MDM0NA==",
"organizations_url": "https://api.github.com/users/KOLANICH/orgs",
"received_events_url": "https://api.github.com/users/KOLANICH/received_events",
"repos_url": "https://api.github.com/users/KOLANICH/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/KOLANICH/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/KOLANICH/subscriptions",
"type": "User",
"url": "https://api.github.com/users/KOLANICH",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 2 |
2019-01-20T15:25:48Z
|
2021-09-02T00:07:17Z
|
2020-02-18T07:16:10Z
|
NONE
|
resolved
|
{
"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/4943/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4943/timeline
| null |
completed
| null | null | false |
[
"I don't believe this is an issue anymore. Resolving since it appears correctly in current Github.",
"It is still the issue. When GH detects project's license, you see not `View license`, but its SPDX identifier."
] |
|
https://api.github.com/repos/psf/requests/issues/4942
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4942/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4942/comments
|
https://api.github.com/repos/psf/requests/issues/4942/events
|
https://github.com/psf/requests/pull/4942
| 401,059,835 |
MDExOlB1bGxSZXF1ZXN0MjQ2MDg1OTc5
| 4,942 |
Update sessions.py
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1960194?v=4",
"events_url": "https://api.github.com/users/xuhuan/events{/privacy}",
"followers_url": "https://api.github.com/users/xuhuan/followers",
"following_url": "https://api.github.com/users/xuhuan/following{/other_user}",
"gists_url": "https://api.github.com/users/xuhuan/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/xuhuan",
"id": 1960194,
"login": "xuhuan",
"node_id": "MDQ6VXNlcjE5NjAxOTQ=",
"organizations_url": "https://api.github.com/users/xuhuan/orgs",
"received_events_url": "https://api.github.com/users/xuhuan/received_events",
"repos_url": "https://api.github.com/users/xuhuan/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/xuhuan/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/xuhuan/subscriptions",
"type": "User",
"url": "https://api.github.com/users/xuhuan",
"user_view_type": "public"
}
|
[
{
"color": "e11d21",
"default": false,
"description": null,
"id": 78002701,
"name": "Do Not Merge",
"node_id": "MDU6TGFiZWw3ODAwMjcwMQ==",
"url": "https://api.github.com/repos/psf/requests/labels/Do%20Not%20Merge"
}
] |
closed
| true | null |
[] | null | 1 |
2019-01-20T03:49:50Z
|
2021-08-31T00:07:25Z
|
2019-02-14T14:13:27Z
|
NONE
|
resolved
|
make proxies.update can use in get or post
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/3725578?v=4",
"events_url": "https://api.github.com/users/Projjol-zz/events{/privacy}",
"followers_url": "https://api.github.com/users/Projjol-zz/followers",
"following_url": "https://api.github.com/users/Projjol-zz/following{/other_user}",
"gists_url": "https://api.github.com/users/Projjol-zz/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Projjol-zz",
"id": 3725578,
"login": "Projjol-zz",
"node_id": "MDQ6VXNlcjM3MjU1Nzg=",
"organizations_url": "https://api.github.com/users/Projjol-zz/orgs",
"received_events_url": "https://api.github.com/users/Projjol-zz/received_events",
"repos_url": "https://api.github.com/users/Projjol-zz/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Projjol-zz/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Projjol-zz/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Projjol-zz",
"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/4942/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4942/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/4942.diff",
"html_url": "https://github.com/psf/requests/pull/4942",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/4942.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/4942"
}
| true |
[
"Closing due to label, please re-open in the future if needed"
] |
https://api.github.com/repos/psf/requests/issues/4941
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4941/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4941/comments
|
https://api.github.com/repos/psf/requests/issues/4941/events
|
https://github.com/psf/requests/issues/4941
| 400,199,470 |
MDU6SXNzdWU0MDAxOTk0NzA=
| 4,941 |
Leakage of results from one request to another while using session
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/16288600?v=4",
"events_url": "https://api.github.com/users/dilipvamsi/events{/privacy}",
"followers_url": "https://api.github.com/users/dilipvamsi/followers",
"following_url": "https://api.github.com/users/dilipvamsi/following{/other_user}",
"gists_url": "https://api.github.com/users/dilipvamsi/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/dilipvamsi",
"id": 16288600,
"login": "dilipvamsi",
"node_id": "MDQ6VXNlcjE2Mjg4NjAw",
"organizations_url": "https://api.github.com/users/dilipvamsi/orgs",
"received_events_url": "https://api.github.com/users/dilipvamsi/received_events",
"repos_url": "https://api.github.com/users/dilipvamsi/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/dilipvamsi/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/dilipvamsi/subscriptions",
"type": "User",
"url": "https://api.github.com/users/dilipvamsi",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 3 |
2019-01-17T10:08:31Z
|
2024-10-04T00:39:57Z
|
2024-10-04T00:39:53Z
|
NONE
| null |
Hi,
I was facing this issue when using the requests session in gevent workers threads. (https://github.com/ArangoDB-Community/pyArango/issues/65).
I faced the same issue when using Celery (which was not using the gevent for workers) while communicating to the db.
I have changed the code such that for every call to the db a new session is created and issue seemed to be resolved.
I think the issue may be due to large number of concurrent calls to db using the same session.
Regards,
Dilip Vamsi.
|
{
"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/4941/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4941/timeline
| null |
completed
| null | null | false |
[
"As far as I can tell, `requests.Session` is not thread safe, see https://github.com/kennethreitz/requests/issues/2766. So creating a new session per thread is probably the way to go?",
"@sethmlarson is this issue resolved? Per your comment in https://github.com/psf/requests/issues/2766#issuecomment-2119324917 it seems you didn't think any threading issues remain.",
"@holmanb that seems an uncharitable read of Seth's statement which is that the issue had become stale and there needed to be new evidence of a threading problem to justify further investigation. I think this issue can also be closed though as stale. "
] |
https://api.github.com/repos/psf/requests/issues/4940
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4940/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4940/comments
|
https://api.github.com/repos/psf/requests/issues/4940/events
|
https://github.com/psf/requests/pull/4940
| 400,078,082 |
MDExOlB1bGxSZXF1ZXN0MjQ1MzUxOTk0
| 4,940 |
Remove sudo: from .travis.yml
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/2379650?v=4",
"events_url": "https://api.github.com/users/sloria/events{/privacy}",
"followers_url": "https://api.github.com/users/sloria/followers",
"following_url": "https://api.github.com/users/sloria/following{/other_user}",
"gists_url": "https://api.github.com/users/sloria/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/sloria",
"id": 2379650,
"login": "sloria",
"node_id": "MDQ6VXNlcjIzNzk2NTA=",
"organizations_url": "https://api.github.com/users/sloria/orgs",
"received_events_url": "https://api.github.com/users/sloria/received_events",
"repos_url": "https://api.github.com/users/sloria/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/sloria/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/sloria/subscriptions",
"type": "User",
"url": "https://api.github.com/users/sloria",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 2 |
2019-01-17T01:59:35Z
|
2021-08-31T00:07:27Z
|
2019-01-21T18:50:28Z
|
CONTRIBUTOR
|
resolved
|
TravisCI has migrated their infrastructure: https://blog.travis-ci.com/2018-11-19-required-linux-infrastructure-migration
|
{
"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/4940/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4940/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/4940.diff",
"html_url": "https://github.com/psf/requests/pull/4940",
"merged_at": "2019-01-21T18:50:28Z",
"patch_url": "https://github.com/psf/requests/pull/4940.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/4940"
}
| true |
[
"Test failures seem unrelated and are happening on `master` as well.",
"# [Codecov](https://codecov.io/gh/requests/requests/pull/4940?src=pr&el=h1) Report\n> Merging [#4940](https://codecov.io/gh/requests/requests/pull/4940?src=pr&el=desc) into [master](https://codecov.io/gh/requests/requests/commit/67a9ed47aec4f9f8280e58e4e05e3a753f62ae15?src=pr&el=desc) will **not change** coverage.\n> The diff coverage is `n/a`.\n\n[](https://codecov.io/gh/requests/requests/pull/4940?src=pr&el=tree)\n\n```diff\n@@ Coverage Diff @@\n## master #4940 +/- ##\n=======================================\n Coverage 66.89% 66.89% \n=======================================\n Files 15 15 \n Lines 1577 1577 \n=======================================\n Hits 1055 1055 \n Misses 522 522\n```\n\n\n\n------\n\n[Continue to review full report at Codecov](https://codecov.io/gh/requests/requests/pull/4940?src=pr&el=continue).\n> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)\n> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`\n> Powered by [Codecov](https://codecov.io/gh/requests/requests/pull/4940?src=pr&el=footer). Last update [67a9ed4...334be4d](https://codecov.io/gh/requests/requests/pull/4940?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).\n"
] |
https://api.github.com/repos/psf/requests/issues/4939
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4939/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4939/comments
|
https://api.github.com/repos/psf/requests/issues/4939/events
|
https://github.com/psf/requests/issues/4939
| 399,365,119 |
MDU6SXNzdWUzOTkzNjUxMTk=
| 4,939 |
Determining the IP address of server with bad TLS cert.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1912206?v=4",
"events_url": "https://api.github.com/users/tmontes/events{/privacy}",
"followers_url": "https://api.github.com/users/tmontes/followers",
"following_url": "https://api.github.com/users/tmontes/following{/other_user}",
"gists_url": "https://api.github.com/users/tmontes/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/tmontes",
"id": 1912206,
"login": "tmontes",
"node_id": "MDQ6VXNlcjE5MTIyMDY=",
"organizations_url": "https://api.github.com/users/tmontes/orgs",
"received_events_url": "https://api.github.com/users/tmontes/received_events",
"repos_url": "https://api.github.com/users/tmontes/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/tmontes/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/tmontes/subscriptions",
"type": "User",
"url": "https://api.github.com/users/tmontes",
"user_view_type": "public"
}
|
[] |
open
| false | null |
[] | null | 8 |
2019-01-15T14:17:58Z
|
2019-01-15T18:00:44Z
| null |
NONE
| null |
Preliminary notes:
* Thanks for `requests`!
* I investigated quite a bit and couldn't find an obvious solution to the issue. Where I looked: documentation, stack overflow, general web search.
Scenario:
* HTTPS service available via a DNS name mapped to multiple IP addresses.
* Each such address is handled by a different server.
* Some of those servers configured with a bad/wrong TLS certificate.
The issue:
* Requests like `requests.get('https://multiple.example.net/')` will sometimes succeed TLS validation and other times fail. How to determine the IP address of the server with the bad TLS certificate?
Why?
* I would like to be able to tell the service provider that their server at IP address "so and so" is presenting a wrong certificate.
The "give me an IP address" solutions I found all assume the HTTP connection has been established and are mostly based in the idea of using streaming mode to get to the underlying socket, calling `getpeername()` from there.
Those do not work in this scenario given that an `requests.exceptions.SSLError` exception is properly raised and there's no response object to work with from that point on. Unless the exception holds a reference to the socket, but I couldn't find it there.
Questions:
* Other than monkey-patching approaches, is there any solution for this challenge I may be missing?
* If not, should/could `requests.exceptions.SSLError` include a reference to the socket that lead to the failure, pretty much like all other requests exceptions include a reference to the request and response objects?
Thanks in advance.
| 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/4939/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4939/timeline
| null | null | null | null | false |
[
"I wrote a thing to handle this, sort of: https://github.com/lifehackjim/cert_human/\r\n\r\nYou can get a cert from a server (regardless of it's validity), then perform whatever validation, reporting, or what-have you on it. Ex:\r\n\r\n```\r\n>>> import cert_human\r\n>>> store = cert_human.CertStore.from_request(\"https://cyborg\")\r\n>>> print(store.subject)\r\n{'common_name': 'cyborg'}\r\n>>> print(store)\r\nCertStore:\r\n Issuer: Common Name: cyborg\r\n Subject: Common Name: cyborg\r\n Subject Alternate Names: cyborg\r\n Fingerprint SHA1: 67 FD F1 7A 02 26 C7 AB 77 AD CD CB 63 76 19 AD 83 0C BF B7\r\n Fingerprint SHA256: FA BF 9D EC CF 6C 3F 8A 08 89 29 04 5E 9E B5 A8 28 A9 F7 A8 E8 38 14 7F 32 CE 78 DC 26 B0 84 EA\r\n Expired: False, Not Valid Before: 2008-11-15 06:32:10+00:00, Not Valid After: 2028-11-15 02:56:10+00:00\r\n Self Signed: maybe, Self Issued: True\r\n```",
"Thanks for your input.\r\n\r\nThat doesn't seem to respond to the question \"what's the IP address of the server that just failed my TLS certificate validation\": the important part here is the **that just failed** (and, thus, resulted in a `requests.exceptions.SSLError` exception).\r\n\r\nIf, facing such failure, the code issues a subsequent request -- be it with `requests` or with your `cert_human` -- there's no guarantee that it will hit the same destination IP address.\r\n\r\nPS: I do not want to validate TLS certificates in my code. I'd rather delegate that to `requests` default behaviour. :)",
"You can do that, by having cert_human always include the cert attributes in the raw object of each response, but you'd have to make two requests per connection. One with verify=False first (either by using cert_human.get_response(), or by using requests.get(verify=False), then your actual connection. Ex:\r\n\r\n```\r\n>>> import requests\r\n>>> import cert_human\r\n>>> cert_human.enable_urllib3_patch()\r\n>>> url = \"https://cyborg\"\r\n>>>\r\n>>> cert_response = requests.get(url, verify=False)\r\n/Users/jim.olsen/.pyenv/versions/3.7.1/lib/python3.7/site-packages/urllib3/connectionpool.py:847: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings\r\n InsecureRequestWarning)\r\n>>> store = cert_human.CertStore.from_response(cert_response)\r\n>>>\r\n>>> try:\r\n... r = requests.get(\"https://cyborg\")\r\n... except requests.exceptions.SSLError as exc:\r\n... m = \"SSL Certificate at url: {url!r} failed, info: {store}\"\r\n... print(m.format(url=url, store=store))\r\n...\r\nSSL Certificate at url: 'https://cyborg' failed, info: CertStore:\r\n Issuer: Common Name: cyborg\r\n Subject: Common Name: cyborg\r\n Subject Alternate Names: cyborg\r\n Fingerprint SHA1: 67 FD F1 7A 02 26 C7 AB 77 AD CD CB 63 76 19 AD 83 0C BF B7\r\n Fingerprint SHA256: FA BF 9D EC CF 6C 3F 8A 08 89 29 04 5E 9E B5 A8 28 A9 F7 A8 E8 38 14 7F 32 CE 78 DC 26 B0 84 EA\r\n Expired: False, Not Valid Before: 2008-11-15 06:32:10+00:00, Not Valid After: 2028-11-15 02:56:10+00:00\r\n Self Signed: maybe, Self Issued: True\r\n```",
"Thanks again Jim, for your prompt feedback.\r\n\r\nAFAICT, your code does not address the issue at all. Let me try to restate it:\r\n* DNS name maps to multiple IP addresses.\r\n* Would like to know the IP address of HTTP server presenting a non-valid TLS certificate.\r\n* Repeating requests is pointless: no guarantee that same IP / server will be hit.\r\n* Knowing the IP is useful in helping me let the provider know that their server at IP \"so and so\" presented a non-valid TLS certificate.\r\n\r\nMinimal code example with a \"fill in the blanks\" approach:\r\n\r\n```python\r\nimport requests\r\n\r\ntry:\r\n # TCP connection to one of multiple IPs that DNS resolves `multiple.example.net` to.\r\n resp = requests.get('https://multiple.example.net')\r\nexcept requests.exceptions.SSLError:\r\n # TLS certificate validation failed.\r\n ip_address = ??? # Which IP address gave us a non-valid TLS certificate?\r\n```\r\n\r\nPS: Not sure if the underlying connection pooling and eventual retrying that may be taking place (?) turns this into a more complex problem that what it may appear to be at first sight.",
"Ah I understand now.. I didn't catch the part that you were making a request to a DNS name with multiple A records. Apologies.\r\n\r\nI don't know that any layer exposes the actual IP address that the socket is connected to (or it's just buried too deep for my quick search). But if you can find that layer, it looks like you'd have to monkey patch and bubble it up (similar to what I do with cert_human).",
"Could you patch [`urllib3.util.connection.create_connection()`](https://github.com/urllib3/urllib3/blob/master/src/urllib3/util/connection.py#L57) to print out / save the DNS records that `socket.getaddrinfo()` receives somewhere you can access? A little hacky but this is where you'd directly get DNS-to-IP information.",
"I decided to play around with this, because curiosity always gets the best of me.\r\n\r\n```python\r\nimport requests\r\nimport urllib3\r\nimport ssl\r\n\r\n_ssl_wrap_socket = urllib3.connection.ssl_wrap_socket\r\n\r\n\r\ndef ssl_wrap_socket(sock, keyfile=None, certfile=None, cert_reqs=None,\r\n ca_certs=None, server_hostname=None,\r\n ssl_version=None, ciphers=None, ssl_context=None,\r\n ca_cert_dir=None):\r\n \"\"\"Pass.\"\"\"\r\n try:\r\n return _ssl_wrap_socket(\r\n sock=sock,\r\n keyfile=keyfile,\r\n certfile=certfile,\r\n cert_reqs=cert_reqs,\r\n ca_certs=ca_certs,\r\n server_hostname=server_hostname,\r\n ssl_version=ssl_version,\r\n ciphers=ciphers,\r\n ssl_context=ssl_context,\r\n ca_cert_dir=ca_cert_dir,\r\n )\r\n except ssl.SSLError as e:\r\n e.laddr = sock.getsockname()\r\n e.raddr = sock.getpeername()\r\n raise\r\n\r\n\r\nurllib3.connection.ssl_wrap_socket = ssl_wrap_socket\r\n\r\nurl = \"https://cyborg\"\r\n\r\ntry:\r\n r = requests.get(url)\r\nexcept requests.exceptions.SSLError as exc:\r\n print(\"Invalid cert at {!r}\".format(url))\r\n print(\"Local ip {} port {}\".format(*exc.args[0].reason.args[0].laddr))\r\n print(\"Remote ip {} port {}\".format(*exc.args[0].reason.args[0].raddr))\r\n```\r\n\r\nThis outputs:\r\n```console\r\npython moo.py\r\nInvalid cert at 'https://cyborg'\r\nLocal ip 192.168.1.174 port 53151\r\nRemote ip 192.168.1.32 port 443\r\n```\r\n",
"Seth, Jim,\r\n\r\nThanks for your ideas. They both follow monkey-patching approaches which I am explicitly trying to avoid: who's to say that, in the future, a given patch will work against a future `requests` / `urllib3` version?\r\n\r\nI myself had created a monkey-patch based solution, patching `socket.socket.connect`:\r\n\r\n```python\r\nimport socket\r\nimport requests\r\n\r\n_socket_connect_method = socket.socket.connect\r\n\r\ndef _socket_connect_tracker(self, address):\r\n _socket_connect_tracker.address = address\r\n return _socket_connect_method(self, address)\r\n\r\nsocket.socket.connect = _socket_connect_tracker\r\n\r\ntry:\r\n resp = requests.get('https://multiple.example.net')\r\nexcept requests.exceptions.SSLError:\r\n print('TLS validation failed for', _socket_connect_tracker.address)\r\n```\r\n\r\nPros:\r\n* Works.\r\n* Simple enough.\r\n* Patching a very stable API, `socket.connect`, likely to work for the foreseeable future.\r\n\r\nCons:\r\n* Monkey patching.\r\n* Due to fail under multi-threaded and other client side concurrency scenarios.\r\n\r\nWhat I was wondering and asking about in this issue was:\r\n* Is there a solution for this use-case that does not depend on monkey-patching?\r\n* If not, couldn't `requests.exceptions.SSLError` include a reference to the socket that failed TLS validation? (pretty much like all other `requests` exceptions include references to the request and response objects) I see that as valuable and legitimate use case, and a perfectly reasonable API.\r\n* If so, would the `requests` and `urllib3` maintainers accept PRs that would cater for that?"
] |
https://api.github.com/repos/psf/requests/issues/4938
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4938/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4938/comments
|
https://api.github.com/repos/psf/requests/issues/4938/events
|
https://github.com/psf/requests/issues/4938
| 399,127,304 |
MDU6SXNzdWUzOTkxMjczMDQ=
| 4,938 |
Session doesn't keep SSL setting
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/11529426?v=4",
"events_url": "https://api.github.com/users/AndTheDaysGoBy/events{/privacy}",
"followers_url": "https://api.github.com/users/AndTheDaysGoBy/followers",
"following_url": "https://api.github.com/users/AndTheDaysGoBy/following{/other_user}",
"gists_url": "https://api.github.com/users/AndTheDaysGoBy/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/AndTheDaysGoBy",
"id": 11529426,
"login": "AndTheDaysGoBy",
"node_id": "MDQ6VXNlcjExNTI5NDI2",
"organizations_url": "https://api.github.com/users/AndTheDaysGoBy/orgs",
"received_events_url": "https://api.github.com/users/AndTheDaysGoBy/received_events",
"repos_url": "https://api.github.com/users/AndTheDaysGoBy/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/AndTheDaysGoBy/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/AndTheDaysGoBy/subscriptions",
"type": "User",
"url": "https://api.github.com/users/AndTheDaysGoBy",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 1 |
2019-01-14T23:54:23Z
|
2021-09-05T00:06:59Z
|
2019-02-14T15:03:58Z
|
NONE
|
resolved
|
Summary.
https://github.com/requests/requests/blob/f37daf25006a4b475b1bea90fecdd035146dbc3b/requests/sessions.py#L340
Looking at the Session object above, we have verify in the` __attr__` field. Let `s = Session()`. One way to set the parameters of the session is to perform `s.<field> = value`. This works for some of them, but not all of them.
In particular, consider the situation where you have a cacert you have to verify with. With a standard curl, you could send this with --cacert, with a standard request, you could pass this in with `requests.get(url, verify="/path/to/cacert"`. In a session however, you could at best set it "per each request" (against the purpose of a session) by performing `s.get(url, verify="path/to/cacert")`.
To fulfill the purpose of a session, authentication and other fields are usually set via `s.<field> = value`, and then you at most have to do `s.get(url)`. This is how it's used in docker-py.
However, this fails to work like a session should due to the implementation of the get method:
https://github.com/requests/requests/blob/f37daf25006a4b475b1bea90fecdd035146dbc3b/requests/sessions.py#L537
in conjunction with the request() method:
https://github.com/requests/requests/blob/f37daf25006a4b475b1bea90fecdd035146dbc3b/requests/sessions.py#L466
Notice how the get method at most passes in the url down to the request method, and the rest are passed in as kwargs. As a result, the verify field will only be passed on to the request if "verify" is in the kwargs (i.e. you perform `s.get(url, verify="path/to/cacert")` as you would in a normal request).
Since it wont be (after all, it's supposed to be a setting of the session, set via `s.verify = "path/to/cacert"`), the request() method will default it to None.
This None value will be passed into the merge_environment_settings method:
https://github.com/requests/requests/blob/f37daf25006a4b475b1bea90fecdd035146dbc3b/requests/sessions.py#L690
Since the default value for trust_env is True, the first if statement will occur. Then, since verify was improperly passed in as None, the second one will also occur. Therefore, we will have
`verify = (os.environ.get('REQUESTS_CA_BUNDLE') or os.environ.get('CURL_CA_BUNDLE'))`
Now, verify will proceed to go to the merge_setting() method, i.e. `verify = merge_setting(verify, self.verify)`:
https://github.com/requests/requests/blob/f37daf25006a4b475b1bea90fecdd035146dbc3b/requests/sessions.py#L49
However, now that verify actually has a value (the value resulting from or'ing the BUNDLEs), the first if in this method will not occur, the second one will not occur (the one we wanted to occur), but the third one (which I guess is error-handling related) will occur (which defaults to returning the request_settings, in this case it'd be the or of the BUNDLEs as opposed to the value set via `s.verify = "path/to/cacert"`).
The most straightforward solution I can give is in the PR I've created. I.e. pass in a value for verify into the kwargs for the request() method. Consequently, verify wont be None so it wont be overwritten by the BUNDLEs in the merge_environment_settings() method. Then, that error method in merge_settings() (the third if, i.e. the if not) will at least return the correct default thing.
If there was to be another fix that doesn't hack around how merge_settings functions (i.e. allows us to take the second if), it would be to mess around in the merge_environment_settings() method so that it wont default to setting verify to the BUNDLEs. Otherwise, you'd have to have a special case in the merge_setting() method for "verify" that will allow either request_settings is None or request_settings is "the or of the CURL CA BUNDLE and REQUEST CA BUNDLE" for the second if statement.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/6740665?v=4",
"events_url": "https://api.github.com/users/lmiguelvargasf/events{/privacy}",
"followers_url": "https://api.github.com/users/lmiguelvargasf/followers",
"following_url": "https://api.github.com/users/lmiguelvargasf/following{/other_user}",
"gists_url": "https://api.github.com/users/lmiguelvargasf/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/lmiguelvargasf",
"id": 6740665,
"login": "lmiguelvargasf",
"node_id": "MDQ6VXNlcjY3NDA2NjU=",
"organizations_url": "https://api.github.com/users/lmiguelvargasf/orgs",
"received_events_url": "https://api.github.com/users/lmiguelvargasf/received_events",
"repos_url": "https://api.github.com/users/lmiguelvargasf/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/lmiguelvargasf/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/lmiguelvargasf/subscriptions",
"type": "User",
"url": "https://api.github.com/users/lmiguelvargasf",
"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/4938/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4938/timeline
| null |
completed
| null | null | false |
[
"Closed due to inactivity."
] |
https://api.github.com/repos/psf/requests/issues/4937
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4937/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4937/comments
|
https://api.github.com/repos/psf/requests/issues/4937/events
|
https://github.com/psf/requests/issues/4937
| 399,031,464 |
MDU6SXNzdWUzOTkwMzE0NjQ=
| 4,937 |
Connection reset by peer when sending POST
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/107323?v=4",
"events_url": "https://api.github.com/users/rdgoite/events{/privacy}",
"followers_url": "https://api.github.com/users/rdgoite/followers",
"following_url": "https://api.github.com/users/rdgoite/following{/other_user}",
"gists_url": "https://api.github.com/users/rdgoite/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/rdgoite",
"id": 107323,
"login": "rdgoite",
"node_id": "MDQ6VXNlcjEwNzMyMw==",
"organizations_url": "https://api.github.com/users/rdgoite/orgs",
"received_events_url": "https://api.github.com/users/rdgoite/received_events",
"repos_url": "https://api.github.com/users/rdgoite/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/rdgoite/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/rdgoite/subscriptions",
"type": "User",
"url": "https://api.github.com/users/rdgoite",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 26 |
2019-01-14T19:08:58Z
|
2021-11-26T05:00:33Z
|
2021-08-28T04:03:32Z
|
NONE
|
resolved
|
Client code that uses Requests module to send data via HTTP POST encounters a `ConnectionResetError`. The entire operation (composed of multiple POST requests to a small set of service endpoints) can sometimes succeed, but most of the time, it fails with this error.
## Expected Result
Operation succeeds (or fails) without connection issues.
## Actual Result
The operation fails with `ConnectionResetError`.
## Additional Information
It's a little difficult to provide basic reproduction for the issue as we're running into this problem with a test payload that's specific to our system. The server (peer) is a Java application that's configured to terminate/reset connection after a given time of no use (idle). The client sends multiple one-off POST requests, but it seems like internally, the connections are being reused similar to issue #4506, and the operation eventually runs into a connection that's already been reset and raises the error. However, unlike #4506, we are not using Sessions.
Here are some tracebacks that could hopefully describe the problem better:
```
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 600, in urlopen
chunked=chunked)
File "/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 384, in _make_request
six.raise_from(e, None)
File "<string>", line 2, in raise_from
File "/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 380, in _make_request
httplib_response = conn.getresponse()
File "/usr/local/lib/python3.7/http/client.py", line 1321, in getresponse
response.begin()
File "/usr/local/lib/python3.7/http/client.py", line 296, in begin
version, status, reason = self._read_status()
File "/usr/local/lib/python3.7/http/client.py", line 257, in _read_status
line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
File "/usr/local/lib/python3.7/socket.py", line 589, in readinto
return self._sock.recv_into(b)
ConnectionResetError: [Errno 104] Connection reset by peer
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/requests/adapters.py", line 449, in send
timeout=timeout
File "/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 638, in urlopen
_stacktrace=sys.exc_info()[2])
File "/usr/local/lib/python3.7/site-packages/urllib3/util/retry.py", line 367, in increment
raise six.reraise(type(error), error, _stacktrace)
File "/usr/local/lib/python3.7/site-packages/urllib3/packages/six.py", line 685, in reraise
raise value.with_traceback(tb)
File "/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 600, in urlopen
chunked=chunked)
File "/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 384, in _make_request
six.raise_from(e, None)
File "<string>", line 2, in raise_from
File "/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 380, in _make_request
httplib_response = conn.getresponse()
File "/usr/local/lib/python3.7/http/client.py", line 1321, in getresponse
response.begin()
File "/usr/local/lib/python3.7/http/client.py", line 296, in begin
version, status, reason = self._read_status()
File "/usr/local/lib/python3.7/http/client.py", line 257, in _read_status
line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
File "/usr/local/lib/python3.7/socket.py", line 589, in readinto
return self._sock.recv_into(b)
urllib3.exceptions.ProtocolError: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))
...
Traceback (most recent call last):
...
File "../client-code.py", line 322, in createFile
r = requests.post(fileSubmissionsUrl, data=json.dumps(fileToCreateObject), headers=self.headers)
File "/usr/local/lib/python3.7/site-packages/requests/api.py", line 116, in post
return request('post', url, data=data, json=json, **kwargs)
File "/usr/local/lib/python3.7/site-packages/requests/api.py", line 60, in request
return session.request(method=method, url=url, **kwargs)
File "/usr/local/lib/python3.7/site-packages/requests/sessions.py", line 533, in request
resp = self.send(prep, **send_kwargs)
File "/usr/local/lib/python3.7/site-packages/requests/sessions.py", line 646, in send
r = adapter.send(request, **kwargs)
File "/usr/local/lib/python3.7/site-packages/requests/adapters.py", line 498, in send
raise ConnectionError(err, request=request)
requests.exceptions.ConnectionError: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))
```
## System Information
$ python -m requests.help
```
{
"chardet": {
"version": "3.0.4"
},
"cryptography": {
"version": "2.3.1"
},
"idna": {
"version": "2.6"
},
"implementation": {
"name": "CPython",
"version": "3.7.1"
},
"platform": {
"release": "4.14.42-61.37.amzn2.x86_64",
"system": "Linux"
},
"pyOpenSSL": {
"openssl_version": "1000211f",
"version": "18.0.0"
},
"requests": {
"version": "2.20.1"
},
"system_ssl": {
"version": "20000000"
},
"urllib3": {
"version": "1.24.1"
},
"using_pyopenssl": true
}
```
|
{
"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": 7,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 7,
"url": "https://api.github.com/repos/psf/requests/issues/4937/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4937/timeline
| null |
completed
| null | null | false |
[
"+1 same issue here",
"test",
"We are also experiencing a lot of errors (14%) on some servers. POST call is not retried by requests as it's not idempotent.\r\n\r\nAfter installing `requests[security]`, error changed to `('Connection aborted.', OSError(\"(104, 'ECONNRESET')\",))`. ",
"I can reproduce single `ECONNRESET` error. If there is no connection in 10 minutes, next first connection will raise `ECONNRESET`.",
"I've got more info here.\r\nhere is message from our internal gitlab:\r\n\r\n> I have an idea I wanna put to test:\r\n> \r\n> there are 10 connections in connection pool per server/worker.\r\n> \r\n> We have slack notifier that has like 10 requests per minute. We have 8 workers, which I assume share same session (connection pool).\r\n> \r\n> These connections are randomly assigned to workers. If worker receives task, it will pick connection from pool and use it. If it receives two tasks at the same time, it will pick two connections and use it , returning them to pool. So something like this can happen for single worker:\r\n> \r\n> 1. minute: 2 simultaneous connections used, returned to pool. \r\n> 2. minute: max 1 simultaneous connection used, returned to pool. \r\n> 3. minute: max 1 simultaneous connection used, returned to pool. \r\n> 4. minute: max 1 simultaneous connection used, returned to pool. \r\n> 5. minute: max 1 simultaneous connection used, returned to pool. \r\n> **server closed second connection, as it was idle for 5 minutes.**. \r\n> 6. minute: 2 simultaneous connection used. When second connection is picked, it's already closed and we receive error.\r\n\r\nWhen I moved initialization of session to method that is doing requests, connection errors disappeared. though that will not use session and will consume more resources.\r\n\r\nShouldn't requests lib be aware of these closed connections and retry them automatically? \r\n",
"Been experiencing this issue as well. In my case, session is being used and we are doing the actual request inside a coroutine (`loop.run_in_executor`)",
"I ran into this as well, and I can provide a way to reproduce 😄 \r\n\r\n### To reproduce\r\nRun any of the notebooks in \r\nhttps://github.com/e-mission/e-mission-eval-public-data\r\n~~The notebooks can be launched using binder:~~\r\n**Update:** The issue does not occur on notebooks launched via binder, only on my laptop.\r\n**Update 2:** The issue is intermittent even on notebooks launched on my laptop. When it works, it works consistently. When it fails, it fails for hours at a time.\r\n**Update 3:** The issue does not occur on binder, but occurs 90% of the time on my laptop\r\n\r\n### Current code\r\n\r\nThe current code is in https://github.com/e-mission/e-mission-eval-public-data/blob/master/emeval/input/spec_details.py#L24 and uses the quickstart version without any sessions\r\n\r\n```\r\n response = requests.post(self.DATASTORE_URL+\"/datastreams/find_entries/timestamp\", headers=close_headers, json=post_msg, stream=False)\r\n```\r\n\r\n### Workarounds tried\r\nI have tried multiple workarounds, none of which have worked:\r\n- setting `stream=False` (as you can see above) ***DOES NOT WORK***\r\n- using `with requests.post(...) as response` ***DOES NOT WORK***\r\n- manually closing the response by adding `response.close` ***DOES NOT WORK***\r\n ```\r\n print(\"Found %d entries\" % len(ret_list))\r\n response.close()\r\n return ret_list\r\n ```\r\n- tried using a session with `keep_alive = False` ***DOES NOT WORK***\r\n ```\r\n s = requests.Session()\r\n s.keep_alive = False\r\n response = s.post(self.DATASTORE_URL+\"/datastreams/find_entries/timestamp\", headers=close_headers, json=post_msg, stream=False)\r\n ```\r\n- tried using a session with retries, ***DOES NOT WORK***\r\n ```\r\n s = requests.Session()\r\n adapter = requests.adapters.HTTPAdapter(max_retries=2)\r\n s.mount('http://', adapter)\r\n response = s.post(self.DATASTORE_URL+\"/datastreams/find_entries/timestamp\", headers=close_headers, json=post_msg, stream=False)\r\n ```\r\n- tried using a session with max connections = 1 in an attempt to disable pooling ***DOES NOT WORK***\r\n ```\r\n s = requests.Session()\r\n adapter = requests.adapters.HTTPAdapter(pool_connections=1, pool_maxsize=1,\r\n max_retries=5, pool_block=True)\r\n s.mount('http://', adapter)\r\n response = s.post(self.DATASTORE_URL+\"/datastreams/find_entries/timestamp\", json=post_msg)\r\n ```\r\n- tried manually closing the session and the adapter ***DOES NOT WORK***\r\n ```\r\n print(\"Found %d entries\" % len(ret_list))\r\n adapter.close()\r\n s.close()\r\n return ret_list\r\n ```\r\n\r\n~~I haven't tried using sessions, but I am not sure why I need to. If I use the quickstart version and ensure that the response is closed, shouldn't the pooling be effectively disabled (as hinted at https://github.com/psf/requests/issues/4937#issuecomment-508134536)~~\r\n\r\nAt this point, I am tempted to give up on requests and drop down to urllib directly",
"Also, I control both the client and the server, and I can confirm that the request that fails never makes it to the server.\r\n\r\nOn the client:\r\n\r\n```\r\nAbout to retrieve data for ucb-sdb-ios-3 from 1563764533.214622 -> 1563788061.999584\r\nAbout to retrieve messages using {'user': 'ucb-sdb-ios-3', 'key_list': ['background/motion_activity'], 'start_time': 1563764533.214622, 'end_time': 1563788061.999584}\r\nresponse = <Response [200]>\r\nFound 11 entries\r\nRetrieved 11 entries with timestamps [1563764540.2866454, 1563764653.7736874, 1563764657.5883818, 1563768002.560504, 1563771602.48612, 1563775203.1804562, 1563778802.582345, 1563782402.60982, 1563786002.906196, 1563788054.78684]...\r\n\r\n\r\nAbout to retrieve data for ucb-sdb-ios-3 from 1563788059.5701566 -> 1563788061.999584\r\nAbout to retrieve messages using {'user': 'ucb-sdb-ios-3', 'key_list': ['background/motion_activity'], 'start_time': 1563788059.5701566, 'end_time': 1563788061.999584}\r\n\r\n---------------------------------------------------------------------------\r\nConnectionResetError Traceback (most recent call last)\r\n```\r\n\r\nOn the server, last call to `/datastreams/find_entries` is as below. Note that this is from the 11 entry successful call. The call generating the `ConnectionResetError` is not even making it to the server.\r\n\r\n```\r\n2019-08-20 19:58:20,794:DEBUG:140171047577344:START POST /datastreams/find_entries/timestamp\r\n2019-08-20 19:58:20,794:DEBUG:140171047577344:methodName = skip, returning <class 'emission.net.auth.skip.SkipMethod'>\r\n2019-08-20 19:58:20,794:DEBUG:140171047577344:Using the skip method to verify id token ucb-sdb-ios-3 of length 13\r\n2019-08-20 19:58:20,795:DEBUG:140171047577344:retUUID = 7ed80490-6853-433d9d20-838fe4d3d71b\r\n2019-08-20 19:58:20,796:DEBUG:140171047577344:curr_query = {'user_id': UUID('7ed80490-6853-433d-9d20-838fe4d3d71b'), '$or': [{'metadata.key': 'background/motion_activity'}], 'metadata.write_ts': {'$lte': 1563788061.999584, '$gte': 1563764533.214622}}, sort_key = metadata.write_ts\r\n2019-08-20 19:58:20,796:DEBUG:140171047577344:orig_ts_db_keys = ['background/motion_activity'], analysis_ts_db_keys = []\r\n2019-08-20 19:58:20,798:DEBUG:140171047577344:finished querying values for ['background/motion_activity'], count = 0\r\n2019-08-20 19:58:20,798:DEBUG:140171047577344:finished querying values for [], count = 0\r\n2019-08-20 19:58:20,800:DEBUG:140171047577344:orig_ts_db_matches = 0, analysis_ts_db_matches = 0\r\n2019-08-20 19:58:20,802:DEBUG:140171047577344:Found 11 messages in response to query {'user_id': UUID('7ed80490-6853-433d-9d20-838fe4d3d71b'), '$or': [{'metadata.key': 'background/motion_activity'}], 'metadata.write_ts': {'$lte': 1563788061.999584, '$gte': 1563764533.214622}}\r\n2019-08-20 19:58:20,807:DEBUG:140171047577344:END POST /datastreams/find_entries/timestamp 7ed80490-6853-433d-9d20-838fe4d3d71b 0.01349186897277832\r\n```",
"ok, so after poking around a bit more, I actually see an error on the server\r\n\r\n```\r\n File \".../lib/python3.6/_pyio.py\", line 1001, in read\r\n return self._read_unlocked(size)\r\n File \".../lib/python3.6/_pyio.py\", line 1041, in _read_unlocked\r\n chunk = self.raw.read(wanted)\r\n File \".../lib/python3.6/socket.py\", line 586, in readinto\r\n return self._sock.recv_into(b)\r\nConnectionResetError: [Errno 104] Connection reset by peer\r\n```\r\n\r\nThis seems to imply that the **client** is dropping the connection to the server. But I am no longer sure that dropping directly to urllib is going to solve the problem.",
"A workaround that did work was to simply catch the error and retry. I am still not sure whether the client or the server is dropping the connection, and why they are doing so, but hopefully this workaround helps somebody else.\r\n\r\nNote that both the request creation (`requests.post`) and the response read/parse (`response.json()`) are within the try block.\r\n\r\n```python\r\n try:\r\n response = requests.post(self.DATASTORE_URL+\"/datastreams/find_entries/timestamp\", json=post_msg)\r\n print(\"response = %s\" % response)\r\n response.raise_for_status()\r\n ret_list = response.json()[\"phone_data\"]\r\n except Exception as e:\r\n # Hacky copy-paste of original code, TODO refactor into separate function\r\n print(\"Got %s error %s, retrying\" % (type(e).__name__, e))\r\n time.sleep(10)\r\n response = requests.post(self.DATASTORE_URL+\"/datastreams/find_entries/timestamp\", json=post_msg)\r\n print(\"response = %s\" % response)\r\n response.raise_for_status()\r\n ret_list = response.json()[\"phone_data\"]\r\n```",
"Experiencing this same issue as well. It seems to be happening 50% of the time. ",
"+1, experiencing ~35% of the time and I am using urllib3 directly.",
"Experiencing this issue as well. Made an exponential backoff to bypass it but, that seems somewhat hacky.",
"I'm having the same issue. What version is it happening on? Im using 2.21.0",
"@LouisBellinger: Can you eleborate your exponential backoff mechanism to bypass the issue?\r\nStruggling to solve this issue while doing ETL. Loosing 5-10% of the files in movement.",
"Hi to everyone, Any update to this issue? I'm having the same problem. Do you known any hotfix?",
"Is there a workaround?",
"for me, a single retry has worked pretty reliably:\r\nhttps://github.com/MobilityNet/mobilitynet-analysis-scripts/blob/master/emeval/input/spec_details.py#L18\r\n\r\nFor exponential backoff, you would just catch the exceptions multiple times, sleeping longer every time.",
"Any solutions?",
"Hello... The Persistent Connectionts features are not handling the client side when it requested a Connection Keep Alive, because at lease for Linux based OS the TCP Keep Alive Feature is not enabled, or when Enabled it is set to 2 start working after 2 hours, so I found that the problem iis because the OS is not handling the flo control correctly you can fix it in some ways...\r\n\r\nFor Python in Linux\r\n\r\n\r\nimport requests\r\nimport socket\r\n from urllib3.connection import HTTPConnection\r\n HTTPConnection.default_socket_options = HTTPConnection.default_socket_options + [\r\n (socket.SOL_SOCKET, socket.SO_KEEPALIVE, 1) #Enables the feature\r\n ,(socket.SOL_TCP, socket.TCP_KEEPIDLE, 45) #Overrides the time when the stack willl start sending KeppAlives after no data received on a Persistent Connection\r\n ,(socket.SOL_TCP, socket.TCP_KEEPINTVL, 10) #Defines how often thoe KA will be sent between them\r\n ,(socket.SOL_TCP, socket.TCP_KEEPCNT, 6) #How many attemps will your code try if the server goes down before droping the connection.\r\n\r\nnow you can Instanciate your Sessions or Requests..\r\n\r\n\r\nWithout TCP Keep Alive\r\n\r\n\r\nWith TCP Keep Alive\r\n\r\n\r\n\r\nIf the client reach the unhandled session timeout by the server...now the server will close the connection , releasing the connection back to the pool insteadd of dropoing it....\r\n\r\n\r\n\r\n\r\n\r\nThere are some other ways to handle it.. depending on your OS and in your needs...\r\nI hope it solve some of your issues\r\n\r\n",
"I found this but I dont how to handle setsockopt and requests... maybe you know. and will fix ti for all OSs\r\n\r\nhttps://gist.github.com/shi-yan/611cc0221eeff1644797",
"I was also having this issue (and not just on POST requests) while running stress tests of services using locust, which uses requests.\r\n\r\nThe very good investigation and fix provided by @jakermx really did it for me as well:\r\n```python\r\nimport socket\r\nfrom urllib3.connection import HTTPConnection\r\n# ...\r\nHTTPConnection.default_socket_options = (\r\n HTTPConnection.default_socket_options + [\r\n (socket.SOL_SOCKET, socket.SO_KEEPALIVE, 1),\r\n (socket.SOL_TCP, socket.TCP_KEEPIDLE, 45),\r\n (socket.SOL_TCP, socket.TCP_KEEPINTVL, 10),\r\n (socket.SOL_TCP, socket.TCP_KEEPCNT, 6)\r\n ]\r\n)\r\n```\r\nInsert that code just somewhere that gets loaded by your application/script and it will change the `urllib3` default socket options globally.\r\n\r\nThis isn't a bug in requests nor urllib3, since both are offering solutions:\r\n* requests: [keep-alive](https://requests.readthedocs.io/en/stable/user/advanced/#keep-alive) (relies on urllib3)\r\n* urllib3: [HTTPConnections](https://urllib3.readthedocs.io/en/latest/reference/urllib3.connection.html#urllib3.connection.HTTPConnection)\r\n\r\nAlso, urllib3 makes it pretty clear that especially in this case, there is a simple detection issue for automatic handling:\r\n* https://github.com/urllib3/urllib3/issues/944#issuecomment-237471302\r\n",
"By defautl, OS TCP/IP stack defines that the app will stack sending TCP Keep-Alives packes after 2 hours of idle activity, this will only work on OOTB Web Servers Installations, but, if your Content provider set lower limits, the TCP L5/L4 Connection willbe dropped off before 2 hours....and when your app try to used the \"persistent\" connection it will fail due Connection Reset by RemotePeer...caus it is not a valid connection, setting the tcp options will avoind someerrorsm but not all....not matter is you set the connection keep alive header at L7-L4....if the OS dont send KA packets at TCP layer....the only header that will avoid this conditions is Connection:Close\r\n\r\nthis is a app, http friendly API, url m api and IETFissue\r\n\r\n",
"@jakermx you are my hero. Thank you for solution. \r\nI killed almost 2 days trying to fix it. ",
"there is no heros pal,,,,just a great community workforce",
"There are several issues that have been tacked onto the original problem here because people are conflating multiple exceptions. I believe @jakermx has explained what is happening at the TCP level and the urllib3 issue #944 discussing that we're not able to distinguish between a dropped connection and RST has been linked. I'm going to resolve this as there isn't more information to provide at this point."
] |
https://api.github.com/repos/psf/requests/issues/4936
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4936/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4936/comments
|
https://api.github.com/repos/psf/requests/issues/4936/events
|
https://github.com/psf/requests/pull/4936
| 398,602,691 |
MDExOlB1bGxSZXF1ZXN0MjQ0MjQ5MTMy
| 4,936 |
Fix typo
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/9677399?v=4",
"events_url": "https://api.github.com/users/ofek/events{/privacy}",
"followers_url": "https://api.github.com/users/ofek/followers",
"following_url": "https://api.github.com/users/ofek/following{/other_user}",
"gists_url": "https://api.github.com/users/ofek/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/ofek",
"id": 9677399,
"login": "ofek",
"node_id": "MDQ6VXNlcjk2NzczOTk=",
"organizations_url": "https://api.github.com/users/ofek/orgs",
"received_events_url": "https://api.github.com/users/ofek/received_events",
"repos_url": "https://api.github.com/users/ofek/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/ofek/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/ofek/subscriptions",
"type": "User",
"url": "https://api.github.com/users/ofek",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 0 |
2019-01-12T23:33:07Z
|
2021-09-01T00:11:40Z
|
2019-01-12T23:54:22Z
|
CONTRIBUTOR
|
resolved
|
{
"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/4936/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4936/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/4936.diff",
"html_url": "https://github.com/psf/requests/pull/4936",
"merged_at": "2019-01-12T23:54:22Z",
"patch_url": "https://github.com/psf/requests/pull/4936.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/4936"
}
| true |
[] |
|
https://api.github.com/repos/psf/requests/issues/4935
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4935/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4935/comments
|
https://api.github.com/repos/psf/requests/issues/4935/events
|
https://github.com/psf/requests/pull/4935
| 398,476,236 |
MDExOlB1bGxSZXF1ZXN0MjQ0MTY4MzY3
| 4,935 |
Make CA Persistent
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/11529426?v=4",
"events_url": "https://api.github.com/users/AndTheDaysGoBy/events{/privacy}",
"followers_url": "https://api.github.com/users/AndTheDaysGoBy/followers",
"following_url": "https://api.github.com/users/AndTheDaysGoBy/following{/other_user}",
"gists_url": "https://api.github.com/users/AndTheDaysGoBy/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/AndTheDaysGoBy",
"id": 11529426,
"login": "AndTheDaysGoBy",
"node_id": "MDQ6VXNlcjExNTI5NDI2",
"organizations_url": "https://api.github.com/users/AndTheDaysGoBy/orgs",
"received_events_url": "https://api.github.com/users/AndTheDaysGoBy/received_events",
"repos_url": "https://api.github.com/users/AndTheDaysGoBy/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/AndTheDaysGoBy/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/AndTheDaysGoBy/subscriptions",
"type": "User",
"url": "https://api.github.com/users/AndTheDaysGoBy",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 7 |
2019-01-11T22:32:42Z
|
2021-08-30T00:06:42Z
|
2019-08-21T22:46:13Z
|
NONE
|
resolved
|
Was trying to get docker-py working with a remote host, i.e. using a key.pem, cert.pem, and ca.pem. Had SSL issues. Ultimately figured out that it was due to the APIClient being derived from requests.sessions. In particular, even if verify is set for the session, it will not actually be used since the kwargs for the get() are directly passed into the request() method (which defaults verify to None).
As additional info., curling worked when passing the cert.pem, ca.pem, and key.pem, requests worked when merely using requests.get(url, cert=(cert, key), verify=ca), and sessions worked as long as verify was always passed into the get() method, i.e. s.get(url, verify=ca, ...)
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/11529426?v=4",
"events_url": "https://api.github.com/users/AndTheDaysGoBy/events{/privacy}",
"followers_url": "https://api.github.com/users/AndTheDaysGoBy/followers",
"following_url": "https://api.github.com/users/AndTheDaysGoBy/following{/other_user}",
"gists_url": "https://api.github.com/users/AndTheDaysGoBy/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/AndTheDaysGoBy",
"id": 11529426,
"login": "AndTheDaysGoBy",
"node_id": "MDQ6VXNlcjExNTI5NDI2",
"organizations_url": "https://api.github.com/users/AndTheDaysGoBy/orgs",
"received_events_url": "https://api.github.com/users/AndTheDaysGoBy/received_events",
"repos_url": "https://api.github.com/users/AndTheDaysGoBy/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/AndTheDaysGoBy/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/AndTheDaysGoBy/subscriptions",
"type": "User",
"url": "https://api.github.com/users/AndTheDaysGoBy",
"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/4935/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4935/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/4935.diff",
"html_url": "https://github.com/psf/requests/pull/4935",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/4935.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/4935"
}
| true |
[
"By the looks of it, I think the tests aren't passing because the tests expect verify=None (as it would be set in the requests() method should it not be passed into the kwargs from the get()). However, is this the intended behavior desired? Since it's a session, it should be using the self.verify when it isn't explicitly passed into the method. Therefore, under this assumption, wouldn't the tests be testing incorrect behavior since they expect the session's verify to be None as opposed to the session's default (self.verify = True set in the __init__)?\r\n\r\nEdit:\r\nRunning python27 locally. I tried just running pytest on master and it fails due to the MarkDecorator has no len() error (that being the only one).",
"I noticed that there is an actual merge_settings function that is used which supposedly performs the behavior I desire. I will have to look into why it doesn't appear to work for me for verify. I'll open an actual issue once I discover it, and update the proposed solution (if one is needed).",
"thanks!\r\n",
"@kennethreitz Thank you for responding, but it seems this issue was never fixed. I.e., the corresponding issue: https://github.com/psf/requests/issues/4938 had been closed without any discussion or resolution. Luckily, someone else found the same or related issue in: https://github.com/home-assistant/home-assistant-cli/issues/184#issuecomment-466302139\r\nHowever, that issue has gone stale (thankful some activity did occur there, so perhaps this issue has entered the public light more).\r\nI would hope either my fix or any fix for this could be implemented. In that other branch they state stuff about WebSocket API. If waiting for that will fix this, good, but I would hope this issue to be kept in the light somehow.",
"@kennethreitz OK, re-merged with master, however, the CI fails on 2.7 since super() is expecting an argument despite the fact that the present code in master seems to be making use of Python 3.X super(). Since all the other builds pass, I presume my code change to not be the source of the issue--in particular since I've not modified anything in regards super.",
"Actually, it seems this should have worked at some point considering it was 7 years ago that: https://github.com/psf/requests/blob/5bd6009261f4a67f42c3c33870c932ff3b2698df/requests/sessions.py#L629 was added. I can only presume that with the introduction of https://github.com/psf/requests/blob/5bd6009261f4a67f42c3c33870c932ff3b2698df/requests/sessions.py#L527 which merges the verify flag (amongst other things for that matter) that things got out of wack. After all, this makes there to be 2 places where some interaction is going on between the session set values and the passed in values. The original which was in the .send() should have take care of everything since, in theory, back before the merge_settings stuff entered the picture, the fact that `verify` wasn't in the call to `request(...)` would result in it not being in the call to `send(...)` consequently, it would use the default value.\r\n\r\nIn light of this I will state that my current PR just has the .get() fixed, however, these fixes of adding .setdefault() of the verify everywhere is more so a hack fix in light of this new info. The true fix would be to either ensure we don't perform additional magic regarding the passed in value and the default value between the `def request(...)` and the `def send(...)` so that the existing `kwargs.setdefault(...)` in `send` may perform their job as required. The alternative would be to extract said defaults out of `send` and have them exist purely in `requests`. I personally thing the prior to be the better option because I'm unsure how much destruction would occur from taking the `setdefaults` out of `send`. After all, who knows what's calling the `send` function and what is expected to be passed along.\r\n\r\nWhen I get the chance, I'll git rebase this branch and attempt that approach. The issue of Python 2.7 super() though still remains a separate issue though, I believe.\r\n",
"Closing in favor of: https://github.com/psf/requests/pull/5172"
] |
https://api.github.com/repos/psf/requests/issues/4934
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4934/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4934/comments
|
https://api.github.com/repos/psf/requests/issues/4934/events
|
https://github.com/psf/requests/issues/4934
| 398,171,423 |
MDU6SXNzdWUzOTgxNzE0MjM=
| 4,934 |
request memory leak with no session
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/24888835?v=4",
"events_url": "https://api.github.com/users/Flyraty/events{/privacy}",
"followers_url": "https://api.github.com/users/Flyraty/followers",
"following_url": "https://api.github.com/users/Flyraty/following{/other_user}",
"gists_url": "https://api.github.com/users/Flyraty/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Flyraty",
"id": 24888835,
"login": "Flyraty",
"node_id": "MDQ6VXNlcjI0ODg4ODM1",
"organizations_url": "https://api.github.com/users/Flyraty/orgs",
"received_events_url": "https://api.github.com/users/Flyraty/received_events",
"repos_url": "https://api.github.com/users/Flyraty/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Flyraty/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Flyraty/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Flyraty",
"user_view_type": "public"
}
|
[
{
"color": "f7c6c7",
"default": false,
"description": null,
"id": 167537670,
"name": "Propose Close",
"node_id": "MDU6TGFiZWwxNjc1Mzc2NzA=",
"url": "https://api.github.com/repos/psf/requests/labels/Propose%20Close"
},
{
"color": "fef2c0",
"default": false,
"description": null,
"id": 298537994,
"name": "Needs More Information",
"node_id": "MDU6TGFiZWwyOTg1Mzc5OTQ=",
"url": "https://api.github.com/repos/psf/requests/labels/Needs%20More%20Information"
}
] |
open
| false | null |
[] | null | 2 |
2019-01-11T07:55:51Z
|
2019-01-11T16:57:32Z
| null |
NONE
| null |
I use requests lib to monitor live room。In the start, i use request.get() and set connection headers closed, it occured memory leak, the memory would increase 10M per 15~20 minutes and dont down.
Because of live room, it will created 2000w requests per day. i think maybe there exists some requests dont close, but i set the connection header closed. Why is it still existed produced?
In the last, i use request.Session() and keep-alive connection header to solve the problem. i want to know why request.get is bad but session is normal.
There is my code demo
``` python
while true:
headers = {'Connection': 'closed'}
requests.get(url, headers=headers):
# when the live room is closed
if close:
break
```
``` python
session =requests.Session()
while true:
headers = {'Connection': 'keep-alive'}
session.get(url, headers=headers):
# when the live room is closed
if close:
session.close()
break
```
| 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/4934/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4934/timeline
| null | null | null | null | false |
[
"Please provide us with the output of\r\n\r\n```\r\npython -m requests.help\r\n```\r\n\r\nIf that is unavailable on your version of Requests please provide some basic information about your system (Python version, operating system, etc).",
"> Please provide us with the output of\r\n> \r\n> ```\r\n> python -m requests.help\r\n> ```\r\n> If that is unavailable on your version of Requests please provide some basic information about your system (Python version, operating system, etc).\r\n\r\nThis is my request info。I use python3.6.2, mac os 10.14.2 \r\n```\r\n{\r\n \"chardet\": {\r\n \"version\": \"3.0.4\"\r\n },\r\n \"cryptography\": {\r\n \"version\": \"2.2.2\"\r\n },\r\n \"idna\": {\r\n \"version\": \"2.7\"\r\n },\r\n \"implementation\": {\r\n \"name\": \"CPython\",\r\n \"version\": \"3.6.2\"\r\n },\r\n \"platform\": {\r\n \"release\": \"18.2.0\",\r\n \"system\": \"Darwin\"\r\n },\r\n \"pyOpenSSL\": {\r\n \"openssl_version\": \"1010008f\",\r\n \"version\": \"18.0.0\"\r\n },\r\n \"requests\": {\r\n \"version\": \"2.19.1\"\r\n },\r\n \"system_ssl\": {\r\n \"version\": \"100020bf\"\r\n },\r\n \"urllib3\": {\r\n \"version\": \"1.23\"\r\n },\r\n \"using_pyopenssl\": true\r\n}\r\n\r\n```"
] |
https://api.github.com/repos/psf/requests/issues/4933
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4933/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4933/comments
|
https://api.github.com/repos/psf/requests/issues/4933/events
|
https://github.com/psf/requests/pull/4933
| 397,548,894 |
MDExOlB1bGxSZXF1ZXN0MjQzNDcwODI0
| 4,933 |
Fallback for decoding malformed Location headers
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/647359?v=4",
"events_url": "https://api.github.com/users/tomchristie/events{/privacy}",
"followers_url": "https://api.github.com/users/tomchristie/followers",
"following_url": "https://api.github.com/users/tomchristie/following{/other_user}",
"gists_url": "https://api.github.com/users/tomchristie/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/tomchristie",
"id": 647359,
"login": "tomchristie",
"node_id": "MDQ6VXNlcjY0NzM1OQ==",
"organizations_url": "https://api.github.com/users/tomchristie/orgs",
"received_events_url": "https://api.github.com/users/tomchristie/received_events",
"repos_url": "https://api.github.com/users/tomchristie/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/tomchristie/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/tomchristie/subscriptions",
"type": "User",
"url": "https://api.github.com/users/tomchristie",
"user_view_type": "public"
}
|
[] |
closed
| false | null |
[] | null | 1 |
2019-01-09T20:26:32Z
|
2024-08-26T10:17:48Z
|
2024-08-26T10:17:48Z
|
CONTRIBUTOR
| null |
I assume this'd be the most robust way to close off #4926.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/647359?v=4",
"events_url": "https://api.github.com/users/tomchristie/events{/privacy}",
"followers_url": "https://api.github.com/users/tomchristie/followers",
"following_url": "https://api.github.com/users/tomchristie/following{/other_user}",
"gists_url": "https://api.github.com/users/tomchristie/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/tomchristie",
"id": 647359,
"login": "tomchristie",
"node_id": "MDQ6VXNlcjY0NzM1OQ==",
"organizations_url": "https://api.github.com/users/tomchristie/orgs",
"received_events_url": "https://api.github.com/users/tomchristie/received_events",
"repos_url": "https://api.github.com/users/tomchristie/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/tomchristie/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/tomchristie/subscriptions",
"type": "User",
"url": "https://api.github.com/users/tomchristie",
"user_view_type": "public"
}
|
{
"+1": 2,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 2,
"url": "https://api.github.com/repos/psf/requests/issues/4933/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4933/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/4933.diff",
"html_url": "https://github.com/psf/requests/pull/4933",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/4933.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/4933"
}
| true |
[
"I can confirm this actually solves my current redirect issue."
] |
https://api.github.com/repos/psf/requests/issues/4932
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4932/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4932/comments
|
https://api.github.com/repos/psf/requests/issues/4932/events
|
https://github.com/psf/requests/pull/4932
| 397,068,939 |
MDExOlB1bGxSZXF1ZXN0MjQzMTAwOTc2
| 4,932 |
Make requests compliant with PEP 476
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/102495?v=4",
"events_url": "https://api.github.com/users/ssbarnea/events{/privacy}",
"followers_url": "https://api.github.com/users/ssbarnea/followers",
"following_url": "https://api.github.com/users/ssbarnea/following{/other_user}",
"gists_url": "https://api.github.com/users/ssbarnea/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/ssbarnea",
"id": 102495,
"login": "ssbarnea",
"node_id": "MDQ6VXNlcjEwMjQ5NQ==",
"organizations_url": "https://api.github.com/users/ssbarnea/orgs",
"received_events_url": "https://api.github.com/users/ssbarnea/received_events",
"repos_url": "https://api.github.com/users/ssbarnea/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/ssbarnea/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/ssbarnea/subscriptions",
"type": "User",
"url": "https://api.github.com/users/ssbarnea",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 3 |
2019-01-08T20:16:04Z
|
2021-08-31T00:07:18Z
|
2019-01-12T23:52:46Z
|
CONTRIBUTOR
|
resolved
|
Enables loading of certificate bundles from SSL_CERT_FILE or
SSL_CERT_DIR as mentioned in https://legacy.python.org/dev/peps/pep-0476/
Current patch keeps backwards compatibility by preferring the more
specific options and using the new ones only as fallbacks.
Fixes: #2899
|
{
"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/4932/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4932/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/4932.diff",
"html_url": "https://github.com/psf/requests/pull/4932",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/4932.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/4932"
}
| true |
[
"@Lukasa Shouldn't this already have been on master via https://github.com/requests/requests/pull/2903?\r\n\r\nCould it be due to this? https://github.com/requests/requests/commit/85a29f1da0d0ccd79e865a7172ea39a2a7667312",
"@ofek this was merged into the Proposed/3.0.0 branch which isn’t merged with master yet. I’m inclined to uphold the decision Lukasa made the last time this PR was proposed. We’ll treat this as a breaking change because it does have a high probability to break existing setups.\r\n\r\nThanks for the proposal @ssbarnea!",
"Will work REQUESTS_CA_BUNDLE with capath until than too?"
] |
https://api.github.com/repos/psf/requests/issues/4931
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4931/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4931/comments
|
https://api.github.com/repos/psf/requests/issues/4931/events
|
https://github.com/psf/requests/issues/4931
| 396,470,558 |
MDU6SXNzdWUzOTY0NzA1NTg=
| 4,931 |
parse_dict_header should return CaseInsensitiveDict
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/23532559?v=4",
"events_url": "https://api.github.com/users/adiba/events{/privacy}",
"followers_url": "https://api.github.com/users/adiba/followers",
"following_url": "https://api.github.com/users/adiba/following{/other_user}",
"gists_url": "https://api.github.com/users/adiba/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/adiba",
"id": 23532559,
"login": "adiba",
"node_id": "MDQ6VXNlcjIzNTMyNTU5",
"organizations_url": "https://api.github.com/users/adiba/orgs",
"received_events_url": "https://api.github.com/users/adiba/received_events",
"repos_url": "https://api.github.com/users/adiba/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/adiba/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/adiba/subscriptions",
"type": "User",
"url": "https://api.github.com/users/adiba",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 1 |
2019-01-07T12:35:33Z
|
2021-09-06T00:06:35Z
|
2019-01-07T16:50:00Z
|
NONE
|
resolved
|
https://github.com/requests/requests/blob/c501ec986daa4961cd9dee370b5d45ff2e524b37/requests/utils.py#L344-L375
In `parse_dict_header` a regular dict is used, but as stated in the RFC the keys should be case-insensitive.
|
{
"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/4931/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4931/timeline
| null |
completed
| null | null | false |
[
"This isn't really part of our public API and it's not meant for parsing into a headers dictionary. This is working as intended for the purpose it is supporting."
] |
https://api.github.com/repos/psf/requests/issues/4930
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4930/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4930/comments
|
https://api.github.com/repos/psf/requests/issues/4930/events
|
https://github.com/psf/requests/issues/4930
| 396,227,123 |
MDU6SXNzdWUzOTYyMjcxMjM=
| 4,930 |
certificate verify failed for developers.google.com & api.github.com
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/12914499?v=4",
"events_url": "https://api.github.com/users/Giri-Chintala/events{/privacy}",
"followers_url": "https://api.github.com/users/Giri-Chintala/followers",
"following_url": "https://api.github.com/users/Giri-Chintala/following{/other_user}",
"gists_url": "https://api.github.com/users/Giri-Chintala/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Giri-Chintala",
"id": 12914499,
"login": "Giri-Chintala",
"node_id": "MDQ6VXNlcjEyOTE0NDk5",
"organizations_url": "https://api.github.com/users/Giri-Chintala/orgs",
"received_events_url": "https://api.github.com/users/Giri-Chintala/received_events",
"repos_url": "https://api.github.com/users/Giri-Chintala/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Giri-Chintala/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Giri-Chintala/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Giri-Chintala",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 1 |
2019-01-06T04:32:33Z
|
2021-09-06T00:06:35Z
|
2019-01-06T06:11:53Z
|
NONE
|
resolved
|
Summary.
I'm seeing certificate verify failed error on calls to developers.google.com & api.github.com, But calls to aws.amazon.com & azure.microsoft.com are working fine.
## Expected Result
I'm expecting successful TLS handshake with public domains google and github etc
## Actual Result
Got this exception
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/urllib3/contrib/pyopenssl.py", line 453, in wrap_socket
cnx.do_handshake()
File "/usr/local/lib/python3.7/site-packages/OpenSSL/SSL.py", line 1907, in do_handshake
self._raise_ssl_error(self._ssl, result)
File "/usr/local/lib/python3.7/site-packages/OpenSSL/SSL.py", line 1639, in _raise_ssl_error
_raise_current_error()
File "/usr/local/lib/python3.7/site-packages/OpenSSL/_util.py", line 54, in exception_from_error_queue
raise exception_type(errors)
OpenSSL.SSL.Error: [('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')]
## Reproduction Steps
```python
import requests
requests.get('https://aws.amazon.com/')
requests.get('https://api.github.com/users/caspyin')
```
## System Information
$ python -m requests.help
```
{
"chardet": {
"version": "3.0.4"
},
"cryptography": {
"version": "2.4.2"
},
"idna": {
"version": "2.8"
},
"implementation": {
"name": "CPython",
"version": "3.7.2"
},
"platform": {
"release": "18.2.0",
"system": "Darwin"
},
"pyOpenSSL": {
"openssl_version": "101000af",
"version": "18.0.0"
},
"requests": {
"version": "2.21.0"
},
"system_ssl": {
"version": "1000211f"
},
"urllib3": {
"version": "1.24.1"
},
"using_pyopenssl": true
}
```
```
Python 3.7.2 (default, Dec 27 2018, 07:35:06)
[Clang 10.0.0 (clang-1000.11.45.5)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import requests
>>> requests.__version__
'2.21.0'
>>> import certifi
>>> certifi.__version__
'2018.11.29'
>>> import ssl
>>> ssl.OPENSSL_VERSION
'OpenSSL 1.0.2q 20 Nov 2018'
```
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/12914499?v=4",
"events_url": "https://api.github.com/users/Giri-Chintala/events{/privacy}",
"followers_url": "https://api.github.com/users/Giri-Chintala/followers",
"following_url": "https://api.github.com/users/Giri-Chintala/following{/other_user}",
"gists_url": "https://api.github.com/users/Giri-Chintala/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Giri-Chintala",
"id": 12914499,
"login": "Giri-Chintala",
"node_id": "MDQ6VXNlcjEyOTE0NDk5",
"organizations_url": "https://api.github.com/users/Giri-Chintala/orgs",
"received_events_url": "https://api.github.com/users/Giri-Chintala/received_events",
"repos_url": "https://api.github.com/users/Giri-Chintala/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Giri-Chintala/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Giri-Chintala/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Giri-Chintala",
"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/4930/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4930/timeline
| null |
completed
| null | null | false |
[
"I figured it out. google is failing because of an internal proxy."
] |
https://api.github.com/repos/psf/requests/issues/4929
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4929/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4929/comments
|
https://api.github.com/repos/psf/requests/issues/4929/events
|
https://github.com/psf/requests/pull/4929
| 396,218,585 |
MDExOlB1bGxSZXF1ZXN0MjQyNDcwMzMw
| 4,929 |
remove duplicate import
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/33651666?v=4",
"events_url": "https://api.github.com/users/dyq666/events{/privacy}",
"followers_url": "https://api.github.com/users/dyq666/followers",
"following_url": "https://api.github.com/users/dyq666/following{/other_user}",
"gists_url": "https://api.github.com/users/dyq666/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/dyq666",
"id": 33651666,
"login": "dyq666",
"node_id": "MDQ6VXNlcjMzNjUxNjY2",
"organizations_url": "https://api.github.com/users/dyq666/orgs",
"received_events_url": "https://api.github.com/users/dyq666/received_events",
"repos_url": "https://api.github.com/users/dyq666/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/dyq666/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/dyq666/subscriptions",
"type": "User",
"url": "https://api.github.com/users/dyq666",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 4 |
2019-01-06T01:32:55Z
|
2021-08-30T00:06:48Z
|
2019-08-20T04:37:48Z
|
NONE
|
resolved
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4",
"events_url": "https://api.github.com/users/kennethreitz/events{/privacy}",
"followers_url": "https://api.github.com/users/kennethreitz/followers",
"following_url": "https://api.github.com/users/kennethreitz/following{/other_user}",
"gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/kennethreitz",
"id": 119893,
"login": "kennethreitz",
"node_id": "MDQ6VXNlcjExOTg5Mw==",
"organizations_url": "https://api.github.com/users/kennethreitz/orgs",
"received_events_url": "https://api.github.com/users/kennethreitz/received_events",
"repos_url": "https://api.github.com/users/kennethreitz/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions",
"type": "User",
"url": "https://api.github.com/users/kennethreitz",
"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/4929/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4929/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/4929.diff",
"html_url": "https://github.com/psf/requests/pull/4929",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/4929.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/4929"
}
| true |
[
"# [Codecov](https://codecov.io/gh/requests/requests/pull/4929?src=pr&el=h1) Report\n> Merging [#4929](https://codecov.io/gh/requests/requests/pull/4929?src=pr&el=desc) into [master](https://codecov.io/gh/requests/requests/commit/5c1f72e80a7d7ac129631ea5b0c34c7876bc6ed7?src=pr&el=desc) will **increase** coverage by `0.04%`.\n> The diff coverage is `n/a`.\n\n[](https://codecov.io/gh/requests/requests/pull/4929?src=pr&el=tree)\n\n```diff\n@@ Coverage Diff @@\n## master #4929 +/- ##\n==========================================\n+ Coverage 66.89% 66.94% +0.04% \n==========================================\n Files 15 15 \n Lines 1577 1576 -1 \n==========================================\n Hits 1055 1055 \n+ Misses 522 521 -1\n```\n\n\n| [Impacted Files](https://codecov.io/gh/requests/requests/pull/4929?src=pr&el=tree) | Coverage Δ | |\n|---|---|---|\n| [requests/sessions.py](https://codecov.io/gh/requests/requests/pull/4929/diff?src=pr&el=tree#diff-cmVxdWVzdHMvc2Vzc2lvbnMucHk=) | `77.03% <ø> (+0.27%)` | :arrow_up: |\n\n------\n\n[Continue to review full report at Codecov](https://codecov.io/gh/requests/requests/pull/4929?src=pr&el=continue).\n> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)\n> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`\n> Powered by [Codecov](https://codecov.io/gh/requests/requests/pull/4929?src=pr&el=footer). Last update [5c1f72e...06bd141](https://codecov.io/gh/requests/requests/pull/4929?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).\n",
"@dyq666 can you please update your branch",
"@inishchith done",
"tried to re-open to retrigger a build, but can't :("
] |
|
https://api.github.com/repos/psf/requests/issues/4927
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4927/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4927/comments
|
https://api.github.com/repos/psf/requests/issues/4927/events
|
https://github.com/psf/requests/issues/4927
| 395,555,058 |
MDU6SXNzdWUzOTU1NTUwNTg=
| 4,927 |
file named "requests.py" throws AttributeError: module 'requests' has no attribute 'get'
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/24904209?v=4",
"events_url": "https://api.github.com/users/emersxw/events{/privacy}",
"followers_url": "https://api.github.com/users/emersxw/followers",
"following_url": "https://api.github.com/users/emersxw/following{/other_user}",
"gists_url": "https://api.github.com/users/emersxw/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/emersxw",
"id": 24904209,
"login": "emersxw",
"node_id": "MDQ6VXNlcjI0OTA0MjA5",
"organizations_url": "https://api.github.com/users/emersxw/orgs",
"received_events_url": "https://api.github.com/users/emersxw/received_events",
"repos_url": "https://api.github.com/users/emersxw/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/emersxw/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/emersxw/subscriptions",
"type": "User",
"url": "https://api.github.com/users/emersxw",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 4 |
2019-01-03T12:24:30Z
|
2020-02-04T20:24:23Z
|
2019-01-03T14:19:56Z
|
NONE
|
resolved
|
I was playing with requests for a while and I was running into issues
I had a file named requests.py which I was always getting the error:
``` AttributeError: module 'requests' has no attribute 'get' ```
but as soon as I changed the name of the file the error doesn't happen anymore.
|
{
"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": 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/4927/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4927/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.",
"> 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.\r\n\r\nHow's that a request of help at any matter? I am just pointing a possible bug, which is the fact that the code won't work if I have a file named 'requests.py'.\r\n\r\nNever asked for help. Cheers.",
"If you do `print(requests.__file__)` you will notice, that the Python import machinery loaded your `requests.py` file instead of the `requests` library. So this is in fact not a bug.",
"> I was playing with requests for a while and I was running into issues\r\n> \r\n> I had a file named requests.py which I was always getting the error:\r\n> \r\n> `AttributeError: module 'requests' has no attribute 'get'`\r\n> \r\n> but as soon as I changed the name of the file the error doesn't happen anymore.\r\n\r\nHow to change it"
] |
https://api.github.com/repos/psf/requests/issues/4926
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4926/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4926/comments
|
https://api.github.com/repos/psf/requests/issues/4926/events
|
https://github.com/psf/requests/issues/4926
| 395,415,751 |
MDU6SXNzdWUzOTU0MTU3NTE=
| 4,926 |
requests can't properly handle redirects if the response body is encoded in something else than 'utf8'
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/4257505?v=4",
"events_url": "https://api.github.com/users/lukasz-kapica/events{/privacy}",
"followers_url": "https://api.github.com/users/lukasz-kapica/followers",
"following_url": "https://api.github.com/users/lukasz-kapica/following{/other_user}",
"gists_url": "https://api.github.com/users/lukasz-kapica/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/lukasz-kapica",
"id": 4257505,
"login": "lukasz-kapica",
"node_id": "MDQ6VXNlcjQyNTc1MDU=",
"organizations_url": "https://api.github.com/users/lukasz-kapica/orgs",
"received_events_url": "https://api.github.com/users/lukasz-kapica/received_events",
"repos_url": "https://api.github.com/users/lukasz-kapica/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/lukasz-kapica/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/lukasz-kapica/subscriptions",
"type": "User",
"url": "https://api.github.com/users/lukasz-kapica",
"user_view_type": "public"
}
|
[] |
open
| false | null |
[] | null | 17 |
2019-01-02T23:37:23Z
|
2023-03-03T15:21:44Z
| null |
NONE
| null |
Just like in the topic. The response body is encoded in iso-8859-2 and the location happens to contain non-ascii character so that it results in UnicodeDecodeError being thrown.
## Expected Result
Flawless execution of the code.
## Actual Result
UnicodeDecodeError
## Reproduction Steps
```python
import requests
requests.get("http://www.biblia.deon.pl/ksiega.php?id=3")
```
## System Information
$ python -m requests.help
```
{
"chardet": {
"version": "3.0.4"
},
"cryptography": {
"version": "2.3"
},
"idna": {
"version": "2.7"
},
"implementation": {
"name": "CPython",
"version": "2.7.15+"
},
"platform": {
"release": "4.18.0-13-generic",
"system": "Linux"
},
"pyOpenSSL": {
"openssl_version": "1010100f",
"version": "18.0.0"
},
"requests": {
"version": "2.19.0"
},
"system_ssl": {
"version": "1010100f"
},
"urllib3": {
"version": "1.23"
},
"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/4257505?v=4",
"events_url": "https://api.github.com/users/lukasz-kapica/events{/privacy}",
"followers_url": "https://api.github.com/users/lukasz-kapica/followers",
"following_url": "https://api.github.com/users/lukasz-kapica/following{/other_user}",
"gists_url": "https://api.github.com/users/lukasz-kapica/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/lukasz-kapica",
"id": 4257505,
"login": "lukasz-kapica",
"node_id": "MDQ6VXNlcjQyNTc1MDU=",
"organizations_url": "https://api.github.com/users/lukasz-kapica/orgs",
"received_events_url": "https://api.github.com/users/lukasz-kapica/received_events",
"repos_url": "https://api.github.com/users/lukasz-kapica/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/lukasz-kapica/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/lukasz-kapica/subscriptions",
"type": "User",
"url": "https://api.github.com/users/lukasz-kapica",
"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/4926/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4926/timeline
| null | null | null | null | false |
[
"Hi @loocash, would you mind providing the stacktrace so we can see where exactly this is failing?",
"```\r\nTraceback\r\n (most recent call last):\r\n File \"<stdin>\", line 1, in <module>\r\n File \"/usr/lib/python3/dist-packages/requests/api.py\", line 72, in get\r\n return request('get', url, params=params, **kwargs)\r\n File \"/usr/lib/python3/dist-packages/requests/api.py\", line 58, in request\r\n return session.request(method=method, url=url, **kwargs)\r\n File \"/usr/lib/python3/dist-packages/requests/sessions.py\", line 520, in request\r\n resp = self.send(prep, **send_kwargs)\r\n File \"/usr/lib/python3/dist-packages/requests/sessions.py\", line 652, in send\r\n history = [resp for resp in gen] if allow_redirects else []\r\n File \"/usr/lib/python3/dist-packages/requests/sessions.py\", line 652, in <listcomp>\r\n history = [resp for resp in gen] if allow_redirects else []\r\n File \"/usr/lib/python3/dist-packages/requests/sessions.py\", line 141, in resolve_redirects\r\n url = self.get_redirect_target(resp)\r\n File \"/usr/lib/python3/dist-packages/requests/sessions.py\", line 116, in get_redirect_target\r\n return to_native_string(location, 'utf8')\r\n File \"/usr/lib/python3/dist-packages/requests/_internal_utils.py\", line 25, in to_native_string\r\n out = string.decode(encoding)\r\nUnicodeDecodeError: 'utf-8' codec can't decode byte 0xb3 in position 19: invalid start byte\r\n\r\n```",
"The encoding of the response body is irrelevant here. The location header should be strictly ascii encoded. (See eg. https://stackoverflow.com/questions/7654207/what-charset-should-be-used-for-a-location-header-in-a-301-response.)\r\n\r\nRequests will (reasonably enough) decode it as utf8, since it is ascii compatible, and ends up being more robust in practice.\r\n\r\nIn short: The `http://www.biblia.deon.pl/ksiega.php?id=3` address is serving an invalid HTTP response.\r\n\r\n```shell\r\n$ curl -v http://www.biblia.deon.pl/ksiega.php?id=3\r\n* Trying 104.25.144.117...\r\n* TCP_NODELAY set\r\n* Connected to www.biblia.deon.pl (104.25.144.117) port 80 (#0)\r\n> GET /ksiega.php?id=3 HTTP/1.1\r\n> Host: www.biblia.deon.pl\r\n> User-Agent: curl/7.54.0\r\n> Accept: */*\r\n> \r\n< HTTP/1.1 301 Moved Permanently\r\n< Date: Tue, 08 Jan 2019 14:25:32 GMT\r\n< Content-Type: text/html\r\n< Transfer-Encoding: chunked\r\n< Connection: keep-alive\r\n< Set-Cookie: __cfduid=d73c8f399ac453a2e4fe967faaa1251c81546957532; expires=Wed, 08-Jan-20 14:25:32 GMT; path=/; domain=.deon.pl; HttpOnly\r\n< Location: otworz.php?skrot=Kp? 1\r\n< J-Cache: HIT\r\n< Server: cloudflare\r\n< CF-RAY: 495f558234763572-LHR\r\n```\r\n\r\n(As an aside it also doesn't include 'iso-8859-2' in the content-type, so there's really no way to determine what the intended content type of the byte sequence might be)\r\n\r\nRequests *could* decode the header with `errors=\"ignore\"` or something like that, in order to be more robust against malformed headers, but it'd just be masking the issue that the response header is malformed.",
"@tomchristie Thank you for answer. Technically speaking it might not be a bug but I will still maintain that this is an expected behaviour from the library which advertises itself as \"HTTP for Humans\".\r\n\r\nFollowing Python3 code works as expected\r\n\r\n```\r\nimport urllib.request\r\ncontents = urllib.request.urlopen(\"http://www.biblia.deon.pl/ksiega.php?id=3\").read()\r\nprint(contents)\r\n```\r\n\r\nFollowing Go code works as expected\r\n\r\n```\r\npackage main\r\n\r\nimport (\r\n\t\"fmt\"\r\n\t\"io/ioutil\"\r\n\t\"log\"\r\n\t\"net/http\"\r\n)\r\n\r\nfunc main() {\r\n\tresp, err := http.Get(\"http://www.biblia.deon.pl/ksiega.php?id=3\")\r\n\tif err != nil {\r\n\t\tlog.Fatal(err)\r\n\t}\r\n\tdefer resp.Body.Close()\r\n\r\n\tbody, err := ioutil.ReadAll(resp.Body)\r\n\tif err != nil {\r\n\t\tlog.Fatal(err)\r\n\t}\r\n\tfmt.Printf(\"%s\", body)\r\n}\r\n```\r\n\r\nBoth of them use only standard library.",
"So dig into urllib. How does it interpret that byte sequence (where does it redirect to exactly?).\r\nDoes it just ignore malformed bytes in the location header, or does it do something else?\r\n\r\nOne resolution here could be to add an errors=... keyword argument to the to_native_string function, and use “ignore” in the get_redirect_target case. ",
"I’d retitle the issue as “Deal with malformed Location header gracefully”.\r\n\r\nErroring is a perfectly legitimate behaviour here, but ignoring the invalid bits of byte sequences *might* (or might not) be preferable.\r\n",
"Refs #4372",
"I am running into the same issue and in my case the charset (latin-1) is returned in the Content-Type header. Yet I still get the same error.\r\n\r\nI tried the fix from #4933 and that worked for me.",
"Encountered the same issue and can confirm that #4933 worked for me also.",
"So, any chance of getting this merged? I'm dealing with websites with international characters and this \"feature\" is surfacing from time to time interrupting the flow. Browsers deal with malformed location just fine.",
"I have also recently run into this issue and would like to see #4933 merged.",
"Hi, I also faced the same issue, with website having a redirect location having special characters.\r\nAny plan to merge #4933? This will solve my issue.",
"> Any plan to merge #4999?\r\n\r\nI think you meant #4933 :-)\r\n",
"> > Any plan to merge #4999?\r\n> \r\n> I think you meant #4933 :-)\r\n\r\nThanks @StarLightPL. I just corrected my typo...\r\n",
"any news on this #4933 ?",
"It is too dangerous to just re-encode a latin-1 string to utf-8.\r\nWhy a dangerous way to re-encode a string will be \"robust\"?",
"I can confirm that https://github.com/psf/requests/pull/4933 solves the issue in my case. Also bad value on location header for redirect."
] |
https://api.github.com/repos/psf/requests/issues/4925
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4925/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4925/comments
|
https://api.github.com/repos/psf/requests/issues/4925/events
|
https://github.com/psf/requests/issues/4925
| 395,075,983 |
MDU6SXNzdWUzOTUwNzU5ODM=
| 4,925 |
return self._store[key.lower()][1] KeyError: 'content-length'
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/10137?v=4",
"events_url": "https://api.github.com/users/ghost/events{/privacy}",
"followers_url": "https://api.github.com/users/ghost/followers",
"following_url": "https://api.github.com/users/ghost/following{/other_user}",
"gists_url": "https://api.github.com/users/ghost/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/ghost",
"id": 10137,
"login": "ghost",
"node_id": "MDQ6VXNlcjEwMTM3",
"organizations_url": "https://api.github.com/users/ghost/orgs",
"received_events_url": "https://api.github.com/users/ghost/received_events",
"repos_url": "https://api.github.com/users/ghost/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/ghost/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/ghost/subscriptions",
"type": "User",
"url": "https://api.github.com/users/ghost",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 2 |
2019-01-01T11:43:37Z
|
2021-09-06T00:06:36Z
|
2019-01-01T13:21:24Z
|
NONE
|
resolved
|
I cannot seem to **constantly** reproduce this bug entirely but, sometimes the header 'content-length' is not present 🤔 whereas, other times it is.
Am I doing something wrong myself?
## Expected Result
The header 'content-length' to be present.
## Actual Result
```
File "/Users/db/github/Wallie/utils.py", line 18, in download_image
total_size = int(resp.headers["content-length"])
File "/Users/db/.local/share/virtualenvs/Wallie-iUwYi7jQ/lib/python3.7/site-packages/requests/structures.py", line 52, in __getitem__
return self._store[key.lower()][1]
KeyError: 'content-length'
```
## Reproduction Steps
```python
import requests
url = "https://images.unsplash.com/photo-1507608869274-d3177c8bb4c7?ixlib=rb-1.2.1&q=85&fm=jpg&crop=entropy&cs=srgb&ixid=eyJhcHBfaWQiOjQ2NTE2fQ"
with requests.get(image_url, stream=True) as resp:
if ((resp.status_code) == (requests.codes.ok)):
total_size = resp.headers["content-length"]
```
## System Information
$ python -m requests.help
```
{
"chardet": {
"version": "3.0.4"
},
"cryptography": {
"version": ""
},
"idna": {
"version": "2.8"
},
"implementation": {
"name": "CPython",
"version": "3.7.1"
},
"platform": {
"release": "18.2.0",
"system": "Darwin"
},
"pyOpenSSL": {
"openssl_version": "",
"version": null
},
"requests": {
"version": "2.21.0"
},
"system_ssl": {
"version": "1000211f"
},
"urllib3": {
"version": "1.24.1"
},
"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/4925/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4925/timeline
| null |
completed
| null | null | false |
[
"> I cannot seem to constantly reproduce this bug entirely but, sometimes the header 'content-length' is not present \r\n\r\nIt's entirely likely that the content you're retrieving is behind a CDN. In one case, the CDN has it cached and you've hit the cache and so it provides a `Content-Length`, and in the other it's a cache miss so it streams it to you with `Transfer-Encoding: chunked` which means there is no `Content-Length` header. \r\n\r\n> Am I doing something wrong myself?\r\n\r\nIn using Requests, no. In understanding how you may receive data, a little. You're not guaranteed nor should you rely on always having a `Content-Length` header. In reality, many headers are optional or mutually exclusive. For example, in this case, it's entirely likely that when there is no `Content-Length` header you're receiving a `Transfer-Encoding` header with the value of `chunked`. In this case you'll want to do something like:\r\n\r\n\r\n```py\r\nis_chunked = resp.headers.get('transfer-encoding', '') == 'chunked'\r\ncontent_length_s = resp.headers.get('content-length')\r\nif not is_chunked and content_length_s.isdigit():\r\n content_length = int(content_length_s)\r\nelse:\r\n content_length = None\r\n```",
"Cool! Thank you for the explaination! @sigmavirus24 "
] |
https://api.github.com/repos/psf/requests/issues/4924
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4924/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4924/comments
|
https://api.github.com/repos/psf/requests/issues/4924/events
|
https://github.com/psf/requests/pull/4924
| 395,030,581 |
MDExOlB1bGxSZXF1ZXN0MjQxNjAwMzcx
| 4,924 |
Include Python Information with default User Agent
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/3005596?v=4",
"events_url": "https://api.github.com/users/cooperlees/events{/privacy}",
"followers_url": "https://api.github.com/users/cooperlees/followers",
"following_url": "https://api.github.com/users/cooperlees/following{/other_user}",
"gists_url": "https://api.github.com/users/cooperlees/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/cooperlees",
"id": 3005596,
"login": "cooperlees",
"node_id": "MDQ6VXNlcjMwMDU1OTY=",
"organizations_url": "https://api.github.com/users/cooperlees/orgs",
"received_events_url": "https://api.github.com/users/cooperlees/received_events",
"repos_url": "https://api.github.com/users/cooperlees/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/cooperlees/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/cooperlees/subscriptions",
"type": "User",
"url": "https://api.github.com/users/cooperlees",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 1 |
2018-12-31T20:52:57Z
|
2021-09-01T00:11:40Z
|
2018-12-31T21:05:49Z
|
NONE
|
resolved
|
- A lot of people use default user agent with requests
- Lets include Python runtime + version information
- Allows servers to know some more useful information about their users e.g. PyPI / Warehouse
This will help pypistats.org for example - https://github.com/crflynn/pypistats.org/issues/13
Open to other ideas here. Just throwing this up to start the discussion.
|
{
"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/4924/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4924/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/4924.diff",
"html_url": "https://github.com/psf/requests/pull/4924",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/4924.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/4924"
}
| true |
[
"- https://github.com/requests/requests/pull/709\r\n- https://github.com/requests/requests/pull/2803\r\n- https://github.com/requests/requests/issues/2785\r\n- https://github.com/requests/requests/issues/3182\r\n\r\nIn short, we used to include that and now don't. And we won't be adding it back in any time soon"
] |
https://api.github.com/repos/psf/requests/issues/4923
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4923/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4923/comments
|
https://api.github.com/repos/psf/requests/issues/4923/events
|
https://github.com/psf/requests/issues/4923
| 394,975,749 |
MDU6SXNzdWUzOTQ5NzU3NDk=
| 4,923 |
Requests 2.21.0 doesn't recognise unicode filenames for uploads
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/45915502?v=4",
"events_url": "https://api.github.com/users/Shellyber/events{/privacy}",
"followers_url": "https://api.github.com/users/Shellyber/followers",
"following_url": "https://api.github.com/users/Shellyber/following{/other_user}",
"gists_url": "https://api.github.com/users/Shellyber/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Shellyber",
"id": 45915502,
"login": "Shellyber",
"node_id": "MDQ6VXNlcjQ1OTE1NTAy",
"organizations_url": "https://api.github.com/users/Shellyber/orgs",
"received_events_url": "https://api.github.com/users/Shellyber/received_events",
"repos_url": "https://api.github.com/users/Shellyber/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Shellyber/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Shellyber/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Shellyber",
"user_view_type": "public"
}
|
[
{
"color": "f7c6c7",
"default": false,
"description": null,
"id": 167537670,
"name": "Propose Close",
"node_id": "MDU6TGFiZWwxNjc1Mzc2NzA=",
"url": "https://api.github.com/repos/psf/requests/labels/Propose%20Close"
},
{
"color": "fef2c0",
"default": false,
"description": null,
"id": 298537994,
"name": "Needs More Information",
"node_id": "MDU6TGFiZWwyOTg1Mzc5OTQ=",
"url": "https://api.github.com/repos/psf/requests/labels/Needs%20More%20Information"
}
] |
closed
| true | null |
[] | null | 9 |
2018-12-31T12:47:17Z
|
2021-09-06T00:06:36Z
|
2018-12-31T15:58:24Z
|
NONE
|
resolved
|
In python 2 unicode filenames are not recognized.
When trying to send a file with a file name containing unicode chars (e.g. ", Γ etc) the request is sent without the file.
## Expected Result
The request is sent containing the file
## Actual Result
The request is sent without the file
## Reproduction Steps
```python
import requests
f= open('/<file-path>/sample-Γ.pdf','rb')
r = requests.request('POST',URL, files={'sample': f})
```
## System Information
$ python -m requests.help
```
{
"chardet": {
"version": "3.0.4"
},
"cryptography": {
"version": ""
},
"idna": {
"version": "2.8"
},
"implementation": {
"name": "CPython",
"version": "2.7.10"
},
"platform": {
"release": "17.7.0",
"system": "Darwin"
},
"pyOpenSSL": {
"openssl_version": "",
"version": null
},
"requests": {
"version": "2.21.0"
},
"system_ssl": {
"version": "20000000"
},
"urllib3": {
"version": "1.24.1"
},
"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/4923/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4923/timeline
| null |
completed
| null | null | false |
[
"How did you verify there's no request body?\r\n\r\nEverything you provided works locally for me so it's most likely your server that's misbehaving.",
"We tested it via postman prior to opening this issue - when using postman, the server received the file containing the unicode char in its name with no issues, however when we used requests package (for python 2), we were able to send a file that does not contain any unicode chars in its file name, however when we tried sending a file with a unicode char in its name we faced the issues described above - the file was not received in the server.\r\n\r\nThis behavior reproduces across multiple systems, operating systems and networks, so it's unlikely this is due to a local configuration...\r\n\r\nThe verification was done in the server - whenever we sent a request without a file we'd receive an error code in the response. It should be noted the file was accessed via a key ('sample'), and not directly in the body - it's possible this issue is related to the key.",
"That's hardly enough information to be helpful here. Also, the issues states it was sent without the file, but it doesn't seem you verified that via `r.request.body`\r\n\r\nCould you verify this against some other server, e.g., httpbin.org?",
"Sure thing, will do it now",
"The response was as follows (using response.json()):\r\n```\r\n{u'files': {u'sample': u''}, u'origin': u'172.17.0.1', u'form': {}, u'url': u'http://localhost/post', u'args': {}, u'headers': {u'Content-Length': u'161', u'Accept-Encoding': u'gzip, deflate', u'Host': u'localhost', u'Accept': u'*/*', u'User-Agent': u'python-requests/2.19.1', u'Connection': u'keep-alive', u'Content-Type': u'multipart/form-data; boundary=8b7752cc729c052ab5db28697b545503'}, u'json': None, u'data': u''}\r\n```\r\nThe response for the same file using postman was:\r\n```\r\n{\r\n \"args\": {},\r\n \"data\": \"\",\r\n \"files\": {\r\n \"sample\": \"data:application/pdf;base64,JVBERi0xLjMNCiXi48/TDQoNCjEgMCBvYmoNCjw8DQovVHlwZSAvQ2F0YWxvZw0KL091dGxpbmVzIDIgMCBSDQovUGFnZXMgMyAwIFINCj4+DQplbmRvYmoNCg0KMiAwIG9iag0KPDwNCi9UeXBlIC9PdXRsaW5lcw0KL0NvdW50IDANCj4+DQplbmRvYmoNCg0KMyAwIG9iag0KPDwNCi9UeXBlIC9QYWdlcw0KL0NvdW50IDINCi9LaWRzIFsgNCAwIFIgNiAwIFIgXSANCj4+DQplbmRvYmoNCg0KNCAwIG9iag0KPDwNCi9UeXBlIC9QYWdlDQovUGFyZW50IDMgMCBSDQovUmVzb3VyY2VzIDw8DQovRm9udCA8PA0KL0YxIDkgMCBSIA0KPj4NCi9Qcm9jU2V0IDggMCBSDQo+Pg0KL01lZGlhQm94IFswIDAgNjEyLjAwMDAgNzkyLjAwMDBdDQovQ29udGVudHMgNSAwIFINCj4+DQplbmRvYmoNCg0KNSAwIG9iag0KPDwgL0xlbmd0aCAxMDc0ID4+DQpzdHJlYW0NCjIgSg0KQlQNCjAgMCAwIHJnDQovRjEgMDAyNyBUZg0KNTcuMzc1MCA3MjIuMjgwMCBUZA0KKCBBIFNpbXBsZSBQREYgRmlsZSApIFRqDQpFVA0KQlQNCi9GMSAwMDEwIFRmDQo2OS4yNTAwIDY4OC42MDgwIFRkDQooIFRoaXMgaXMgYSBzbWFsbCBkZW1vbnN0cmF0aW9uIC5wZGYgZmlsZSAtICkgVGoNCkVUDQpCVA0KL0YxIDAwMTAgVGYNCjY5LjI1MDAgNjY0LjcwNDAgVGQNCigganVzdCBmb3IgdXNlIGluIHRoZSBWaXJ0dWFsIE1lY2hhbmljcyB0dXRvcmlhbHMuIE1vcmUgdGV4dC4gQW5kIG1vcmUgKSBUag0KRVQNCkJUDQovRjEgMDAxMCBUZg0KNjkuMjUwMCA2NTIuNzUyMCBUZA0KKCB0ZXh0LiBBbmQgbW9yZSB0ZXh0LiBBbmQgbW9yZSB0ZXh0LiBBbmQgbW9yZSB0ZXh0LiApIFRqDQpFVA0KQlQNCi9GMSAwMDEwIFRmDQo2OS4yNTAwIDYyOC44NDgwIFRkDQooIEFuZCBtb3JlIHRleHQuIEFuZCBtb3JlIHRleHQuIEFuZCBtb3JlIHRleHQuIEFuZCBtb3JlIHRleHQuIEFuZCBtb3JlICkgVGoNCkVUDQpCVA0KL0YxIDAwMTAgVGYNCjY5LjI1MDAgNjE2Ljg5NjAgVGQNCiggdGV4dC4gQW5kIG1vcmUgdGV4dC4gQm9yaW5nLCB6enp6ei4gQW5kIG1vcmUgdGV4dC4gQW5kIG1vcmUgdGV4dC4gQW5kICkgVGoNCkVUDQpCVA0KL0YxIDAwMTAgVGYNCjY5LjI1MDAgNjA0Ljk0NDAgVGQNCiggbW9yZSB0ZXh0LiBBbmQgbW9yZSB0ZXh0LiBBbmQgbW9yZSB0ZXh0LiBBbmQgbW9yZSB0ZXh0LiBBbmQgbW9yZSB0ZXh0LiApIFRqDQpFVA0KQlQNCi9GMSAwMDEwIFRmDQo2OS4yNTAwIDU5Mi45OTIwIFRkDQooIEFuZCBtb3JlIHRleHQuIEFuZCBtb3JlIHRleHQuICkgVGoNCkVUDQpCVA0KL0YxIDAwMTAgVGYNCjY5LjI1MDAgNTY5LjA4ODAgVGQNCiggQW5kIG1vcmUgdGV4dC4gQW5kIG1vcmUgdGV4dC4gQW5kIG1vcmUgdGV4dC4gQW5kIG1vcmUgdGV4dC4gQW5kIG1vcmUgKSBUag0KRVQNCkJUDQovRjEgMDAxMCBUZg0KNjkuMjUwMCA1NTcuMTM2MCBUZA0KKCB0ZXh0LiBBbmQgbW9yZSB0ZXh0LiBBbmQgbW9yZSB0ZXh0LiBFdmVuIG1vcmUuIENvbnRpbnVlZCBvbiBwYWdlIDIgLi4uKSBUag0KRVQNCmVuZHN0cmVhbQ0KZW5kb2JqDQoNCjYgMCBvYmoNCjw8DQovVHlwZSAvUGFnZQ0KL1BhcmVudCAzIDAgUg0KL1Jlc291cmNlcyA8PA0KL0ZvbnQgPDwNCi9GMSA5IDAgUiANCj4+DQovUHJvY1NldCA4IDAgUg0KPj4NCi9NZWRpYUJveCBbMCAwIDYxMi4wMDAwIDc5Mi4wMDAwXQ0KL0NvbnRlbnRzIDcgMCBSDQo+Pg0KZW5kb2JqDQoNCjcgMCBvYmoNCjw8IC9MZW5ndGggNjc2ID4+DQpzdHJlYW0NCjIgSg0KQlQNCjAgMCAwIHJnDQovRjEgMDAyNyBUZg0KNTcuMzc1MCA3MjIuMjgwMCBUZA0KKCBTaW1wbGUgUERGIEZpbGUgMiApIFRqDQpFVA0KQlQNCi9GMSAwMDEwIFRmDQo2OS4yNTAwIDY4OC42MDgwIFRkDQooIC4uLmNvbnRpbnVlZCBmcm9tIHBhZ2UgMS4gWWV0IG1vcmUgdGV4dC4gQW5kIG1vcmUgdGV4dC4gQW5kIG1vcmUgdGV4dC4gKSBUag0KRVQNCkJUDQovRjEgMDAxMCBUZg0KNjkuMjUwMCA2NzYuNjU2MCBUZA0KKCBBbmQgbW9yZSB0ZXh0LiBBbmQgbW9yZSB0ZXh0LiBBbmQgbW9yZSB0ZXh0LiBBbmQgbW9yZSB0ZXh0LiBBbmQgbW9yZSApIFRqDQpFVA0KQlQNCi9GMSAwMDEwIFRmDQo2OS4yNTAwIDY2NC43MDQwIFRkDQooIHRleHQuIE9oLCBob3cgYm9yaW5nIHR5cGluZyB0aGlzIHN0dWZmLiBCdXQgbm90IGFzIGJvcmluZyBhcyB3YXRjaGluZyApIFRqDQpFVA0KQlQNCi9GMSAwMDEwIFRmDQo2OS4yNTAwIDY1Mi43NTIwIFRkDQooIHBhaW50IGRyeS4gQW5kIG1vcmUgdGV4dC4gQW5kIG1vcmUgdGV4dC4gQW5kIG1vcmUgdGV4dC4gQW5kIG1vcmUgdGV4dC4gKSBUag0KRVQNCkJUDQovRjEgMDAxMCBUZg0KNjkuMjUwMCA2NDAuODAwMCBUZA0KKCBCb3JpbmcuICBNb3JlLCBhIGxpdHRsZSBtb3JlIHRleHQuIFRoZSBlbmQsIGFuZCBqdXN0IGFzIHdlbGwuICkgVGoNCkVUDQplbmRzdHJlYW0NCmVuZG9iag0KDQo4IDAgb2JqDQpbL1BERiAvVGV4dF0NCmVuZG9iag0KDQo5IDAgb2JqDQo8PA0KL1R5cGUgL0ZvbnQNCi9TdWJ0eXBlIC9UeXBlMQ0KL05hbWUgL0YxDQovQmFzZUZvbnQgL0hlbHZldGljYQ0KL0VuY29kaW5nIC9XaW5BbnNpRW5jb2RpbmcNCj4+DQplbmRvYmoNCg0KMTAgMCBvYmoNCjw8DQovQ3JlYXRvciAoUmF2ZSBcKGh0dHA6Ly93d3cubmV2cm9uYS5jb20vcmF2ZVwpKQ0KL1Byb2R1Y2VyIChOZXZyb25hIERlc2lnbnMpDQovQ3JlYXRpb25EYXRlIChEOjIwMDYwMzAxMDcyODI2KQ0KPj4NCmVuZG9iag0KDQp4cmVmDQowIDExDQowMDAwMDAwMDAwIDY1NTM1IGYNCjAwMDAwMDAwMTkgMDAwMDAgbg0KMDAwMDAwMDA5MyAwMDAwMCBuDQowMDAwMDAwMTQ3IDAwMDAwIG4NCjAwMDAwMDAyMjIgMDAwMDAgbg0KMDAwMDAwMDM5MCAwMDAwMCBuDQowMDAwMDAxNTIyIDAwMDAwIG4NCjAwMDAwMDE2OTAgMDAwMDAgbg0KMDAwMDAwMjQyMyAwMDAwMCBuDQowMDAwMDAyNDU2IDAwMDAwIG4NCjAwMDAwMDI1NzQgMDAwMDAgbg0KDQp0cmFpbGVyDQo8PA0KL1NpemUgMTENCi9Sb290IDEgMCBSDQovSW5mbyAxMCAwIFINCj4+DQoNCnN0YXJ0eHJlZg0KMjcxNA0KJSVFT0YNCg==\"\r\n },\r\n \"form\": {},\r\n \"headers\": {\r\n \"Accept\": \"application/json\",\r\n \"Accept-Encoding\": \"gzip, deflate\",\r\n \"Cache-Control\": \"no-cache\",\r\n \"Connection\": \"keep-alive\",\r\n \"Content-Length\": \"3246\",\r\n \"Content-Type\": \"multipart/form-data; boundary=--------------------------554121099512621829342169\",\r\n \"Host\": \"localhost:80\",\r\n \"Postman-Token\": \"4adf795c-00f7-454b-b9a8-1876ae65e33d\",\r\n \"User-Agent\": \"PostmanRuntime/7.4.0\",\r\n \"X-Api-Key\": \"da758758d5c44f9687263f05a855054e\",\r\n \"X-Api-Secret\": \"21f6aa272a2926c7fc691769927416c0c4957da507fb4ff2105bd161581f5b1e\"\r\n },\r\n \"json\": null,\r\n \"origin\": \"172.17.0.1\",\r\n \"url\": \"http://localhost:80/post\"\r\n}\r\n```\r\n\r\nThe file we used is this one:\r\n[sample-Γ.pdf](https://github.com/requests/requests/files/2718454/sample-.pdf)\r\n",
"And what do you see in `response.request.body`?",
"I ask because\r\n\r\n```\r\nPython 2.7.15 (default, Oct 15 2018, 15:26:09) \r\n[GCC 8.2.1 20180801 (Red Hat 8.2.1-2)] on linux2\r\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\r\n>>> import requests\r\n>>> fd = open('./sample-Γ.pdf', 'rb')\r\n>>> r = requests.post('https://httpbin.org/post', files={'sample': fd})\r\n>>> r.json()['files']\r\n{u'sample': u'data:application/octet-stream;base64,JVBERi0xLjMNCiXi48/TDQoNCjEgMCBvYmoNCjw8DQovVHlwZSAvQ2F0YWxvZw0KL091dGxpbmVzIDIgMCBSDQovUGFnZXMgMyAwIFINCj4+DQplbmRvYmoNCg0KMiAwIG9iag0KPDwNCi9UeXBlIC9PdXRsaW5lcw0KL0NvdW50IDANCj4+DQplbmRvYmoNCg0KMyAwIG9iag0KPDwNCi9UeXBlIC9QYWdlcw0KL0NvdW50IDINCi9LaWRzIFsgNCAwIFIgNiAwIFIgXSANCj4+DQplbmRvYmoNCg0KNCAwIG9iag0KPDwNCi9UeXBlIC9QYWdlDQovUGFyZW50IDMgMCBSDQovUmVzb3VyY2VzIDw8DQovRm9udCA8PA0KL0YxIDkgMCBSIA0KPj4NCi9Qcm9jU2V0IDggMCBSDQo+Pg0KL01lZGlhQm94IFswIDAgNjEyLjAwMDAgNzkyLjAwMDBdDQovQ29udGVudHMgNSAwIFINCj4+DQplbmRvYmoNCg0KNSAwIG9iag0KPDwgL0xlbmd0aCAxMDc0ID4+DQpzdHJlYW0NCjIgSg0KQlQNCjAgMCAwIHJnDQovRjEgMDAyNyBUZg0KNTcuMzc1MCA3MjIuMjgwMCBUZA0KKCBBIFNpbXBsZSBQREYgRmlsZSApIFRqDQpFVA0KQlQNCi9GMSAwMDEwIFRmDQo2OS4yNTAwIDY4OC42MDgwIFRkDQooIFRoaXMgaXMgYSBzbWFsbCBkZW1vbnN0cmF0aW9uIC5wZGYgZmlsZSAtICkgVGoNCkVUDQpCVA0KL0YxIDAwMTAgVGYNCjY5LjI1MDAgNjY0LjcwNDAgVGQNCigganVzdCBmb3IgdXNlIGluIHRoZSBWaXJ0dWFsIE1lY2hhbmljcyB0dXRvcmlhbHMuIE1vcmUgdGV4dC4gQW5kIG1vcmUgKSBUag0KRVQNCkJUDQovRjEgMDAxMCBUZg0KNjkuMjUwMCA2NTIuNzUyMCBUZA0KKCB0ZXh0LiBBbmQgbW9yZSB0ZXh0LiBBbmQgbW9yZSB0ZXh0LiBBbmQgbW9yZSB0ZXh0LiApIFRqDQpFVA0KQlQNCi9GMSAwMDEwIFRmDQo2OS4yNTAwIDYyOC44NDgwIFRkDQooIEFuZCBtb3JlIHRleHQuIEFuZCBtb3JlIHRleHQuIEFuZCBtb3JlIHRleHQuIEFuZCBtb3JlIHRleHQuIEFuZCBtb3JlICkgVGoNCkVUDQpCVA0KL0YxIDAwMTAgVGYNCjY5LjI1MDAgNjE2Ljg5NjAgVGQNCiggdGV4dC4gQW5kIG1vcmUgdGV4dC4gQm9yaW5nLCB6enp6ei4gQW5kIG1vcmUgdGV4dC4gQW5kIG1vcmUgdGV4dC4gQW5kICkgVGoNCkVUDQpCVA0KL0YxIDAwMTAgVGYNCjY5LjI1MDAgNjA0Ljk0NDAgVGQNCiggbW9yZSB0ZXh0LiBBbmQgbW9yZSB0ZXh0LiBBbmQgbW9yZSB0ZXh0LiBBbmQgbW9yZSB0ZXh0LiBBbmQgbW9yZSB0ZXh0LiApIFRqDQpFVA0KQlQNCi9GMSAwMDEwIFRmDQo2OS4yNTAwIDU5Mi45OTIwIFRkDQooIEFuZCBtb3JlIHRleHQuIEFuZCBtb3JlIHRleHQuICkgVGoNCkVUDQpCVA0KL0YxIDAwMTAgVGYNCjY5LjI1MDAgNTY5LjA4ODAgVGQNCiggQW5kIG1vcmUgdGV4dC4gQW5kIG1vcmUgdGV4dC4gQW5kIG1vcmUgdGV4dC4gQW5kIG1vcmUgdGV4dC4gQW5kIG1vcmUgKSBUag0KRVQNCkJUDQovRjEgMDAxMCBUZg0KNjkuMjUwMCA1NTcuMTM2MCBUZA0KKCB0ZXh0LiBBbmQgbW9yZSB0ZXh0LiBBbmQgbW9yZSB0ZXh0LiBFdmVuIG1vcmUuIENvbnRpbnVlZCBvbiBwYWdlIDIgLi4uKSBUag0KRVQNCmVuZHN0cmVhbQ0KZW5kb2JqDQoNCjYgMCBvYmoNCjw8DQovVHlwZSAvUGFnZQ0KL1BhcmVudCAzIDAgUg0KL1Jlc291cmNlcyA8PA0KL0ZvbnQgPDwNCi9GMSA5IDAgUiANCj4+DQovUHJvY1NldCA4IDAgUg0KPj4NCi9NZWRpYUJveCBbMCAwIDYxMi4wMDAwIDc5Mi4wMDAwXQ0KL0NvbnRlbnRzIDcgMCBSDQo+Pg0KZW5kb2JqDQoNCjcgMCBvYmoNCjw8IC9MZW5ndGggNjc2ID4+DQpzdHJlYW0NCjIgSg0KQlQNCjAgMCAwIHJnDQovRjEgMDAyNyBUZg0KNTcuMzc1MCA3MjIuMjgwMCBUZA0KKCBTaW1wbGUgUERGIEZpbGUgMiApIFRqDQpFVA0KQlQNCi9GMSAwMDEwIFRmDQo2OS4yNTAwIDY4OC42MDgwIFRkDQooIC4uLmNvbnRpbnVlZCBmcm9tIHBhZ2UgMS4gWWV0IG1vcmUgdGV4dC4gQW5kIG1vcmUgdGV4dC4gQW5kIG1vcmUgdGV4dC4gKSBUag0KRVQNCkJUDQovRjEgMDAxMCBUZg0KNjkuMjUwMCA2NzYuNjU2MCBUZA0KKCBBbmQgbW9yZSB0ZXh0LiBBbmQgbW9yZSB0ZXh0LiBBbmQgbW9yZSB0ZXh0LiBBbmQgbW9yZSB0ZXh0LiBBbmQgbW9yZSApIFRqDQpFVA0KQlQNCi9GMSAwMDEwIFRmDQo2OS4yNTAwIDY2NC43MDQwIFRkDQooIHRleHQuIE9oLCBob3cgYm9yaW5nIHR5cGluZyB0aGlzIHN0dWZmLiBCdXQgbm90IGFzIGJvcmluZyBhcyB3YXRjaGluZyApIFRqDQpFVA0KQlQNCi9GMSAwMDEwIFRmDQo2OS4yNTAwIDY1Mi43NTIwIFRkDQooIHBhaW50IGRyeS4gQW5kIG1vcmUgdGV4dC4gQW5kIG1vcmUgdGV4dC4gQW5kIG1vcmUgdGV4dC4gQW5kIG1vcmUgdGV4dC4gKSBUag0KRVQNCkJUDQovRjEgMDAxMCBUZg0KNjkuMjUwMCA2NDAuODAwMCBUZA0KKCBCb3JpbmcuICBNb3JlLCBhIGxpdHRsZSBtb3JlIHRleHQuIFRoZSBlbmQsIGFuZCBqdXN0IGFzIHdlbGwuICkgVGoNCkVUDQplbmRzdHJlYW0NCmVuZG9iag0KDQo4IDAgb2JqDQpbL1BERiAvVGV4dF0NCmVuZG9iag0KDQo5IDAgb2JqDQo8PA0KL1R5cGUgL0ZvbnQNCi9TdWJ0eXBlIC9UeXBlMQ0KL05hbWUgL0YxDQovQmFzZUZvbnQgL0hlbHZldGljYQ0KL0VuY29kaW5nIC9XaW5BbnNpRW5jb2RpbmcNCj4+DQplbmRvYmoNCg0KMTAgMCBvYmoNCjw8DQovQ3JlYXRvciAoUmF2ZSBcKGh0dHA6Ly93d3cubmV2cm9uYS5jb20vcmF2ZVwpKQ0KL1Byb2R1Y2VyIChOZXZyb25hIERlc2lnbnMpDQovQ3JlYXRpb25EYXRlIChEOjIwMDYwMzAxMDcyODI2KQ0KPj4NCmVuZG9iag0KDQp4cmVmDQowIDExDQowMDAwMDAwMDAwIDY1NTM1IGYNCjAwMDAwMDAwMTkgMDAwMDAgbg0KMDAwMDAwMDA5MyAwMDAwMCBuDQowMDAwMDAwMTQ3IDAwMDAwIG4NCjAwMDAwMDAyMjIgMDAwMDAgbg0KMDAwMDAwMDM5MCAwMDAwMCBuDQowMDAwMDAxNTIyIDAwMDAwIG4NCjAwMDAwMDE2OTAgMDAwMDAgbg0KMDAwMDAwMjQyMyAwMDAwMCBuDQowMDAwMDAyNDU2IDAwMDAwIG4NCjAwMDAwMDI1NzQgMDAwMDAgbg0KDQp0cmFpbGVyDQo8PA0KL1NpemUgMTENCi9Sb290IDEgMCBSDQovSW5mbyAxMCAwIFINCj4+DQoNCnN0YXJ0eHJlZg0KMjcxNA0KJSVFT0YNCg=='}\r\n>>> print(requests.__version__)\r\n2.21.0\r\n```",
"Also your User-Agent says:\r\n\r\n```\r\n u'User-Agent': u'python-requests/2.19.1'\r\n```\r\n\r\nWhich seems like this is more a problem with something in your environment",
"You are right, once I updated the package to version 2.21 the issue was resolved...\r\n\r\nYou can close this issue."
] |
https://api.github.com/repos/psf/requests/issues/4922
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4922/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4922/comments
|
https://api.github.com/repos/psf/requests/issues/4922/events
|
https://github.com/psf/requests/pull/4922
| 394,805,059 |
MDExOlB1bGxSZXF1ZXN0MjQxNDUyNDE2
| 4,922 |
Remove unnecessary compat shim for OrderedDict
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/347634?v=4",
"events_url": "https://api.github.com/users/jdufresne/events{/privacy}",
"followers_url": "https://api.github.com/users/jdufresne/followers",
"following_url": "https://api.github.com/users/jdufresne/following{/other_user}",
"gists_url": "https://api.github.com/users/jdufresne/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/jdufresne",
"id": 347634,
"login": "jdufresne",
"node_id": "MDQ6VXNlcjM0NzYzNA==",
"organizations_url": "https://api.github.com/users/jdufresne/orgs",
"received_events_url": "https://api.github.com/users/jdufresne/received_events",
"repos_url": "https://api.github.com/users/jdufresne/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/jdufresne/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jdufresne/subscriptions",
"type": "User",
"url": "https://api.github.com/users/jdufresne",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 4 |
2018-12-29T15:43:49Z
|
2021-08-30T00:06:49Z
|
2019-08-20T04:22:33Z
|
CONTRIBUTOR
|
resolved
|
The shim is the same on both Python 2 & 3. It is always `collections.OrderedDict`. Avoid the indirection and import from Python stdlib instead.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4",
"events_url": "https://api.github.com/users/kennethreitz/events{/privacy}",
"followers_url": "https://api.github.com/users/kennethreitz/followers",
"following_url": "https://api.github.com/users/kennethreitz/following{/other_user}",
"gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/kennethreitz",
"id": 119893,
"login": "kennethreitz",
"node_id": "MDQ6VXNlcjExOTg5Mw==",
"organizations_url": "https://api.github.com/users/kennethreitz/orgs",
"received_events_url": "https://api.github.com/users/kennethreitz/received_events",
"repos_url": "https://api.github.com/users/kennethreitz/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions",
"type": "User",
"url": "https://api.github.com/users/kennethreitz",
"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/4922/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4922/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/4922.diff",
"html_url": "https://github.com/psf/requests/pull/4922",
"merged_at": "2019-08-20T04:22:33Z",
"patch_url": "https://github.com/psf/requests/pull/4922.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/4922"
}
| true |
[
"Hey @jdufresne, thanks for putting this together. We originally had this change in the commits to remove Python 2.6, but there are at least a handful of well known projects that use Requests compat imports directly.\r\n\r\nIn order to maintain backwards compatibility, we went ahead and left these intact in Requests 2.x (at least for now) and removed them in the Requests 3.x branch. I think I’d still bias towards keeping them unless there’s a compelling reason they need to go.",
"Thanks. That makes a lot of sense.\r\n\r\nWhat do you think about keeping the compat shim, but not using it internally? That would avoid the unnecessary indirection internally, but keep the compat import for backwards compatibility. I could also add a comment to explain why it exists so others understand it isn't an oversight.",
"# [Codecov](https://codecov.io/gh/requests/requests/pull/4922?src=pr&el=h1) Report\n> Merging [#4922](https://codecov.io/gh/requests/requests/pull/4922?src=pr&el=desc) into [master](https://codecov.io/gh/requests/requests/commit/5c1f72e80a7d7ac129631ea5b0c34c7876bc6ed7?src=pr&el=desc) will **decrease** coverage by `0.08%`.\n> The diff coverage is `0%`.\n\n[](https://codecov.io/gh/requests/requests/pull/4922?src=pr&el=tree)\n\n```diff\n@@ Coverage Diff @@\n## master #4922 +/- ##\n==========================================\n- Coverage 66.89% 66.81% -0.09% \n==========================================\n Files 15 15 \n Lines 1577 1579 +2 \n==========================================\n Hits 1055 1055 \n- Misses 522 524 +2\n```\n\n\n| [Impacted Files](https://codecov.io/gh/requests/requests/pull/4922?src=pr&el=tree) | Coverage Δ | |\n|---|---|---|\n| [requests/sessions.py](https://codecov.io/gh/requests/requests/pull/4922/diff?src=pr&el=tree#diff-cmVxdWVzdHMvc2Vzc2lvbnMucHk=) | `76.49% <0%> (-0.27%)` | :arrow_down: |\n| [requests/structures.py](https://codecov.io/gh/requests/requests/pull/4922/diff?src=pr&el=tree#diff-cmVxdWVzdHMvc3RydWN0dXJlcy5weQ==) | `52.5% <0%> (-1.35%)` | :arrow_down: |\n\n------\n\n[Continue to review full report at Codecov](https://codecov.io/gh/requests/requests/pull/4922?src=pr&el=continue).\n> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)\n> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`\n> Powered by [Codecov](https://codecov.io/gh/requests/requests/pull/4922?src=pr&el=footer). Last update [5c1f72e...2aab9a9](https://codecov.io/gh/requests/requests/pull/4922?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).\n",
"Sure, I think that sounds reasonable."
] |
https://api.github.com/repos/psf/requests/issues/4921
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4921/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4921/comments
|
https://api.github.com/repos/psf/requests/issues/4921/events
|
https://github.com/psf/requests/issues/4921
| 394,727,088 |
MDU6SXNzdWUzOTQ3MjcwODg=
| 4,921 |
Wrong originating IP address with 2.21
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/3694634?v=4",
"events_url": "https://api.github.com/users/znat/events{/privacy}",
"followers_url": "https://api.github.com/users/znat/followers",
"following_url": "https://api.github.com/users/znat/following{/other_user}",
"gists_url": "https://api.github.com/users/znat/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/znat",
"id": 3694634,
"login": "znat",
"node_id": "MDQ6VXNlcjM2OTQ2MzQ=",
"organizations_url": "https://api.github.com/users/znat/orgs",
"received_events_url": "https://api.github.com/users/znat/received_events",
"repos_url": "https://api.github.com/users/znat/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/znat/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/znat/subscriptions",
"type": "User",
"url": "https://api.github.com/users/znat",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 1 |
2018-12-28T21:58:45Z
|
2021-11-05T03:00:28Z
|
2021-08-07T02:35:36Z
|
NONE
|
resolved
|
Summary.
In a pod running on a Kubernetes cluster, a python app using `requests`.
When I look the `nginx-ingress` container logs
With requests <= 2.20.1: the originating IP address of the requests belongs to the **cluster IP range** (which I think is correct)
With requests == 2.21: requests are coming from the **Node pool IP range** (which I don't think is correct)
## Expected Result
Requests should be coming from the cluster IP range
## Actual Result
Requests should be coming from the node pool IP range
## Reproduction Steps
Set up a K8S cluster, a deployment using `requests` and observe logs in the `nginx-ingress` controller pod
## System Information
$ python -m requests.help
```
{
"chardet": {
"version": "3.0.4"
},
"cryptography": {
"version": ""
},
"idna": {
"version": "2.7"
},
"implementation": {
"name": "CPython",
"version": "3.6.7"
},
"platform": {
"release": "4.4.111+",
"system": "Linux"
},
"pyOpenSSL": {
"openssl_version": "",
"version": null
},
"requests": {
"version": "2.20.0"
},
"system_ssl": {
"version": "1010006f"
},
"urllib3": {
"version": "1.24.1"
},
"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/4921/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4921/timeline
| null |
completed
| null | null | false |
[
"We don't pick our own source IP. I'm surprised that there's a difference between the versions. I think we need a smaller reproduction case because there's just too many moving pieces here."
] |
https://api.github.com/repos/psf/requests/issues/4920
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4920/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4920/comments
|
https://api.github.com/repos/psf/requests/issues/4920/events
|
https://github.com/psf/requests/pull/4920
| 394,710,773 |
MDExOlB1bGxSZXF1ZXN0MjQxMzg5Mjcz
| 4,920 |
iter_content() checks for < 1 chunk_size
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/32204469?v=4",
"events_url": "https://api.github.com/users/alex-wenzel/events{/privacy}",
"followers_url": "https://api.github.com/users/alex-wenzel/followers",
"following_url": "https://api.github.com/users/alex-wenzel/following{/other_user}",
"gists_url": "https://api.github.com/users/alex-wenzel/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/alex-wenzel",
"id": 32204469,
"login": "alex-wenzel",
"node_id": "MDQ6VXNlcjMyMjA0NDY5",
"organizations_url": "https://api.github.com/users/alex-wenzel/orgs",
"received_events_url": "https://api.github.com/users/alex-wenzel/received_events",
"repos_url": "https://api.github.com/users/alex-wenzel/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/alex-wenzel/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/alex-wenzel/subscriptions",
"type": "User",
"url": "https://api.github.com/users/alex-wenzel",
"user_view_type": "public"
}
|
[] |
open
| false | null |
[] | null | 8 |
2018-12-28T20:10:50Z
|
2021-12-29T03:54:39Z
| null |
NONE
| null |
With requests v2.20.1, supplying a value of 0 for `chunk_size` causes `iter_content()` to hang. This made debugging code that dynamically computes a value for `chunk_size` difficult. These two lines explicitly enforce `chunk_size` being a positive integer.
|
{
"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/4920/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4920/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/4920.diff",
"html_url": "https://github.com/psf/requests/pull/4920",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/4920.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/4920"
}
| true |
[
"Hi @alex-wenzel, thanks for taking a look at this. I believe this is actually a duplicate of #4876. This is a new behaviour introduced with the last release of urllib3 where 0 no longer denotes \"any size\". I believe this is probably a bug since it doesn't make sense to iterate in chunks of 0.\r\n\r\nIn regards to the PR, I don't think we want to handle the issue with an exception. We handle 0 correctly in `iter_slices` and preventing that would further break the API expectations. We'll track next steps in #4876 for now.\r\n\r\n/cc @sethmlarson",
"@nateprewitt That makes sense, thanks for the quick review/reply!",
"I'll investigate, thanks for the report. ",
"What I'm seeing so far is that urllib3 hasn't (in recent history, tested urllib3 1.18 to 1.24.1) not-blocked indefinitely when using `amt=0` into `HTTPResponse.stream()`. Is this issue different from the one described into #4876 which appears to be about `amt=None`?",
"@sethmlarson after a closer look, it is not. `None` does appear to work correctly with all of the combinations I tried today. It looks like Requests has never supported this actually, at least not since 2.0.\r\n\r\n@alex-wenzel I'm going to reopen this since I agree we can do a better job here. Part of me would be more inclined to treat 0 the same way we treat `None`. That would require special-casing logic for `0`->`None` but the alternative of requiring everyone implement this themselves (`len('')`-> `None`) seems silly. The case of `amt<0` is already handled by the standard library. @sigmavirus24, @sethmlarson, any thoughts on that?",
"What do other streaming interfaces typically do with a chunk size of zero? Any examples in the stdlib? I'd be inclined to copy whatever is done there. ",
"For what it's worth, the code I was debugging includes:\r\n\r\n```python\r\nfile_size = int(r.headers['Content-Length'])\r\nchunk_size = int(file_size / 50)\r\n```\r\n\r\n...so files smaller than 50 bytes would hang forever. I have to imagine this would be one of the most common reasons a user would inadvertently set `chunk_size=0` and in this case I think having it behave like `None` would be reasonable.\r\n\r\nAlso, slightly tangential to this thread, but it looks like my most recent changes failed in AppVeyor with an `ImportError` in Python 3.7 specifically that doesn't look related to my changes.",
"I took a look at getting this added into 2.27.0 but it has some unfortunate side effects. Non-streamed requests currently succeed at returning data from `iter_content` for non-positive integers. While I agree that's nonsensical, adding this behavior breaks that workflow, which we won't be able to do in a minor release.\r\n\r\nFor the time being, this is an unfortunate behavior which we could definitely document for `iter_content`. We won't be able to merge this PR until it's reworked to maintain current behavior though. Unfortunately, I don't see an immediate way to do that."
] |
https://api.github.com/repos/psf/requests/issues/4919
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4919/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4919/comments
|
https://api.github.com/repos/psf/requests/issues/4919/events
|
https://github.com/psf/requests/pull/4919
| 394,658,976 |
MDExOlB1bGxSZXF1ZXN0MjQxMzUwNDAw
| 4,919 |
Updated wording for switch devhelp
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/10725735?v=4",
"events_url": "https://api.github.com/users/blak3irwin/events{/privacy}",
"followers_url": "https://api.github.com/users/blak3irwin/followers",
"following_url": "https://api.github.com/users/blak3irwin/following{/other_user}",
"gists_url": "https://api.github.com/users/blak3irwin/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/blak3irwin",
"id": 10725735,
"login": "blak3irwin",
"node_id": "MDQ6VXNlcjEwNzI1NzM1",
"organizations_url": "https://api.github.com/users/blak3irwin/orgs",
"received_events_url": "https://api.github.com/users/blak3irwin/received_events",
"repos_url": "https://api.github.com/users/blak3irwin/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/blak3irwin/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/blak3irwin/subscriptions",
"type": "User",
"url": "https://api.github.com/users/blak3irwin",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 2 |
2018-12-28T15:20:18Z
|
2021-09-01T00:11:41Z
|
2018-12-28T15:36:09Z
|
NONE
|
resolved
|
Adding file location for devhelp switch in make.bat
|
{
"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/4919/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4919/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/4919.diff",
"html_url": "https://github.com/psf/requests/pull/4919",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/4919.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/4919"
}
| true |
[
"# [Codecov](https://codecov.io/gh/requests/requests/pull/4919?src=pr&el=h1) Report\n> Merging [#4919](https://codecov.io/gh/requests/requests/pull/4919?src=pr&el=desc) into [master](https://codecov.io/gh/requests/requests/commit/5c1f72e80a7d7ac129631ea5b0c34c7876bc6ed7?src=pr&el=desc) will **not change** coverage.\n> The diff coverage is `n/a`.\n\n[](https://codecov.io/gh/requests/requests/pull/4919?src=pr&el=tree)\n\n```diff\n@@ Coverage Diff @@\n## master #4919 +/- ##\n=======================================\n Coverage 66.89% 66.89% \n=======================================\n Files 15 15 \n Lines 1577 1577 \n=======================================\n Hits 1055 1055 \n Misses 522 522\n```\n\n\n\n------\n\n[Continue to review full report at Codecov](https://codecov.io/gh/requests/requests/pull/4919?src=pr&el=continue).\n> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)\n> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`\n> Powered by [Codecov](https://codecov.io/gh/requests/requests/pull/4919?src=pr&el=footer). Last update [5c1f72e...be78b20](https://codecov.io/gh/requests/requests/pull/4919?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).\n",
"Thank you, but this file is auto-generated and not manually maintained. "
] |
https://api.github.com/repos/psf/requests/issues/4918
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4918/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4918/comments
|
https://api.github.com/repos/psf/requests/issues/4918/events
|
https://github.com/psf/requests/pull/4918
| 394,647,254 |
MDExOlB1bGxSZXF1ZXN0MjQxMzQxMzYx
| 4,918 |
Use 'dist: xenial' in Travis to simplify configuration
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/347634?v=4",
"events_url": "https://api.github.com/users/jdufresne/events{/privacy}",
"followers_url": "https://api.github.com/users/jdufresne/followers",
"following_url": "https://api.github.com/users/jdufresne/following{/other_user}",
"gists_url": "https://api.github.com/users/jdufresne/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/jdufresne",
"id": 347634,
"login": "jdufresne",
"node_id": "MDQ6VXNlcjM0NzYzNA==",
"organizations_url": "https://api.github.com/users/jdufresne/orgs",
"received_events_url": "https://api.github.com/users/jdufresne/received_events",
"repos_url": "https://api.github.com/users/jdufresne/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/jdufresne/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jdufresne/subscriptions",
"type": "User",
"url": "https://api.github.com/users/jdufresne",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 1 |
2018-12-28T14:21:03Z
|
2021-08-31T00:07:22Z
|
2019-03-16T23:11:20Z
|
CONTRIBUTOR
|
resolved
|
Allows using Python version 3.7 without sudo declarations.
Travis officially added support for Xenial on 2018-11-08.
https://blog.travis-ci.com/2018-11-08-xenial-release
Can remove unused Python 2.6 check.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/347634?v=4",
"events_url": "https://api.github.com/users/jdufresne/events{/privacy}",
"followers_url": "https://api.github.com/users/jdufresne/followers",
"following_url": "https://api.github.com/users/jdufresne/following{/other_user}",
"gists_url": "https://api.github.com/users/jdufresne/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/jdufresne",
"id": 347634,
"login": "jdufresne",
"node_id": "MDQ6VXNlcjM0NzYzNA==",
"organizations_url": "https://api.github.com/users/jdufresne/orgs",
"received_events_url": "https://api.github.com/users/jdufresne/received_events",
"repos_url": "https://api.github.com/users/jdufresne/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/jdufresne/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jdufresne/subscriptions",
"type": "User",
"url": "https://api.github.com/users/jdufresne",
"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/4918/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4918/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/4918.diff",
"html_url": "https://github.com/psf/requests/pull/4918",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/4918.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/4918"
}
| true |
[
"# [Codecov](https://codecov.io/gh/requests/requests/pull/4918?src=pr&el=h1) Report\n> Merging [#4918](https://codecov.io/gh/requests/requests/pull/4918?src=pr&el=desc) into [master](https://codecov.io/gh/requests/requests/commit/5c1f72e80a7d7ac129631ea5b0c34c7876bc6ed7?src=pr&el=desc) will **not change** coverage.\n> The diff coverage is `n/a`.\n\n[](https://codecov.io/gh/requests/requests/pull/4918?src=pr&el=tree)\n\n```diff\n@@ Coverage Diff @@\n## master #4918 +/- ##\n=======================================\n Coverage 66.89% 66.89% \n=======================================\n Files 15 15 \n Lines 1577 1577 \n=======================================\n Hits 1055 1055 \n Misses 522 522\n```\n\n\n\n------\n\n[Continue to review full report at Codecov](https://codecov.io/gh/requests/requests/pull/4918?src=pr&el=continue).\n> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)\n> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`\n> Powered by [Codecov](https://codecov.io/gh/requests/requests/pull/4918?src=pr&el=footer). Last update [5c1f72e...06652c1](https://codecov.io/gh/requests/requests/pull/4918?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).\n"
] |
https://api.github.com/repos/psf/requests/issues/4917
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4917/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4917/comments
|
https://api.github.com/repos/psf/requests/issues/4917/events
|
https://github.com/psf/requests/pull/4917
| 394,644,344 |
MDExOlB1bGxSZXF1ZXN0MjQxMzM5MDkz
| 4,917 |
Remove unnecessary compat shim for bytes
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/347634?v=4",
"events_url": "https://api.github.com/users/jdufresne/events{/privacy}",
"followers_url": "https://api.github.com/users/jdufresne/followers",
"following_url": "https://api.github.com/users/jdufresne/following{/other_user}",
"gists_url": "https://api.github.com/users/jdufresne/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/jdufresne",
"id": 347634,
"login": "jdufresne",
"node_id": "MDQ6VXNlcjM0NzYzNA==",
"organizations_url": "https://api.github.com/users/jdufresne/orgs",
"received_events_url": "https://api.github.com/users/jdufresne/received_events",
"repos_url": "https://api.github.com/users/jdufresne/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/jdufresne/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jdufresne/subscriptions",
"type": "User",
"url": "https://api.github.com/users/jdufresne",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 3 |
2018-12-28T14:05:59Z
|
2021-08-30T00:06:45Z
|
2019-08-20T04:37:26Z
|
CONTRIBUTOR
|
resolved
|
Both Python 2.7 & Python 3 have the type `bytes`. On Python 2.7, it is an alias of `str`, same as what was defined in `compat.py`.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4",
"events_url": "https://api.github.com/users/kennethreitz/events{/privacy}",
"followers_url": "https://api.github.com/users/kennethreitz/followers",
"following_url": "https://api.github.com/users/kennethreitz/following{/other_user}",
"gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/kennethreitz",
"id": 119893,
"login": "kennethreitz",
"node_id": "MDQ6VXNlcjExOTg5Mw==",
"organizations_url": "https://api.github.com/users/kennethreitz/orgs",
"received_events_url": "https://api.github.com/users/kennethreitz/received_events",
"repos_url": "https://api.github.com/users/kennethreitz/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions",
"type": "User",
"url": "https://api.github.com/users/kennethreitz",
"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/4917/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4917/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/4917.diff",
"html_url": "https://github.com/psf/requests/pull/4917",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/4917.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/4917"
}
| true |
[
"# [Codecov](https://codecov.io/gh/requests/requests/pull/4917?src=pr&el=h1) Report\n> Merging [#4917](https://codecov.io/gh/requests/requests/pull/4917?src=pr&el=desc) into [master](https://codecov.io/gh/requests/requests/commit/5c1f72e80a7d7ac129631ea5b0c34c7876bc6ed7?src=pr&el=desc) will **not change** coverage.\n> The diff coverage is `n/a`.\n\n[](https://codecov.io/gh/requests/requests/pull/4917?src=pr&el=tree)\n\n```diff\n@@ Coverage Diff @@\n## master #4917 +/- ##\n=======================================\n Coverage 66.89% 66.89% \n=======================================\n Files 15 15 \n Lines 1577 1577 \n=======================================\n Hits 1055 1055 \n Misses 522 522\n```\n\n\n| [Impacted Files](https://codecov.io/gh/requests/requests/pull/4917?src=pr&el=tree) | Coverage Δ | |\n|---|---|---|\n| [requests/models.py](https://codecov.io/gh/requests/requests/pull/4917/diff?src=pr&el=tree#diff-cmVxdWVzdHMvbW9kZWxzLnB5) | `77.35% <ø> (ø)` | :arrow_up: |\n\n------\n\n[Continue to review full report at Codecov](https://codecov.io/gh/requests/requests/pull/4917?src=pr&el=continue).\n> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)\n> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`\n> Powered by [Codecov](https://codecov.io/gh/requests/requests/pull/4917?src=pr&el=footer). Last update [5c1f72e...93cd9cb](https://codecov.io/gh/requests/requests/pull/4917?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).\n",
"people rely on this code. it's cruft from our 2.5/2.6 days.",
"Even if the import in `compat.py` sticks around for backwards compatibility, there is no reason to use the non-standard `bytes` internally. Same reasoning as applied in #4922."
] |
https://api.github.com/repos/psf/requests/issues/4916
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4916/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4916/comments
|
https://api.github.com/repos/psf/requests/issues/4916/events
|
https://github.com/psf/requests/issues/4916
| 393,816,676 |
MDU6SXNzdWUzOTM4MTY2NzY=
| 4,916 |
possible memory leak
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/12421352?v=4",
"events_url": "https://api.github.com/users/tarjintor/events{/privacy}",
"followers_url": "https://api.github.com/users/tarjintor/followers",
"following_url": "https://api.github.com/users/tarjintor/following{/other_user}",
"gists_url": "https://api.github.com/users/tarjintor/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/tarjintor",
"id": 12421352,
"login": "tarjintor",
"node_id": "MDQ6VXNlcjEyNDIxMzUy",
"organizations_url": "https://api.github.com/users/tarjintor/orgs",
"received_events_url": "https://api.github.com/users/tarjintor/received_events",
"repos_url": "https://api.github.com/users/tarjintor/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/tarjintor/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/tarjintor/subscriptions",
"type": "User",
"url": "https://api.github.com/users/tarjintor",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 2 |
2018-12-24T06:07:19Z
|
2021-09-06T00:06:30Z
|
2019-02-04T11:55:19Z
|
NONE
|
resolved
|
It seems that my code memory used is increase slowly,I find that even the simplest code will lead this.
## Expected Result
memory won't slowly increase
## Actual Result
memory is slowly increase, running after one hour


## Reproduction Steps
```python
import requests
def f():
while 1:
s = requests.get('https://www.baidu.com')
text = s.text
if __name__ == '__main__':
f()
```
## System Information
$ python -m requests.help
```
{
"chardet": {
"version": "3.0.4"
},
"cryptography": {
"version": "2.3.1"
},
"idna": {
"version": "2.7"
},
"implementation": {
"name": "CPython",
"version": "3.6.6"
},
"platform": {
"release": "10",
"system": "Windows"
},
"pyOpenSSL": {
"openssl_version": "1010009f",
"version": "18.0.0"
},
"requests": {
"version": "2.19.1"
},
"system_ssl": {
"version": "100020ff"
},
"urllib3": {
"version": "1.23"
},
"using_pyopenssl": true
}
```
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/240830?v=4",
"events_url": "https://api.github.com/users/sigmavirus24/events{/privacy}",
"followers_url": "https://api.github.com/users/sigmavirus24/followers",
"following_url": "https://api.github.com/users/sigmavirus24/following{/other_user}",
"gists_url": "https://api.github.com/users/sigmavirus24/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/sigmavirus24",
"id": 240830,
"login": "sigmavirus24",
"node_id": "MDQ6VXNlcjI0MDgzMA==",
"organizations_url": "https://api.github.com/users/sigmavirus24/orgs",
"received_events_url": "https://api.github.com/users/sigmavirus24/received_events",
"repos_url": "https://api.github.com/users/sigmavirus24/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/sigmavirus24/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/sigmavirus24/subscriptions",
"type": "User",
"url": "https://api.github.com/users/sigmavirus24",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/4916/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4916/timeline
| null |
completed
| null | null | false |
[
"Seems to be a similar issue : https://github.com/requests/requests/issues/4934",
"Duplicate of #4934"
] |
https://api.github.com/repos/psf/requests/issues/4915
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4915/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4915/comments
|
https://api.github.com/repos/psf/requests/issues/4915/events
|
https://github.com/psf/requests/pull/4915
| 393,783,171 |
MDExOlB1bGxSZXF1ZXN0MjQwNzAyMzgy
| 4,915 |
Normalize percent-encoded bytes before comparison
|
{
"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 | 8 |
2018-12-23T21:54:59Z
|
2021-08-31T00:07:21Z
|
2019-01-21T13:58:33Z
|
MEMBER
|
resolved
|
urllib3 replaced it's URL parser with `rfc3986` for more compliant parsing (urllib3/urllib3#1487). We've also got an effort underway to run downstream tests before releases (urllib3/urllib3#1508) and during that process we've discovered that requests requires percent-encoded bytes to keep their casing.
Adding this to the unit tests would allow either version of pre- and post-rfc3986 urllib3 to pass requests unit tests. I don't know if the `Request.url` attribute needs to maintain it's casing in this situation or not, if it does this is not the solution. Just putting this together as a potential solution.
|
{
"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/4915/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4915/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/4915.diff",
"html_url": "https://github.com/psf/requests/pull/4915",
"merged_at": "2019-01-21T13:58:33Z",
"patch_url": "https://github.com/psf/requests/pull/4915.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/4915"
}
| true |
[
"# [Codecov](https://codecov.io/gh/requests/requests/pull/4915?src=pr&el=h1) Report\n> Merging [#4915](https://codecov.io/gh/requests/requests/pull/4915?src=pr&el=desc) into [master](https://codecov.io/gh/requests/requests/commit/f37daf25006a4b475b1bea90fecdd035146dbc3b?src=pr&el=desc) will **not change** coverage.\n> The diff coverage is `n/a`.\n\n[](https://codecov.io/gh/requests/requests/pull/4915?src=pr&el=tree)\n\n```diff\n@@ Coverage Diff @@\n## master #4915 +/- ##\n=======================================\n Coverage 66.89% 66.89% \n=======================================\n Files 15 15 \n Lines 1577 1577 \n=======================================\n Hits 1055 1055 \n Misses 522 522\n```\n\n\n\n------\n\n[Continue to review full report at Codecov](https://codecov.io/gh/requests/requests/pull/4915?src=pr&el=continue).\n> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)\n> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`\n> Powered by [Codecov](https://codecov.io/gh/requests/requests/pull/4915?src=pr&el=footer). Last update [f37daf2...2820839](https://codecov.io/gh/requests/requests/pull/4915?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).\n",
"Closing and re-opening to trigger a new build",
"Is a newer pytest version not compatible with one of our plugins / our test setup somehow?",
"Beats me",
"I guess I'll have to poke around with this more and see why we're getting these funky errors on test load.",
"Just as I suspected, pytest 4.1 is the problem. Had to deal with this in multiple places at work as well. :( Now to figure out why [Python 3.6 is still installing pytest 4.1.1 despite being locked to `<4.1`](https://travis-ci.org/requests/requests/jobs/481793727#L499).\r\n\r\n...and it's installing on Python 3.7 on AppVeyor? Is this a bug with Pipenv and `--skip-lock`?",
"I don't know what you think about this @sigmavirus24 / @kennethreitz, I don't want to remove the `--skip-lock` because we're getting really outdated dependencies but it looks like `pipenv` is having trouble with the version specifier?",
"Thanks for merging this!"
] |
https://api.github.com/repos/psf/requests/issues/4914
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4914/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4914/comments
|
https://api.github.com/repos/psf/requests/issues/4914/events
|
https://github.com/psf/requests/issues/4914
| 393,115,557 |
MDU6SXNzdWUzOTMxMTU1NTc=
| 4,914 |
Proxy error when redirect (Caused by ProxyError('Cannot connect to proxy.', timeout('timed out',)))
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/17624449?v=4",
"events_url": "https://api.github.com/users/gjones95/events{/privacy}",
"followers_url": "https://api.github.com/users/gjones95/followers",
"following_url": "https://api.github.com/users/gjones95/following{/other_user}",
"gists_url": "https://api.github.com/users/gjones95/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/gjones95",
"id": 17624449,
"login": "gjones95",
"node_id": "MDQ6VXNlcjE3NjI0NDQ5",
"organizations_url": "https://api.github.com/users/gjones95/orgs",
"received_events_url": "https://api.github.com/users/gjones95/received_events",
"repos_url": "https://api.github.com/users/gjones95/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/gjones95/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/gjones95/subscriptions",
"type": "User",
"url": "https://api.github.com/users/gjones95",
"user_view_type": "public"
}
|
[] |
open
| false | null |
[] | null | 0 |
2018-12-20T16:18:14Z
|
2018-12-20T16:18:14Z
| null |
NONE
| null |
Summary.
When accessing a URL using requests, the redirect causes proxy error because the initial web page DOES require the proxy, but the page it redirects to DOES NOT require the proxy. The program succeeds in using the proxy for the first web page, but when redirecting to the next web page it does not recognize the
## Expected Result
After my program executes 'requests.get(<url>)', the program should reach the initial website through the proxy, and then redirect to the new website without going through the proxy, and then print the HTTP status code. In short, I expect the program to run and print the HTTP status code (ideally 200).
## Actual Result
Instead I get a proxy error when the program tries to access the website it redirects to and the HTTP status code line isn't executed.
I traced this down using python debugger and my findings were as follows...
The proxy and no proxy are set in my environment and these are first set in the program as a dictionary in 'merge_environment_settings', which calls 'get_environ_proxies' which gets the proxy settings from the environment (which is needed at this point so is correct).
NOTE: If the proxy wasn't needed at this point, it would have produced an empty dictionary for 'proxies' as long as the URL domain matched the 'no_proxy' (thanks to the 'should_bypass_proxies' function).
All is fine at this point as the first URL requires the proxy, BUT...
Further down the line when the redirect occurs, within the 'resolve_redirects' function, 'rebuild_proxies' is called. This functions creates a 'new_proxies' variable which copies the original environment proxy settings.
Further along in this function, the 'bypass_proxy' boolean variable is set from the 'should_bypass_proxies' function, this is correctly set to 'True' as the 'no_proxy' matches the new URL (for the redirect website).
At this point, I expect the 'new_proxies' variable to be altered as the bypass proxy has been triggered, but it remains unchanged and the 'rebuild_proxies' function just returns the original proxy settings.
Another note: within 'rebuild_proxies', the below statement is skipped due to 'not bypass_proxy' but in the 'get_environ_proxies' function mentioned earlier is the only place I discovered to actually return an empty dictionary for 'proxies' when it detects a no proxy. So by skipping the below code, it is skipping the only function I discovered to actually remove the proxy settings.
```python
bypass_proxy = should_bypass_proxies(url, no_proxy=no_proxy)
if self.trust_env and not bypass_proxy:
environ_proxies = get_environ_proxies(url, no_proxy=no_proxy)
proxy = environ_proxies.get(scheme, environ_proxies.get('all'))
if proxy:
new_proxies.setdefault(scheme, proxy)
```
I actually added the following bit of code to the end of 'rebuild_proxies' and it seemed to fix my program, but i think there is an underlying issue worth fixing.
```python
if bypass_proxy:
new_proxies = OrderedDict()
```
## Reproduction Steps
```python
import requests
from requests import Session
def test():
session = Session()
session.verify = '<SSL-cert>'
r = session.get('<url>', timeout=5)
print(r.status_code)
if __name__ == "__main__":
test()
```
## System Information
$ python -m requests.help
```
{
"chardet": {
"version": "3.0.4"
},
"cryptography": {
"version": "2.4.2"
},
"idna": {
"version": "2.8"
},
"implementation": {
"name": "CPython",
"version": "3.6.5"
},
"platform": {
"release": "4.15.0-29-generic",
"system": "Linux"
},
"pyOpenSSL": {
"openssl_version": "101000af",
"version": "18.0.0"
},
"requests": {
"version": "2.21.0"
},
"system_ssl": {
"version": "1010007f"
},
"urllib3": {
"version": "1.24.1"
},
"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).
Thanks for reading and hope it can be fixed!
| null |
{
"+1": 3,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 3,
"url": "https://api.github.com/repos/psf/requests/issues/4914/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4914/timeline
| null | null | null | null | false |
[] |
https://api.github.com/repos/psf/requests/issues/4913
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4913/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4913/comments
|
https://api.github.com/repos/psf/requests/issues/4913/events
|
https://github.com/psf/requests/issues/4913
| 392,951,773 |
MDU6SXNzdWUzOTI5NTE3NzM=
| 4,913 |
Turning off keep-alive
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/19627133?v=4",
"events_url": "https://api.github.com/users/StKob/events{/privacy}",
"followers_url": "https://api.github.com/users/StKob/followers",
"following_url": "https://api.github.com/users/StKob/following{/other_user}",
"gists_url": "https://api.github.com/users/StKob/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/StKob",
"id": 19627133,
"login": "StKob",
"node_id": "MDQ6VXNlcjE5NjI3MTMz",
"organizations_url": "https://api.github.com/users/StKob/orgs",
"received_events_url": "https://api.github.com/users/StKob/received_events",
"repos_url": "https://api.github.com/users/StKob/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/StKob/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/StKob/subscriptions",
"type": "User",
"url": "https://api.github.com/users/StKob",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 3 |
2018-12-20T09:09:56Z
|
2021-08-29T00:06:39Z
|
2018-12-20T13:32:05Z
|
NONE
|
resolved
|
In older versions of Requests there was option to turn off keep alive. Something like this:
```
s = requests.session()
s.config['keep_alive'] = False
```
How to do it in recent versions?
|
{
"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": 2,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 2,
"url": "https://api.github.com/repos/psf/requests/issues/4913/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4913/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.",
"The question asked is not answered https://stackoverflow.com/questions/53870767/turning-off-keep-alive",
"A similar question with 16 upvoted answers doesn't work for requests 2.x\r\nhttps://stackoverflow.com/questions/21008953/python-requests-1-how-to-disable-keep-alive\r\n\r\n s = requests.session()\r\n s.keep_alive = False\r\n\r\n AttributeError: 'Session' object has no attribute 'keep_alive'\r\n"
] |
https://api.github.com/repos/psf/requests/issues/4912
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4912/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4912/comments
|
https://api.github.com/repos/psf/requests/issues/4912/events
|
https://github.com/psf/requests/issues/4912
| 392,685,189 |
MDU6SXNzdWUzOTI2ODUxODk=
| 4,912 |
Issue "Remote end closed connection without response" when create multiple sessions
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/10137?v=4",
"events_url": "https://api.github.com/users/ghost/events{/privacy}",
"followers_url": "https://api.github.com/users/ghost/followers",
"following_url": "https://api.github.com/users/ghost/following{/other_user}",
"gists_url": "https://api.github.com/users/ghost/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/ghost",
"id": 10137,
"login": "ghost",
"node_id": "MDQ6VXNlcjEwMTM3",
"organizations_url": "https://api.github.com/users/ghost/orgs",
"received_events_url": "https://api.github.com/users/ghost/received_events",
"repos_url": "https://api.github.com/users/ghost/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/ghost/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/ghost/subscriptions",
"type": "User",
"url": "https://api.github.com/users/ghost",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 5 |
2018-12-19T16:40:13Z
|
2018-12-19T18:22:21Z
|
2018-12-19T17:56:58Z
|
NONE
|
off-topic
|
Here is my situation:
When I use a for loop to login some REST-Web site for about 100 ~500 times, if I use requests.post method to lanch my request, requests freamwork is aways issuing the titled Bug. code as follow:
```
# coding: UTF-8
"""
@Author: ITACHY
@Contact: [email protected]
@CreateTime:2018/12/19 17:26
"""
import datetime
import uuid
import requests
def login_test(num):
start = datetime.datetime.now()
url = XXXXX
uid = str(uuid.uuid4())
body = {
"type": "login",
"clientinfo":
{
"deviceid": uid,
"uid": uid,
"timezone": "Asia/Shanghai",
"osFamily": "ANDROID",
"osVersion": "22",
"deviceType": "MOBILE",
"deviceModel": "1.0",
"appVersion": "1.0.0-SNAPSHOT",
"location":
{
"longitude": 116.407394,
"latitude": 39.904211,
"type": "GCJ02"
}
}
}
header = {
'Content-Type': 'application/json; charset=UTF-8',
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36'
}
# response = requests.post(url, json = body, headers = header)
response = requests.post(url, json = body, headers = header)
if response.status_code == 200:
result = response.json()
print('Count: {}, Result: {}'.format(num, result))
if result["code"] == 0:
due = datetime.datetime.now() - start
print('Count: {}, Uid: {}, Token: {}, Time; {}, '.format(str(i), uid, result["data"]["accessToken"], str(due)))
else:
due = datetime.datetime.now() - start
print('Count: {}, Uid: {}, Response: {}, Time: {}, '.format(str(i), uid, result, str(due)))
else:
print('Count: {}, Login failed. Code: {}, Msg: {}'.format(num, response.status_code, response.text))
if __name__ == '__main__':
for i in range(500):
login_test(i)
```
But when I change my code to following:
```
# coding: UTF-8
"""
@Author: ITACHY
@Contact: [email protected]
@CreateTime:2018/12/19 17:26
"""
import datetime
import uuid
import requests
# import logging
def login(count, session):
start = datetime.datetime.now()
url = XXXXXXX
uid = str(uuid.uuid4())
body = {
"type": "login",
"clientinfo":
{
"deviceid": uid,
"uid": uid,
"timezone": "Asia/Shanghai",
"osFamily": "ANDROID",
"osVersion": "22",
"deviceType": "MOBILE",
"deviceModel": "1.0",
"appVersion": "1.0.0-SNAPSHOT",
"location":
{
"longitude": 116.407394,
"latitude": 39.904211,
"type": "GCJ02"
}
}
}
header = {
'Content-Type': 'application/json; charset=UTF-8',
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36'
}
# try:
# response = requests.post(url, json = body, headers = header)
response = session.post(url, json = body, headers = header)
if response.status_code == 200:
result = response.json()
# print(result)
if result["code"] == 0:
due = datetime.datetime.now() - start
print('Count: {}, Uid: {}, Token: {}, Time; {}, '.format(str(count), uid, result["data"]["accessToken"], str(due)))
else:
due = datetime.datetime.now() - start
print('Count: {}, Uid: {}, Response: {}, Time: {}, '.format(str(count), uid, result, str(due)))
else:
print('Login failed. Code: {}, Msg: {}'.format(response.status_code, response.text))
# except Exception as e:
# print(e)
if __name__ == '__main__':
with requests.Session() as session:
for i in range(5000):
login(i, session)
```
There everything goes well, I think the second way just create only ONE session and the First create lots of sessions, please check it. Thanks in advance if anyone could confirm it.
BTW: The server is behind an Apache NGINX.
|
{
"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/4912/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4912/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.",
"> 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.\r\n\r\nThanks for your kind remind, but I could NOT aggre with you if you do NOT give it a try, How could you know this case is NOT a Bug? By the way, I do post a question on StackOverflow [https://stackoverflow.com/questions/53855850/issue-remote-end-closed-connection-without-response-when-create-multiple-sessi](https://stackoverflow.com/questions/53855850/issue-remote-end-closed-connection-without-response-when-create-multiple-sessi)",
"My server side is a java Spring-WebFlux web site, When I use Java login 6000+ times, everything goes OK, But when I use requests, that just goes as below, and here is some logs:\r\n\r\n```\r\nCount: 112, Uid: 44603f84-21e6-4646-a78c-3b3769075d2f, Response: {'code': 1, 'msg': None, 'data': None}, Time: 0:00:00.036606, \r\nCount: 113, Uid: 0ab278d7-5a19-4b4f-a38a-05fdf3dae90f, Response: {'code': 1, 'msg': None, 'data': None}, Time: 0:00:00.035971, \r\nCount: 114, Uid: 189ba22f-13f3-4b1e-a2e6-410ad4ea5ef1, Response: {'code': 1, 'msg': None, 'data': None}, Time: 0:00:00.031312, \r\nTraceback (most recent call last):\r\n File \"C:\\Program Files\\Python37\\lib\\site-packages\\urllib3\\connectionpool.py\", line 601, in urlopen\r\n chunked=chunked)\r\n File \"C:\\Program Files\\Python37\\lib\\site-packages\\urllib3\\connectionpool.py\", line 387, in _make_request\r\n six.raise_from(e, None)\r\n File \"<string>\", line 2, in raise_from\r\n File \"C:\\Program Files\\Python37\\lib\\site-packages\\urllib3\\connectionpool.py\", line 383, in _make_request\r\n httplib_response = conn.getresponse()\r\n File \"C:\\Program Files\\Python37\\lib\\http\\client.py\", line 1321, in getresponse\r\n response.begin()\r\n File \"C:\\Program Files\\Python37\\lib\\http\\client.py\", line 296, in begin\r\n version, status, reason = self._read_status()\r\n File \"C:\\Program Files\\Python37\\lib\\http\\client.py\", line 265, in _read_status\r\n raise RemoteDisconnected(\"Remote end closed connection without\"\r\nhttp.client.RemoteDisconnected: Remote end closed connection without response\r\n\r\nDuring handling of the above exception, another exception occurred:\r\n\r\nTraceback (most recent call last):\r\n File \"C:\\Program Files\\Python37\\lib\\site-packages\\requests\\adapters.py\", line 440, in send\r\n timeout=timeout\r\n File \"C:\\Program Files\\Python37\\lib\\site-packages\\urllib3\\connectionpool.py\", line 639, in urlopen\r\n _stacktrace=sys.exc_info()[2])\r\n File \"C:\\Program Files\\Python37\\lib\\site-packages\\urllib3\\util\\retry.py\", line 357, in increment\r\n raise six.reraise(type(error), error, _stacktrace)\r\n File \"C:\\Program Files\\Python37\\lib\\site-packages\\urllib3\\packages\\six.py\", line 685, in reraise\r\n raise value.with_traceback(tb)\r\n File \"C:\\Program Files\\Python37\\lib\\site-packages\\urllib3\\connectionpool.py\", line 601, in urlopen\r\n chunked=chunked)\r\n File \"C:\\Program Files\\Python37\\lib\\site-packages\\urllib3\\connectionpool.py\", line 387, in _make_request\r\n six.raise_from(e, None)\r\n File \"<string>\", line 2, in raise_from\r\n File \"C:\\Program Files\\Python37\\lib\\site-packages\\urllib3\\connectionpool.py\", line 383, in _make_request\r\n httplib_response = conn.getresponse()\r\n File \"C:\\Program Files\\Python37\\lib\\http\\client.py\", line 1321, in getresponse\r\n response.begin()\r\n File \"C:\\Program Files\\Python37\\lib\\http\\client.py\", line 296, in begin\r\n version, status, reason = self._read_status()\r\n File \"C:\\Program Files\\Python37\\lib\\http\\client.py\", line 265, in _read_status\r\n raise RemoteDisconnected(\"Remote end closed connection without\"\r\nurllib3.exceptions.ProtocolError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))\r\n\r\nDuring handling of the above exception, another exception occurred:\r\n\r\nTraceback (most recent call last):\r\n File \"D:/Code/rest/web/automation/utils/aiclient/test.py\", line 52, in <module>\r\n login()\r\n File \"D:/Code/rest/web/automation/utils/aiclient/test.py\", line 36, in login\r\n response = requests.post(url, data = body, headers = {'Content-Type': 'application/json; charset=UTF-8'})\r\n File \"C:\\Program Files\\Python37\\lib\\site-packages\\requests\\api.py\", line 112, in post\r\n return request('post', url, data=data, json=json, **kwargs)\r\n File \"C:\\Program Files\\Python37\\lib\\site-packages\\requests\\api.py\", line 58, in request\r\n return session.request(method=method, url=url, **kwargs)\r\n File \"C:\\Program Files\\Python37\\lib\\site-packages\\requests\\sessions.py\", line 508, in request\r\n resp = self.send(prep, **send_kwargs)\r\n File \"C:\\Program Files\\Python37\\lib\\site-packages\\requests\\sessions.py\", line 618, in send\r\n r = adapter.send(request, **kwargs)\r\n File \"C:\\Program Files\\Python37\\lib\\site-packages\\requests\\adapters.py\", line 490, in send\r\n raise ConnectionError(err, request=request)\r\nrequests.exceptions.ConnectionError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))\r\n\r\nProcess finished with exit code 1\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.\r\n\r\n@sigmavirus24 Please help me! Please...",
"@I-TACHI, this is not the forum for debugging your local software issues. The stacktrace you provided is at the standard library level, so at worst it’s a defect we’d be unable to fix in Requests. That said it looks like you’re overwhelming the server with Requests and it’s forcibly killing the connections.\r\n\r\nIt’s not appropriate to spam these issues every 10 minutes asking for help after receiving a response. You’re pinging 1400 people who are here to monitor user impacting bugs. Please follow Sigmavirus24’s instructions and wait for a response on the Stackoverflow question. Thanks."
] |
https://api.github.com/repos/psf/requests/issues/4911
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4911/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4911/comments
|
https://api.github.com/repos/psf/requests/issues/4911/events
|
https://github.com/psf/requests/issues/4911
| 390,868,284 |
MDU6SXNzdWUzOTA4NjgyODQ=
| 4,911 |
Incorrect claim that params go in the request body
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/46775?v=4",
"events_url": "https://api.github.com/users/mjpieters/events{/privacy}",
"followers_url": "https://api.github.com/users/mjpieters/followers",
"following_url": "https://api.github.com/users/mjpieters/following{/other_user}",
"gists_url": "https://api.github.com/users/mjpieters/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/mjpieters",
"id": 46775,
"login": "mjpieters",
"node_id": "MDQ6VXNlcjQ2Nzc1",
"organizations_url": "https://api.github.com/users/mjpieters/orgs",
"received_events_url": "https://api.github.com/users/mjpieters/received_events",
"repos_url": "https://api.github.com/users/mjpieters/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/mjpieters/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/mjpieters/subscriptions",
"type": "User",
"url": "https://api.github.com/users/mjpieters",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 2 |
2018-12-13T21:31:26Z
|
2021-09-06T00:06:38Z
|
2018-12-13T21:34:58Z
|
CONTRIBUTOR
|
resolved
|
c008bf38836a2b5621ba7b352e9fcecacac4ee93 introduced a factual error in to the documentation for the `params` parameter.
The old text was
> :param params: (optional) Dictionary or bytes to be sent **in the query string** for the :class:`Request`.
which was replaced by
> :param params: (optional) Dictionary, list of tuples or bytes to send **in the body** of the :class:`Request`.
Bold emphasis mine. Obviously `params` still go in the query parameter, no functionality was changed. This was probably a copy and paste error following 2d1b4482c5916433a642d66c6b3d0cd28058b39e.
Please replace *body* with *query string*.
Cc: @moy
|
{
"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/4911/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4911/timeline
| null |
completed
| null | null | false |
[
"Hi @mjpieters, #4910 addressed this so it should be resolved shortly. Thanks!",
"Bah, should have checked for pull requests too. Sorry!"
] |
https://api.github.com/repos/psf/requests/issues/4910
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4910/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4910/comments
|
https://api.github.com/repos/psf/requests/issues/4910/events
|
https://github.com/psf/requests/pull/4910
| 390,716,107 |
MDExOlB1bGxSZXF1ZXN0MjM4NDE5MDUw
| 4,910 |
get(), request(): fix documentation of 'params'
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/14709?v=4",
"events_url": "https://api.github.com/users/moy/events{/privacy}",
"followers_url": "https://api.github.com/users/moy/followers",
"following_url": "https://api.github.com/users/moy/following{/other_user}",
"gists_url": "https://api.github.com/users/moy/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/moy",
"id": 14709,
"login": "moy",
"node_id": "MDQ6VXNlcjE0NzA5",
"organizations_url": "https://api.github.com/users/moy/orgs",
"received_events_url": "https://api.github.com/users/moy/received_events",
"repos_url": "https://api.github.com/users/moy/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/moy/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/moy/subscriptions",
"type": "User",
"url": "https://api.github.com/users/moy",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 0 |
2018-12-13T14:57:21Z
|
2021-09-01T00:11:42Z
|
2018-12-13T21:34:11Z
|
CONTRIBUTOR
|
resolved
|
'params' is sent to the query string, not the body.
|
{
"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/4910/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4910/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/4910.diff",
"html_url": "https://github.com/psf/requests/pull/4910",
"merged_at": "2018-12-13T21:34:11Z",
"patch_url": "https://github.com/psf/requests/pull/4910.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/4910"
}
| true |
[] |
https://api.github.com/repos/psf/requests/issues/4909
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4909/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4909/comments
|
https://api.github.com/repos/psf/requests/issues/4909/events
|
https://github.com/psf/requests/pull/4909
| 390,610,904 |
MDExOlB1bGxSZXF1ZXN0MjM4MzM1NTIy
| 4,909 |
#4908 json exception error
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/8709755?v=4",
"events_url": "https://api.github.com/users/SebastianoF/events{/privacy}",
"followers_url": "https://api.github.com/users/SebastianoF/followers",
"following_url": "https://api.github.com/users/SebastianoF/following{/other_user}",
"gists_url": "https://api.github.com/users/SebastianoF/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/SebastianoF",
"id": 8709755,
"login": "SebastianoF",
"node_id": "MDQ6VXNlcjg3MDk3NTU=",
"organizations_url": "https://api.github.com/users/SebastianoF/orgs",
"received_events_url": "https://api.github.com/users/SebastianoF/received_events",
"repos_url": "https://api.github.com/users/SebastianoF/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/SebastianoF/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/SebastianoF/subscriptions",
"type": "User",
"url": "https://api.github.com/users/SebastianoF",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 1 |
2018-12-13T10:22:36Z
|
2021-09-01T00:11:43Z
|
2018-12-13T13:57:09Z
|
NONE
|
resolved
|
{
"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/4909/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4909/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/4909.diff",
"html_url": "https://github.com/psf/requests/pull/4909",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/4909.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/4909"
}
| true |
[
"`Response.json` is a method so that we do not need to handle the underlying exceptions. You're expected to handle them or only call `.json` when you know the response body has JSON to be decoded. Nowhere else in this library do we print anything either."
] |
|
https://api.github.com/repos/psf/requests/issues/4908
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4908/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4908/comments
|
https://api.github.com/repos/psf/requests/issues/4908/events
|
https://github.com/psf/requests/issues/4908
| 390,582,776 |
MDU6SXNzdWUzOTA1ODI3NzY=
| 4,908 |
From `Expecting value: line 1 column 1 (char 0)` to `Response content not in json format`
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/8709755?v=4",
"events_url": "https://api.github.com/users/SebastianoF/events{/privacy}",
"followers_url": "https://api.github.com/users/SebastianoF/followers",
"following_url": "https://api.github.com/users/SebastianoF/following{/other_user}",
"gists_url": "https://api.github.com/users/SebastianoF/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/SebastianoF",
"id": 8709755,
"login": "SebastianoF",
"node_id": "MDQ6VXNlcjg3MDk3NTU=",
"organizations_url": "https://api.github.com/users/SebastianoF/orgs",
"received_events_url": "https://api.github.com/users/SebastianoF/received_events",
"repos_url": "https://api.github.com/users/SebastianoF/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/SebastianoF/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/SebastianoF/subscriptions",
"type": "User",
"url": "https://api.github.com/users/SebastianoF",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 10 |
2018-12-13T09:12:07Z
|
2021-11-30T08:00:44Z
|
2018-12-13T14:05:27Z
|
NONE
|
resolved
|
Hi!
Please run
```
import requests
r = requests.get('http://httpbin.org/status/200')
r.status_code
r.json()
```
The answer is:
```
200
JSONDecodeError: Expecting value: line 1 column 1 (char 0)
```
I do not think it is informative and maybe it could contain something like:
`Json: Response content is not in the json format`
Do you think it is a good idea to wrap line 892 of requests/models.py into something like:
```
try:
return complexjson.loads(self.text, **kwargs) # current line 892
except JSONDecodeError:
print('Response content is not in the json format')
```
?
## System Information
```
(py3) ~/ $ python -m requests.help
{
"chardet": {
"version": "3.0.4"
},
"cryptography": {
"version": ""
},
"idna": {
"version": "2.6"
},
"implementation": {
"name": "CPython",
"version": "3.6.6"
},
"platform": {
"release": "4.15.0-39-generic",
"system": "Linux"
},
"pyOpenSSL": {
"openssl_version": "",
"version": null
},
"requests": {
"version": "2.18.4"
},
"system_ssl": {
"version": "1010007f"
},
"urllib3": {
"version": "1.22"
},
"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": 9,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 4,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 13,
"url": "https://api.github.com/repos/psf/requests/issues/4908/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4908/timeline
| null |
completed
| null | null | false |
[
"If you inspect the response headers, it's not returning JSON so you shouldn't be unconditionally calling `.json()` on the response.",
"Thanks for the quick reply!\r\nYou solved my problem!\r\n\r\nFor future reference, below how to get the JSON content or to get some spam:\r\n```\r\nimport requests\r\n\r\n\r\nurl = 'http://httpbin.org/status/200'\r\nr = requests.get(url)\r\n\r\nif 'json' in r.headers.get('Content-Type'):\r\n js = r.json()\r\nelse:\r\n print('Response content is not in JSON format.')\r\n js = 'spam'\r\n```",
"> Thanks for the quick reply!\r\n> You solved my problem!\r\n> \r\n> For future reference, below how to get the JSON content or to get some spam:\r\n> \r\n> ```\r\n> import requests\r\n> \r\n> \r\n> url = 'http://httpbin.org/status/200'\r\n> r = requests.get(url)\r\n> \r\n> if 'json' in r.headers.get('Content-Type'):\r\n> js = r.json()\r\n> else:\r\n> print('Response content is not in JSON format.')\r\n> js = 'spam'\r\n> ```\r\n\r\nunfortunately not all systems that return json set the Content-Type correctly\r\n\r\nThe best way to handle this is catch the JSONDecodeError:\r\n```python\r\nr = requests.get(url)\r\ntry:\r\n data = r.json()\r\nexcept ValueError:\r\n print(\"Response content is not valid JSON\")\r\n```\r\n\r\n**p.s.** `JSONDecodeError: Expecting value: line 1 column 1 (char 0)` specifically happens with an empty string (i.e. empty response content)\r\n\r\n\r\n",
"@wesinator \r\n> **p.s.** `JSONDecodeError: Expecting value: line 1 column 1 (char 0)` specifically happens with an empty string (i.e. empty response content)\r\n\r\nNot specifically. As the name suggests, it's a decoding error:\r\n```\r\n>>> import json\r\n>>> json.loads('<html>')\r\nTraceback (most recent call last):\r\n ...\r\njson.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)\r\n```\r\n\r\nTo check whether it's an empty response you can look at the exception's `doc` attribute:\r\n```\r\ntry:\r\n json.loads(content)\r\nexcept json.decoder.JSONDecodeError as e:\r\n if not e.doc:\r\n raise ValueError('Empty response.')\r\n else:\r\n raise ValueError(f\"Decoding error at char {e.pos} (line {e.lineno}, col {e.colno}): '{e.doc}'\")\r\n```",
"I know, I meant that the specific position `line 1 column 1 (char 0)` happens in the case there is an empty string ",
"Not necessarily. In my previous comment there is an example of the opposite.\r\n\r\nThe `line x column y (char z)` only shows where the invalid starting value for an expected object was found or, if it's the case, not found.\r\n\r\n```\r\n>>> json.loads('{\"key\":')\r\nTraceback (most recent call last):\r\n ...\r\njson.decoder.JSONDecodeError: Expecting value: line 1 column 8 (char 7)\r\n```\r\n\r\nIn addition to empty responses, the `line 1 column 1 (char 0)` also often means that the document is in another format (such as XML or HTML, as in my first comment).\r\n\r\nThat's why I believe the op's request would clearly be useful. That's a significant difference.",
"```\r\nimport requests\r\n\r\ndef methodPost(_url, _data, _headers):\r\n a = 0\r\n while a != 1:\r\n\r\n data = requests.post(_url, data=_data, headers=_headers)\r\n\r\n if 'json' in data.headers.get('Content-Type'):\r\n js = data.json()\r\n a = 1\r\n else:\r\n print('Response content is not in JSON format.')\r\n js = 'spam'\r\n a = 0\r\n\r\n return js\r\n```\r\n\r\n\r\n\r\n.....\r\n` r = methodPost(url, '{\"data\": \"123\"}', {'content-type': 'application/json', 'Accept-Charset': 'UTF-8'})`",
"I am trying to read a json file which consist of squad dataset for question answering .\r\nIt is showing the same error ,I have the dataset in the local .\r\n\r\n\r\n\r\n",
"All Possible Working solution added [[Solved] JSONDecodeError: Expecting value: line 1 column 1 (char 0)](https://flutterq.com/jsondecodeerror-expecting-value-line-1-column-1-char-0/)\r\n",
"import requests\r\nimport json\r\nimport sys\r\nencoding = sys.stdout.reconfigure(encoding='utf-8')\r\nHEADERS = {'user-agent': ('Mozilla/5.0 (Windows NT 10.0; Win64; x64)' 'AppleWebKit/537.36 (KHTML, like Gecko)' 'Chrome/92.0.4515.159 Safari/537.36'), 'referer': 'https://www.myntra.com/men-clothing?p=2&plaEnabled=false'}\r\nurl = \"https://www.myntra.com/gateway/v2/search/men-clothing-?p=1&plaEnabled=false&rows=50&o=0?apiKey:AIzaSyDAegtWIjzK09VsL5KH05nn-zzCSSql3H4\"\r\nur = \"https://www.myntra.com/men-clothing?p=2&plaEnabled=false\"\r\nresponse = requests.get(url, headers=HEADERS).json()\r\nresp = response.text\r\ndata = json.loads(resp)\r\n\r\nerror:-json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)"
] |
https://api.github.com/repos/psf/requests/issues/4907
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4907/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4907/comments
|
https://api.github.com/repos/psf/requests/issues/4907/events
|
https://github.com/psf/requests/issues/4907
| 390,330,768 |
MDU6SXNzdWUzOTAzMzA3Njg=
| 4,907 |
Address CVE-2018-20060
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/11942927?v=4",
"events_url": "https://api.github.com/users/tuck1s/events{/privacy}",
"followers_url": "https://api.github.com/users/tuck1s/followers",
"following_url": "https://api.github.com/users/tuck1s/following{/other_user}",
"gists_url": "https://api.github.com/users/tuck1s/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/tuck1s",
"id": 11942927,
"login": "tuck1s",
"node_id": "MDQ6VXNlcjExOTQyOTI3",
"organizations_url": "https://api.github.com/users/tuck1s/orgs",
"received_events_url": "https://api.github.com/users/tuck1s/received_events",
"repos_url": "https://api.github.com/users/tuck1s/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/tuck1s/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/tuck1s/subscriptions",
"type": "User",
"url": "https://api.github.com/users/tuck1s",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 2 |
2018-12-12T17:28:00Z
|
2021-09-06T00:06:38Z
|
2018-12-12T19:33:41Z
|
NONE
|
resolved
|
Summary.
[CVE-2018-20060](https://nvd.nist.gov/vuln/detail/CVE-2018-20060) identifies a vulnerability in `urllib3` before version 1.23.
This project `Pipfile` --> `Pipfile.lock` is using version 1.22 currently: [here](https://github.com/requests/requests/blob/c452e3b92d65cb9b5377606488888da0da5db3ad/Pipfile.lock#L56)
|
{
"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/4907/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4907/timeline
| null |
completed
| null | null | false |
[
"Hi @tuck1s, we reviewed the urllib3 issue when it was disclosed. Requests doesn’t use urllib3’s redirect functionality and we’ve already patched a sinusale vulnerability in #4718.",
"Good to know, thanks. This came to my attention because Github are sending out warning notices by email, like this, for transitive dependencies. I assume it's likely other folks will also get this warning.\r\n\r\n> Known high severity security vulnerability detected in urllib3 < 1.23 defined in Pipfile.lock.\r\n> Pipfile.lock update suggested: urllib3 ~> 1.23.\r\n\r\n"
] |
https://api.github.com/repos/psf/requests/issues/4906
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4906/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4906/comments
|
https://api.github.com/repos/psf/requests/issues/4906/events
|
https://github.com/psf/requests/issues/4906
| 389,927,619 |
MDU6SXNzdWUzODk5Mjc2MTk=
| 4,906 |
please help requests
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/23573179?v=4",
"events_url": "https://api.github.com/users/muhommadalmusawi/events{/privacy}",
"followers_url": "https://api.github.com/users/muhommadalmusawi/followers",
"following_url": "https://api.github.com/users/muhommadalmusawi/following{/other_user}",
"gists_url": "https://api.github.com/users/muhommadalmusawi/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/muhommadalmusawi",
"id": 23573179,
"login": "muhommadalmusawi",
"node_id": "MDQ6VXNlcjIzNTczMTc5",
"organizations_url": "https://api.github.com/users/muhommadalmusawi/orgs",
"received_events_url": "https://api.github.com/users/muhommadalmusawi/received_events",
"repos_url": "https://api.github.com/users/muhommadalmusawi/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/muhommadalmusawi/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/muhommadalmusawi/subscriptions",
"type": "User",
"url": "https://api.github.com/users/muhommadalmusawi",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 1 |
2018-12-11T19:54:26Z
|
2018-12-11T20:27:51Z
|
2018-12-11T20:27:34Z
|
NONE
|
spam
|
Please refer to our [Stack Overflow tag](https://stackoverflow.com/questions/tagged/python-requests) for guidance.
code:
import requests
import json
import chardet
email = ("[email protected] ")
payload ={'tk':email,'mk':'2762716611'
, 'button': 'submit'}
headers = {'user-agent': 'my-app/0.0.1'}
cookies = dict(cookies_are='working')
urlData = ('https://token-seshu.tk/')
webURL = requests.get(urlData, headers=headers,json=payload ,cookies=cookies,allow_redirects=True)
data = webURL
print(json.loads(data.content.decode('utf-8')))
================================================
please help
error
Traceback (most recent call last):
File "C:/Users/mayar/Desktop/ghf jf.py", line 14, in <module>
print(json.loads(data.content.decode('utf-8')))
File "C:\Python34\lib\json\__init__.py", line 318, in loads
return _default_decoder.decode(s)
File "C:\Python34\lib\json\decoder.py", line 343, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "C:\Python34\lib\json\decoder.py", line 361, in raw_decode
raise ValueError(errmsg("Expecting value", s, err.value)) from None
ValueError: Expecting value: line 1 column 1 (char 0)
|
{
"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/4906/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4906/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/4905
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4905/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4905/comments
|
https://api.github.com/repos/psf/requests/issues/4905/events
|
https://github.com/psf/requests/issues/4905
| 389,502,056 |
MDU6SXNzdWUzODk1MDIwNTY=
| 4,905 |
@PranayWankhede, the issue being discussed in #3683 was resolved in 2.12.2. As stated in that issue, Requests has no intent to support URIs with underscores in hostnames because those are expressly prohibited in the URI RFC.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/21958722?v=4",
"events_url": "https://api.github.com/users/PranayWankhede/events{/privacy}",
"followers_url": "https://api.github.com/users/PranayWankhede/followers",
"following_url": "https://api.github.com/users/PranayWankhede/following{/other_user}",
"gists_url": "https://api.github.com/users/PranayWankhede/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/PranayWankhede",
"id": 21958722,
"login": "PranayWankhede",
"node_id": "MDQ6VXNlcjIxOTU4NzIy",
"organizations_url": "https://api.github.com/users/PranayWankhede/orgs",
"received_events_url": "https://api.github.com/users/PranayWankhede/received_events",
"repos_url": "https://api.github.com/users/PranayWankhede/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/PranayWankhede/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/PranayWankhede/subscriptions",
"type": "User",
"url": "https://api.github.com/users/PranayWankhede",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 0 |
2018-12-10T21:51:06Z
|
2021-09-06T00:06:39Z
|
2018-12-10T22:23:45Z
|
NONE
|
resolved
|
If you’re still experiencing this issue prior to 2.12, it’s likely another issue because we did not use idna to validate hostnames at that point. We’d need a concrete example to do anymore debugging here. I’m going to close this for now since this seems like a usage inquiry for unsupported behavior. If you have a use case that’s causing this with a URI that conforms to spec, please feel free to reopen. Thanks!
_Originally posted by @nateprewitt in https://github.com/requests/requests/issues/4904#issuecomment-445982947_
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/21958722?v=4",
"events_url": "https://api.github.com/users/PranayWankhede/events{/privacy}",
"followers_url": "https://api.github.com/users/PranayWankhede/followers",
"following_url": "https://api.github.com/users/PranayWankhede/following{/other_user}",
"gists_url": "https://api.github.com/users/PranayWankhede/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/PranayWankhede",
"id": 21958722,
"login": "PranayWankhede",
"node_id": "MDQ6VXNlcjIxOTU4NzIy",
"organizations_url": "https://api.github.com/users/PranayWankhede/orgs",
"received_events_url": "https://api.github.com/users/PranayWankhede/received_events",
"repos_url": "https://api.github.com/users/PranayWankhede/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/PranayWankhede/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/PranayWankhede/subscriptions",
"type": "User",
"url": "https://api.github.com/users/PranayWankhede",
"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/4905/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4905/timeline
| null |
completed
| null | null | false |
[] |
https://api.github.com/repos/psf/requests/issues/4904
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4904/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4904/comments
|
https://api.github.com/repos/psf/requests/issues/4904/events
|
https://github.com/psf/requests/issues/4904
| 389,494,192 |
MDU6SXNzdWUzODk0OTQxOTI=
| 4,904 |
InvalidURL: URL has an invalid label.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/21958722?v=4",
"events_url": "https://api.github.com/users/PranayWankhede/events{/privacy}",
"followers_url": "https://api.github.com/users/PranayWankhede/followers",
"following_url": "https://api.github.com/users/PranayWankhede/following{/other_user}",
"gists_url": "https://api.github.com/users/PranayWankhede/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/PranayWankhede",
"id": 21958722,
"login": "PranayWankhede",
"node_id": "MDQ6VXNlcjIxOTU4NzIy",
"organizations_url": "https://api.github.com/users/PranayWankhede/orgs",
"received_events_url": "https://api.github.com/users/PranayWankhede/received_events",
"repos_url": "https://api.github.com/users/PranayWankhede/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/PranayWankhede/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/PranayWankhede/subscriptions",
"type": "User",
"url": "https://api.github.com/users/PranayWankhede",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 1 |
2018-12-10T21:29:08Z
|
2021-09-06T00:06:39Z
|
2018-12-10T21:36:57Z
|
NONE
|
resolved
|
I am getting the following exception for the URL which has underscore in it. After going through https://github.com/requests/requests/issues/3683 I got to know that this issue is only for the request library version >= 2.12. But i encountered similar issue for 2.11.1. Are there any changes to the older versions? Thanks!
|
{
"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/4904/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4904/timeline
| null |
completed
| null | null | false |
[
"@PranayWankhede, the issue being discussed in #3683 was resolved in 2.12.2. As stated in that issue, Requests has no intent to support URIs with underscores in hostnames because those are expressly prohibited in the URI RFC.\r\n\r\nIf you’re still experiencing this issue prior to 2.12, it’s likely another issue because we did not use idna to validate hostnames at that point. We’d need a concrete example to do anymore debugging here. I’m going to close this for now since this seems like a usage inquiry for unsupported behavior. If you have a use case that’s causing this with a URI that conforms to spec, please feel free to reopen. Thanks!"
] |
https://api.github.com/repos/psf/requests/issues/4903
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4903/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4903/comments
|
https://api.github.com/repos/psf/requests/issues/4903/events
|
https://github.com/psf/requests/issues/4903
| 389,435,061 |
MDU6SXNzdWUzODk0MzUwNjE=
| 4,903 |
SSL handshake Error when using chunked uploads via Proxy
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/6557070?v=4",
"events_url": "https://api.github.com/users/dobey/events{/privacy}",
"followers_url": "https://api.github.com/users/dobey/followers",
"following_url": "https://api.github.com/users/dobey/following{/other_user}",
"gists_url": "https://api.github.com/users/dobey/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/dobey",
"id": 6557070,
"login": "dobey",
"node_id": "MDQ6VXNlcjY1NTcwNzA=",
"organizations_url": "https://api.github.com/users/dobey/orgs",
"received_events_url": "https://api.github.com/users/dobey/received_events",
"repos_url": "https://api.github.com/users/dobey/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/dobey/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/dobey/subscriptions",
"type": "User",
"url": "https://api.github.com/users/dobey",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 6 |
2018-12-10T18:44:20Z
|
2021-09-04T00:06:13Z
|
2018-12-11T15:28:19Z
|
NONE
|
resolved
|
When attempting to perform a chunked upload by passing a generator to put() as the data argument, while going through a proxy server (either unauthenticated or with basic auth), a ConnectionError is raised with the content of `("bad hanshake: Error([('SSL routines', 'ssl3_get_record', 'wrong version number')],)",)`. Connecting without proxy, and connecting via proxy with other libraries (pycurl), works as expected. I've verified the failure still occurs with the latest requests release. Proxy server in testing is Squid 3.5.20.
## Expected Result
Successful connection.
## Actual Result
ConnectionError
## Reproduction Steps
```python
import requests
def file_read(fileobj):
while True:
data = fileobj.read(1024 * 1024 * 4)
if not data:
break
yield data
proxy_string = 'http://proxy.server:8080'
session = requests.Session()
session.proxies = {'http': proxy_string, 'https': proxy_string}
headers = {
'Content-Type': 'application/octet-stream',
'x-amz-acl': 'bucket-owner-full-control',
}
with open('/tmp/some-large-file', 'rb') as f:
url = 'https://aws.bucket/path/to/some-large-file'
requests.put(url, data=file_read(f), headers=headers)
```
## System Information
Python 2.7.13 with requests 2.18.4 (though reproduced with 2.20.1 on same system), in virtualenv, connecting via Squid 3.5.20 proxy server with either basic auth, or no authentication.
|
{
"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/4903/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4903/timeline
| null |
completed
| null | null | false |
[
"Python 2.7.3 is ancient, and has numerous bugs fixed in 2.7.5 that make it unsuitable for usage with Requests. Please use a later version of 2.7 or even a version of python 3.",
"Sorry, that was a typo. It's 2.7.13. Please re-open.",
"@sigmavirus24 Can you please re-open this It is with 2.7.13, not .3. Thanks.",
"Please provide us with the output of\r\n\r\n```\r\npython -m requests.help\r\n```\r\n\r\nWe'll need more details before we can reopen this as an investigation of a bug. This seems more likely to be a problem with your proxy config from my experience, though.",
"```\r\n~$: python -m requests.help\r\n{\r\n \"chardet\": {\r\n \"version\": \"3.0.4\"\r\n }, \r\n \"cryptography\": {\r\n \"version\": \"2.0.3\"\r\n }, \r\n \"idna\": {\r\n \"version\": \"2.6\"\r\n }, \r\n \"implementation\": {\r\n \"name\": \"CPython\", \r\n \"version\": \"2.7.13\"\r\n }, \r\n \"platform\": {\r\n \"release\": \"3.13.0-160-generic\", \r\n \"system\": \"Linux\"\r\n }, \r\n \"pyOpenSSL\": {\r\n \"openssl_version\": \"1010006f\", \r\n \"version\": \"17.2.0\"\r\n }, \r\n \"requests\": {\r\n \"version\": \"2.18.4\"\r\n }, \r\n \"system_ssl\": {\r\n \"version\": \"1000106f\"\r\n }, \r\n \"urllib3\": {\r\n \"version\": \"1.22\"\r\n }, \r\n \"using_pyopenssl\": true\r\n}\r\n```",
"Can this please be re-opened, as the requested information had been provided? Thanks."
] |
https://api.github.com/repos/psf/requests/issues/4902
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4902/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4902/comments
|
https://api.github.com/repos/psf/requests/issues/4902/events
|
https://github.com/psf/requests/issues/4902
| 389,391,774 |
MDU6SXNzdWUzODkzOTE3NzQ=
| 4,902 |
Only use urllib3's pyOpenSSL support when SNI isn't available
|
{
"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 |
2018-12-10T16:51:47Z
|
2021-09-06T00:06:38Z
|
2018-12-11T15:56:15Z
|
MEMBER
|
resolved
|
I'm floating this idea because currently our native `ssl` module support isn't being utilized by any requests users and I'm planning on making major improvements to SNI within native `ssl` support in urllib3 including leaning on the stdlib for hostname verification. What are the thoughts on only using pyOpenSSL when `urllib3.util.HAS_SNI` is false?
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/18519037?v=4",
"events_url": "https://api.github.com/users/sethmlarson/events{/privacy}",
"followers_url": "https://api.github.com/users/sethmlarson/followers",
"following_url": "https://api.github.com/users/sethmlarson/following{/other_user}",
"gists_url": "https://api.github.com/users/sethmlarson/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/sethmlarson",
"id": 18519037,
"login": "sethmlarson",
"node_id": "MDQ6VXNlcjE4NTE5MDM3",
"organizations_url": "https://api.github.com/users/sethmlarson/orgs",
"received_events_url": "https://api.github.com/users/sethmlarson/received_events",
"repos_url": "https://api.github.com/users/sethmlarson/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/sethmlarson/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/sethmlarson/subscriptions",
"type": "User",
"url": "https://api.github.com/users/sethmlarson",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/4902/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4902/timeline
| null |
completed
| null | null | false |
[
"That would be potentially backwards incompatible. At this point, we inject pyOpenSSL when it's there. It was primarily for SNI support, but I believe this enables other things the stdlib doesn't support and that some users may be relying on \"if pyOpenSSL is installed, requests uses it\" at this point.",
"Ah okay, I was unaware there were extras besides SNI being added. Thanks for the clarification!"
] |
https://api.github.com/repos/psf/requests/issues/4901
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4901/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4901/comments
|
https://api.github.com/repos/psf/requests/issues/4901/events
|
https://github.com/psf/requests/pull/4901
| 389,356,769 |
MDExOlB1bGxSZXF1ZXN0MjM3MzYzODQ2
| 4,901 |
v2.21.0
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/5271761?v=4",
"events_url": "https://api.github.com/users/nateprewitt/events{/privacy}",
"followers_url": "https://api.github.com/users/nateprewitt/followers",
"following_url": "https://api.github.com/users/nateprewitt/following{/other_user}",
"gists_url": "https://api.github.com/users/nateprewitt/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/nateprewitt",
"id": 5271761,
"login": "nateprewitt",
"node_id": "MDQ6VXNlcjUyNzE3NjE=",
"organizations_url": "https://api.github.com/users/nateprewitt/orgs",
"received_events_url": "https://api.github.com/users/nateprewitt/received_events",
"repos_url": "https://api.github.com/users/nateprewitt/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/nateprewitt/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/nateprewitt/subscriptions",
"type": "User",
"url": "https://api.github.com/users/nateprewitt",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 0 |
2018-12-10T15:35:42Z
|
2021-08-31T00:07:22Z
|
2018-12-10T15:36:34Z
|
MEMBER
|
resolved
|
2.21.0 (2018-12-10)
-------------------
**Dependencies**
- Requests now supports idna v2.8.
|
{
"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/4901/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4901/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/4901.diff",
"html_url": "https://github.com/psf/requests/pull/4901",
"merged_at": "2018-12-10T15:36:34Z",
"patch_url": "https://github.com/psf/requests/pull/4901.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/4901"
}
| true |
[] |
https://api.github.com/repos/psf/requests/issues/4900
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4900/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4900/comments
|
https://api.github.com/repos/psf/requests/issues/4900/events
|
https://github.com/psf/requests/issues/4900
| 389,213,160 |
MDU6SXNzdWUzODkyMTMxNjA=
| 4,900 |
Not clear how to build coverage report
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/332428?v=4",
"events_url": "https://api.github.com/users/boxed/events{/privacy}",
"followers_url": "https://api.github.com/users/boxed/followers",
"following_url": "https://api.github.com/users/boxed/following{/other_user}",
"gists_url": "https://api.github.com/users/boxed/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/boxed",
"id": 332428,
"login": "boxed",
"node_id": "MDQ6VXNlcjMzMjQyOA==",
"organizations_url": "https://api.github.com/users/boxed/orgs",
"received_events_url": "https://api.github.com/users/boxed/received_events",
"repos_url": "https://api.github.com/users/boxed/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/boxed/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/boxed/subscriptions",
"type": "User",
"url": "https://api.github.com/users/boxed",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 3 |
2018-12-10T09:35:34Z
|
2021-09-06T00:06:37Z
|
2018-12-31T00:09:21Z
|
NONE
|
resolved
|
I was looking into trying out mutation testing (with mutmut) on requests, seeing as this is one of the most critical libraries for python. But to do this effectively I need to get the coverage report and this was non-trivial.
## Expected Result
`tox -e coverage` or `make coverage` should run tests with coverage.
## Actual Result
It complains about me not having pipenv, so I installed that, then it build some venv and then fails with
```
pipenv run py.test --cov-config .coveragerc --verbose --cov-report term --cov-report xml --cov=requests tests
Error: the command py.test could not be found within PATH or Pipfile's [scripts].
make: *** [coverage] Error 1
```
(aside: py.test? It's pytest nowadays)
## Reproduction Steps
Check out requests. Run `make coverage`.
## System Information
$ python -m requests.help
```
{
"chardet": {
"version": "3.0.4"
},
"cryptography": {
"version": ""
},
"idna": {
"version": "2.7"
},
"implementation": {
"name": "CPython",
"version": "2.7.15"
},
"platform": {
"release": "18.0.0",
"system": "Darwin"
},
"pyOpenSSL": {
"openssl_version": "",
"version": null
},
"requests": {
"version": "2.20.1"
},
"system_ssl": {
"version": "1000210f"
},
"urllib3": {
"version": "1.24.1"
},
"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/4900/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4900/timeline
| null |
completed
| null | null | false |
[
"Hi @boxed,\r\n\r\nThere's a couple options for running coverage.\r\n\r\n1.) You'll need to setup pipenv to run `make coverage`. More info on that [here](https://pipenv.readthedocs.io/en/latest/).\r\n2.) You can call `pytest --cov-config .coveragerc --verbose --cov-report term --cov-report xml --cov=requests tests` directly with the pytest dependencies installed. You can find those dependencies in the [Pipfile](https://github.com/requests/requests/blob/master/Pipfile).",
"Why did you close this? This is a documentation and/or tooling issue, not a support forum question.",
"This is the first report of someone who couldn't get the tooling to work. If it continues to be an issue, we can invest time in figuring out how to make it easier. Otherwise, I agree with Nate closing this."
] |
https://api.github.com/repos/psf/requests/issues/4899
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4899/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4899/comments
|
https://api.github.com/repos/psf/requests/issues/4899/events
|
https://github.com/psf/requests/issues/4899
| 389,196,003 |
MDU6SXNzdWUzODkxOTYwMDM=
| 4,899 |
Exceptions occur when nonstandard headers are returned
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/8945364?v=4",
"events_url": "https://api.github.com/users/Lcys/events{/privacy}",
"followers_url": "https://api.github.com/users/Lcys/followers",
"following_url": "https://api.github.com/users/Lcys/following{/other_user}",
"gists_url": "https://api.github.com/users/Lcys/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Lcys",
"id": 8945364,
"login": "Lcys",
"node_id": "MDQ6VXNlcjg5NDUzNjQ=",
"organizations_url": "https://api.github.com/users/Lcys/orgs",
"received_events_url": "https://api.github.com/users/Lcys/received_events",
"repos_url": "https://api.github.com/users/Lcys/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Lcys/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Lcys/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Lcys",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 1 |
2018-12-10T08:47:31Z
|
2021-09-06T00:06:41Z
|
2018-12-10T14:14:26Z
|
NONE
|
resolved
|
requests==2.20.1
python2.7.15
```
HTTP/1.1 200 OK
Content-Type: application/octet-stream
Content-Length: 35239
Content-Disposition: attachment; filename="text.txt"
```
Exceptions occur when tabs exist in HTTP return headers
Exception information: `Header continuation with no previous header: urllib3.exceptions.InvalidHeader: Header continuation with no previous header: Content-Type: application/octet-stream
`
|
{
"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/4899/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4899/timeline
| null |
completed
| null | null | false |
[
"It's not that these are non-standard headers. It's that the headers are formatted as if they're all part of the line `HTTP/1.1 200 OK`. This is a bug that has been opened in the past. It's not something we can fix. There's only so much we can do to override httplib's behaviour when a server completely and totally misbehaves."
] |
https://api.github.com/repos/psf/requests/issues/4898
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4898/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4898/comments
|
https://api.github.com/repos/psf/requests/issues/4898/events
|
https://github.com/psf/requests/pull/4898
| 389,134,102 |
MDExOlB1bGxSZXF1ZXN0MjM3MTk0Njc2
| 4,898 |
revert azure pipeline changes
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/5271761?v=4",
"events_url": "https://api.github.com/users/nateprewitt/events{/privacy}",
"followers_url": "https://api.github.com/users/nateprewitt/followers",
"following_url": "https://api.github.com/users/nateprewitt/following{/other_user}",
"gists_url": "https://api.github.com/users/nateprewitt/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/nateprewitt",
"id": 5271761,
"login": "nateprewitt",
"node_id": "MDQ6VXNlcjUyNzE3NjE=",
"organizations_url": "https://api.github.com/users/nateprewitt/orgs",
"received_events_url": "https://api.github.com/users/nateprewitt/received_events",
"repos_url": "https://api.github.com/users/nateprewitt/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/nateprewitt/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/nateprewitt/subscriptions",
"type": "User",
"url": "https://api.github.com/users/nateprewitt",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 1 |
2018-12-10T04:29:49Z
|
2021-08-31T00:07:20Z
|
2018-12-10T04:31:10Z
|
MEMBER
|
resolved
|
Since we don't have access to the new testing infrastructure, we're going to revert the Azure changes for now. We can revisit this once the permissions issues are fixed.
Reverting commits:
fc9dfac
bc3eddc
d911f27
3da2f10
ce52825
398d110
c15d2b6
086655e
|
{
"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/4898/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4898/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/4898.diff",
"html_url": "https://github.com/psf/requests/pull/4898",
"merged_at": "2018-12-10T04:31:10Z",
"patch_url": "https://github.com/psf/requests/pull/4898.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/4898"
}
| true |
[
"For auditing purposes, I missed e4974c7 in this commit and it's been reverted in abe950c."
] |
https://api.github.com/repos/psf/requests/issues/4897
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4897/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4897/comments
|
https://api.github.com/repos/psf/requests/issues/4897/events
|
https://github.com/psf/requests/issues/4897
| 388,969,273 |
MDU6SXNzdWUzODg5NjkyNzM=
| 4,897 |
Build security (same-origin policy, some protections against CSRF and DNS rebinding) into requests
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/240344?v=4",
"events_url": "https://api.github.com/users/KOLANICH/events{/privacy}",
"followers_url": "https://api.github.com/users/KOLANICH/followers",
"following_url": "https://api.github.com/users/KOLANICH/following{/other_user}",
"gists_url": "https://api.github.com/users/KOLANICH/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/KOLANICH",
"id": 240344,
"login": "KOLANICH",
"node_id": "MDQ6VXNlcjI0MDM0NA==",
"organizations_url": "https://api.github.com/users/KOLANICH/orgs",
"received_events_url": "https://api.github.com/users/KOLANICH/received_events",
"repos_url": "https://api.github.com/users/KOLANICH/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/KOLANICH/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/KOLANICH/subscriptions",
"type": "User",
"url": "https://api.github.com/users/KOLANICH",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 6 |
2018-12-08T23:23:59Z
|
2021-09-06T00:06:40Z
|
2018-12-10T05:09:24Z
|
NONE
|
resolved
|
`requests` has some security problems.
Browsers have same-origin policies, csrf protection headers and security addons like uMatrix and NoScript, preventing CSRF and some XSS attacks. Requests doesn't. So if a user of a browser opens a web page with a malicious script, the page won't access the authenticated admin consoles of user's IoT or local CUPS server: the addons provide the protections against even dns rebinding. But a script crawling the web lacks these protections, so a malicious webpage can trick the script into accessing local rezources.
So we need introduce security contexts.
1. a user creates a session
2. a user spawns a security context
3. a user is not allowed to access the URIs non available from the context using that context object.
4. for accessing them a user can redefine the restrictions of a context.
5. user should access the links from the pages loaded from the context using only a contexts, and this should be checkable by taint analysers.
6. spawning a context should be a simple call, and `requests` should do the work automatically
7. requests should by default enable the checks preventing accessing addresses from intranet.
|
{
"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/4897/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4897/timeline
| null |
completed
| null | null | false |
[
"Hi @KOLANICH,\r\n\r\nThanks for reaching out. I'm not sure if this makes sense in the scope of Requests. Requests is not a web browser and deals with the web in the context of a single http request. We don't execute any asynchronous scripts or additional asynchronous requests in a single call. If you have a script that's capable of being tricked into retrieving local information and sending it back to a remote server, that's at least 3 requests and would be a vulnerability in code implemented using Requests.\r\n\r\nIf you have specific examples of a vulnerability, I'd encourage you to reach out to Ian or I with the disclosure information [here](http://docs.python-requests.org/en/master/community/vulnerabilities/).",
"> If you have a script that's capable of being tricked into retrieving local information and sending it back to a remote server, that's at least 3 requests and would be a vulnerability in code implemented using Requests.\r\n\r\nYes, it would be a vulnr in the code, but it would be a flaw in requests design. The tools should be designed in the way encouraging and making easy to use them in a secure way. If one violates this recommendation, if the tool is popular, there will be many apps using it insecurely.\r\n\r\nSo IMHO some security should be built into `requests` itself.",
"@KOLANICH do you understand that Requests does not execute JavaScript or any of the contents of the response body?",
"I do, but it is still possble to repurpose the existing code.\r\n\r\nFor example, let we have the following script\r\n\r\n```python\r\nresources=requests.get(\"https://someSite.com/mirrors.json\").json()\r\nfor r in resources:\r\n try:\r\n csv=requests.get(r).text\r\n except:\r\n warn(\"Mirror\"+r+\" is not available, trying another one\")\r\n continue\r\n dataset=parseCsv(csv)\r\n break\r\n```\r\n\r\nWhat if the malicious server sends the following response:\r\n\r\n```javascript\r\n[\"http://192.168.1.1/index.html\", \"https://someSite.com/dataset.csv\"]\r\n```\r\n\r\nIf http://192.168.1.1/index.html is available, then the program gets html and crashes because it is invalid csv and doesn't probe the second URI, and the server can derive it.\r\nIf it is not available, it probes the second URI.\r\n\r\nThis way a malicious server hosting a list of mirrors can probe intranet.",
"This sounds like user issue rather than a requests issue. Like Nate said above, this library is only for singular HTTP requests. What a user does with response information isn't really requests business. The same goes for curl/wget and every other HTTP library.",
">This sounds like user issue rather than a requests issue.\r\n\r\nIt is. But the purpose of libraries is to solve issues of its users. Of course it is possible to create a wrapper for `requests` checking same-origin policy, but ... it would be used by noone.\r\n"
] |
https://api.github.com/repos/psf/requests/issues/4896
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4896/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4896/comments
|
https://api.github.com/repos/psf/requests/issues/4896/events
|
https://github.com/psf/requests/issues/4896
| 388,900,753 |
MDU6SXNzdWUzODg5MDA3NTM=
| 4,896 |
python27 post requests fails
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/45708778?v=4",
"events_url": "https://api.github.com/users/GgAaYyAaNn/events{/privacy}",
"followers_url": "https://api.github.com/users/GgAaYyAaNn/followers",
"following_url": "https://api.github.com/users/GgAaYyAaNn/following{/other_user}",
"gists_url": "https://api.github.com/users/GgAaYyAaNn/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/GgAaYyAaNn",
"id": 45708778,
"login": "GgAaYyAaNn",
"node_id": "MDQ6VXNlcjQ1NzA4Nzc4",
"organizations_url": "https://api.github.com/users/GgAaYyAaNn/orgs",
"received_events_url": "https://api.github.com/users/GgAaYyAaNn/received_events",
"repos_url": "https://api.github.com/users/GgAaYyAaNn/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/GgAaYyAaNn/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/GgAaYyAaNn/subscriptions",
"type": "User",
"url": "https://api.github.com/users/GgAaYyAaNn",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 2 |
2018-12-08T08:31:04Z
|
2018-12-12T13:36:33Z
|
2018-12-08T14:48:42Z
|
NONE
|
spam
|
https://stackoverflow.com/questions/53286484/python27-post-requests-fails
|
{
"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/4896/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4896/timeline
| null |
completed
| null | null | false |
[
"?",
"can you fix?"
] |
https://api.github.com/repos/psf/requests/issues/4895
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4895/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4895/comments
|
https://api.github.com/repos/psf/requests/issues/4895/events
|
https://github.com/psf/requests/issues/4895
| 388,810,405 |
MDU6SXNzdWUzODg4MTA0MDU=
| 4,895 |
Having a space in header element for posting
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/7781739?v=4",
"events_url": "https://api.github.com/users/felleg/events{/privacy}",
"followers_url": "https://api.github.com/users/felleg/followers",
"following_url": "https://api.github.com/users/felleg/following{/other_user}",
"gists_url": "https://api.github.com/users/felleg/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/felleg",
"id": 7781739,
"login": "felleg",
"node_id": "MDQ6VXNlcjc3ODE3Mzk=",
"organizations_url": "https://api.github.com/users/felleg/orgs",
"received_events_url": "https://api.github.com/users/felleg/received_events",
"repos_url": "https://api.github.com/users/felleg/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/felleg/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/felleg/subscriptions",
"type": "User",
"url": "https://api.github.com/users/felleg",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 4 |
2018-12-07T20:55:07Z
|
2021-09-06T00:06:40Z
|
2018-12-07T23:39:33Z
|
NONE
|
resolved
|
I'm trying to post to a server using the following script:
```
import requests
data = {
'query': 'GetProcess',
'getFrom': '2018-12-06 10:10:10.000',
}
response = requests.post('http://localhost/monitor', data=data)
```
I cannot find where exactly, but the space character in the `getFrom` element is being replaced with a `+`: `'2018-12-06+10:10:10.000'`
This doesn't match the syntax SQL expects on our server, so the query fails.
I read here (https://stackoverflow.com/a/12528097) that setting the Content-type might help. I tried `text/html`, `text/plain`, `application/json`, and nothing seems to change.
Interestingly, the following (equivalent?) bash command succeeds:
` curl -d 'query=GetProcess&getFrom=2018-12-06 10:10:10.000' localhost/monitor`
I'm looking for a way to make my server receive `"getFrom" : "2018-12-06 10:10:10.000"` in the header. Thank you in advance :)
|
{
"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/4895/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4895/timeline
| null |
completed
| null | null | false |
[
"Hi there! Thanks for opening this issue. Unfortunately, it seems this is a request for help instead of a report of a defect in the project. Please use [StackOverflow](https://stackoverflow.com) for general usage questions instead and only report defects here.",
"I looked deeper into this, and I found the culprit: at line 105 of models.py, the `urlencode` function is the one that adds the `+` sign. Unless I am mistaken, this function should not be used to encode data.\r\n\r\nIn other words, if I add these prints near line 105 of models.py:\r\n`print(\"Result:\", result)`\r\n`print(\"encoded:\", urlencode(result, doseq=True))`\r\n`return urlencode(result, doseq=True)`\r\n\r\nI get this output: \r\n`Result: [(b'getFrom', b'2018-12-10 06:10:10.000'), (b'query', b'GetProcess')]`\r\n`encoded: getFrom=2018-12-10+06%3A10%3A10.000&query=GetProcess`\r\n(notice the `+` in encoded)",
"Hi @felleg,\r\n\r\nThis is the default behavior for the data arg using a dict, as stated in the [getting started docs](http://docs.python-requests.org/en/master/user/quickstart/#more-complicated-post-requests).\r\n\r\n> Typically, you want to send some form-encoded data — much like an HTML form. 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\nAs Sigmavirus24 stated, this isn’t the right place for general usage questions. We’d appreciate it if you directed further inquiries to Stackoverflow. Thanks!\r\n",
"I'll post the solution in case anyone is looking for the answer: https://stackoverflow.com/a/53710004/5565172\r\nThe link I was really looking for in the docs was this one: http://docs.python-requests.org/en/master/user/advanced/#prepared-requests\r\nThank you for your patience"
] |
https://api.github.com/repos/psf/requests/issues/4894
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4894/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4894/comments
|
https://api.github.com/repos/psf/requests/issues/4894/events
|
https://github.com/psf/requests/issues/4894
| 388,355,491 |
MDU6SXNzdWUzODgzNTU0OTE=
| 4,894 |
Timeout in session chunked requests lead to subsequent request timeout
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/47389?v=4",
"events_url": "https://api.github.com/users/meddulla/events{/privacy}",
"followers_url": "https://api.github.com/users/meddulla/followers",
"following_url": "https://api.github.com/users/meddulla/following{/other_user}",
"gists_url": "https://api.github.com/users/meddulla/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/meddulla",
"id": 47389,
"login": "meddulla",
"node_id": "MDQ6VXNlcjQ3Mzg5",
"organizations_url": "https://api.github.com/users/meddulla/orgs",
"received_events_url": "https://api.github.com/users/meddulla/received_events",
"repos_url": "https://api.github.com/users/meddulla/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/meddulla/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/meddulla/subscriptions",
"type": "User",
"url": "https://api.github.com/users/meddulla",
"user_view_type": "public"
}
|
[] |
open
| false | null |
[] | null | 1 |
2018-12-06T19:10:09Z
|
2019-11-14T16:29:29Z
| null |
NONE
| null |
## Expected Result
Requests in same session don't interfere with one another.
## Actual Result
A slow response from a chunked request causes the subsequent request to fail with a timeout even if the server responded before the timeout was reached.
## Reproduction Steps
Run a test server that accepts GET and POST requests. When responding to POST requests it waits 10 seconds before responding:
```python
import time
from http.server import BaseHTTPRequestHandler, HTTPServer
time_sleep = 10
class HandlerSlowResponse(BaseHTTPRequestHandler):
def do_POST(self):
# Hangs
time.sleep(time_sleep)
self.send_response(200)
self.end_headers()
def do_GET(self):
# OK
self.send_response(200)
self.end_headers()
if __name__ == '__main__':
print("Time sleep %s" % time_sleep)
httpd = HTTPServer(('', 8000), HandlerSlowResponse)
print('Listening on :8000')
httpd.serve_forever()
```
Then, in another REPL, verify non-session requests don't interfere with one another:
```python
import requests
import time
timeout = 2
def norm(i):
print("GET (quick response) %s" % i)
try:
requests.get('http://localhost:8000', timeout=timeout, data='hello'.encode('utf-8'))
except Exception as e:
print("-> EXC Norm %s %s" % (i, e))
def chunked(i):
print("POST chunked (slow response) %s" % i)
# Does not fail if exceeds timeout
def gen():
yield 'hello'.encode('utf-8')
try:
requests.post('http://localhost:8000', timeout=timeout, data=gen())
except Exception as e:
print("-> EXC Chunked %s %s" % (i, e))
def cycle():
# requests don't interfere with one another
for i in range(1, 10):
time.sleep(1)
if i % 2 == 0:
norm(i)
else:
chunked(i)
if __name__ == "__main__":
print("Timeout %s" % timeout)
cycle()
```
Output:
Note that chunked requests never time out (ticket https://github.com/requests/requests/issues/4402).
```
Timeout 2
POST chunked (slow response) 1
GET (quick response) 2
POST chunked (slow response) 3
GET (quick response) 4
POST chunked (slow response) 5
GET (quick response) 6
POST chunked (slow response) 7
GET (quick response) 8
POST chunked (slow response) 9
```
Next, do the same thing but now using a `Session`:
```python
import requests
import time
timeout = 2
session = requests.Session()
def norm_session(i):
print("GET norm session (quick response) %s" % i)
try:
session.get('http://localhost:8000', timeout=timeout, data='hello'.encode('utf-8'))
except Exception as e:
print("-> EXC Norm session %s %s" % (i, e))
def chunked_session(i):
print("POST chunked session (slow response) %s" % i)
def gen():
yield 'hello'.encode('utf-8')
try:
session.post('http://localhost:8000', timeout=timeout, data=gen())
except Exception as e:
print("-> EXC Chunked session %s %s" % (i, e))
def cycle_session():
# A normal request always times out after a chunked timeout request
# even if the server responded in time
for i in range(1, 10):
time.sleep(1)
if i % 2 == 0:
norm_session(i)
else:
chunked_session(i)
if __name__ == "__main__":
print("Timeout %s" % timeout)
cycle_session()
```
Output:
Note that chunked requests do time out but cause the subsequent GET to fail.
```
Timeout 2
POST chunked session (slow response) 1
GET norm session (quick response) 2
POST chunked session (slow response) 3
-> EXC Chunked session 3 timed out
GET norm session (quick response) 4
-> EXC Norm session 4 HTTPConnectionPool(host='localhost', port=8000): Read timed out. (read timeout=2)
POST chunked session (slow response) 5
GET norm session (quick response) 6
POST chunked session (slow response) 7
-> EXC Chunked session 7 timed out
GET norm session (quick response) 8
-> EXC Norm session 8 HTTPConnectionPool(host='localhost', port=8000): Read timed out. (read timeout=2)
POST chunked session (slow response) 9
```
## System Information
$ python -m requests.help
```
{
"chardet": {
"version": "3.0.4"
},
"cryptography": {
"version": ""
},
"idna": {
"version": "2.6"
},
"implementation": {
"name": "CPython",
"version": "3.6.5"
},
"platform": {
"release": "16.7.0",
"system": "Darwin"
},
"pyOpenSSL": {
"openssl_version": "",
"version": null
},
"requests": {
"version": "2.18.4"
},
"system_ssl": {
"version": "1000210f"
},
"urllib3": {
"version": "1.22"
},
"using_pyopenssl": false
}
```
This command is only available on Requests v2.16.4 and greater. Otherwise,
please provide some basic information about your system (Python version,
operating system, &c).
| null |
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/4894/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4894/timeline
| null | null | null | null | false |
[
"It could maybe be fixed by #5128 (see also https://github.com/psf/requests/issues/4402#issuecomment-415748368) ?"
] |
https://api.github.com/repos/psf/requests/issues/4893
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4893/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4893/comments
|
https://api.github.com/repos/psf/requests/issues/4893/events
|
https://github.com/psf/requests/issues/4893
| 388,222,304 |
MDU6SXNzdWUzODgyMjIzMDQ=
| 4,893 |
Library IDNA 2.7 and 2.8
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/7862574?v=4",
"events_url": "https://api.github.com/users/homerjonathan/events{/privacy}",
"followers_url": "https://api.github.com/users/homerjonathan/followers",
"following_url": "https://api.github.com/users/homerjonathan/following{/other_user}",
"gists_url": "https://api.github.com/users/homerjonathan/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/homerjonathan",
"id": 7862574,
"login": "homerjonathan",
"node_id": "MDQ6VXNlcjc4NjI1NzQ=",
"organizations_url": "https://api.github.com/users/homerjonathan/orgs",
"received_events_url": "https://api.github.com/users/homerjonathan/received_events",
"repos_url": "https://api.github.com/users/homerjonathan/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/homerjonathan/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/homerjonathan/subscriptions",
"type": "User",
"url": "https://api.github.com/users/homerjonathan",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 2 |
2018-12-06T13:50:22Z
|
2021-09-06T00:06:41Z
|
2018-12-06T14:01:35Z
|
NONE
|
resolved
|
Summary.
Since off the grid I manually installed IDNA 2.8 as a dependant. When installing requests via the .whl file v2.20.1 version. It manually tried to download the IDNA 2.7 version. I manually installed IDNA 2.7 and the install completed correctly.
What you expected.
To install correctly with IDNA 2.8
What happened instead.
When installing Requests version IDNA 2.7 will be downloaded.
## System Information
$ python -m requests.help
```
{
"chardet": {
"version": "3.0.4"
},
"cryptography": {
"version": ""
},
"idna": {
"version": "2.7"
},
"implementation": {
"name": "CPython",
"version": "3.7.1"
},
"platform": {
"release": "2008ServerR2",
"system": "Windows"
},
"pyOpenSSL": {
"openssl_version": "",
"version": null
},
"requests": {
"version": "2.20.1"
},
"system_ssl": {
"version": "1010009f"
},
"urllib3": {
"version": "1.24.1"
},
"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/4893/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4893/timeline
| null |
completed
| null | null | false |
[
"Duplicate of #4890 ",
"In the future, please search **closed and** open issues before creating new ones that are duplicates."
] |
https://api.github.com/repos/psf/requests/issues/4892
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4892/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4892/comments
|
https://api.github.com/repos/psf/requests/issues/4892/events
|
https://github.com/psf/requests/issues/4892
| 388,025,990 |
MDU6SXNzdWUzODgwMjU5OTA=
| 4,892 |
Getting SSLError(SSLError("bad handshake: SysCallError(104, 'ECONNRESET'
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/109864?v=4",
"events_url": "https://api.github.com/users/sagarsumant/events{/privacy}",
"followers_url": "https://api.github.com/users/sagarsumant/followers",
"following_url": "https://api.github.com/users/sagarsumant/following{/other_user}",
"gists_url": "https://api.github.com/users/sagarsumant/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/sagarsumant",
"id": 109864,
"login": "sagarsumant",
"node_id": "MDQ6VXNlcjEwOTg2NA==",
"organizations_url": "https://api.github.com/users/sagarsumant/orgs",
"received_events_url": "https://api.github.com/users/sagarsumant/received_events",
"repos_url": "https://api.github.com/users/sagarsumant/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/sagarsumant/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/sagarsumant/subscriptions",
"type": "User",
"url": "https://api.github.com/users/sagarsumant",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 1 |
2018-12-06T02:09:59Z
|
2021-09-06T00:06:41Z
|
2018-12-06T13:57:30Z
|
NONE
|
resolved
|
- I saw that here ssl retry issue is fixed. https://github.com/urllib3/urllib3/pull/1178/files.
- I am getting this issue after retry exhaust. This after 30 min plus starting my application.
- The code that polls the server to get next data tries every 20 seconds. (each attempt has retry enabled)
- But this issue happens after 30-40 minutes.
- we are using urllib3==1.24.1
Any pointers/suggestions for this?
Stacktrace:
ERROR:adal-python:75788bbf-6a33-4890-96bf-9553ed7e1073 - OAuth2Client:Get Token request failed
Traceback (most recent call last):
File "/databricks/python/lib/python3.5/site-packages/urllib3/contrib/pyopenssl.py", line 453, in wrap_socket
cnx.do_handshake()
File "/databricks/python/lib/python3.5/site-packages/OpenSSL/SSL.py", line 1443, in do_handshake
self._raise_ssl_error(self._ssl, result)
File "/databricks/python/lib/python3.5/site-packages/OpenSSL/SSL.py", line 1182, in _raise_ssl_error
raise SysCallError(errno, errorcode.get(errno))
OpenSSL.SSL.SysCallError: (104, 'ECONNRESET')
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/databricks/python/lib/python3.5/site-packages/urllib3/connectionpool.py", line 600, in urlopen
chunked=chunked)
File "/databricks/python/lib/python3.5/site-packages/urllib3/connectionpool.py", line 343, in _make_request
self._validate_conn(conn)
File "/databricks/python/lib/python3.5/site-packages/urllib3/connectionpool.py", line 839, in _validate_conn
conn.connect()
File "/databricks/python/lib/python3.5/site-packages/urllib3/connection.py", line 344, in connect
ssl_context=context)
File "/databricks/python/lib/python3.5/site-packages/urllib3/util/ssl_.py", line 344, in ssl_wrap_socket
return context.wrap_socket(sock, server_hostname=server_hostname)
File "/databricks/python/lib/python3.5/site-packages/urllib3/contrib/pyopenssl.py", line 459, in wrap_socket
raise ssl.SSLError('bad handshake: %r' % e)
ssl.SSLError: ("bad handshake: SysCallError(104, 'ECONNRESET')",)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/databricks/python/lib/python3.5/site-packages/requests/adapters.py", line 449, in send
timeout=timeout
File "/databricks/python/lib/python3.5/site-packages/urllib3/connectionpool.py", line 638, in urlopen
_stacktrace=sys.exc_info()[2])
File "/databricks/python/lib/python3.5/site-packages/urllib3/util/retry.py", line 398, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='login.microsoftonline.com', port=443): Max retries exceeded with url: /72f988bf-86f1-41af-91ab-2d7cd011db47/oauth2/token (Caused by SSLError(SSLError("bad handshake: SysCallError(104, 'ECONNRESET')",),))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/databricks/python/lib/python3.5/site-packages/adal/oauth2_client.py", line 268, in get_token
timeout=self._call_context.get('timeout', None))
File "/databricks/python/lib/python3.5/site-packages/requests/api.py", line 116, in post
return request('post', url, data=data, json=json, **kwargs)
File "/databricks/python/lib/python3.5/site-packages/requests/api.py", line 60, in request
return session.request(method=method, url=url, **kwargs)
File "/databricks/python/lib/python3.5/site-packages/requests/sessions.py", line 533, in request
resp = self.send(prep, **send_kwargs)
File "/databricks/python/lib/python3.5/site-packages/requests/sessions.py", line 646, in send
r = adapter.send(request, **kwargs)
File "/databricks/python/lib/python3.5/site-packages/requests/adapters.py", line 514, in send
raise SSLError(e, request=request)
requests.exceptions.SSLError: HTTPSConnectionPool(host='login.microsoftonline.com', port=443): Max retries exceeded with url: /72f988bf-86f1-41af-91ab-2d7cd011db47/oauth2/token (Caused by SSLError(SSLError("bad handshake: SysCallError(104, 'ECONNRESET')",),))
|
{
"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/4892/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4892/timeline
| null |
completed
| null | null | false |
[
"It's likely that a peer between you and `login.microsoftonline.com` is resetting the connection because a packet isn't received in order causing the reset. It's impossible for us to discern why this is just happening for you after 30 minutes. For help debugging this, you must ask on [StackOverflow](https://stackoverflow.com)"
] |
https://api.github.com/repos/psf/requests/issues/4891
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4891/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4891/comments
|
https://api.github.com/repos/psf/requests/issues/4891/events
|
https://github.com/psf/requests/pull/4891
| 387,742,730 |
MDExOlB1bGxSZXF1ZXN0MjM2MTYyNzc3
| 4,891 |
chore: Remove unused imports in test
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1192122?v=4",
"events_url": "https://api.github.com/users/artofhuman/events{/privacy}",
"followers_url": "https://api.github.com/users/artofhuman/followers",
"following_url": "https://api.github.com/users/artofhuman/following{/other_user}",
"gists_url": "https://api.github.com/users/artofhuman/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/artofhuman",
"id": 1192122,
"login": "artofhuman",
"node_id": "MDQ6VXNlcjExOTIxMjI=",
"organizations_url": "https://api.github.com/users/artofhuman/orgs",
"received_events_url": "https://api.github.com/users/artofhuman/received_events",
"repos_url": "https://api.github.com/users/artofhuman/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/artofhuman/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/artofhuman/subscriptions",
"type": "User",
"url": "https://api.github.com/users/artofhuman",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 1 |
2018-12-05T12:51:22Z
|
2022-02-26T15:00:31Z
|
2021-11-28T14:28:13Z
|
NONE
|
resolved
|
{
"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/4891/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4891/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/4891.diff",
"html_url": "https://github.com/psf/requests/pull/4891",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/4891.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/4891"
}
| true |
[
"This will be handled by automated tools once/if introduced. For now doesn't hurt anything."
] |
|
https://api.github.com/repos/psf/requests/issues/4890
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4890/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4890/comments
|
https://api.github.com/repos/psf/requests/issues/4890/events
|
https://github.com/psf/requests/issues/4890
| 387,638,509 |
MDU6SXNzdWUzODc2Mzg1MDk=
| 4,890 |
idna 2.8 released
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/3694534?v=4",
"events_url": "https://api.github.com/users/Nothing4You/events{/privacy}",
"followers_url": "https://api.github.com/users/Nothing4You/followers",
"following_url": "https://api.github.com/users/Nothing4You/following{/other_user}",
"gists_url": "https://api.github.com/users/Nothing4You/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Nothing4You",
"id": 3694534,
"login": "Nothing4You",
"node_id": "MDQ6VXNlcjM2OTQ1MzQ=",
"organizations_url": "https://api.github.com/users/Nothing4You/orgs",
"received_events_url": "https://api.github.com/users/Nothing4You/received_events",
"repos_url": "https://api.github.com/users/Nothing4You/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Nothing4You/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Nothing4You/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Nothing4You",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 9 |
2018-12-05T08:12:10Z
|
2021-09-06T00:06:40Z
|
2018-12-10T15:46:45Z
|
NONE
|
resolved
|
[`idna`](https://pypi.org/project/idna/#history) 2.8 was just released. requests is [pinned to `idna>=2.5,<2.8`](https://github.com/requests/requests/blob/57d7284c1a245cf9fbcecb594f50471d86e879f7/setup.py#L46)
Can the pin be updated to allow v2.8?
|
{
"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": 9,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 9,
"url": "https://api.github.com/repos/psf/requests/issues/4890/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4890/timeline
| null |
completed
| null | null | false |
[
"By the way, out of curiosity, what's the reason to pin minor version number at all?\r\nIt seems it was first introduced in 1ea27b35649571abb796f7cffbab83938d882a8d, but there is no explanation in the commit metadata.",
"@Vlad-Shcherbina why have a lowest version we support? Because that's the lowest version we know works with idna at all. Libraries change things in subtly backwards incompatible ways. If we don't put together a range of known good versions, users will use whatever they want, shoot themselves in the foot, and demand we fix it for them. With only 2 people working on this project, no one has time for that",
"My 2 cents.\r\n\r\n`aiohttp` library depends on `yarl`. In turn, `yarl` depends on `idna>=2.0`.\r\nSo far so good.\r\n`aiohttp` uses `twine check` for making sure that `setup.py` is (at least partially) correct.\r\nThere is no surprise that `twine` uses the awesome `requests` (almost every tool that needs synchronous HTTP access uses `requests`).\r\n\r\nToday our daily CI job has failed wit version conflict error. Sure, we can create a separate virtual env for `twine` usage or we can find another solution but the situation looks odd.\r\n\r\nOn another hand I understand the striving to pin everything for such community important project: any backward incompatibility in `requests` dependencies can hurt too many people.",
"Could you please make a new release? \r\nReleasing `requests==2.20.2` should not take too long perhaps.",
"> Releasing requests==2.20.2 should not take too long perhaps.\r\n\r\nChanging version constraints would lead to a 2.21 version. There's already a PR for upgrading the dependency version https://github.com/requests/requests/pull/4889",
"Breaks py-requests, and in turn certbot under MacPorts.",
"Hi @Schamschula, we’re aware of the impact. Using the requirements specified by Requests will continue to work until the next patch is released. I’m aiming to get something out early next week once we can get the testing issues worked out.",
"@nateprewitt Thanks for the update.!\r\n\r\n In the meantime, I've opened a ticket for those MacPorts users that might run into this issue:\r\n\r\nhttps://trac.macports.org/ticket/57747",
"Requests 2.21.0 is up on PyPi now supporting idna 2.8."
] |
https://api.github.com/repos/psf/requests/issues/4889
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4889/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4889/comments
|
https://api.github.com/repos/psf/requests/issues/4889/events
|
https://github.com/psf/requests/pull/4889
| 387,439,440 |
MDExOlB1bGxSZXF1ZXN0MjM1OTI3Njg0
| 4,889 |
Bumped maximum version of idna
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/772?v=4",
"events_url": "https://api.github.com/users/alex/events{/privacy}",
"followers_url": "https://api.github.com/users/alex/followers",
"following_url": "https://api.github.com/users/alex/following{/other_user}",
"gists_url": "https://api.github.com/users/alex/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/alex",
"id": 772,
"login": "alex",
"node_id": "MDQ6VXNlcjc3Mg==",
"organizations_url": "https://api.github.com/users/alex/orgs",
"received_events_url": "https://api.github.com/users/alex/received_events",
"repos_url": "https://api.github.com/users/alex/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/alex/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/alex/subscriptions",
"type": "User",
"url": "https://api.github.com/users/alex",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 12 |
2018-12-04T19:16:36Z
|
2021-09-01T00:11:44Z
|
2018-12-10T05:41:15Z
|
MEMBER
|
resolved
|
{
"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": 3,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 3,
"url": "https://api.github.com/repos/psf/requests/issues/4889/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4889/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/4889.diff",
"html_url": "https://github.com/psf/requests/pull/4889",
"merged_at": "2018-12-10T05:41:15Z",
"patch_url": "https://github.com/psf/requests/pull/4889.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/4889"
}
| true |
[
"AppVeyor failures don't seem related to this patch",
"Failing vsts build also looks unrelated to this patch.",
"@alex The build will fail for Python 3.5 on `idna==2.8` so I think the bump isn't safe. I just saw the same at work",
"I'm not sure I understand? Why do you think this will fail with Python 3.5? AFAICT, idna did not drop support for it: https://github.com/kjd/idna/commit/2618ad17c86498d627ebb136143c2799ad48cbe3",
"We're using 3.5 (where also failed) and the [request-ci](https://kennethreitz.visualstudio.com/requests/_build/results?buildId=17) in this PR failed for the same version (just checked it was for Windows, tho). I'm also not sure about why. Maybe it's a coincidence and I misunderstood the log ",
"Hey @alex, thanks for getting this put together. I agree the failures look unrelated. Kenneth recently changed our testing infrastructure and I don’t think we’ve validated it’s working since. I’ll take a look at things this evening and try to work out the issue.",
"So it looks like this is just a spurious pipenv failure. I've disabled appveyor but I don't seem to have any permissions for Azure. @kennethreitz do we have a way to get Ian and I access to the build infrastructure?",
"Why not `<3` ? Pinning a maximum minor version causes install fails of `requests` whenever a new minor version of `idna` is released, even if that version is compatible. Instead, you could allow _any_ version of idna v2, and then there will only be issues with `requests` if there are incompatibilities in `idna`.",
"@jakul we can't guarantee future compatibility with a library whose backwards compatibility we don't manage. It often occurs that people break things accidentally. That's all fine until someone upgrades their version they use with requests to find requests is broken and then we get 50 bug reports within 30 minutes of the release telling us we're broken. Most people don't immediately need the latest version of idna, they tend to use the overly eager upgrade strategy in pip meaning that they get it, think they need it, and pester us to upgrade. That's fine, because we can then fix the incompatibility when we find it, meanwhile users can restrict themselves to using the version compatible with everything.",
"@sigmavirus24 Thanks for taking the time to write a detailed response. I understand your points, but I think it's a tradeoff between \"the requests team have to do work everytime idna makes any release\" vs \"the requests team have to do work if idna does a release which actually breaks something in requests\". \r\n\r\nThat's my 2 cents, cheers.",
"Yes, but that's a tradeoff we're willing to make. \"Stability in the requests user experience because we can proactively fix an accidental backwards incompatibility\" versus \"This is an arcane instability happening in 2% of our users cases that we could have caught and now people don't trust requests to be stable because we promised forwards compatibility that we couldn't actually guarantee.\"",
"Alright we've got successful builds, so I'm going to rebase and merge. Thanks Alex!\r\n\r\nhttps://ci.appveyor.com/project/kennethreitz/requests/builds/20888463"
] |
|
https://api.github.com/repos/psf/requests/issues/4888
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4888/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4888/comments
|
https://api.github.com/repos/psf/requests/issues/4888/events
|
https://github.com/psf/requests/issues/4888
| 387,215,856 |
MDU6SXNzdWUzODcyMTU4NTY=
| 4,888 |
HTTPS Server certificate custom verification
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/18055678?v=4",
"events_url": "https://api.github.com/users/luc-alquier/events{/privacy}",
"followers_url": "https://api.github.com/users/luc-alquier/followers",
"following_url": "https://api.github.com/users/luc-alquier/following{/other_user}",
"gists_url": "https://api.github.com/users/luc-alquier/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/luc-alquier",
"id": 18055678,
"login": "luc-alquier",
"node_id": "MDQ6VXNlcjE4MDU1Njc4",
"organizations_url": "https://api.github.com/users/luc-alquier/orgs",
"received_events_url": "https://api.github.com/users/luc-alquier/received_events",
"repos_url": "https://api.github.com/users/luc-alquier/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/luc-alquier/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/luc-alquier/subscriptions",
"type": "User",
"url": "https://api.github.com/users/luc-alquier",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 1 |
2018-12-04T10:24:20Z
|
2021-09-06T00:06:41Z
|
2018-12-04T13:54:11Z
|
NONE
|
resolved
|
Like the openssl c api, it would be great if in requests api or urllib3 api user could provide callback or a method to do custom server certificate validation.
|
{
"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/4888/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4888/timeline
| null |
completed
| null | null | false |
[
"That belongs over in urllib3 since it handles all of this for us."
] |
https://api.github.com/repos/psf/requests/issues/4887
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4887/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4887/comments
|
https://api.github.com/repos/psf/requests/issues/4887/events
|
https://github.com/psf/requests/issues/4887
| 387,190,760 |
MDU6SXNzdWUzODcxOTA3NjA=
| 4,887 |
windows for ubuntu18.04,data={"id":None},no response
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/42604280?v=4",
"events_url": "https://api.github.com/users/cxdtotsj/events{/privacy}",
"followers_url": "https://api.github.com/users/cxdtotsj/followers",
"following_url": "https://api.github.com/users/cxdtotsj/following{/other_user}",
"gists_url": "https://api.github.com/users/cxdtotsj/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/cxdtotsj",
"id": 42604280,
"login": "cxdtotsj",
"node_id": "MDQ6VXNlcjQyNjA0Mjgw",
"organizations_url": "https://api.github.com/users/cxdtotsj/orgs",
"received_events_url": "https://api.github.com/users/cxdtotsj/received_events",
"repos_url": "https://api.github.com/users/cxdtotsj/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/cxdtotsj/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/cxdtotsj/subscriptions",
"type": "User",
"url": "https://api.github.com/users/cxdtotsj",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 1 |
2018-12-04T09:23:56Z
|
2021-09-06T00:06:37Z
|
2018-12-31T13:17:39Z
|
NONE
|
resolved
|
Summary.
## Actual Result
No response, no timeout parameter does not work
## Reproduction Steps
```python
import requests
url = "https://dt-dev.arctron.cn/api/zone/get" (my company progect)
data = {"id":None}
headers = header
reqs = requests.post(url=url,data=data,headers=header)
```
## the picture

|
{
"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/4887/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4887/timeline
| null |
completed
| null | null | false |
[
"Seems to be an issue with the host: `https://dt-dev.arctron.cn/api/zone/get`\r\n\r\n`curl https://dt-dev.arctron.cn/api/zone/get` acts the same."
] |
https://api.github.com/repos/psf/requests/issues/4885
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4885/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4885/comments
|
https://api.github.com/repos/psf/requests/issues/4885/events
|
https://github.com/psf/requests/issues/4885
| 385,866,414 |
MDU6SXNzdWUzODU4NjY0MTQ=
| 4,885 |
https://docs.python-requests.org certificate's CN is *.readthedocs.org
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/14002720?v=4",
"events_url": "https://api.github.com/users/juga0/events{/privacy}",
"followers_url": "https://api.github.com/users/juga0/followers",
"following_url": "https://api.github.com/users/juga0/following{/other_user}",
"gists_url": "https://api.github.com/users/juga0/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/juga0",
"id": 14002720,
"login": "juga0",
"node_id": "MDQ6VXNlcjE0MDAyNzIw",
"organizations_url": "https://api.github.com/users/juga0/orgs",
"received_events_url": "https://api.github.com/users/juga0/received_events",
"repos_url": "https://api.github.com/users/juga0/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/juga0/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/juga0/subscriptions",
"type": "User",
"url": "https://api.github.com/users/juga0",
"user_view_type": "public"
}
|
[] |
closed
| true |
{
"avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4",
"events_url": "https://api.github.com/users/kennethreitz/events{/privacy}",
"followers_url": "https://api.github.com/users/kennethreitz/followers",
"following_url": "https://api.github.com/users/kennethreitz/following{/other_user}",
"gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/kennethreitz",
"id": 119893,
"login": "kennethreitz",
"node_id": "MDQ6VXNlcjExOTg5Mw==",
"organizations_url": "https://api.github.com/users/kennethreitz/orgs",
"received_events_url": "https://api.github.com/users/kennethreitz/received_events",
"repos_url": "https://api.github.com/users/kennethreitz/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions",
"type": "User",
"url": "https://api.github.com/users/kennethreitz",
"user_view_type": "public"
}
|
[
{
"avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4",
"events_url": "https://api.github.com/users/kennethreitz/events{/privacy}",
"followers_url": "https://api.github.com/users/kennethreitz/followers",
"following_url": "https://api.github.com/users/kennethreitz/following{/other_user}",
"gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/kennethreitz",
"id": 119893,
"login": "kennethreitz",
"node_id": "MDQ6VXNlcjExOTg5Mw==",
"organizations_url": "https://api.github.com/users/kennethreitz/orgs",
"received_events_url": "https://api.github.com/users/kennethreitz/received_events",
"repos_url": "https://api.github.com/users/kennethreitz/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions",
"type": "User",
"url": "https://api.github.com/users/kennethreitz",
"user_view_type": "public"
}
] | null | 1 |
2018-11-29T18:24:54Z
|
2021-09-06T00:06:35Z
|
2019-01-08T01:30:31Z
|
NONE
|
resolved
|
This is not a software bug but a deployment bug.
http://docs.python-requests.org does not redirect to HTTPS.
In some browsers, visiting https://docs.python-requests.org, will give SSL_ERROR_BAD_CERT_DOMAIN, because the certificate's CN does not match the requested URL.
https://readthedocs.org/projects/requests/latest/ redirects http://docs.python-requests.org.
## Expected Result
docs.python-requests.org Website via HTTPS
## Actual Result
SSL_ERROR_BAD_CERT_DOMAIN: Unable to communicate securely with peer: requested domain name does not match the server’s certificate.
## Reproduction Steps
Open https://docs.python-requests.org in a browser, or:
```
curl https://docs.python-requests.org
curl: (51) SSL: no alternative certificate subject name matches target host name 'docs.python-requests.org'
```
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4",
"events_url": "https://api.github.com/users/kennethreitz/events{/privacy}",
"followers_url": "https://api.github.com/users/kennethreitz/followers",
"following_url": "https://api.github.com/users/kennethreitz/following{/other_user}",
"gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/kennethreitz",
"id": 119893,
"login": "kennethreitz",
"node_id": "MDQ6VXNlcjExOTg5Mw==",
"organizations_url": "https://api.github.com/users/kennethreitz/orgs",
"received_events_url": "https://api.github.com/users/kennethreitz/received_events",
"repos_url": "https://api.github.com/users/kennethreitz/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions",
"type": "User",
"url": "https://api.github.com/users/kennethreitz",
"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/4885/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4885/timeline
| null |
completed
| null | null | false |
[
"currently unsupported"
] |
https://api.github.com/repos/psf/requests/issues/4884
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4884/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4884/comments
|
https://api.github.com/repos/psf/requests/issues/4884/events
|
https://github.com/psf/requests/issues/4884
| 385,450,724 |
MDU6SXNzdWUzODU0NTA3MjQ=
| 4,884 |
HTTP CONNECT request sent in different packets while using an HTTPS Proxy
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1035793?v=4",
"events_url": "https://api.github.com/users/brad-anton/events{/privacy}",
"followers_url": "https://api.github.com/users/brad-anton/followers",
"following_url": "https://api.github.com/users/brad-anton/following{/other_user}",
"gists_url": "https://api.github.com/users/brad-anton/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/brad-anton",
"id": 1035793,
"login": "brad-anton",
"node_id": "MDQ6VXNlcjEwMzU3OTM=",
"organizations_url": "https://api.github.com/users/brad-anton/orgs",
"received_events_url": "https://api.github.com/users/brad-anton/received_events",
"repos_url": "https://api.github.com/users/brad-anton/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/brad-anton/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/brad-anton/subscriptions",
"type": "User",
"url": "https://api.github.com/users/brad-anton",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 5 |
2018-11-28T20:49:16Z
|
2022-02-26T04:00:37Z
|
2021-11-28T03:16:07Z
|
NONE
|
resolved
|
When using an HTTPS proxy, HTTP headers (and other parts of the request) are sent at different times then the initial HTTP `CONNECT` method, causing _some_ proxy services to abort the connection.
## Expected Result
The entire HTTP request should be sent in the same packet as the `CONNECT` method.
## Actual Result
HTTP Headers and trailing `\r\n` are sent at a different time.
You can see this in the Wireshark Capture:
First Packet contains the HTTP CONNECT (from [here](https://github.com/python/cpython/blob/master/Lib/http/client.py#L895-L898))

Second packet shows the left over `\r\n` (from [here](https://github.com/python/cpython/blob/master/Lib/http/client.py#L903))

This results in _some_ proxy servers aborting the connection.
## Reproduction Steps
```
>>> import requests
>>> proxies = { 'https': 'https://someproxy:443' }
>>> requests.get('https://www.google.com', proxies=proxies)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/user/Library/Python/2.7/lib/python/site-packages/requests/api.py", line 70, in get
return request('get', url, params=params, **kwargs)
File "/Users/user/Library/Python/2.7/lib/python/site-packages/requests/api.py", line 56, in request
return session.request(method=method, url=url, **kwargs)
File "/Users/user/Library/Python/2.7/lib/python/site-packages/requests/sessions.py", line 475, in request
resp = self.send(prep, **send_kwargs)
File "/Users/user/Library/Python/2.7/lib/python/site-packages/requests/sessions.py", line 596, in send
r = adapter.send(request, **kwargs)
File "/Users/user/Library/Python/2.7/lib/python/site-packages/requests/adapters.py", line 485, in send
raise ProxyError(e, request=request)
requests.exceptions.ProxyError: HTTPSConnectionPool(host='www.google.com', port=443): Max retries exceeded with url: / (Caused by ProxyError('Cannot connect to proxy.', error(54, 'Connection reset by peer')))
```
## System Information
```
$ python -V
Python 2.7.11
```
(Same behavior on Python 3)
MacOSX
## Work Around
The following work around sends the entire HTTP `CONNECT` request at the same time:
https://gist.github.com/brad-anton/ff517025a86754793b680b3c5cfc9797
|
{
"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/4884/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4884/timeline
| null |
completed
| null | null | false |
[
"This is an issue with urllib3, maybe we can use that new issue moving feature! :)",
"@SethMichaelLarson I gave it a whirl but it looks like we can only move between repos in this org. @brad-anton would you mind making an issue in the urllib3 repo referencing this? Then we can close this out after. Thanks!",
"Shame, I was looking forward to exchanging so many issues back and forth with our sister project. :)",
"We’ll get there :) Incremental progress.",
"This was [fixed in CPython 3.10](https://github.com/python/cpython/pull/24780) and thus in both urllib3 and Requests."
] |
https://api.github.com/repos/psf/requests/issues/4883
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4883/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4883/comments
|
https://api.github.com/repos/psf/requests/issues/4883/events
|
https://github.com/psf/requests/issues/4883
| 385,103,742 |
MDU6SXNzdWUzODUxMDM3NDI=
| 4,883 |
requests really long compared to curl
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/2164118?v=4",
"events_url": "https://api.github.com/users/tobiasBora/events{/privacy}",
"followers_url": "https://api.github.com/users/tobiasBora/followers",
"following_url": "https://api.github.com/users/tobiasBora/following{/other_user}",
"gists_url": "https://api.github.com/users/tobiasBora/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/tobiasBora",
"id": 2164118,
"login": "tobiasBora",
"node_id": "MDQ6VXNlcjIxNjQxMTg=",
"organizations_url": "https://api.github.com/users/tobiasBora/orgs",
"received_events_url": "https://api.github.com/users/tobiasBora/received_events",
"repos_url": "https://api.github.com/users/tobiasBora/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/tobiasBora/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/tobiasBora/subscriptions",
"type": "User",
"url": "https://api.github.com/users/tobiasBora",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 5 |
2018-11-28T05:06:23Z
|
2021-11-26T05:00:33Z
|
2021-08-28T04:05:51Z
|
NONE
|
resolved
|
First thanks for the great job.
For some specific requests, requests is very slow (around 8s in average) while curl configured with more or less the same parameters is nearly instantaneous.
## Expected Result
I would expect requests to take less than 8s to proceed a request. I tried to change `Connection: close/keep-alive`, and `Accept-Encoding: identify/gzip/gzip, deflate/...`
## Reproduction Steps
On one side run:
curl -X 'GET' -H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:62.0) Gecko/20100101 Firefox/62.0' -H 'Accept-Encoding: identity' -H 'Accept: application/json, text/plain, */*' -H 'Connection: close' -H 'Referer: https://www.oui.sncf/bons-plans/tgvmax' -H 'X-CT-Locale: fr' -H 'X-User-Agent: CaptainTrain/1542980776(web) (Ember 3.4.6)' -H 'content-type: application/json' -H 'x-not-a-bot: i-am-human' 'https://www.trainline.fr/api/v5_1/stations?context=search&q=Paris'
and on the other side:
```python
import requests
from collections import OrderedDict
###### Debug tools
def pretty_string_request(req):
"""Pretty string a request"""
return '{}\n{}\n{}\n\n{}\n{}'.format(
'>>>-----------START-----------',
req.method + ' ' + req.url,
'\n'.join('{}: {}'.format(k, v) for k, v in req.headers.items()),
req.body,
'<<<-----------STOP-----------',
)
def pretty_string_response(response):
return pretty_string_request(response.request)
###### Code
# Does not order anything in fact
headers = OrderedDict([('Accept', 'application/json, text/plain, */*'),
('Accept-Encoding', 'identity'),
('Connection', 'close'),
('Referer', 'https://www.oui.sncf/bons-plans/tgvmax'),
('User-Agent', 'Mozilla/5.0 (X11; Linux x86_64; rv:62.0) Gecko/20100101 Firefox/62.0'),
('X-CT-Locale', 'fr'),
('X-User-Agent', 'CaptainTrain/1542980776(web) (Ember 3.4.6)'),
('content-type', 'application/json'),
('x-not-a-bot', 'i-am-human')])
url = 'https://www.trainline.fr/api/v5_1/stations'
payload = {'context':'search',
'q': 'Paris' }
print("Before request...")
response = requests.get(url, headers=headers, params=payload)
print("After request...")
print(pretty_string_response(response))
print(response.json())
```
I also took a wireshark capture (the first packets until N=52 included are from curl, the others are from requests). For me, the server shouldn't even be able to distinguish wether on the other side you have curl or requests as they are supposed to send the same headers...

EDIT: I also noticed that I can keep only the header `'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64; rv:62.0) Gecko/20100101 Firefox/62.0'` and this time requests is as quick as curl. However, problems arrive in two scenari: either I add the header `'Connection': 'close'` or the header `'content-type': 'application/json'`, while both options are fine with curl. Maybe is could be useful to understand why requests does not always behave as curl?
## System Information
$ python -m requests.help
```
$ python -m requests.help
{
"chardet": {
"version": "3.0.4"
},
"cryptography": {
"version": "2.3"
},
"idna": {
"version": "2.7"
},
"implementation": {
"name": "CPython",
"version": "3.6.7"
},
"platform": {
"release": "4.18.0-2-amd64",
"system": "Linux"
},
"pyOpenSSL": {
"openssl_version": "1010008f",
"version": "18.0.0"
},
"requests": {
"version": "2.20.0"
},
"system_ssl": {
"version": "1010100f"
},
"urllib3": {
"version": "1.24"
},
"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/4883/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4883/timeline
| null |
completed
| null | null | false |
[
"@kenneth-reitz @timofurrer do you know who can take a look into this?",
"Hi guys, i'm facing a similar issue. requests.get() takes ~520s. It used to be <1s. I don't know what changed to cause this huge delay. I can provide you the cProfile output.",
"@kenneth-reitz, what could be the issue? Please explain the troubleshooting steps that we can follow to fix this. ",
"I reproduced the high response time, but it does not appear to be an issue with the requests library.\r\n\r\nIt is probably some anti-crawler protection from the server. Perhaps it performs fingerprinting and recognizes that the exhibited behavior (use of HTTP/1.1) is unlikely match to match the Firefox user agent (which uses HTTP/2), and therefore decides to throttle the client.\r\n\r\nThis packet capture ([trainline-dsb.pcapng.zip](https://github.com/psf/requests/files/4533984/trainline-dsb.pcapng.zip)) captures three cases and includes the TLS decryption secrets that allows Wireshark to decrypt the result:\r\n- The curl command from the original report. Uses HTTP/2. Response time: 0.047s\r\n- The curl command plus `--http1.1`. Uses HTTP/1.1. Response time: 9.16s\r\n- The Python requests reproducer. Uses HTTP/1.1. Response time: 8.14s\r\n\r\nTo find the responses, use the \"json\" display filter. To study the whole trace, you can use the \"tls\" display filter.\r\n\r\nI believe this issue should be closed as it is not a defect in the requests library.",
"@Lekensteyn is correct about the issue. The fact that changing the user-agent resolved the issue is a clear sign that this is a server side defense mechanism. There isn't anything for Requests to do in this case."
] |
https://api.github.com/repos/psf/requests/issues/4882
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4882/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4882/comments
|
https://api.github.com/repos/psf/requests/issues/4882/events
|
https://github.com/psf/requests/pull/4882
| 384,987,658 |
MDExOlB1bGxSZXF1ZXN0MjM0MDYxNDc3
| 4,882 |
raise requests.exceptions.ReadTimeout for streaming responses
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/751650?v=4",
"events_url": "https://api.github.com/users/bgardiner/events{/privacy}",
"followers_url": "https://api.github.com/users/bgardiner/followers",
"following_url": "https://api.github.com/users/bgardiner/following{/other_user}",
"gists_url": "https://api.github.com/users/bgardiner/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/bgardiner",
"id": 751650,
"login": "bgardiner",
"node_id": "MDQ6VXNlcjc1MTY1MA==",
"organizations_url": "https://api.github.com/users/bgardiner/orgs",
"received_events_url": "https://api.github.com/users/bgardiner/received_events",
"repos_url": "https://api.github.com/users/bgardiner/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/bgardiner/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/bgardiner/subscriptions",
"type": "User",
"url": "https://api.github.com/users/bgardiner",
"user_view_type": "public"
}
|
[
{
"color": "eb6420",
"default": false,
"description": null,
"id": 44501256,
"name": "Breaking API Change",
"node_id": "MDU6TGFiZWw0NDUwMTI1Ng==",
"url": "https://api.github.com/repos/psf/requests/labels/Breaking%20API%20Change"
}
] |
closed
| false | null |
[] | null | 3 |
2018-11-27T21:11:56Z
|
2024-05-19T18:38:57Z
|
2024-05-19T18:38:57Z
|
NONE
| null |
Currently, if there is a read timeout while streaming a response, a `requests.exceptions.ConnectionError` is raised in lieu of a `requests.exceptions.ReadTimeout`. This is unexpected and [contrary to the documentation](http://docs.python-requests.org/en/latest/user/quickstart/#timeouts). As a user, I am being forced to catch the `ConnectionError` when I only actually care about the `ReadTimeout` situation.
This PR revises the streaming response code to properly raise a `requests.exceptions.ReadTimeout`, consistent with [the non-streaming request behavior](https://github.com/requests/requests/blob/57d7284c1a245cf9fbcecb594f50471d86e879f7/requests/adapters.py#L528).
I am unable to write a test for this situation since `httpbin` does not support a delay for chunked-encoded responses; see requests/httpbin#479 regarding this lack of functionality.
|
{
"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": 4,
"-1": 1,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 5,
"url": "https://api.github.com/repos/psf/requests/issues/4882/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4882/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/4882.diff",
"html_url": "https://github.com/psf/requests/pull/4882",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/4882.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/4882"
}
| true |
[
"Any thoughts on this? I think this is clearly a bug in the existing implementation...... is there something I am missing?",
"ping anyone want to take a look at this?",
"I looks like this has been fixed in the 3.0 branch, and the comments on #2392 and #5430 note that a change like this is too much of a breaking change to ship with 2.x. So maybe this should be closed? (With an explanation for people encountering the issue, please!)\r\n\r\nFWIW, though, I got here because I only recently had time to really dig into Requests and Urllib3 to understand what was happening here — this has been a longstanding issue in a codebase I maintain, where we were successfully catching some read timeouts but not others. I definitely understand I don’t speak for all users, but, like @VasiliPupkin256, having this fix in 2.x would not break me and would actually really help me clean up some messy code by making error handling more consistent (I currently catch both `Timeout` and `ConnectionError`, but for the latter case inspect the error string to decide what to do, which is really not good)."
] |
https://api.github.com/repos/psf/requests/issues/4881
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4881/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4881/comments
|
https://api.github.com/repos/psf/requests/issues/4881/events
|
https://github.com/psf/requests/issues/4881
| 384,953,673 |
MDU6SXNzdWUzODQ5NTM2NzM=
| 4,881 |
Cookies from Response don't show up in cookies list
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1813375?v=4",
"events_url": "https://api.github.com/users/jcrmatos/events{/privacy}",
"followers_url": "https://api.github.com/users/jcrmatos/followers",
"following_url": "https://api.github.com/users/jcrmatos/following{/other_user}",
"gists_url": "https://api.github.com/users/jcrmatos/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/jcrmatos",
"id": 1813375,
"login": "jcrmatos",
"node_id": "MDQ6VXNlcjE4MTMzNzU=",
"organizations_url": "https://api.github.com/users/jcrmatos/orgs",
"received_events_url": "https://api.github.com/users/jcrmatos/received_events",
"repos_url": "https://api.github.com/users/jcrmatos/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/jcrmatos/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jcrmatos/subscriptions",
"type": "User",
"url": "https://api.github.com/users/jcrmatos",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 6 |
2018-11-27T19:37:27Z
|
2021-09-06T00:06:42Z
|
2018-11-28T13:02:10Z
|
NONE
|
resolved
|
Hello,
I receive a response (checked with Chrome/Firefox inspector) from the post request with the following headers:
Cache-control: no-cache, no-store, max-age=0
Connection: Keep-Alive
Content-Language: pt
Content-Type: text/html
Pragma: no-cache
Set-cookie: Cookie=sid=46c76f5a656dcb9092e7c2840b0a9747fe248af99bc7e62e372bfcede16c0e63:Language:portuguese:id=1;path=/
Transfer-Encoding: chunked
X-Frame-Options: SAMEORIGIN
but the cookies don't appear in the response.cookies or the session.cookies.
## Expected Result
The cookies should appear in the response cookies list.
## Actual Result
Both cookies lists are empty.
200
200
<RequestsCookieJar[]>
<RequestsCookieJar[]>
## Reproduction Steps
```python
import requests
headers = {
'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8',
'Accept-Encoding': 'gzip, deflate',
'Accept-Language': 'pt-PT,pt;q=0.9,en-US;q=0.8,en;q=0.7',
'Cache-Control': 'no-cache',
'Connection': 'keep-alive',
'Cookie': 'Cookie=sid=254f086ef66799f95c777d1e681ac2b3380a80f4c7faa172163a261eaab2da12:Language:portuguese:id=1',
'Pragma': 'no-cache',
'Upgrade-Insecure-Requests': '1',
'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.102 Safari/537.36',
}
headers_login = {
'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8',
'Accept-Encoding': 'gzip, deflate',
'Accept-Language': 'pt-PT,pt;q=0.9,en-US;q=0.8,en;q=0.7',
'Cache-Control': 'max-age=0',
'Connection': 'keep-alive',
'Content-Length': '89',
'Content-Type': 'application/x-www-form-urlencoded',
'Cookie': 'Cookie=body:Language:portuguese:id=-1',
'DNT': '1',
'Host': '192.168.255.254',
'Origin': 'http://192.168.255.254',
'Referer': 'http://192.168.255.254/',
'Upgrade-Insecure-Requests': '1',
'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.102 Safari/537.36',
}
with requests.Session() as s:
resp = s.get('http://192.168.255.254', headers=headers)
print(resp.status_code)
resp = s.post('http://192.168.255.254/login.cgi',
data={'UserName': 'username', 'PassWord': 'password',
'x.X_HW_Token': 'c95075d23616ccc9c149ec82c651becd'},
headers=headers_login)
print(resp.status_code)
print(resp.cookies)
print(s.cookies)
```
## System Information
$ python -m requests.help
```
{
"chardet": {
"version": "3.0.4"
},
"cryptography": {
"version": ""
},
"idna": {
"version": "2.7"
},
"implementation": {
"name": "CPython",
"version": "3.7.0"
},
"platform": {
"release": "7",
"system": "Windows"
},
"pyOpenSSL": {
"openssl_version": "",
"version": null
},
"requests": {
"version": "2.19.1"
},
"system_ssl": {
"version": "1010008f"
},
"urllib3": {
"version": "1.23"
},
"using_pyopenssl": false
}
```
Thanks,
JM
|
{
"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/4881/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4881/timeline
| null |
completed
| null | null | false |
[
"- Are there redirects? Check `resp.history` and those responses' cookie jars.\r\n- Is the cookie header ever present in `resp.headers`?\r\n- Are you expecting the cookie header you're sending to show up in the headers on the response or session? This won't work\r\n- Have you read over the myriad of other closed issues that are just like this one?",
"Hello,\r\n\r\nNo, no redirects that I can find. resp.history is empty.\r\nNo it does not appear in the response.headers from requests, but I see it in Chrome/Firefox inspect response headers.\r\nNo, I'm expecting the cookie header that I receive to appear in the response cookies list, or at least in the response headers.\r\nYes, I read them.\r\n\r\nThanks,\r\n\r\nJM",
"> No it does not appear in the response.headers from requests, but I see it in Chrome/Firefox inspect response headers.\r\n\r\nThen this is why it doesn't show up in your cookiejar. If there is no header returned to us, we can't pull the cookie strings out of thin air.\r\n\r\nIt would seem the server isn't returning the value to you and therein lies the problem",
"Hello,\r\n\r\nAs I stated \"No it does not appear in the response.headers from requests, **but I see it in Chrome/Firefox inspect response headers.**\"\r\nThe server IS sending the header because I see it in Chrome/Firefox.\r\n\r\nThanks,\r\nJM",
"It is not sending it to us though. We don't modify the headers at all. If it doesn't show up in our headers dictionary, the server isn't sending it.",
"Hello,\r\n\r\nYour are correct. It was sending it to the browser (Chrome/Firefox) but not to the requests module.\r\nThere was a token missing in the request headers. As soon as I added the missing token, requests received the cookie headers and everything showed up.\r\nSorry for the inconvenience and thanks for the help.\r\n\r\nThanks,\r\n\r\nJM"
] |
https://api.github.com/repos/psf/requests/issues/4880
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4880/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4880/comments
|
https://api.github.com/repos/psf/requests/issues/4880/events
|
https://github.com/psf/requests/issues/4880
| 384,521,303 |
MDU6SXNzdWUzODQ1MjEzMDM=
| 4,880 |
`requests.utils.guess_json_utf` breaks on Python 3
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/8718473?v=4",
"events_url": "https://api.github.com/users/annakovale/events{/privacy}",
"followers_url": "https://api.github.com/users/annakovale/followers",
"following_url": "https://api.github.com/users/annakovale/following{/other_user}",
"gists_url": "https://api.github.com/users/annakovale/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/annakovale",
"id": 8718473,
"login": "annakovale",
"node_id": "MDQ6VXNlcjg3MTg0NzM=",
"organizations_url": "https://api.github.com/users/annakovale/orgs",
"received_events_url": "https://api.github.com/users/annakovale/received_events",
"repos_url": "https://api.github.com/users/annakovale/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/annakovale/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/annakovale/subscriptions",
"type": "User",
"url": "https://api.github.com/users/annakovale",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 1 |
2018-11-26T21:38:13Z
|
2021-09-06T00:06:43Z
|
2018-11-26T21:48:13Z
|
NONE
|
resolved
|
Unable to use `Response.json()`. I notice `requests.utils.guess_json_utf` expects type str but then breaks at `sample.count(_null)`, understandably because `<str>.count(<bytes)` is not valid - [see the function here](https://github.com/requests/requests/blob/57d7284c1a245cf9fbcecb594f50471d86e879f7/requests/utils.py#L851-L886).
## Expected Result
```In [10]: from requests.models import Response
In [11]: response_dict = {'foo':'bar'}
In [12]: response = Response()
In [13]: response.status_code = 200
In [14]: response._content = json.dumps(response_dict)
In [15]: response.json()
'{'foo': 'bar'}'
```
## Actual Result
```
In [10]: from requests.models import Response
In [11]: response_dict = {'foo':'bar'}
In [12]: response = Response()
In [13]: response.status_code = 200
In [14]: response._content = json.dumps(response_dict)
In [15]: response.json()
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-15-670418389d1b> in <module>()
----> 1 response.json()
/data/virtualenv/py3default/lib/python3.6/site-packages/requests/models.py in json(self, **kwargs)
882 # decoding fails, fall back to `self.text` (using chardet to make
883 # a best guess).
--> 884 encoding = guess_json_utf(self.content)
885 if encoding is not None:
886 try:
/data/virtualenv/py3default/lib/python3.6/site-packages/requests/utils.py in guess_json_utf(data)
868 if sample[:2] in (codecs.BOM_UTF16_LE, codecs.BOM_UTF16_BE):
869 return 'utf-16' # BOM included
--> 870 nullcount = sample.count(_null)
871 if nullcount == 0:
872 return 'utf-8'
TypeError: must be str, not bytes
```
## Reproduction Steps
Follow the steps in Actual Result
## System Information
```
(py3default) deploy@lemon:/data/shared/buffet/bokchoy/tests$ python -m requests.help
{
"chardet": {
"version": "3.0.4"
},
"cryptography": {
"version": "2.3.1"
},
"idna": {
"version": "2.7"
},
"implementation": {
"name": "CPython",
"version": "3.6.6"
},
"platform": {
"release": "4.4.0-51-generic",
"system": "Linux"
},
"pyOpenSSL": {
"openssl_version": "1010009f",
"version": "18.0.0"
},
"requests": {
"version": "2.19.1"
},
"system_ssl": {
"version": "1000207f"
},
"urllib3": {
"version": "1.23"
},
"using_pyopenssl": true
}
(py3default) deploy@lemon:/data/shared/buffet/bokchoy/tests$ python --version
Python 3.6.6
```
Possibly related to: https://github.com/requests/requests/issues/4879
|
{
"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/4880/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4880/timeline
| null |
completed
| null | null | false |
[
"Yep, this is a dupe of #4879. We’ll track there."
] |
https://api.github.com/repos/psf/requests/issues/4879
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4879/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4879/comments
|
https://api.github.com/repos/psf/requests/issues/4879/events
|
https://github.com/psf/requests/issues/4879
| 384,447,145 |
MDU6SXNzdWUzODQ0NDcxNDU=
| 4,879 |
cannot use json() on request in python 3.7 (TypeError: must be str, not bytes)
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/825210?v=4",
"events_url": "https://api.github.com/users/uvwild/events{/privacy}",
"followers_url": "https://api.github.com/users/uvwild/followers",
"following_url": "https://api.github.com/users/uvwild/following{/other_user}",
"gists_url": "https://api.github.com/users/uvwild/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/uvwild",
"id": 825210,
"login": "uvwild",
"node_id": "MDQ6VXNlcjgyNTIxMA==",
"organizations_url": "https://api.github.com/users/uvwild/orgs",
"received_events_url": "https://api.github.com/users/uvwild/received_events",
"repos_url": "https://api.github.com/users/uvwild/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/uvwild/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/uvwild/subscriptions",
"type": "User",
"url": "https://api.github.com/users/uvwild",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 8 |
2018-11-26T18:02:51Z
|
2021-08-30T00:06:17Z
|
2018-12-10T15:51:29Z
|
NONE
|
resolved
|
Summary.
Calling this code is not working in python 3.6 on ubuntu.
There is a change adding .encode('ascii')
to the _null constant which causes the type error.
Removing the encoding call fixes the problem!
I am confused!
## Expected Result
no exception
## Actual Result
TypeError: must be str, not bytes
## Reproduction Steps
```python
import requests
jsonstr="{ 'bla' : 'blub'}"
resp = requests.Response()
resp._content = jsonstr
resp.json()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python3/dist-packages/requests/models.py", line 880, in json
encoding = guess_json_utf(self.content)
File "/usr/lib/python3/dist-packages/requests/utils.py", line 798, in guess_json_utf
nullcount = sample.count(_null)
TypeError: must be str, not bytes
```
## System Information
$ python3 -m requests.help
```
"chardet": {
"version": "3.0.4"
},
"cryptography": {
"version": ""
},
"idna": {
"version": "2.7"
},
"implementation": {
"name": "CPython",
"version": "3.6.7"
},
"platform": {
"release": "4.15.0-39-lowlatency",
"system": "Linux"
},
"pyOpenSSL": {
"openssl_version": "",
"version": null
},
"requests": {
"version": "2.18.4"
},
"system_ssl": {
"version": "1010007f"
},
"urllib3": {
"version": "1.21.1"
},
"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).
ubuntu 18.04 (ubuntustudio)
|
{
"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/4879/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4879/timeline
| null |
completed
| null | null | false |
[
"OK I found the remark elsewhere to require requests.content to be bytes.\r\nI just migrated to python3 and this was a hidden magic functional change from python 2.\r\nWhen I added the byte conversion it worked.\r\n\r\nHow can we avoid such intransparent changes in the API?\r\nHow am I supposed to know this?\r\n\r\nIn java it would be totally transparent and annotated as @Deprecated\r\nDue to the python autotyping this is not so easy.\r\n\r\nHow about a test for string type on the parameter and an appropriate error message instead of a type error? Or at least some more comment somewhere that the type has changed?\r\nLike augmenting line comment added to the encode() line with changed to byte as the content attribute!\r\n",
"So it is possible in python. Just nobody bothered.\r\n\r\nThis is what I found in base64: \r\n\r\n warnings.warn(\"encodestring() is a deprecated alias since 3.1, \"\r\n \"use encodebytes()\",\r\n DeprecationWarning, 2)\r\n",
"Forgive me if I'm misunderstanding but setting `Response._content` to a value seems like mucking with internals which has no guarantees compared to the \"public\" interface. If the expected type of `_content` is bytes during regular usage by requests you would have to conform to that as well if you plan on using the code this way.",
"@SethMichaelLarson is correct, this is outside of Requests defined usage. You’re setting a private variable to an unepexcted type. This shouldn’t be possible with normal use of the Requests API.\r\n\r\n@uvwild can you please provide some more details on how you reached this state. Is it reproducible without manually setting _content?",
"@nateprewitt spoiler, it's not reproducible without accessing otherwise private attributes.",
"Resolving since we haven't received a response in the last two weeks. Feel free to reopen if you have a concrete example that doesn't use private methods or variables. Thanks!",
"for anyone else who get this error - just make content bytes\r\n```\r\nresp = requests.Response()\r\nresp._content = b\"{ 'bla' : 'blub'}\"\r\n```",
"According commit msg bellow of commit https://github.com/psf/requests/pull/909/commits/4decc7986e32bb8f3511df3dd0c9b1c1d57453c1. [And the type of native string in python2 is bytes but in python3 is text](https://portingguide.readthedocs.io/en/latest/strings.html#the-native-string), so we need to convert it into bytes explicitly in python3\r\n\"\r\n\r\n\"JSON *must* be encoded using UTF-8, UTF-16 or UTF-32 (see the [RFC][1]; detect the encoding based on the fact that JSON always starts with 2 ASCII characters.\""
] |
https://api.github.com/repos/psf/requests/issues/4878
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4878/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4878/comments
|
https://api.github.com/repos/psf/requests/issues/4878/events
|
https://github.com/psf/requests/issues/4878
| 383,192,808 |
MDU6SXNzdWUzODMxOTI4MDg=
| 4,878 |
Use a certificate
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/764040?v=4",
"events_url": "https://api.github.com/users/metropt/events{/privacy}",
"followers_url": "https://api.github.com/users/metropt/followers",
"following_url": "https://api.github.com/users/metropt/following{/other_user}",
"gists_url": "https://api.github.com/users/metropt/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/metropt",
"id": 764040,
"login": "metropt",
"node_id": "MDQ6VXNlcjc2NDA0MA==",
"organizations_url": "https://api.github.com/users/metropt/orgs",
"received_events_url": "https://api.github.com/users/metropt/received_events",
"repos_url": "https://api.github.com/users/metropt/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/metropt/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/metropt/subscriptions",
"type": "User",
"url": "https://api.github.com/users/metropt",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 2 |
2018-11-21T16:16:24Z
|
2021-09-06T00:06:43Z
|
2018-11-22T12:41:36Z
|
NONE
|
resolved
|
I'm trying to use a certificate with requests. I need to use a certificate to access internal services at work. I have installed it on chrome per example to access some internal sites.
With curl I can use it that way: `curl -s --cacert /home/path/certificate.crt -u USER:PASSWORD https://server:8443/teste`
With requests I can't make it work. I have already read some old closed issues without success. I also created a post on stack-overflow but I couldn't understand the answers I got on comments. https://stackoverflow.com/questions/53340465/cant-use-a-crt-certificate
I use the command
`r = requests.get('https://server:8443/teste', auth=HTTPBasicAuth('USER', 'PASSWORD'), verify='/home/path/certificate.crt')`
with result:
`requests.exceptions.SSLError: HTTPSConnectionPool(host='server', port=8443): Max retries exceeded with url: /teste (Caused by SSLError(SSLError(1, u'[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:590)'),))`
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/4878/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4878/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.",
"Hi, thank you. I tried to get help there without success :("
] |
https://api.github.com/repos/psf/requests/issues/4877
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4877/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4877/comments
|
https://api.github.com/repos/psf/requests/issues/4877/events
|
https://github.com/psf/requests/issues/4877
| 382,676,665 |
MDU6SXNzdWUzODI2NzY2NjU=
| 4,877 |
Make a seperate repo for requests3.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4",
"events_url": "https://api.github.com/users/kennethreitz/events{/privacy}",
"followers_url": "https://api.github.com/users/kennethreitz/followers",
"following_url": "https://api.github.com/users/kennethreitz/following{/other_user}",
"gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/kennethreitz",
"id": 119893,
"login": "kennethreitz",
"node_id": "MDQ6VXNlcjExOTg5Mw==",
"organizations_url": "https://api.github.com/users/kennethreitz/orgs",
"received_events_url": "https://api.github.com/users/kennethreitz/received_events",
"repos_url": "https://api.github.com/users/kennethreitz/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions",
"type": "User",
"url": "https://api.github.com/users/kennethreitz",
"user_view_type": "public"
}
|
[
{
"color": "fef2c0",
"default": false,
"description": null,
"id": 298537994,
"name": "Needs More Information",
"node_id": "MDU6TGFiZWwyOTg1Mzc5OTQ=",
"url": "https://api.github.com/repos/psf/requests/labels/Needs%20More%20Information"
},
{
"color": "1cff91",
"default": false,
"description": "",
"id": 860696300,
"name": "3.0",
"node_id": "MDU6TGFiZWw4NjA2OTYzMDA=",
"url": "https://api.github.com/repos/psf/requests/labels/3.0"
}
] |
closed
| true |
{
"avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4",
"events_url": "https://api.github.com/users/kennethreitz/events{/privacy}",
"followers_url": "https://api.github.com/users/kennethreitz/followers",
"following_url": "https://api.github.com/users/kennethreitz/following{/other_user}",
"gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/kennethreitz",
"id": 119893,
"login": "kennethreitz",
"node_id": "MDQ6VXNlcjExOTg5Mw==",
"organizations_url": "https://api.github.com/users/kennethreitz/orgs",
"received_events_url": "https://api.github.com/users/kennethreitz/received_events",
"repos_url": "https://api.github.com/users/kennethreitz/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions",
"type": "User",
"url": "https://api.github.com/users/kennethreitz",
"user_view_type": "public"
}
|
[
{
"avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4",
"events_url": "https://api.github.com/users/kennethreitz/events{/privacy}",
"followers_url": "https://api.github.com/users/kennethreitz/followers",
"following_url": "https://api.github.com/users/kennethreitz/following{/other_user}",
"gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/kennethreitz",
"id": 119893,
"login": "kennethreitz",
"node_id": "MDQ6VXNlcjExOTg5Mw==",
"organizations_url": "https://api.github.com/users/kennethreitz/orgs",
"received_events_url": "https://api.github.com/users/kennethreitz/received_events",
"repos_url": "https://api.github.com/users/kennethreitz/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions",
"type": "User",
"url": "https://api.github.com/users/kennethreitz",
"user_view_type": "public"
}
] | null | 6 |
2018-11-20T14:01:36Z
|
2021-02-20T14:42:15Z
|
2019-04-27T11:38:30Z
|
CONTRIBUTOR
|
resolved
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4",
"events_url": "https://api.github.com/users/kennethreitz/events{/privacy}",
"followers_url": "https://api.github.com/users/kennethreitz/followers",
"following_url": "https://api.github.com/users/kennethreitz/following{/other_user}",
"gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/kennethreitz",
"id": 119893,
"login": "kennethreitz",
"node_id": "MDQ6VXNlcjExOTg5Mw==",
"organizations_url": "https://api.github.com/users/kennethreitz/orgs",
"received_events_url": "https://api.github.com/users/kennethreitz/received_events",
"repos_url": "https://api.github.com/users/kennethreitz/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions",
"type": "User",
"url": "https://api.github.com/users/kennethreitz",
"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/4877/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4877/timeline
| null |
completed
| null | null | false |
[
"Why?",
"Indeed, why? I thought it would be easier to keep things in a single place (at least from a user PoV).",
"Is it https://github.com/kennethreitz/requests3?",
"it is indeed! It's a different namespace, and a different package.",
"https://github.com/kennethreitz/requests3",
"It would be better to create requests2, should someone need that, and drop python 2 support. Things that depend on the name requests can pin to an old version."
] |
|
https://api.github.com/repos/psf/requests/issues/4876
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4876/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4876/comments
|
https://api.github.com/repos/psf/requests/issues/4876/events
|
https://github.com/psf/requests/issues/4876
| 381,779,381 |
MDU6SXNzdWUzODE3NzkzODE=
| 4,876 |
chunk_size=None does not work as expected when streaming a response
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/2375201?v=4",
"events_url": "https://api.github.com/users/hiranya911/events{/privacy}",
"followers_url": "https://api.github.com/users/hiranya911/followers",
"following_url": "https://api.github.com/users/hiranya911/following{/other_user}",
"gists_url": "https://api.github.com/users/hiranya911/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/hiranya911",
"id": 2375201,
"login": "hiranya911",
"node_id": "MDQ6VXNlcjIzNzUyMDE=",
"organizations_url": "https://api.github.com/users/hiranya911/orgs",
"received_events_url": "https://api.github.com/users/hiranya911/received_events",
"repos_url": "https://api.github.com/users/hiranya911/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/hiranya911/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/hiranya911/subscriptions",
"type": "User",
"url": "https://api.github.com/users/hiranya911",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 6 |
2018-11-16T22:14:17Z
|
2021-08-31T00:06:48Z
|
2018-12-30T23:50:30Z
|
NONE
|
resolved
|
Summary.
I have the following code to stream an SSE response.
```
resp = session.get(self.url, stream=True)
resp_iterator = resp.iter_content(decode_unicode=True, chunk_size=None)
while _some_condition():
nextchar = next(resp_iterator)
_add_to_buffer(nextchar)
```
## Expected Result
According to the [documentation](http://docs.python-requests.org/en/master/api/#requests.Response.iter_content), when chunk_size is None, it should stream the content as it is received.
## Actual Result
No content is received by the consumer. It simply hangs. If I simply remove the chunk_size argument, I can see the consumer receiving 1 byte at a time.
## System Information
$ python -m requests.help
```
{
"chardet": {
"version": "3.0.4"
},
"cryptography": {
"version": ""
},
"idna": {
"version": "2.7"
},
"implementation": {
"name": "CPython",
"version": "2.7.13"
},
"platform": {
"release": "4.17.0-3rodete2-amd64",
"system": "Linux"
},
"pyOpenSSL": {
"openssl_version": "",
"version": null
},
"requests": {
"version": "2.20.1"
},
"system_ssl": {
"version": "1010008f"
},
"urllib3": {
"version": "1.24.1"
},
"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/4876/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4876/timeline
| null |
completed
| null | null | false |
[
"I suspect that this is an issue with urllib3's stream method that wasn't caught when it was changed.\r\n\r\nhttps://github.com/requests/requests/blob/57d7284c1a245cf9fbcecb594f50471d86e879f7/requests/models.py#L750",
"The two modes within `HTTPResponse.stream()` (being `HTTPResponse.read()` and `HTTPResponse.read_chunked()`) both *appear* to support setting `amt=None` and it's the default parameter for all three. Do you know where that regression may have been introduced @sigmavirus24?\r\n\r\nIt'd be great to know what the headers are for the HTTP response you're getting here because a lot of the behavior within `HTTPResponse.stream()` is determined by a few headers.",
"As a quick FYI, I did some minimal debugging and this appears to only be reproducible with Requests and not with generic usage of urllib3. It's likely our adapters code may be doing something to the urllib3 Reponse object that isn't being tested for in Requests or urllib3.\r\n\r\n**Requests Repro**\r\n```python\r\nimport requests\r\nr = requests.get('https://httpbin.org/get', stream=True)\r\nfor i in r.iter_content(chunk_size=0):\r\n print(i) # We hang on the first iter here at the line Sigmavirus24 noted\r\n```\r\n\r\n@sethmlarson, None and 0 appear to operate the same way, both causing hangs. I don't think we changed anything around this recently, but it may be something specific to how Requests is using urllib3. I'll have some time this weekend to do some poking to figure out what's going on.",
"Thanks for the repro! I'll step through it and see what I find. Also did you see my comment in the previous PR related to this issue?\r\n\r\nEDIT: I wasn't able to reproduce a hang with Python 2.7.15 with the latest urllib3 using `chunk_size=None` but `chunk_size=0` definitely hangs indefinitely per my comment in the other PR.",
"Hi @hiranya911, after a closer look, it doesn't appear this is reproducible. A more concrete repro will terminate with a `StopIteration` exception. My best guess here is the server is failing to respond completely and when you go to consume the content, it's hanging indefinitely until the connection is terminated.\r\n\r\nI don't believe there's a lot more we can do here presently without a repro that's available with public resources. If the case turns out that the connection is hanging, Requests doesn't have an ability to control that and the issue lies with the server. I'm going to close this for now, but feel free to reopen if you do find a reproducible example of a bug in the Requests code. Thanks!\r\n\r\n\r\n**Basic Repro**\r\n```python\r\nimport requests\r\n \r\ncount = 0\r\n\r\nresp = requests.Session().get('https://www.google.com', stream=True)\r\nresp_iterator = resp.iter_content(decode_unicode=True, chunk_size=None)\r\nwhile count < 1000:\r\n nextchar = next(resp_iterator)\r\n count+=1\r\n\r\nprint(count)\r\n```",
"@nateprewitt hi, is there really no way to detect such situations on the requests side? We're facing a similar problem right now, and it looks like we have to wait a lot until the connection is deemed dead before we can retry."
] |
https://api.github.com/repos/psf/requests/issues/4875
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4875/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4875/comments
|
https://api.github.com/repos/psf/requests/issues/4875/events
|
https://github.com/psf/requests/issues/4875
| 381,273,610 |
MDU6SXNzdWUzODEyNzM2MTA=
| 4,875 |
Cryptiles dependency vulnerability: Update to >4.1.2
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/21318528?v=4",
"events_url": "https://api.github.com/users/carlosscastro/events{/privacy}",
"followers_url": "https://api.github.com/users/carlosscastro/followers",
"following_url": "https://api.github.com/users/carlosscastro/following{/other_user}",
"gists_url": "https://api.github.com/users/carlosscastro/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/carlosscastro",
"id": 21318528,
"login": "carlosscastro",
"node_id": "MDQ6VXNlcjIxMzE4NTI4",
"organizations_url": "https://api.github.com/users/carlosscastro/orgs",
"received_events_url": "https://api.github.com/users/carlosscastro/received_events",
"repos_url": "https://api.github.com/users/carlosscastro/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/carlosscastro/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/carlosscastro/subscriptions",
"type": "User",
"url": "https://api.github.com/users/carlosscastro",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 2 |
2018-11-15T17:52:12Z
|
2021-09-06T00:06:44Z
|
2018-11-15T18:41:17Z
|
NONE
|
resolved
|
Hello!
In some of the Microsoft Bot Framework repos have a dependency on request which has an indirect dependency on Cryptiles. We are getting a warning from a security vulnerability that would be solved upgrading cryptyles to >4.1.2.
It seems like it is an indirect dependency of yours. Any idea how I can fix this vulnerability or plans to somehow upgrade cryptiles dependency?
Thanks!
|
{
"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/4875/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4875/timeline
| null |
completed
| null | null | false |
[
"Hi @carlosscastro, we shouldn’t have any dependencies on that package. Can you tell us how you determined this was tied back to Requests?",
"I took a look and that is a JavaScript package. Requests only contains python code, so I think this may be filed in the wrong repository. Perhaps you were looking for the request/request repo."
] |
https://api.github.com/repos/psf/requests/issues/4874
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4874/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4874/comments
|
https://api.github.com/repos/psf/requests/issues/4874/events
|
https://github.com/psf/requests/pull/4874
| 380,750,779 |
MDExOlB1bGxSZXF1ZXN0MjMwODc2Mjc5
| 4,874 |
Add build badge for Azure Pipelines
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/20052233?v=4",
"events_url": "https://api.github.com/users/kaylangan/events{/privacy}",
"followers_url": "https://api.github.com/users/kaylangan/followers",
"following_url": "https://api.github.com/users/kaylangan/following{/other_user}",
"gists_url": "https://api.github.com/users/kaylangan/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/kaylangan",
"id": 20052233,
"login": "kaylangan",
"node_id": "MDQ6VXNlcjIwMDUyMjMz",
"organizations_url": "https://api.github.com/users/kaylangan/orgs",
"received_events_url": "https://api.github.com/users/kaylangan/received_events",
"repos_url": "https://api.github.com/users/kaylangan/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/kaylangan/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/kaylangan/subscriptions",
"type": "User",
"url": "https://api.github.com/users/kaylangan",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 0 |
2018-11-14T15:27:39Z
|
2021-09-01T00:11:45Z
|
2018-11-14T15:33:07Z
|
CONTRIBUTOR
|
resolved
|
Not sure if you want to add a build badge since you didn't have one before. But if you do, here's yours for Azure Pipelines.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4",
"events_url": "https://api.github.com/users/kennethreitz/events{/privacy}",
"followers_url": "https://api.github.com/users/kennethreitz/followers",
"following_url": "https://api.github.com/users/kennethreitz/following{/other_user}",
"gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/kennethreitz",
"id": 119893,
"login": "kennethreitz",
"node_id": "MDQ6VXNlcjExOTg5Mw==",
"organizations_url": "https://api.github.com/users/kennethreitz/orgs",
"received_events_url": "https://api.github.com/users/kennethreitz/received_events",
"repos_url": "https://api.github.com/users/kennethreitz/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions",
"type": "User",
"url": "https://api.github.com/users/kennethreitz",
"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/4874/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4874/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/4874.diff",
"html_url": "https://github.com/psf/requests/pull/4874",
"merged_at": "2018-11-14T15:33:07Z",
"patch_url": "https://github.com/psf/requests/pull/4874.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/4874"
}
| true |
[] |
https://api.github.com/repos/psf/requests/issues/4873
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4873/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4873/comments
|
https://api.github.com/repos/psf/requests/issues/4873/events
|
https://github.com/psf/requests/issues/4873
| 380,460,732 |
MDU6SXNzdWUzODA0NjA3MzI=
| 4,873 |
SSLError(SSLError(0, 'unknown error (_ssl.c:3517)
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/34018539?v=4",
"events_url": "https://api.github.com/users/JeetBhattachariya/events{/privacy}",
"followers_url": "https://api.github.com/users/JeetBhattachariya/followers",
"following_url": "https://api.github.com/users/JeetBhattachariya/following{/other_user}",
"gists_url": "https://api.github.com/users/JeetBhattachariya/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/JeetBhattachariya",
"id": 34018539,
"login": "JeetBhattachariya",
"node_id": "MDQ6VXNlcjM0MDE4NTM5",
"organizations_url": "https://api.github.com/users/JeetBhattachariya/orgs",
"received_events_url": "https://api.github.com/users/JeetBhattachariya/received_events",
"repos_url": "https://api.github.com/users/JeetBhattachariya/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/JeetBhattachariya/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/JeetBhattachariya/subscriptions",
"type": "User",
"url": "https://api.github.com/users/JeetBhattachariya",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 1 |
2018-11-13T22:54:37Z
|
2021-09-06T00:06:37Z
|
2018-12-31T00:00:58Z
|
NONE
|
resolved
|
I am trying to invoke a api which is sitting in a load balancer server. The server uses certificate chain which i downloaded from browser in .p7b file and passing in my code
`r=request.get(uri,headers=header,verify='certificate.p7b').`
Even I tried generating .pem file through openssl commands, but it didn't work. I also tried using "verify=False" sttement. But getting the same error:
Please help.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/5271761?v=4",
"events_url": "https://api.github.com/users/nateprewitt/events{/privacy}",
"followers_url": "https://api.github.com/users/nateprewitt/followers",
"following_url": "https://api.github.com/users/nateprewitt/following{/other_user}",
"gists_url": "https://api.github.com/users/nateprewitt/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/nateprewitt",
"id": 5271761,
"login": "nateprewitt",
"node_id": "MDQ6VXNlcjUyNzE3NjE=",
"organizations_url": "https://api.github.com/users/nateprewitt/orgs",
"received_events_url": "https://api.github.com/users/nateprewitt/received_events",
"repos_url": "https://api.github.com/users/nateprewitt/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/nateprewitt/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/nateprewitt/subscriptions",
"type": "User",
"url": "https://api.github.com/users/nateprewitt",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/4873/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4873/timeline
| null |
completed
| null | null | false |
[
"Hi @JeetBhattachariya, this is an exception in _ssl.c on line 3517. That's code within CPython, so without an exact version of your interpreter and likely a dummy cert that we can reproduce this with, it's going to be very difficult to debug.\r\n\r\nWe can take a closer look if you can provide all of the information you originally requested, but this appears to be a cert or standard library issue. [StackOverflow](https://www.stackoverflow.com) is probably a better venue for that though since this doesn't appear to be an issue with Requests code base. I'm going to close this for now, but feel free to add a link to the StackOverflow question if you choose to create one."
] |
https://api.github.com/repos/psf/requests/issues/4872
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4872/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4872/comments
|
https://api.github.com/repos/psf/requests/issues/4872/events
|
https://github.com/psf/requests/issues/4872
| 380,394,221 |
MDU6SXNzdWUzODAzOTQyMjE=
| 4,872 |
Connect and Trace methods not supported
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/12761574?v=4",
"events_url": "https://api.github.com/users/javixeneize/events{/privacy}",
"followers_url": "https://api.github.com/users/javixeneize/followers",
"following_url": "https://api.github.com/users/javixeneize/following{/other_user}",
"gists_url": "https://api.github.com/users/javixeneize/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/javixeneize",
"id": 12761574,
"login": "javixeneize",
"node_id": "MDQ6VXNlcjEyNzYxNTc0",
"organizations_url": "https://api.github.com/users/javixeneize/orgs",
"received_events_url": "https://api.github.com/users/javixeneize/received_events",
"repos_url": "https://api.github.com/users/javixeneize/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/javixeneize/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/javixeneize/subscriptions",
"type": "User",
"url": "https://api.github.com/users/javixeneize",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 1 |
2018-11-13T19:49:15Z
|
2021-09-05T00:06:59Z
|
2019-02-14T15:02:19Z
|
NONE
|
resolved
|
Hi
There are some http methods, as connect and trace, that apparently are not supported by request library.
Is there any way of sending a request using those methods with requests library?
Thanks
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/6740665?v=4",
"events_url": "https://api.github.com/users/lmiguelvargasf/events{/privacy}",
"followers_url": "https://api.github.com/users/lmiguelvargasf/followers",
"following_url": "https://api.github.com/users/lmiguelvargasf/following{/other_user}",
"gists_url": "https://api.github.com/users/lmiguelvargasf/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/lmiguelvargasf",
"id": 6740665,
"login": "lmiguelvargasf",
"node_id": "MDQ6VXNlcjY3NDA2NjU=",
"organizations_url": "https://api.github.com/users/lmiguelvargasf/orgs",
"received_events_url": "https://api.github.com/users/lmiguelvargasf/received_events",
"repos_url": "https://api.github.com/users/lmiguelvargasf/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/lmiguelvargasf/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/lmiguelvargasf/subscriptions",
"type": "User",
"url": "https://api.github.com/users/lmiguelvargasf",
"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/4872/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4872/timeline
| null |
completed
| null | null | false |
[
"Closed since it is seems not relevant."
] |
https://api.github.com/repos/psf/requests/issues/4871
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4871/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4871/comments
|
https://api.github.com/repos/psf/requests/issues/4871/events
|
https://github.com/psf/requests/issues/4871
| 380,254,230 |
MDU6SXNzdWUzODAyNTQyMzA=
| 4,871 |
respect no_proxy environment variable and proxies['no'] parameter
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/12958815?v=4",
"events_url": "https://api.github.com/users/milahu/events{/privacy}",
"followers_url": "https://api.github.com/users/milahu/followers",
"following_url": "https://api.github.com/users/milahu/following{/other_user}",
"gists_url": "https://api.github.com/users/milahu/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/milahu",
"id": 12958815,
"login": "milahu",
"node_id": "MDQ6VXNlcjEyOTU4ODE1",
"organizations_url": "https://api.github.com/users/milahu/orgs",
"received_events_url": "https://api.github.com/users/milahu/received_events",
"repos_url": "https://api.github.com/users/milahu/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/milahu/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/milahu/subscriptions",
"type": "User",
"url": "https://api.github.com/users/milahu",
"user_view_type": "public"
}
|
[] |
open
| false | null |
[] | null | 13 |
2018-11-13T14:33:10Z
|
2024-02-23T11:46:37Z
| null |
NONE
| null |
make requests respect no_proxy settings
bugfix attached
## Expected Result
http requests to 'white listed urls' should bypass all proxies
white listed urls, as defined in the no_proxy env var
## Actual Result
proxies are not bypassed
the sample script will raise
requests.exceptions.ConnectionError: SOCKSHTTPConnectionPool ....: Max retries exceeded with url: / (Caused by NewConnectionError('<urllib3.contrib.socks.SOCKSConnection object at ....>: Failed to establish a new connection: 0x01: General SOCKS server failure',))
## Reproduction Steps
use case: torify python requests, but also allow requests to localhost etc.
<details>
<summary>sample script</summary>
```python
#!/usr/bin/python2
# license = public domain
import os
import random
import time
import requests
import BaseHTTPServer
import thread
import bs4
tor_host = '127.0.0.1'
#tor_port = 9050 # system-wide tor
tor_port = 9150 # torbrowser tor
# do not use tor to connect to local or private hosts
# see https://en.wikipedia.org/wiki/Reserved_IP_addresses
no_proxy_list = [
# hostnames are not resolved locally with socks5h proxy
'localhost',
'localhost.localdomain',
# IPv4
'127.0.0.0/8', # localhost
# subnets
'169.254.0.0/16',
'255.255.255.255',
# LAN aka private networks
'10.0.0.0/8',
'100.64.0.0/10',
'172.16.0.0/12',
'192.0.0.0/24',
'192.168.0.0/16',
'198.18.0.0/15',
# IPv6
'::1/128', # localhost
'fc00::/7', # LAN
'fe80::/10', # link-local
]
# variant 1
os.environ['no_proxy'] = ','.join(no_proxy_list)
def get_tor_session(tor_host='127.0.0.1', tor_port=9050,
torbrowser_headers=[], no_proxy_list=[]):
session = requests.session()
# variant 1
session.trust_env = True
#session.trust_env = False # ignore environment variables
# socks5h scheme = remote DNS = no DNS leaks
p = 'socks5h://{0}:{1}'.format(tor_host, tor_port)
session.proxies = {
'http' : p,
'https': p,
# variant 2
'no': ','.join(no_proxy_list)
}
if torbrowser_headers == []:
print('warning. got no torbrowser_headers')
# at least imitate torbrowser from year 2018
torbrowser_headers = [
('accept-language', 'en-US,en;q=0.5'),
('accept', 'text/html,application/xhtml+xml,' \
+ 'application/xml;q=0.9,*/*;q=0.8'),
('user-agent', 'Mozilla/5.0 (Windows NT 6.1; rv:60.0) ' \
+ 'Gecko/20100101 Firefox/60.0'),
('upgrade-insecure-requests', '1'),
]
for k, v in torbrowser_headers:
# header 'host' is dynamic
# header 'connection' = 'keep-alive' is set internally
if k not in ['host', 'connection']:
session.headers[k] = v
return session
tor = get_tor_session(tor_host, tor_port, [], no_proxy_list)
test_host = '127.0.0.1'
test_port = random.randint(8000, 16000)
test_url = 'http://{0}:{1}/'.format(test_host, test_port)
def test_tor_get(test_url):
time.sleep(2) # wait for http server to start
tor.get(test_url)
thread.start_new_thread(test_tor_get, (test_url,))
test_headers = [] # global
class test_handler(BaseHTTPServer.BaseHTTPRequestHandler):
def do_GET(self): # handle GET request
global test_headers
test_headers = self.headers.items()
self.send_response(204, 'No Content')
self.end_headers()
serv = BaseHTTPServer.HTTPServer((test_host, test_port), test_handler)
serv.handle_request() # handle one request
del serv
print('tor.get headers')
for k, v in test_headers:
print('header %s: %s' % (k, v))
#print('tor ip '+tor.get("http://httpbin.org/ip").text)
print('tor check ' + \
bs4.BeautifulSoup(
tor.get("https://check.torproject.org/").text, 'html.parser'
).title.string.strip())
```
</details>
## System Information
* python2
* current git-version of requests
## ~~Bugfix~~ Quickfix
the bug is in sessions.py
proxies = merge_setting(proxies, self.proxies)
where [request_]proxies was set to {} by utils.get_environ_proxies *
but proxies is set to session_proxies
\* with os.environ['no_proxy'] = '127.0.0.1'
this bugfix will respect both
* no_proxy environment variable aka os.environ['no_proxy']
* proxies['no'] parameter for requests.get and requests.session
<details>
<summary>patch</summary>
```diff
--- a/utils.py
+++ b/utils.py
@@ -757,7 +757,7 @@
:rtype: dict
"""
if should_bypass_proxies(url, no_proxy=no_proxy):
- return {}
+ return {'__bypass_proxies': True}
else:
return getproxies()
--- a/sessions.py
+++ b/sessions.py
@@ -698,8 +698,15 @@
verify = (os.environ.get('REQUESTS_CA_BUNDLE') or
os.environ.get('CURL_CA_BUNDLE'))
+ if 'no' in self.proxies:
+ if should_bypass_proxies(url, no_proxy=self.proxies['no']):
+ proxies = {'__bypass_proxies': True}
+
# Merge all the kwargs.
- proxies = merge_setting(proxies, self.proxies)
+ if '__bypass_proxies' in proxies:
+ proxies = {} # bypass proxies for this request
+ else:
+ proxies = merge_setting(proxies, self.proxies)
stream = merge_setting(stream, self.stream)
verify = merge_setting(verify, self.verify)
cert = merge_setting(cert, self.cert)
```
</details>
| null |
{
"+1": 14,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 14,
"url": "https://api.github.com/repos/psf/requests/issues/4871/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4871/timeline
| null | null | null | null | false |
[
"no interest in fixing this bug?\r\n",
"heloo?\r\n",
"Any update on this topic?",
"I am unsure how contributing to Python has changed over the years, but there is an issue for this matter documented here from 2017:\r\nhttps://bugs.python.org/issue29142",
"*Note: I've stumbled upon this issue as part of debugging some unrelated problem.*\r\n\r\nLooking into it, I noticed that this issue focuses on adding **IP addresses** to the `no_proxy` setting.\r\nFrom the available documentation I could find, `no_proxy` is supposed to be a comma-separated list of **domain names**; IP address aren't supported:\r\n- Curl: https://curl.haxx.se/docs/manpage.html#NOPROXY\r\n- Wget: https://www.gnu.org/software/wget/manual/html_node/Proxies.html\r\n\r\nWhen running with a domain name, `no_proxy` is properly honoured by `requests`:\r\n\r\n```python\r\n>>> import os, requests\r\n\r\n# Invalid proxy address; exemption for example.com\r\n>>> os.environ['no_proxy'], os.environ['https_proxy']\r\n('example.com', 'http://localhost:1/')\r\n\r\n# Requests to example.com DO bypass the proxy\r\n>>> requests.get('http://example.com')\r\n<Response [200]>\r\n\r\n# Requests to example.org DON'T bypass the proxy, and fail.\r\n>>> requests.get('http://example.org')\r\nTraceback (most recent call last):\r\n[...]\r\nrequests.exceptions.ProxyError: HTTPConnectionPool(host='localhost', port=1): Max retries exceeded with url: http://example.org/ (Caused by ProxyError('Cannot connect to proxy.', NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7fec85a53c10>: Failed to establish a new connection: [Errno 111] Connection refused')))\r\n```\r\n\r\nAs far as I can tell, there is no issue in *requests* here: the library's behaviour is consistent with other HTTP clients in its handling of `no_proxy`.\r\n\r\nFor the original use case (bypassing a tor proxy for some IPs), it might be useful to add an additional local proxy that connects directly for those IPs, and chains to Tor for other addresses.",
"> `no_proxy` is supposed to be a comma-separated list of **domain names**; IP address aren't supported\r\n\r\nno, this just makes no sense. \r\nnetwork nodes always have a numeric address, and only sometimes have a hostname.\r\nunder the hood, hostnames are always resolved to numeric ads.\r\n\r\ncurl docs - https://curl.haxx.se/docs/manpage.html#NOPROXY\r\n> NO_PROXY <comma-separated list of hosts/domains> \r\n> ....\r\n> The list of host names **can also be include numerical IP addresses**, and IPv6 versions should then be given without enclosing brackets. \r\n\r\nwget docs - https://www.gnu.org/software/wget/manual/html_node/Proxies.html\r\n> https_proxy\r\n> If set, the http_proxy and https_proxy variables should contain the **URLs of the proxies** for HTTP and HTTPS connections respectively.\r\n>\r\n> no_proxy\r\n> This variable should contain a comma-separated list of **domain extensions** proxy should not be used for. For instance, if the value of no_proxy is ‘.mit.edu’, proxy will not be used to retrieve documents from MIT. \r\n\r\nthis is misleading.\r\nURL hosts can be numeric-address or hostname.\r\n*_proxy values should be consistent, so no_proxy also should accept any valid URL,\r\nwhere subnetworks also are valid resources - blocking of resources should allow for \"fuzzy\" IDs / wildcard IDs\r\n\r\njust wanted to leave this comment here, i have lost interest in fixing the issue",
"@nateprewitt can you check if the patch in OP's can be patched into requests? Because as requests is now, it does not honor the `no_proxy`\r\n\r\n`requests.get('http://10.0.0.200:4454/abc.txt', proxies={'http': 'http://broken-ass-proxy.com', 'https': 'https://broken-ass-proxy.com'})`\r\nWill error out with `requests.exceptions.ProxyError`, as expected.\r\n\r\n`requests.get('http://10.0.0.200:4454/abc.txt', proxies={'no_proxy': '10.0.0.200', 'http': 'http://broken-ass-proxy.com', 'https': 'https://broken-ass-proxy.com'})`\r\nWill error out with `requests.exceptions.ProxyError`. This should not happen, as the no_proxy should take effect, before the http and https. The request should have been sent directly.\r\n\r\nBut with the patch that @milahu provided, the no_proxy is honored and works as intended.",
"**>>WITH OP's PATCH<<**\r\n\r\n\r\n```python\r\nimport requests\r\ns = requests.Session()\r\ns.proxies = {'no_proxy':'10.0.0.200', 'http': 'http://broken-ass-proxy.com'}\r\ns.get('http://10.0.0.200:4454/abc.txt')\r\n```\r\nWill end up with `requests.exceptions.ProxyError: HTTPConnectionPool(host='broken-ass-proxy.com', port=80): Max retries exceeded with url`\r\nCreating a session and assigning it some porxies, seems to fail in this case.\r\n\r\nSeems that the `s.proxies` is never called in `s.get`, meaning that the call https://github.com/psf/requests/blob/967a05bfffcb68f97296eda197b062221c2ebc0d/requests/sessions.py#L530-L534 will always get an empty proxy var. Which in turn will mess with the following logic and prevent the `no_proxy` from working as intended. Followed by `get_environ_proxies` > `should_bypass_proxies` def, which needs the no_proxy to be extracted, to determine if the proxy should be bypassed or not https://github.com/psf/requests/blob/02eb5a2cd34d36548ebb08528c73ca66c2a398d9/requests/sessions.py#L708-L713",
"> @nateprewitt can you check if the patch in OP's can be patched into requests?\r\n\r\nnot the original patch, cos it breaks a function interface by adding a hidden property to the return object (quick n dirty), [which makes a test fail](https://github.com/psf/requests/pull/5287)\r\n\r\nif you wanna fix this, you will have to change the function interface (return nested object with proxy-map and optional parameters) and update the test",
"The longer I look at it, it starts making more sense to call `should_bypass_proxies(url, no_proxy)` inside `merge_environment_settings` just before https://github.com/psf/requests/blob/967a05bfffcb68f97296eda197b062221c2ebc0d/requests/sessions.py#L722\r\nAnd decide if `proxy` is to be foreced to `{}` or allowed to merge proxies.",
"Coming across this now, is there any way in python to no_proxy an ip range (like a 10.0.0.0/8)? According to this, no: https://about.gitlab.com/blog/2021/01/27/we-need-to-talk-no-proxy/#no_proxy. Article mentions curl discussion which is interesting to look at too: https://github.com/curl/curl/issues/1208",
"Code that works as expected:\r\n```\r\nimport os\r\nimport sys\r\nimport requests\r\nimport traceback\r\n\r\nurl = \"https://github.com\"\r\n\r\n# When only environment variables are passed, everything works as expected\r\n# requests module will take them into account and go through the defined proxies\r\n# unless no_proxy matches.\r\nos.environ.update({\r\n \"http_proxy\": \"http://dummy-proxy.com:443\",\r\n \"https_proxy\": \"http://dummy-proxy.com:443\",\r\n # \"no_proxy\": \".whatever.com\" # Uncomment to fail with env proxies\r\n \"no_proxy\": \".github.com\" # Uncomment to pass with env proxies\r\n})\r\n\r\nwith requests.Session() as session:\r\n req = requests.Request(method=\"GET\", url=url)\r\n prep = session.prepare_request(req)\r\n settings = session.merge_environment_settings(prep.url, None, None, None, None)\r\n try:\r\n print(session.request(method=\"GET\", url=url, timeout=1))\r\n except requests.exceptions.ProxyError:\r\n print(traceback.format_exc().strip().splitlines()[-1], file=sys.stderr)\r\n finally:\r\n print(\"\\nProxies:\", settings.get(\"proxies\"))\r\n```\r\n\r\nCode that DOESN'T works as expected:\r\n```\r\nimport os\r\nimport sys\r\nimport requests\r\nimport traceback\r\n\r\nurl = \"https://github.com\"\r\n\r\n# When only environment variables are passed, everything works as expected\r\n# requests module will take them into account and go through the defined proxies\r\n# unless no_proxy matches.\r\nos.environ.update({\r\n \"http_proxy\": \"http://dummy-proxy.com:443\",\r\n \"https_proxy\": \"http://dummy-proxy.com:443\",\r\n # \"no_proxy\": \".whatever.com\" # Uncomment to fail with env proxies\r\n \"no_proxy\": \".github.com\" # Uncomment to pass with env proxies\r\n})\r\n\r\n# Doesn't work even if adding \"no\": \".github.com\" or \"no_proxy\": \".github.com\" inside the proxies kwarg\r\nproxies = {\"http\": \"http://dummy-proxy.com:443\", \"https\": \"http://dummy-proxy.com:443\"}\r\n\r\nwith requests.Session() as session:\r\n req = requests.Request(method=\"GET\", url=url)\r\n prep = session.prepare_request(req)\r\n settings = session.merge_environment_settings(prep.url, proxies, None, None, None)\r\n try:\r\n print(session.request(method=\"GET\", proxies=proxies, url=url, timeout=1))\r\n except requests.exceptions.ProxyError:\r\n print(traceback.format_exc().strip().splitlines()[-1], file=sys.stderr)\r\n finally:\r\n print(\"\\nProxies:\", settings.get(\"proxies\"))\r\n```\r\n\r\nLike @milahu said, the issue comes from [utils.get_environ_proxies](https://github.com/psf/requests/blob/v2.31.0/requests/utils.py#L824) and [sessions.merge_environment_settings](https://github.com/psf/requests/blob/v2.31.0/requests/sessions.py#L751)",
"https://github.com/psf/requests/pull/5596#issuecomment-1961184126"
] |
https://api.github.com/repos/psf/requests/issues/4870
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4870/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4870/comments
|
https://api.github.com/repos/psf/requests/issues/4870/events
|
https://github.com/psf/requests/pull/4870
| 380,202,451 |
MDExOlB1bGxSZXF1ZXN0MjMwNDU3MTU5
| 4,870 |
Delete appveyor.yml
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4",
"events_url": "https://api.github.com/users/kennethreitz/events{/privacy}",
"followers_url": "https://api.github.com/users/kennethreitz/followers",
"following_url": "https://api.github.com/users/kennethreitz/following{/other_user}",
"gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/kennethreitz",
"id": 119893,
"login": "kennethreitz",
"node_id": "MDQ6VXNlcjExOTg5Mw==",
"organizations_url": "https://api.github.com/users/kennethreitz/orgs",
"received_events_url": "https://api.github.com/users/kennethreitz/received_events",
"repos_url": "https://api.github.com/users/kennethreitz/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions",
"type": "User",
"url": "https://api.github.com/users/kennethreitz",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 0 |
2018-11-13T12:27:45Z
|
2021-09-01T00:11:43Z
|
2018-11-13T12:51:26Z
|
CONTRIBUTOR
|
resolved
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4",
"events_url": "https://api.github.com/users/kennethreitz/events{/privacy}",
"followers_url": "https://api.github.com/users/kennethreitz/followers",
"following_url": "https://api.github.com/users/kennethreitz/following{/other_user}",
"gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/kennethreitz",
"id": 119893,
"login": "kennethreitz",
"node_id": "MDQ6VXNlcjExOTg5Mw==",
"organizations_url": "https://api.github.com/users/kennethreitz/orgs",
"received_events_url": "https://api.github.com/users/kennethreitz/received_events",
"repos_url": "https://api.github.com/users/kennethreitz/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions",
"type": "User",
"url": "https://api.github.com/users/kennethreitz",
"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/4870/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4870/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/4870.diff",
"html_url": "https://github.com/psf/requests/pull/4870",
"merged_at": "2018-11-13T12:51:25Z",
"patch_url": "https://github.com/psf/requests/pull/4870.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/4870"
}
| true |
[] |
|
https://api.github.com/repos/psf/requests/issues/4869
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4869/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4869/comments
|
https://api.github.com/repos/psf/requests/issues/4869/events
|
https://github.com/psf/requests/pull/4869
| 379,919,635 |
MDExOlB1bGxSZXF1ZXN0MjMwMjQzMTg1
| 4,869 |
Set up CI with Azure Pipelines
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/20052233?v=4",
"events_url": "https://api.github.com/users/kaylangan/events{/privacy}",
"followers_url": "https://api.github.com/users/kaylangan/followers",
"following_url": "https://api.github.com/users/kaylangan/following{/other_user}",
"gists_url": "https://api.github.com/users/kaylangan/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/kaylangan",
"id": 20052233,
"login": "kaylangan",
"node_id": "MDQ6VXNlcjIwMDUyMjMz",
"organizations_url": "https://api.github.com/users/kaylangan/orgs",
"received_events_url": "https://api.github.com/users/kaylangan/received_events",
"repos_url": "https://api.github.com/users/kaylangan/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/kaylangan/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/kaylangan/subscriptions",
"type": "User",
"url": "https://api.github.com/users/kaylangan",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 9 |
2018-11-12T19:27:56Z
|
2021-09-01T00:11:44Z
|
2018-11-13T12:11:50Z
|
CONTRIBUTOR
|
resolved
|
Currently, CI and PR validation are run on AppVeyor and Travis using pretty different configurations. This PR shows how [Azure Pipelines](https://azure.microsoft.com/en-us/services/devops/pipelines/) could be used to unify the pipeline configuration and run CI and PR checks more quickly. Azure Pipelines offers unlimited minutes with 10 parallel jobs.
The first commit attempts to match the AppVeyor and Travis builds apples to apples. You can see in the [build results](https://dev.azure.com/kaylangan-github/kangantest-requests/_build/results?buildId=229&view=logs) that Azure Pipelines typically runs the Linux jobs in <2 minutes and the Windows jobs in ~5 minutes. The Linux jobs are slightly faster than on Travis; the Windows jobs, though individually slower than on AppVeyor, are faster because of the additional parallelism.
The second commit unifies the build using a single configuration. CI is run only on Linux and coverage only on Windows. Here's an example of the [build results](https://dev.azure.com/kaylangan-github/kangantest-requests/_build/results?buildId=245&view=logs). I also hooked up test reporting for the Linux builds which you can see [here](https://dev.azure.com/kaylangan-github/kangantest-requests/_build/results?buildId=245&view=ms.vss-test-web.test-result-details):

I was a little concerned that the Windows builds appear to fail intermittently, but I noticed that AppVeyor seems to have the same flakiness?
Would you consider trying out Azure Pipelines and adding it as additional validation for PR/CI?
Disclaimer: I'm a Program Manager on Azure Pipelines.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4",
"events_url": "https://api.github.com/users/kennethreitz/events{/privacy}",
"followers_url": "https://api.github.com/users/kennethreitz/followers",
"following_url": "https://api.github.com/users/kennethreitz/following{/other_user}",
"gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/kennethreitz",
"id": 119893,
"login": "kennethreitz",
"node_id": "MDQ6VXNlcjExOTg5Mw==",
"organizations_url": "https://api.github.com/users/kennethreitz/orgs",
"received_events_url": "https://api.github.com/users/kennethreitz/received_events",
"repos_url": "https://api.github.com/users/kennethreitz/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions",
"type": "User",
"url": "https://api.github.com/users/kennethreitz",
"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/4869/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4869/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/4869.diff",
"html_url": "https://github.com/psf/requests/pull/4869",
"merged_at": "2018-11-13T12:11:50Z",
"patch_url": "https://github.com/psf/requests/pull/4869.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/4869"
}
| true |
[
"# [Codecov](https://codecov.io/gh/requests/requests/pull/4869?src=pr&el=h1) Report\n> Merging [#4869](https://codecov.io/gh/requests/requests/pull/4869?src=pr&el=desc) into [master](https://codecov.io/gh/requests/requests/commit/bedd9284c9646e50c10b3defdf519d4ba479e2c7?src=pr&el=desc) will **not change** coverage.\n> The diff coverage is `n/a`.\n\n[](https://codecov.io/gh/requests/requests/pull/4869?src=pr&el=tree)\n\n```diff\n@@ Coverage Diff @@\n## master #4869 +/- ##\n=======================================\n Coverage 66.89% 66.89% \n=======================================\n Files 15 15 \n Lines 1577 1577 \n=======================================\n Hits 1055 1055 \n Misses 522 522\n```\n\n\n\n------\n\n[Continue to review full report at Codecov](https://codecov.io/gh/requests/requests/pull/4869?src=pr&el=continue).\n> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)\n> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`\n> Powered by [Codecov](https://codecov.io/gh/requests/requests/pull/4869?src=pr&el=footer). Last update [bedd928...086655e](https://codecov.io/gh/requests/requests/pull/4869?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).\n",
":sparkles: :cake: :sparkles:\r\n\r\nWe’ve been very happy with Azure Pipelines for Pipenv!",
"Could you sponsor the ‘kennethreitz’ org for free pipelines?\r\n\r\nAlso, I’m getting this error when setting it up:\r\n\r\n> Unexpected vmImage",
"got it working!",
"Since the project is public, you're already set up for the free 10 pipelines. Let me know if you need anything else!",
"I meant for parallel builds :)",
"Yup, you should be all set! Let me know if you're seeing otherwise.",
"Thanks so much!",
"@kennethreitz Can you add @nateprewitt and myself to the \"kennethreitz\" org for Pipelines? Otherwise, I'm going to ask that we remove this if we don't have a way of modifying/updating the CI bulds."
] |
https://api.github.com/repos/psf/requests/issues/4868
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4868/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4868/comments
|
https://api.github.com/repos/psf/requests/issues/4868/events
|
https://github.com/psf/requests/pull/4868
| 379,557,508 |
MDExOlB1bGxSZXF1ZXN0MjI5OTc0NDUz
| 4,868 |
Add Python 3.7 to tox test matrix
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/347634?v=4",
"events_url": "https://api.github.com/users/jdufresne/events{/privacy}",
"followers_url": "https://api.github.com/users/jdufresne/followers",
"following_url": "https://api.github.com/users/jdufresne/following{/other_user}",
"gists_url": "https://api.github.com/users/jdufresne/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/jdufresne",
"id": 347634,
"login": "jdufresne",
"node_id": "MDQ6VXNlcjM0NzYzNA==",
"organizations_url": "https://api.github.com/users/jdufresne/orgs",
"received_events_url": "https://api.github.com/users/jdufresne/received_events",
"repos_url": "https://api.github.com/users/jdufresne/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/jdufresne/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jdufresne/subscriptions",
"type": "User",
"url": "https://api.github.com/users/jdufresne",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 1 |
2018-11-11T20:02:36Z
|
2021-09-01T00:11:47Z
|
2018-11-13T12:51:37Z
|
CONTRIBUTOR
|
resolved
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4",
"events_url": "https://api.github.com/users/kennethreitz/events{/privacy}",
"followers_url": "https://api.github.com/users/kennethreitz/followers",
"following_url": "https://api.github.com/users/kennethreitz/following{/other_user}",
"gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/kennethreitz",
"id": 119893,
"login": "kennethreitz",
"node_id": "MDQ6VXNlcjExOTg5Mw==",
"organizations_url": "https://api.github.com/users/kennethreitz/orgs",
"received_events_url": "https://api.github.com/users/kennethreitz/received_events",
"repos_url": "https://api.github.com/users/kennethreitz/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions",
"type": "User",
"url": "https://api.github.com/users/kennethreitz",
"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/4868/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4868/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/4868.diff",
"html_url": "https://github.com/psf/requests/pull/4868",
"merged_at": "2018-11-13T12:51:37Z",
"patch_url": "https://github.com/psf/requests/pull/4868.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/4868"
}
| true |
[
"# [Codecov](https://codecov.io/gh/requests/requests/pull/4868?src=pr&el=h1) Report\n> Merging [#4868](https://codecov.io/gh/requests/requests/pull/4868?src=pr&el=desc) into [master](https://codecov.io/gh/requests/requests/commit/bedd9284c9646e50c10b3defdf519d4ba479e2c7?src=pr&el=desc) will **not change** coverage.\n> The diff coverage is `n/a`.\n\n[](https://codecov.io/gh/requests/requests/pull/4868?src=pr&el=tree)\n\n```diff\n@@ Coverage Diff @@\n## master #4868 +/- ##\n=======================================\n Coverage 66.89% 66.89% \n=======================================\n Files 15 15 \n Lines 1577 1577 \n=======================================\n Hits 1055 1055 \n Misses 522 522\n```\n\n\n\n------\n\n[Continue to review full report at Codecov](https://codecov.io/gh/requests/requests/pull/4868?src=pr&el=continue).\n> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)\n> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`\n> Powered by [Codecov](https://codecov.io/gh/requests/requests/pull/4868?src=pr&el=footer). Last update [bedd928...779fd6e](https://codecov.io/gh/requests/requests/pull/4868?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).\n"
] |
|
https://api.github.com/repos/psf/requests/issues/4867
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4867/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4867/comments
|
https://api.github.com/repos/psf/requests/issues/4867/events
|
https://github.com/psf/requests/pull/4867
| 379,556,883 |
MDExOlB1bGxSZXF1ZXN0MjI5OTc0MDQ3
| 4,867 |
Simplify tox.ini
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/347634?v=4",
"events_url": "https://api.github.com/users/jdufresne/events{/privacy}",
"followers_url": "https://api.github.com/users/jdufresne/followers",
"following_url": "https://api.github.com/users/jdufresne/following{/other_user}",
"gists_url": "https://api.github.com/users/jdufresne/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/jdufresne",
"id": 347634,
"login": "jdufresne",
"node_id": "MDQ6VXNlcjM0NzYzNA==",
"organizations_url": "https://api.github.com/users/jdufresne/orgs",
"received_events_url": "https://api.github.com/users/jdufresne/received_events",
"repos_url": "https://api.github.com/users/jdufresne/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/jdufresne/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jdufresne/subscriptions",
"type": "User",
"url": "https://api.github.com/users/jdufresne",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 1 |
2018-11-11T19:55:31Z
|
2021-09-01T00:11:47Z
|
2018-11-13T12:52:07Z
|
CONTRIBUTOR
|
resolved
|
Tox installs the package to the virtualenv by default. PySocks is
already included in test_requirements. Don't need to install these
explicitly.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4",
"events_url": "https://api.github.com/users/kennethreitz/events{/privacy}",
"followers_url": "https://api.github.com/users/kennethreitz/followers",
"following_url": "https://api.github.com/users/kennethreitz/following{/other_user}",
"gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/kennethreitz",
"id": 119893,
"login": "kennethreitz",
"node_id": "MDQ6VXNlcjExOTg5Mw==",
"organizations_url": "https://api.github.com/users/kennethreitz/orgs",
"received_events_url": "https://api.github.com/users/kennethreitz/received_events",
"repos_url": "https://api.github.com/users/kennethreitz/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions",
"type": "User",
"url": "https://api.github.com/users/kennethreitz",
"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/4867/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4867/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/4867.diff",
"html_url": "https://github.com/psf/requests/pull/4867",
"merged_at": "2018-11-13T12:52:07Z",
"patch_url": "https://github.com/psf/requests/pull/4867.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/4867"
}
| true |
[
"# [Codecov](https://codecov.io/gh/requests/requests/pull/4867?src=pr&el=h1) Report\n> Merging [#4867](https://codecov.io/gh/requests/requests/pull/4867?src=pr&el=desc) into [master](https://codecov.io/gh/requests/requests/commit/bedd9284c9646e50c10b3defdf519d4ba479e2c7?src=pr&el=desc) will **not change** coverage.\n> The diff coverage is `n/a`.\n\n[](https://codecov.io/gh/requests/requests/pull/4867?src=pr&el=tree)\n\n```diff\n@@ Coverage Diff @@\n## master #4867 +/- ##\n=======================================\n Coverage 66.89% 66.89% \n=======================================\n Files 15 15 \n Lines 1577 1577 \n=======================================\n Hits 1055 1055 \n Misses 522 522\n```\n\n\n\n------\n\n[Continue to review full report at Codecov](https://codecov.io/gh/requests/requests/pull/4867?src=pr&el=continue).\n> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)\n> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`\n> Powered by [Codecov](https://codecov.io/gh/requests/requests/pull/4867?src=pr&el=footer). Last update [bedd928...af63554](https://codecov.io/gh/requests/requests/pull/4867?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).\n"
] |
https://api.github.com/repos/psf/requests/issues/4866
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4866/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4866/comments
|
https://api.github.com/repos/psf/requests/issues/4866/events
|
https://github.com/psf/requests/issues/4866
| 379,199,811 |
MDU6SXNzdWUzNzkxOTk4MTE=
| 4,866 |
Unexpected exception: InvalidURL: No host specified.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/193463?v=4",
"events_url": "https://api.github.com/users/stratosgear/events{/privacy}",
"followers_url": "https://api.github.com/users/stratosgear/followers",
"following_url": "https://api.github.com/users/stratosgear/following{/other_user}",
"gists_url": "https://api.github.com/users/stratosgear/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/stratosgear",
"id": 193463,
"login": "stratosgear",
"node_id": "MDQ6VXNlcjE5MzQ2Mw==",
"organizations_url": "https://api.github.com/users/stratosgear/orgs",
"received_events_url": "https://api.github.com/users/stratosgear/received_events",
"repos_url": "https://api.github.com/users/stratosgear/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/stratosgear/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/stratosgear/subscriptions",
"type": "User",
"url": "https://api.github.com/users/stratosgear",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 7 |
2018-11-09T15:11:45Z
|
2021-09-06T00:06:44Z
|
2018-11-12T14:29:28Z
|
NONE
|
resolved
|
I have some legacy code that calls requests like this:
```
response = requests.get(file_resource['url'], stream=True)
```
Through debug statements right before that statement I see that the passed url is like:
```
http://xxxxxx.xxxx.xxx.int/xxx-sl-int/data-action?ProductType=MAP&MAP.MAP_OID=12655
```
That url, btw, correctly resolves into a 200MB file, in the browser or through a curl/wget download.
## Expected Result
I'd expect my file to be downloaded (when I later try to:
```
for block in response.iter_content(100 * 1024):
handle.write(block)
```
## Actual Result
I get the following stack trace:
```
Failed with: Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/rq/worker.py", line 710, in perform_job
rv = job.perform()
File "/usr/local/lib/python2.7/dist-packages/rq/job.py", line 560, in perform
self._result = self._execute()
File "/usr/local/lib/python2.7/dist-packages/rq/job.py", line 566, in _execute
return self.func(*self.args, **self.kwargs)
File "/plaavi/components/file_cache/worker.py", line 1131, in download
return worker.download(fileResource)
File "/plaavi/components/file_cache/worker.py", line 112, in download
response = requests.get(file_resource['url'], stream=True)
File "/usr/local/lib/python2.7/dist-packages/requests/api.py", line 75, in get
return request('get', url, params=params, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/requests/api.py", line 60, in request
return session.request(method=method, url=url, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/requests/sessions.py", line 533, in request
resp = self.send(prep, **send_kwargs)
File "/usr/local/lib/python2.7/dist-packages/requests/sessions.py", line 668, in send
history = [resp for resp in gen] if allow_redirects else []
File "/usr/local/lib/python2.7/dist-packages/requests/sessions.py", line 247, in resolve_redirects
**adapter_kwargs
File "/usr/local/lib/python2.7/dist-packages/requests/sessions.py", line 646, in send
r = adapter.send(request, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/requests/adapters.py", line 414, in send
raise InvalidURL(e, request=request)
InvalidURL: No host specified.
```
## Reproduction Steps
```python
>>> import requests
>>> response = requests.get("http://xxxxxx.xxxx.xxx.int/xxx-sl-int/data-action?ProductType=MAP&MAP.MAP_OID=12655", stream=True)
>>> response
<Response [200]>
```
Apparently trying the request from the same-ish machine that cause the exception, is working.
What is different in the actual exception case, is that the request to download happens inside an RQ (http://python-rq.org/) worker running inside a docker container, that I do not know how to further debug. Mind you that kind of download infrastructure, was working correctly the last two years and only now it starts to have these downloading issues.
## System Information
The docker container is setup like this:
$ python -m requests.help
```
root@9dd4bc57a320:/tmp# python -m requests.help
{
"chardet": {
"version": "3.0.4"
},
"cryptography": {
"version": "2.2.1"
},
"idna": {
"version": ""
},
"implementation": {
"name": "CPython",
"version": "2.7.6"
},
"platform": {
"release": "3.10.0-862.11.6.el7.x86_64",
"system": "Linux"
},
"pyOpenSSL": {
"openssl_version": "1010007f",
"version": "18.0.0"
},
"requests": {
"version": "2.20.1"
},
"system_ssl": {
"version": "1000106f"
},
"urllib3": {
"version": "1.24.1"
},
"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).
Thanks!
|
{
"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/4866/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4866/timeline
| null |
completed
| null | null | false |
[
"I double checked all the python requirements and the only outdated, from the ones mentioned above, is the `cryptography` one from 2.2.1 to 2.3.1.\r\n\r\nI will try to upgrade that one, and report if it makes any difference.",
"OK, that didn't help, although upgrading `cryptography` now leads to:\r\n\r\n```\r\nroot@4d17f93cfd7a:/tmp# python -m requests.help\r\n/usr/local/lib/python2.7/dist-packages/cryptography/hazmat/primitives/constant_time.py:26: CryptographyDeprecationWarning: Support for your Python version is deprecated. The next version of cryptography will remove support. Please upgrade to a 2.7.x release that supports hmac.compare_digest as soon as possible.\r\n utils.DeprecatedIn23,\r\n{\r\n \"chardet\": {\r\n \"version\": \"3.0.4\"\r\n },\r\n \"cryptography\": {\r\n \"version\": \"2.3.1\"\r\n },\r\n \"idna\": {\r\n \"version\": \"\"\r\n },\r\n \"implementation\": {\r\n \"name\": \"CPython\",\r\n \"version\": \"2.7.6\"\r\n },\r\n \"platform\": {\r\n \"release\": \"3.10.0-862.11.6.el7.x86_64\",\r\n \"system\": \"Linux\"\r\n },\r\n \"pyOpenSSL\": {\r\n \"openssl_version\": \"1010009f\",\r\n \"version\": \"18.0.0\"\r\n },\r\n \"requests\": {\r\n \"version\": \"2.20.1\"\r\n },\r\n \"system_ssl\": {\r\n \"version\": \"1000106f\"\r\n },\r\n \"urllib3\": {\r\n \"version\": \"1.24.1\"\r\n },\r\n \"using_pyopenssl\": true\r\n}\r\n```\r\n\r\nBut I really think that this is unrelated!\r\n\r\nThanks, once again.",
"@stratosgear, this looks like an issue with the URI you’re providing. If you use the code below, what is the value returned? If it’s None or empty, then this is a problem with the URI or a bug in the urlparse function in the Python standard library.\r\n\r\n```python\r\nfrom requests.compat import urlparse\r\n\r\nURL = \"http://yourURI.here\"\r\n\r\nparsed = urlparse(URL)\r\nprint(parsed.hostname)\r\n```",
"Hmmm, I do not think so. I used the sample you suggested ([taken from here](https://github.com/requests/requests/blob/v2.20.1/requests/adapters.py#L313) I guess) and the url is parsed correctly.\r\n\r\nI do get: `xxxxxx.xxxx.xxx.int` just as I should (sorry for obfuscating it)\r\n\r\nI'm afraid I'll have to bite the bullet and fork requests, add additional debug statements, point to my fork, recompile the docker containers and try again, unless no other suggestions pop up... :(\r\n",
"Further debugging reveals that the `resolve_redirects` at `sessions.py:665` follows a non existent redirect, (as my url does not redirect anywhere), and somehow dropping the host part of the url, as the debug below shows (whichjust prints the value of the url in various places):\r\n\r\n```\r\n11/12/2018 11:26:07 AM api.py:75 url: http://xxxxxx.xxxx.xxx.int/pla-sl-int/data-action?ProductType=MAP&MAP.MAP_OID=12655\r\n11/12/2018 11:26:07 AM adapters.py:412 url: http://xxxxxx.xxxx.xxx.int/pla-sl-int/data-action?ProductType=MAP&MAP.MAP_OID=12655\r\n11/12/2018 11:26:07 AM adapters.py:412 url: https:///pla-sl-int/data-action?ProductType=MAP&MAP.MAP_OID=12655\r\n```\r\n\r\nAs I do not understand what goes on in 'resolve_redirects' and it is difficult for me to debug it in the place this occurs due to my setup, is there anyone else that can understand what goes on in that method and why it drops the hostname....?\r\n\r\nThanks!\r\n\r\nNote: I'm debugging from the v2.20.1 release branch.",
"> follows a non existent redirect, (as my url does not redirect anywhere),\r\n\r\nWe do exactly what the server tells us meaning that your URL must redirect somewhere.\r\n\r\nThis is not a bug in Requests and this is not a forum for helping you debug your infrastructure. It's only for actual defects in Requests, which this does not appear to be.",
"For completeness sake this was an issue in our code base. There was a rogue:\r\n\r\n```\r\nhttplib.HTTPConnection._http_vsn = 10\r\nhttplib.HTTPConnection._http_vsn_str = 'HTTP/1.0'\r\n```\r\n\r\nthat I have no idea what it was trying to achieve, Removing this, helps the url to resolve correctly.\r\n\r\nAnd yes, I know this is not a forum, but I did not ask anyone to help me debug my infrastructure. I honestly thought that I came across a requests bug, and I did whatever was humanly possible to debug the issue as best I could, even patching requests to help me find where the issue was. I provided, step by step progress report on what I was doing along the way. Ok, it's finally an issue in our infrastructure but that last comment was uncalled for, and really leaves me walking away from here with a bad taste in my mouth..."
] |
https://api.github.com/repos/psf/requests/issues/4865
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4865/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4865/comments
|
https://api.github.com/repos/psf/requests/issues/4865/events
|
https://github.com/psf/requests/pull/4865
| 379,137,121 |
MDExOlB1bGxSZXF1ZXN0MjI5Njc0Mzgy
| 4,865 |
Changes to improve intelligibility
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/40767897?v=4",
"events_url": "https://api.github.com/users/spitGlued/events{/privacy}",
"followers_url": "https://api.github.com/users/spitGlued/followers",
"following_url": "https://api.github.com/users/spitGlued/following{/other_user}",
"gists_url": "https://api.github.com/users/spitGlued/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/spitGlued",
"id": 40767897,
"login": "spitGlued",
"node_id": "MDQ6VXNlcjQwNzY3ODk3",
"organizations_url": "https://api.github.com/users/spitGlued/orgs",
"received_events_url": "https://api.github.com/users/spitGlued/received_events",
"repos_url": "https://api.github.com/users/spitGlued/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/spitGlued/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/spitGlued/subscriptions",
"type": "User",
"url": "https://api.github.com/users/spitGlued",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 1 |
2018-11-09T12:06:49Z
|
2021-09-01T00:11:46Z
|
2018-11-13T12:52:27Z
|
NONE
|
resolved
|
I believe that it was not cleat, what the modified snippet referred to
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4",
"events_url": "https://api.github.com/users/kennethreitz/events{/privacy}",
"followers_url": "https://api.github.com/users/kennethreitz/followers",
"following_url": "https://api.github.com/users/kennethreitz/following{/other_user}",
"gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/kennethreitz",
"id": 119893,
"login": "kennethreitz",
"node_id": "MDQ6VXNlcjExOTg5Mw==",
"organizations_url": "https://api.github.com/users/kennethreitz/orgs",
"received_events_url": "https://api.github.com/users/kennethreitz/received_events",
"repos_url": "https://api.github.com/users/kennethreitz/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions",
"type": "User",
"url": "https://api.github.com/users/kennethreitz",
"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/4865/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4865/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/4865.diff",
"html_url": "https://github.com/psf/requests/pull/4865",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/4865.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/4865"
}
| true |
[
"# [Codecov](https://codecov.io/gh/requests/requests/pull/4865?src=pr&el=h1) Report\n> Merging [#4865](https://codecov.io/gh/requests/requests/pull/4865?src=pr&el=desc) into [master](https://codecov.io/gh/requests/requests/commit/6cfbe1aedd56f8c2f9ff8b968efe65b22669795b?src=pr&el=desc) will **not change** coverage.\n> The diff coverage is `n/a`.\n\n[](https://codecov.io/gh/requests/requests/pull/4865?src=pr&el=tree)\n\n```diff\n@@ Coverage Diff @@\n## master #4865 +/- ##\n=======================================\n Coverage 66.89% 66.89% \n=======================================\n Files 15 15 \n Lines 1577 1577 \n=======================================\n Hits 1055 1055 \n Misses 522 522\n```\n\n\n\n------\n\n[Continue to review full report at Codecov](https://codecov.io/gh/requests/requests/pull/4865?src=pr&el=continue).\n> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)\n> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`\n> Powered by [Codecov](https://codecov.io/gh/requests/requests/pull/4865?src=pr&el=footer). Last update [6cfbe1a...9aa876a](https://codecov.io/gh/requests/requests/pull/4865?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).\n"
] |
https://api.github.com/repos/psf/requests/issues/4864
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4864/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4864/comments
|
https://api.github.com/repos/psf/requests/issues/4864/events
|
https://github.com/psf/requests/issues/4864
| 378,721,446 |
MDU6SXNzdWUzNzg3MjE0NDY=
| 4,864 |
why use Session post a data contain a empty tuple,the status_code always 400
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/14889037?v=4",
"events_url": "https://api.github.com/users/yanchunhuo/events{/privacy}",
"followers_url": "https://api.github.com/users/yanchunhuo/followers",
"following_url": "https://api.github.com/users/yanchunhuo/following{/other_user}",
"gists_url": "https://api.github.com/users/yanchunhuo/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/yanchunhuo",
"id": 14889037,
"login": "yanchunhuo",
"node_id": "MDQ6VXNlcjE0ODg5MDM3",
"organizations_url": "https://api.github.com/users/yanchunhuo/orgs",
"received_events_url": "https://api.github.com/users/yanchunhuo/received_events",
"repos_url": "https://api.github.com/users/yanchunhuo/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/yanchunhuo/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/yanchunhuo/subscriptions",
"type": "User",
"url": "https://api.github.com/users/yanchunhuo",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 1 |
2018-11-08T13:01:25Z
|
2021-09-06T00:06:45Z
|
2018-11-08T13:58:06Z
|
NONE
|
resolved
|
Summary.
why use Session post a data contain a empty tuple,the status_code always 400
## Expected Result
200
200
## Actual Result
200
400
What happened instead.
## Reproduction Steps
```python
#-*- coding:utf8 -*-
import requests
if __name__=='__main__':
session = requests.session()
params={}
a=()
params.update({'id':a})
httpresult = session.get('http://www.baidu.com/',data=params)
print httpresult.status_code
httpresult = session.get('http://www.baidu.com/')
print httpresult.status_code
```
## System Information
$ python -m requests.help
```
{
"chardet": {
"version": "3.0.4"
},
"cryptography": {
"version": ""
},
"idna": {
"version": "2.6"
},
"implementation": {
"name": "CPython",
"version": "2.7.12"
},
"platform": {
"release": "4.15.0-29-generic",
"system": "Linux"
},
"pyOpenSSL": {
"openssl_version": "",
"version": null
},
"requests": {
"version": "2.20.0"
},
"system_ssl": {
"version": "1000207f"
},
"urllib3": {
"version": "1.22"
},
"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/4864/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4864/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/4863
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4863/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4863/comments
|
https://api.github.com/repos/psf/requests/issues/4863/events
|
https://github.com/psf/requests/pull/4863
| 378,580,843 |
MDExOlB1bGxSZXF1ZXN0MjI5MjUxNTEy
| 4,863 |
Redirect double encoding
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/2091481?v=4",
"events_url": "https://api.github.com/users/behanna/events{/privacy}",
"followers_url": "https://api.github.com/users/behanna/followers",
"following_url": "https://api.github.com/users/behanna/following{/other_user}",
"gists_url": "https://api.github.com/users/behanna/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/behanna",
"id": 2091481,
"login": "behanna",
"node_id": "MDQ6VXNlcjIwOTE0ODE=",
"organizations_url": "https://api.github.com/users/behanna/orgs",
"received_events_url": "https://api.github.com/users/behanna/received_events",
"repos_url": "https://api.github.com/users/behanna/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/behanna/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/behanna/subscriptions",
"type": "User",
"url": "https://api.github.com/users/behanna",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 1 |
2018-11-08T05:06:11Z
|
2021-09-01T00:11:48Z
|
2018-11-08T17:27:52Z
|
NONE
|
resolved
|
This change makes requests more tolerant of a misconfigured Apache server that escapes percent signs in its redirects. The change includes tests that fail without the change and pass with the change.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/5271761?v=4",
"events_url": "https://api.github.com/users/nateprewitt/events{/privacy}",
"followers_url": "https://api.github.com/users/nateprewitt/followers",
"following_url": "https://api.github.com/users/nateprewitt/following{/other_user}",
"gists_url": "https://api.github.com/users/nateprewitt/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/nateprewitt",
"id": 5271761,
"login": "nateprewitt",
"node_id": "MDQ6VXNlcjUyNzE3NjE=",
"organizations_url": "https://api.github.com/users/nateprewitt/orgs",
"received_events_url": "https://api.github.com/users/nateprewitt/received_events",
"repos_url": "https://api.github.com/users/nateprewitt/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/nateprewitt/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/nateprewitt/subscriptions",
"type": "User",
"url": "https://api.github.com/users/nateprewitt",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/4863/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4863/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/4863.diff",
"html_url": "https://github.com/psf/requests/pull/4863",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/4863.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/4863"
}
| true |
[
"Hi @behanna, thanks for putting the time and effort into creating this patch! While we want Requests to be tolerant of common server misbehaviors, this seems be a pretty niche case. We provide the option in Requests to disable redirects with the `allow_redirects` flag for cases when users need to handle special redirect circumstances. I'd say that's probably the better approach in this case since we'd otherwise be adding somewhat magic behavior here that may not apply to all users."
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.