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/4261
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4261/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4261/comments
|
https://api.github.com/repos/psf/requests/issues/4261/events
|
https://github.com/psf/requests/pull/4261
| 253,147,990 |
MDExOlB1bGxSZXF1ZXN0MTM3ODI1MDEz
| 4,261 |
Pin to httpbin 0.5.0.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4",
"events_url": "https://api.github.com/users/Lukasa/events{/privacy}",
"followers_url": "https://api.github.com/users/Lukasa/followers",
"following_url": "https://api.github.com/users/Lukasa/following{/other_user}",
"gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Lukasa",
"id": 1382556,
"login": "Lukasa",
"node_id": "MDQ6VXNlcjEzODI1NTY=",
"organizations_url": "https://api.github.com/users/Lukasa/orgs",
"received_events_url": "https://api.github.com/users/Lukasa/received_events",
"repos_url": "https://api.github.com/users/Lukasa/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Lukasa",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 4 |
2017-08-27T07:55:16Z
|
2021-09-04T00:06:51Z
|
2017-08-27T13:00:38Z
|
MEMBER
|
resolved
|
The release of httpbin 0.6.0 seems to have broken pytest-httpbin in a surprising way. We want to pin that version out, and probably also alert @kevin1024 about the problem.
Resolves #4259.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4",
"events_url": "https://api.github.com/users/Lukasa/events{/privacy}",
"followers_url": "https://api.github.com/users/Lukasa/followers",
"following_url": "https://api.github.com/users/Lukasa/following{/other_user}",
"gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Lukasa",
"id": 1382556,
"login": "Lukasa",
"node_id": "MDQ6VXNlcjEzODI1NTY=",
"organizations_url": "https://api.github.com/users/Lukasa/orgs",
"received_events_url": "https://api.github.com/users/Lukasa/received_events",
"repos_url": "https://api.github.com/users/Lukasa/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Lukasa",
"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/4261/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4261/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/4261.diff",
"html_url": "https://github.com/psf/requests/pull/4261",
"merged_at": "2017-08-27T13:00:38Z",
"patch_url": "https://github.com/psf/requests/pull/4261.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/4261"
}
| true |
[
"# [Codecov](https://codecov.io/gh/requests/requests/pull/4261?src=pr&el=h1) Report\n> Merging [#4261](https://codecov.io/gh/requests/requests/pull/4261?src=pr&el=desc) into [master](https://codecov.io/gh/requests/requests/commit/5dcbdb50fc9652cbeffeec22a21d1196e938bfca?src=pr&el=desc) will **not change** coverage.\n> The diff coverage is `n/a`.\n\n[](https://codecov.io/gh/requests/requests/pull/4261?src=pr&el=tree)\n\n```diff\n@@ Coverage Diff @@\n## master #4261 +/- ##\n=======================================\n Coverage 88.66% 88.66% \n=======================================\n Files 18 18 \n Lines 2021 2021 \n=======================================\n Hits 1792 1792 \n Misses 229 229\n```\n\n\n\n------\n\n[Continue to review full report at Codecov](https://codecov.io/gh/requests/requests/pull/4261?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/4261?src=pr&el=footer). Last update [5dcbdb5...3a2ea9d](https://codecov.io/gh/requests/requests/pull/4261?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).\n",
"OK, this is a really crazy rabbit hole - I think @Lukasa is actually more up what's going on than I.\r\n\r\nI think the problem is caused by this commit to httpbin by @kennethreitz:\r\n\r\nhttps://github.com/kennethreitz/httpbin/commit/2e94212886e4c9531b8ba7f55f4fb0b8134e10ac\r\n\r\nwhich is an attempt to fix kennethreitz/httpbin#340\r\n\r\nBUT I think it only fixes it on Gunicorn? And pytest-httpbin uses werkzeug which has chunked encoding issues so it ends up causing problems: https://github.com/pallets/werkzeug/issues/1149",
"@kevin1024 we can remove that — I don't think it fixed anything. ",
"@kennethreitz sweet, I think this problem should magically disappear in that case 🌟 "
] |
https://api.github.com/repos/psf/requests/issues/4260
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4260/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4260/comments
|
https://api.github.com/repos/psf/requests/issues/4260/events
|
https://github.com/psf/requests/issues/4260
| 253,127,089 |
MDU6SXNzdWUyNTMxMjcwODk=
| 4,260 |
Incorrect Response Headers Leave Session in an Inconsistent State
|
{
"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 | 3 |
2017-08-26T22:29:19Z
|
2021-09-08T04:00:37Z
|
2018-02-24T14:53:28Z
|
NONE
|
resolved
|
I have a server that is misbehaving slightly when sending 304 responses. It sends a `304 Not Modified` response with an empty response body, but with `Content-Length: 4` and `Content-Type: application/json; charset=utf-8` in the header header. This seems to break the requests session:
```
session = requests.Session()
print 'Send req 1'
resp = session.request('get', url, headers={'if-none-match': etag, 'Authorization' : 'Bearer ' + token})
print resp.status_code, resp.headers
print 'Send req 2'
resp = session.request('get', url, headers={'if-none-match': etag, 'Authorization' : 'Bearer ' + token})
print resp.status_code, resp.headers
```
The call to second request simply hangs, and never returns.
## Expected Result
Either both requests should complete normally, or an exception should be raised.
## Actual Result
The first request leaves the session in some broken state, so any subsequent call will simply appear to be stuck.
## Reproduction Steps
See above.
## System Information
$ python -m requests.help
```
{
"chardet": {
"version": "3.0.4"
},
"cryptography": {
"version": ""
},
"idna": {
"version": "2.6"
},
"implementation": {
"name": "CPython",
"version": "2.7.10"
},
"platform": {
"release": "16.7.0",
"system": "Darwin"
},
"pyOpenSSL": {
"openssl_version": "",
"version": null
},
"requests": {
"version": "2.18.4"
},
"system_ssl": {
"version": "9081df"
},
"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/4260/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4260/timeline
| null |
completed
| null | null | false |
[
"If this is happening that server isn't misbehaving, Requests/urllib3 is. 304's with Content-Length that corresponds to the cached entity body are entirely allowed, so this should work just fine. I'll see if I can reproduce.",
"I think in this case the server might be genuinely misbehaving. Here's a wire-level trace of the response:\r\n\r\n```\r\n0000: 48 54 54 50 2F 31 2E 31 20 33 30 34 20 4E 6F 74 HTTP/1.1 304 Not\r\n0010: 20 4D 6F 64 69 66 69 65 64 0D 0A 53 65 72 76 65 Modified..Serve\r\n0020: 72 3A 20 6E 67 69 6E 78 0D 0A 44 61 74 65 3A 20 r: nginx..Date: \r\n0030: 53 75 6E 2C 20 32 37 20 41 75 67 20 32 30 31 37 Sun, 27 Aug 2017\r\n0040: 20 30 36 3A 34 34 3A 34 32 20 47 4D 54 0D 0A 43 06:44:42 GMT..C\r\n0050: 6F 6E 74 65 6E 74 2D 54 79 70 65 3A 20 61 70 70 ontent-Type: app\r\n0060: 6C 69 63 61 74 69 6F 6E 2F 6A 73 6F 6E 3B 20 63 lication/json; c\r\n0070: 68 61 72 73 65 74 3D 75 74 66 2D 38 0D 0A 43 6F harset=utf-8..Co\r\n0080: 6E 74 65 6E 74 2D 4C 65 6E 67 74 68 3A 20 34 0D ntent-Length: 4.\r\n0090: 0A 43 6F 6E 6E 65 63 74 69 6F 6E 3A 20 6B 65 65 .Connection: kee\r\n00A0: 70 2D 61 6C 69 76 65 0D 0A 41 63 63 65 73 73 2D p-alive..Access-\r\n00B0: 43 6F 6E 74 72 6F 6C 2D 41 6C 6C 6F 77 2D 4F 72 Control-Allow-Or\r\n00C0: 69 67 69 6E 3A 20 2A 0D 0A 43 61 63 68 65 2D 43 igin: *..Cache-C\r\n00D0: 6F 6E 74 72 6F 6C 3A 20 6E 6F 2D 63 61 63 68 65 ontrol: no-cache\r\n00E0: 0D 0A 53 74 72 69 63 74 2D 54 72 61 6E 73 70 6F ..Strict-Transpo\r\n00F0: 72 74 2D 53 65 63 75 72 69 74 79 3A 20 6D 61 78 rt-Security: max\r\n0100: 2D 61 67 65 3D 33 31 35 35 36 39 32 36 3B 20 69 -age=31556926; i\r\n0110: 6E 63 6C 75 64 65 53 75 62 44 6F 6D 61 69 6E 73 ncludeSubDomains\r\n0120: 3B 20 70 72 65 6C 6F 61 64 0D 0A 0D 0A 6E 75 6C ; preload....nul\r\n0130: 6C l\r\n```\r\n\r\nNotice the payload string `null` at the end of the message. According to the HTTP spec, however, a 304 response \"must not\" contain a message body. And FWIW, I was able to reproduce this problem with a client written in Java too, so it's not specific to Python either.\r\n\r\nIt would be great if requests can raise an exception in this type of situations though.",
"*Ah*, yes, ok. So it's not that it's sending 304 with *no* body, it's that it's sending 304 *with* a body, which is against the spec.\r\n\r\nWe could raise exceptions in this case, certainly, but it's very hard to detect. For example, the presence of the content-length header is not an indication of this problem, as it's completely allowed to send a content-length that applies to the cached response. There is really no way to know except to try to parse the next response, which is apparently failing.\r\n\r\nThis is very difficult for us to handle except via timeouts and retries, which we already have support for, so my recommendation is to use the support we have for providing timeout objects to urllib3 to set timeouts on your requests and then retry ones that fail."
] |
https://api.github.com/repos/psf/requests/issues/4259
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4259/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4259/comments
|
https://api.github.com/repos/psf/requests/issues/4259/events
|
https://github.com/psf/requests/issues/4259
| 253,125,188 |
MDU6SXNzdWUyNTMxMjUxODg=
| 4,259 |
tests are broken
|
{
"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 | 3 |
2017-08-26T21:51:49Z
|
2021-09-08T07:00:29Z
|
2017-08-27T13:00:38Z
|
CONTRIBUTOR
|
resolved
|
Specifically, this hangs https://github.com/requests/requests/blob/5dcbdb50fc9652cbeffeec22a21d1196e938bfca/tests/test_requests.py#L151
It can be seen in #4258 https://travis-ci.org/requests/requests/jobs/268764155
This occurs locally for me as well.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4",
"events_url": "https://api.github.com/users/Lukasa/events{/privacy}",
"followers_url": "https://api.github.com/users/Lukasa/followers",
"following_url": "https://api.github.com/users/Lukasa/following{/other_user}",
"gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Lukasa",
"id": 1382556,
"login": "Lukasa",
"node_id": "MDQ6VXNlcjEzODI1NTY=",
"organizations_url": "https://api.github.com/users/Lukasa/orgs",
"received_events_url": "https://api.github.com/users/Lukasa/received_events",
"repos_url": "https://api.github.com/users/Lukasa/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Lukasa",
"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/4259/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4259/timeline
| null |
completed
| null | null | false |
[
"I'm loving these new GitHub line previews. ",
"So fancy!",
"See #4261."
] |
https://api.github.com/repos/psf/requests/issues/4258
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4258/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4258/comments
|
https://api.github.com/repos/psf/requests/issues/4258/events
|
https://github.com/psf/requests/pull/4258
| 253,123,560 |
MDExOlB1bGxSZXF1ZXN0MTM3ODEyNDUy
| 4,258 |
info for #4259 DO NOT MERGE
|
{
"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 | 11 |
2017-08-26T21:20:51Z
|
2021-08-31T00:07:20Z
|
2017-08-27T07:53:04Z
|
CONTRIBUTOR
|
resolved
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4",
"events_url": "https://api.github.com/users/Lukasa/events{/privacy}",
"followers_url": "https://api.github.com/users/Lukasa/followers",
"following_url": "https://api.github.com/users/Lukasa/following{/other_user}",
"gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Lukasa",
"id": 1382556,
"login": "Lukasa",
"node_id": "MDQ6VXNlcjEzODI1NTY=",
"organizations_url": "https://api.github.com/users/Lukasa/orgs",
"received_events_url": "https://api.github.com/users/Lukasa/received_events",
"repos_url": "https://api.github.com/users/Lukasa/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Lukasa",
"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/4258/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4258/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/4258.diff",
"html_url": "https://github.com/psf/requests/pull/4258",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/4258.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/4258"
}
| true |
[
"@kennethreitz Hey there! Could you please re-open this? There is a hanging test I want to verify in CI.",
"sorry!",
"@kennethreitz No problem! I submitted #4259 ",
"Ok, so the first note is that I don't reproduce this failure locally. That suggests that the failure is environmental: either OS-based (I'm on macOS) or something more nuanced. My first guess is that it's related to proxies, so I'm going to chase that rabbit hole.",
"Ok if we fail out of the `mixed_case_scheme_acceptable` test the next test hangs instead. Let me see if I can escape that one too.",
"Ok so what seems to be happening is that the HTTP server is blocking forever. Let's try to find out why.",
"Hrm, here's a weirdness: this doesn't appear to happen when I run the tests under tox.",
"Ohhhhh I know what this will be. Ok, one sec.",
"Yup, got it. Ok, will open a PR that fixes this problem.",
"Between this and that macOS memory allocation thing, you're the King of Bug Hunting!",
"Heh, thanks!"
] |
|
https://api.github.com/repos/psf/requests/issues/4257
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4257/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4257/comments
|
https://api.github.com/repos/psf/requests/issues/4257/events
|
https://github.com/psf/requests/issues/4257
| 252,943,846 |
MDU6SXNzdWUyNTI5NDM4NDY=
| 4,257 |
Requesting the ability to globally override the CA bundle path
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/517114?v=4",
"events_url": "https://api.github.com/users/wise0wl/events{/privacy}",
"followers_url": "https://api.github.com/users/wise0wl/followers",
"following_url": "https://api.github.com/users/wise0wl/following{/other_user}",
"gists_url": "https://api.github.com/users/wise0wl/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/wise0wl",
"id": 517114,
"login": "wise0wl",
"node_id": "MDQ6VXNlcjUxNzExNA==",
"organizations_url": "https://api.github.com/users/wise0wl/orgs",
"received_events_url": "https://api.github.com/users/wise0wl/received_events",
"repos_url": "https://api.github.com/users/wise0wl/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/wise0wl/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/wise0wl/subscriptions",
"type": "User",
"url": "https://api.github.com/users/wise0wl",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 1 |
2017-08-25T15:52:09Z
|
2021-09-08T07:00:29Z
|
2017-08-25T16:10:25Z
|
NONE
|
resolved
|
Currently, requests.certs.where() provides the path to the CA bundle by means of the certifi library. While this is fine it presents issues for developers who are using third party libraries requiring the requests library in situations where they need to use a internal or self signed CA.
A method prescribing a global override for this CA bundle path as a first pass would be extremely helpful. This method could be as easy as setting an environment variable, ie. CA_PATH=/path/to/ca/bundle.crt
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4",
"events_url": "https://api.github.com/users/Lukasa/events{/privacy}",
"followers_url": "https://api.github.com/users/Lukasa/followers",
"following_url": "https://api.github.com/users/Lukasa/following{/other_user}",
"gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Lukasa",
"id": 1382556,
"login": "Lukasa",
"node_id": "MDQ6VXNlcjEzODI1NTY=",
"organizations_url": "https://api.github.com/users/Lukasa/orgs",
"received_events_url": "https://api.github.com/users/Lukasa/received_events",
"repos_url": "https://api.github.com/users/Lukasa/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Lukasa",
"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/4257/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4257/timeline
| null |
completed
| null | null | false |
[
"Such an environment variable already exists: `REQUESTS_CA_BUNDLE`. I hope that helps!"
] |
https://api.github.com/repos/psf/requests/issues/4256
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4256/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4256/comments
|
https://api.github.com/repos/psf/requests/issues/4256/events
|
https://github.com/psf/requests/issues/4256
| 252,937,917 |
MDU6SXNzdWUyNTI5Mzc5MTc=
| 4,256 |
SSL verification error when using requests sessions
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/24897834?v=4",
"events_url": "https://api.github.com/users/PascalVA/events{/privacy}",
"followers_url": "https://api.github.com/users/PascalVA/followers",
"following_url": "https://api.github.com/users/PascalVA/following{/other_user}",
"gists_url": "https://api.github.com/users/PascalVA/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/PascalVA",
"id": 24897834,
"login": "PascalVA",
"node_id": "MDQ6VXNlcjI0ODk3ODM0",
"organizations_url": "https://api.github.com/users/PascalVA/orgs",
"received_events_url": "https://api.github.com/users/PascalVA/received_events",
"repos_url": "https://api.github.com/users/PascalVA/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/PascalVA/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/PascalVA/subscriptions",
"type": "User",
"url": "https://api.github.com/users/PascalVA",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 11 |
2017-08-25T15:31:48Z
|
2018-10-05T16:31:38Z
|
2017-08-28T08:00:19Z
|
CONTRIBUTOR
|
resolved
|
## The problem
When using requests sessions to connect to a https website with a self signed certificate, requests throws a SSLError. It is working pefectly fine when using requests without sessions.
## What I am using:
* python2.7
* requests (2.18.4)
* exported REQUESTS_CA_BUNDLE environment variable
* Imported certificate to ca-certificates on underlying Debian os
Note: The certificate validates more than one hostname (e.g. kubernetes, kubernetes.default, kubernets.default.svc, kubernetes.default.svc.cluster.local, ...)
## Steps to reproduce
```python
# Normal request
import requests
requests.get('https://kubernetes.default.svc')
<Response [401]>
# Session request
s = requests.Session()
request = requests.Request('GET', 'https://kubernetes.default.svc')
prepared_request = s.prepare_request(request)
response = s.send(prepared_request)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/site-packages/requests/sessions.py", line 612, in send
r = adapter.send(request, **kwargs)
File "/usr/local/lib/python2.7/site-packages/requests/adapters.py", line 504, in send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='kubernetes.default.svc', port=443): Max retries exceeded with url: / (Caused by SSLError(SSLError(1, u'[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:661)'),))
```
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4",
"events_url": "https://api.github.com/users/Lukasa/events{/privacy}",
"followers_url": "https://api.github.com/users/Lukasa/followers",
"following_url": "https://api.github.com/users/Lukasa/following{/other_user}",
"gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Lukasa",
"id": 1382556,
"login": "Lukasa",
"node_id": "MDQ6VXNlcjEzODI1NTY=",
"organizations_url": "https://api.github.com/users/Lukasa/orgs",
"received_events_url": "https://api.github.com/users/Lukasa/received_events",
"repos_url": "https://api.github.com/users/Lukasa/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Lukasa",
"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/4256/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4256/timeline
| null |
completed
| null | null | false |
[
"You should prepare the request using the `Session`:\r\n\r\n```python\r\nrequest = requests.Request('GET', 'https://kubernetes.default.svc')\r\nprepared_request = s.prepare_request(request)\r\nresponse = s.send(prepared_request)\r\n```",
"Thanks for the quick response Lukasa, I did make a mistake copy/pasting on the issue. Sorry.\r\nI will update the issue too. Could you please reopen?\r\n\r\nHere is the request output using the session to prepare:\r\n```python\r\nimport requests\r\n# Normal request\r\nrequests.get('https://kubernetes.default.svc')\r\n<Response [401]>\r\n\r\n# Session request\r\ns = requests.Session()\r\nrequest = requests.Request('GET', 'https://kubernetes.default.svc')\r\nprepared_request = s.prepare_request(request)\r\nresponse = s.send(prepared_request)\r\nTraceback (most recent call last):\r\n File \"<stdin>\", line 1, in <module>\r\n File \"/usr/local/lib/python2.7/site-packages/requests/sessions.py\", line 612, in send\r\n r = adapter.send(request, **kwargs)\r\n File \"/usr/local/lib/python2.7/site-packages/requests/adapters.py\", line 504, in send\r\n raise ConnectionError(e, request=request)\r\nrequests.exceptions.ConnectionError: HTTPSConnectionPool(host='kubernetes.default.svc', port=443): Max retries exceeded with url: / (Caused by SSLError(SSLError(1, u'[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:661)'),))\r\n```",
"Yup, you're missing some environmental settings here. This is something that is not well handled by the prepared request flow. You can try doing this:\r\n\r\n```python\r\ns = requests.Session()\r\nrequest = requests.Request('GET', 'https://kubernetes.default.svc')\r\nprepared_request = s.prepare_request(request)\r\n\r\nsettings = s.merge_environment_settings(prepared_request.url, None, None, None, None)\r\nresponse = s.send(prepared_request, **settings)\r\n```",
"Thanks Lukasa, this works like a charm! I will try to figure out what exactly is wrong with my environment.",
"Nothing is wrong with it: just the prepared request flow doesn't normally consider the environment. =)",
"That is good to know. Maybe it can be added to the documentation page:\r\nhttp://docs.python-requests.org/en/master/user/advanced/#session-objects\r\n\r\nThis page documents the usage of Sessions, but it doesn't mention the environment. Also the SSL section does not mention this.",
"It should probably go into the prepared request section, not the session section. =) I'd welcome a patch though.",
"Do you mean a patch on the documentation, or to fix the prepared request to use the environment?\r\nI am not really familiar with the code, but I can take a crack at it.",
"A patch on the documentation. :smile:",
"Max retries exceeded with url: / (Caused by SSLError(SSLError(1, u'[SSL: SSLV3_ALERT_HANDSHAKE_FAILURE] sslv3 alert handshake failure (_ssl.c:590)'),))",
"I know this issue is closed but I had the same issue and with hours of research and attempting potential solutions nothing seemed to work. **Ended up uninstalling and reinstalling Python and have not ran into this issue since, I highly suggest you try this if you are still experiencing this issue and have tried multiple potential resolutions.**"
] |
https://api.github.com/repos/psf/requests/issues/4255
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4255/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4255/comments
|
https://api.github.com/repos/psf/requests/issues/4255/events
|
https://github.com/psf/requests/issues/4255
| 252,841,334 |
MDU6SXNzdWUyNTI4NDEzMzQ=
| 4,255 |
requests does not remove the default port from response url
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/2804645?v=4",
"events_url": "https://api.github.com/users/hydrargyrum/events{/privacy}",
"followers_url": "https://api.github.com/users/hydrargyrum/followers",
"following_url": "https://api.github.com/users/hydrargyrum/following{/other_user}",
"gists_url": "https://api.github.com/users/hydrargyrum/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/hydrargyrum",
"id": 2804645,
"login": "hydrargyrum",
"node_id": "MDQ6VXNlcjI4MDQ2NDU=",
"organizations_url": "https://api.github.com/users/hydrargyrum/orgs",
"received_events_url": "https://api.github.com/users/hydrargyrum/received_events",
"repos_url": "https://api.github.com/users/hydrargyrum/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/hydrargyrum/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/hydrargyrum/subscriptions",
"type": "User",
"url": "https://api.github.com/users/hydrargyrum",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 12 |
2017-08-25T09:10:24Z
|
2021-09-08T06:00:45Z
|
2017-09-14T15:19:27Z
|
NONE
|
resolved
|
When requests is asked to open an url like `https://httpbin.org:443`, be it with a direct `requests.get` call or by a site redirection, the port part should be removed since it's the default one.
## Expected Result
`response.url` should not contain a port if it's the default one
## Actual Result
`response.url` contains the default port if the request url contained it
## Reproduction Steps
```python
import requests
print(requests.get('https://httpbin.org:443/get').url)
```
## System Information
$ python -m requests.help
```
{
"chardet": {
"version": "3.0.4"
},
"cryptography": {
"version": "1.8.1"
},
"idna": {
"version": ""
},
"implementation": {
"name": "CPython",
"version": "2.7.13"
},
"platform": {
"release": "4.12.0-1-amd64",
"system": "Linux"
},
"pyOpenSSL": {
"openssl_version": "100020bf",
"version": "16.2.0"
},
"requests": {
"version": "2.18.4"
},
"system_ssl": {
"version": "1010006f"
},
"urllib3": {
"version": "1.21.1"
},
"using_pyopenssl": 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"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/4255/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4255/timeline
| null |
completed
| null | null | false |
[
"Why should we strip this from the URL? The URL is for the user only, it's not sent to the server, so what's the reason for stripping it?",
"- For end-users, real browsers already do strip it as soon as the user enters it in the URL bar.\r\n- Developers don't need to handle 2 different format for the same thing (using the default port). If the port is present, IMHO it should safely be assumed that it's because the port is not the default one.\r\n- The domain part is already normalized in some way, for example the hostname is lowercased, why not removing the default port as part of the normalization?",
"> For end-users, real browsers already do strip it as soon as the user enters it in the URL bar.\r\n\r\nAh, but Requests is not a browser. We do emulate the browser's behaviour in some cases, but not in all.\r\n\r\n> Developers don't need to handle 2 different format for the same thing (using the default port). If the port is present, IMHO it should safely be assumed that it's because the port is not the default one.\r\n\r\nYes, they do. Ports may be present in any URL. If they're not handling ports, they're not doing their job.\r\n\r\n> The domain part is already normalized in some way, for example the hostname is lowercased, why not removing the default port as part of the normalization?\r\n\r\nI forget under which conditions it is necessary, but domain normalization isn't cosmetic, it's for a real technical reason. In this case, you're asking for a purely cosmetic change. That's no reason to break backwards compatibility or behaviour.",
"> Yes, they do. Ports may be present in any URL. If they're not handling ports, they're not doing their job.\r\n\r\nrequests is a helper library, its job is to minimize the burden of its users (developers) by avoiding to expose unnecessary low-level details. For example the library follows redirections by default to avoid its users having to handle the redirection by themselves (that's probably not the best example of a \"low-level\" thing but I didn't really look for another)\r\n\r\nIt's not about \"not handling ports\", users of requests probably don't even care about ports (I don't). It's about a library returning the URL it just made a request to, but that doesn't return consistent URLs, sometimes with \":443\", sometimes without (this library is requests). When the port is not the default one, it's mandatory to return it, but when it is, it's better to be consistent, never return it or always (pick one).\r\n\r\n> That's no reason to break backwards compatibility or behaviour.\r\n\r\nBreaking compatibility is about making a new behavior that isn't _compatible_, not that isn't _identical_. In this case, the 2 URLs are compatible, just one of them is not pretty, and the result is not always consistent.",
"> Breaking compatibility is about making a new behavior that isn't compatible, not that isn't identical. In this case, the 2 URLs are compatible, just one of them is not pretty, and the result is not always consistent.\r\n\r\nIf we accept that dealing with the variation in URLs is an inconvenience then necessarily this is a compatibility break. Right now there is a clear logic: if we were given a URL with a port we return a URL with a port. If we change that logic then we will inevitably break people's code.\r\n\r\nI'm fine with changing this in 3.0, but not before then. Along with that change we may want to consider moving to a better URL handling library (e.g. hyperlink) to help manage this complexity.",
"> For example the library follows redirections by default to avoid its users having to handle the redirection by themselves (that's probably not the best example of a \"low-level\" thing but I didn't really look for another)\r\n\r\nRedirection isn't inherently low-level, especially since we give the user a way to tinker with redirection (by turning it off and handling it themselves).\r\n\r\nI think a better low-level detail that we manage (but don't really since urllib3 handles this for us) is DNS lookup and trying different IP addresses until we find one that works. But then you have two wildly different ideas of low-level.\r\n\r\n> users of requests probably don't even care about ports \r\n\r\nNo. Some users of requests definitely do care about ports. Maybe something like 80% don't.\r\n\r\n> but that doesn't return consistent URLs, sometimes with \":443\", sometimes without (this library is requests)\r\n\r\nIt does consistently return URLs if the URLs used in the request are consistent.\r\n\r\n> When the port is not the default one, it's mandatory to return it, but when it is, it's better to be consistent, never return it or always (pick one).\r\n\r\nAgain, we're consistent based on input.\r\n\r\n> just one of them is not pretty\r\n\r\nAnd I think this is the real heart of the problem. You're using the `.url` attribute of the Response object for some kind of display to some other user and you don't want to deal with that user's input first to get your consistent output. You feel as though Requests should handle everything for you and exonerate you from having to deal with user inputs. That is fundamentally not requests' job. Requests' job is to handle HTTP and the semantics thereof. Our job is not to prettify URLs for our users. Our users are fundamentally technical and should be able to handle exactly what you want to handle themselves. Users of Browsers are fundamentally different from Requests Users. The latter are a subset of the former, but they're the subset who know how and when to handle ports.\r\n\r\nI really don't think this is something we need to change for 3.0 and I'm not convinced it's something we want to either.",
"> you don't want to deal with that user's input first\r\n\r\nAs I said in the very first message, it doesn't necessarily come from user input. I took an example URL since it was easier to demonstrate, but it can happen in a redirection, where user input isn't involved, and there it's even worse since the hostname isn't lowercased, so your \"technical reason for lowercasing\" doesn't really hold:\r\n\r\n```\r\n>>> requests.get('https://httpbin.org/redirect-to?url=https%3A%2F%2FHTtpbin.org:443%2Fget').url\r\n'https://HTtpbin.org:443/get'\r\n```",
"What is also ironic is that you already do this normalization is some part of the code, since the `Host` port **never contains the default port** even if put explicitly in the URL given as argument to `requests.get`...\r\n\r\n```\r\n% socat TCP-LISTEN:1234 STDIO | grep Host\r\nHost: localhost:1234\r\n\r\nMeanwhile:\r\nrequests.get('http://localhost:1234')\r\n\r\nAnd:\r\n\r\n# socat TCP-LISTEN:80 STDIO | grep Host\r\nHost: localhost\r\n\r\nMeanwhile:\r\nrequests.get('http://localhost:80')\r\n```",
"That normalisation is required per the HTTP specification. None of us is saying we aren't technically capable of doing it, only that we don't currently do it and aren't convinced it's important for `response.url`.",
"I would like to weigh in on this issue with a use case I have that could help this discussion. \r\n\r\nWe are performing a request to an url that is redirected by the server (302 or 301 redirect). For some business logic we need to determine the url and the port the request came from. \r\n\r\nIn our use case this could be helpfull\r\n\r\n >>> import requests\r\n >>> r = requests.get('http://my-url.com')\r\n >>> r.url\r\n 'https://another-url.com\r\n >>> r.port\r\n 443\r\n\r\nFor me it made sense that since the response contains the url we were redirected to, I could also access a port attribute. In this (contrived) example it makes sense to parse the URL and figure out the port. But what if the server redirects to https on port 8080 for example and I needed to figure out port 8080? \r\n\r\nSuggestion: add a port attribute to the response attribute and normalize the response url. ",
"@MichaelAnckaert I think the problem in general is that `Response` instances shouldn't have ever had a URL. I understand it's convenient but semantically a bit wobbly. The *request* is made to a URL, and in fact `r.request.url` exists and is the same as `r.url`. If a port attribute were to make sense somewhere, then it would be on the `PreparedRequest` object, but even that's not exactly the best place to have it. In general, I really don't quite understand the issue with using `urlparse` or one of the several other libraries that work significantly better to retrieve the port. I really don't think this issue or your specific use case are appropriate changes for Requests.",
"intended behavior"
] |
https://api.github.com/repos/psf/requests/issues/4254
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4254/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4254/comments
|
https://api.github.com/repos/psf/requests/issues/4254/events
|
https://github.com/psf/requests/issues/4254
| 252,820,667 |
MDU6SXNzdWUyNTI4MjA2Njc=
| 4,254 |
Git Clone Fails
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/5565407?v=4",
"events_url": "https://api.github.com/users/evans/events{/privacy}",
"followers_url": "https://api.github.com/users/evans/followers",
"following_url": "https://api.github.com/users/evans/following{/other_user}",
"gists_url": "https://api.github.com/users/evans/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/evans",
"id": 5565407,
"login": "evans",
"node_id": "MDQ6VXNlcjU1NjU0MDc=",
"organizations_url": "https://api.github.com/users/evans/orgs",
"received_events_url": "https://api.github.com/users/evans/received_events",
"repos_url": "https://api.github.com/users/evans/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/evans/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/evans/subscriptions",
"type": "User",
"url": "https://api.github.com/users/evans",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 2 |
2017-08-25T07:35:03Z
|
2021-09-08T07:00:30Z
|
2017-08-25T07:36:48Z
|
NONE
|
resolved
|
The repository does not clone, due to a bad commit. Let me know if I can do anything more to help!
## Expected Result
The repository should be cloned successfully with the command:
```
git clone [email protected]:requests/requests.git
```
## Actual Result
I get this message:
```
Cloning into 'requests'...
remote: Counting objects: 20967, done.
remote: Compressing objects: 100% (25/25), done.
error: object 5e6ecdad9f69b1ff789a17733b8edc6fd7091bd8: badTimezone: invalid author/committer line - bad time zone
fatal: Error in object
fatal: index-pack failed
```
## Reproduction Steps
run:
```
git clone [email protected]:requests/requests.git
```
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4",
"events_url": "https://api.github.com/users/Lukasa/events{/privacy}",
"followers_url": "https://api.github.com/users/Lukasa/followers",
"following_url": "https://api.github.com/users/Lukasa/following{/other_user}",
"gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Lukasa",
"id": 1382556,
"login": "Lukasa",
"node_id": "MDQ6VXNlcjEzODI1NTY=",
"organizations_url": "https://api.github.com/users/Lukasa/orgs",
"received_events_url": "https://api.github.com/users/Lukasa/received_events",
"repos_url": "https://api.github.com/users/Lukasa/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Lukasa",
"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/4254/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4254/timeline
| null |
completed
| null | null | false |
[
"Thanks for the report. This is a known problem: see #3088, #3008, and #2690 for previous discussions. The problem can be easily resolved on your end either by performing a shallow clone (if you don't need the history) or turning off the fsck timestamp check. This cannot be fixed without rewriting our history and causing *way* more problems that way than by just letting it sit.",
"Please, search open **and** closed issues before opening new ones in the future, @evanshauser "
] |
https://api.github.com/repos/psf/requests/issues/4253
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4253/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4253/comments
|
https://api.github.com/repos/psf/requests/issues/4253/events
|
https://github.com/psf/requests/issues/4253
| 252,458,254 |
MDU6SXNzdWUyNTI0NTgyNTQ=
| 4,253 |
If there is a value in the body, setting the content-length in the header does not transfer it.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/9694022?v=4",
"events_url": "https://api.github.com/users/kssim/events{/privacy}",
"followers_url": "https://api.github.com/users/kssim/followers",
"following_url": "https://api.github.com/users/kssim/following{/other_user}",
"gists_url": "https://api.github.com/users/kssim/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/kssim",
"id": 9694022,
"login": "kssim",
"node_id": "MDQ6VXNlcjk2OTQwMjI=",
"organizations_url": "https://api.github.com/users/kssim/orgs",
"received_events_url": "https://api.github.com/users/kssim/received_events",
"repos_url": "https://api.github.com/users/kssim/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/kssim/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/kssim/subscriptions",
"type": "User",
"url": "https://api.github.com/users/kssim",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 4 |
2017-08-24T01:04:10Z
|
2021-09-08T07:00:30Z
|
2017-08-24T01:10:23Z
|
NONE
|
resolved
|
If there is a value in the body, setting the content-length in the header does not transfer it.
I wonder if you are willing to give me the option to ignore the body value and pass in the value set by content-length
If you are thinking about providing options, I am willing to send a pull-request
## Expected Result
I set the header to a content-length of 100, and the size of the body is 10.
I expected the content-length to be 100, but actually it was 10.
## Actual Result
Looking at the code, there was logic to update the content-length by calculating the value of the body if it had a value for the body.
(requests/models.py - line 515, in prepare_content_legnth method)
## Reproduction Steps
This happens when you set the content-length and enter a different size than the value set in the body.
## System Information
It is not system dependent.
|
{
"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/4253/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4253/timeline
| null |
completed
| null | null | false |
[
"Hey @kssim, you should be able to accomplish what you're looking for by creating a PreparedRequest and then modifying the value of the header before sending.\r\n\r\nYou really shouldn't be sending incorrect content lengths though as this can cause issues for some servers and will often leave sockets hanging open waiting for more data.\r\n\r\nLet us know if you're still experiencing issues with the above approach.",
"I know that sending invalid values can affect the server.\r\nI'm trying to validate my server using requests, but I need to intentionally send the wrong value.\r\n\r\nSo, I asked if you could provide that functionality as a send option, not a formal function.\r\nFor example, through a boolean value like allow_redirects",
"Sorry if I didn't provide enough information in the last response. Requests is fully capable of handling your use case, you'll just need to use what we call the \"PreparedRequest workflow\".\r\n\r\nThe Content-Length calculation should only be performed when prepare() is called. This will produce a PreparedRequest object which will have the newly computed Content-Length based on the body size. You can override the Content-Length header on the PreparedRequest object and then send it using the send method on a Session.\r\n\r\nAs for a specific option, the Requests API is fairly frozen at this point. I think it's unlikely we'd provide an option or any further modifications to address this since it's already achievable though other means.",
"Thanks for the kind answer.\r\nI think it's better to override and use it as needed.\r\nThank you :)"
] |
https://api.github.com/repos/psf/requests/issues/4252
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4252/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4252/comments
|
https://api.github.com/repos/psf/requests/issues/4252/events
|
https://github.com/psf/requests/issues/4252
| 252,222,328 |
MDU6SXNzdWUyNTIyMjIzMjg=
| 4,252 |
get an error OpenSSL.SSL.SysCallError: (-1, 'Unexpected EOF'),
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/19412136?v=4",
"events_url": "https://api.github.com/users/liying1993/events{/privacy}",
"followers_url": "https://api.github.com/users/liying1993/followers",
"following_url": "https://api.github.com/users/liying1993/following{/other_user}",
"gists_url": "https://api.github.com/users/liying1993/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/liying1993",
"id": 19412136,
"login": "liying1993",
"node_id": "MDQ6VXNlcjE5NDEyMTM2",
"organizations_url": "https://api.github.com/users/liying1993/orgs",
"received_events_url": "https://api.github.com/users/liying1993/received_events",
"repos_url": "https://api.github.com/users/liying1993/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/liying1993/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/liying1993/subscriptions",
"type": "User",
"url": "https://api.github.com/users/liying1993",
"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"
}
] |
closed
| true | null |
[] | null | 3 |
2017-08-23T09:45:35Z
|
2021-09-08T07:00:30Z
|
2017-08-25T07:35:07Z
|
NONE
|
resolved
|
get an error OpenSSL.SSL.SysCallError: (-1, 'Unexpected EOF'),
## Expected Result
I just make a simple request, and i just want to see what is the response
## Actual Result
OpenSSL.SSL.SysCallError: (-1, 'Unexpected EOF')
## Reproduction Steps
here is my code
```python
import requests
r = requests.post("https://gateway.gopay.com.cn/Trans/WebClientAction.do", data=param_dict)
```
## System Information
$ python -m requests.help
```
<paste here>
```
This command is only available on Requests v2.16.4 and greater. Otherwise,
please provide some basic information about your system (Python version,
operating system, &c).
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4",
"events_url": "https://api.github.com/users/Lukasa/events{/privacy}",
"followers_url": "https://api.github.com/users/Lukasa/followers",
"following_url": "https://api.github.com/users/Lukasa/following{/other_user}",
"gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Lukasa",
"id": 1382556,
"login": "Lukasa",
"node_id": "MDQ6VXNlcjEzODI1NTY=",
"organizations_url": "https://api.github.com/users/Lukasa/orgs",
"received_events_url": "https://api.github.com/users/Lukasa/received_events",
"repos_url": "https://api.github.com/users/Lukasa/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Lukasa",
"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/4252/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4252/timeline
| null |
completed
| null | null | false |
[
"Hi @liying1993,\r\n\r\nPlease provide more information about your system. Without that we cannot provide much help.",
"In the absence of more detail I'm assuming this is a dupe of #4244.",
"@Lukasa sorry,I have not check my email boxes in time,\r\nI have asked our cooperative corporation which is the server I requested.They told me they need to bound our company's.something about DNS.So,thank you"
] |
https://api.github.com/repos/psf/requests/issues/4251
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4251/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4251/comments
|
https://api.github.com/repos/psf/requests/issues/4251/events
|
https://github.com/psf/requests/issues/4251
| 252,182,030 |
MDU6SXNzdWUyNTIxODIwMzA=
| 4,251 |
Configuration to follow redirect method after http redirect
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/8131738?v=4",
"events_url": "https://api.github.com/users/raja-gola/events{/privacy}",
"followers_url": "https://api.github.com/users/raja-gola/followers",
"following_url": "https://api.github.com/users/raja-gola/following{/other_user}",
"gists_url": "https://api.github.com/users/raja-gola/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/raja-gola",
"id": 8131738,
"login": "raja-gola",
"node_id": "MDQ6VXNlcjgxMzE3Mzg=",
"organizations_url": "https://api.github.com/users/raja-gola/orgs",
"received_events_url": "https://api.github.com/users/raja-gola/received_events",
"repos_url": "https://api.github.com/users/raja-gola/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/raja-gola/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/raja-gola/subscriptions",
"type": "User",
"url": "https://api.github.com/users/raja-gola",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 1 |
2017-08-23T07:09:33Z
|
2021-09-08T07:00:31Z
|
2017-08-23T07:46:00Z
|
NONE
|
resolved
|
Summary.
Basically HTTP 301 redirection replaces POST method with a GET.
More Info: https://softwareengineering.stackexchange.com/questions/99894/why-doesnt-http-have-post-redirect
Need an config option in python requests to override this behavior and follow redirect method after http redirection.
Thanks
Raja
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4",
"events_url": "https://api.github.com/users/Lukasa/events{/privacy}",
"followers_url": "https://api.github.com/users/Lukasa/followers",
"following_url": "https://api.github.com/users/Lukasa/following{/other_user}",
"gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Lukasa",
"id": 1382556,
"login": "Lukasa",
"node_id": "MDQ6VXNlcjEzODI1NTY=",
"organizations_url": "https://api.github.com/users/Lukasa/orgs",
"received_events_url": "https://api.github.com/users/Lukasa/received_events",
"repos_url": "https://api.github.com/users/Lukasa/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Lukasa",
"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/4251/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4251/timeline
| null |
completed
| null | null | false |
[
"For overriding our redirect logic we have a coarse grained switch: `allow_redirecte`, which can be set to `False`. Failing that, more modern versions of Requests have a `Session.rebuild_method` method that can be overridden to change the behaviour to get what you're looking for. \r\n\r\nThere is no plan to add an additional config option for this behaviour. "
] |
https://api.github.com/repos/psf/requests/issues/4250
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4250/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4250/comments
|
https://api.github.com/repos/psf/requests/issues/4250/events
|
https://github.com/psf/requests/issues/4250
| 252,161,567 |
MDU6SXNzdWUyNTIxNjE1Njc=
| 4,250 |
Error with relative url
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/322101?v=4",
"events_url": "https://api.github.com/users/marcoshipe/events{/privacy}",
"followers_url": "https://api.github.com/users/marcoshipe/followers",
"following_url": "https://api.github.com/users/marcoshipe/following{/other_user}",
"gists_url": "https://api.github.com/users/marcoshipe/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/marcoshipe",
"id": 322101,
"login": "marcoshipe",
"node_id": "MDQ6VXNlcjMyMjEwMQ==",
"organizations_url": "https://api.github.com/users/marcoshipe/orgs",
"received_events_url": "https://api.github.com/users/marcoshipe/received_events",
"repos_url": "https://api.github.com/users/marcoshipe/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/marcoshipe/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/marcoshipe/subscriptions",
"type": "User",
"url": "https://api.github.com/users/marcoshipe",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 1 |
2017-08-23T05:14:25Z
|
2021-09-08T07:00:31Z
|
2017-08-23T06:02:33Z
|
NONE
|
resolved
|
I have a problem with a specific relative URL, but I suppose it's not the only one.
When i do:
`print(requests.get('http://www.resultados.gob.ar/escrutinio/dat99/../../javascript/mun.js')`
## Expected Result
The content of the js
## Actual Result
> b'File not found."'
## Reproduction Steps
```python
import requests
print(requests.get('http://www.resultados.gob.ar/escrutinio/dat99/../../javascript/mun.js').content)
```
## Other info
With other links in the same web, it not happened, for example:
`print(requests.get('http://www.resultados.gob.ar/escrutinio/dat99/../dat01/DDN01001A.htm').content)`
If i do it with no relative path:
`print(requests.get('http://www.resultados.gob.ar/javascript/mun.js').content`
is ok either
And in firefox or chrome the same relative url is ok too
So i think it can be the '.js' at the end in combination with relative urls?
## System Information
```
{
"chardet": {
"version": "3.0.4"
},
"cryptography": {
"version": ""
},
"idna": {
"version": "2.6"
},
"implementation": {
"name": "CPython",
"version": "3.6.2"
},
"platform": {
"release": "4.10.0-32-generic",
"system": "Linux"
},
"pyOpenSSL": {
"openssl_version": "",
"version": null
},
"requests": {
"version": "2.18.4"
},
"system_ssl": {
"version": "1000207f"
},
"urllib3": {
"version": "1.22"
},
"using_pyopenssl": false
}
```
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4",
"events_url": "https://api.github.com/users/Lukasa/events{/privacy}",
"followers_url": "https://api.github.com/users/Lukasa/followers",
"following_url": "https://api.github.com/users/Lukasa/following{/other_user}",
"gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Lukasa",
"id": 1382556,
"login": "Lukasa",
"node_id": "MDQ6VXNlcjEzODI1NTY=",
"organizations_url": "https://api.github.com/users/Lukasa/orgs",
"received_events_url": "https://api.github.com/users/Lukasa/received_events",
"repos_url": "https://api.github.com/users/Lukasa/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Lukasa",
"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/4250/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4250/timeline
| null |
completed
| null | null | false |
[
"Yeah, it's currently the case that Requests does not clean up relative URLs. This is not planned to change in the short term: eventually we'll want to add a dependency on a proper URL handling module in urllib3, but until that work gets done we can't resolve this. \r\n\r\nIf you're interested in doing that work please open an issue on urllib3 and we can discuss steps forward. "
] |
https://api.github.com/repos/psf/requests/issues/4249
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4249/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4249/comments
|
https://api.github.com/repos/psf/requests/issues/4249/events
|
https://github.com/psf/requests/issues/4249
| 252,070,388 |
MDU6SXNzdWUyNTIwNzAzODg=
| 4,249 |
requests-http-signature
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/862013?v=4",
"events_url": "https://api.github.com/users/kislyuk/events{/privacy}",
"followers_url": "https://api.github.com/users/kislyuk/followers",
"following_url": "https://api.github.com/users/kislyuk/following{/other_user}",
"gists_url": "https://api.github.com/users/kislyuk/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/kislyuk",
"id": 862013,
"login": "kislyuk",
"node_id": "MDQ6VXNlcjg2MjAxMw==",
"organizations_url": "https://api.github.com/users/kislyuk/orgs",
"received_events_url": "https://api.github.com/users/kislyuk/received_events",
"repos_url": "https://api.github.com/users/kislyuk/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/kislyuk/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/kislyuk/subscriptions",
"type": "User",
"url": "https://api.github.com/users/kislyuk",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 4 |
2017-08-22T19:54:03Z
|
2021-09-08T07:00:28Z
|
2017-08-22T19:58:14Z
|
NONE
|
resolved
|
I have published a new PyPI module, https://github.com/kislyuk/requests-http-signature, to implement the IETF draft for HTTP signatures (https://tools.ietf.org/html/draft-cavage-http-signatures-07). This draft RFC formalizes the use of symmetric (HMAC-SHA1, HMAC-SHA256) and asymmetric (RSA-SHA256, ECDSA-SHA256) message signing in HTTP.
Is there interest in bringing this module under the requests organization?
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4",
"events_url": "https://api.github.com/users/Lukasa/events{/privacy}",
"followers_url": "https://api.github.com/users/Lukasa/followers",
"following_url": "https://api.github.com/users/Lukasa/following{/other_user}",
"gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Lukasa",
"id": 1382556,
"login": "Lukasa",
"node_id": "MDQ6VXNlcjEzODI1NTY=",
"organizations_url": "https://api.github.com/users/Lukasa/orgs",
"received_events_url": "https://api.github.com/users/Lukasa/received_events",
"repos_url": "https://api.github.com/users/Lukasa/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Lukasa",
"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/4249/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4249/timeline
| null |
completed
| null | null | false |
[
"Very nice work! For the moment I think it would be best to keep it separate; this ensures we don't bottleneck on the limited resources of the Requests team. However, if there is significant uptake and you no longer have the resources to do solo maintainership please let us know and we'll re-evaluate. ",
"For reference, here is an issue tracking HTTP Signatures standard finalization: https://github.com/w3c-dvcg/http-signatures/issues/1",
"We should have a document in our docs for modules like this",
"https://github.com/requests/requests/issues/4267"
] |
https://api.github.com/repos/psf/requests/issues/4248
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4248/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4248/comments
|
https://api.github.com/repos/psf/requests/issues/4248/events
|
https://github.com/psf/requests/issues/4248
| 251,389,826 |
MDU6SXNzdWUyNTEzODk4MjY=
| 4,248 |
Error decoding chunked response in _update_chunk_length: ValueError: invalid literal for int() with base 16: b'HTTP/1.1 200 OK\r\n'
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/398575?v=4",
"events_url": "https://api.github.com/users/danc86/events{/privacy}",
"followers_url": "https://api.github.com/users/danc86/followers",
"following_url": "https://api.github.com/users/danc86/following{/other_user}",
"gists_url": "https://api.github.com/users/danc86/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/danc86",
"id": 398575,
"login": "danc86",
"node_id": "MDQ6VXNlcjM5ODU3NQ==",
"organizations_url": "https://api.github.com/users/danc86/orgs",
"received_events_url": "https://api.github.com/users/danc86/received_events",
"repos_url": "https://api.github.com/users/danc86/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/danc86/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/danc86/subscriptions",
"type": "User",
"url": "https://api.github.com/users/danc86",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 25 |
2017-08-19T01:04:30Z
|
2021-08-31T00:06:58Z
|
2019-02-04T11:51:47Z
|
NONE
|
resolved
|
Decoding a response with chunked encoding fails because it seems to be reading from the HTTP status line instead of the start of the body.
## Expected Result
Successfully return a 200 response object.
## Actual Result
```
Traceback (most recent call last):
File "/usr/lib/python3.6/site-packages/requests/packages/urllib3/response.py", line 535, in _update_chunk_length
self.chunk_left = int(line, 16)
ValueError: invalid literal for int() with base 16: b'HTTP/1.1 200 OK\r\n'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3.6/site-packages/requests/packages/urllib3/response.py", line 298, in _error_catcher
yield
File "/usr/lib/python3.6/site-packages/requests/packages/urllib3/response.py", line 590, in read_chunked
self._update_chunk_length()
File "/usr/lib/python3.6/site-packages/requests/packages/urllib3/response.py", line 539, in _update_chunk_length
raise httplib.IncompleteRead(line)
http.client.IncompleteRead: IncompleteRead(17 bytes read)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3.6/site-packages/requests/models.py", line 719, in generate
for chunk in self.raw.stream(chunk_size, decode_content=True):
File "/usr/lib/python3.6/site-packages/requests/packages/urllib3/response.py", line 428, in stream
for line in self.read_chunked(amt, decode_content=decode_content):
File "/usr/lib/python3.6/site-packages/requests/packages/urllib3/response.py", line 618, in read_chunked
self._original_response.close()
File "/usr/lib64/python3.6/contextlib.py", line 99, in __exit__
self.gen.throw(type, value, traceback)
File "/usr/lib/python3.6/site-packages/requests/packages/urllib3/response.py", line 316, in _error_catcher
raise ProtocolError('Connection broken: %r' % e, e)
requests.packages.urllib3.exceptions.ProtocolError: ('Connection broken: IncompleteRead(17 bytes read)', IncompleteRead(17 bytes read))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/lib/python3.6/site-packages/requests/api.py", line 70, in get
return request('get', url, params=params, **kwargs)
File "/usr/lib/python3.6/site-packages/requests/api.py", line 56, in request
return session.request(method=method, url=url, **kwargs)
File "/usr/lib/python3.6/site-packages/requests/sessions.py", line 488, in request
resp = self.send(prep, **send_kwargs)
File "/usr/lib/python3.6/site-packages/requests/sessions.py", line 641, in send
r.content
File "/usr/lib/python3.6/site-packages/requests/models.py", line 797, in content
self._content = bytes().join(self.iter_content(CONTENT_CHUNK_SIZE)) or bytes()
File "/usr/lib/python3.6/site-packages/requests/models.py", line 722, in generate
raise ChunkedEncodingError(e)
requests.exceptions.ChunkedEncodingError: ('Connection broken: IncompleteRead(17 bytes read)', IncompleteRead(17 bytes read))
```
## Reproduction Steps
```python
import requests
requests.get('https://my.virginmoney.com.au/AUVMA/JSO/signon/DisplayUsernameSignon.do')
```
## System Information
requests 2.13.0
urllib3 1.20
Python 3.6.2
Fedora 26
|
{
"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": 6,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 6,
"url": "https://api.github.com/repos/psf/requests/issues/4248/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4248/timeline
| null |
completed
| null | null | false |
[
"This works fine with requests 2.10.0 so something regressed between then and 2.13.0. Also tested with 2.18.4 and the bug exists as above.",
"I can't spot anything defective or invalid in the response from that server when I look at it manually.\r\n\r\nOne thing I do notice is that it is using both `Content-Encoding: gzip` and `Transfer-Encoding: chunked` which might be a little unusual. Could this bug be caused by some bad interaction between the gzip decoding and chunk decoding?",
"I can't reproduce this with Requests 2.18.4 on either Python 3 or Python 2. Have you tried updating urllib3 to check if this resolves the problem?",
"Okay sorry, my comment above about 2.10.0 vs. 2.13.0 was incorrect. I did not thoroughly test all the combinations. It turns out this works fine with all versions/combinations of requests and urllib3 that I tested on Fedora 25 but fails with all versions/combinations of requests and urllib3 that I tested on Fedora 26.\r\n\r\nWhich most likely means: it's something specific to Python 3.6?\r\n\r\n",
"Or at least Fedora 36, as it works fine for me with my Python 3.6.2 on macOS. I recommend reporting a bug with Fedora. ",
"I get this error on Windows with the latest Python 3.7 alpha and latest requests / urllib3. When I use Python 3.5 then it works fine with the same requests / urllib3. I'm suspecting a python version issue as well. ",
"I haven't dug into this in a while. Back when I was looking at it, I could not find any substantial differences between Fedora 25 and 26 in Python land at all (same Python version, same version of all the relevant Python libraries I could see, same code for urllib3 and requests) *but* one big difference did stand out: Fedora 25 has openssl 1.0.2 whereas Fedora 26+ has openssl 1.1.0. Not sure if that is related.",
"i'm facing same kind of issue. any idea how to bypass this?\r\n```\r\n<Response [200]>\r\nTraceback (most recent call last):\r\n File \"/Users/officeuse/environs/py_elt_service/lib/python3.6/site-packages/requests/packages/urllib3/response.py\", line 539, in _update_chunk_length\r\n self.chunk_left = int(line, 16)\r\nValueError: invalid literal for int() with base 16: b''\r\n\r\nDuring handling of the above exception, another exception occurred:\r\n\r\nTraceback (most recent call last):\r\n File \"/Users/officeuse/environs/py_elt_service/lib/python3.6/site-packages/requests/packages/urllib3/response.py\", line 302, in _error_catcher\r\n yield\r\n File \"/Users/officeuse/environs/py_elt_service/lib/python3.6/site-packages/requests/packages/urllib3/response.py\", line 594, in read_chunked\r\n self._update_chunk_length()\r\n File \"/Users/officeuse/environs/py_elt_service/lib/python3.6/site-packages/requests/packages/urllib3/response.py\", line 543, in _update_chunk_length\r\n raise httplib.IncompleteRead(line)\r\nhttp.client.IncompleteRead: IncompleteRead(0 bytes read)\r\n\r\nDuring handling of the above exception, another exception occurred:\r\n\r\nTraceback (most recent call last):\r\n File \"/Users/officeuse/environs/py_elt_service/lib/python3.6/site-packages/requests/models.py\", line 738, in generate\r\n for chunk in self.raw.stream(chunk_size, decode_content=True):\r\n File \"/Users/officeuse/environs/py_elt_service/lib/python3.6/site-packages/requests/packages/urllib3/response.py\", line 432, in stream\r\n for line in self.read_chunked(amt, decode_content=decode_content):\r\n File \"/Users/officeuse/environs/py_elt_service/lib/python3.6/site-packages/requests/packages/urllib3/response.py\", line 622, in read_chunked\r\n self._original_response.close()\r\n File \"/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/contextlib.py\", line 100, in __exit__\r\n self.gen.throw(type, value, traceback)\r\n File \"/Users/officeuse/environs/py_elt_service/lib/python3.6/site-packages/requests/packages/urllib3/response.py\", line 320, in _error_catcher\r\n raise ProtocolError('Connection broken: %r' % e, e)\r\nrequests.packages.urllib3.exceptions.ProtocolError: ('Connection broken: IncompleteRead(0 bytes read)', IncompleteRead(0 bytes read))\r\n\r\nDuring handling of the above exception, another exception occurred:\r\n\r\nTraceback (most recent call last):\r\n File \"loginscheck.py\", line 49, in <module>\r\n f.write(req.text)\r\n File \"/Users/officeuse/environs/py_elt_service/lib/python3.6/site-packages/requests/models.py\", line 840, in text\r\n if not self.content:\r\n File \"/Users/officeuse/environs/py_elt_service/lib/python3.6/site-packages/requests/models.py\", line 816, in content\r\n self._content = bytes().join(self.iter_content(CONTENT_CHUNK_SIZE)) or bytes()\r\n File \"/Users/officeuse/environs/py_elt_service/lib/python3.6/site-packages/requests/models.py\", line 741, in generate\r\n raise ChunkedEncodingError(e)\r\nrequests.exceptions.ChunkedEncodingError: ('Connection broken: IncompleteRead(0 bytes read)', IncompleteRead(0 bytes read))\r\n```\r\n",
"I solved this problem by adding one line code.\r\n# \r\npython3 on Mac\r\nurllib3 == 1.23\r\nrequests == 2.19.1\r\n# \r\n> Traceback (most recent call last):\r\n File \"/usr/local/Cellar/python3/3.6.4/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/urllib3/response.py\", line 574, in _update_chunk_length\r\n self.chunk_left = int(line, 16)\r\nValueError: invalid literal for int() with base 16: b''\r\n\r\nso, I open the file \"......./urllib3/response.py\", add `line = (len(line)>0 and line or \"0\")` in 571, like below:\r\n```\r\n def _update_chunk_length(self):\r\n # First, we'll figure out length of a chunk and then\r\n # we'll try to read it from socket.\r\n if self.chunk_left is not None:\r\n return\r\n line = self._fp.fp.readline()\r\n line = line.split(b';', 1)[0]\r\n line = (len(line)>0 and line or \"0\") # added this line\r\n try:\r\n self.chunk_left = int(line, 16)\r\n except ValueError:\r\n # Invalid chunked protocol response, abort.\r\n self.close()\r\n raise httplib.IncompleteRead(line)\r\n```\r\n\r\n\r\n",
"> I solved this problem by adding one line code.\r\n> \r\n> python3 on Mac\r\n> urllib3 == 1.23\r\n> requests == 2.19.1\r\n> \r\n> > Traceback (most recent call last):\r\n> > File \"/usr/local/Cellar/python3/3.6.4/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/urllib3/response.py\", line 574, in _update_chunk_length\r\n> > self.chunk_left = int(line, 16)\r\n> > ValueError: invalid literal for int() with base 16: b''\r\n> \r\n> so, I open the file \"......./urllib3/response.py\", add `line = (len(line)>0 and line or \"0\")` in 571, like below:\r\n> \r\n> ```\r\n> def _update_chunk_length(self):\r\n> # First, we'll figure out length of a chunk and then\r\n> # we'll try to read it from socket.\r\n> if self.chunk_left is not None:\r\n> return\r\n> line = self._fp.fp.readline()\r\n> line = line.split(b';', 1)[0]\r\n> line = (len(line)>0 and line or \"0\") # added this line\r\n> try:\r\n> self.chunk_left = int(line, 16)\r\n> except ValueError:\r\n> # Invalid chunked protocol response, abort.\r\n> self.close()\r\n> raise httplib.IncompleteRead(line)\r\n> ```\r\n\r\nIt looks that ths line fixes the problem for me. Can you please explain what this line do?",
"Shouldn't this then be fixed in urllib3? @Lukasa ",
"@KonMann yes it should. ",
"@cosminnastasie I am a little forgotten. It seems like that without this line, there should be occur problem at the last chunk data. when the value of 'line' is Null, the error arise.",
"@cosminnastasie \r\n\r\n```\r\n>>> line = b''\r\n>>> line = line.split(b';', 1)[0]\r\n>>> int(line,16)\r\nTraceback (most recent call last):\r\n File \"<stdin>\", line 1, in <module>\r\nValueError: invalid literal for int() with base 16: b''\r\n```\r\n\r\nbut if we add that line:\r\n```\r\n>>> line = b''\r\n>>> line = line.split(b';', 1)[0]\r\n>>> line = (len(line)>0 and line or \"0\") # added this line\r\n>>> int(line,16)\r\n0\r\n```\r\n\r\nproblem solved!!!",
"@sigmavirus24 ok, as far as I can see there is no open issue about this in the [Urllib3 Issue Tracker](https://github.com/urllib3/urllib3/issues?utf8=%E2%9C%93&q=is%3Aissue+open) at the moment => Let's open an issue there?",
"@KonMann you seem to have more time than me. Go for it.",
"@odboy Do you have some code to reproduce?",
"We temporarily repaired it in this way. I wonder if there will be any problem.\r\n\r\n\r\n def _update_chunk_length(self):\r\n # First, we'll figure out length of a chunk and then\r\n # we'll try to read it from socket.\r\n if self.chunk_left is not None:\r\n return\r\n line = self._fp.fp.readline()\r\n line = line.split(b';', 1)[0]\r\n try:\r\n if len(line) == 0:\r\n self.chunk_left = 0\r\n else:\r\n self.chunk_left = int(line, 16)\r\n except ValueError:\r\n # Invalid chunked protocol response, abort.\r\n self.close()\r\n raise httplib.IncompleteRead(line)",
"I'm running into this exact issue as well, with an identical traceback as https://github.com/requests/requests/issues/4248#issuecomment-398007524. I've tried reverting requests as far back as 2.9.1, and as far forward as the current release (2.20.1), with a few different combinations of urllib3 versions in each case - they all give the exact same traceback.\r\n\r\nIs there a release which we can use until this is fixed, or do we have to patch our requests with the above corrected def?",
"I am having this issue as well, and I agree the problem is at the urllib3 level.",
"Can we agree on where we want this issue to be fixed? Here in requests or in urllib3?",
"The underlying exception comes from urllib3, but as @dulitz explained in urllib3/urllib3#1516, this isn't necessarily always a \"bug\" in requests or urllib3. So \"fixing\" it might not be easy or possible. Regardless, I'm closing this issue here.",
"I am able to reproduce the same bug by using this code\r\n\r\nimport requests\r\nrequests.get('https://www.telecreditobcp.com/tlcnp/index.do')\r\n\r\nI think this is a bug in the server side, but maybe urllib3 could do a better job workarounding this bug in the server, as other libraries / applications do for example (same URL works ok in a web browser like chrome or firefox ...)",
"As far as I could see, the server (in the example above) sends chunked transfer, but it does not send properly the last 0-length chunk and returns the response code. That's where urllib3 raises exception when trying to decode the length of the chunk from the response status code line. Some insights I could find so far:\r\n\r\n* the same request works in a browser without complain (I have tried sending same headers than the browser but didn't see a different for the sample code reproducing the bug)\r\n\r\n* sometimes the request works perfectly with the sample code for a while, and then stops working again. So as our local side has not changed really, I assume there is some load balancing or something and we are served by another server maybe with possibly a slightly different version of software.\r\n\r\n* the following code makes it deliver part of the content but still not the full content:\r\n\r\nr = requests.get('https://www.telecreditobcp.com/tlcnp/index.do', stream=True)\r\nfor line in r.iter_lines():\r\n print(line)\r\n\r\n* the bug in my local environment happens with python 3.6.8, 3.7.3 and 2.7.16 versions in Linux. Have tried same kernel though (5.1.16-300.fc30.x86_64).\r\n\r\n* Have tried with Ubuntu and Fedora, both seem to fail same way.\r\n\r\n* I have a server in AWS running Linux with python 3.5.2, and it works always, no bugs\r\n\r\n* I've been told the bug seems not reproducible in Windows environment with any version.\r\n\r\n* I've been told enabling traffic through a VPN makes it work in a Linux environment that used to fail.\r\n\r\n* same bug seems to happen with curl\r\ncurl -X GET https://www.telecreditobcp.com/tlcnp/index.do\r\n\r\ncurl: (56) Illegal or missing hexadecimal sequence in chunked-encoding\r\n",
"> line = (len(line)>0 and line or \"0\") # added this line\r\n\r\nSolved my problem. Man is a LEGEND."
] |
https://api.github.com/repos/psf/requests/issues/4247
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4247/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4247/comments
|
https://api.github.com/repos/psf/requests/issues/4247/events
|
https://github.com/psf/requests/issues/4247
| 251,320,530 |
MDU6SXNzdWUyNTEzMjA1MzA=
| 4,247 |
Having trouble with SSL verification
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/19782075?v=4",
"events_url": "https://api.github.com/users/TJOak/events{/privacy}",
"followers_url": "https://api.github.com/users/TJOak/followers",
"following_url": "https://api.github.com/users/TJOak/following{/other_user}",
"gists_url": "https://api.github.com/users/TJOak/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/TJOak",
"id": 19782075,
"login": "TJOak",
"node_id": "MDQ6VXNlcjE5NzgyMDc1",
"organizations_url": "https://api.github.com/users/TJOak/orgs",
"received_events_url": "https://api.github.com/users/TJOak/received_events",
"repos_url": "https://api.github.com/users/TJOak/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/TJOak/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/TJOak/subscriptions",
"type": "User",
"url": "https://api.github.com/users/TJOak",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 2 |
2017-08-18T18:14:19Z
|
2021-09-08T07:00:31Z
|
2017-08-18T20:20:22Z
|
NONE
|
resolved
|
Preface: I have a feeling that this isn't an issue with requests itself, but it did up come while I was using it, so I was hoping that you could offer some insight. This issue might even be the same one that hellt had in https://github.com/requests/requests/issues/3212 , but there are a few differences that made me uncertain whether that is actually the case. My apologies if it's a duplicate.
The error in question:
```
Traceback (most recent call last):
File "ALT_post_api.py", line 177, in <module>
main()
File "ALT_post_api.py", line 96, in main
response = requests.get(url, headers=headers, verify="/path/to/ssl/DigiCertCA.crt")
File "/export/software/lib/python2.7/site-packages/requests/api.py", line 72, in get
return request('get', url, params=params, **kwargs)
File "/export/software/lib/python2.7/site-packages/requests/api.py", line 58, in request
return session.request(method=method, url=url, **kwargs)
File "/export/software/lib/python2.7/site-packages/requests/sessions.py", line 502, in request
resp = self.send(prep, **send_kwargs)
File "/export/software/lib/python2.7/site-packages/requests/sessions.py", line 612, in send
r = adapter.send(request, **kwargs)
File "/export/software/lib/python2.7/site-packages/requests/adapters.py", line 514, in send
raise SSLError(e, request=request)
requests.exceptions.SSLError: ("bad handshake: Error([('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')],)",)
```
Looking at the Apache config, an SSLCertificateFile, an SSLCertificateKeyFile, and an SSLCertificateChainFile are specified. The above uses the SSLCertificateChainFile (DigiCertCA.crt) in the verify parameter, though both True and the SSLCertificateFile throw the same exact error. I tried appending those two files to a copy of the file given by `certifi.where()` (named cacert.pem) as seems to be suggested in the linked issue, but it also throws the same error.
Versions:
```
Python 2.7.12
>>> requests.__version__
'2.18.1'
>>> certifi.__version__
'2017.04.17'
>>> ssl.OPENSSL_VERSION
'OpenSSL 1.0.1e-fips 11 Feb 2013'
```
This is the result of running `openssl s_client -connect my_host:443 -showcerts -servername my_host`, HOWEVER, I later ran openssl version and got OpenSSL 0.9.8za 5 Jun 2014; this isn't the version Python is using:
```
CONNECTED(00000003)
depth=0 /C=US/ST=[redacted; local area + host]
verify error:num=20:unable to get local issuer certificate
verify return:1
depth=0 /C=US/ST=[redacted; local area + host]
verify error:num=27:certificate not trusted
verify return:1
depth=0 /C=US/ST=[redacted; local area + host]
verify error:num=21:unable to verify the first certificate
verify return:1
---
Certificate chain
0 s:/C=US/ST=[redacted; local area + host]
i:/C=US/O=DigiCert Inc/OU=www.digicert.com/CN=DigiCert SHA2 High Assurance Server CA
-----BEGIN CERTIFICATE-----
MIIFmzC[redacted]
-----END CERTIFICATE-----
1 s:/C=US/O=DigiCert Inc/OU=www.digicert.com/CN=DigiCert High Assurance CA-3
i:/C=US/O=DigiCert Inc/OU=www.digicert.com/CN=DigiCert High Assurance EV Root CA
-----BEGIN CERTIFICATE-----
MIIGWDC[redacted]
-----END CERTIFICATE-----
---
Server certificate
subject=/C=US/ST=[redacted; local area + host]
issuer=/C=US/O=DigiCert Inc/OU=www.digicert.com/CN=DigiCert SHA2 High Assurance Server CA
---
No client certificate CA names sent
---
SSL handshake has read 3980 bytes and written 329 bytes
---
New, TLSv1/SSLv3, Cipher is DHE-RSA-AES128-SHA
Server public key is 2048 bit
Secure Renegotiation IS supported
Compression: NONE
Expansion: NONE
SSL-Session:
Protocol : TLSv1
Cipher : DHE-RSA-AES128-SHA
Session-ID: 400E[etc]
Session-ID-ctx:
Master-Key: E536[etc.]
Key-Arg : None
TLS session ticket:
0000 - 48 39 0b 54 3d 88 e3 bf-69 71 ac ea 7e aa fe 9a H9.T=...iq..~...
[etc.]
00d0 - b7 23 f5 ed a7 6c 9a 56-09 c2 ac 32 11 6e 5c c6 .#...l.V...2.n\.
Start Time: 1503002301
Timeout : 300 (sec)
Verify return code: 21 (unable to verify the first certificate)
---
```
But specifying -CAfile with the SSLCertificateFile, DigiCertCA.crt, or cacert.pem returns '0 (ok)':
```
depth=2 /C=US/O=DigiCert Inc/OU=www.digicert.com/CN=DigiCert High Assurance EV Root CA
verify return:1
depth=1 /C=US/O=DigiCert Inc/OU=www.digicert.com/CN=DigiCert SHA2 High Assurance Server CA
verify return:1
depth=0 /C=US/ST=[redacted; local area + host]
verify return:1
---
Certificate chain
0 s:/C=US/ST=[redacted; local area + host]
i:/C=US/O=DigiCert Inc/OU=www.digicert.com/CN=DigiCert SHA2 High Assurance Server CA
-----BEGIN CERTIFICATE-----
MIIFmzC[redacted]
-----END CERTIFICATE-----
1 s:/C=US/O=DigiCert Inc/OU=www.digicert.com/CN=DigiCert High Assurance CA-3
i:/C=US/O=DigiCert Inc/OU=www.digicert.com/CN=DigiCert High Assurance EV Root CA
-----BEGIN CERTIFICATE-----
MIIGWDC[redacted]
-----END CERTIFICATE-----
---
Server certificate
subject=/C=US/ST=[redacted; local area + host]
issuer=/C=US/O=DigiCert Inc/OU=www.digicert.com/CN=DigiCert SHA2 High Assurance Server CA
---
No client certificate CA names sent
---
SSL handshake has read 3980 bytes and written 329 bytes
---
New, TLSv1/SSLv3, Cipher is DHE-RSA-AES128-SHA
Server public key is 2048 bit
Secure Renegotiation IS supported
Compression: NONE
Expansion: NONE
SSL-Session:
Protocol : TLSv1
Cipher : DHE-RSA-AES128-SHA
Session-ID: 0EFE[etc.]
Session-ID-ctx:
Master-Key: 856A[etc.]
Key-Arg : None
TLS session ticket:
0000 - 48 39 0b 54 3d 88 e3 bf-69 71 ac ea 7e aa fe 9a H9.T=...iq..~...
[etc.]
00d0 - 1e 0c ac a4 32 6d 57 6b-64 19 32 69 6b 62 a4 f3 ....2mWkd.2ikb..
Start Time: 1503002938
Timeout : 300 (sec)
Verify return code: 0 (ok)
---
```
Now for the output of the OpenSSL version that Python is actually using:
```
CONNECTED(00000003)
depth=0 C = US, ST = [redacted; local area + host]
verify error:num=20:unable to get local issuer certificate
verify return:1
depth=0 C = US, ST = [redacted; local area + host]
verify error:num=27:certificate not trusted
verify return:1
depth=0 C = US, ST = [redacted; local area + host]
verify error:num=21:unable to verify the first certificate
verify return:1
---
Certificate chain
0 s:/C=US/ST=[redacted; local area + host]
i:/C=US/O=DigiCert Inc/OU=www.digicert.com/CN=DigiCert SHA2 High Assurance Server CA
-----BEGIN CERTIFICATE-----
MIIFmzC[redacted]
-----END CERTIFICATE-----
1 s:/C=US/O=DigiCert Inc/OU=www.digicert.com/CN=DigiCert High Assurance CA-3
i:/C=US/O=DigiCert Inc/OU=www.digicert.com/CN=DigiCert High Assurance EV Root CA
-----BEGIN CERTIFICATE-----
MIIGWDC[redacted]
-----END CERTIFICATE-----
---
Server certificate
subject=/C=US/ST=[redacted; local area + host]
issuer=/C=US/O=DigiCert Inc/OU=www.digicert.com/CN=DigiCert SHA2 High Assurance Server CA
---
No client certificate CA names sent
Server Temp Key: DH, 1024 bits
---
SSL handshake has read 3980 bytes and written 492 bytes
---
New, TLSv1/SSLv3, Cipher is DHE-RSA-AES128-SHA
Server public key is 2048 bit
Secure Renegotiation IS supported
Compression: NONE
Expansion: NONE
SSL-Session:
Protocol : TLSv1
Cipher : DHE-RSA-AES128-SHA
Session-ID: D4AD[redacted]
Session-ID-ctx:
Master-Key: 7732[redacted]
Key-Arg : None
Krb5 Principal: None
PSK identity: None
PSK identity hint: None
TLS session ticket:
0000 - 48 39 0b 54 3d 88 e3 bf-69 71 ac ea 7e aa fe 9a H9.T=...iq..~...
[etc.]
00d0 - 3f ff 52 7a 03 a7 ee f3-7f d0 f0 ae f2 b3 46 a0 ?.Rz..........F.
Start Time: 1503072674
Timeout : 300 (sec)
Verify return code: 21 (unable to verify the first certificate)
```
(One difference I noticed was "Server Temp Key: DH, 1024 bits")
The reason I included the outputs of both versions of `openssl` is because the version Python is using always seems to return 21, even when `-CAfile` is specified.
I tried compiling Python with the other version of OpenSSL, but ran into issues, so I figured I should ask if that has a good chance of fixing my problem before continuing.
## Expected Result
A GET request should be made and retrieve some data. This does work with `verify=False`.
## Actual Result
Request seems to fail verifying the certificate.
## System Information
$ python -m requests.help
```
{
"chardet": {
"version": "3.0.4"
},
"cryptography": {
"version": "2.0.3"
},
"implementation": {
"name": "CPython",
"version": "2.7.12"
},
"platform": {
"release": "2.6.32-642.11.1.el6.x86_64",
"system": "Linux"
},
"pyOpenSSL": {
"openssl_version": "1010006f",
"version": "17.2.0"
},
"requests": {
"version": "2.18.1"
},
"system_ssl": {
"version": "1000105f"
},
"urllib3": {
"version": "1.21.1"
},
"using_pyopenssl": true
}
```
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/19782075?v=4",
"events_url": "https://api.github.com/users/TJOak/events{/privacy}",
"followers_url": "https://api.github.com/users/TJOak/followers",
"following_url": "https://api.github.com/users/TJOak/following{/other_user}",
"gists_url": "https://api.github.com/users/TJOak/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/TJOak",
"id": 19782075,
"login": "TJOak",
"node_id": "MDQ6VXNlcjE5NzgyMDc1",
"organizations_url": "https://api.github.com/users/TJOak/orgs",
"received_events_url": "https://api.github.com/users/TJOak/received_events",
"repos_url": "https://api.github.com/users/TJOak/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/TJOak/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/TJOak/subscriptions",
"type": "User",
"url": "https://api.github.com/users/TJOak",
"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/4247/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4247/timeline
| null |
completed
| null | null | false |
[
"So there are a number of issues here, but the core problem is that your server is not sending a TLS cert chain that makes any sense at all. From your OpenSSL output, the server is sending two certs:\r\n\r\n1. [redacted; local area + host], issued by DigiCert SHA2 High Assurance Server CA\r\n2. DigiCert High Assurance CA-3, issued by DigiCert High Assurance EV Root CA\r\n\r\nThe way the cert chain is *supposed* to work is that you send all the certificates needed to build the trust chain except for the root: that is, you send the leaf, the intermediate that issued the leaf, the intermediate that issued that intermediate, and so on, ending with the intermediate that was issued by the root.\r\n\r\nYour cert chain does not do that. It sends only two certs, and the second appears to be totally unrelated to the first! It certainly didn't issue it. Either an intermediate is missing (that should go between the two certs your server sent), or you are sending a chain for a different certificate.\r\n\r\nEither way, adding the missing intermediate to the trust store should fix the problem. As should fixing the server so it sends the right cert! 😉",
"Thank you! \r\n(While not yet fixed, closing since I should be able to figure it out from here.)"
] |
https://api.github.com/repos/psf/requests/issues/4246
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4246/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4246/comments
|
https://api.github.com/repos/psf/requests/issues/4246/events
|
https://github.com/psf/requests/issues/4246
| 251,072,141 |
MDU6SXNzdWUyNTEwNzIxNDE=
| 4,246 |
SSLError HTTPSConnectionPool Max retries exceeded with url: /oauth/token Caused by SSLError('bad handshake: SysCallError(0, None))
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/16965638?v=4",
"events_url": "https://api.github.com/users/albayraktaroglu/events{/privacy}",
"followers_url": "https://api.github.com/users/albayraktaroglu/followers",
"following_url": "https://api.github.com/users/albayraktaroglu/following{/other_user}",
"gists_url": "https://api.github.com/users/albayraktaroglu/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/albayraktaroglu",
"id": 16965638,
"login": "albayraktaroglu",
"node_id": "MDQ6VXNlcjE2OTY1NjM4",
"organizations_url": "https://api.github.com/users/albayraktaroglu/orgs",
"received_events_url": "https://api.github.com/users/albayraktaroglu/received_events",
"repos_url": "https://api.github.com/users/albayraktaroglu/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/albayraktaroglu/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/albayraktaroglu/subscriptions",
"type": "User",
"url": "https://api.github.com/users/albayraktaroglu",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 12 |
2017-08-17T21:05:08Z
|
2021-08-29T00:06:52Z
|
2017-08-18T16:59:26Z
|
NONE
|
resolved
|
## Summary
The problem that I am having is showing up after user enters their credentials at the Auth0's lock screen. When I looked at Auth0 Dashboard's log section I can see users can login successfully ( I see both Success Exchange, Success Login ). Then call back function is triggering the callback call. At that point production and test(localhost) environments differs from each other.
In localhost I can see the status code 302 Found status code on the localhost but not in the production server. In production server I am seeing the status code 500 INTERNAL SERVER ERROR.
When I checked the server side I saw it was failing at the token line of the callback function
```
@app.route('/callback')
def callback_handling():
code = request.args.get('CODE_KEY')
get_token = GetToken('AUTH0_DOMAIN')
auth0_users = Users('AUTH0_DOMAIN')
token = get_token.authorization_code('AUTH0_CLIENT_ID'], ['AUTH0_CLIENT_SECRET', code, 'AUTH0_CALLBACK_URL') # FAILING HERE #
user_info = auth0_users.userinfo(token['access_token'])
.....
...
..
return redirect('/some_path')
```
When I checked the credentials they all look what they are supposed to be. So in the server logs I am seeing this keywords in the servers.
```
ERROR in app: Exception on /callback
raise SSLError(e, request=request)
SSLError: HTTPSConnectionPool(host='my_domain.auth0.com', port=443): Max retries exceeded with url: /oauth/token (Caused by SSLError(SSLError('bad handshake: SysCallError(0, None)',),))
```
I am thinking server might be rejecting the certificate or something and after seeing [this link](https://github.com/rackspace/pyrax/issues/601) thought opening issue might be helpful.
Ubuntu 16.04, Python 2.7.12, certifi 2017.7.27.1
## Expected Result
In the callback function returns token
` token = get_token.authorization_code('AUTH0_CLIENT_ID', 'AUTH0_CLIENT_SECRET', code, 'AUTH0_CALLBACK_URL') `
## Actual Result
`SSLError: HTTPSConnectionPool(host='my_domain.auth0.com', port=443): Max retries exceeded with url: /oauth/token (Caused by SSLError(SSLError('bad handshake: SysCallError(0, None)',`
## Reproduction Steps
```python
import requests
```
## System Information
$ python -m requests.help
```
python -m requests.help
{
"chardet": {
"version": "3.0.4"
},
"cryptography": {
"version": "1.2.3"
},
"idna": {
"version": "2.6"
},
"implementation": {
"name": "CPython",
"version": "2.7.12"
},
"platform": {
"release": "3.13.0-43-generic",
"system": "Linux"
},
"pyOpenSSL": {
"openssl_version": "1000207f",
"version": "0.15.1"
},
"requests": {
"version": "2.18.4"
},
"system_ssl": {
"version": "1000207f"
},
"urllib3": {
"version": "1.22"
},
"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/1382556?v=4",
"events_url": "https://api.github.com/users/Lukasa/events{/privacy}",
"followers_url": "https://api.github.com/users/Lukasa/followers",
"following_url": "https://api.github.com/users/Lukasa/following{/other_user}",
"gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Lukasa",
"id": 1382556,
"login": "Lukasa",
"node_id": "MDQ6VXNlcjEzODI1NTY=",
"organizations_url": "https://api.github.com/users/Lukasa/orgs",
"received_events_url": "https://api.github.com/users/Lukasa/received_events",
"repos_url": "https://api.github.com/users/Lukasa/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Lukasa",
"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/4246/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4246/timeline
| null |
completed
| null | null | false |
[
"Thanks for this report! I think we need to see a bit more of the actual Requests code. It seems like the server is rejecting the handshake but it's hard to know more without seeing your requests call.",
"Hi Lukasa, \r\n\r\n\r\nThe code below is being called by ` token = get_token.authorization_code('AUTH0_CLIENT_ID'], ['AUTH0_CLIENT_SECRET', code, 'AUTH0_CALLBACK_URL') ` function which is located in my callback function.\r\n\r\n``` \r\nimport json\r\nimport requests\r\nfrom ..exceptions import Auth0Error\r\n\r\n\r\nclass AuthenticationBase(object):\r\n\r\n def post(self, url, data=None, headers=None):\r\n response = requests.post(url=url, data=json.dumps(data),\r\n headers=headers)\r\n return self._process_response(response)\r\n\r\n def get(self, url, params=None, headers=None):\r\n return requests.get(url=url, params=params, headers=headers).text\r\n\r\n def _process_response(self, response):\r\n try:\r\n text = json.loads(response.text) if response.text else {}\r\n except ValueError:\r\n return response.text\r\n else:\r\n if 'error' in text:\r\n raise Auth0Error(status_code=text['error'],\r\n error_code=text['error'],\r\n message=text['error_description'])\r\n return text\r\n\r\n```\r\n\r\nMore deeper\r\n\r\n```\r\ninstancemethod: <bound method GetToken._process_response of <auth0.v3.authentication.\r\n get_token.GetToken object at 0x7f4ff00a8450>>\r\n\r\n――――――――――――――――――――――――――――――――――――――――\r\ndef _process_response Found at: auth0.v3.authentication.base\r\n\r\ndef _process_response(self, response):\r\n try:\r\n text = json.loads(response.text) if response.text else {}\r\n except ValueError:\r\n return response.text\r\n else:\r\n if 'error' in text:\r\n raise Auth0Error(status_code=text['error'], \r\n error_code=text['error'], \r\n message=text['error_description'])\r\n \r\n return text\r\n````\r\n\r\nCloser look to exception's traceback \r\n\r\n```\r\n[Fri Aug 18 09:57:12.535170 2017] [wsgi:error] [pid 14121] File \"/usr/local/lib/python2.7/dist-packages/auth0/v3/authentication/get_token.py\", line 49, in authorization_code\r\n[Fri Aug 18 09:57:12.535300 2017] [wsgi:error] [pid 14121] headers={'Content-Type': 'application/json'}\r\n[Fri Aug 18 09:57:12.535315 2017] [wsgi:error] [pid 14121] File \"/usr/local/lib/python2.7/dist-packages/auth0/v3/authentication/base.py\", line 10, in post\r\n[Fri Aug 18 09:57:12.535366 2017] [wsgi:error] [pid 14121] headers=headers)\r\n[Fri Aug 18 09:57:12.535378 2017] [wsgi:error] [pid 14121] File \"/usr/local/lib/python2.7/dist-packages/requests/api.py\", line 112, in post\r\n[Fri Aug 18 09:57:12.535463 2017] [wsgi:error] [pid 14121] return request('post', url, data=data, json=json, **kwargs)\r\n[Fri Aug 18 09:57:12.535475 2017] [wsgi:error] [pid 14121] File \"/usr/local/lib/python2.7/dist-packages/requests/api.py\", line 58, in request\r\n[Fri Aug 18 09:57:12.535493 2017] [wsgi:error] [pid 14121] return session.request(method=method, url=url, **kwargs)\r\n[Fri Aug 18 09:57:12.535501 2017] [wsgi:error] [pid 14121] File \"/usr/local/lib/python2.7/dist-packages/requests/sessions.py\", line 508, in request\r\n[Fri Aug 18 09:57:12.535746 2017] [wsgi:error] [pid 14121] resp = self.send(prep, **send_kwargs)\r\n[Fri Aug 18 09:57:12.535759 2017] [wsgi:error] [pid 14121] File \"/usr/local/lib/python2.7/dist-packages/requests/sessions.py\", line 618, in send\r\n[Fri Aug 18 09:57:12.535775 2017] [wsgi:error] [pid 14121] r = adapter.send(request, **kwargs)\r\n[Fri Aug 18 09:57:12.535782 2017] [wsgi:error] [pid 14121] File \"/usr/local/lib/python2.7/dist-packages/requests/adapters.py\", line 506, in send\r\n[Fri Aug 18 09:57:12.535964 2017] [wsgi:error] [pid 14121] raise SSLError(e, request=request)\r\n[Fri Aug 18 09:57:12.535991 2017] [wsgi:error] [pid 14121] SSLError: HTTPSConnectionPool(host='domain.auth0.com', port=443): Max retries exceeded with url: /oauth/token (Caused by SSLError(SSLError('bad handshake: SysCallError(0, None)',),))\r\n[Fri Aug 18 09:57:12.536003 2017] [wsgi:error] [pid 14121] None\r\n```\r\n\r\nAny thoughts?\r\n\r\nThanks ",
"Hrm, it's not super apparent what's happening here. `SysCallError` is an odd one, but I suspect this is the result of the TLS connection being shut down. Are you familiar enough with Wireshark or tcpdump to get me a packet capture of the connection attempt?",
"Problem solved! I was thinking that is something related with certificates and started to look into `certifi` in the beginning but problem is about `pyOpenSSL` when I compared the local and production `pyOpenSSL` versions, saw big version gap. Steps we followed\r\n\r\n* uninstalled pyOpenSSL-0.15.1\r\n\r\n* installed pyOpenSSL-17.2.0 (the latest version)\r\n\r\nand it works now. Thank you for all your assistance. You can mark issue as solved 😄 ",
"Thanks!",
"@albayraktaroglu thanks :)! \r\n\r\nIt was solved by `pip install -U pyopenssl`",
"EZ\r\nuse and randomize proxies",
"https://stackoverflow.com/q/24323858/13476428\r\n\r\nThis solution fixed the issue by syncing the openssl versions\r\nif \r\n`--with-brewd-openssl ` \r\ndoesn't work try uninstalling python and then install openssl and reinstall python with homebrew with steps mentioned in the link\r\n",
"Just use verify=False to ignore the SSL.\r\n```\r\nimport requests\r\n\r\n#old code\r\nresponse = requests.get(url)\r\n\r\n#new code\r\nresponse = requests.get(url,verify=False)\r\n```",
"@albayraktaroglu The solution is not working for me. i have upgraded to 18.0.0 but still getting error.\r\n\r\n```\r\nSSLError\r\nHTTPSConnectionPool(host='firebasedynamiclinks.googleapis.com', port=443): Max retries exceeded with url: /v1/shortLinks?key=key (Caused by SSLError(SSLError(\"bad handshake: SysCallError(-1, 'Unexpected EOF')\",),))\r\n```",
"@albayraktaroglu Same story. Upgrading `pyopenssl` does not works for me. 👎 ",
"See my comment on May 14th.\r\n\r\n From what I get Python needs to reference the right version of openssl. To ensure that I uninstalled both python and openssl and followed the link for reinstallation"
] |
https://api.github.com/repos/psf/requests/issues/4245
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4245/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4245/comments
|
https://api.github.com/repos/psf/requests/issues/4245/events
|
https://github.com/psf/requests/pull/4245
| 250,810,681 |
MDExOlB1bGxSZXF1ZXN0MTM2MTU5ODY5
| 4,245 |
Fix parse_header_links on empty header
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/426784?v=4",
"events_url": "https://api.github.com/users/remram44/events{/privacy}",
"followers_url": "https://api.github.com/users/remram44/followers",
"following_url": "https://api.github.com/users/remram44/following{/other_user}",
"gists_url": "https://api.github.com/users/remram44/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/remram44",
"id": 426784,
"login": "remram44",
"node_id": "MDQ6VXNlcjQyNjc4NA==",
"organizations_url": "https://api.github.com/users/remram44/orgs",
"received_events_url": "https://api.github.com/users/remram44/received_events",
"repos_url": "https://api.github.com/users/remram44/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/remram44/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/remram44/subscriptions",
"type": "User",
"url": "https://api.github.com/users/remram44",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 4 |
2017-08-17T02:14:02Z
|
2021-09-04T00:06:52Z
|
2017-08-17T19:34:07Z
|
CONTRIBUTOR
|
resolved
|
When receiving an empty `Link:` header, one bogus entry was returned anyway. This breaks some applications.
I agree that web servers shouldn't be sending those but they do so here we are. Also fixes docstring with proper return type.
Fixes https://github.com/halcy/Mastodon.py/issues/74
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4",
"events_url": "https://api.github.com/users/Lukasa/events{/privacy}",
"followers_url": "https://api.github.com/users/Lukasa/followers",
"following_url": "https://api.github.com/users/Lukasa/following{/other_user}",
"gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Lukasa",
"id": 1382556,
"login": "Lukasa",
"node_id": "MDQ6VXNlcjEzODI1NTY=",
"organizations_url": "https://api.github.com/users/Lukasa/orgs",
"received_events_url": "https://api.github.com/users/Lukasa/received_events",
"repos_url": "https://api.github.com/users/Lukasa/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Lukasa",
"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/4245/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4245/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/4245.diff",
"html_url": "https://github.com/psf/requests/pull/4245",
"merged_at": "2017-08-17T19:34:07Z",
"patch_url": "https://github.com/psf/requests/pull/4245.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/4245"
}
| true |
[
"# [Codecov](https://codecov.io/gh/requests/requests/pull/4245?src=pr&el=h1) Report\n> Merging [#4245](https://codecov.io/gh/requests/requests/pull/4245?src=pr&el=desc) into [master](https://codecov.io/gh/requests/requests/commit/af9dd61fcba5a1d0b3f75abf5499f6e1f845349c?src=pr&el=desc) will **increase** coverage by `0.01%`.\n> The diff coverage is `100%`.\n\n[](https://codecov.io/gh/requests/requests/pull/4245?src=pr&el=tree)\n\n```diff\n@@ Coverage Diff @@\n## master #4245 +/- ##\n==========================================\n+ Coverage 88.65% 88.66% +0.01% \n==========================================\n Files 18 18 \n Lines 2018 2021 +3 \n==========================================\n+ Hits 1789 1792 +3 \n Misses 229 229\n```\n\n\n| [Impacted Files](https://codecov.io/gh/requests/requests/pull/4245?src=pr&el=tree) | Coverage Δ | |\n|---|---|---|\n| [requests/utils.py](https://codecov.io/gh/requests/requests/pull/4245?src=pr&el=tree#diff-cmVxdWVzdHMvdXRpbHMucHk=) | `82.87% <100%> (+0.12%)` | :arrow_up: |\n\n------\n\n[Continue to review full report at Codecov](https://codecov.io/gh/requests/requests/pull/4245?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/4245?src=pr&el=footer). Last update [af9dd61...8e411d0](https://codecov.io/gh/requests/requests/pull/4245?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).\n",
"Sure thing!",
"Congratulations on your first Requests contribution! ✨🍰✨",
"You guys are very friendly. Thanks for the kind words. I'll try to patch the bogus server as well."
] |
https://api.github.com/repos/psf/requests/issues/4244
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4244/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4244/comments
|
https://api.github.com/repos/psf/requests/issues/4244/events
|
https://github.com/psf/requests/issues/4244
| 250,439,971 |
MDU6SXNzdWUyNTA0Mzk5NzE=
| 4,244 |
("bad handshake: SysCallError(-1, 'Unexpected EOF')",) despite using verify=False
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/15695586?v=4",
"events_url": "https://api.github.com/users/adamwilbert/events{/privacy}",
"followers_url": "https://api.github.com/users/adamwilbert/followers",
"following_url": "https://api.github.com/users/adamwilbert/following{/other_user}",
"gists_url": "https://api.github.com/users/adamwilbert/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/adamwilbert",
"id": 15695586,
"login": "adamwilbert",
"node_id": "MDQ6VXNlcjE1Njk1NTg2",
"organizations_url": "https://api.github.com/users/adamwilbert/orgs",
"received_events_url": "https://api.github.com/users/adamwilbert/received_events",
"repos_url": "https://api.github.com/users/adamwilbert/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/adamwilbert/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/adamwilbert/subscriptions",
"type": "User",
"url": "https://api.github.com/users/adamwilbert",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 32 |
2017-08-15T21:09:26Z
|
2018-09-28T12:56:07Z
|
2017-11-25T14:29:02Z
|
NONE
|
resolved
|
Summary.
I am trying to make a request to a private api with a private api with an expired certificate that I do not control.
I am attempting to use verify=False in the request, but continue to get a
("bad handshake: SysCallError(-1, 'Unexpected EOF')",) error.
I have tried using the old 2.11 cipher string, but I still cannot complete the request. I have tried creating a custom adapter as detailed here: https://lukasa.co.uk/2017/02/Configuring_TLS_With_Requests/
I am able to recreate the request locally and inside the container that holds my application, but I am not able to make the request within my application without the bad handshake.
## Expected Result
Get the same response as I am able to get with cURL/postman/etc.
## Actual Result
("bad handshake: SysCallError(-1, 'Unexpected EOF')",)
## Reproduction Steps
```python
import requests
requests.post(url, data=data, headers=headers, verify=False)
```
Have also tried making get requests here without data just to test, they also fail
## System Information
$ python -m requests.help
```
{
"chardet": {
"version": "3.0.4"
},
"cryptography": {
"version": "2.0.3"
},
"idna": {
"version": ""
},
"implementation": {
"name": "CPython",
"version": "3.5.2"
},
"platform": {
"release": "4.9.31-moby",
"system": "Linux"
},
"pyOpenSSL": {
"openssl_version": "1010006f",
"version": "16.2.0"
},
"requests": {
"version": "2.18.3"
},
"system_ssl": {
"version": "1000207f"
},
"urllib3": {
"version": "1.21.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).
|
{
"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/4244/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4244/timeline
| null |
completed
| null | null | false |
[
"`verify=False` only prevents us from validating the certificate. Based on this error we aren't getting that far: the server is shutting down the connection. Is the server in question publicly reachable?",
"Oh, wait, I see that curl works. Can you use `curl -v` and print the debug output here?",
"Note: Unnecessary use of -X or --request, POST is already inferred.\r\n* Trying ***...\r\n* TCP_NODELAY set\r\n* Connected to *** (***) port 443 (#0)\r\n* TLS 1.0 connection using TLS_RSA_WITH_3DES_EDE_CBC_SHA\r\n* Server certificate: *.***.com\r\n* Server certificate: RapidSSL CA\r\n* Server certificate: GeoTrust Global CA\r\n> POST /***.php HTTP/1.1\r\n> Host: ***\r\n> User-Agent: curl/7.51.0\r\n> Accept: */*\r\n> cache-control: no-cache\r\n> content-type: text/xml;charset=UTF-8\r\n> Content-Length: 474\r\n> \r\n* upload completely sent off: 474 out of 474 bytes\r\n< HTTP/1.1 200 OK\r\n< Content-Length: 877629\r\n< Content-Type: text/xml; charset=ISO-8859-1\r\n< Server: Microsoft-IIS/6.0\r\n< Server: NuSOAP Server v0.9.5\r\n< X-SOAP-Server: NuSOAP/0.9.5 (1.123)\r\n< X-Powered-By: ASP.NET\r\n< Date: Wed, 16 Aug 2017 16:09:32 GMT\r\n\r\nHopefully all you need. Thank you so much!",
"Yeah, so the server definitely wants 3DES. The custom adapter linked above should work: can you show me the code you're using with that adapter?",
"```python\r\n from requests.adapters import HTTPAdapter\r\n from requests.packages.urllib3.util.ssl_ import create_urllib3_context\r\n\r\n # This is the 2.11 Requests cipher string, containing 3DES.\r\n CIPHERS = (\r\n 'ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:ECDH+HIGH:'\r\n 'DH+HIGH:ECDH+3DES:DH+3DES:RSA+AESGCM:RSA+AES:RSA+HIGH:RSA+3DES:!aNULL:'\r\n '!eNULL:!MD5'\r\n )\r\n\r\n class DESAdapter(HTTPAdapter):\r\n \"\"\"\r\n A TransportAdapter that re-enables 3DES support in Requests.\r\n \"\"\"\r\n def init_poolmanager(self, *args, **kwargs):\r\n context = create_urllib3_context(ciphers=CIPHERS)\r\n kwargs['ssl_context'] = context\r\n return super(DESAdapter, self).init_poolmanager(*args, **kwargs)\r\n\r\n def proxy_manager_for(self, *args, **kwargs):\r\n context = create_urllib3_context(ciphers=CIPHERS)\r\n kwargs['ssl_context'] = context\r\n return super(DESAdapter, self).proxy_manager_for(*args, **kwargs)\r\n\r\n s = requests.Session()\r\n s.mount('https://feed.***.com', DESAdapter())\r\n response = s.post('https://feed.***.com/***_server.php', data=SOAP_REQUEST, headers=headers, verify=False)\r\n data = {}\r\n data['details'] = self.parse_data(response.content)\r\n return data\r\n```",
"You're missing a slash in your call to `mount`.",
"Sorry that was a typo in editing on GitHub, same code snippet with appropriate url fails",
"Hrm. What happens with `allow_redirects=True`?",
"Sorry, `allow_redirects=False`.",
"same error",
"Are you familiar with wireshark or tcpdump? I'd like to see a packet capture of the curl TLS handshake and the Requests TLS handshake.",
"When made through requests\r\n```\r\ntcpdump: listening on eth0, link-type EN10MB (Ethernet), capture size 262144 bytes\r\n18:56:08.400983 IP (tos 0x0, ttl 64, id 21907, offset 0, flags [DF], proto TCP (6), length 311)\r\n *** > ***.443: Flags [P.], cksum 0x378e (incorrect -> 0x8e6e), seq 2978143108:2978143379, ack 452897697, win 229, length 271\r\n```\r\n\r\nWhen made through curl\r\n```\r\n18:57:34.570901 IP (tos 0x0, ttl 64, id 21293, offset 0, flags [DF], proto TCP (6), length 314)\r\n *** >***.443: Flags [P.], cksum 0x3791 (incorrect -> 0x7dd4), seq 3275934:3276208, ack 452881097, win 229, length 274\r\n18:57:34.658120 IP (tos 0x0, ttl 37, id 14376, offset 0, flags [none], proto TCP (6), length 1475)\r\n *** > ***: Flags [P.], cksum 0x81f7 (correct), seq 1:1436, ack 274, win 65535, length 1435\r\n18:57:34.659577 IP (tos 0x0, ttl 64, id 21295, offset 0, flags [DF], proto TCP (6), length 307)\r\n *** > ***.443: Flags [P.], cksum 0x378a (incorrect -> 0x15fd), seq 274:541, ack 1436, win 251, length 267\r\n\r\n```\r\n\r\nThank you again!",
"Sorry, I need to see the handshake decoded. I'd need a pcap I can open in Wireshark.",
"\r\n\r\nLet me know if you need anything else.\r\n\r\nThank you.",
"Ok, so that handshake suggests that 3DES is not actually being offered by Requests. Can you please send me an *exact* copy of the code that sets up the adapter? Because you're sending some cipher suites Requests doesn't normally (`CAMELLIA`) and not sending 3DES, which I'd expect.",
"```python\r\n headers = { 'Content-Type': 'text/xml;charset=UTF-8' }\r\n\r\n try:\r\n # This is the 2.11 Requests cipher string, containing 3DES.\r\n CIPHERS = (\r\n 'ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:ECDH+HIGH:'\r\n 'DH+HIGH:ECDH+3DES:DH+3DES:RSA+AESGCM:RSA+AES:RSA+HIGH:RSA+3DES:!aNULL:'\r\n '!eNULL:!MD5'\r\n )\r\n\r\n class DESAdapter(requests.adapters.HTTPAdapter):\r\n \"\"\"\r\n A TransportAdapter that re-enables 3DES support in Requests.\r\n \"\"\"\r\n def init_poolmanager(self, *args, **kwargs):\r\n context = requests.packages.urllib3.util.\\\r\n ssl_.create_urllib3_context(ciphers=CIPHERS)\r\n kwargs['ssl_context'] = context\r\n return super(DESAdapter, self).init_poolmanager(*args,\r\n **kwargs)\r\n\r\n def proxy_manager_for(self, *args, **kwargs):\r\n context = requests.packages.urllib3.util.\\\r\n ssl_.create_urllib3_context(ciphers=CIPHERS)\r\n kwargs['ssl_context'] = context\r\n return super(DESAdapter, self).proxy_manager_for(*args,\r\n **kwargs)\r\n\r\n s = requests.Session()\r\n s.mount('https://feed.***.com', DESAdapter())\r\n response = s.post('https://feed.***.com/parkme_server.php',\r\n data=SOAP_REQUEST, headers=headers,\r\n verify=False)\r\n data = {}\r\n data['lot_details'] = self.parse_data(response.content)\r\n return data\r\n except Exception as error:\r\n print(error)\r\n```\r\n\r\nthe except is just printing (\"bad handshake: SysCallError(-1, 'Unexpected EOF')\",)\r\n",
"Can you put a print statement in the `init_poolmanager` function to confirm that it is in fact being called?",
"Tried, it is indeed getting called.",
"Gah, that's infuriating. Can you tell me what the type of `ssl_context` is please?",
"When set in the adapter <class 'urllib3.contrib.pyopenssl.PyOpenSSLContext'>",
"Aha! Interesting...\r\n\r\nCan you try *uninstalling* PyOpenSSL and see if that fixes the problem? You'll still need the `DESAdapter`, but I have a theory...",
"After uninstalling PyOpenSSL I get\r\n`EOF occurred in violation of protocol (_ssl.c:645)`",
"@Lukasa any further info on that theory?",
"Hrm, that is weird. I had a theory that said that we weren't applying the custom cipher suites, but apparently not. Can you tcpdump without PyOpenSSL and send me the pcap so I can see if the cipher suites are getting advertised?",
"\r\n\r\nThanks again!\r\n",
"@adamwilbert Ok so I'm now extremely perplexed: all of this seems to be ignoring the cipher suites we set. I have no idea why Camellia keeps popping up, but it does, which is a strong suggestion that we're being totally ignored.\r\n\r\n*However*, the new handshake also includes 3DES, and is still being rejected. This suggests 3DES is not your problem. At this stage that makes it very hard to identify what your problem *is*, without getting an idea of what the hell the server is up to.",
"There's been no update to this since late August (3 months). I'm closing this for now but if we get more information, we can reopen this to investigate it. ",
"I have the same issue, here is the curl output:\r\n\r\n```\r\n$ curl -v \"https://www.europeandataportal.eu/data/en/api/3/action/package_show?id=cz-cuzk-sm5-rk-tren09\"\r\n* Trying 185.3.44.12...\r\n* TCP_NODELAY set\r\n* Connected to www.europeandataportal.eu (185.3.44.12) port 443 (#0)\r\n* ALPN, offering http/1.1\r\n* Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH\r\n* successfully set certificate verify locations:\r\n* CAfile: /etc/ssl/certs/ca-certificates.crt\r\n CApath: /etc/ssl/certs\r\n* TLSv1.2 (OUT), TLS header, Certificate Status (22):\r\n* TLSv1.2 (OUT), TLS handshake, Client hello (1):\r\n* TLSv1.2 (IN), TLS handshake, Server hello (2):\r\n* NPN, negotiated HTTP1.1\r\n* TLSv1.2 (IN), TLS handshake, Certificate (11):\r\n* TLSv1.2 (IN), TLS handshake, Server key exchange (12):\r\n* TLSv1.2 (IN), TLS handshake, Server finished (14):\r\n* TLSv1.2 (OUT), TLS handshake, Client key exchange (16):\r\n* TLSv1.2 (OUT), TLS change cipher, Client hello (1):\r\n* TLSv1.2 (OUT), TLS handshake, Unknown (67):\r\n* TLSv1.2 (OUT), TLS handshake, Finished (20):\r\n* TLSv1.2 (IN), TLS change cipher, Client hello (1):\r\n* TLSv1.2 (IN), TLS handshake, Finished (20):\r\n* SSL connection using TLSv1.2 / ECDHE-RSA-AES256-GCM-SHA384\r\n* ALPN, server did not agree to a protocol\r\n* Server certificate:\r\n* subject: OU=Domain Control Validated; OU=Gandi Standard SSL; CN=europeandataportal.eu\r\n* start date: Jan 7 00:00:00 2017 GMT\r\n* expire date: Jan 7 23:59:59 2018 GMT\r\n* subjectAltName: host \"www.europeandataportal.eu\" matched cert's \"www.europeandataportal.eu\"\r\n* issuer: C=FR; ST=Paris; L=Paris; O=Gandi; CN=Gandi Standard SSL CA 2\r\n* SSL certificate verify ok.\r\n> GET /data/en/api/3/action/package_show?id=cz-cuzk-sm5-rk-tren09 HTTP/1.1\r\n> Host: www.europeandataportal.eu\r\n> User-Agent: curl/7.55.1\r\n> Accept: */*\r\n> \r\n< HTTP/1.1 200 OK\r\n< Server: nginx\r\n< Date: Thu, 14 Dec 2017 09:14:02 GMT\r\n< Content-Type: application/json;charset=utf-8\r\n< Content-Length: 18548\r\n< Connection: keep-alive\r\n< Pragma: no-cache\r\n< Cache-Control: no-cache\r\n< Access-Control-Allow-Origin: *\r\n< Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS\r\n< Access-Control-Allow-Headers: X-CKAN-API-KEY, Content-Type\r\n< X-Cache: BYPASS\r\n< \r\n```\r\n\r\nThat said I can not reproduce all the time with requests.",
"Here is the debug output of `requests` when it happens:\r\n\r\n```\r\n[2017-12-14 08:24:29,176: ERROR/ForkPoolWorker-19] error in requests.get: HTTPSConnectionPool(host='www.europeandataportal.eu', port=443): Max retries exceeded with url: /data/en/api/3/action/package_show?id=cz-cuzk-sm5-rk-mlaz28 (Caused by SSLError(SSLError(\"bad handshake: SysCallError(-1, 'Unexpected EOF')\",),))\r\n```",
"@Lukasa @adamwilbert Hi, I'm having the *exact* same issue. How did you fix this without having to uninstall Pyopenssl?\r\n\r\nWhen I do curl I get \"SSL connection using ECDHE-RSA-AES128-GCM-SHA256\"\r\n\r\nI'm using an older version of Requests (2.0.0). If I update to 2.4.0 the issue is gone, but I'm afraid this could break other things.\r\n\r\n Thanks!"
] |
https://api.github.com/repos/psf/requests/issues/4243
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4243/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4243/comments
|
https://api.github.com/repos/psf/requests/issues/4243/events
|
https://github.com/psf/requests/issues/4243
| 249,901,271 |
MDU6SXNzdWUyNDk5MDEyNzE=
| 4,243 |
Slow charset detection on Json file with no explicit encoding
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/6244078?v=4",
"events_url": "https://api.github.com/users/gil9red/events{/privacy}",
"followers_url": "https://api.github.com/users/gil9red/followers",
"following_url": "https://api.github.com/users/gil9red/following{/other_user}",
"gists_url": "https://api.github.com/users/gil9red/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/gil9red",
"id": 6244078,
"login": "gil9red",
"node_id": "MDQ6VXNlcjYyNDQwNzg=",
"organizations_url": "https://api.github.com/users/gil9red/orgs",
"received_events_url": "https://api.github.com/users/gil9red/received_events",
"repos_url": "https://api.github.com/users/gil9red/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/gil9red/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/gil9red/subscriptions",
"type": "User",
"url": "https://api.github.com/users/gil9red",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 1 |
2017-08-13T21:49:21Z
|
2021-09-08T07:00:32Z
|
2017-08-14T05:40:17Z
|
NONE
|
resolved
|
Hello!
In Reproduction Steps a large JSON file is downloaded - about 180MB
When I called rs.text (step 6), I did not wait for the result - I waited about 25 minutes
Console:
```
None
[1] total time: 4.0396250532594795 sec
[2] total time: 3.9574704779202534 sec
[3] total time: 0.271754903759728 sec
[4] total time: 4.078747523628547 sec
[5] total time: 0.27294884912872064 sec
[6] total time: 1515.3671759879826 sec
```
## Reproduction Steps
```python
class TimeThis(object):
def __init__(self, title="TimeThis"):
self.title = title
self.start_time = None
def __enter__(self):
import time
self.start_time = time.clock()
return self
def __exit__(self, exc_type, exc_value, exc_traceback):
import time
print('[{}] total time: {} sec'.format(self.title, time.clock() - self.start_time))
url = 'http://opendata.mkrf.ru/opendata/7705851331-register_movies/data-16-structure-3.json'
import requests
rs = requests.get(url)
print(rs.encoding)
with TimeThis("1"):
rs.json()
with TimeThis("2"):
import json
json.loads(rs.content, encoding='utf-8')
with TimeThis("3"):
rs.content.decode('utf-8')
with TimeThis("4"):
import json
json_data = rs.content.decode('utf-8')
json.loads(json_data)
with TimeThis("5"):
rs.encoding = 'utf-8'
rs.text
rs.encoding = None
with TimeThis("6"):
rs.text
```
## System Information
$ python -m requests.help
```
{
"chardet": {
"version": "3.0.4"
},
"cryptography": {
"version": ""
},
"idna": {
"version": ""
},
"implementation": {
"name": "CPython",
"version": "3.6.1"
},
"platform": {
"release": "7",
"system": "Windows"
},
"pyOpenSSL": {
"openssl_version": "",
"version": null
},
"requests": {
"version": "2.18.3"
},
"system_ssl": {
"version": "100020bf"
},
"urllib3": {
"version": "1.22"
},
"using_pyopenssl": false
}
```
Windows7, Python 3.6.1 | Anaconda 4.4.0 (64-bit)
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4",
"events_url": "https://api.github.com/users/Lukasa/events{/privacy}",
"followers_url": "https://api.github.com/users/Lukasa/followers",
"following_url": "https://api.github.com/users/Lukasa/following{/other_user}",
"gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Lukasa",
"id": 1382556,
"login": "Lukasa",
"node_id": "MDQ6VXNlcjEzODI1NTY=",
"organizations_url": "https://api.github.com/users/Lukasa/orgs",
"received_events_url": "https://api.github.com/users/Lukasa/received_events",
"repos_url": "https://api.github.com/users/Lukasa/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Lukasa",
"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/4243/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4243/timeline
| null |
completed
| null | null | false |
[
"Thanks for this! This is a dupe of #4235: closing to centralise. "
] |
https://api.github.com/repos/psf/requests/issues/4242
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4242/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4242/comments
|
https://api.github.com/repos/psf/requests/issues/4242/events
|
https://github.com/psf/requests/issues/4242
| 249,814,935 |
MDU6SXNzdWUyNDk4MTQ5MzU=
| 4,242 |
.get params is ignored if there is a double slash in the url
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/800543?v=4",
"events_url": "https://api.github.com/users/robertlayton/events{/privacy}",
"followers_url": "https://api.github.com/users/robertlayton/followers",
"following_url": "https://api.github.com/users/robertlayton/following{/other_user}",
"gists_url": "https://api.github.com/users/robertlayton/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/robertlayton",
"id": 800543,
"login": "robertlayton",
"node_id": "MDQ6VXNlcjgwMDU0Mw==",
"organizations_url": "https://api.github.com/users/robertlayton/orgs",
"received_events_url": "https://api.github.com/users/robertlayton/received_events",
"repos_url": "https://api.github.com/users/robertlayton/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/robertlayton/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/robertlayton/subscriptions",
"type": "User",
"url": "https://api.github.com/users/robertlayton",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 5 |
2017-08-12T14:23:00Z
|
2021-09-08T05:00:38Z
|
2017-09-14T15:39:10Z
|
NONE
|
resolved
|
Summary.
The behaviour doesn't seem to be consistent everywhere, but when I run the following with Python 3 / requests 2.14-2, params is ignored in the double-slash case:
```python
import requests
response = requests.get("https://erikberg.com/nba/results/atlanta-hawks.json", params={"season": "2014"}, verify=False)
print("No double slashes", response.url)
response2 = requests.get("https://erikberg.com//nba/results/atlanta-hawks.json", params={"season": "2014"}, verify=False)
print("With double slashes", response2.url)
```
## Expected Result
`response2.url` should be the same as `response.url`:
No double slashes https://erikberg.com/nba/results/atlanta-hawks.json?season=2014
With double slashes https://erikberg.com/nba/results/atlanta-hawks.json?season=2014
## Actual Result
`response2.url` was the raw url, with no params attached to it:
No double slashes https://erikberg.com/nba/results/atlanta-hawks.json?season=2014
With double slashes https://erikberg.com/nba/results/atlanta-hawks.json
## Reproduction Steps
```python
import requests
response = requests.get("https://erikberg.com/nba/results/atlanta-hawks.json", params={"season": "2014"}, verify=False)
print("No double slashes", response.url)
response2 = requests.get("https://erikberg.com//nba/results/atlanta-hawks.json", params={"season": "2014"}, verify=False)
print("With double slashes", response2.url)
```
## System Information
$ python -m requests.help
```
{
"chardet": {
"version": "3.0.4"
},
"cryptography": {
"version": "1.8.1"
},
"idna": {
"version": ""
},
"implementation": {
"name": "CPython",
"version": "3.6.1"
},
"platform": {
"release": "3.18.0-14875-g438cb8ab27c6",
"system": "Linux"
},
"pyOpenSSL": {
"openssl_version": "100020bf",
"version": "17.0.0"
},
"requests": {
"version": "2.18.3"
},
"system_ssl": {
"version": "100020cf"
},
"urllib3": {
"version": "1.22"
},
"using_pyopenssl": 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"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/4242/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4242/timeline
| null |
completed
| null | null | false |
[
"Did you say this happens with Requests 2.14? Why does your help output identify the Requests version as 2.18.3?",
"The case above seems to be very specific, testing with any other url that has a double slash in it seems to work. \r\n\r\n >>> response = requests.get(\"https://www.sinax.be/blog\", params={\"season\": \"2014\"})\r\n >>> response.url\r\n 'https://www.sinax.be/blog/?season=2014'\r\n >>> response = requests.get(\"https://www.sinax.be//blog\", params={\"season\": \"2014\"})\r\n >>> response.url\r\n 'https://www.sinax.be/blog/?season=2014'\r\n\r\n\r\nNote: reproduced with requests version 2.18.4\r\n",
"This is not an issue with requests, but with the website. \r\nWhat happens is that the site redirects the url `https://erikberg.com//nba/results/atlanta-hawks.json?season=2014` to `https://erikberg.com/nba/results/atlanta-hawks.json`. ",
"Indeed, check `response.history` for more information.",
"Thanks for investigating and sorry for the hassle!"
] |
https://api.github.com/repos/psf/requests/issues/4241
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4241/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4241/comments
|
https://api.github.com/repos/psf/requests/issues/4241/events
|
https://github.com/psf/requests/pull/4241
| 249,734,863 |
MDExOlB1bGxSZXF1ZXN0MTM1NDA5NDE1
| 4,241 |
attempted fix of travis
|
{
"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 | 3 |
2017-08-11T20:06:33Z
|
2021-08-28T00:06:24Z
|
2018-02-24T14:53:50Z
|
CONTRIBUTOR
|
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/4241/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4241/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/4241.diff",
"html_url": "https://github.com/psf/requests/pull/4241",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/4241.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/4241"
}
| true |
[
"# [Codecov](https://codecov.io/gh/requests/requests/pull/4241?src=pr&el=h1) Report\n> Merging [#4241](https://codecov.io/gh/requests/requests/pull/4241?src=pr&el=desc) into [master](https://codecov.io/gh/requests/requests/commit/1c2022cf868cb503815f34901ad8e85cf524d01a?src=pr&el=desc) will **increase** coverage by `0.19%`.\n> The diff coverage is `n/a`.\n\n[](https://codecov.io/gh/requests/requests/pull/4241?src=pr&el=tree)\n\n```diff\n@@ Coverage Diff @@\n## master #4241 +/- ##\n==========================================\n+ Coverage 88.65% 88.85% +0.19% \n==========================================\n Files 18 18 \n Lines 2018 2054 +36 \n==========================================\n+ Hits 1789 1825 +36 \n Misses 229 229\n```\n\n\n| [Impacted Files](https://codecov.io/gh/requests/requests/pull/4241?src=pr&el=tree) | Coverage Δ | |\n|---|---|---|\n| [requests/utils.py](https://codecov.io/gh/requests/requests/pull/4241?src=pr&el=tree#diff-cmVxdWVzdHMvdXRpbHMucHk=) | `84.17% <0%> (+1.42%)` | :arrow_up: |\n\n------\n\n[Continue to review full report at Codecov](https://codecov.io/gh/requests/requests/pull/4241?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/4241?src=pr&el=footer). Last update [1c2022c...ade8379](https://codecov.io/gh/requests/requests/pull/4241?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).\n",
"not working",
"do not merge"
] |
|
https://api.github.com/repos/psf/requests/issues/4240
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4240/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4240/comments
|
https://api.github.com/repos/psf/requests/issues/4240/events
|
https://github.com/psf/requests/pull/4240
| 249,731,154 |
MDExOlB1bGxSZXF1ZXN0MTM1NDA2NTU5
| 4,240 |
Adding header name to exception
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/25228167?v=4",
"events_url": "https://api.github.com/users/mgasvoda/events{/privacy}",
"followers_url": "https://api.github.com/users/mgasvoda/followers",
"following_url": "https://api.github.com/users/mgasvoda/following{/other_user}",
"gists_url": "https://api.github.com/users/mgasvoda/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/mgasvoda",
"id": 25228167,
"login": "mgasvoda",
"node_id": "MDQ6VXNlcjI1MjI4MTY3",
"organizations_url": "https://api.github.com/users/mgasvoda/orgs",
"received_events_url": "https://api.github.com/users/mgasvoda/received_events",
"repos_url": "https://api.github.com/users/mgasvoda/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/mgasvoda/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/mgasvoda/subscriptions",
"type": "User",
"url": "https://api.github.com/users/mgasvoda",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 6 |
2017-08-11T19:49:57Z
|
2021-09-04T00:06:53Z
|
2017-08-12T14:41:28Z
|
CONTRIBUTOR
|
resolved
|
Adds the name of the header to the invalid header exception raised on TypeError.
Fixes #4239
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4",
"events_url": "https://api.github.com/users/Lukasa/events{/privacy}",
"followers_url": "https://api.github.com/users/Lukasa/followers",
"following_url": "https://api.github.com/users/Lukasa/following{/other_user}",
"gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Lukasa",
"id": 1382556,
"login": "Lukasa",
"node_id": "MDQ6VXNlcjEzODI1NTY=",
"organizations_url": "https://api.github.com/users/Lukasa/orgs",
"received_events_url": "https://api.github.com/users/Lukasa/received_events",
"repos_url": "https://api.github.com/users/Lukasa/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Lukasa",
"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/4240/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4240/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/4240.diff",
"html_url": "https://github.com/psf/requests/pull/4240",
"merged_at": "2017-08-12T14:41:27Z",
"patch_url": "https://github.com/psf/requests/pull/4240.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/4240"
}
| true |
[
"I like this. ",
"# [Codecov](https://codecov.io/gh/requests/requests/pull/4240?src=pr&el=h1) Report\n> Merging [#4240](https://codecov.io/gh/requests/requests/pull/4240?src=pr&el=desc) into [master](https://codecov.io/gh/requests/requests/commit/1c2022cf868cb503815f34901ad8e85cf524d01a?src=pr&el=desc) will **not change** coverage.\n> The diff coverage is `100%`.\n\n[](https://codecov.io/gh/requests/requests/pull/4240?src=pr&el=tree)\n\n```diff\n@@ Coverage Diff @@\n## master #4240 +/- ##\n=======================================\n Coverage 88.65% 88.65% \n=======================================\n Files 18 18 \n Lines 2018 2018 \n=======================================\n Hits 1789 1789 \n Misses 229 229\n```\n\n\n| [Impacted Files](https://codecov.io/gh/requests/requests/pull/4240?src=pr&el=tree) | Coverage Δ | |\n|---|---|---|\n| [requests/utils.py](https://codecov.io/gh/requests/requests/pull/4240?src=pr&el=tree#diff-cmVxdWVzdHMvdXRpbHMucHk=) | `82.75% <100%> (ø)` | :arrow_up: |\n\n------\n\n[Continue to review full report at Codecov](https://codecov.io/gh/requests/requests/pull/4240?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/4240?src=pr&el=footer). Last update [1c2022c...d528106](https://codecov.io/gh/requests/requests/pull/4240?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).\n",
"Can we add a test for this change?",
"@Lukasa I modified the existing tests to include a basic assertion that the header name is included in the exception message - If you would prefer that assertion be more specific to match the expected exception statement exactly, I can definitely add that in there as well.",
"History updated, thanks again for your feedback!",
"Thanks for this! :sparkles:"
] |
https://api.github.com/repos/psf/requests/issues/4239
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4239/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4239/comments
|
https://api.github.com/repos/psf/requests/issues/4239/events
|
https://github.com/psf/requests/issues/4239
| 249,683,433 |
MDU6SXNzdWUyNDk2ODM0MzM=
| 4,239 |
Add header name to InvalidHeader exception message
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/3511141?v=4",
"events_url": "https://api.github.com/users/lsmithso/events{/privacy}",
"followers_url": "https://api.github.com/users/lsmithso/followers",
"following_url": "https://api.github.com/users/lsmithso/following{/other_user}",
"gists_url": "https://api.github.com/users/lsmithso/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/lsmithso",
"id": 3511141,
"login": "lsmithso",
"node_id": "MDQ6VXNlcjM1MTExNDE=",
"organizations_url": "https://api.github.com/users/lsmithso/orgs",
"received_events_url": "https://api.github.com/users/lsmithso/received_events",
"repos_url": "https://api.github.com/users/lsmithso/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/lsmithso/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/lsmithso/subscriptions",
"type": "User",
"url": "https://api.github.com/users/lsmithso",
"user_view_type": "public"
}
|
[
{
"color": "02e10c",
"default": false,
"description": null,
"id": 76800,
"name": "Feature Request",
"node_id": "MDU6TGFiZWw3NjgwMA==",
"url": "https://api.github.com/repos/psf/requests/labels/Feature%20Request"
},
{
"color": "0b02e1",
"default": false,
"description": null,
"id": 191274,
"name": "Contributor Friendly",
"node_id": "MDU6TGFiZWwxOTEyNzQ=",
"url": "https://api.github.com/repos/psf/requests/labels/Contributor%20Friendly"
}
] |
closed
| true | null |
[] | null | 3 |
2017-08-11T16:19:45Z
|
2021-09-08T07:00:32Z
|
2017-08-12T14:41:28Z
|
NONE
|
resolved
|
requests.get('http://example.com', headers={'foo': 1})
requests.exceptions.InvalidHeader: Header value 1 must be of type str or bytes, not <class 'int'>
It would be good to add the name of the bad header to make it easier
to track this down in large bodies of code. Something like:
requests.exceptions.InvalidHeader: Header foo value 1 must be of type str or bytes, not <class 'int'>
Thanks.
Summary.
## Expected Result
What you expected.
## Actual Result
What happened instead.
## Reproduction Steps
```python
import requests
```
## System Information
$ python -m requests.help
```
<paste here>
```
This command is only available on Requests v2.16.4 and greater. Otherwise,
please provide some basic information about your system (Python version,
operating system, &c).e
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4",
"events_url": "https://api.github.com/users/Lukasa/events{/privacy}",
"followers_url": "https://api.github.com/users/Lukasa/followers",
"following_url": "https://api.github.com/users/Lukasa/following{/other_user}",
"gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Lukasa",
"id": 1382556,
"login": "Lukasa",
"node_id": "MDQ6VXNlcjEzODI1NTY=",
"organizations_url": "https://api.github.com/users/Lukasa/orgs",
"received_events_url": "https://api.github.com/users/Lukasa/received_events",
"repos_url": "https://api.github.com/users/Lukasa/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Lukasa",
"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/4239/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4239/timeline
| null |
completed
| null | null | false |
[
"Agreed, this seems like a useful enhancement. ",
"I'd like to help on this one if that's alright, I can have a pull request in shortly.",
"\nHi: Please be my guest.\n\nmgasvoda writes:\n > I'd like to help on this one if that's alright, I can have a pull request in shortly.\n > \n > -- \n > You are receiving this because you authored the thread.\n > Reply to this email directly or view it on GitHub:\n > https://github.com/requests/requests/issues/4239#issuecomment-321900563\n\n-- \nLes Smithson\n"
] |
https://api.github.com/repos/psf/requests/issues/4238
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4238/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4238/comments
|
https://api.github.com/repos/psf/requests/issues/4238/events
|
https://github.com/psf/requests/issues/4238
| 249,497,185 |
MDU6SXNzdWUyNDk0OTcxODU=
| 4,238 |
418 I'm a Teapot
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/74384?v=4",
"events_url": "https://api.github.com/users/mnot/events{/privacy}",
"followers_url": "https://api.github.com/users/mnot/followers",
"following_url": "https://api.github.com/users/mnot/following{/other_user}",
"gists_url": "https://api.github.com/users/mnot/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/mnot",
"id": 74384,
"login": "mnot",
"node_id": "MDQ6VXNlcjc0Mzg0",
"organizations_url": "https://api.github.com/users/mnot/orgs",
"received_events_url": "https://api.github.com/users/mnot/received_events",
"repos_url": "https://api.github.com/users/mnot/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/mnot/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/mnot/subscriptions",
"type": "User",
"url": "https://api.github.com/users/mnot",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 22 |
2017-08-10T22:43:46Z
|
2017-08-11T11:29:43Z
|
2017-08-11T00:12:12Z
|
NONE
| null |
Requests implements the 418 I'm a Teapot status code in `status_codes.py`.
Its source is RFC2324, Hyper Text Coffee Pot Control Protocol (HTCPCP/1.0). Note the title - HTCPCP/1.0 is not HTTP/1.x.
HTCPCP was an April 1 joke by Larry to illustrate how people were abusing HTTP in various ways. Ironically, it's not being used to abuse HTTP itself -- people are implementing parts of HTCPCP in their HTTP stacks.
In particular, Node's support for the HTCPCP 418 I'm a Teapot status code has been used as an argument in the HTTP Working Group to preclude use of 418 in HTTP for real-world purposes.
While we have a number of spare 4xx HTTP status codes that are unregistered now, the semantics of HTTP are something that (hopefully) are going to last for a long time, so one day we may need this code point.
Please consider removing support for 418 from Requests, since it's not a HTTP status code (even by its own definition). I know it's amusing, I know that a few people have knocked up implementations for fun, but it shouldn't pollute the core protocol; folks can extend Node easily enough if they want to play with non-standard semantics.
Thanks,
/cc @Lukasa
|
{
"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": 3,
"-1": 93,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 96,
"url": "https://api.github.com/repos/psf/requests/issues/4238/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4238/timeline
| null |
completed
| null | null | false |
[
"BTW, I'm aware this is a breaking change; deprecating and delaying to the next major release is fine.",
"Line of code in question: https://github.com/requests/requests/blob/master/requests/status_codes.py#L55",
"Please note the alternative versions for 200 OK: https://github.com/requests/requests/blob/master/requests/status_codes.py#L13",
"Huh. The only thing that causes me concern there is the use of unicode and backslashes; requests doesn't emit those, does it?",
"Nope, this is for reverse lookup only — same with I'm a teapot. ",
"OK, that's good. The problem is that implementation is being used as evidence to preclude actual use of the status code, which is going to _eventually_ be a problem. ",
"Please see https://github.com/nodejs/node/issues/14644 and https://github.com/golang/go/issues/21326 for discussions regarding similar changes.",
"I'm okay with removing it, unless we want to add other status codes like 420 and friends. \r\n\r\nHTTPbin.org is keeping it though :)",
"Individual servers, I'm less concerned about :)",
"Send a PR!",
"Make it against the 3.0.0 branch though, this will be a breaking change. ",
"Hold on! I'm the guy behind http://save418.com (https://github.com/WhataShane/save418). I, [like many others](https://www.reddit.com/r/webdev/comments/6stdcj/http_error_code_418_im_a_teapot_is_about_to_be/), enjoy stumbling upon (almost entirely) innocuous gags like 418. It's the sort of thing that'll put a smile on your face even when you're pressed to meet a project deadline and your boss is yapping at you one office over. It'd be a real shame to see it go.\r\n\r\nTo quote @romellem from the Go thread, who quite eloquently sums up the argument for 418:\r\n\r\n> Just to be clear, is your argument that when/if the 400 block runs out, we'll want that one extra code available to stretch out the usefulness of the 400 block just a bit further?\r\n> \r\n> Unless I'm reading it incorrectly, the 400 block of HTTP status codes has more than 50 codes available. With the available \"space\" of the 400 block at more than 50%, this might be a pre-mature optimization for a problem that may never occur (400 block running out of available codes, that is).\r\n> \r\n> Not trying to sound harsh, but I for one like fun little easter eggs that you find throughout a programming career. To me, it shows that everything that goes on to make a computer actually do work is still made by humans, and keeping small slices of that human element is nice (in my opinion). Your argument is sound and logical, but this requested change ever so slightly lowers the \"fun-ness\" of Go (and potentially NodeJS) in the spirit of engineering robustness. At the end of the day, I have to say I don't think that tradeoff is worth it.\r\n> \r\n> (I appreciate the history lesson though! I always thought 418 was a part of the HTTP/1.x spec; didn't know about the \"HTCPCP/1.0\" spec. 🙂)\r\n",
"I agree that it's a fun easter egg. ",
"Requests takes itself seriously, but not too seriously. :)",
"This might be the line of \"too seriously\". ",
"Isn't the obvious answer here to make it part of the spec by starting with a new RFC?",
"@tSavo Clearly!",
"While I recognize 418 isn't part of the HTTP status code spec in RFC 7231, it does exist in the wild. Even google has it implemented [here](https://www.google.com/teapot). In the unlikely event the IETF decides to implement a real use for 418, we'll have plenty of forewarning to address this. I'm in favor of leaving this as it is unless there's a more compelling reason it needs to be removed.",
"Give me your keys.",
"Just to be clear, I agree with the rest of the Requests team: we should keep the 418 mapping here. But the reason I agree is purely pragmatic, not because of the fun Easter egg (though it *is* fun): `codes.py` is used to build a mapping from reason phrase to code. For this reason it should include any reason phrase that is somewhat likely to appear for a given code. For the moment that is I'm A Teapot. If this changes, we'll add any other phrase the IANA assigns. \r\n\r\n@mnot, feel free to use this response as a commitment that says that the IETF/IANA should feel free to re-use 418, and not to block it on our behalf. 😉 I think reason phrases are stupid anyhow. ",
"[A request to register 418 has been submitted to IANA](https://github.com/nodejs/node/issues/14644#issuecomment-321726573), under number 979050.",
"Ok; this is not a discussion forum for the merits of 418. @mnot if you want to follow up on this please drop me an email. For everyone else: we appreciate your input, but I feel pretty good about the decision we've made. "
] |
https://api.github.com/repos/psf/requests/issues/4237
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4237/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4237/comments
|
https://api.github.com/repos/psf/requests/issues/4237/events
|
https://github.com/psf/requests/pull/4237
| 249,420,106 |
MDExOlB1bGxSZXF1ZXN0MTM1MTc5ODU0
| 4,237 |
Adds import statement to front page of docs for clarity and quicker start up
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/3673341?v=4",
"events_url": "https://api.github.com/users/robinske/events{/privacy}",
"followers_url": "https://api.github.com/users/robinske/followers",
"following_url": "https://api.github.com/users/robinske/following{/other_user}",
"gists_url": "https://api.github.com/users/robinske/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/robinske",
"id": 3673341,
"login": "robinske",
"node_id": "MDQ6VXNlcjM2NzMzNDE=",
"organizations_url": "https://api.github.com/users/robinske/orgs",
"received_events_url": "https://api.github.com/users/robinske/received_events",
"repos_url": "https://api.github.com/users/robinske/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/robinske/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/robinske/subscriptions",
"type": "User",
"url": "https://api.github.com/users/robinske",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 2 |
2017-08-10T17:27:45Z
|
2021-09-04T00:06:54Z
|
2017-08-10T18:02:57Z
|
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/4237/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4237/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/4237.diff",
"html_url": "https://github.com/psf/requests/pull/4237",
"merged_at": "2017-08-10T18:02:57Z",
"patch_url": "https://github.com/psf/requests/pull/4237.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/4237"
}
| true |
[
"I'm down to try this — but I may remove it later. ",
"Current example is very intentional. "
] |
|
https://api.github.com/repos/psf/requests/issues/4236
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4236/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4236/comments
|
https://api.github.com/repos/psf/requests/issues/4236/events
|
https://github.com/psf/requests/issues/4236
| 249,416,345 |
MDU6SXNzdWUyNDk0MTYzNDU=
| 4,236 |
Redirection 301 different behavior between versions
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/2580646?v=4",
"events_url": "https://api.github.com/users/estevopaz/events{/privacy}",
"followers_url": "https://api.github.com/users/estevopaz/followers",
"following_url": "https://api.github.com/users/estevopaz/following{/other_user}",
"gists_url": "https://api.github.com/users/estevopaz/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/estevopaz",
"id": 2580646,
"login": "estevopaz",
"node_id": "MDQ6VXNlcjI1ODA2NDY=",
"organizations_url": "https://api.github.com/users/estevopaz/orgs",
"received_events_url": "https://api.github.com/users/estevopaz/received_events",
"repos_url": "https://api.github.com/users/estevopaz/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/estevopaz/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/estevopaz/subscriptions",
"type": "User",
"url": "https://api.github.com/users/estevopaz",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 6 |
2017-08-10T17:13:21Z
|
2021-09-08T07:00:33Z
|
2017-08-11T05:50:06Z
|
NONE
|
resolved
|
Hi, I have different redirection behavior between version 2.12.4 and 2.18.3:
Version 2.18.3 redirects POST method to GET after 301.
Version 2.12.4 get POST data directly without redirection ???
URL: http://www.eddyseverything.com/
POST data:
{'_post_id': '5',
'_referer': '/used-vehicles/',
'action': 'im_ajax_call',
'make[]': 'Acura',
'model[]': 'MDX',
'page': '1',
'perform': 'get_results',
'show_all_filters': 'false'}
```
import requests
session = requests.Session()
'"num_rows"' in session.post('http://www.eddyseverything.com/', {'_post_id': '5', '_referer': '/used-vehicles/', 'action': 'im_ajax_call', 'make[]': 'Acura', 'model[]': 'MDX', 'page': '1', 'perform': 'get_results', 'show_all_filters': 'false'}).text
'"num_rows"' in session.post('http://www.eddyseverything.com/', {'_post_id': '5', '_referer': '/used-vehicles/', 'action': 'im_ajax_call', 'make[]': 'Acura', 'model[]': 'MDX', 'page': '1', 'perform': 'get_results', 'show_all_filters': 'false'}).text
```
First POST request is false for both versions, but it must store some kind of data into session, and second request has a different behavior:
2.12.4 is True
2.18.1 and 2.18.3 is False
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4",
"events_url": "https://api.github.com/users/Lukasa/events{/privacy}",
"followers_url": "https://api.github.com/users/Lukasa/followers",
"following_url": "https://api.github.com/users/Lukasa/following{/other_user}",
"gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Lukasa",
"id": 1382556,
"login": "Lukasa",
"node_id": "MDQ6VXNlcjEzODI1NTY=",
"organizations_url": "https://api.github.com/users/Lukasa/orgs",
"received_events_url": "https://api.github.com/users/Lukasa/received_events",
"repos_url": "https://api.github.com/users/Lukasa/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Lukasa",
"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/4236/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4236/timeline
| null |
completed
| null | null | false |
[
"Version 2.12.4:\r\n```\r\nIn [1]: import requests\r\n ...: session = requests.Session()\r\n ...: session.get('http://www.eddyseverything.com/')\r\n ...: '\"num_rows\"' in session.post('http://www.eddyseverything.com/', {'_post_id': '5', '_referer': '/used-vehicles/', 'action': 'im_ajax_call', 'make[]': 'Acura', 'model[]': 'MD\r\n ...: X', 'page': '1', 'perform': 'get_results', 'show_all_filters': 'false'}).text\r\n ...: \r\n2017-08-10 12:17:01,210 : DEBUG : requests.packages.urllib3.connectionpool : Starting new HTTP connection (1): www.eddyseverything.com\r\n2017-08-10 12:17:01,619 : DEBUG : requests.packages.urllib3.connectionpool : http://www.eddyseverything.com:80 \"GET / HTTP/1.1\" 301 240\r\n2017-08-10 12:17:01,623 : DEBUG : requests.packages.urllib3.connectionpool : Starting new HTTPS connection (1): www.eddyseverything.com\r\n2017-08-10 12:17:02,082 : DEBUG : requests.packages.urllib3.connectionpool : https://www.eddyseverything.com:443 \"GET / HTTP/1.1\" 200 None\r\n2017-08-10 12:17:02,306 : DEBUG : requests.packages.urllib3.connectionpool : https://www.eddyseverything.com:443 \"POST / HTTP/1.1\" 200 None\r\nOut[1]: True\r\n```\r\n\r\nVersion 2.18.1:\r\n```\r\nIn [1]: import requests\r\n ...: session = requests.Session()\r\n ...: session.get('http://www.eddyseverything.com/')\r\n ...: '\"num_rows\"' in session.post('http://www.eddyseverything.com/', {'_post_id': '5', '_referer': '/used-vehicles/', 'action': 'im_ajax_call', 'make[]': 'Acura', 'model[]': 'MD\r\n ...: X', 'page': '1', 'perform': 'get_results', 'show_all_filters': 'false'}).text\r\n ...: \r\n2017-08-10 19:17:30,886 : DEBUG : urllib3.connectionpool : Starting new HTTP connection (1): www.eddyseverything.com\r\n2017-08-10 19:17:31,203 : DEBUG : urllib3.connectionpool : http://www.eddyseverything.com:80 \"GET / HTTP/1.1\" 301 240\r\n2017-08-10 19:17:31,209 : DEBUG : urllib3.connectionpool : Starting new HTTPS connection (1): www.eddyseverything.com\r\n2017-08-10 19:17:31,808 : DEBUG : urllib3.connectionpool : https://www.eddyseverything.com:443 \"GET / HTTP/1.1\" 200 None\r\n2017-08-10 19:17:32,177 : DEBUG : urllib3.connectionpool : http://www.eddyseverything.com:80 \"POST / HTTP/1.1\" 301 240\r\n2017-08-10 19:17:32,339 : DEBUG : urllib3.connectionpool : https://www.eddyseverything.com:443 \"GET / HTTP/1.1\" 200 None\r\nOut[1]: False\r\n```",
"Given that these two requests are plaintext, can you use tools like wire shark to compare the two HTTP requests that we're making?",
"However, I think we might be bumping into a concern around the 301 cache here.",
"I think our current behaviour is more correct though, so I don't think this is a bug",
"I agree, new behavior is better because second request in old version is done to HTTPS instead of HTTP as in given URL.\r\nAnyway I think that must be a parameter to keep POST method after redirection.",
"> Anyway I think that must be a parameter to keep POST method after redirection.\r\n\r\nI disagree. :smile:\r\n\r\nPOST -> 301 -> GET is a very common pattern. It's so common that RFC 7231 notes that it's a thing that can happen, and it's what all browsers do. We're just keeping in place with the standard behaviour. If you'd like to override it, you can set `allow_redirects=False` and process the redirect yourself."
] |
https://api.github.com/repos/psf/requests/issues/4235
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4235/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4235/comments
|
https://api.github.com/repos/psf/requests/issues/4235/events
|
https://github.com/psf/requests/issues/4235
| 249,398,342 |
MDU6SXNzdWUyNDkzOTgzNDI=
| 4,235 |
Slow charset detection on JavaScript file with no explicit encoding
|
{
"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 | 6 |
2017-08-10T16:06:19Z
|
2021-11-24T07:00:24Z
|
2021-08-26T06:45:08Z
|
NONE
|
resolved
|
When I request https://play.wimpmusic.com/v1.1.3-p-40/app.js and then try to use `r.text` without setting `r.encoding`, my script hangs indefinitely instead of returning the text or raising an exception. `r.content` works fine, and as soon as I set `r.encoding = 'utf-8'` or anything, `r.text` also works. The `Content-Type` header the site is returning is `application/x-javascript` (no encoding specificed).
## Reproduction Steps
```py3
import requests
r = requests.get('https://play.wimpmusic.com/v1.1.3-p-40/app.js')
print(r.text)
```
## System Information
```sh
$ python -m requests.help
```
```json
{
"chardet": {
"version": "3.0.4"
},
"cryptography": {
"version": ""
},
"idna": {
"version": ""
},
"implementation": {
"name": "CPython",
"version": "3.6.1"
},
"platform": {
"release": "4.4.0-43-Microsoft",
"system": "Linux"
},
"pyOpenSSL": {
"openssl_version": "",
"version": null
},
"requests": {
"version": "2.18.3"
},
"system_ssl": {
"version": "1000207f"
},
"urllib3": {
"version": "1.22"
},
"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/4235/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4235/timeline
| null |
completed
| null | null | false |
[
"How big is the file? If you ctrl+c the code while running indefinitely, what traceback do you see?",
"It's about 1.31 MiB. This is the traceback I get when interrupting it after about 10 seconds:\r\n\r\n```pytb\r\nTraceback (most recent call last):\r\n File \"<stdin>\", line 1, in <module>\r\n File \"/home/nyuszika7h/.local/lib/python3.6/site-packages/requests/models.py\", line 852, in text\r\n encoding = self.apparent_encoding\r\n File \"/home/nyuszika7h/.local/lib/python3.6/site-packages/requests/models.py\", line 722, in apparent_encoding\r\n return chardet.detect(self.content)['encoding']\r\n File \"/home/nyuszika7h/.local/lib/python3.6/site-packages/chardet/__init__.py\", line 38, in detect\r\n detector.feed(byte_str)\r\n File \"/home/nyuszika7h/.local/lib/python3.6/site-packages/chardet/universaldetector.py\", line 211, in feed\r\n if prober.feed(byte_str) == ProbingState.FOUND_IT:\r\n File \"/home/nyuszika7h/.local/lib/python3.6/site-packages/chardet/charsetgroupprober.py\", line 71, in feed\r\n state = prober.feed(byte_str)\r\n File \"/home/nyuszika7h/.local/lib/python3.6/site-packages/chardet/sbcharsetprober.py\", line 79, in feed\r\n byte_str = self.filter_international_words(byte_str)\r\n File \"/home/nyuszika7h/.local/lib/python3.6/site-packages/chardet/charsetprober.py\", line 87, in filter_international_words\r\n buf)\r\n File \"/usr/lib/python3.6/re.py\", line 222, in findall\r\n return _compile(pattern, flags).findall(string)\r\nKeyboardInterrupt\r\n\r\n```",
"Ok, so this seems slow even for chardet. @sigmavirus24, why is chardet so slow here?",
"Okay, I left it running a bit longer. Looks like it takes about 66.26 seconds on my computer, and 8.76 seconds on a more powerful server.",
"Same problem here with `https://archive.scryfall.com/json/scryfall-default-cards.json` which is a large JSON file sent back with `content-type: application/json`.\r\n\r\n(Setting `response.encoding = 'utf-8'` explicitly makes things take milliseconds not minutes.)",
"This class of slow downs were possible in chardet, but there isn't a great way to resolve them in Requests. Given `chardet` was replaced by `charset_normalizer` as the default, and this issue is no longer reproducible, I'm going to close."
] |
https://api.github.com/repos/psf/requests/issues/4234
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4234/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4234/comments
|
https://api.github.com/repos/psf/requests/issues/4234/events
|
https://github.com/psf/requests/pull/4234
| 249,290,792 |
MDExOlB1bGxSZXF1ZXN0MTM1MDgyODkw
| 4,234 |
Feature Suggestion: Include response body in raise_for_status method
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/5054356?v=4",
"events_url": "https://api.github.com/users/westover/events{/privacy}",
"followers_url": "https://api.github.com/users/westover/followers",
"following_url": "https://api.github.com/users/westover/following{/other_user}",
"gists_url": "https://api.github.com/users/westover/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/westover",
"id": 5054356,
"login": "westover",
"node_id": "MDQ6VXNlcjUwNTQzNTY=",
"organizations_url": "https://api.github.com/users/westover/orgs",
"received_events_url": "https://api.github.com/users/westover/received_events",
"repos_url": "https://api.github.com/users/westover/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/westover/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/westover/subscriptions",
"type": "User",
"url": "https://api.github.com/users/westover",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 7 |
2017-08-10T09:46:28Z
|
2018-09-15T18:34:54Z
|
2017-08-10T15:11:11Z
|
NONE
|
resolved
|
#4233
Potential implementation of my feature suggestion
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4",
"events_url": "https://api.github.com/users/Lukasa/events{/privacy}",
"followers_url": "https://api.github.com/users/Lukasa/followers",
"following_url": "https://api.github.com/users/Lukasa/following{/other_user}",
"gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Lukasa",
"id": 1382556,
"login": "Lukasa",
"node_id": "MDQ6VXNlcjEzODI1NTY=",
"organizations_url": "https://api.github.com/users/Lukasa/orgs",
"received_events_url": "https://api.github.com/users/Lukasa/received_events",
"repos_url": "https://api.github.com/users/Lukasa/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Lukasa",
"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/4234/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4234/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/4234.diff",
"html_url": "https://github.com/psf/requests/pull/4234",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/4234.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/4234"
}
| true |
[
"> The response object is already attached to the exception, which means it's fairly trivial for user code to access this data in a way that is going to be safe for their application. What benefit do we obtain by placing the body into the exception message, and does it outweigh the risks?\r\n\r\nThis is exactly my question. And in all fairness, I'm fairly certain the benefit is \"nothing\". This will also only hurt folks who already depend on our current _decently_ formatted messages when logging response errors (i.e., so many command-line clients that would break).\r\n\r\nI'm pretty sure what's actually happening here is that our documentation is not sufficiently clear enough to indicate that the response is attached to the exception.\r\n\r\nI'm pretty strongly convinced this is a bad idea.",
"As for the merits let me give you a pretty clear example:\r\nImagine you are wrapping an existing API because its interface is terrible or has secret keys you don't want to expose client side. The existing API gives back reasonable error information in the body when an 'illegal' value is passed but has no way to know what values it will accept for certain query parameters.\r\nSo currently requests raises an error message like this \r\n```\r\nHTTPError: 400 Client Error: Bad Request for url: https://PROTECTED_TO_HIDE_SECRETS\r\n```\r\nWhich frankly isn't enough information to pass along for troubleshooting while trying to stay true to wrapping the existing API and not adding a lot of boiler plate error handling that is ALREADY in requests \"raise_for_status\" method.\r\nHowever like said above the wrapped API has a reasonable error message \r\n```\r\n{\"faultCode\":\"DIAGNOSTIC CODE\",\"responseCode\":\"400\",\"message\":\"This release is not available or does not cover the requested index.\"}\r\n```\r\nAs in the original feature suggestion issue: wouldn't it be nice to see that without needing more boilerplate error handling?\r\n\r\nAnd attaching the response to the exception still means I need boilerplate just to get that message.\r\n\r\nTo the statement of it breaking existing folks, sure I can buy that, so we can use an keyword in invocation of the function to select whether or not to include that text.",
"> As in the original feature suggestion issue: wouldn't it be nice to see that without needing more boilerplate error handling?\r\n\r\nSure, but maybe your API returns the message in headers. Or maybe it's a very large JSON document where only one part is relevant. Or maybe it's like [GitHub's 404 page](https://github.com/dddd/dddd), a 126kB HTML document that would all of a sudden turn this exception text:\r\n\r\n```\r\nrequests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://github.com/dddd/dddd\r\n```\r\n\r\nInto\r\n\r\n```\r\nrequests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://github.com/dddd/dddd Response Body: <!DOCTYPE html>\\n<html>\\n <head>\\n <meta http-equiv=\"Content-type\" content=\"text/html; charset=utf-8\">\\n <meta http-equiv=\"Content-Security-Policy\" content=\"default-src \\'none\\'; base-uri \\'self\\'; connect-src \\'self\\'; form-action \\'self\\'; img-src data:; script-src \\'self\\'; style-src \\'unsafe-inline\\'\">\\n <meta content=\"origin\" name=\"referrer\">\\n <title>Page not found · GitHub</title>\\n <style type=\"text/css\" media=\"screen\">\\n body {\\n background-color: #f1f1f1;\\n margin: \r\n```\r\n\r\nI contend that this is very much not an improvement, especially as it'd have to be rendered in 80-character wide terminals and so would end up taking multiple lines.\r\n\r\nThe general problem of this approach is that while in *some* situations it works nicely, in many others it works very badly. The negative experience from the bad cases vastly outweighs the convenience in the good cases, IMO, so that suggests that you should probably tolerate the two lines of boilerplate required to get the exception message you'd actually like to see.",
"@Lukasa ... Well considering that the use case I am looking at has nothing to do with terminals then sure but rather browsers themselves. As I let the error bubble back up to the client browser. \r\n\r\nAnd in response to your earlier piece. I made the behavior optional and limited so who it would \"work really badly\" for is somewhat elusive.\r\n\r\nAnd not to be a jerk but I think the whole 80 character thing really shows a disconnect with reality. I honestly don't know a single developer who uses the 80 character terminal width on a regular basis. So IMO this whole line of reasoning is totally bunk.\r\n\r\nLastly, if the tagline is really about HTTP for Humans. Then you tell me what is more actionable: \"400 Client Error\" or \"400 Client Error: ERROR TEXT\". The 404 case is silly here because 404 has a specific meaning. 400 is a general 'caller screwed up' message.\r\n\r\nAlright climbing off that soapbox. If you don't want it totes cool with me. Good day!",
"Sorry to rip this one open again, but I actually want this behavior. Or at least, I don't want to duplicate what's in raise_for_status just to add the body.. It would be nice to have `raise_for_status(include_body=True)` or `raise_for_status('additional message')`\r\n\r\nWould either of these satisfy both set of requirements? ",
"No. `raise_for_status` is meant to help with control flow, not give you a complete response body when you already have the response. Further more, if you aren't handling it and some third party is (e.g., Rollbar, Sentry, etc.) you could leak sensitive information to that service which is more than likely not what 99% of our users want. Secure by default means secure in every aspect, including trying as hard as possible to prevent people from shooting themselves in the foot with our defaults.",
"It wouldn't be a default. Let users ask to include the body if they want it, but don't make it a default."
] |
https://api.github.com/repos/psf/requests/issues/4233
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4233/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4233/comments
|
https://api.github.com/repos/psf/requests/issues/4233/events
|
https://github.com/psf/requests/issues/4233
| 249,287,873 |
MDU6SXNzdWUyNDkyODc4NzM=
| 4,233 |
Suggestion: Improve the raise for status to include response body if there is one
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/5054356?v=4",
"events_url": "https://api.github.com/users/westover/events{/privacy}",
"followers_url": "https://api.github.com/users/westover/followers",
"following_url": "https://api.github.com/users/westover/following{/other_user}",
"gists_url": "https://api.github.com/users/westover/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/westover",
"id": 5054356,
"login": "westover",
"node_id": "MDQ6VXNlcjUwNTQzNTY=",
"organizations_url": "https://api.github.com/users/westover/orgs",
"received_events_url": "https://api.github.com/users/westover/received_events",
"repos_url": "https://api.github.com/users/westover/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/westover/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/westover/subscriptions",
"type": "User",
"url": "https://api.github.com/users/westover",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 2 |
2017-08-10T09:35:42Z
|
2021-09-08T07:00:33Z
|
2017-08-10T10:18:11Z
|
NONE
|
resolved
|
Looking for more details on the HTTPError exception. The API I am working with sends back a 400 but also has a text/json body in it. It would be nice if the raise_for_status() function included the response text if there was any.
## Expected Result
That the body would be included
## Actual Result
No response body
## Reproduction Steps
N/A Feature Request! Current workaround:
```python
import requests
from requests.exceptions import HTTPError
def expanded_raise_for_status(res):
"""
Take a "requests" response object and expand the raise_for_status method to return more helpful errors
@param res:
@return: None
"""
try:
res.raise_for_status()
except HTTPError as e:
if res.text:
raise HTTPError('{} Error Message: {}'.format(str(e.message), res.text))
else:
raise e
return
```
## System Information
$ python -m requests.help
```
{
"chardet": {
"version": "3.0.4"
},
"cryptography": {
"version": "2.0.3"
},
"idna": {
"version": ""
},
"implementation": {
"name": "CPython",
"version": "2.7.13"
},
"platform": {
"release": "16.7.0",
"system": "Darwin"
},
"pyOpenSSL": {
"openssl_version": "1010006f",
"version": "16.2.0"
},
"requests": {
"version": "2.18.3"
},
"system_ssl": {
"version": "100020cf"
},
"urllib3": {
"version": "1.22"
},
"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/1382556?v=4",
"events_url": "https://api.github.com/users/Lukasa/events{/privacy}",
"followers_url": "https://api.github.com/users/Lukasa/followers",
"following_url": "https://api.github.com/users/Lukasa/following{/other_user}",
"gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Lukasa",
"id": 1382556,
"login": "Lukasa",
"node_id": "MDQ6VXNlcjEzODI1NTY=",
"organizations_url": "https://api.github.com/users/Lukasa/orgs",
"received_events_url": "https://api.github.com/users/Lukasa/received_events",
"repos_url": "https://api.github.com/users/Lukasa/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Lukasa",
"user_view_type": "public"
}
|
{
"+1": 6,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 6,
"url": "https://api.github.com/repos/psf/requests/issues/4233/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4233/timeline
| null |
completed
| null | null | false |
[
"Added a pull with an implementation",
"Let's close this to focus on the pull itself: it's always nicer to discuss an idea with actual code, rather than in the abstract. :smile: Closing to focus on #4234."
] |
https://api.github.com/repos/psf/requests/issues/4232
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4232/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4232/comments
|
https://api.github.com/repos/psf/requests/issues/4232/events
|
https://github.com/psf/requests/issues/4232
| 249,268,091 |
MDU6SXNzdWUyNDkyNjgwOTE=
| 4,232 |
Posting Multiselect Forms
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/5037305?v=4",
"events_url": "https://api.github.com/users/kianhean/events{/privacy}",
"followers_url": "https://api.github.com/users/kianhean/followers",
"following_url": "https://api.github.com/users/kianhean/following{/other_user}",
"gists_url": "https://api.github.com/users/kianhean/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/kianhean",
"id": 5037305,
"login": "kianhean",
"node_id": "MDQ6VXNlcjUwMzczMDU=",
"organizations_url": "https://api.github.com/users/kianhean/orgs",
"received_events_url": "https://api.github.com/users/kianhean/received_events",
"repos_url": "https://api.github.com/users/kianhean/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/kianhean/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/kianhean/subscriptions",
"type": "User",
"url": "https://api.github.com/users/kianhean",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 4 |
2017-08-10T08:19:16Z
|
2021-09-08T07:00:33Z
|
2017-08-10T08:22:14Z
|
NONE
|
resolved
|
Please help me. I am trying to automate a post from a form. The multiselect portion is throwing me off. the below doesnt work. quite sure the way i am posting the mutliselect portion ('session_id') is wrong
## Expected Result
Expected this to work

payload2 = {'from_date': '2017-08-17', 'fac_id': '10',
'par_fac_id': '1', 'book_purpose': '0', 'session_id': ['50']}
p2 = s.post(new_url, data=payload2)
session_id comes from a multiselect form.
## Actual Result
The request command was not accepted by the server
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4",
"events_url": "https://api.github.com/users/Lukasa/events{/privacy}",
"followers_url": "https://api.github.com/users/Lukasa/followers",
"following_url": "https://api.github.com/users/Lukasa/following{/other_user}",
"gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Lukasa",
"id": 1382556,
"login": "Lukasa",
"node_id": "MDQ6VXNlcjEzODI1NTY=",
"organizations_url": "https://api.github.com/users/Lukasa/orgs",
"received_events_url": "https://api.github.com/users/Lukasa/received_events",
"repos_url": "https://api.github.com/users/Lukasa/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Lukasa",
"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/4232/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4232/timeline
| null |
completed
| null | null | false |
[
"i found the answer!\r\n\r\nSorry about that please close.\r\n\r\npayload2 = {'from_date': '2017-08-17', 'fac_id': '10', \r\n 'par_fac_id': '1', 'book_purpose': '0', 'session_id[]': ['50']}",
"Well done finding the answer!",
"The [toolbelt](/requests/toolbelt) also provides a function to do this for you. Glad you found the answer on your own though. 🎉 ",
"Thanks all. Somehow it wasn't that easy to find "
] |
https://api.github.com/repos/psf/requests/issues/4231
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4231/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4231/comments
|
https://api.github.com/repos/psf/requests/issues/4231/events
|
https://github.com/psf/requests/pull/4231
| 249,113,345 |
MDExOlB1bGxSZXF1ZXN0MTM0OTU0MjQ4
| 4,231 |
Drop Python 3.3 support.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4",
"events_url": "https://api.github.com/users/Lukasa/events{/privacy}",
"followers_url": "https://api.github.com/users/Lukasa/followers",
"following_url": "https://api.github.com/users/Lukasa/following{/other_user}",
"gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Lukasa",
"id": 1382556,
"login": "Lukasa",
"node_id": "MDQ6VXNlcjEzODI1NTY=",
"organizations_url": "https://api.github.com/users/Lukasa/orgs",
"received_events_url": "https://api.github.com/users/Lukasa/received_events",
"repos_url": "https://api.github.com/users/Lukasa/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Lukasa",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 3 |
2017-08-09T18:02:49Z
|
2021-09-04T00:06:53Z
|
2017-08-10T18:03:37Z
|
MEMBER
|
resolved
|
At this point, urllib3 is dropping 3.3 support. I think we should do so as well: 3.3 is long past support and never had the usage that 2.6 did, so we should probably abandon it. As a bonus reason, our CI is breaking on 3.3, so we should probably take the easy route out of that problem.
|
{
"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/4231/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4231/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/4231.diff",
"html_url": "https://github.com/psf/requests/pull/4231",
"merged_at": "2017-08-10T18:03:37Z",
"patch_url": "https://github.com/psf/requests/pull/4231.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/4231"
}
| true |
[
"Nice :)\r\n\r\nDon't forget to update the docs!",
"Good call, updated.",
"This is also currently blocking other builds from succeeding #4234 because of dependency issues in 3.3 specifically!"
] |
https://api.github.com/repos/psf/requests/issues/4230
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4230/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4230/comments
|
https://api.github.com/repos/psf/requests/issues/4230/events
|
https://github.com/psf/requests/issues/4230
| 249,035,848 |
MDU6SXNzdWUyNDkwMzU4NDg=
| 4,230 |
Please bump certifi to 2017.7.27.1
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/27829577?v=4",
"events_url": "https://api.github.com/users/mtdeguzis/events{/privacy}",
"followers_url": "https://api.github.com/users/mtdeguzis/followers",
"following_url": "https://api.github.com/users/mtdeguzis/following{/other_user}",
"gists_url": "https://api.github.com/users/mtdeguzis/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/mtdeguzis",
"id": 27829577,
"login": "mtdeguzis",
"node_id": "MDQ6VXNlcjI3ODI5NTc3",
"organizations_url": "https://api.github.com/users/mtdeguzis/orgs",
"received_events_url": "https://api.github.com/users/mtdeguzis/received_events",
"repos_url": "https://api.github.com/users/mtdeguzis/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/mtdeguzis/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/mtdeguzis/subscriptions",
"type": "User",
"url": "https://api.github.com/users/mtdeguzis",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 1 |
2017-08-09T13:45:36Z
|
2021-09-08T07:00:34Z
|
2017-08-09T14:37:50Z
|
NONE
|
resolved
|
Cannot build requests via pip/buildout/easy_install due to old specified certifi
## Expected Result
Buildout succeeds
## Actual Result
```
Got pykerberos 1.1.14.
Picked: pykerberos = 1.1.14
Getting required 'certifi>=2017.4.17'
required by requests 2.18.3.
We have no distributions for certifi that satisfies 'certifi>=2017.4.17'.
```
## Reproduction Steps
Build requests via pip/pypi fetches
See: https://pypi.python.org/pypi/certifi
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/27829577?v=4",
"events_url": "https://api.github.com/users/mtdeguzis/events{/privacy}",
"followers_url": "https://api.github.com/users/mtdeguzis/followers",
"following_url": "https://api.github.com/users/mtdeguzis/following{/other_user}",
"gists_url": "https://api.github.com/users/mtdeguzis/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/mtdeguzis",
"id": 27829577,
"login": "mtdeguzis",
"node_id": "MDQ6VXNlcjI3ODI5NTc3",
"organizations_url": "https://api.github.com/users/mtdeguzis/orgs",
"received_events_url": "https://api.github.com/users/mtdeguzis/received_events",
"repos_url": "https://api.github.com/users/mtdeguzis/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/mtdeguzis/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/mtdeguzis/subscriptions",
"type": "User",
"url": "https://api.github.com/users/mtdeguzis",
"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/4230/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4230/timeline
| null |
completed
| null | null | false |
[
"This bug report makes no sense. Our certifi requirement specifies only a *minimum* version. You should be able to install alongside any newer certifi without difficulty. "
] |
https://api.github.com/repos/psf/requests/issues/4229
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4229/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4229/comments
|
https://api.github.com/repos/psf/requests/issues/4229/events
|
https://github.com/psf/requests/pull/4229
| 249,017,781 |
MDExOlB1bGxSZXF1ZXN0MTM0ODgzMjE2
| 4,229 |
Fixes issue #3863
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/10330520?v=4",
"events_url": "https://api.github.com/users/NikosVlagoidis/events{/privacy}",
"followers_url": "https://api.github.com/users/NikosVlagoidis/followers",
"following_url": "https://api.github.com/users/NikosVlagoidis/following{/other_user}",
"gists_url": "https://api.github.com/users/NikosVlagoidis/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/NikosVlagoidis",
"id": 10330520,
"login": "NikosVlagoidis",
"node_id": "MDQ6VXNlcjEwMzMwNTIw",
"organizations_url": "https://api.github.com/users/NikosVlagoidis/orgs",
"received_events_url": "https://api.github.com/users/NikosVlagoidis/received_events",
"repos_url": "https://api.github.com/users/NikosVlagoidis/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/NikosVlagoidis/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/NikosVlagoidis/subscriptions",
"type": "User",
"url": "https://api.github.com/users/NikosVlagoidis",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 2 |
2017-08-09T12:42:35Z
|
2021-09-04T00:06:55Z
|
2017-08-09T17:56:40Z
|
CONTRIBUTOR
|
resolved
|
Update the docs for issue #3863 .
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4",
"events_url": "https://api.github.com/users/Lukasa/events{/privacy}",
"followers_url": "https://api.github.com/users/Lukasa/followers",
"following_url": "https://api.github.com/users/Lukasa/following{/other_user}",
"gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Lukasa",
"id": 1382556,
"login": "Lukasa",
"node_id": "MDQ6VXNlcjEzODI1NTY=",
"organizations_url": "https://api.github.com/users/Lukasa/orgs",
"received_events_url": "https://api.github.com/users/Lukasa/received_events",
"repos_url": "https://api.github.com/users/Lukasa/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Lukasa",
"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/4229/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4229/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/4229.diff",
"html_url": "https://github.com/psf/requests/pull/4229",
"merged_at": "2017-08-09T17:56:40Z",
"patch_url": "https://github.com/psf/requests/pull/4229.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/4229"
}
| true |
[
"How tests are failing for Python 3.3. I have only changed one .rst on the docs",
"I update the docs accordingly."
] |
https://api.github.com/repos/psf/requests/issues/4228
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4228/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4228/comments
|
https://api.github.com/repos/psf/requests/issues/4228/events
|
https://github.com/psf/requests/issues/4228
| 248,960,728 |
MDU6SXNzdWUyNDg5NjA3Mjg=
| 4,228 |
Please support idna 2.6
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/24315939?v=4",
"events_url": "https://api.github.com/users/stephanema/events{/privacy}",
"followers_url": "https://api.github.com/users/stephanema/followers",
"following_url": "https://api.github.com/users/stephanema/following{/other_user}",
"gists_url": "https://api.github.com/users/stephanema/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/stephanema",
"id": 24315939,
"login": "stephanema",
"node_id": "MDQ6VXNlcjI0MzE1OTM5",
"organizations_url": "https://api.github.com/users/stephanema/orgs",
"received_events_url": "https://api.github.com/users/stephanema/received_events",
"repos_url": "https://api.github.com/users/stephanema/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/stephanema/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/stephanema/subscriptions",
"type": "User",
"url": "https://api.github.com/users/stephanema",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 2 |
2017-08-09T08:51:55Z
|
2021-09-08T07:00:34Z
|
2017-08-09T09:18:17Z
|
NONE
|
resolved
|
Today I updated idna to 2.6 then I tried to install requests 2.18.3 and got an
error that dna must be <2.6.
Would be nice it you support the actual idna package,
thanks.
System: python 3.6.2 64 bit on windows7 64 bit
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4",
"events_url": "https://api.github.com/users/Lukasa/events{/privacy}",
"followers_url": "https://api.github.com/users/Lukasa/followers",
"following_url": "https://api.github.com/users/Lukasa/following{/other_user}",
"gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Lukasa",
"id": 1382556,
"login": "Lukasa",
"node_id": "MDQ6VXNlcjEzODI1NTY=",
"organizations_url": "https://api.github.com/users/Lukasa/orgs",
"received_events_url": "https://api.github.com/users/Lukasa/received_events",
"repos_url": "https://api.github.com/users/Lukasa/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Lukasa",
"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/4228/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4228/timeline
| null |
completed
| null | null | false |
[
"*Please* check recent issues. You'll find that two have been opened before you, both saying that we have updated the pin in the current master and will be releasing an update next week.",
"Oops sorry, I didn't realize it (I use seldomly the github issues pages)"
] |
https://api.github.com/repos/psf/requests/issues/4227
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4227/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4227/comments
|
https://api.github.com/repos/psf/requests/issues/4227/events
|
https://github.com/psf/requests/issues/4227
| 248,953,399 |
MDU6SXNzdWUyNDg5NTMzOTk=
| 4,227 |
requests.get(stream=True) will get incomplete data
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/3338245?v=4",
"events_url": "https://api.github.com/users/MrKang/events{/privacy}",
"followers_url": "https://api.github.com/users/MrKang/followers",
"following_url": "https://api.github.com/users/MrKang/following{/other_user}",
"gists_url": "https://api.github.com/users/MrKang/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/MrKang",
"id": 3338245,
"login": "MrKang",
"node_id": "MDQ6VXNlcjMzMzgyNDU=",
"organizations_url": "https://api.github.com/users/MrKang/orgs",
"received_events_url": "https://api.github.com/users/MrKang/received_events",
"repos_url": "https://api.github.com/users/MrKang/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/MrKang/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/MrKang/subscriptions",
"type": "User",
"url": "https://api.github.com/users/MrKang",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 19 |
2017-08-09T08:22:36Z
|
2021-08-30T00:06:08Z
|
2018-02-24T14:52:20Z
|
NONE
|
resolved
|
when I use stream=True, I get these:
```python
#print response.headers['Content-Length']
1332224
#print response.raw.tell()
1332224
#print len(response.content)
1331968
```
the content I get is incomplete.But when I use stream=False,I can get complete data.
when I set `stream=True` and `response.iter_content(chunk_size=1024*32)` I also get incomplete data.
## Reproduction Steps
```python
import requests
r = request.get(url='http://down.ziyuanku.com/201708091545/b5e3765e0be509c91617da128ecf169f/Resources/ChuZhong/2017-07-12/cccee17addb349cf8966161180c3e3ea.doc', stream=True)
with open(file, 'wb') as f:
for chunk in r.iter_content(chunk_size=1024*36):
if chunk:
f.write(chunk)
f.flush()
r.close()
```
## System Information
$ python -m requests.help
```
{
"chardet": {
"version": "3.0.4"
},
"cryptography": {
"version": ""
},
"implementation": {
"name": "CPython",
"version": "2.7.10"
},
"platform": {
"release": "16.7.0",
"system": "Darwin"
},
"pyOpenSSL": {
"openssl_version": "",
"version": null
},
"requests": {
"version": "2.18.1"
},
"system_ssl": {
"version": "9081df"
},
"urllib3": {
"version": "1.21.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/4227/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4227/timeline
| null |
completed
| null | null | false |
[
"The only change in behaviour from `stream=True` to `stream=False` is changing where in the code-path we consume the body. It causes no externally visible effects, nor does it affect the way we load the code. Do you know for a fact that the body is corrupted in this case?",
"```python\r\n#this is the property of response in requests/models.py\r\n @property\r\n def content(self):\r\n \"\"\"Content of the response, in bytes.\"\"\"\r\n\r\n if self._content is False:\r\n\r\n if self._content_consumed:\r\n raise RuntimeError(\r\n 'The content for this response was already consumed')\r\n\r\n if self.status_code == 0 or self.raw is None:\r\n self._content = None\r\n else:\r\n #if stream=True \r\n self._content = bytes().join(self.iter_content(CONTENT_CHUNK_SIZE)) or bytes()\r\n\r\n self._content_consumed = True\r\n\r\n return self._content\r\n```\r\nso i think the problem is `iter_content()`.And i found sometimes the length of chunk from `iter_content(chunk_size=BLOCK_SIZE)` is smaller than BLOCK_SIZE",
"I don't think the problem is `iter_content`, because `iter_content` is *always* used. Take a look at the definition of `session.send` [here](https://github.com/requests/requests/blob/master/requests/sessions.py#L658) to see that we always do the same thing.\r\n\r\nSo that cannot be the problem. So back to my question: do you know *for sure* that the body is corrupted? If so, how is the corruption manifesting?",
"> so i think the problem is iter_content().And i found sometimes the length of chunk from iter_content(chunk_size=BLOCK_SIZE) is smaller than BLOCK_SIZE\r\n\r\nIf I recall correctly, `iter_content` will return something smaller than `BLOCK_SIZE` if the content was compressed. Is that happening to you?",
"@Lukasa \r\nSorry my English is basic,I do not know what you said the _body_ refers to what。If it means the file that I downloaded,I'm sure it is really damaged,because I can not open the downloaded .doc file.",
"Yeah, that's the body.\r\n\r\nSo if you have two *identical* blocks of code, one that downloads with `stream=True` and one that downloads with `stream=False`, they save two different files to disk?",
"@sigmavirus24 \r\nI'm not sure if that is happening to me.If the content was compressed should I do something to ensure that the content is correct?",
"> So if you have two identical blocks of code, one that downloads with stream=True and one that downloads with stream=False, they save two different files to disk?\r\n\r\nI did a small test and the result of the file stream_true.doc and stream_false.doc is the same:\r\n```python\r\nimport requests\r\n\r\n\r\ndef stream_false():\r\n r = requests.get(url='http://www.uep.cl/wp-content/uploads/2016/01/TestWordDoc.doc', stream=False)\r\n with open('stream_false.doc', 'wb') as f: \r\n for chunk in r.iter_content(chunk_size=1024*36):\r\n if chunk:\r\n f.write(chunk)\r\n f.flush()\r\n r.close()\r\n\r\ndef stream_true():\r\n r = requests.get(url='http://www.uep.cl/wp-content/uploads/2016/01/TestWordDoc.doc', stream=True)\r\n with open('stream_true.doc', 'wb') as f: \r\n for chunk in r.iter_content(chunk_size=1024*36):\r\n if chunk:\r\n f.write(chunk)\r\n f.flush()\r\n r.close()\r\n\r\n\r\nif __name__ == '__main__':\r\n stream_false()\r\n stream_true()\r\n```",
"@nano3k0a that's an interesting data point but context is required. Please provide the output of `python -m requests.help` so we know the similarities and differences between your system/configuration and @MrKang 's",
"I found that the error was caused by single step of debugging\r\nMy development environment is:\r\nvscode:\r\n 1.15.0 (1.15.0)\r\nplugins:\r\nPython 0.7.0\r\nPython for VSCode 0.2.3\r\nMagicPython 1.0.12\r\n```python\r\nwith open(tmp_full_path, 'wb') as f: \r\n for chunk in r.iter_content(chunk_size=1024*36):\r\n#set a breakpoint anywhere in this loop and then single step several times\r\n if len(chunk) < 1024*36:\r\n print len(chunk)\r\n if chunk:\r\n f.write(chunk)\r\n f.flush()\r\n```",
"So what you're saying is that the loop above works fine without a breakpoint, and otherwise breaks?",
"yes,I have tested it many times.",
"What happens if you change the breakpoint just to be a `time.sleep`instead?",
"Everything is fine when using time.sleep.\r\n```python\r\nwith open(tmp_full_path, 'wb') as f: \r\n for chunk in r.iter_content(chunk_size=1024*36):\r\n if len(chunk) < 1024*36: \r\n#set a breakpoint anywhere in this loop and then single step several times,there will be a chunk that smaller than chunk_size\r\n print len(chunk)\r\n if chunk:\r\n f.write(chunk)\r\n f.flush()\r\n```",
"To be clear, a chunk smaller than chunk size is not a bug. I'm worried more about *losing* data.",
"I just want to say that every time I get an incomplete file ,the `len(chunk) < 1024*36`will be true.\r\nI have already said the steps to reproduce,you can set a breakpoint to test",
"@MrKang Sure, but that's to be expected. At the very least you will get *one* chunk smaller than that, which is the end of the file.",
"I've just had a similar experience -- a chunked binary read turned out different from a whole-file read.\r\n\r\nEach chunk in the failing case was a substring of the entire file, but there were inter-chunk pieces missing.\r\n\r\nIn the process of making a demo program, I discovered that the failing case only occurs when I was running my program within PyTools for VisualStudio, even without breakpoints in the affected code.\r\n\r\nWeirdness.\r\n\r\nThanks to MrKang and Lukasa for planting a seed in my mind about breakpoints and debugging.",
"i wonder what if i use without `with` statement?\r\nbecause i don't need to write to file, only need to iterate to read each 1024 bytes until i get what i need.\r\nwould it be ok?\r\n\r\n```\r\nr = request.get(url='http://down.ziyuanku.com/201708091545/b5e3765e0be509c91617da128ecf169f/Resources/ChuZhong/2017-07-12/cccee17addb349cf8966161180c3e3ea.doc', stream=True)\r\ndata=[]\r\nfor chunk in r.iter_content(chunk_size=1024*36):\r\n if chunk:\r\n data.append(chunk)\r\n f.flush()\r\nr.close()\r\n```"
] |
https://api.github.com/repos/psf/requests/issues/4226
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4226/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4226/comments
|
https://api.github.com/repos/psf/requests/issues/4226/events
|
https://github.com/psf/requests/pull/4226
| 248,873,679 |
MDExOlB1bGxSZXF1ZXN0MTM0Nzc5Mjk0
| 4,226 |
TEST OF CI
|
{
"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 |
2017-08-08T23:17:03Z
|
2021-09-04T00:06:54Z
|
2017-08-09T17:57:03Z
|
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/4226/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4226/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/4226.diff",
"html_url": "https://github.com/psf/requests/pull/4226",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/4226.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/4226"
}
| true |
[] |
|
https://api.github.com/repos/psf/requests/issues/4225
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4225/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4225/comments
|
https://api.github.com/repos/psf/requests/issues/4225/events
|
https://github.com/psf/requests/pull/4225
| 248,871,357 |
MDExOlB1bGxSZXF1ZXN0MTM0Nzc3NTU2
| 4,225 |
TEST FOR CI
|
{
"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 |
2017-08-08T23:03:14Z
|
2021-09-05T00:07:06Z
|
2017-08-08T23:03: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/4225/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4225/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/4225.diff",
"html_url": "https://github.com/psf/requests/pull/4225",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/4225.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/4225"
}
| true |
[] |
|
https://api.github.com/repos/psf/requests/issues/4224
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4224/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4224/comments
|
https://api.github.com/repos/psf/requests/issues/4224/events
|
https://github.com/psf/requests/issues/4224
| 248,763,772 |
MDU6SXNzdWUyNDg3NjM3NzI=
| 4,224 |
idna dependency
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/244702?v=4",
"events_url": "https://api.github.com/users/papachoco/events{/privacy}",
"followers_url": "https://api.github.com/users/papachoco/followers",
"following_url": "https://api.github.com/users/papachoco/following{/other_user}",
"gists_url": "https://api.github.com/users/papachoco/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/papachoco",
"id": 244702,
"login": "papachoco",
"node_id": "MDQ6VXNlcjI0NDcwMg==",
"organizations_url": "https://api.github.com/users/papachoco/orgs",
"received_events_url": "https://api.github.com/users/papachoco/received_events",
"repos_url": "https://api.github.com/users/papachoco/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/papachoco/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/papachoco/subscriptions",
"type": "User",
"url": "https://api.github.com/users/papachoco",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 3 |
2017-08-08T15:56:13Z
|
2021-09-08T07:00:35Z
|
2017-08-08T16:19:36Z
|
NONE
|
resolved
|
Hi,
Could we get a new release of requests w/ an updated idna dependency.
Thanks a lot,
Carlos
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4",
"events_url": "https://api.github.com/users/Lukasa/events{/privacy}",
"followers_url": "https://api.github.com/users/Lukasa/followers",
"following_url": "https://api.github.com/users/Lukasa/following{/other_user}",
"gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Lukasa",
"id": 1382556,
"login": "Lukasa",
"node_id": "MDQ6VXNlcjEzODI1NTY=",
"organizations_url": "https://api.github.com/users/Lukasa/orgs",
"received_events_url": "https://api.github.com/users/Lukasa/received_events",
"repos_url": "https://api.github.com/users/Lukasa/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Lukasa",
"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/4224/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4224/timeline
| null |
completed
| null | null | false |
[
"This is already updated in master. A new release will be shipped next week. ",
"It seems that we get into an invalid state when something that has an unbounded-upper requirement of `idna` is listed first to `pip install`. Example:\r\n```\r\n$ pip install cryptography requests\r\nCollecting cryptography\r\n Using cached cryptography-2.0.3-cp35-cp35m-manylinux1_x86_64.whl\r\nCollecting requests\r\n Using cached requests-2.18.3-py2.py3-none-any.whl\r\n...\r\nCollecting idna>=2.1 (from cryptography)\r\n Using cached idna-2.6-py2.py3-none-any.whl\r\n...\r\nSuccessfully installed asn1crypto-0.22.0 certifi-2017.7.27.1 cffi-1.10.0 chardet-3.0.4 cryptography-2.0.3 idna-2.6 pycparser-2.18 requests-2.18.3 six-1.10.0 urllib3-1.22\r\n````\r\nHere, `idna-2.6` is installed.\r\n\r\nOn the other hand,\r\n```\r\n$ pip install requests cryptography\r\nCollecting requests\r\n Using cached requests-2.18.3-py2.py3-none-any.whl\r\nCollecting cryptography\r\n Using cached cryptography-2.0.3-cp35-cp35m-manylinux1_x86_64.whl\r\n...\r\nCollecting idna<2.6,>=2.5 (from requests)\r\n Using cached idna-2.5-py2.py3-none-any.whl\r\n...\r\nSuccessfully installed asn1crypto-0.22.0 certifi-2017.7.27.1 cffi-1.10.0 chardet-3.0.4 cryptography-2.0.3 idna-2.5 pycparser-2.18 requests-2.18.3 six-1.10.0 urllib3-1.22\r\n```\r\n\r\nIs this a bug in `pip` or desired functionality?",
"Disregard my last comment, pip lacks a proper dependency resolver https://github.com/pypa/pip/issues/988 which explains the behavior."
] |
https://api.github.com/repos/psf/requests/issues/4223
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4223/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4223/comments
|
https://api.github.com/repos/psf/requests/issues/4223/events
|
https://github.com/psf/requests/pull/4223
| 248,699,778 |
MDExOlB1bGxSZXF1ZXN0MTM0NjQ4ODMy
| 4,223 |
Allow IDNA 2.6
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4",
"events_url": "https://api.github.com/users/Lukasa/events{/privacy}",
"followers_url": "https://api.github.com/users/Lukasa/followers",
"following_url": "https://api.github.com/users/Lukasa/following{/other_user}",
"gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Lukasa",
"id": 1382556,
"login": "Lukasa",
"node_id": "MDQ6VXNlcjEzODI1NTY=",
"organizations_url": "https://api.github.com/users/Lukasa/orgs",
"received_events_url": "https://api.github.com/users/Lukasa/received_events",
"repos_url": "https://api.github.com/users/Lukasa/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Lukasa",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 2 |
2017-08-08T12:33:55Z
|
2021-09-05T00:07:06Z
|
2017-08-08T14:42:55Z
|
MEMBER
|
resolved
|
Resolves #4222.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4",
"events_url": "https://api.github.com/users/Lukasa/events{/privacy}",
"followers_url": "https://api.github.com/users/Lukasa/followers",
"following_url": "https://api.github.com/users/Lukasa/following{/other_user}",
"gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Lukasa",
"id": 1382556,
"login": "Lukasa",
"node_id": "MDQ6VXNlcjEzODI1NTY=",
"organizations_url": "https://api.github.com/users/Lukasa/orgs",
"received_events_url": "https://api.github.com/users/Lukasa/received_events",
"repos_url": "https://api.github.com/users/Lukasa/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Lukasa",
"user_view_type": "public"
}
|
{
"+1": 1,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 1,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 2,
"url": "https://api.github.com/repos/psf/requests/issues/4223/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4223/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/4223.diff",
"html_url": "https://github.com/psf/requests/pull/4223",
"merged_at": "2017-08-08T14:42:55Z",
"patch_url": "https://github.com/psf/requests/pull/4223.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/4223"
}
| true |
[
"Looks like the CI is busted again. 😞 ",
"tests passed"
] |
https://api.github.com/repos/psf/requests/issues/4222
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4222/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4222/comments
|
https://api.github.com/repos/psf/requests/issues/4222/events
|
https://github.com/psf/requests/issues/4222
| 248,661,329 |
MDU6SXNzdWUyNDg2NjEzMjk=
| 4,222 |
support idna 2.6
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/632049?v=4",
"events_url": "https://api.github.com/users/cjw296/events{/privacy}",
"followers_url": "https://api.github.com/users/cjw296/followers",
"following_url": "https://api.github.com/users/cjw296/following{/other_user}",
"gists_url": "https://api.github.com/users/cjw296/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/cjw296",
"id": 632049,
"login": "cjw296",
"node_id": "MDQ6VXNlcjYzMjA0OQ==",
"organizations_url": "https://api.github.com/users/cjw296/orgs",
"received_events_url": "https://api.github.com/users/cjw296/received_events",
"repos_url": "https://api.github.com/users/cjw296/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/cjw296/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/cjw296/subscriptions",
"type": "User",
"url": "https://api.github.com/users/cjw296",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 9 |
2017-08-08T09:54:36Z
|
2021-08-27T00:08:26Z
|
2017-08-08T14:42:55Z
|
CONTRIBUTOR
|
resolved
|
idna 2.6 has been released, so the constraint in setup.py is now blowing up:
```
pkg_resources.ContextualVersionConflict: (idna 2.6 (.../ve/lib/python2.7/site-packages), Requirement.parse('idna<2.6,>=2.5'), set(['requests']))
```
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4",
"events_url": "https://api.github.com/users/Lukasa/events{/privacy}",
"followers_url": "https://api.github.com/users/Lukasa/followers",
"following_url": "https://api.github.com/users/Lukasa/following{/other_user}",
"gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Lukasa",
"id": 1382556,
"login": "Lukasa",
"node_id": "MDQ6VXNlcjEzODI1NTY=",
"organizations_url": "https://api.github.com/users/Lukasa/orgs",
"received_events_url": "https://api.github.com/users/Lukasa/received_events",
"repos_url": "https://api.github.com/users/Lukasa/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Lukasa",
"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/4222/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4222/timeline
| null |
completed
| null | null | false |
[
"Hang on, why is that constraint exploding? 2.5 should satisfy the requirement.",
"My guess something is installing it earlier in the build chain, and pip isn't clever enough to downgrade to 2.5 once 2.6 is installed.\r\n\r\nIs there a problem with 2.6 that makes it backwards incompatible?",
"We don't know at this time: we began with very tight pins because we only unvendored the package a few months ago and so didn't want to run the risk of accidental breakage. We need to get a feel for what the actual compatibility structure is here.\r\n\r\nIn the short term, you can resolve your problem by using `requirements.txt` or similar to pin the `idna` version. In the longer term, we can aim to get a Requests patch that widens the pin.",
"Thanks for the quick turnaround!",
"Is there any plan for releasing a new version with this fix? That would be really helpful.",
"Yes, next week. ",
"The same is starting to happen with idna 2.7 ~~because cryptography requires idna 2.7~~\r\nI still don't know why pip is resolving idna 2.7, cryptography is not requiring 2.7",
"I have a similar issue but with version 2.10:\r\n\r\n```\r\nerror: idna 2.10 is installed but idna<2.9,>=2.5 is required by {'requests'}\r\n```",
"> I have a similar issue but with version 2.10:\r\n> \r\n> ```\r\n> error: idna 2.10 is installed but idna<2.9,>=2.5 is required by {'requests'}\r\n> ```\r\n\r\nMe too, getting the same error while deploying my project on scrapy cloud. Have you found a solution yet?\r\nError:\r\nrequests 2.25.1 has requirement idna<3,>=2.5, but you have idna 2.1.\r\nWarning: Pip checks failed, please fix the conflicts.\r\n{\"message\": \"Dependencies check exit code: 1\", \"details\": \"Pip checks failed, please fix the conflicts\", \"error\": \"requirements_error\"}\r\n{\"status\": \"error\", \"message\": \"Requirements error\"}"
] |
https://api.github.com/repos/psf/requests/issues/4221
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4221/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4221/comments
|
https://api.github.com/repos/psf/requests/issues/4221/events
|
https://github.com/psf/requests/issues/4221
| 248,415,832 |
MDU6SXNzdWUyNDg0MTU4MzI=
| 4,221 |
HTTPS proxy fails with requests.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/4874269?v=4",
"events_url": "https://api.github.com/users/sebastienvercammen/events{/privacy}",
"followers_url": "https://api.github.com/users/sebastienvercammen/followers",
"following_url": "https://api.github.com/users/sebastienvercammen/following{/other_user}",
"gists_url": "https://api.github.com/users/sebastienvercammen/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/sebastienvercammen",
"id": 4874269,
"login": "sebastienvercammen",
"node_id": "MDQ6VXNlcjQ4NzQyNjk=",
"organizations_url": "https://api.github.com/users/sebastienvercammen/orgs",
"received_events_url": "https://api.github.com/users/sebastienvercammen/received_events",
"repos_url": "https://api.github.com/users/sebastienvercammen/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/sebastienvercammen/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/sebastienvercammen/subscriptions",
"type": "User",
"url": "https://api.github.com/users/sebastienvercammen",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 10 |
2017-08-07T13:42:49Z
|
2021-09-08T07:00:35Z
|
2017-08-07T23:11:02Z
|
NONE
|
resolved
|
Using `requests` with an HTTPS proxy (Node.js with `https` to receive incoming requests and `http-proxy` to tunnel) always results in:
```
requests.exceptions.ConnectionError: ('Connection aborted.', BadStatusLine("''",))
```
The Node.js proxy server intentionally returns 401 on all requests for testing purposes. If 401 won't work, there's no reason to add the rest of the functionality.
Using httplib (correct response):
```
>>> import httplib
>>> conn = httplib.HTTPSConnection('censored-proxy-domain.com', 8081)
>>> conn.request('HEAD', 'https://www.google.com')
>>> res = conn.getresponse()
>>> res.status
401
```
Using urllib.urlopen (correct response):
```
>>> urllib.urlopen('https://www.google.com', proxies=proxies)
...
IOError: ('http error', 401, 'Unauthorized', <httplib.HTTPMessage instance at 0x032A7AA8>)
```
But using requests:
```
r = requests.get('https://www.google.com', proxies=proxies)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Python27\lib\site-packages\requests\api.py", line 72, in get
return request('get', url, params=params, **kwargs)
File "C:\Python27\lib\site-packages\requests\api.py", line 58, in request
return session.request(method=method, url=url, **kwargs)
File "C:\Python27\lib\site-packages\requests\sessions.py", line 508, in request
resp = self.send(prep, **send_kwargs)
File "C:\Python27\lib\site-packages\requests\sessions.py", line 618, in send
r = adapter.send(request, **kwargs)
File "C:\Python27\lib\site-packages\requests\adapters.py", line 490, in send
raise ConnectionError(err, request=request)
requests.exceptions.ConnectionError: ('Connection aborted.', BadStatusLine("''",))
```
The `requests` request also never gets received or handled/logged in the proxy server. Any other library or 3rd party tool has worked (test in browser, Proxifier, ProxyCap).
## Expected Result
I expect `requests` to return a similar result to any other library.
## Actual Result
Logs above.
## Reproduction Steps
```python
import requests
```
## System Information
$ python -m requests.help
```
{
"chardet": {
"version": "3.0.4"
},
"cryptography": {
"version": ""
},
"idna": {
"version": ""
},
"implementation": {
"name": "CPython",
"version": "2.7.12"
},
"platform": {
"release": "10",
"system": "Windows"
},
"pyOpenSSL": {
"openssl_version": "",
"version": null
},
"requests": {
"version": "2.18.3"
},
"system_ssl": {
"version": "1000208f"
},
"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/4874269?v=4",
"events_url": "https://api.github.com/users/sebastienvercammen/events{/privacy}",
"followers_url": "https://api.github.com/users/sebastienvercammen/followers",
"following_url": "https://api.github.com/users/sebastienvercammen/following{/other_user}",
"gists_url": "https://api.github.com/users/sebastienvercammen/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/sebastienvercammen",
"id": 4874269,
"login": "sebastienvercammen",
"node_id": "MDQ6VXNlcjQ4NzQyNjk=",
"organizations_url": "https://api.github.com/users/sebastienvercammen/orgs",
"received_events_url": "https://api.github.com/users/sebastienvercammen/received_events",
"repos_url": "https://api.github.com/users/sebastienvercammen/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/sebastienvercammen/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/sebastienvercammen/subscriptions",
"type": "User",
"url": "https://api.github.com/users/sebastienvercammen",
"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/4221/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4221/timeline
| null |
completed
| null | null | false |
[
"Can you show me the contents of the `proxies` dict please?",
"@Lukasa Tested with these:\r\n```\r\nproxies = {'http': 'http://censored-proxy-domain.com:8080', 'https': 'https://censored-proxy-domain.com:8081'}\r\nproxies = {'http': 'https://censored-proxy-domain.com:8081', 'https': 'https://censored-proxy-domain.com:8081'}\r\nproxies = {'https': 'https://censored-proxy-domain.com:8081'}\r\nproxies = {'http': 'censored-proxy-domain.com:8080', 'https': 'censored-proxy-domain.com:8081'}\r\n```\r\nThe first one was used with urllib, the others were just random tests to make sure I didn't miss any test case. The domain resolves to `127.0.0.1` via Windows' hosts file (done to use the real domain's Let's Encrypt SSL certificate to have a valid one).\r\n\r\nDoes `requests` have a problem with the hosts file?",
"Can you try:\r\n\r\n```\r\nproxies = {'http': 'http://censored-proxy-domain.com:8080', 'https': 'https://censored-proxy-domain.com:8081'}\r\n```\r\n\r\nRequests doesn't do what you'd expect when the scheme of the proxy URL is `https`.\r\n\r\nRequests does not have a problem with the hosts file.",
"@Lukasa That's the same as my first example.",
"@sebastienvercammen Ah, sorry, I meant this:\r\n\r\n```\r\nproxies = {'http': 'http://censored-proxy-domain.com:8080', 'https': 'http://censored-proxy-domain.com:8081'}\r\n```\r\n\r\nForgot to actually make the edit.",
"@Lukasa Tried it, same result:\r\n```\r\n>>> proxies\r\n{'http': 'http://censored-proxy-domain.com:8080', 'https': 'http://censored-proxy-domain.com:8081'}\r\n>>> r = requests.get('https://www.google.com', proxies=proxies)\r\nTraceback (most recent call last):\r\n File \"<stdin>\", line 1, in <module>\r\n File \"C:\\Python27\\lib\\site-packages\\requests\\api.py\", line 72, in get\r\n return request('get', url, params=params, **kwargs)\r\n File \"C:\\Python27\\lib\\site-packages\\requests\\api.py\", line 58, in request\r\n return session.request(method=method, url=url, **kwargs)\r\n File \"C:\\Python27\\lib\\site-packages\\requests\\sessions.py\", line 508, in request\r\n resp = self.send(prep, **send_kwargs)\r\n File \"C:\\Python27\\lib\\site-packages\\requests\\sessions.py\", line 618, in send\r\n r = adapter.send(request, **kwargs)\r\n File \"C:\\Python27\\lib\\site-packages\\requests\\adapters.py\", line 490, in send\r\n raise ConnectionError(err, request=request)\r\nrequests.exceptions.ConnectionError: ('Connection aborted.', BadStatusLine(\"''\",))\r\n```\r\nSame when `http://censored-proxy-domain.com:8080` is used for both `http` and `https` in the proxies dict.",
"Hrm, can you try using wire shark to compare Requests to urllib? My suspicion is that your proxy server doesn't like our HTTP/1.0 HEAD request.",
"@Lukasa Thank you, your suggestion to check Wireshark helped me to notice that `requests` first sends a `CONNECT` request, which led me to find that Node.js' HTTP and HTTPS servers have something specific about them:\r\n\r\nhttps://nodejs.org/api/http.html#http_event_connect_1\r\n\r\n> Emitted each time a client requests an HTTP CONNECT method. **If this event is not listened for, then clients requesting a CONNECT method will have their connections closed.**\r\n\r\nPerhaps it could help to let `requests` show a more helpful exception message?",
"Requests is kind of doing the best it can: its expecting a response and not getting one before EOF. Sadly that error is emitted by our parser, which is httplib, so until and unless we swap parser it's hard for us to get a better error here. 🙁",
"@Lukasa Perfectly understandable. Closing this issue because it was resolved."
] |
https://api.github.com/repos/psf/requests/issues/4220
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4220/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4220/comments
|
https://api.github.com/repos/psf/requests/issues/4220/events
|
https://github.com/psf/requests/issues/4220
| 248,237,895 |
MDU6SXNzdWUyNDgyMzc4OTU=
| 4,220 |
Traceback format_exc failing with ConnectionError
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/3856586?v=4",
"events_url": "https://api.github.com/users/Phyks/events{/privacy}",
"followers_url": "https://api.github.com/users/Phyks/followers",
"following_url": "https://api.github.com/users/Phyks/following{/other_user}",
"gists_url": "https://api.github.com/users/Phyks/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Phyks",
"id": 3856586,
"login": "Phyks",
"node_id": "MDQ6VXNlcjM4NTY1ODY=",
"organizations_url": "https://api.github.com/users/Phyks/orgs",
"received_events_url": "https://api.github.com/users/Phyks/received_events",
"repos_url": "https://api.github.com/users/Phyks/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Phyks/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Phyks/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Phyks",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 2 |
2017-08-06T10:07:05Z
|
2021-09-08T07:00:36Z
|
2017-08-06T10:42:36Z
|
NONE
|
resolved
|
Hi,
I tried to use a script using requests (v2.18.1) on a remote website without having any internet connectivity. Of course, this resulted in a long stack traces due to the absence of internet connectivity, as expected, which ended up with
```
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='updates.weboob.org', port=443): Max retries exceeded with url: /1.3/main/modules.list (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7fe5f7474be0>: Failed to establish a new connection: [Errno -2] Name or service not known',))
```
Problem is that I catch any such exception and pass them to `traceback.format_exc` in order to have a nice error formatting in my logs.
## Expected Result
Using something like
```
try:
my_code_calling_requests()
except Exception as e:
log.error(("Unknown exception raised: %s" % traceback.format_exc(e)))
```
I would have expected a nicely formatted exception in my logs.
## Actual Result
Actually, it raised another exception, which I am not 100% sure to understand :/ Full traceback is:
```
Traceback (most recent call last):
File "MY_CODE", line 363, in <module>
traceback.format_exc(e)),
File "/usr/lib/python3.6/traceback.py", line 163, in format_exc
return "".join(format_exception(*sys.exc_info(), limit=limit, chain=chain))
File "/usr/lib/python3.6/traceback.py", line 117, in format_exception
type(value), value, tb, limit=limit).format(chain=chain))
File "/usr/lib/python3.6/traceback.py", line 486, in __init__
_seen=_seen)
File "/usr/lib/python3.6/traceback.py", line 486, in __init__
_seen=_seen)
File "/usr/lib/python3.6/traceback.py", line 486, in __init__
_seen=_seen)
File "/usr/lib/python3.6/traceback.py", line 497, in __init__
capture_locals=capture_locals)
File "/usr/lib/python3.6/traceback.py", line 332, in extract
if limit >= 0:
TypeError: '>=' not supported between instances of 'ConnectionError' and 'int'
```
## System Information
```
{
"chardet": {
"version": "3.0.4"
},
"cryptography": {
"version": "1.9"
},
"implementation": {
"name": "CPython",
"version": "3.6.1"
},
"platform": {
"release": "4.11.7-1-ARCH",
"system": "Linux"
},
"pyOpenSSL": {
"openssl_version": "1010006f",
"version": "17.0.0"
},
"requests": {
"version": "2.18.1"
},
"system_ssl": {
"version": "1010006f"
},
"urllib3": {
"version": "1.21.1"
},
"using_pyopenssl": true
}
```
Thanks!
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4",
"events_url": "https://api.github.com/users/Lukasa/events{/privacy}",
"followers_url": "https://api.github.com/users/Lukasa/followers",
"following_url": "https://api.github.com/users/Lukasa/following{/other_user}",
"gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Lukasa",
"id": 1382556,
"login": "Lukasa",
"node_id": "MDQ6VXNlcjEzODI1NTY=",
"organizations_url": "https://api.github.com/users/Lukasa/orgs",
"received_events_url": "https://api.github.com/users/Lukasa/received_events",
"repos_url": "https://api.github.com/users/Lukasa/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Lukasa",
"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/4220/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4220/timeline
| null |
completed
| null | null | false |
[
"The first argument of `format_exc` is not the exception to print, it's a limit on how many lines of trace back to print. You may want to reread the documentation for the function on python.org. The correct call is just `format_exc`.",
"Oops, truly sorry about this :/ I took it from a snippet and should have checked the snippet thoroughly :/"
] |
https://api.github.com/repos/psf/requests/issues/4219
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4219/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4219/comments
|
https://api.github.com/repos/psf/requests/issues/4219/events
|
https://github.com/psf/requests/issues/4219
| 248,164,643 |
MDU6SXNzdWUyNDgxNjQ2NDM=
| 4,219 |
_validate_timeout raise an exception about typage
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/3684625?v=4",
"events_url": "https://api.github.com/users/tomapp/events{/privacy}",
"followers_url": "https://api.github.com/users/tomapp/followers",
"following_url": "https://api.github.com/users/tomapp/following{/other_user}",
"gists_url": "https://api.github.com/users/tomapp/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/tomapp",
"id": 3684625,
"login": "tomapp",
"node_id": "MDQ6VXNlcjM2ODQ2MjU=",
"organizations_url": "https://api.github.com/users/tomapp/orgs",
"received_events_url": "https://api.github.com/users/tomapp/received_events",
"repos_url": "https://api.github.com/users/tomapp/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/tomapp/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/tomapp/subscriptions",
"type": "User",
"url": "https://api.github.com/users/tomapp",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 1 |
2017-08-05T06:10:12Z
|
2021-09-08T07:00:36Z
|
2017-08-05T07:59:01Z
|
NONE
|
resolved
|
Hello!
When i use docker-compose, i have an error with this lib.
## Expected Result
utils/_validate_timeout should not raise any errors.
## Actual Result
utils _validate_timeout should raise an exception :
```
Timeout(connect=None, read=None, total=None)
Traceback (most recent call last):
File "/usr/lib/python3.6/site-packages/requests/packages/urllib3/util/timeout.py", line 126, in _validate_timeout
float(value)
TypeError: float() argument must be a string or a number, not 'Timeout'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/bin/docker-compose", line 11, in <module>
load_entry_point('docker-compose==1.15.0', 'console_scripts', 'docker-compose')()
File "/usr/lib/python3.6/site-packages/compose/cli/main.py", line 68, in main
command()
File "/usr/lib/python3.6/site-packages/compose/cli/main.py", line 118, in perform_command
handler(command, command_options)
File "/usr/lib/python3.6/site-packages/compose/cli/main.py", line 239, in build
build_args=build_args)
File "/usr/lib/python3.6/site-packages/compose/project.py", line 340, in build
service.build(no_cache, pull, force_rm, build_args)
File "/usr/lib/python3.6/site-packages/compose/service.py", line 910, in build
network_mode=build_opts.get('network', None),
File "/usr/lib/python3.6/site-packages/docker/api/build.py", line 235, in build
timeout=timeout,
File "/usr/lib/python3.6/site-packages/docker/utils/decorators.py", line 46, in inner
return f(self, *args, **kwargs)
File "/usr/lib/python3.6/site-packages/docker/api/client.py", line 185, in _post
return self.post(url, **self._set_request_timeout(kwargs))
File "/usr/lib/python3.6/site-packages/requests/sessions.py", line 555, in post
return self.request('POST', url, data=data, json=json, **kwargs)
File "/usr/lib/python3.6/site-packages/requests/sessions.py", line 508, in request
resp = self.send(prep, **send_kwargs)
File "/usr/lib/python3.6/site-packages/requests/sessions.py", line 618, in send
r = adapter.send(request, **kwargs)
File "/usr/lib/python3.6/site-packages/requests/adapters.py", line 440, in send
timeout=timeout
File "/usr/lib/python3.6/site-packages/requests/packages/urllib3/connectionpool.py", line 582, in urlopen
timeout_obj = self._get_timeout(timeout)
File "/usr/lib/python3.6/site-packages/requests/packages/urllib3/connectionpool.py", line 309, in _get_timeout
return Timeout.from_float(timeout)
File "/usr/lib/python3.6/site-packages/requests/packages/urllib3/util/timeout.py", line 156, in from_float
return Timeout(read=timeout, connect=timeout)
File "/usr/lib/python3.6/site-packages/requests/packages/urllib3/util/timeout.py", line 97, in __init__
self._connect = self._validate_timeout(connect, 'connect')
File "/usr/lib/python3.6/site-packages/requests/packages/urllib3/util/timeout.py", line 129, in _validate_timeout
"int or float." % (name, value))
ValueError: Timeout value connect was Timeout(connect=None, read=None, total=None), but it must be an int or float.
```
## Reproduction Steps
```python
@classmethod
def _validate_timeout(cls, value, name):
""" Check that a timeout attribute is valid.
:param value: The timeout value to validate
:param name: The name of the timeout attribute to validate. This is
used to specify in error messages.
:return: The validated and casted version of the given value.
:raises ValueError: If the type is not an integer or a float, or if it
is a numeric value less than zero.
"""
if value is _Default:
return cls.DEFAULT_TIMEOUT
if value is None or value is cls.DEFAULT_TIMEOUT:
return value
""" Value = 60 in this case
"""
try:
float(value)
except (TypeError, ValueError):
raise ValueError("Timeout value %s was %s, but it must be an "
"int or float." % (name, value))
try:
if value < 0:
raise ValueError("Attempted to set %s timeout to %s, but the "
"timeout cannot be set to a value less "
"than 0." % (name, value))
except TypeError: # Python 3
raise ValueError("Timeout value %s was %s, but it must be an "
"int or float." % (name, value))
return value
```
## System Information
$ python -m requests.help
```
{
"chardet": {
"version": "3.0.4"
},
"cryptography": {
"version": ""
},
"idna": {
"version": ""
},
"implementation": {
"name": "CPython",
"version": "3.6.2"
},
"platform": {
"release": "4.12.4-1-ARCH",
"system": "Linux"
},
"pyOpenSSL": {
"openssl_version": "",
"version": null
},
"requests": {
"version": "2.18.3"
},
"system_ssl": {
"version": "1010006f"
},
"urllib3": {
"version": "1.22"
},
"using_pyopenssl": false
}
```
I'm on Antergos Archlinux.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4",
"events_url": "https://api.github.com/users/Lukasa/events{/privacy}",
"followers_url": "https://api.github.com/users/Lukasa/followers",
"following_url": "https://api.github.com/users/Lukasa/following{/other_user}",
"gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Lukasa",
"id": 1382556,
"login": "Lukasa",
"node_id": "MDQ6VXNlcjEzODI1NTY=",
"organizations_url": "https://api.github.com/users/Lukasa/orgs",
"received_events_url": "https://api.github.com/users/Lukasa/received_events",
"repos_url": "https://api.github.com/users/Lukasa/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Lukasa",
"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/4219/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4219/timeline
| null |
completed
| null | null | false |
[
"Where did you get your Requests from? It looks like you have multiple copies of Requests on your system, because you're apparently using 2.18.3, but are looking at a vendored copy of urllib3 (which we got rid of in 2.17).\r\n\r\nI recommend creating a clean installation and try again. "
] |
https://api.github.com/repos/psf/requests/issues/4218
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4218/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4218/comments
|
https://api.github.com/repos/psf/requests/issues/4218/events
|
https://github.com/psf/requests/issues/4218
| 248,155,180 |
MDU6SXNzdWUyNDgxNTUxODA=
| 4,218 |
File name encoding cannot be set when uploading files
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/11145391?v=4",
"events_url": "https://api.github.com/users/fym0121/events{/privacy}",
"followers_url": "https://api.github.com/users/fym0121/followers",
"following_url": "https://api.github.com/users/fym0121/following{/other_user}",
"gists_url": "https://api.github.com/users/fym0121/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/fym0121",
"id": 11145391,
"login": "fym0121",
"node_id": "MDQ6VXNlcjExMTQ1Mzkx",
"organizations_url": "https://api.github.com/users/fym0121/orgs",
"received_events_url": "https://api.github.com/users/fym0121/received_events",
"repos_url": "https://api.github.com/users/fym0121/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/fym0121/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/fym0121/subscriptions",
"type": "User",
"url": "https://api.github.com/users/fym0121",
"user_view_type": "public"
}
|
[] |
closed
| false | null |
[] |
{
"closed_at": null,
"closed_issues": 29,
"created_at": "2024-05-19T18:29:04Z",
"creator": {
"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"
},
"description": "",
"due_on": null,
"html_url": "https://github.com/psf/requests/milestone/34",
"id": 11073254,
"labels_url": "https://api.github.com/repos/psf/requests/milestones/34/labels",
"node_id": "MI_kwDOABTKOs4AqPbm",
"number": 34,
"open_issues": 0,
"state": "open",
"title": "Bankruptcy",
"updated_at": "2024-05-20T14:37:16Z",
"url": "https://api.github.com/repos/psf/requests/milestones/34"
}
| 6 |
2017-08-05T03:39:00Z
|
2024-05-20T14:36:52Z
|
2024-05-20T14:36:51Z
|
NONE
| null |
Summary.
The server code is windows-1251, and the program file code is UTF-8. When I upload the file, the file name obtained by the server is garbled. File name cannot be encoded as windows-1251, otherwise an exception will be thrown.
## Expected Result
the file name obtained by the server is normal
## Actual Result
the file name obtained by the server is garbled.
## Reproduction Steps
```python
# Server can receive fym_Пуск
data["RETURN"] = 'fym_Пуск'.encode('windows-1251')
# Server can not receive fym_Пуск.pdf.
f = {'FILE_LNK': ('fym_Пуск.pdf', #'fym_Пуск.pdf'.encode('windows-1251') will raise exception
open('fym_Пуск.pdf', 'rb'),
'application/pdf')
}
r = self.session.post(url, files=f, data=data)
```
## System Information
$ python -m requests.help
```
{
"chardet": {
"version": "3.0.4"
},
"cryptography": {
"version": ""
},
"implementation": {
"name": "CPython",
"version": "3.6.1"
},
"platform": {
"release": "7",
"system": "Windows"
},
"pyOpenSSL": {
"openssl_version": "",
"version": null
},
"requests": {
"version": "2.18.1"
},
"system_ssl": {
"version": "100020bf"
},
"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).
|
{
"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/4218/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4218/timeline
| null |
completed
| null | null | false |
[
"Can you please provide me with the full traceback that occurs when you encode with cp1251?",
"```\r\nTraceback (most recent call last):\r\n File \"C:\\Users\\Administrator\\vso_python\\vso.py\", line 453, in <module>\r\n v.upload_pdf('169519', u'fym_Пуск.pdf')\r\n File \"C:\\Users\\Administrator\\vso_python\\vso.py\", line 267, in upload_pdf\r\n r = self.session.post(url, files=f, data=data)\r\n File \"D:\\Program Files\\python\\lib\\site-packages\\requests\\sessions.py\", line 549, in post\r\n return self.request('POST', url, data=data, json=json, **kwargs)\r\n File \"D:\\Program Files\\python\\lib\\site-packages\\requests\\sessions.py\", line 488, in request\r\n prep = self.prepare_request(req)\r\n File \"D:\\Program Files\\python\\lib\\site-packages\\requests\\sessions.py\", line 431, in prepare_request\r\n hooks=merge_hooks(request.hooks, self.hooks),\r\n File \"D:\\Program Files\\python\\lib\\site-packages\\requests\\models.py\", line 310, in prepare\r\n self.prepare_body(data, files, json)\r\n File \"D:\\Program Files\\python\\lib\\site-packages\\requests\\models.py\", line 498, in prepare_body\r\n (body, content_type) = self._encode_files(files, data)\r\n File \"D:\\Program Files\\python\\lib\\site-packages\\requests\\models.py\", line 164, in _encode_files\r\n rf.make_multipart(content_type=ft)\r\n File \"D:\\Program Files\\python\\lib\\site-packages\\urllib3\\fields.py\", line 174, in make_multipart\r\n (('name', self._name), ('filename', self._filename))\r\n File \"D:\\Program Files\\python\\lib\\site-packages\\urllib3\\fields.py\", line 134, in _render_parts\r\n parts.append(self._render_part(name, value))\r\n File \"D:\\Program Files\\python\\lib\\site-packages\\urllib3\\fields.py\", line 114, in _render_part\r\n return format_header_param(name, value)\r\n File \"D:\\Program Files\\python\\lib\\site-packages\\urllib3\\fields.py\", line 35, in format_header_param\r\n if not any(ch in value for ch in '\"\\\\\\r\\n'):\r\n File \"D:\\Program Files\\python\\lib\\site-packages\\urllib3\\fields.py\", line 35, in <genexpr>\r\n if not any(ch in value for ch in '\"\\\\\\r\\n'):\r\nTypeError: a bytes-like object is required, not 'str'\r\n[Finished in 37.1s with exit code 1]\r\n[shell_cmd: python -u \"C:\\Users\\Administrator\\vso_python\\vso.py\"]\r\n[dir: C:\\Users\\Administrator\\vso_python]\r\n[path: C:\\Users\\Public\\PTGo\\Program\\;C:\\Program Files (x86)\\RSA SecurID Token Common;C:\\Program Files (x86)\\AMD APP\\bin\\x86_64;C:\\Program Files (x86)\\AMD APP\\bin\\x86;C:\\Windows\\system32;C:\\Windows;C:\\Windows\\System32\\Wbem;C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\;C:\\Program Files (x86)\\ATI Technologies\\ATI.ACE\\Core-Static;D:\\Program Files (x86)\\php-7.1.4-Win32-VC14-x64;D:\\Program Files\\Sublime Text 3;D:\\Program Files\\nodejs\\;D:\\Program Files\\python\\Scripts\\;D:\\Program Files\\python\\;C:\\Users\\Administrator\\AppData\\Roaming\\npm;D:\\Program Files\\python\\Scripts]\r\n```\r\n\r\nI read the code, and Requests calls urllib3, but urllib3 seems to accept only STR, not bytes. If I pass the string in, it will encode the filename with UTF-8, but my server doesn't recognize the code. So I don't think it's a bug. I would be happy if I could encode my own file name",
"Hrm. The server really should recognise it. However, urllib3 should also allow you to provide your own bytes, so I think you should raise this as a urllib3 bug.",
"I've spent some time with this (related #2117, #2217), where I needed to post utf-8 encoded filename to a confluence server. The issue being that confluence does not recognise the `filename*=` and throws a `500 Internal Server Error`.\r\n\r\nI found the solution in [RFC2047](https://tools.ietf.org/html/rfc2047), by encoding the filename to only ascii printables, and thus sending it in the old standard `filename=` header, it works. :D\r\n\r\npython code to encoding unicode filename to such a string:\r\n```\r\nimport base64\r\n# https://tools.ietf.org/html/rfc2047\r\ndef rfc2047_encode(s):\r\n # make a point of returning a string here!\r\n return str('=?utf-8?B?{}?='.format(base64.b64encode(s.encode('utf-8'))))\r\n```\r\n\r\nWould be nice if this could somehow be provided as a feature in requests (that is, an option wether to use `filename*=` or encode according to the above and stick with `filename=`.\r\n",
"> Summary.\r\n> \r\n> The server code is windows-1251, and the program file code is UTF-8. When I upload the file, the file name obtained by the server is garbled. File name cannot be encoded as windows-1251, otherwise an exception will be thrown.\r\n> \r\n> ## Expected Result\r\n> the file name obtained by the server is normal\r\n> \r\n> ## Actual Result\r\n> the file name obtained by the server is garbled.\r\n> \r\n> ## Reproduction Steps\r\n> ```python\r\n> # Server can receive fym_Пуск\r\n> data[\"RETURN\"] = 'fym_Пуск'.encode('windows-1251')\r\n> \r\n> # Server can not receive fym_Пуск.pdf. \r\n> f = {'FILE_LNK': ('fym_Пуск.pdf', #'fym_Пуск.pdf'.encode('windows-1251') will raise exception\r\n> open('fym_Пуск.pdf', 'rb'),\r\n> 'application/pdf')\r\n> \r\n> }\r\n> \r\n> r = self.session.post(url, files=f, data=data)\r\n> ```\r\n> \r\n> ## System Information\r\n> ```\r\n> $ python -m requests.help\r\n> ```\r\n> \r\n> ```\r\n> {\r\n> \"chardet\": {\r\n> \"version\": \"3.0.4\"\r\n> },\r\n> \"cryptography\": {\r\n> \"version\": \"\"\r\n> },\r\n> \"implementation\": {\r\n> \"name\": \"CPython\",\r\n> \"version\": \"3.6.1\"\r\n> },\r\n> \"platform\": {\r\n> \"release\": \"7\",\r\n> \"system\": \"Windows\"\r\n> },\r\n> \"pyOpenSSL\": {\r\n> \"openssl_version\": \"\",\r\n> \"version\": null\r\n> },\r\n> \"requests\": {\r\n> \"version\": \"2.18.1\"\r\n> },\r\n> \"system_ssl\": {\r\n> \"version\": \"100020bf\"\r\n> },\r\n> \"urllib3\": {\r\n> \"version\": \"1.21.1\"\r\n> },\r\n> \"using_pyopenssl\": false\r\n> }\r\n> ```\r\n> \r\n> This command is only available on Requests v2.16.4 and greater. Otherwise,\r\n> please provide some basic information about your system (Python version,\r\n> operating system, &c).\r\n\r\nHi. Have you been able to solve this problem? The server I work with also accepts windows-1251 encoding only and when I upload files their names become corrupt. Thanks.",
"In an effort to clean up the issue tracker to only have issues that are still relevant to the project we've done a quick pass and decided this issue may no longer be relevant for a variety of potential reasons, including:\r\n\r\n* Applies to a much older version, unclear whether the issue still applies.\r\n* Change requires a backwards incompatible release and it's unclear if the benefits are worth the migration effort from the community.\r\n* There isn't a clear demand from the community on the change landing in Requests.\r\n\r\nIf you think the issue should remain open, please comment so below or open a new issue and link back to the original issue. Again, thank you for opening the issue and for the discussion, it's much appreciated."
] |
https://api.github.com/repos/psf/requests/issues/4217
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4217/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4217/comments
|
https://api.github.com/repos/psf/requests/issues/4217/events
|
https://github.com/psf/requests/pull/4217
| 247,407,971 |
MDExOlB1bGxSZXF1ZXN0MTMzNzIyNzE5
| 4,217 |
fix typo in changelog
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/59292?v=4",
"events_url": "https://api.github.com/users/nikolas/events{/privacy}",
"followers_url": "https://api.github.com/users/nikolas/followers",
"following_url": "https://api.github.com/users/nikolas/following{/other_user}",
"gists_url": "https://api.github.com/users/nikolas/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/nikolas",
"id": 59292,
"login": "nikolas",
"node_id": "MDQ6VXNlcjU5Mjky",
"organizations_url": "https://api.github.com/users/nikolas/orgs",
"received_events_url": "https://api.github.com/users/nikolas/received_events",
"repos_url": "https://api.github.com/users/nikolas/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/nikolas/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/nikolas/subscriptions",
"type": "User",
"url": "https://api.github.com/users/nikolas",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 1 |
2017-08-02T14:26:47Z
|
2021-09-05T00:07:06Z
|
2017-08-02T14:38:47Z
|
CONTRIBUTOR
|
resolved
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4",
"events_url": "https://api.github.com/users/Lukasa/events{/privacy}",
"followers_url": "https://api.github.com/users/Lukasa/followers",
"following_url": "https://api.github.com/users/Lukasa/following{/other_user}",
"gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Lukasa",
"id": 1382556,
"login": "Lukasa",
"node_id": "MDQ6VXNlcjEzODI1NTY=",
"organizations_url": "https://api.github.com/users/Lukasa/orgs",
"received_events_url": "https://api.github.com/users/Lukasa/received_events",
"repos_url": "https://api.github.com/users/Lukasa/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Lukasa",
"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/4217/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4217/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/4217.diff",
"html_url": "https://github.com/psf/requests/pull/4217",
"merged_at": "2017-08-02T14:38:47Z",
"patch_url": "https://github.com/psf/requests/pull/4217.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/4217"
}
| true |
[
"yay cake for everyone!"
] |
|
https://api.github.com/repos/psf/requests/issues/4216
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4216/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4216/comments
|
https://api.github.com/repos/psf/requests/issues/4216/events
|
https://github.com/psf/requests/issues/4216
| 247,351,498 |
MDU6SXNzdWUyNDczNTE0OTg=
| 4,216 |
multiline header should be supported!
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/524216?v=4",
"events_url": "https://api.github.com/users/dotpot/events{/privacy}",
"followers_url": "https://api.github.com/users/dotpot/followers",
"following_url": "https://api.github.com/users/dotpot/following{/other_user}",
"gists_url": "https://api.github.com/users/dotpot/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/dotpot",
"id": 524216,
"login": "dotpot",
"node_id": "MDQ6VXNlcjUyNDIxNg==",
"organizations_url": "https://api.github.com/users/dotpot/orgs",
"received_events_url": "https://api.github.com/users/dotpot/received_events",
"repos_url": "https://api.github.com/users/dotpot/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/dotpot/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/dotpot/subscriptions",
"type": "User",
"url": "https://api.github.com/users/dotpot",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 1 |
2017-08-02T11:01:09Z
|
2021-09-08T07:00:38Z
|
2017-08-02T11:13:13Z
|
NONE
|
resolved
|
Summary.
2.11 version introduced this change:
- Reject header values that contain leading whitespace or newline characters to
reduce risk of header smuggling.
BUT, as per standard https://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.2 It whould be possible to have multiline headers.
f.ex. I need to attach a certificate via request header (currently I just mock the header validation method).
## Expected Result
support multiline header.
## Actual Result
requests.exceptions.InvalidHeader: Invalid return character or leading space in header: X-CERTIFICATE
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/1382556?v=4",
"events_url": "https://api.github.com/users/Lukasa/events{/privacy}",
"followers_url": "https://api.github.com/users/Lukasa/followers",
"following_url": "https://api.github.com/users/Lukasa/following{/other_user}",
"gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Lukasa",
"id": 1382556,
"login": "Lukasa",
"node_id": "MDQ6VXNlcjEzODI1NTY=",
"organizations_url": "https://api.github.com/users/Lukasa/orgs",
"received_events_url": "https://api.github.com/users/Lukasa/received_events",
"repos_url": "https://api.github.com/users/Lukasa/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Lukasa",
"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/4216/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4216/timeline
| null |
completed
| null | null | false |
[
"Multiline headers *should not* be supported. RFC 2616 is not the HTTP specification anymore: the relevant one is RFC 7230. \r\n\r\n[Here](https://tools.ietf.org/html/rfc7230#section-3.2.4) is the relevant part:\r\n\r\n> Historically, HTTP header field values could be extended over multiple lines by preceding each extra line with at least one space or horizontal tab (obs-fold). This specification deprecates such line folding except within the message/http media type (Section 8.3.1). A sender MUST NOT generate a message that includes line folding (i.e., that has any field-value that contains a match to the obs-fold rule) unless the message is intended for packaging within the message/http media type.\r\n\r\nThere is no plan to add this support. Even if we did, the new line characters are not semantic in the header and get stripped for processing, so they're ill-suited to your use case. You need to come up with a different method of sending that cert. "
] |
https://api.github.com/repos/psf/requests/issues/4215
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4215/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4215/comments
|
https://api.github.com/repos/psf/requests/issues/4215/events
|
https://github.com/psf/requests/issues/4215
| 247,214,166 |
MDU6SXNzdWUyNDcyMTQxNjY=
| 4,215 |
Sending an empty body from a file, with Content-Length: 0 header times out
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/327833?v=4",
"events_url": "https://api.github.com/users/dobesv/events{/privacy}",
"followers_url": "https://api.github.com/users/dobesv/followers",
"following_url": "https://api.github.com/users/dobesv/following{/other_user}",
"gists_url": "https://api.github.com/users/dobesv/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/dobesv",
"id": 327833,
"login": "dobesv",
"node_id": "MDQ6VXNlcjMyNzgzMw==",
"organizations_url": "https://api.github.com/users/dobesv/orgs",
"received_events_url": "https://api.github.com/users/dobesv/received_events",
"repos_url": "https://api.github.com/users/dobesv/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/dobesv/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/dobesv/subscriptions",
"type": "User",
"url": "https://api.github.com/users/dobesv",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 2 |
2017-08-01T21:57:02Z
|
2021-09-08T07:00:38Z
|
2017-08-01T23:03:33Z
|
NONE
|
resolved
|
Sending a POST request with an empty body read from an empty file and a `Content-Length: 0` header times out after a long time instead of doing normal processing.
## Expected Result
Sending an empty body from a file with `Content-Length: 0` should send the request and return a result in a similar amount of time as a non-empty request, or a request without `Content-Length: 0`, or an empty body provided as a string.
For example:
```
$ cat repro2.py
import requests, tempfile
with tempfile.NamedTemporaryFile() as tf:
print requests.Session().send(requests.Request('POST', 'https://www.google.com', data=open(tf.name)).prepare())
$ python repro2.py
<Response [405]>
```
Or using a string body:
```
$ cat repro3.py
import requests, tempfile
print requests.Session().send(requests.Request('POST', 'https://www.google.com', headers={'Content-Length': u'0'}, data='').prepare())
$ python repro3.py
<Response [405]>
```
Or a non-empty file:
```
$ cat repro5.py
import requests, tempfile
with tempfile.NamedTemporaryFile() as tf:
tf.write('x')
tf.flush()
print requests.post('https://www.google.com', headers={'Content-Length': u'0'}, data=open(tf.name))
$ python repro5.py
<Response [405]>
```
## Actual Result
However, with the specific combination of a `Content-Length: 0` header and an empty open file descriptor, the request times out after 4 minutes with an error.
```
$ pip freeze | grep requests
requests==2.18.2
$ cat repro1.py
import requests, tempfile
with tempfile.NamedTemporaryFile() as tf:
requests.Session().send(requests.Request('POST', 'https://www.google.com', headers={'Content-Length': u'0'}, data=open(tf.name)).prepare())
$ time python repro1.py
Traceback (most recent call last):
File "repro1.py", line 4, in <module>
requests.Session().send(requests.Request('POST', 'https://www.google.com', headers={'Content-Length': u'0'}, data=open(tf.name)).prepare())
File "/home/ubuntu/env/lib/python2.7/site-packages/requests/sessions.py", line 612, in send
r = adapter.send(request, **kwargs)
File "/home/ubuntu/env/lib/python2.7/site-packages/requests/adapters.py", line 490, in send
raise ConnectionError(err, request=request)
requests.exceptions.ConnectionError: ('Connection aborted.', BadStatusLine("''",))
real 4m0.480s
user 0m0.296s
sys 0m0.040s
$ cat repro4.py
import requests, tempfile
with tempfile.NamedTemporaryFile() as tf:
print requests.post('https://www.google.com', headers={'Content-Length': u'0'}, data=open(tf.name))
$ time python repro4.py
Traceback (most recent call last):
File "repro4.py", line 4, in <module>
print requests.post('https://www.google.com', headers={'Content-Length': u'0'}, data=open(tf.name))
File "/home/ubuntu/env/lib/python2.7/site-packages/requests/api.py", line 112, in post
return request('post', url, data=data, json=json, **kwargs)
File "/home/ubuntu/env/lib/python2.7/site-packages/requests/api.py", line 58, in request
return session.request(method=method, url=url, **kwargs)
File "/home/ubuntu/env/lib/python2.7/site-packages/requests/sessions.py", line 502, in request
resp = self.send(prep, **send_kwargs)
File "/home/ubuntu/env/lib/python2.7/site-packages/requests/sessions.py", line 612, in send
r = adapter.send(request, **kwargs)
File "/home/ubuntu/env/lib/python2.7/site-packages/requests/adapters.py", line 490, in send
raise ConnectionError(err, request=request)
requests.exceptions.ConnectionError: ('Connection aborted.', BadStatusLine("''",))
real 4m5.474s
user 0m0.288s
sys 0m0.036s
```
## Reproduction Steps
```python
import requests, tempfile
with tempfile.NamedTemporaryFile() as tf:
print requests.post('https://www.google.com', headers={'Content-Length': u'0'}, data=open(tf.name))
```
## System Information
$ python -m requests.help
```
{
"chardet": {
"version": "3.0.4"
},
"cryptography": {
"version": "1.5.2"
},
"implementation": {
"name": "CPython",
"version": "2.7.13"
},
"platform": {
"release": "4.4.0-78-generic",
"system": "Linux"
},
"pyOpenSSL": {
"openssl_version": "1000207f",
"version": "16.1.0"
},
"requests": {
"version": "2.18.2"
},
"system_ssl": {
"version": "1000207f"
},
"urllib3": {
"version": "1.22"
},
"using_pyopenssl": true
}
```
## Workaround
Check if the file is empty before sending and, if it is, substitute the file descriptor for an empty string.
|
{
"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/4215/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4215/timeline
| null |
completed
| null | null | false |
[
"Hey @dobesv, this is a known bug in the 2.x versions of requests and was originally recorded in #3066. We have a patch submitted (#3897) and merged into the 3.0.0 branch which will address this.\r\n\r\nFor the time being, Requests should be capable of determining the required headers in it's current state. If you don't manually pass a `Content-Length` header for empty files, you should find that this is a non-issue unless your endpoint is incapable of handling `Transfer-Encoding: chunked`. I'm going to close this out as a duplicate and the issue will be resolved in a future release. Please let us know if you have any further questions or comments. Thanks!",
"@nateprewitt Thanks, sounds great. Sorry I didn't find the other issue in the first place."
] |
https://api.github.com/repos/psf/requests/issues/4214
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4214/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4214/comments
|
https://api.github.com/repos/psf/requests/issues/4214/events
|
https://github.com/psf/requests/issues/4214
| 247,004,428 |
MDU6SXNzdWUyNDcwMDQ0Mjg=
| 4,214 |
Returning cookies from Adapters
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/6284?v=4",
"events_url": "https://api.github.com/users/Singletoned/events{/privacy}",
"followers_url": "https://api.github.com/users/Singletoned/followers",
"following_url": "https://api.github.com/users/Singletoned/following{/other_user}",
"gists_url": "https://api.github.com/users/Singletoned/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Singletoned",
"id": 6284,
"login": "Singletoned",
"node_id": "MDQ6VXNlcjYyODQ=",
"organizations_url": "https://api.github.com/users/Singletoned/orgs",
"received_events_url": "https://api.github.com/users/Singletoned/received_events",
"repos_url": "https://api.github.com/users/Singletoned/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Singletoned/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Singletoned/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Singletoned",
"user_view_type": "public"
}
|
[] |
open
| false | null |
[] | null | 7 |
2017-08-01T09:12:47Z
|
2017-09-05T13:52:49Z
| null |
NONE
| null |
I've been trying to create a subclass of `BaseAdapter` for Requests that supports WSGI applications, (preferably based on the requests-wsgi-adapter package, or from scratch if need be).
The sticking point has been cookies and session handling. From reading the Requests code, my understanding is that cookies are automatically extracted from the reponse object returned from the adapter's `send` method. In order for the cookies to be automatically extracted the response needs to have a `r.raw._original_response.msg` chain of attributes and this should return an object with an `info` method that should return an `email.message.Message` instance (largely because of `cookies.py:extract_cookies_to_jar`, but also because of how `http.cookiejar` behaves).
This seems like a needlessly complicated series of steps to go through, particularly as I'm not currently clear on how to correctly convert my response body to an `email.message.Message` (and a quick scan of the Python documentation makes this look non-trivial).
Have I misunderstood? Are there any helper functions for performing these steps?
Would you consider a patch to `extract_cookies_to_jar` that also looks, for example, for a `_cookies_dict` property on the response, at the point that it currently silently returns if there is no `_original_response` attribute?
Alternatively, would you consider supporting something like https://pypi.python.org/pypi/cookies/ with a friendlier interface (kind of "Requests for cookies")? I haven't dug into it a lot, but it looks relatively easy to add optional support for it (which I'd be happy to contribute).
| 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/4214/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4214/timeline
| null | null | null | null | false |
[
"> Have I misunderstood? Are there any helper functions for performing these steps?\r\n\r\nYou have not: there are no helper functions for performing these steps.\r\n\r\n> Alternatively, would you consider supporting something like https://pypi.python.org/pypi/cookies/ with a friendlier interface (kind of \"Requests for cookies\")?\r\n\r\nNope. =) Note the README on that project:\r\n\r\n> This doesn’t compete with the cookielib (http.cookiejar) module in the Python standard library, which is specifically for implementing cookie storage and similar behavior in an HTTP client such as a browser. Things cookielib does that this doesn’t:\r\n>\r\n> - Write to or read from browsers’ cookie stores or other proprietary formats for storing cookie data in files\r\n> - Handle the browser/client logic like deciding which cookies to send or discard, etc.\r\n\r\n`cookies` is not an appropriate replacement for `cookielib`. We need to continue to use `cookielib` for the moment.\r\n> Would you consider a patch to `extract_cookies_to_jar` that also looks, for example, for a `_cookies_dict` property on the response, at the point that it currently silently returns if there is no `_original_response` attribute?\r\n\r\nI am disinclined to do that. Generally speaking I don't think this is a common concern. Additionally, the surface area you actually need here is low. Your `Message` instance actually just needs to be an object with a few methods: `get_all`, and `getheaders`. That's it: everything else should be covered by the shim code. I think the two methods can even have the same implementation, and that in your case `getheaders` may be optional.\r\n\r\nSo I don't think this is completely unreasonable to work with, and given that it's very uncommonly needed the overhead of having an alternative escape method is probably not worthwhile.",
"@Singletoned thank you for doing this! WSGI app mounting is exactly one of the use cases I had in mind when designing the ConnectionAdapter interface — I've been waiting for someone to do this :)\r\n\r\n✨🍰✨",
"@Lukasa\r\n\r\n> cookies is not an appropriate replacement for cookielib. We need to continue to use cookielib for the moment.\r\n\r\nI'm not suggesting that you replace `cookielib` with `cookies`, I'm suggesting that `cookies` would be a nicer thing to return attached to a response from an adapter than `email.message.Message`. I've already wasted a day looking into this, and my experience of looking at the `cookielib` code makes me reluctant to get involved with it any further. It appears to be legacy code that will involve needless pain to interface with, that will be very hard to debug when strange things happen. All this just to pass a single header.\r\n\r\n> given that it's very uncommonly needed the overhead of having an alternative escape method is probably not worthwhile.\r\n\r\nThe reason it is uncommonly needed is because no one is creating adapters. If the interface between adapters and sessions is deeply entwined with urllib/cookielib, then that could discourage people from creating adapters.\r\n\r\nAt some point an interface between adapters and sessions will have to be designed (it can't always be based on urllib/cookielib). I'd prefer it if it was sooner rather than later. If you can agree on a design, I'd be willing to implement it.\r\n\r\n@kennethreitz Thanks but @seanbrant did most of the work already on https://github.com/seanbrant/requests-wsgi-adapter. I'm just hoping to stand on his shoulders, and get it working with sessions (or rewrite it if need be). I want to be able to replace some code using Requests to test a legacy website with some that tests a new WSGI app. I've also been playing with creating a web testing library that's based on Requests, but returns custom responses with helpers for filling in forms, using css selectors, etc.\r\n\r\nI really like the idea of the adapters and the ability to mount them on particular addresses. I can see it being useful in a surprising variety of ways. It also ties in nicely (for me) with the ability to hook into response creation.",
"> I'm not suggesting that you replace cookielib with cookies, I'm suggesting that cookies would be a nicer thing to return attached to a response from an adapter than email.message.Message. \r\n\r\nAh, sorry, I misunderstood. If we're redesigning this interface and adding code to Requests to shim from format x to `cookielib` there is no reason to invoke a third party library at all: we should just look straight at the header. We already have the headers, no reason to beat around the bush with an extra dependency. \r\n\r\n> The reason it is uncommonly needed is because no one is creating adapters.\r\n\r\nSure they are. I have done it myself several times. And I have [tackled this problem](https://github.com/Lukasa/hyper/blob/development/hyper/contrib.py#L173). It's not intractable at all: the interface is really as small as I suggested it was. \r\n\r\nHowever, I agree that we could bear to formalise this interface more strongly. The primary reason it takes the form that it does is that Requests throws away some key data about the header: namely, it joins them with commas, which does not work well with cookie handling. So we will need *a* formal interface that we can use, and we will need to map urllib3's responses through that interface. \r\n\r\nThe design wouldn't need to be very complex: just an object that takes a header iterable and implements the two needed methods. Hell, you could lift the one I linked above from hyper, change its name, and use that. That would probably be my initial suggestion. ",
"@frostming's solution works fine for me (following your suggestion). If you guys are open to it, I (or @frostming) could make a small utility to put in the adapters code that generates the relevant stub. At the very least it should be documented somewhere so that other people don't have to go through the same chain of exploration.",
"@Singletoned What's the proposed patch for `adapters.py`? I'd be open to seeing what it looks like. Failing that I'd be happy to review a documentation patch for the `Transport Adapters` section of the documentation.",
"Having looked through the code while working on my own [WSGI adapter project](https://github.com/the-allanc/pyriform), it makes me wonder why we don't just use urllib3's HTTPHeaderDict directly from the urllib3 response object. I'm guessing that's there's an [API difference](https://github.com/shazow/urllib3/issues/670) which means that we can't plug it directly in.\r\n\r\nIf requests had its own `HTTPHeaderDict` which is inspired by the `urllib3` version, but is compatible with `CaseInsensitiveDict` - would that make things much easier? If so, then I might play with that a little later - adding some methods (maybe just `add` and `getlist`) would do the job."
] |
https://api.github.com/repos/psf/requests/issues/4213
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4213/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4213/comments
|
https://api.github.com/repos/psf/requests/issues/4213/events
|
https://github.com/psf/requests/issues/4213
| 246,877,626 |
MDU6SXNzdWUyNDY4Nzc2MjY=
| 4,213 |
Incorrect default value of Session attributes in documentation
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1050156?v=4",
"events_url": "https://api.github.com/users/lmazuel/events{/privacy}",
"followers_url": "https://api.github.com/users/lmazuel/followers",
"following_url": "https://api.github.com/users/lmazuel/following{/other_user}",
"gists_url": "https://api.github.com/users/lmazuel/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/lmazuel",
"id": 1050156,
"login": "lmazuel",
"node_id": "MDQ6VXNlcjEwNTAxNTY=",
"organizations_url": "https://api.github.com/users/lmazuel/orgs",
"received_events_url": "https://api.github.com/users/lmazuel/received_events",
"repos_url": "https://api.github.com/users/lmazuel/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/lmazuel/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/lmazuel/subscriptions",
"type": "User",
"url": "https://api.github.com/users/lmazuel",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 2 |
2017-07-31T20:41:42Z
|
2022-02-26T04:00:38Z
|
2021-11-28T03:06:36Z
|
NONE
|
resolved
|
See for instance `trust_env`, that is `True` by default, but `None` in the documentation:
http://docs.python-requests.org/en/latest/api/#requests.Session.trust_env
In that case, True/None are opposite, and I understood my own issue only after looking at the code :/
Same for all attributes actually, that are all `None` in doc.
I totally get that it's complicated for sphinx to generate instance attribute (since the value is assigned from inside `__init__`), but at least would be nice to have like `max_redirects` the default value in the docstring:

I could probably try to PR some of these strings if it helps and if you confirm the "This defaults to XXXX" pattern in the docstring.
Thanks! :-)
|
{
"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/4213/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4213/timeline
| null |
completed
| null | null | false |
[
"Hrm, Sphinx autodoc should be getting those rights they're very simple. Rather than change the text, which will end up out of sync with the code, it may be worth digging in to why Sphinx is failing to detect this. ",
"Defaults are no longer displayed in the documentation, closing this issue."
] |
https://api.github.com/repos/psf/requests/issues/4212
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4212/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4212/comments
|
https://api.github.com/repos/psf/requests/issues/4212/events
|
https://github.com/psf/requests/issues/4212
| 246,643,771 |
MDU6SXNzdWUyNDY2NDM3NzE=
| 4,212 |
ECONNRESET error after upgrading packages
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/19325732?v=4",
"events_url": "https://api.github.com/users/sugiantolauw/events{/privacy}",
"followers_url": "https://api.github.com/users/sugiantolauw/followers",
"following_url": "https://api.github.com/users/sugiantolauw/following{/other_user}",
"gists_url": "https://api.github.com/users/sugiantolauw/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/sugiantolauw",
"id": 19325732,
"login": "sugiantolauw",
"node_id": "MDQ6VXNlcjE5MzI1NzMy",
"organizations_url": "https://api.github.com/users/sugiantolauw/orgs",
"received_events_url": "https://api.github.com/users/sugiantolauw/received_events",
"repos_url": "https://api.github.com/users/sugiantolauw/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/sugiantolauw/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/sugiantolauw/subscriptions",
"type": "User",
"url": "https://api.github.com/users/sugiantolauw",
"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"
}
] |
closed
| true | null |
[] | null | 8 |
2017-07-31T04:48:51Z
|
2021-09-08T01:21:06Z
|
2018-08-04T12:30:57Z
|
NONE
|
resolved
|
Summary:
Hi Team,
Hope you are well.
I am having an issue with OpenSSL which I didnt experience before.
I am running a Python script that extracts data from a DMP's API (https://www.lotame.com/). The script has been working for a month now and I was able to extract data properly for over a month now.
## Expected Result
`affinities_table begun, current row length = 39
id 158260 added, current row length = 69
id 153226 added, current row length = 194
id 153237 added, current row length = 446
id 153235 added, current row length = 879
id 159852 added, current row length = 1696
id 153232 added, current row length = 1969
id 153225 added, current row length = 2483
id 153230 added, current row length = 2722
id 151975 added, current row length = 3015
id 153701 added, current row length = 3415
id 153697 added, current row length = 3781
id 151977 added, current row length = 4134
id 153700 added, current row length = 4418
id 153698 added, current row length = 5068
id 153699 added, current row length = 5467
id 153705 added, current row length = 7487
id 161726 added, current row length = 7508
id 172973 added, current row length = 8004
id 153993 added, current row length = 8029
id 153994 added, current row length = 8084
id 153996 added, current row length = 8215
id 153995 added, current row length = 8337
id 168763 added, current row length = 8628
id 168762 added, current row length = 8919
id 153236 added, current row length = 9044
id 151980 added, current row length = 9279
id 153228 added, current row length = 9562
id 153229 added, current row length = 9745
id 179586 added, current row length = 9804
id 196979 added, current row length = 9829
id 175403 added, current row length = 10481
id 190349 added, current row length = 11116
id 192283 added, current row length = 12044
id 192282 added, current row length = 12395
id 197643 added, current row length = 13304
id 197645 added, current row length = 14860
id 197646 added, current row length = 14861
id 197647 added, current row length = 16526
id 197649 added, current row length = 18267
id 197651 added, current row length = 20337
id 197653 added, current row length = 22180
id 197655 added, current row length = 24275
`
## Actual Result
But when I upgrade requests, pyopenssl, and other packagesI received below error:
```
affinities_table begun, current row length = 39
Traceback (most recent call last):
tbl = audience_affinities(config_filepath, date_today)
File "/home/slauw/Lotame_test/lotame_api_optimized.py", line 457, in audience_affinities
aud_affinities = single_audience_affinities(config_filepath, i, date_today)
File "/home/slauw/Lotame_test/lotame_api_optimized.py", line 389, in single_audience_affinities
raise SSLError(e, request=request)
requests.exceptions.SSLError: ("bad handshake: SysCallError(104, 'ECONNRESET')",)
Traceback (most recent call last):
KeyError: 'location'
affinities_table begun, current row length = 39
Running audaffinities job
affinities_table begun, current row length = 39
Traceback (most recent call last):
tbl = audience_affinities(config_filepath, date_today)
File "/home/slauw/Lotame_test/lotame_api_optimized.py", line 460, in audience_affinities
aud_affinities = single_audience_affinities(config_filepath, i, date_today)
File "/home/slauw/Lotame_test/lotame_api_optimized.py", line 392, in single_audience_affinities
raise SSLError(e, request=request)
requests.exceptions.SSLError: ("bad handshake: SysCallError(-1, 'Unexpected EOF')",)
affinities_table begun, current row length = 39
```
Now, I also ran the command to update all of my python packages.
## Reproduction Steps
```python
import requests
```
## System Information
$ python -m requests.help
```
{
"chardet": {
"version": "3.0.4"
},
"cryptography": {
"version": "2.0"
},
"implementation": {
"name": "CPython",
"version": "2.7.13"
},
"platform": {
"release": "2.6.32-431.29.2.el6.x86_64",
"system": "Linux"
},
"pyOpenSSL": {
"openssl_version": "1010006f",
"version": "17.2.0"
},
"requests": {
"version": "2.14.2"
},
"system_ssl": {
"version": "100020cf"
},
"urllib3": {
"version": "1.22"
},
"using_pyopenssl": true
}
```
Also, more information:
- Python version 2.7.13
- Operating system: CentOS release 6.5 (final)
Let me know if you need more information.
Cheers,
Sugi
|
{
"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/4212/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4212/timeline
| null |
completed
| null | null | false |
[
"Thanks for this issue! Did you also upgrade `cryptography`? Can you try downgrading `cryptography` to version 1.9 and see if the problem reproduces?",
"hahahha, happy to be of help.\r\n\r\nYes, I did as I also upgrade all of my Python packages.\r\n\r\nWill try to run this with downgraded cryptography version 1.9 and get back to you on this.\r\n",
"Hi @Lukasa,\r\n\r\nI tried running it with cryptography version 1.9 and I got a different error:\r\n\r\n```\r\nTraceback (most recent call last):\r\n tbl = audience_sites(config_filepath, date_today)\r\n File \"/home/slauw/Lotame_test/lotame_api_optimized.py\", line 237, in audience_sites\r\n aud_sites = single_audience_sites(config_filepath, i, date_today)\r\n File \"/home/slauw/Lotame_test/lotame_api_optimized.py\", line 204, in single_audience_sites\r\n raise ChunkedEncodingError(e)\r\nrequests.exceptions.ChunkedEncodingError: ('Connection broken: IncompleteRead(0 bytes read)', IncompleteRead(0 bytes read))\r\nRunning audaffinities job\r\naffinities_table begun, current row length = 39\r\n```\r\n",
"Interesting. That error is a misbehaviour in the server, not correctly terminating a chunk-encoded body. Have you encountered this error before?",
"@Lukasa Yes, i did when I was testing my script to extract data from the website's API.\r\n\r\nBut I have been running this script for over a month without any issue until I upgraded all of my Python packages....",
"Hrm, interesting. Can you print the headers of each response and show me the ones for the response that triggers that exception?",
"Hi @Lukasa,\r\n\r\nHm, this is weird. \r\n\r\nI was expecting an error happening but it seems like its working properly this time. In saying that though, there is still chance that it will return error from time to time.\r\n\r\nLet me do more testing on this and I will grab the response headers when it returns an error.",
"No further information provided to help reproduce. Closing until that is provided."
] |
https://api.github.com/repos/psf/requests/issues/4211
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4211/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4211/comments
|
https://api.github.com/repos/psf/requests/issues/4211/events
|
https://github.com/psf/requests/issues/4211
| 246,581,160 |
MDU6SXNzdWUyNDY1ODExNjA=
| 4,211 |
SSLError has been changed to ConnectionError in requests 2.18.2?
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1055747?v=4",
"events_url": "https://api.github.com/users/5j9/events{/privacy}",
"followers_url": "https://api.github.com/users/5j9/followers",
"following_url": "https://api.github.com/users/5j9/following{/other_user}",
"gists_url": "https://api.github.com/users/5j9/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/5j9",
"id": 1055747,
"login": "5j9",
"node_id": "MDQ6VXNlcjEwNTU3NDc=",
"organizations_url": "https://api.github.com/users/5j9/orgs",
"received_events_url": "https://api.github.com/users/5j9/received_events",
"repos_url": "https://api.github.com/users/5j9/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/5j9/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/5j9/subscriptions",
"type": "User",
"url": "https://api.github.com/users/5j9",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 2 |
2017-07-30T12:33:00Z
|
2021-09-08T07:00:40Z
|
2017-07-30T12:45:54Z
|
NONE
|
resolved
|
In requests-2.18.1 and earlier:
`requests.get('https://testssl-expire-r2i2.disig.sk/index.en.html')`
Used to raise `SSLError: ("bad handshake: Error([('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')],)",)`
But as of requests-2.18.2 (the latest version), the same URL is returning `ConnectionError: HTTPSConnectionPool(host='testssl-expire-r2i2.disig.sk', port=443): Max retries exceeded with url: /index.en.html (Caused by SSLError(SSLError("bad handshake: Error([('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')],)",),))`
I just need a confirmation that this change is intentional and if it is going to remain so (or not).
Thanks.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4",
"events_url": "https://api.github.com/users/Lukasa/events{/privacy}",
"followers_url": "https://api.github.com/users/Lukasa/followers",
"following_url": "https://api.github.com/users/Lukasa/following{/other_user}",
"gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Lukasa",
"id": 1382556,
"login": "Lukasa",
"node_id": "MDQ6VXNlcjEzODI1NTY=",
"organizations_url": "https://api.github.com/users/Lukasa/orgs",
"received_events_url": "https://api.github.com/users/Lukasa/received_events",
"repos_url": "https://api.github.com/users/Lukasa/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Lukasa",
"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/4211/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4211/timeline
| null |
completed
| null | null | false |
[
"Thanks for this! This is a duplicate of #4902, so I'll refer you to that issue. ",
"Sorry, I meant #4209."
] |
https://api.github.com/repos/psf/requests/issues/4210
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4210/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4210/comments
|
https://api.github.com/repos/psf/requests/issues/4210/events
|
https://github.com/psf/requests/pull/4210
| 246,515,706 |
MDExOlB1bGxSZXF1ZXN0MTMzMDg5NTE2
| 4,210 |
Make sure we raise SSLError.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4",
"events_url": "https://api.github.com/users/Lukasa/events{/privacy}",
"followers_url": "https://api.github.com/users/Lukasa/followers",
"following_url": "https://api.github.com/users/Lukasa/following{/other_user}",
"gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Lukasa",
"id": 1382556,
"login": "Lukasa",
"node_id": "MDQ6VXNlcjEzODI1NTY=",
"organizations_url": "https://api.github.com/users/Lukasa/orgs",
"received_events_url": "https://api.github.com/users/Lukasa/received_events",
"repos_url": "https://api.github.com/users/Lukasa/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Lukasa",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 1 |
2017-07-29T11:15:18Z
|
2021-09-05T00:07:07Z
|
2017-07-29T11:27:18Z
|
MEMBER
|
resolved
|
Resolves #4209.
|
{
"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/4210/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4210/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/4210.diff",
"html_url": "https://github.com/psf/requests/pull/4210",
"merged_at": "2017-07-29T11:27:18Z",
"patch_url": "https://github.com/psf/requests/pull/4210.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/4210"
}
| true |
[
"✨ 🎉 ✨ "
] |
https://api.github.com/repos/psf/requests/issues/4209
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4209/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4209/comments
|
https://api.github.com/repos/psf/requests/issues/4209/events
|
https://github.com/psf/requests/issues/4209
| 246,493,653 |
MDU6SXNzdWUyNDY0OTM2NTM=
| 4,209 |
SSLError -> ConnectionError in 2.18.2: intended?
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/950506?v=4",
"events_url": "https://api.github.com/users/simon-weber/events{/privacy}",
"followers_url": "https://api.github.com/users/simon-weber/followers",
"following_url": "https://api.github.com/users/simon-weber/following{/other_user}",
"gists_url": "https://api.github.com/users/simon-weber/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/simon-weber",
"id": 950506,
"login": "simon-weber",
"node_id": "MDQ6VXNlcjk1MDUwNg==",
"organizations_url": "https://api.github.com/users/simon-weber/orgs",
"received_events_url": "https://api.github.com/users/simon-weber/received_events",
"repos_url": "https://api.github.com/users/simon-weber/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/simon-weber/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/simon-weber/subscriptions",
"type": "User",
"url": "https://api.github.com/users/simon-weber",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 2 |
2017-07-29T02:31:43Z
|
2021-09-08T08:00:32Z
|
2017-07-29T11:27:18Z
|
NONE
|
resolved
|
My dev builds started failing after 2.18.2 was released (they purposefully run on the latest releases to flush out problems). They work on 2.18.1.
It looks like the cause is a minor breaking change: in at least my particular situation, an SSLError has changed to ConnectionError.
I can update my tests to look for ConnectionError instead, but I figured I'd check first to see if this behavior is intended.
## Expected Result
Getting `https://wrong.host.badssl.com` raises SSLError.
## Actual Result
Getting `https://wrong.host.badssl.com` raises ConnectionError, mentioning SSLError as the cause.
## Reproduction Steps
```
# starting with 2.18.1...
$ python -c 'import requests; requests.get("https://wrong.host.badssl.com")'
Traceback (most recent call last):
...
requests.exceptions.SSLError: hostname 'wrong.host.badssl.com' doesn't match either of '*.badssl.com', 'badssl.com'
$ pip install --upgrade requests
Collecting requests
...
Successfully installed requests-2.18.2 urllib3-1.22
$ python -c 'import requests; requests.get("https://wrong.host.badssl.com")'
Traceback (most recent call last):
...
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='wrong.host.badssl.com', port=443): Max retries exceeded with url: / (Caused by SSLError(CertificateError("hostname 'wrong.host.badssl.com' doesn't match either of '*.badssl.com', 'badssl.com'",),))
```
In case it's helpful, here's an example build: https://travis-ci.org/simon-weber/gmusicapi/jobs/248191438.
## System Information
$ python -m requests.help
```
{
"chardet": {
"version": "3.0.4"
},
"cryptography": {
"version": "1.4"
},
"implementation": {
"name": "CPython",
"version": "2.7.11"
},
"platform": {
"release": "4.4.2ph+",
"system": "Linux"
},
"pyOpenSSL": {
"openssl_version": "1000204f",
"version": "16.0.0"
},
"requests": {
"version": "2.18.2"
},
"system_ssl": {
"version": "1000207f"
},
"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/4209/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4209/timeline
| null |
completed
| null | null | false |
[
"Hrm, this breaking change happened because we made urllib3 retry on `SSLError`. In this case I think we need to add some custom code to Requests to make this work a bit better, namely by throwing SSLError again. Good catch!",
"Thanks!"
] |
https://api.github.com/repos/psf/requests/issues/4208
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4208/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4208/comments
|
https://api.github.com/repos/psf/requests/issues/4208/events
|
https://github.com/psf/requests/issues/4208
| 246,291,184 |
MDU6SXNzdWUyNDYyOTExODQ=
| 4,208 |
`requests.exceptions.*` do not inherit from Python's own specific exceptions.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/167327?v=4",
"events_url": "https://api.github.com/users/StyXman/events{/privacy}",
"followers_url": "https://api.github.com/users/StyXman/followers",
"following_url": "https://api.github.com/users/StyXman/following{/other_user}",
"gists_url": "https://api.github.com/users/StyXman/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/StyXman",
"id": 167327,
"login": "StyXman",
"node_id": "MDQ6VXNlcjE2NzMyNw==",
"organizations_url": "https://api.github.com/users/StyXman/orgs",
"received_events_url": "https://api.github.com/users/StyXman/received_events",
"repos_url": "https://api.github.com/users/StyXman/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/StyXman/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/StyXman/subscriptions",
"type": "User",
"url": "https://api.github.com/users/StyXman",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 1 |
2017-07-28T09:13:26Z
|
2021-09-08T08:00:32Z
|
2017-07-28T09:19:03Z
|
CONTRIBUTOR
|
resolved
|
Several `Exceptions` in https://github.com/requests/requests/blob/master/requests/exceptions.py inherit (indirectly) from `IOError`, but not from other Python exception. Two I can easily see are `ConnectionError` (see https://docs.python.org/3/library/exceptions.html#ConnectionError) and `TimeoutError`.
It might make sense to inherit from those too. If you think it doesn't, just close the Issue.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4",
"events_url": "https://api.github.com/users/Lukasa/events{/privacy}",
"followers_url": "https://api.github.com/users/Lukasa/followers",
"following_url": "https://api.github.com/users/Lukasa/following{/other_user}",
"gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Lukasa",
"id": 1382556,
"login": "Lukasa",
"node_id": "MDQ6VXNlcjEzODI1NTY=",
"organizations_url": "https://api.github.com/users/Lukasa/orgs",
"received_events_url": "https://api.github.com/users/Lukasa/received_events",
"repos_url": "https://api.github.com/users/Lukasa/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Lukasa",
"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/4208/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4208/timeline
| null |
completed
| null | null | false |
[
"I don't think it does at this time; while we're keeping compatibility across Python 2 and 3 it is probably not worth attempting to build complex exception hierarchies on different versions. For now, I think it's fine as-is. \r\n\r\nThanks for the suggestion!"
] |
https://api.github.com/repos/psf/requests/issues/4207
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4207/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4207/comments
|
https://api.github.com/repos/psf/requests/issues/4207/events
|
https://github.com/psf/requests/pull/4207
| 245,892,191 |
MDExOlB1bGxSZXF1ZXN0MTMyNjQyNDU1
| 4,207 |
remove legacy super() call
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/611033?v=4",
"events_url": "https://api.github.com/users/markjszy/events{/privacy}",
"followers_url": "https://api.github.com/users/markjszy/followers",
"following_url": "https://api.github.com/users/markjszy/following{/other_user}",
"gists_url": "https://api.github.com/users/markjszy/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/markjszy",
"id": 611033,
"login": "markjszy",
"node_id": "MDQ6VXNlcjYxMTAzMw==",
"organizations_url": "https://api.github.com/users/markjszy/orgs",
"received_events_url": "https://api.github.com/users/markjszy/received_events",
"repos_url": "https://api.github.com/users/markjszy/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/markjszy/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/markjszy/subscriptions",
"type": "User",
"url": "https://api.github.com/users/markjszy",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 0 |
2017-07-27T00:24:53Z
|
2021-09-05T00:07:08Z
|
2017-07-27T04:40:04Z
|
CONTRIBUTOR
|
resolved
|
This does not seem to be necessary anymore since there is no longer a `BaseResponse` object from which `Response` inherits.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4",
"events_url": "https://api.github.com/users/Lukasa/events{/privacy}",
"followers_url": "https://api.github.com/users/Lukasa/followers",
"following_url": "https://api.github.com/users/Lukasa/following{/other_user}",
"gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Lukasa",
"id": 1382556,
"login": "Lukasa",
"node_id": "MDQ6VXNlcjEzODI1NTY=",
"organizations_url": "https://api.github.com/users/Lukasa/orgs",
"received_events_url": "https://api.github.com/users/Lukasa/received_events",
"repos_url": "https://api.github.com/users/Lukasa/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Lukasa",
"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/4207/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4207/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/4207.diff",
"html_url": "https://github.com/psf/requests/pull/4207",
"merged_at": "2017-07-27T04:40:04Z",
"patch_url": "https://github.com/psf/requests/pull/4207.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/4207"
}
| true |
[] |
https://api.github.com/repos/psf/requests/issues/4206
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4206/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4206/comments
|
https://api.github.com/repos/psf/requests/issues/4206/events
|
https://github.com/psf/requests/pull/4206
| 245,830,929 |
MDExOlB1bGxSZXF1ZXN0MTMyNTk2NDk1
| 4,206 |
some docs on request redirect detection
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/204779?v=4",
"events_url": "https://api.github.com/users/jvanasco/events{/privacy}",
"followers_url": "https://api.github.com/users/jvanasco/followers",
"following_url": "https://api.github.com/users/jvanasco/following{/other_user}",
"gists_url": "https://api.github.com/users/jvanasco/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/jvanasco",
"id": 204779,
"login": "jvanasco",
"node_id": "MDQ6VXNlcjIwNDc3OQ==",
"organizations_url": "https://api.github.com/users/jvanasco/orgs",
"received_events_url": "https://api.github.com/users/jvanasco/received_events",
"repos_url": "https://api.github.com/users/jvanasco/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/jvanasco/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jvanasco/subscriptions",
"type": "User",
"url": "https://api.github.com/users/jvanasco",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 1 |
2017-07-26T19:36:38Z
|
2021-09-05T00:07:08Z
|
2017-07-26T19:57:22Z
|
CONTRIBUTOR
|
resolved
|
This is just a small docstring that I wanted to suggest for inclusion. I should have offered it in my earlier commit.
The purpose of the docstring: we had some unit tests to ensure that `get_redirect_target` was being called the appropriate number of times. They broke because I calculated the number incorrectly. It took a while to re-familiarize myself with the code and figure out what was going on.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4",
"events_url": "https://api.github.com/users/Lukasa/events{/privacy}",
"followers_url": "https://api.github.com/users/Lukasa/followers",
"following_url": "https://api.github.com/users/Lukasa/following{/other_user}",
"gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Lukasa",
"id": 1382556,
"login": "Lukasa",
"node_id": "MDQ6VXNlcjEzODI1NTY=",
"organizations_url": "https://api.github.com/users/Lukasa/orgs",
"received_events_url": "https://api.github.com/users/Lukasa/received_events",
"repos_url": "https://api.github.com/users/Lukasa/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Lukasa",
"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/4206/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4206/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/4206.diff",
"html_url": "https://github.com/psf/requests/pull/4206",
"merged_at": "2017-07-26T19:57:22Z",
"patch_url": "https://github.com/psf/requests/pull/4206.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/4206"
}
| true |
[
"this looks solid to me!"
] |
https://api.github.com/repos/psf/requests/issues/4205
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4205/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4205/comments
|
https://api.github.com/repos/psf/requests/issues/4205/events
|
https://github.com/psf/requests/issues/4205
| 245,777,319 |
MDU6SXNzdWUyNDU3NzczMTk=
| 4,205 |
Requests not working with Mac osx 10.11 Python-3
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/30474062?v=4",
"events_url": "https://api.github.com/users/paul93065/events{/privacy}",
"followers_url": "https://api.github.com/users/paul93065/followers",
"following_url": "https://api.github.com/users/paul93065/following{/other_user}",
"gists_url": "https://api.github.com/users/paul93065/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/paul93065",
"id": 30474062,
"login": "paul93065",
"node_id": "MDQ6VXNlcjMwNDc0MDYy",
"organizations_url": "https://api.github.com/users/paul93065/orgs",
"received_events_url": "https://api.github.com/users/paul93065/received_events",
"repos_url": "https://api.github.com/users/paul93065/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/paul93065/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/paul93065/subscriptions",
"type": "User",
"url": "https://api.github.com/users/paul93065",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 4 |
2017-07-26T16:17:29Z
|
2021-09-08T08:00:33Z
|
2017-07-26T18:23:53Z
|
NONE
|
resolved
|
Environment is Max OS-X 10.11, fully updated.
Python 3.6.2
Requests:
/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages
urllib3<1.23,>=1.21.1 in /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages
chardet<3.1.0,>=3.0.2 in /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages
idna<2.6,>=2.5 in /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages
certifi>=2017.4.17 in /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages
Any get requests called from Python3 fails:
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/urllib3/connectionpool.py", line 601, in urlopen
More detail in attached file.
[Python3Requests.txt](https://github.com/requests/requests/files/1177297/Python3Requests.txt)
|
{
"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/4205/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4205/timeline
| null |
completed
| null | null | false |
[
"This seems to be a problem with your Python installation. It appears that this would happen with any TLS connection. How did you get your Python 3?",
"Hello Lukasa,\r\nInstalled a package from Python.org\r\nhttps://www.python.org/downloads/release/python-362/\r\nThe problem seems particular to OSX 10-11. Works OK on 10.10, same package install for Python 3.\r\nI have to use Python 3 as I'm also using PyQt5 which only works on P3\r\n",
"Ok, I think this makes this a bug with your Python. You may need to report this to the python-dev team at bugs.python.org.",
"Ok Thanks!\n\nOn Wed, Jul 26, 2017 at 11:24 AM, Ian Stapleton Cordasco <\[email protected]> wrote:\n\n> Closed #4205 <https://github.com/requests/requests/issues/4205>.\n>\n> —\n> You are receiving this because you authored the thread.\n> Reply to this email directly, view it on GitHub\n> <https://github.com/requests/requests/issues/4205#event-1180424873>, or mute\n> the thread\n> <https://github.com/notifications/unsubscribe-auth/AdD_Tv-xo5zxoW4LUCX40J3xv5q5Twmeks5sR4RVgaJpZM4OkKD_>\n> .\n>\n"
] |
https://api.github.com/repos/psf/requests/issues/4204
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4204/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4204/comments
|
https://api.github.com/repos/psf/requests/issues/4204/events
|
https://github.com/psf/requests/pull/4204
| 245,659,608 |
MDExOlB1bGxSZXF1ZXN0MTMyNDY4NzEz
| 4,204 |
Correct urllib3 compatibility comment
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/861044?v=4",
"events_url": "https://api.github.com/users/browniebroke/events{/privacy}",
"followers_url": "https://api.github.com/users/browniebroke/followers",
"following_url": "https://api.github.com/users/browniebroke/following{/other_user}",
"gists_url": "https://api.github.com/users/browniebroke/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/browniebroke",
"id": 861044,
"login": "browniebroke",
"node_id": "MDQ6VXNlcjg2MTA0NA==",
"organizations_url": "https://api.github.com/users/browniebroke/orgs",
"received_events_url": "https://api.github.com/users/browniebroke/received_events",
"repos_url": "https://api.github.com/users/browniebroke/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/browniebroke/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/browniebroke/subscriptions",
"type": "User",
"url": "https://api.github.com/users/browniebroke",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 1 |
2017-07-26T09:25:09Z
|
2023-01-06T16:49:52Z
|
2017-07-26T10:03:58Z
|
CONTRIBUTOR
|
resolved
|
So that it's in line with the code.
I saw the warning raised recently and had to dive into the code for exact compatibility, but I stopped after reading the comment rather than the code.
Maybe a better solution would be to surface the supported versions in the warning? However, I see it was changed recently in https://github.com/requests/requests/pull/4144/, any specific reason for removing that?
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4",
"events_url": "https://api.github.com/users/Lukasa/events{/privacy}",
"followers_url": "https://api.github.com/users/Lukasa/followers",
"following_url": "https://api.github.com/users/Lukasa/following{/other_user}",
"gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Lukasa",
"id": 1382556,
"login": "Lukasa",
"node_id": "MDQ6VXNlcjEzODI1NTY=",
"organizations_url": "https://api.github.com/users/Lukasa/orgs",
"received_events_url": "https://api.github.com/users/Lukasa/received_events",
"repos_url": "https://api.github.com/users/Lukasa/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Lukasa",
"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/4204/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4204/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/4204.diff",
"html_url": "https://github.com/psf/requests/pull/4204",
"merged_at": "2017-07-26T10:03:58Z",
"patch_url": "https://github.com/psf/requests/pull/4204.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/4204"
}
| true |
[
"The primary reason is just trying to reduce the maintenance area of this code: it's painful to need to update in lots of places. Ideally we'd have a nice refactor that will work here to minimise the number of places we need to write our version constraints: if someone wants to do that, it might be a worthwhile project."
] |
https://api.github.com/repos/psf/requests/issues/4203
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4203/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4203/comments
|
https://api.github.com/repos/psf/requests/issues/4203/events
|
https://github.com/psf/requests/issues/4203
| 245,187,624 |
MDU6SXNzdWUyNDUxODc2MjQ=
| 4,203 |
requests is asking for urllib3 1.21.1, when 1.22 is on pypi
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/27829577?v=4",
"events_url": "https://api.github.com/users/mtdeguzis/events{/privacy}",
"followers_url": "https://api.github.com/users/mtdeguzis/followers",
"following_url": "https://api.github.com/users/mtdeguzis/following{/other_user}",
"gists_url": "https://api.github.com/users/mtdeguzis/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/mtdeguzis",
"id": 27829577,
"login": "mtdeguzis",
"node_id": "MDQ6VXNlcjI3ODI5NTc3",
"organizations_url": "https://api.github.com/users/mtdeguzis/orgs",
"received_events_url": "https://api.github.com/users/mtdeguzis/received_events",
"repos_url": "https://api.github.com/users/mtdeguzis/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/mtdeguzis/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/mtdeguzis/subscriptions",
"type": "User",
"url": "https://api.github.com/users/mtdeguzis",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 1 |
2017-07-24T19:42:35Z
|
2021-09-08T08:00:34Z
|
2017-07-24T19:49:01Z
|
NONE
|
resolved
|
Summary.
## Expected Result
requests is asking for urllib3 1.21.1, when 1.22 is on pypi. If pip/setuptools pulls the latest version of urllib3, you will not be able to run setup.py here.
## Actual Result
```'
Error: Couldn't find a distribution for 'urllib3<1.22,>=1.21.1'
```
## Reproduction Steps
* install latest urllib3
* run setup.py
## System Information
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4",
"events_url": "https://api.github.com/users/Lukasa/events{/privacy}",
"followers_url": "https://api.github.com/users/Lukasa/followers",
"following_url": "https://api.github.com/users/Lukasa/following{/other_user}",
"gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Lukasa",
"id": 1382556,
"login": "Lukasa",
"node_id": "MDQ6VXNlcjEzODI1NTY=",
"organizations_url": "https://api.github.com/users/Lukasa/orgs",
"received_events_url": "https://api.github.com/users/Lukasa/received_events",
"repos_url": "https://api.github.com/users/Lukasa/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Lukasa",
"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/4203/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4203/timeline
| null |
completed
| null | null | false |
[
"A new release is coming tomorrow to resolve this. "
] |
https://api.github.com/repos/psf/requests/issues/4202
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4202/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4202/comments
|
https://api.github.com/repos/psf/requests/issues/4202/events
|
https://github.com/psf/requests/issues/4202
| 245,095,372 |
MDU6SXNzdWUyNDUwOTUzNzI=
| 4,202 |
request not return in time
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/3711655?v=4",
"events_url": "https://api.github.com/users/zjbzju/events{/privacy}",
"followers_url": "https://api.github.com/users/zjbzju/followers",
"following_url": "https://api.github.com/users/zjbzju/following{/other_user}",
"gists_url": "https://api.github.com/users/zjbzju/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/zjbzju",
"id": 3711655,
"login": "zjbzju",
"node_id": "MDQ6VXNlcjM3MTE2NTU=",
"organizations_url": "https://api.github.com/users/zjbzju/orgs",
"received_events_url": "https://api.github.com/users/zjbzju/received_events",
"repos_url": "https://api.github.com/users/zjbzju/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/zjbzju/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/zjbzju/subscriptions",
"type": "User",
"url": "https://api.github.com/users/zjbzju",
"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 |
{
"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"
}
|
[
{
"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"
}
] | null | 2 |
2017-07-24T14:18:06Z
|
2021-09-08T07:00:36Z
|
2017-08-06T11:39:31Z
|
NONE
|
resolved
|
I'm using request('POST', url, data=data) to access a 4 layer SLB. I found that some of requests delayed for about 2s.
The tcp packets (dumped using tcpdump) shows that the packets are really received from SLB, but request doesn't returned to the caller. Does anyone have any idea about it?
BTW: my requests lib version is 2.12.4
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/240830?v=4",
"events_url": "https://api.github.com/users/sigmavirus24/events{/privacy}",
"followers_url": "https://api.github.com/users/sigmavirus24/followers",
"following_url": "https://api.github.com/users/sigmavirus24/following{/other_user}",
"gists_url": "https://api.github.com/users/sigmavirus24/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/sigmavirus24",
"id": 240830,
"login": "sigmavirus24",
"node_id": "MDQ6VXNlcjI0MDgzMA==",
"organizations_url": "https://api.github.com/users/sigmavirus24/orgs",
"received_events_url": "https://api.github.com/users/sigmavirus24/received_events",
"repos_url": "https://api.github.com/users/sigmavirus24/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/sigmavirus24/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/sigmavirus24/subscriptions",
"type": "User",
"url": "https://api.github.com/users/sigmavirus24",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/4202/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4202/timeline
| null |
completed
| null | null | false |
[
"@zjbzju could you provide more information, including the operating system, whether or not TLS is involved, what versions of openssl you have installed and are using, what you mean by `4 layer SLB`, and perhaps even the `tcpdump` itself.",
"Closing since no new information has been supplied to provide additional assistance."
] |
https://api.github.com/repos/psf/requests/issues/4201
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4201/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4201/comments
|
https://api.github.com/repos/psf/requests/issues/4201/events
|
https://github.com/psf/requests/issues/4201
| 244,915,908 |
MDU6SXNzdWUyNDQ5MTU5MDg=
| 4,201 |
Feature request: timeout on full request completion
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/581718?v=4",
"events_url": "https://api.github.com/users/dgillis/events{/privacy}",
"followers_url": "https://api.github.com/users/dgillis/followers",
"following_url": "https://api.github.com/users/dgillis/following{/other_user}",
"gists_url": "https://api.github.com/users/dgillis/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/dgillis",
"id": 581718,
"login": "dgillis",
"node_id": "MDQ6VXNlcjU4MTcxOA==",
"organizations_url": "https://api.github.com/users/dgillis/orgs",
"received_events_url": "https://api.github.com/users/dgillis/received_events",
"repos_url": "https://api.github.com/users/dgillis/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/dgillis/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/dgillis/subscriptions",
"type": "User",
"url": "https://api.github.com/users/dgillis",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 2 |
2017-07-23T15:07:00Z
|
2021-09-08T08:00:34Z
|
2017-07-23T15:34:45Z
|
NONE
|
resolved
|
A simple way to place a timeout on the entire request duration would be very useful. I see this was discussed previously but workarounds involved using additional libraries, signals, etc.
Can this not be fixed by simply modifying `Response.iter_content()` and checking the time after each chunk is read, raising an exception after some "complete_timeout" is surpassed?
I've used a function like this to do something similar by hijacking the `stream` parameter but it would be nice if this could be built right into `Session` and/or `Response`.
```python
from time import time
import requests
class CompleteTimeout(requests.exceptions.Timeout):
pass
def request_with_complete_timeout(method, url, complete_timeout, **kwargs):
"""
Call requests.request() but raise an Exception if the total time exceeds
complete_timeout seconds.
"""
kwargs['timeout'] = complete_timeout
kwargs['stream'] = True
timeout_time = time() + complete_timeout
response = requests.request(method, url, **kwargs)
content_barr = bytearray()
for chnk in response.iter_content():
if time() > timeout_time:
raise CompleteTimeout(
"Request exceeded complete timeout of {} seconds: {}"
.format(complete_timeout, url))
content_barr.extend(chnk)
response._content = bytes(content_barr)
return response
```
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4",
"events_url": "https://api.github.com/users/Lukasa/events{/privacy}",
"followers_url": "https://api.github.com/users/Lukasa/followers",
"following_url": "https://api.github.com/users/Lukasa/following{/other_user}",
"gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Lukasa",
"id": 1382556,
"login": "Lukasa",
"node_id": "MDQ6VXNlcjEzODI1NTY=",
"organizations_url": "https://api.github.com/users/Lukasa/orgs",
"received_events_url": "https://api.github.com/users/Lukasa/received_events",
"repos_url": "https://api.github.com/users/Lukasa/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Lukasa",
"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/4201/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4201/timeline
| null |
completed
| null | null | false |
[
"> Can this not be fixed by simply modifying Response.iter_content() and checking the time after each chunk is read, raising an exception after some \"complete_timeout\" is surpassed?\r\n\r\nNot really. This won't prevent `iter_content` potentially blocking well past any such timeout, because the socket reads may take a very long time, as may the buffering until the `iter_content` read size. This also ignores all problems with such a timeout while reading the response. \r\n\r\nUltimately this is a problem of library structure: the way we use the underlying libraries makes expressing his semantic very difficult. We acknowledge it's a problem and hope to remove httplib in order to take steps towards fixing it. However, until that time we're stuck with the semantic we have now. ",
"Thank you. I figured it would have been already added if it were as simple as what I had suggested."
] |
https://api.github.com/repos/psf/requests/issues/4200
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4200/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4200/comments
|
https://api.github.com/repos/psf/requests/issues/4200/events
|
https://github.com/psf/requests/issues/4200
| 244,909,766 |
MDU6SXNzdWUyNDQ5MDk3NjY=
| 4,200 |
Cookies lost after redirect
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/26007903?v=4",
"events_url": "https://api.github.com/users/HynekBlaha/events{/privacy}",
"followers_url": "https://api.github.com/users/HynekBlaha/followers",
"following_url": "https://api.github.com/users/HynekBlaha/following{/other_user}",
"gists_url": "https://api.github.com/users/HynekBlaha/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/HynekBlaha",
"id": 26007903,
"login": "HynekBlaha",
"node_id": "MDQ6VXNlcjI2MDA3OTAz",
"organizations_url": "https://api.github.com/users/HynekBlaha/orgs",
"received_events_url": "https://api.github.com/users/HynekBlaha/received_events",
"repos_url": "https://api.github.com/users/HynekBlaha/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/HynekBlaha/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/HynekBlaha/subscriptions",
"type": "User",
"url": "https://api.github.com/users/HynekBlaha",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 2 |
2017-07-23T13:19:39Z
|
2021-09-08T08:00:35Z
|
2017-07-23T13:38:30Z
|
NONE
|
resolved
|
After redirect, the JSESSIONID cookie is lost.
## Expected Result
Status code: 200
Cookies:
**JSESSIONID=91D71FBD2086F8FD1968001E6EECC9E5 for jizdenky.regiojet.cz,**
currency=CZK for jizdenky.regiojet.cz
locale=cs for jizdenky.regiojet.cz
Status code: 302
Cookies:
**JSESSIONID=91D71FBD2086F8FD1968001E6EECC9E5 for jizdenky.regiojet.cz,**
currency=CZK for jizdenky.regiojet.cz
locale=cs for jizdenky.regiojet.cz
## Actual Result
Status code: 200
Cookies:
currency=CZK for jizdenky.regiojet.cz
locale=cs for jizdenky.regiojet.cz
Status code: 302
Cookies:
**JSESSIONID=91D71FBD2086F8FD1968001E6EECC9E5 for jizdenky.regiojet.cz,**
currency=CZK for jizdenky.regiojet.cz
locale=cs for jizdenky.regiojet.cz
## Reproduction Steps
```python
import requests
# Without redirect I get session id cookie
with requests.Session() as s:
s = s.get("https://jizdenky.regiojet.cz/Login", allow_redirects=False)
print("Status code: {0}".format(s.status_code))
print("Cookies: {0}".format(s.cookies))
# With redirect I don't get session id cookie
with requests.Session() as s:
s = s.get("https://jizdenky.regiojet.cz/Login")
print("Status code: {0}".format(s.status_code))
print("Cookies: {0}".format(s.cookies))
```
## System Information
$ python -m requests.help
```
{
"chardet": {
"version": "3.0.4"
},
"cryptography": {
"version": "1.8.1"
},
"implementation": {
"name": "CPython",
"version": "3.6.1"
},
"platform": {
"release": "16.6.0",
"system": "Darwin"
},
"pyOpenSSL": {
"openssl_version": "100020bf",
"version": "17.0.0"
},
"requests": {
"version": "2.18.1"
},
"system_ssl": {
"version": "100020cf"
},
"urllib3": {
"version": "1.21.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).
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/26007903?v=4",
"events_url": "https://api.github.com/users/HynekBlaha/events{/privacy}",
"followers_url": "https://api.github.com/users/HynekBlaha/followers",
"following_url": "https://api.github.com/users/HynekBlaha/following{/other_user}",
"gists_url": "https://api.github.com/users/HynekBlaha/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/HynekBlaha",
"id": 26007903,
"login": "HynekBlaha",
"node_id": "MDQ6VXNlcjI2MDA3OTAz",
"organizations_url": "https://api.github.com/users/HynekBlaha/orgs",
"received_events_url": "https://api.github.com/users/HynekBlaha/received_events",
"repos_url": "https://api.github.com/users/HynekBlaha/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/HynekBlaha/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/HynekBlaha/subscriptions",
"type": "User",
"url": "https://api.github.com/users/HynekBlaha",
"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/4200/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4200/timeline
| null |
completed
| null | null | false |
[
"@HynekBlaha why did you close this?",
"My mistake. Didn't read doc enough. \r\nrequests.cookies return cookies of the last response. \r\nCookie was already used in the second request header. Everything is ok. "
] |
https://api.github.com/repos/psf/requests/issues/4199
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4199/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4199/comments
|
https://api.github.com/repos/psf/requests/issues/4199/events
|
https://github.com/psf/requests/issues/4199
| 244,594,451 |
MDU6SXNzdWUyNDQ1OTQ0NTE=
| 4,199 |
HEAD response with chunked Transfer-Encoding does not release the connection
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/703870?v=4",
"events_url": "https://api.github.com/users/timuralp/events{/privacy}",
"followers_url": "https://api.github.com/users/timuralp/followers",
"following_url": "https://api.github.com/users/timuralp/following{/other_user}",
"gists_url": "https://api.github.com/users/timuralp/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/timuralp",
"id": 703870,
"login": "timuralp",
"node_id": "MDQ6VXNlcjcwMzg3MA==",
"organizations_url": "https://api.github.com/users/timuralp/orgs",
"received_events_url": "https://api.github.com/users/timuralp/received_events",
"repos_url": "https://api.github.com/users/timuralp/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/timuralp/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/timuralp/subscriptions",
"type": "User",
"url": "https://api.github.com/users/timuralp",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 2 |
2017-07-21T08:07:55Z
|
2021-09-08T08:00:35Z
|
2017-07-21T14:20:24Z
|
NONE
|
resolved
|
Filing this to track the issue in urllib3 -- https://github.com/shazow/urllib3/issues/1234. Whenever urllib3 merges a fix, requests should update its requirements to avoid leaking connections.
The issue is that some servers -- in my case, Amazon S3 -- will set "Transfer-Encoding: chunked" even in response to a HEAD request. This results in urllib3 not returning the connection to the connection pool after requests calls `stream()` to get the content.
Here is a small script I wrote to confirm the problem (with a hacky reach into the pool).
```python
s = requests.Session()
req = requests.Request(method='HEAD', url='https://s3.amazonaws.com/other-bucket')
p = s.prepare_request(req)
resp = s.send(p, allow_redirects=False)
pool = s.adapters['https://'].poolmanager.pools._container.values()[0].pool
print pool.qsize()
s = requests.Session()
req = requests.Request(method='HEAD', url='https://google.com/other-bucket')
p = s.prepare_request(req)
resp = s.send(p, allow_redirects=False)
pool = s.adapters['https://'].poolmanager.pools._container.values()[0].pool
print pool.qsize()
```
In the case of google.com, the pool size is 10 upon completing the request, as the connection is put back. In the case of contacting Amazon, the pool size is 9. The default pool size is 10 and that's what we expect to get back.
Here's the debug information from the interaction, along with the requests version used:
```
2.18.1
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): s3.amazonaws.com
send: 'HEAD /other-bucket HTTP/1.1\r\nHost: s3.amazonaws.com\r\nConnection: keep-alive\r\nAccept-Encoding: gzip, deflate\r\nAccept: */*\r\nUser-Agent: python-requests/2.18.1\r\n\r\n'
reply: 'HTTP/1.1 301 Moved Permanently\r\n'
header: x-amz-bucket-region: ap-northeast-1
header: x-amz-request-id: A63B39B85D7E91DF
header: x-amz-id-2: BcZpRKNNvxorP7jG7SZE6RgcwFulAkuQDMBqw/q0C3DI6meKksIeZBYaeUD7pF3Xi3Mp5QjdObo=
header: Content-Type: application/xml
header: Transfer-Encoding: chunked
header: Date: Fri, 21 Jul 2017 08:01:49 GMT
header: Server: AmazonS3
DEBUG:urllib3.connectionpool:https://s3.amazonaws.com:443 "HEAD /other-bucket HTTP/1.1" 301 0
9
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): google.com
send: 'HEAD /other-bucket HTTP/1.1\r\nHost: google.com\r\nConnection: keep-alive\r\nAccept-Encoding: gzip, deflate\r\nAccept: */*\r\nUser-Agent: python-requests/2.18.1\r\n\r\n'
reply: 'HTTP/1.1 404 Not Found\r\n'
header: Content-Type: text/html; charset=UTF-8
header: Referrer-Policy: no-referrer
header: Content-Length: 1573
header: Date: Fri, 21 Jul 2017 08:01:50 GMT
header: Alt-Svc: quic=":443"; ma=2592000; v="39,38,37,36,35"
DEBUG:urllib3.connectionpool:https://google.com:443 "HEAD /other-bucket HTTP/1.1" 404 0
10
```
As far as I can tell, this bug has been present ever since the `read_chunked()` method was introduced in urllib3.Response in 1.10.3.
|
{
"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/4199/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4199/timeline
| null |
completed
| null | null | false |
[
"As we don't vendor in urllib3 anymore, we don't need to open bug reports to track upstream issues. Thanks anyway!",
"Pursuant to @Lukasa 's comment, I'm closing this (as I suspect that was what he intended to do)"
] |
https://api.github.com/repos/psf/requests/issues/4198
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4198/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4198/comments
|
https://api.github.com/repos/psf/requests/issues/4198/events
|
https://github.com/psf/requests/pull/4198
| 244,557,159 |
MDExOlB1bGxSZXF1ZXN0MTMxNjkzMzEx
| 4,198 |
redundant comma
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/9360340?v=4",
"events_url": "https://api.github.com/users/andportnoy/events{/privacy}",
"followers_url": "https://api.github.com/users/andportnoy/followers",
"following_url": "https://api.github.com/users/andportnoy/following{/other_user}",
"gists_url": "https://api.github.com/users/andportnoy/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/andportnoy",
"id": 9360340,
"login": "andportnoy",
"node_id": "MDQ6VXNlcjkzNjAzNDA=",
"organizations_url": "https://api.github.com/users/andportnoy/orgs",
"received_events_url": "https://api.github.com/users/andportnoy/received_events",
"repos_url": "https://api.github.com/users/andportnoy/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/andportnoy/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/andportnoy/subscriptions",
"type": "User",
"url": "https://api.github.com/users/andportnoy",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 0 |
2017-07-21T03:49:32Z
|
2021-09-05T00:07:09Z
|
2017-07-21T06:05:11Z
|
NONE
|
resolved
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4",
"events_url": "https://api.github.com/users/Lukasa/events{/privacy}",
"followers_url": "https://api.github.com/users/Lukasa/followers",
"following_url": "https://api.github.com/users/Lukasa/following{/other_user}",
"gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Lukasa",
"id": 1382556,
"login": "Lukasa",
"node_id": "MDQ6VXNlcjEzODI1NTY=",
"organizations_url": "https://api.github.com/users/Lukasa/orgs",
"received_events_url": "https://api.github.com/users/Lukasa/received_events",
"repos_url": "https://api.github.com/users/Lukasa/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Lukasa",
"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/4198/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4198/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/4198.diff",
"html_url": "https://github.com/psf/requests/pull/4198",
"merged_at": "2017-07-21T06:05:11Z",
"patch_url": "https://github.com/psf/requests/pull/4198.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/4198"
}
| true |
[] |
|
https://api.github.com/repos/psf/requests/issues/4197
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4197/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4197/comments
|
https://api.github.com/repos/psf/requests/issues/4197/events
|
https://github.com/psf/requests/issues/4197
| 244,367,209 |
MDU6SXNzdWUyNDQzNjcyMDk=
| 4,197 |
new relase of requests since urllib3 dep was bumped to 1.22
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/244702?v=4",
"events_url": "https://api.github.com/users/papachoco/events{/privacy}",
"followers_url": "https://api.github.com/users/papachoco/followers",
"following_url": "https://api.github.com/users/papachoco/following{/other_user}",
"gists_url": "https://api.github.com/users/papachoco/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/papachoco",
"id": 244702,
"login": "papachoco",
"node_id": "MDQ6VXNlcjI0NDcwMg==",
"organizations_url": "https://api.github.com/users/papachoco/orgs",
"received_events_url": "https://api.github.com/users/papachoco/received_events",
"repos_url": "https://api.github.com/users/papachoco/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/papachoco/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/papachoco/subscriptions",
"type": "User",
"url": "https://api.github.com/users/papachoco",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 4 |
2017-07-20T13:43:15Z
|
2021-09-08T08:00:35Z
|
2017-07-20T13:43:58Z
|
NONE
|
resolved
|
Could we get a new release of requests that uses urllib3 >=1.22 as dependency. Latest released version of requests has urllib3<1.22,>=1.21.1
Thanks
Carlos
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4",
"events_url": "https://api.github.com/users/Lukasa/events{/privacy}",
"followers_url": "https://api.github.com/users/Lukasa/followers",
"following_url": "https://api.github.com/users/Lukasa/following{/other_user}",
"gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Lukasa",
"id": 1382556,
"login": "Lukasa",
"node_id": "MDQ6VXNlcjEzODI1NTY=",
"organizations_url": "https://api.github.com/users/Lukasa/orgs",
"received_events_url": "https://api.github.com/users/Lukasa/received_events",
"repos_url": "https://api.github.com/users/Lukasa/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Lukasa",
"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/4197/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4197/timeline
| null |
completed
| null | null | false |
[
"See #4196. A new release is planned.",
"@Lukasa Is there a time frame on that release? Just looking for a ballpark, if possible.",
"@dmtucker Yeah, there is: early next week, realistically. We try to release on Tuesdays or Wednesdays to allow ops teams time to roll out releases (for boring compliance reasons some places have to take manual steps to handle updates of critical dependencies like us), so expect next Tuesday.",
"Perfect, thank you!"
] |
https://api.github.com/repos/psf/requests/issues/4196
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4196/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4196/comments
|
https://api.github.com/repos/psf/requests/issues/4196/events
|
https://github.com/psf/requests/pull/4196
| 244,293,905 |
MDExOlB1bGxSZXF1ZXN0MTMxNTA0MjIz
| 4,196 |
Allow urllib3 1.22
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4",
"events_url": "https://api.github.com/users/Lukasa/events{/privacy}",
"followers_url": "https://api.github.com/users/Lukasa/followers",
"following_url": "https://api.github.com/users/Lukasa/following{/other_user}",
"gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Lukasa",
"id": 1382556,
"login": "Lukasa",
"node_id": "MDQ6VXNlcjEzODI1NTY=",
"organizations_url": "https://api.github.com/users/Lukasa/orgs",
"received_events_url": "https://api.github.com/users/Lukasa/received_events",
"repos_url": "https://api.github.com/users/Lukasa/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Lukasa",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 1 |
2017-07-20T09:09:54Z
|
2021-09-05T00:07:09Z
|
2017-07-20T11:52:12Z
|
MEMBER
|
resolved
|
Based on the changelog this should be safe for us to use.
|
{
"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/4196/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4196/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/4196.diff",
"html_url": "https://github.com/psf/requests/pull/4196",
"merged_at": "2017-07-20T11:52:12Z",
"patch_url": "https://github.com/psf/requests/pull/4196.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/4196"
}
| true |
[
"👍 ✨ "
] |
https://api.github.com/repos/psf/requests/issues/4195
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4195/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4195/comments
|
https://api.github.com/repos/psf/requests/issues/4195/events
|
https://github.com/psf/requests/pull/4195
| 244,278,858 |
MDExOlB1bGxSZXF1ZXN0MTMxNDkzMjc3
| 4,195 |
Use 'prefix' instead of 'key' in session docstring
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/121219?v=4",
"events_url": "https://api.github.com/users/alexmuller/events{/privacy}",
"followers_url": "https://api.github.com/users/alexmuller/followers",
"following_url": "https://api.github.com/users/alexmuller/following{/other_user}",
"gists_url": "https://api.github.com/users/alexmuller/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/alexmuller",
"id": 121219,
"login": "alexmuller",
"node_id": "MDQ6VXNlcjEyMTIxOQ==",
"organizations_url": "https://api.github.com/users/alexmuller/orgs",
"received_events_url": "https://api.github.com/users/alexmuller/received_events",
"repos_url": "https://api.github.com/users/alexmuller/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/alexmuller/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/alexmuller/subscriptions",
"type": "User",
"url": "https://api.github.com/users/alexmuller",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 0 |
2017-07-20T08:11:06Z
|
2021-09-05T00:07:10Z
|
2017-07-20T08:13:07Z
|
CONTRIBUTOR
|
resolved
|
This commit makes [the API docs](http://docs.python-requests.org/en/master/api/#requests.Session.mount) more clear. The 'key' is an implementation detail.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4",
"events_url": "https://api.github.com/users/Lukasa/events{/privacy}",
"followers_url": "https://api.github.com/users/Lukasa/followers",
"following_url": "https://api.github.com/users/Lukasa/following{/other_user}",
"gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Lukasa",
"id": 1382556,
"login": "Lukasa",
"node_id": "MDQ6VXNlcjEzODI1NTY=",
"organizations_url": "https://api.github.com/users/Lukasa/orgs",
"received_events_url": "https://api.github.com/users/Lukasa/received_events",
"repos_url": "https://api.github.com/users/Lukasa/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Lukasa",
"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/4195/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4195/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/4195.diff",
"html_url": "https://github.com/psf/requests/pull/4195",
"merged_at": "2017-07-20T08:13:06Z",
"patch_url": "https://github.com/psf/requests/pull/4195.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/4195"
}
| true |
[] |
https://api.github.com/repos/psf/requests/issues/4194
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4194/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4194/comments
|
https://api.github.com/repos/psf/requests/issues/4194/events
|
https://github.com/psf/requests/pull/4194
| 244,039,630 |
MDExOlB1bGxSZXF1ZXN0MTMxMzIwNTk4
| 4,194 |
compat.py uses try/except to prevent linter errors
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/3709715?v=4",
"events_url": "https://api.github.com/users/cclauss/events{/privacy}",
"followers_url": "https://api.github.com/users/cclauss/followers",
"following_url": "https://api.github.com/users/cclauss/following{/other_user}",
"gists_url": "https://api.github.com/users/cclauss/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/cclauss",
"id": 3709715,
"login": "cclauss",
"node_id": "MDQ6VXNlcjM3MDk3MTU=",
"organizations_url": "https://api.github.com/users/cclauss/orgs",
"received_events_url": "https://api.github.com/users/cclauss/received_events",
"repos_url": "https://api.github.com/users/cclauss/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/cclauss/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/cclauss/subscriptions",
"type": "User",
"url": "https://api.github.com/users/cclauss",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 4 |
2017-07-19T13:25:34Z
|
2021-09-05T00:07:10Z
|
2017-07-19T13:28:22Z
|
CONTRIBUTOR
|
resolved
|
flake8 testing of https://github.com/requests/requests on Python 3.6.2
$ __time flake8 . --count --select=E901,E999,F821,F822,F823 --show-source --statistics__
```
./requests/compat.py:53:11: F821 undefined name 'unicode'
str = unicode
^
./requests/compat.py:54:18: F821 undefined name 'basestring'
basestring = basestring
^
./requests/compat.py:55:27: F821 undefined name 'long'
numeric_types = (int, long, float)
^
./requests/compat.py:56:27: F821 undefined name 'long'
integer_types = (int, long)
^
./requests/models.py:357:19: F821 undefined name 'unicode'
url = unicode(url) if is_py2 else str(url)
^
```
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4",
"events_url": "https://api.github.com/users/Lukasa/events{/privacy}",
"followers_url": "https://api.github.com/users/Lukasa/followers",
"following_url": "https://api.github.com/users/Lukasa/following{/other_user}",
"gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Lukasa",
"id": 1382556,
"login": "Lukasa",
"node_id": "MDQ6VXNlcjEzODI1NTY=",
"organizations_url": "https://api.github.com/users/Lukasa/orgs",
"received_events_url": "https://api.github.com/users/Lukasa/received_events",
"repos_url": "https://api.github.com/users/Lukasa/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Lukasa",
"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/4194/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4194/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/4194.diff",
"html_url": "https://github.com/psf/requests/pull/4194",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/4194.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/4194"
}
| true |
[
"Thanks for this! However, I'm not concerned about the linter errors here because any moderately intelligent static analysis tool could tell you that they're not a concern. So I don't think this patch provides any particular value to the project. Sorry!",
"Understood. Is there a better linter that you would recommend for Python projects?",
"Not particularly: this linter is fine. It's just ill-suited to this kind of file.\n\nAs a more general note, you'll find you may encounter hostility when you open PRs that do nothing more than make linter changes to files. If the project isn't using the linter in CI, that's usually a signal that they aren't interested in having their project linted. :smile:",
"Agreed. It is always difficult to know who are those who know linting is possible but don't want to do it and those who don't even know that it is possible and also don't know of the lintable problems that lurk in their code.\r\n\r\nThanks for the awesome work -- this project is essential to tons of developers!"
] |
https://api.github.com/repos/psf/requests/issues/4193
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4193/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4193/comments
|
https://api.github.com/repos/psf/requests/issues/4193/events
|
https://github.com/psf/requests/issues/4193
| 244,009,553 |
MDU6SXNzdWUyNDQwMDk1NTM=
| 4,193 |
requests 2.18.1 with proxies throw SSLError: ("bad handshake: SysCallError(-1, 'Unexpected EOF')",)
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/9978183?v=4",
"events_url": "https://api.github.com/users/chen2aaron/events{/privacy}",
"followers_url": "https://api.github.com/users/chen2aaron/followers",
"following_url": "https://api.github.com/users/chen2aaron/following{/other_user}",
"gists_url": "https://api.github.com/users/chen2aaron/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/chen2aaron",
"id": 9978183,
"login": "chen2aaron",
"node_id": "MDQ6VXNlcjk5NzgxODM=",
"organizations_url": "https://api.github.com/users/chen2aaron/orgs",
"received_events_url": "https://api.github.com/users/chen2aaron/received_events",
"repos_url": "https://api.github.com/users/chen2aaron/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/chen2aaron/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/chen2aaron/subscriptions",
"type": "User",
"url": "https://api.github.com/users/chen2aaron",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 2 |
2017-07-19T11:31:22Z
|
2021-09-08T08:00:36Z
|
2017-07-19T11:51:08Z
|
NONE
|
resolved
|
Hi,
When I use requests 2.18.1 with proxies, it throw SSLError: ("bad handshake: SysCallError(-1, 'Unexpected EOF')",)
## Scenario 1
Debian GNU/Linux 8
Python 3.6.1
OpenSSL 1.0.1t
pip list:
certifi (2017.4.17)
cryptography (2.0)
ndg-httpsclient (0.4.2)
pip (9.0.1)
pyasn1 (0.2.3)
pycparser (2.18)
pyldap (2.4.35.1)
pyOpenSSL (17.1.0)
PySocks (1.6.7)
requests (2.18.1)
requests-toolbelt (0.8.0)
setuptools (36.0.1)
six (1.10.0)
urllib3 (1.21.1)
My code:
```
import requests
proxies={'http':'socks5://127.0.0.1:8388', 'https': 'socks5://127.0.0.1:8388'}
r=requests.get('https://twitter.com',proxies=proxies)
```
Error message:
```
File "/venv/lib/python3.6/site-packages/requests/adapters.py", line 514, in send
raise SSLError(e, request=request)
requests.exceptions.SSLError: ("bad handshake: SysCallError(-1, 'Unexpected EOF')",)
```
When I degrade requests=2.11.1
The error gone.
## Scenario 2
MacOS Sierra
Python 3.6.1
OpenSSL 1.0.2l
pip list:
The same as above
It also return the same error message
And also when I degrade requests=2.11.1
The error gone.
I want to know what the reason is, help me~ thanks
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4",
"events_url": "https://api.github.com/users/Lukasa/events{/privacy}",
"followers_url": "https://api.github.com/users/Lukasa/followers",
"following_url": "https://api.github.com/users/Lukasa/following{/other_user}",
"gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Lukasa",
"id": 1382556,
"login": "Lukasa",
"node_id": "MDQ6VXNlcjEzODI1NTY=",
"organizations_url": "https://api.github.com/users/Lukasa/orgs",
"received_events_url": "https://api.github.com/users/Lukasa/received_events",
"repos_url": "https://api.github.com/users/Lukasa/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Lukasa",
"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/4193/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4193/timeline
| null |
completed
| null | null | false |
[
"This is almost certainly because we removed 3DES from our default cipher suite list. Try following the steps [in this blog post](https://lukasa.co.uk/2017/02/Configuring_TLS_With_Requests/) to see if that resolves your issue.",
"Thanks, it resolved my problem\r\n"
] |
https://api.github.com/repos/psf/requests/issues/4192
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4192/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4192/comments
|
https://api.github.com/repos/psf/requests/issues/4192/events
|
https://github.com/psf/requests/pull/4192
| 243,152,877 |
MDExOlB1bGxSZXF1ZXN0MTMwNzAzMzk2
| 4,192 |
Add requirements.txt to MANIFEST.in
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1011612?v=4",
"events_url": "https://api.github.com/users/koobs/events{/privacy}",
"followers_url": "https://api.github.com/users/koobs/followers",
"following_url": "https://api.github.com/users/koobs/following{/other_user}",
"gists_url": "https://api.github.com/users/koobs/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/koobs",
"id": 1011612,
"login": "koobs",
"node_id": "MDQ6VXNlcjEwMTE2MTI=",
"organizations_url": "https://api.github.com/users/koobs/orgs",
"received_events_url": "https://api.github.com/users/koobs/received_events",
"repos_url": "https://api.github.com/users/koobs/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/koobs/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/koobs/subscriptions",
"type": "User",
"url": "https://api.github.com/users/koobs",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 0 |
2017-07-15T04:45:56Z
|
2021-09-05T00:07:10Z
|
2017-07-15T06:39:02Z
|
CONTRIBUTOR
|
resolved
|
Three tests [1] rely on `requirements.txt` being available. If the file is not present, the following error is observed in those tests:
```
> with open('requirements.txt') as f:
E IOError: [Errno 2] No such file or directory: 'requirements.txt'
```
The latest (2.18.1) source distribution on PyPI does not include requirements.txt, which precludes successfully passing the tests.
This change adds the required file to the source distribution. An alternative is to use a different file already included in the sdist.
Additionally, skipping tests if a required resource (library, file, etc) is not available would be a user experience improvement.
[1] test_POSTBIN_GET_POST_FILES, test_POSTBIN_GET_POST_FILES_WITH_DATA, test_conflicting_post_params,
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4",
"events_url": "https://api.github.com/users/Lukasa/events{/privacy}",
"followers_url": "https://api.github.com/users/Lukasa/followers",
"following_url": "https://api.github.com/users/Lukasa/following{/other_user}",
"gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Lukasa",
"id": 1382556,
"login": "Lukasa",
"node_id": "MDQ6VXNlcjEzODI1NTY=",
"organizations_url": "https://api.github.com/users/Lukasa/orgs",
"received_events_url": "https://api.github.com/users/Lukasa/received_events",
"repos_url": "https://api.github.com/users/Lukasa/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Lukasa",
"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/4192/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4192/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/4192.diff",
"html_url": "https://github.com/psf/requests/pull/4192",
"merged_at": "2017-07-15T06:39:02Z",
"patch_url": "https://github.com/psf/requests/pull/4192.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/4192"
}
| true |
[] |
https://api.github.com/repos/psf/requests/issues/4191
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4191/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4191/comments
|
https://api.github.com/repos/psf/requests/issues/4191/events
|
https://github.com/psf/requests/issues/4191
| 242,422,950 |
MDU6SXNzdWUyNDI0MjI5NTA=
| 4,191 |
Possible Memory Leak
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/2804731?v=4",
"events_url": "https://api.github.com/users/le1nux/events{/privacy}",
"followers_url": "https://api.github.com/users/le1nux/followers",
"following_url": "https://api.github.com/users/le1nux/following{/other_user}",
"gists_url": "https://api.github.com/users/le1nux/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/le1nux",
"id": 2804731,
"login": "le1nux",
"node_id": "MDQ6VXNlcjI4MDQ3MzE=",
"organizations_url": "https://api.github.com/users/le1nux/orgs",
"received_events_url": "https://api.github.com/users/le1nux/received_events",
"repos_url": "https://api.github.com/users/le1nux/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/le1nux/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/le1nux/subscriptions",
"type": "User",
"url": "https://api.github.com/users/le1nux",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 23 |
2017-07-12T15:32:40Z
|
2021-09-01T00:11:38Z
|
2017-07-29T10:59:05Z
|
NONE
|
resolved
|
I'm crawling a lot of different URLs using the requests library and I encountered that the process takes more and more RAM over time.
Basically all I do is calling this iteratively from multiple threads:
```{python}
r = requests.get(url=url, timeout=timeout)
content = r.text
```
when I comment out the second line this issue does not occur ... am I using the library fundamentally wrong or could this actually be a bug?
|
{
"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/4191/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4191/timeline
| null |
completed
| null | null | false |
[
"What are you doing with the content? What's the rate of memory growth? Can you try following [this blog post](http://tech.labs.oliverwyman.com/blog/2008/11/14/tracing-python-memory-leaks/) to gather data about *what* objects are being retained, ideally after your memory has grown very substantially (e.g. to more than 10 times the initial process memory size).",
"Also, I have a hunch, so humor my following question: Does the server provide a charset/character encoding? If not, does the leak persist if you do `content = r.content`?\r\n\r\n@Lukasa I wonder if there's a leak in chardet.",
"Good hunch. Checking if the problem appears with a change of `text` to `content` would also work to isolate that.",
"@Lukasa \r\n> What are you doing with the content?\r\n\r\nI store _content_ in a queue and have a worker thread that dumps the data in a csv file. \r\nHowever I isolated the download workers and skipped the part of storing it in the queue. \r\nSo basically all I do now is this (using multiple threads):\r\n```\r\nwhile True:\r\n r = requests.get(url=url, timeout=timeout)\r\n content = r.text\r\n```\r\nIf I delete the assignment to _content_ the memory does not grow anymore.\r\n```\r\nwhile True:\r\n r = requests.get(url=url, timeout=timeout)\r\n```\r\n> What's the rate of memory growth?\r\n\r\nThe initial RAM usage is at about 100MB and grows to 2GB within ~24 hours.\r\n\r\n@sigmavirus24 \r\n> Does the server provide a charset/character encoding?\r\n\r\nGood question. Since my URL list contains more than 100 servers I would have to check for each. \r\nBesides what exactly do you mean by \"charset/character encoding\". Are you referring to the HTTP response header's field _Content-Encoding_? \r\n \r\n> If not, does the leak happen if you do content = r.content?\r\n\r\nI will give that a try. ",
"No, @sigmavirus24 is referring to having a `charset` parameter in the `content-type` header field.",
"Ah okay. I wrote a little script that prints the content-type field of all responses. \r\nContent types are:\r\n```\r\nContent-Type: text/xml\r\nContent-Type: text/xml;charset=UTF-8\r\nContent-Type: application/rss+xml;charset=UTF-8\r\n```\r\nAdditionally, some of those servers don't even provide a Content-Type field.\r\n",
"Ok, so the ones with no `content-type` and the ones with no `charset` are the ones we're interested in. Try changing `text` to `content` to see if it reproduces.",
"Alright, I compared both versions now:\r\n\r\n| time in h | content | text |\r\n| ------------- |-------------| -----|\r\n| 00:00 | 0.9%| 1.0% |\r\n| 00:30 | 1.3%|1.7% |\r\n| 01:00 | 1.4% |2.1% |\r\n| 01:30 | 1.4% | |\r\n| 02:00 | 1.4% | 2.3%|\r\n| 02:30 | 1.4% |2.3% |\r\n| 03:00 | 1.4% |2.4% |\r\n| 03:30 | 1.5% |2.4% |\r\n| 04:00 | 1.5% | 2.4%|\r\n|4:30| | 2.5%|\r\n|...|||\r\n|~6:00h|1.6%| |\r\n\r\nIn case you're interested in absolute values: my notebook has 10GB of RAM. \r\nIt seems like RAM usage growing something like a root function. \r\nThis behavior is equivalent to what I have encountered when using my crawler although there it's taking GBs of RAM. \r\n\r\nThis what my requests test script looks like:\r\nhttps://gist.github.com/le1nux/c94b3707f076edbd982299906737b1ca ",
"Ok, so the leaking does appear to occur more *slowly* when using `content`, but it is vaguely present. In both of these cases, though, this may not be a leak: given that the growth is asymptotic it may be a property of the Python allocator, which does not always return object memory to the OS. In this case the process with `content` is asymptotically growing to about 160MB: large, but not completely absurd, especially for large response bodies.\r\n\r\nI think we need to see `objgraph` results from a long run to see how much data is actually floating around.",
"> In this case the process with content is asymptotically growing to about 160MB: large, but not completely absurd, especially for large response bodies.\r\n\r\nWell, I only requested XML data which is not really big. \r\n\r\nCharacter length:\r\n\r\n| max | min | avg | median |\r\n|-----------|---------|----------|----------------|\r\n| 610869 | 876 | 51329 | 21592|\r\n\r\nI will replace my URL list by URLs that direct to bigger websites and see if I can reproduce the huge RAM usage of my crawler. \r\n\r\n\r\n",
"> it may be a property of the Python allocator, which does not always return object memory to the OS.\r\n\r\nSo actually, the last time I spent a few weeks trying to track down a memory leak in requests what I learned is that the Resident Size measure (RSS) is actually not the amount of memory *actively* used by your program but the maximum amount of memory it has allocated thus far. And if your OS doesn't need to reclaim any of that, that value can stay the same and generally does not shrink.",
"Not sure how relevant it is, but there was an interesting thread a month ago on Python-Dev about CPython's memory allocation approach, and some of its consequences. The thread starts here:\r\nhttps://mail.python.org/pipermail/python-dev/2017-June/148105.html\r\n\r\n",
"@sigmavirus24 \r\nGood point. However I'm still asking myself why my crawler (i.e. the requests library probably) allocates that amount of RAM in the first place. ",
"@le1nux btw, can you please fill out the template you had to delete to report this issue in the first place. We *did* have a leak a couple years back with the functional API you're using and without knowing what version you're on, I don't have a good way of telling you if that's the issue.",
"Hey @le1nux I'm going to close this since the investigation has stalled and we don't really have any concrete things to chase down. We'll be happy to reopen it if you can bring us the details we need to continue the investigation. Cheers!",
"Hey @sigmavirus24 I'm sorry for not having provided any further information, yet. At the moment I'm busy working on something else but I will get back to it in approx. two weeks. I will investigate that issue further and if it persists I will come back to you guys. ",
"I have a similar issue where additional objects are created everytime r=requests.get() is called and r.content is retrieved in multithreaded program\r\n <class 'str | 4 | 275 B\r\n <class 'urllib.parse.SplitResult | 1 | 88 B\r\n",
"Using python 2.7.15 and requests 2.21.0\r\nAnd I encountering the exact same memory leak.",
"Since this issue seems to persist for others, I set up my old crawler again and updated to the latest requests library version (2.21.0). I ran it for a couple of hours and the memory keeps still increasing. In my opinion my light-wight rss-feed-crawler might be an \"easy\" starting point to track it down? \r\n\r\nhttps://github.com/le1nux/crawly\r\n\r\nIn any case, I will be happy to assist tracking down this possible memory leak. ",
"Python 3.7.2 and requests 2.21.0\r\nAnd I also have the exact same memory leak.",
"09/12/2019\r\nWindows-7 python38 requests 2.22.0 -- the same leakage found while on threadpool execution",
"27 Dec 2020\r\nThink I've found the same: Python 3.7, requests 2.22.0. ",
"I'm also seeing this exact same memory leak - Python 3.6.9, requests 2.23.0. Has anyone found any work arounds?"
] |
https://api.github.com/repos/psf/requests/issues/4190
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4190/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4190/comments
|
https://api.github.com/repos/psf/requests/issues/4190/events
|
https://github.com/psf/requests/issues/4190
| 242,323,252 |
MDU6SXNzdWUyNDIzMjMyNTI=
| 4,190 |
Use requests for python2.7.13 scarping error
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/6219520?v=4",
"events_url": "https://api.github.com/users/liaoran/events{/privacy}",
"followers_url": "https://api.github.com/users/liaoran/followers",
"following_url": "https://api.github.com/users/liaoran/following{/other_user}",
"gists_url": "https://api.github.com/users/liaoran/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/liaoran",
"id": 6219520,
"login": "liaoran",
"node_id": "MDQ6VXNlcjYyMTk1MjA=",
"organizations_url": "https://api.github.com/users/liaoran/orgs",
"received_events_url": "https://api.github.com/users/liaoran/received_events",
"repos_url": "https://api.github.com/users/liaoran/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/liaoran/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/liaoran/subscriptions",
"type": "User",
"url": "https://api.github.com/users/liaoran",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 4 |
2017-07-12T09:55:53Z
|
2021-09-08T08:00:37Z
|
2017-07-12T11:40:28Z
|
NONE
|
resolved
|
# request version
2.14.2
# os information
Linux programmer 4.8.0-58-generic #63~16.04.1-Ubuntu SMP Mon Jun 26 18:08:51 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
# code
```python
def get_html(url):
headers = {'User-Agent':'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.115 Safari/537.36'}
request = requests.get(url=url,headers=headers) #发送get请求
response = request.content #获取网页内容
return response
def get_img_html(html):
soup = BeautifulSoup(html,'lxml') #解析网页
all_a = soup.find_all('a',class_ = 'list-group-item') #找到a标签
for i in all_a:
img_html = get_html(i['href']) #获取超链接的网页内容
print img_html #网页源码
def get_img(html):
soup = etree.HTML(html) #初始化源码
items = soup.xpath('//div[@class="artile_des"]') #找这个盒子下面的内容
for item in items:
imgurl_list = item.xpath('table/tbody/tr/td/a/img/@onerror') #选取属性
start_save_img(imgurl_list)
def save_img(img_url):
img_url = img_url.split('=')[-1][1:-2].replace('jp','jpg') #分割
print u"正在下载" + 'http:' + img_url
img_content = requests.get('http:' + img_url).content
with open('doutu/%s' % img_url.split('/')[-1],'wb') as f:
f.write(img_content)
def start_save_img(imgurl_list):
for i in imgurl_list:
print i
th = threading.Thread(target=save_img,args=(i,))
th.start()
def main():
start_url = 'https://www.doutula.com/article/list/?page='
for i in range(1,10):
start_html = get_html(start_url.format(i))
get_img_html(start_html)
if __name__ == '__main__':
main()
```
# Error
```
/home/kongnian/anaconda2/bin/python /home/kongnian/PycharmProjects/Scraping/DouTuScraping.py
Traceback (most recent call last):
File "/home/kongnian/PycharmProjects/Scraping/DouTuScraping.py", line 52, in <module>
main()
File "/home/kongnian/PycharmProjects/Scraping/DouTuScraping.py", line 48, in main
start_html = get_html(start_url.format(i))
File "/home/kongnian/PycharmProjects/Scraping/DouTuScraping.py", line 10, in get_html
request = requests.get(url=url,headers=headers) #发送get请求
File "/home/kongnian/anaconda2/lib/python2.7/site-packages/requests/api.py", line 72, in get
return request('get', url, params=params, **kwargs)
File "/home/kongnian/anaconda2/lib/python2.7/site-packages/requests/api.py", line 58, in request
return session.request(method=method, url=url, **kwargs)
File "/home/kongnian/anaconda2/lib/python2.7/site-packages/requests/sessions.py", line 518, in request
resp = self.send(prep, **send_kwargs)
File "/home/kongnian/anaconda2/lib/python2.7/site-packages/requests/sessions.py", line 639, in send
r = adapter.send(request, **kwargs)
File "/home/kongnian/anaconda2/lib/python2.7/site-packages/requests/adapters.py", line 512, in send
raise SSLError(e, request=request)
requests.exceptions.SSLError: ("bad handshake: SysCallError(104, 'ECONNRESET')",)
```
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4",
"events_url": "https://api.github.com/users/Lukasa/events{/privacy}",
"followers_url": "https://api.github.com/users/Lukasa/followers",
"following_url": "https://api.github.com/users/Lukasa/following{/other_user}",
"gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Lukasa",
"id": 1382556,
"login": "Lukasa",
"node_id": "MDQ6VXNlcjEzODI1NTY=",
"organizations_url": "https://api.github.com/users/Lukasa/orgs",
"received_events_url": "https://api.github.com/users/Lukasa/received_events",
"repos_url": "https://api.github.com/users/Lukasa/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Lukasa",
"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/4190/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4190/timeline
| null |
completed
| null | null | false |
[
"In this context it seems like the connection is being closed as we send more data. Rude, but not entirely unusual. Does it happen deterministically or only occasionally?",
"Yesterday normal, today an error occurred.",
"If this is intermittent then I think you just have to tolerate this as being \"network weather\": the kind of error that will occasionally occur in long-running networked programs. If you hit this condition, I recommend retrying.",
"OK,thanks"
] |
https://api.github.com/repos/psf/requests/issues/4189
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4189/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4189/comments
|
https://api.github.com/repos/psf/requests/issues/4189/events
|
https://github.com/psf/requests/issues/4189
| 241,592,257 |
MDU6SXNzdWUyNDE1OTIyNTc=
| 4,189 |
Sometimes it happens, What can I sove this? Thanks a lot.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/19851699?v=4",
"events_url": "https://api.github.com/users/liangrengongzuoshi/events{/privacy}",
"followers_url": "https://api.github.com/users/liangrengongzuoshi/followers",
"following_url": "https://api.github.com/users/liangrengongzuoshi/following{/other_user}",
"gists_url": "https://api.github.com/users/liangrengongzuoshi/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/liangrengongzuoshi",
"id": 19851699,
"login": "liangrengongzuoshi",
"node_id": "MDQ6VXNlcjE5ODUxNjk5",
"organizations_url": "https://api.github.com/users/liangrengongzuoshi/orgs",
"received_events_url": "https://api.github.com/users/liangrengongzuoshi/received_events",
"repos_url": "https://api.github.com/users/liangrengongzuoshi/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/liangrengongzuoshi/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/liangrengongzuoshi/subscriptions",
"type": "User",
"url": "https://api.github.com/users/liangrengongzuoshi",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 4 |
2017-07-10T03:47:39Z
|
2021-09-08T08:00:37Z
|
2017-07-10T07:21:22Z
|
NONE
|
resolved
|
HTTPConnectionPool(host='xxx', port=xxx): Max retries exceeded with url: /Upload/Processing.aspx (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f79f9c9c1d0>: Failed to establish a new connection: [Errno 113] No route to host',))
Traceback (most recent call last):
File "/data/apps/browser_9090/UuwiseUtil.py", line 131, in uploadPic
resp = requests.post("http://" + self.UPLOAD_SERVER + "/Upload/Processing.aspx", data=data , files=files, headers=headers)
File "/home/python27/lib/python2.7/site-packages/requests/api.py", line 112, in post
return request('post', url, data=data, json=json, **kwargs)
File "/home/python27/lib/python2.7/site-packages/requests/api.py", line 58, in request
return session.request(method=method, url=url, **kwargs)
File "/home/python27/lib/python2.7/site-packages/requests/sessions.py", line 502, in request
resp = self.send(prep, **send_kwargs)
File "/home/python27/lib/python2.7/site-packages/requests/sessions.py", line 612, in send
r = adapter.send(request, **kwargs)
File "/home/python27/lib/python2.7/site-packages/requests/adapters.py", line 504, in send
raise ConnectionError(e, request=request)
ConnectionError: HTTPConnectionPool(host='xxx', port=xxx): Max retries exceeded with url: /Upload/Processing.aspx (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f79f9c9c1d0>: Failed to establish a new connection: [Errno 113] No route to host',))
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4",
"events_url": "https://api.github.com/users/Lukasa/events{/privacy}",
"followers_url": "https://api.github.com/users/Lukasa/followers",
"following_url": "https://api.github.com/users/Lukasa/following{/other_user}",
"gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Lukasa",
"id": 1382556,
"login": "Lukasa",
"node_id": "MDQ6VXNlcjEzODI1NTY=",
"organizations_url": "https://api.github.com/users/Lukasa/orgs",
"received_events_url": "https://api.github.com/users/Lukasa/received_events",
"repos_url": "https://api.github.com/users/Lukasa/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Lukasa",
"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/4189/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4189/timeline
| null |
completed
| null | null | false |
[
"This error is systemic: it means that when we attempted to connect to the IP address returned by DNS, the operating system told us it didn't know how to get there. This is not really a thing we can fix: when you get this error, you should just retry.",
"Thanks for your answer.\r\n\r\nIt just happens sometimes.\r\nAnd sometimes It throws exceptions below, Whether it is related to HTTP persistent connection?\r\n\r\nConnectionError: HTTPConnectionPool(host='xxx', port=xxx): Max retries exceeded with url: xxx (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f2f225a1b50>: Failed to establish a new connection: [Errno 111] Connection refused',))\r\n\r\nThanks~\r\n",
"It's not related to the persistent connections: that's caused by the remote peer refusing a TCP connection when we attempt to connect to it.",
"OK, I got it , thanks a lot."
] |
https://api.github.com/repos/psf/requests/issues/4188
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4188/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4188/comments
|
https://api.github.com/repos/psf/requests/issues/4188/events
|
https://github.com/psf/requests/pull/4188
| 241,472,446 |
MDExOlB1bGxSZXF1ZXN0MTI5NTM4NDM2
| 4,188 |
Make username:pass@host URLs play nice with NO_PROXY environment variable
|
{
"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
| false | null |
[] | null | 2 |
2017-07-08T18:46:33Z
|
2018-04-29T19:08:16Z
|
2018-04-29T19:08:16Z
|
NONE
| null |
Fixes issue #4158.
|
{
"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/4188/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4188/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/4188.diff",
"html_url": "https://github.com/psf/requests/pull/4188",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/4188.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/4188"
}
| true |
[
"Is there any progress so far? we also having problem with that bug!",
"It looks like this ended up getting resolved in #4427, so I'm closing this as resolved. Thanks for the effort here @ghost."
] |
https://api.github.com/repos/psf/requests/issues/4187
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4187/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4187/comments
|
https://api.github.com/repos/psf/requests/issues/4187/events
|
https://github.com/psf/requests/issues/4187
| 241,197,729 |
MDU6SXNzdWUyNDExOTc3Mjk=
| 4,187 |
UTF-8 characters unable to handle in headers.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/924698?v=4",
"events_url": "https://api.github.com/users/hrimfaxi/events{/privacy}",
"followers_url": "https://api.github.com/users/hrimfaxi/followers",
"following_url": "https://api.github.com/users/hrimfaxi/following{/other_user}",
"gists_url": "https://api.github.com/users/hrimfaxi/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/hrimfaxi",
"id": 924698,
"login": "hrimfaxi",
"node_id": "MDQ6VXNlcjkyNDY5OA==",
"organizations_url": "https://api.github.com/users/hrimfaxi/orgs",
"received_events_url": "https://api.github.com/users/hrimfaxi/received_events",
"repos_url": "https://api.github.com/users/hrimfaxi/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/hrimfaxi/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/hrimfaxi/subscriptions",
"type": "User",
"url": "https://api.github.com/users/hrimfaxi",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 14 |
2017-07-07T08:45:34Z
|
2021-09-08T08:00:38Z
|
2017-07-07T08:48:42Z
|
NONE
|
resolved
|
requests is unable to handle utf-8 characters in headers.
http://assrt.net/download/217234/%E6%A4%8D%E7%89%A9%E7%8E%8B%E5%9B%BD%E7%AC%AC%E4%BA%8C%E9%9B%86%E8%93%9D%E5%85%89%E7%89%88%E4%B8%AD%E8%8B%B1%E6%96%87%E5%8F%8A%E5%8F%8C%E8%AF%AD%E5%AD%97%E5%B9%95.rar
## Expected Result
Content-Disposition should be subtitle; filename="植物王国第三集蓝光版中英文及双语字幕.rar"
## Actual Result
{'Cache-Control': 'max-age=2678400', 'X-Cache': 'MISS', 'Expires': 'Mon, 07 Aug 2017 08:16:04 GMT', 'Server': 'openresty', 'Content-Disposition': 'subtitle; filename="æ¤\x8dç\x89©ç\x8e\x8bå\x9b½ç¬¬äº\x8cé\x9b\x86è\x93\x9då\x85', 'Connection': 'keep-alive', 'Date': 'Fri, 07 Jul 2017 08:16:04 GMT', 'Content-Length': '62859', 'Servant': 'Berserker', 'ETag': '"56f296fd-f58b"', 'Content-Type': 'application/octet-stream', 'Last-Modified': 'Wed, 23 Mar 2016 13:15:41 GMT'}
Content-Disposition is corrupted with last characters:
>>> a.headers['content-disposition'].encode('iso8859-1').decode('utf-8', errors='ignore')
'subtitle; filename="植物王国第三集蓝'
## Reproduction Steps
## System Information
$ python -m requests.help
```
hrimfaxi@ubuntu-build-server:~/aasrt$ python3 -m requests.help
{
"chardet": {
"version": "3.0.4"
},
"cryptography": {
"version": ""
},
"implementation": {
"name": "CPython",
"version": "3.5.2"
},
"platform": {
"release": "4.7.4+",
"system": "Linux"
},
"pyOpenSSL": {
"openssl_version": "",
"version": null
},
"requests": {
"version": "2.18.1"
},
"system_ssl": {
"version": "1000207f"
},
"urllib3": {
"version": "1.21.1"
},
"using_pyopenssl": false
}
```
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4",
"events_url": "https://api.github.com/users/Lukasa/events{/privacy}",
"followers_url": "https://api.github.com/users/Lukasa/followers",
"following_url": "https://api.github.com/users/Lukasa/following{/other_user}",
"gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Lukasa",
"id": 1382556,
"login": "Lukasa",
"node_id": "MDQ6VXNlcjEzODI1NTY=",
"organizations_url": "https://api.github.com/users/Lukasa/orgs",
"received_events_url": "https://api.github.com/users/Lukasa/received_events",
"repos_url": "https://api.github.com/users/Lukasa/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Lukasa",
"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/4187/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4187/timeline
| null |
completed
| null | null | false |
[
"On Python 3 the header decoding is actually done by the Python standard library. This decodes headers using Latin-1, so you can resolve this issue by doing `headers['content-disposition'].encode('iso-8859-1').decode('utf-8')`.\r\n\r\nSadly, there is no guaranteed header encoding for headers, so this approach (while silly) works pretty well.",
"I did tried that. But the filename is corrupted:\r\n```\r\n a.headers['content-disposition'].encode('iso8859-1').decode('utf-8', errors='ignore')\r\n'subtitle; filename=\"植物王国第三集蓝'\r\n```\r\n\r\nThe complete filename should be \r\n```\r\nContent-Disposition should be subtitle; filename=\"植物王国第三集蓝光版中英文及双语字幕.rar\"\r\n```\r\n\r\ncurl -I -L -v gets the header without problem.",
"Hrm. Why are you setting `errors='ignore'`? Do you get an error if you don't do that?",
"Yes. \r\n```\r\n>>> a['Content-Disposition'].encode('iso-8859-1').decode('utf-8')\r\nTraceback (most recent call last):\r\n File \"<stdin>\", line 1, in <module>\r\nUnicodeDecodeError: 'utf-8' codec can't decode bytes in position 44-45: unexpected end of data\r\n```",
"Ok, that strongly suggests that the data is *not* `UTF-8` encoded. Once you do the latin-1 encode, what does the raw bytes repr look like?",
"I think it is UTF-8 encoded, however was corrupted after decoding as latin-1.\r\n```\r\ncurl -L -I -v 'http://assrt.net/download/217235/%E6%A4%8D%E7%89%A9%E7%8E%8B%E5%9B%BD%E7%AC%AC%E4%B8%89%E9%9B%86%E8%93%9D%E5%85%89%E7%89%88%E4%B8%AD%E8%8B%B1%E6%96%87%E5%8F%8A%E5%8F%8C%E8%AF%AD%E5%AD%97%E5%B9%95.rar'\r\n* Trying 210.129.49.133...\r\n* Trying 2001:470:24:401::1...\r\n* Immediate connect fail for 2001:470:24:401::1: Network is unreachable\r\n* Connected to assrt.net (210.129.49.133) port 80 (#0)\r\n> HEAD /download/217235/%E6%A4%8D%E7%89%A9%E7%8E%8B%E5%9B%BD%E7%AC%AC%E4%B8%89%E9%9B%86%E8%93%9D%E5%85%89%E7%89%88%E4%B8%AD%E8%8B%B1%E6%96%87%E5%8F%8A%E5%8F%8C%E8%AF%AD%E5%AD%97%E5%B9%95.rar HTTP/1.1\r\n> Host: assrt.net\r\n> User-Agent: curl/7.47.0\r\n> Accept: */*\r\n> \r\n< HTTP/1.1 302 Moved Temporarily\r\nHTTP/1.1 302 Moved Temporarily\r\n< Server: openresty\r\nServer: openresty\r\n< Date: Fri, 07 Jul 2017 09:06:29 GMT\r\nDate: Fri, 07 Jul 2017 09:06:29 GMT\r\n< Content-Type: text/html\r\nContent-Type: text/html\r\n< Content-Length: 154\r\nContent-Length: 154\r\n< Connection: keep-alive\r\nConnection: keep-alive\r\n< Location: http://file0.assrt.net/download/217235/%E6%A4%8D%E7%89%A9%E7%8E%8B%E5%9B%BD%E7%AC%AC%E4%B8%89%E9%9B%86%E8%93%9D%E5%85%89%E7%89%88%E4%B8%AD%E8%8B%B1%E6%96%87%E5%8F%8A%E5%8F%8C%E8%AF%AD%E5%AD%97%E5%B9%95.rar?_=1499418389&-=2e12dadb7fd23e0f65e121f62890f7d2\r\nLocation: http://file0.assrt.net/download/217235/%E6%A4%8D%E7%89%A9%E7%8E%8B%E5%9B%BD%E7%AC%AC%E4%B8%89%E9%9B%86%E8%93%9D%E5%85%89%E7%89%88%E4%B8%AD%E8%8B%B1%E6%96%87%E5%8F%8A%E5%8F%8C%E8%AF%AD%E5%AD%97%E5%B9%95.rar?_=1499418389&-=2e12dadb7fd23e0f65e121f62890f7d2\r\n< Master: Yoda\r\nMaster: Yoda\r\n< Droid: R2-D2\r\nDroid: R2-D2\r\n\r\n< \r\n* Connection #0 to host assrt.net left intact\r\n* Issue another request to this URL: 'http://file0.assrt.net/download/217235/%E6%A4%8D%E7%89%A9%E7%8E%8B%E5%9B%BD%E7%AC%AC%E4%B8%89%E9%9B%86%E8%93%9D%E5%85%89%E7%89%88%E4%B8%AD%E8%8B%B1%E6%96%87%E5%8F%8A%E5%8F%8C%E8%AF%AD%E5%AD%97%E5%B9%95.rar?_=1499418389&-=2e12dadb7fd23e0f65e121f62890f7d2'\r\n* Trying 210.129.49.133...\r\n* Connected to file0.assrt.net (210.129.49.133) port 80 (#1)\r\n> HEAD /download/217235/%E6%A4%8D%E7%89%A9%E7%8E%8B%E5%9B%BD%E7%AC%AC%E4%B8%89%E9%9B%86%E8%93%9D%E5%85%89%E7%89%88%E4%B8%AD%E8%8B%B1%E6%96%87%E5%8F%8A%E5%8F%8C%E8%AF%AD%E5%AD%97%E5%B9%95.rar?_=1499418389&-=2e12dadb7fd23e0f65e121f62890f7d2 HTTP/1.1\r\n> Host: file0.assrt.net\r\n> User-Agent: curl/7.47.0\r\n> Accept: */*\r\n> \r\n< HTTP/1.1 200 OK\r\nHTTP/1.1 200 OK\r\n< Server: openresty\r\nServer: openresty\r\n< Date: Fri, 07 Jul 2017 09:06:30 GMT\r\nDate: Fri, 07 Jul 2017 09:06:30 GMT\r\n< Content-Type: application/octet-stream\r\nContent-Type: application/octet-stream\r\n< Content-Length: 67270\r\nContent-Length: 67270\r\n< Connection: keep-alive\r\nConnection: keep-alive\r\n< Last-Modified: Wed, 23 Mar 2016 13:15:41 GMT\r\nLast-Modified: Wed, 23 Mar 2016 13:15:41 GMT\r\n< ETag: \"56f296fd-106c6\"\r\nETag: \"56f296fd-106c6\"\r\n< Servant: Berserker\r\nServant: Berserker\r\n< Expires: Mon, 07 Aug 2017 09:06:30 GMT\r\nExpires: Mon, 07 Aug 2017 09:06:30 GMT\r\n< Cache-Control: max-age=2678400\r\nCache-Control: max-age=2678400\r\n< X-Cache: HIT\r\nX-Cache: HIT\r\n< Content-Disposition: subtitle; filename=\"植物王国第三集蓝光版中英文及双语字幕.rar\"\r\nContent-Disposition: subtitle; filename=\"植物王国第三集蓝光版中英文及双语字幕.rar\"\r\n< Accept-Ranges: bytes\r\nAccept-Ranges: bytes\r\n\r\n< \r\n* Connection #1 to host file0.assrt.net left intact\r\n```\r\n\r\nThe link could be not available after a short of time.\r\n\r\n```\r\n>>> a = requests.get('http://file0.assrt.net/download/217235/%E6%A4%8D%E7%89%A9%E7%8E%8B%E5%9B%BD%E7%AC%AC%E4%B8%89%E9%9B%86%E8%93%9D%E5%85%89%E7%89%88%E4%B8%AD%E8%8B%B1%E6%96%87%E5%8F%8A%E5%8F%8C%E8%AF%AD%E5%AD%97%E5%B9%95.rar?_=1499418389&-=2e12dadb7fd23e0f65e121f62890f7d2')\r\n>>> a.headers\r\n{'Server': 'openresty', 'Date': 'Fri, 07 Jul 2017 09:08:16 GMT', 'X-Cache': 'HIT', 'Connection': 'keep-alive', 'Content-Disposition': 'subtitle; filename=\"æ¤\\x8dç\\x89©ç\\x8e\\x8bå\\x9b½ç¬¬ä¸\\x89é\\x9b\\x86è\\x93\\x9då\\x85', 'Content-Type': 'application/octet-stream', 'Content-Length': '67270', 'Expires': 'Mon, 07 Aug 2017 09:08:16 GMT', 'Servant': 'Berserker', 'Cache-Control': 'max-age=2678400', 'Last-Modified': 'Wed, 23 Mar 2016 13:15:41 GMT', 'ETag': '\"56f296fd-106c6\"'}\r\n>>> a.headers['Content-Disposition']\r\n'subtitle; filename=\"æ¤\\x8dç\\x89©ç\\x8e\\x8bå\\x9b½ç¬¬ä¸\\x89é\\x9b\\x86è\\x93\\x9då\\x85'\r\n>>> a.headers['Content-Disposition'].encode('latin1')\r\nb'subtitle; filename=\"\\xe6\\xa4\\x8d\\xe7\\x89\\xa9\\xe7\\x8e\\x8b\\xe5\\x9b\\xbd\\xe7\\xac\\xac\\xe4\\xb8\\x89\\xe9\\x9b\\x86\\xe8\\x93\\x9d\\xe5\\x85'\r\n>>> a.headers['Content-Disposition'].encode('latin1').decode('utf-8')\r\nTraceback (most recent call last):\r\n File \"<stdin>\", line 1, in <module>\r\nUnicodeDecodeError: 'utf-8' codec can't decode bytes in position 44-45: unexpected end of data\r\n>>> a.headers['Content-Disposition'].encode('latin1').decode('utf-8', errors='ignore')\r\n'subtitle; filename=\"植物王国第三集蓝'\r\n```",
"Decoding as latin-1 cannot corrupt binary data: latin-1 is a character map encoding, which means that it has a one-to-one mapping of bytes to unicode code points. The corruption appears to be happening lower down the stack, or more likely in the redirect. Can you use Wireshark to capture the HTTP traffic that Requests is sending?",
"But why curl is doing fine?\r\n\r\n```\r\n17:15:11.019128 IP 192.168.42.34.50210 > 210.129.49.133.80: Flags [P.], seq 1:377, ack 1, win 58, options [nop,nop,TS val 43682431 ecr 794638478], length 376: HTTP: GET /download/217235/%E6%A4%8D%E7%89%A9%E7%8E%8B%E5%9B%BD%E7%AC%AC%E4%B8%89%E9%9B%86%E8%93%9D%E5%85%89%E7%89%88%E4%B8%AD%E8%8B%B1%E6%96%87%E5%8F%8A%E5%8F%8C%E8%AF%AD%E5%AD%97%E5%B9%95.rar?_=1499418389&-=2e12dadb7fd23e0f65e121f62890f7d2 HTTP/1.1\r\n\t0x0000: 4500 01ac 4e50 4000 4006 fc2a c0a8 2a22 E...NP@.@..*..*\"\r\n\t0x0010: d281 3185 c422 0050 ad55 c430 fc1f 7a0a ..1..\".P.U.0..z.\r\n\t0x0020: 8018 003a 8636 0000 0101 080a 029a 8a7f ...:.6..........\r\n\t0x0030: 2f5d 388e 4745 5420 2f64 6f77 6e6c 6f61 /]8.GET./downloa\r\n\t0x0040: 642f 3231 3732 3335 2f25 4536 2541 3425 d/217235/%E6%A4%\r\n\t0x0050: 3844 2545 3725 3839 2541 3925 4537 2538 8D%E7%89%A9%E7%8\r\n\t0x0060: 4525 3842 2545 3525 3942 2542 4425 4537 E%8B%E5%9B%BD%E7\r\n\t0x0070: 2541 4325 4143 2545 3425 4238 2538 3925 %AC%AC%E4%B8%89%\r\n\t0x0080: 4539 2539 4225 3836 2545 3825 3933 2539 E9%9B%86%E8%93%9\r\n\t0x0090: 4425 4535 2538 3525 3839 2545 3725 3839 D%E5%85%89%E7%89\r\n\t0x00a0: 2538 3825 4534 2542 3825 4144 2545 3825 %88%E4%B8%AD%E8%\r\n\t0x00b0: 3842 2542 3125 4536 2539 3625 3837 2545 8B%B1%E6%96%87%E\r\n\t0x00c0: 3525 3846 2538 4125 4535 2538 4625 3843 5%8F%8A%E5%8F%8C\r\n\t0x00d0: 2545 3825 4146 2541 4425 4535 2541 4425 %E8%AF%AD%E5%AD%\r\n\t0x00e0: 3937 2545 3525 4239 2539 352e 7261 723f 97%E5%B9%95.rar?\r\n\t0x00f0: 5f3d 3134 3939 3431 3833 3839 262d 3d32 _=1499418389&-=2\r\n\t0x0100: 6531 3264 6164 6237 6664 3233 6530 6636 e12dadb7fd23e0f6\r\n\t0x0110: 3565 3132 3166 3632 3839 3066 3764 3220 5e121f62890f7d2.\r\n\t0x0120: 4854 5450 2f31 2e31 0d0a 486f 7374 3a20 HTTP/1.1..Host:.\r\n\t0x0130: 6669 6c65 302e 6173 7372 742e 6e65 740d file0.assrt.net.\r\n\t0x0140: 0a41 6363 6570 743a 202a 2f2a 0d0a 4163 .Accept:.*/*..Ac\r\n\t0x0150: 6365 7074 2d45 6e63 6f64 696e 673a 2067 cept-Encoding:.g\r\n\t0x0160: 7a69 702c 2064 6566 6c61 7465 0d0a 436f zip,.deflate..Co\r\n\t0x0170: 6e6e 6563 7469 6f6e 3a20 6b65 6570 2d61 nnection:.keep-a\r\n\t0x0180: 6c69 7665 0d0a 5573 6572 2d41 6765 6e74 live..User-Agent\r\n\t0x0190: 3a20 7079 7468 6f6e 2d72 6571 7565 7374 :.python-request\r\n\t0x01a0: 732f 322e 3138 2e31 0d0a 0d0a s/2.18.1....\r\n17:15:11.162475 IP 210.129.49.133.80 > 192.168.42.34.50210: Flags [.], ack 377, win 235, options [nop,nop,TS val 794638514 ecr 43682431], length 0\r\n\t0x0000: 4548 0034 42b8 4000 2b06 1df3 d281 3185 EH.4B.@.+.....1.\r\n\t0x0010: c0a8 2a22 0050 c422 fc1f 7a0a ad55 c5a8 ..*\".P.\"..z..U..\r\n\t0x0020: 8010 00eb e43c 0000 0101 080a 2f5d 38b2 .....<....../]8.\r\n\t0x0030: 029a 8a7f ....\r\n17:15:11.162623 IP 210.129.49.133.80 > 192.168.42.34.50210: Flags [.], ack 377, win 235, options [nop,nop,TS val 794638514 ecr 43682431], length 0\r\n\t0x0000: 4548 0034 42b9 4000 2b06 1df2 d281 3185 EH.4B.@.+.....1.\r\n\t0x0010: c0a8 2a22 0050 c422 fc1f 7a0a ad55 c5a8 ..*\".P.\"..z..U..\r\n\t0x0020: 8010 00eb e43c 0000 0101 080a 2f5d 38b2 .....<....../]8.\r\n\t0x0030: 029a 8a7f ....\r\n17:15:11.277061 IP 210.129.49.133.80 > 192.168.42.34.50210: Flags [.], seq 1:1389, ack 377, win 235, options [nop,nop,TS val 794638541 ecr 43682431], length 1388: HTTP: HTTP/1.1 200 OK\r\n\t0x0000: 4548 05a0 42ba 4000 2b06 1885 d281 3185 EH..B.@.+.....1.\r\n\t0x0010: c0a8 2a22 0050 c422 fc1f 7a0a ad55 c5a8 ..*\".P.\"..z..U..\r\n\t0x0020: 8010 00eb f62f 0000 0101 080a 2f5d 38cd ...../....../]8.\r\n\t0x0030: 029a 8a7f 4854 5450 2f31 2e31 2032 3030 ....HTTP/1.1.200\r\n\t0x0040: 204f 4b0d 0a53 6572 7665 723a 206f 7065 .OK..Server:.ope\r\n\t0x0050: 6e72 6573 7479 0d0a 4461 7465 3a20 4672 nresty..Date:.Fr\r\n\t0x0060: 692c 2030 3720 4a75 6c20 3230 3137 2030 i,.07.Jul.2017.0\r\n\t0x0070: 393a 3135 3a31 3120 474d 540d 0a43 6f6e 9:15:11.GMT..Con\r\n\t0x0080: 7465 6e74 2d54 7970 653a 2061 7070 6c69 tent-Type:.appli\r\n\t0x0090: 6361 7469 6f6e 2f6f 6374 6574 2d73 7472 cation/octet-str\r\n\t0x00a0: 6561 6d0d 0a43 6f6e 7465 6e74 2d4c 656e eam..Content-Len\r\n\t0x00b0: 6774 683a 2036 3732 3730 0d0a 436f 6e6e gth:.67270..Conn\r\n\t0x00c0: 6563 7469 6f6e 3a20 6b65 6570 2d61 6c69 ection:.keep-ali\r\n\t0x00d0: 7665 0d0a 4c61 7374 2d4d 6f64 6966 6965 ve..Last-Modifie\r\n\t0x00e0: 643a 2057 6564 2c20 3233 204d 6172 2032 d:.Wed,.23.Mar.2\r\n\t0x00f0: 3031 3620 3133 3a31 353a 3431 2047 4d54 016.13:15:41.GMT\r\n\t0x0100: 0d0a 4554 6167 3a20 2235 3666 3239 3666 ..ETag:.\"56f296f\r\n\t0x0110: 642d 3130 3663 3622 0d0a 5365 7276 616e d-106c6\"..Servan\r\n\t0x0120: 743a 2042 6572 7365 726b 6572 0d0a 4578 t:.Berserker..Ex\r\n\t0x0130: 7069 7265 733a 204d 6f6e 2c20 3037 2041 pires:.Mon,.07.A\r\n\t0x0140: 7567 2032 3031 3720 3039 3a31 353a 3131 ug.2017.09:15:11\r\n\t0x0150: 2047 4d54 0d0a 4361 6368 652d 436f 6e74 .GMT..Cache-Cont\r\n\t0x0160: 726f 6c3a 206d 6178 2d61 6765 3d32 3637 rol:.max-age=267\r\n\t0x0170: 3834 3030 0d0a 582d 4361 6368 653a 2048 8400..X-Cache:.H\r\n\t0x0180: 4954 0d0a 436f 6e74 656e 742d 4469 7370 IT..Content-Disp\r\n\t0x0190: 6f73 6974 696f 6e3a 2073 7562 7469 746c osition:.subtitl\r\n\t0x01a0: 653b 2066 696c 656e 616d 653d 22e6 a48d e;.filename=\"...\r\n\t0x01b0: e789 a9e7 8e8b e59b bde7 acac e4b8 89e9 ................\r\n\t0x01c0: 9b86 e893 9de5 8589 e789 88e4 b8ad e88b ................\r\n\t0x01d0: b1e6 9687 e58f 8ae5 8f8c e8af ade5 ad97 ................\r\n\t0x01e0: e5b9 952e 7261 7222 0d0a 4163 6365 7074 ....rar\"..Accept\r\n\t0x01f0: 2d52 616e 6765 733a 2062 7974 6573 0d0a -Ranges:.bytes..\r\n\t0x0200: 0d0a 5261 7221 1a07 00cf 9073 0000 0d00 ..Rar!.....s....\r\n\t0x0210: 0000 0000 0000 4988 7420 927d 0091 4300 ......I.t..}..C.\r\n\t0x0220: 0064 9900 0002 ff96 0f99 af72 1841 1d33 .d.........r.A.3\r\n\t0x0230: 5800 2000 0000 4253 6b79 422e 4b69 6e67 X.....BSkyB.King\r\n\t0x0240: 646f 6d2e 6f66 2e50 6c61 6e74 732e 336f dom.of.Plants.3o\r\n\t0x0250: 6634 2e53 7572 7669 7661 6c2e 3732 3070 f4.Survival.720p\r\n\t0x0260: 2e42 4452 6970 2e48 442e 7832 3634 2e41 .BDRip.HD.x264.A\r\n\t0x0270: 4143 2e4d 5647 726f 7570 2e6f 7267 2e43 AC.MVGroup.org.C\r\n\t0x0280: 6869 6e65 7365 2e73 7274 0001 c052 00b0 hinese.srt...R..\r\n\t0x0290: 3ad3 7410 2114 d50c cd9d 1016 157b ee22 :.t.!........{.\"\r\n\t0x02a0: fc1e fab3 a9dd def9 be88 cc8c e8bf 15c8 ................\r\n\t0x02b0: 8c8b 8c8c 8be8 fd11 9119 e368 94d2 4ca4 ...........h..L.\r\n\t0x02c0: d335 fe10 d551 35c2 6b80 d551 aa28 b293 .5...Q5.k..Q.(..\r\n\t0x02d0: 5c2d 36d7 3369 15c2 e2e1 8145 36ea a8ea \\-6.3i.....E6...\r\n\t0x02e0: 40de f740 bfd9 e019 d1f7 cfa1 bd91 200d @..@............\r\n\t0x02f0: 81a1 a1ae 3dd7 8909 1224 6848 d0d0 d44c ....=....$hH...L\r\n\t0x0300: cec5 4ff6 a49f 055f fe3f f059 6ff4 5fe2 ..O...._.?.Yo._.\r\n\t0x0310: ebfd 4c7f 37fc bfe7 ff3f fdbf e507 81bf ..L.7....?......\r\n\t0x0320: a963 2fef afe2 c9c7 bf4a efbb 7bc5 5fcf .c/......J..{._.\r\n\t0x0330: 2ac6 58f7 fd17 2ad2 fcbf b7fa 2c7f c7fe *.X...*.....,...\r\n\t0x0340: 115b abb2 caa2 5efa 9bfe d0ea 4e3c de7d .[....^.....N<.}\r\n\t0x0350: 179d 97f8 954b fa35 ead5 f6ff 0036 4d58 .....K.5.....6MX\r\n\t0x0360: 64c9 66cd d61c fa9a 6ccf 1e1d cbb8 6b54 d.f.....l.....kT\r\n\t0x0370: dea3 467d e67f ed6f c18f 6ccb 6fd1 97e0 ..F}...o..l.o...\r\n\t0x0380: 0534 6343 1b75 83e3 ffd8 3077 ab3a f66c .4cC.u....0w.:.l\r\n\t0x0390: 7262 a153 e177 e5fd 1b7e 78fc 59d5 7e2a rb.S.w...~x.Y.~*\r\n\t0x03a0: fc86 8d9a b3ab 5658 74fd 64c9 f7da 37a9 ......VXt.d...7.\r\n\t0x03b0: 75ee 46a3 e1dc f75d ed4d b142 86af 45d1 u.F....].M.B..E.\r\n\t0x03c0: a438 de3c d44d 1c35 69af a9c7 15d3 4d3b .8.<.M.5i.....M;\r\n\t0x03d0: f53c d3e6 5a7d a925 2146 bb26 ee92 6d7e .<..Z}.%!F.&..m~\r\n\t0x03e0: 53ef d3ab 1f96 9cfe 1f78 b83a 6ada da21 S........x.:j..!\r\n\t0x03f0: a75c fd6f 4a4b 2e58 6009 014a afa4 7e72 .\\.oJK.X`..J..~r\r\n\t0x0400: 70fd 92fe ebfe 8d7a 05e8 8596 d6f5 059f p......z........\r\n\t0x0410: 3502 d3c5 b3dc 7971 f937 3cd7 bbe8 1331 5.....yq.7<....1\r\n\t0x0420: 38a7 cc3d a2ad 1f8b ffa5 8b26 ffb1 cea3 8..=.......&....\r\n\t0x0430: ec59 2deb abd5 a723 2e1b 7f09 3e2c 15aa .Y-....#....>,..\r\n\t0x0440: c901 ae44 0e0b 363e a61d 5d51 d1bf 45e9 ...D..6>..]Q..E.\r\n\t0x0450: 7a2d a6a9 bed9 757f 96ff 725f efaa aa1f z-....u...r_....\r\n\t0x0460: 09d3 b488 81e5 cc0b 4bc7 cd56 b8f3 d0ed ........K..V....\r\n\t0x0470: 8c75 caed 6dea cf48 133a d725 6022 3899 .u..m..H.:.%`\"8.\r\n\t0x0480: 4bfa 28bb 2c18 d117 5857 1b5c b3f5 9e67 K.(.,...XW.\\...g\r\n\t0x0490: 3bef a927 87bf 4faf 1f46 6c6a 0ec1 7ff8 ;..'..O..Flj....\r\n\t0x04a0: de6e 0eda 0799 35d2 369f de36 115f 587c .n....5.6..6._X|\r\n\t0x04b0: bfb5 8b34 ef5c b38f 6277 c285 ca38 8172 ...4.\\..bw...8.r\r\n\t0x04c0: c9b7 67d5 f4d0 3ed1 874c 9870 d8f9 6d79 ..g...>..L.p..my\r\n\t0x04d0: 61ef 3a79 3aa0 5c2c 69f3 83f4 b98a afa1 a.:y:.\\,i.......\r\n\t0x04e0: 038d 982b 43a7 c22f e37f d843 ef13 3639 ...+C../...C..69\r\n\t0x04f0: eb18 9cde 7a3d 7977 7488 35dd cb98 fa87 ....z=ywt.5.....\r\n\t0x0500: f9c3 5634 fac9 b595 8e9e 2d59 c51c 177b ..V4......-Y...{\r\n\t0x0510: 7a40 cf8d 1cc3 d2c3 7aff 877b dc6f 9d35 [email protected]..{.o.5\r\n\t0x0520: 45a5 83e3 5cfc b8d9 a73e f1b6 6874 eefb E...\\....>..ht..\r\n\t0x0530: f1e1 34bf 26ac 9d22 70d2 9732 afc4 df9e ..4.&..\"p..2....\r\n\t0x0540: 31a2 6cff 07c6 cb6f e5b3 dd5e e6c6 8b75 1.l....o...^...u\r\n\t0x0550: f31c f8b8 fba7 e8e0 b79d 3b2c 0def da71 ..........;,...q\r\n\t0x0560: 162f fd54 ffdf d5a3 66b5 1dee c65e cd1c ./.T....f....^..\r\n\t0x0570: 567c 167f 499e 7c19 bfb3 ffe7 fdbf dbff V|..I.|.........\r\n\t0x0580: 1feb febf f5ff f33a ffa7 fdff faff c7ff .......:........\r\n\t0x0590: bff7 ffa7 ff7f fc7f b7fd 7fb6 8d4f 365b .............O6[\r\n```\r\nit is utf-8 encoded:\r\n```\r\n>>> b\"\"\"\\x65\\x3b\\x20\\x66\\x69\\x6c\\x65\\x6e\\x61\\x6d\\x65\\x3d\\x22\\xe6\\xa4\\x8d\\xe7\\x89\\xa9\\xe7\\x8e\\x8b\\xe5\\x9b\\xbd\\xe7\\xac\\xac\\xe4\\xb8\\x89\\xe9\\x9b\\x86\\xe8\\x93\\x9d\\xe5\\x85\\x89\\xe7\\x89\\x88\\xe4\\xb8\\xad\\xe8\\x8b\\xb1\\xe6\\x96\\x87\\xe5\\x8f\\x8a\\xe5\\x8f\\x8c\\xe8\\xaf\\xad\\xe5\\xad\\x97\\xe5\\xb9\\x95\\x2e\\x72\\x61\\x72\\x22\"\"\".decode('utf-8')\r\n'e; filename=\"植物王国第三集蓝光版中英文及双语字幕.rar\"'\r\n```",
"And that tcpdump result is from python-requests, not curl.",
"Somehow, requests striped last 32 bytes on the value of 'Content-Disposition'.",
"Yup, that appears to be the problem here. Requests isn't doing custom header parsing here: it's done by `http.client`. So I suspect `http.client` is the one making the error.\r\n\r\nI recommend trying to use `http.client` to reproduce that request and see if the error persists. If it does, this is a bug in the Python standard library.",
"I tried http.client. It didn't reproduce the error.\r\n```\r\n#!/usr/bin/python3\r\n# coding: utf-8\r\n\r\nimport http.client\r\n\r\nconn = http.client.HTTPConnection(\"file0.assrt.net\", 80)\r\nconn.set_debuglevel(9)\r\n#http://assrt.net/download/217233/%E6%A4%8D%E7%89%A9%E7%8E%8B%E5%9B%BD%E7%AC%AC%E4%B8%80%E9%9B%86%E8%93%9D%E5%85%89%E7%89%88%E4%B8%AD%E8%8B%B1%E6%96%87%E5%8F%8A%E5%8F%8C%E8%AF%AD%E5%AD%97%E5%B9%95.rar\r\nconn.request(\"HEAD\",\"/download/217234/%E6%A4%8D%E7%89%A9%E7%8E%8B%E5%9B%BD%E7%AC%AC%E4%BA%8C%E9%9B%86%E8%93%9D%E5%85%89%E7%89%88%E4%B8%AD%E8%8B%B1%E6%96%87%E5%8F%8A%E5%8F%8C%E8%AF%AD%E5%AD%97%E5%B9%95.rar?_=1499423618&-=cf2f5266fe8012534e2c0a8c8ac8aafe\")\r\nresponse = conn.getresponse()\r\nprint (response.getheaders())\r\nprint (response.getheader('Content-Disposition').encode('latin1').decode('utf-8'))\r\n\r\nsend: b'HEAD /download/217234/%E6%A4%8D%E7%89%A9%E7%8E%8B%E5%9B%BD%E7%AC%AC%E4%BA%8C%E9%9B%86%E8%93%9D%E5%85%89%E7%89%88%E4%B8%AD%E8%8B%B1%E6%96%87%E5%8F%8A%E5%8F%8C%E8%AF%AD%E5%AD%97%E5%B9%95.rar?_=1499423618&-=cf2f5266fe8012534e2c0a8c8ac8aafe HTTP/1.1\\r\\nHost: file0.assrt.net\\r\\nAccept-Encoding: identity\\r\\n\\r\\n'\r\nreply: 'HTTP/1.1 200 OK\\r\\n'\r\nheader: Server header: Date header: Content-Type header: Content-Length header: Connection header: Last-Modified header: ETag header: Servant header: Expires header: Cache-Control header: X-Cache header: Content-Disposition header: Accept-Ranges [('Server', 'openresty'), ('Date', 'Fri, 07 Jul 2017 10:36:32 GMT'), ('Content-Type', 'application/octet-stream'), ('Content-Length', '62859'), ('Connection', 'keep-alive'), ('Last-Modified', 'Wed, 23 Mar 2016 13:15:41 GMT'), ('ETag', '\"56f296fd-f58b\"'), ('Servant', 'Berserker'), ('Expires', 'Mon, 07 Aug 2017 10:36:32 GMT'), ('Cache-Control', 'max-age=2678400'), ('X-Cache', 'HIT'), ('Content-Disposition', 'subtitle; filename=\"æ¤\\x8dç\\x89©ç\\x8e\\x8bå\\x9b½ç¬¬äº\\x8cé\\x9b\\x86è\\x93\\x9då\\x85\\x89ç\\x89\\x88ä¸\\xadè\\x8b±æ\\x96\\x87å\\x8f\\x8aå\\x8f\\x8cè¯\\xadå\\xad\\x97å¹\\x95.rar\"'), ('Accept-Ranges', 'bytes')]\r\nsubtitle; filename=\"植物王国第二集蓝光版中英文及双语字幕.rar\"\r\n```",
"And urllib3:\r\n```\r\nhttp = urllib3.PoolManager()\r\nr = http.request(\"HEAD\",\"http://assrt.net/download/217234/%E6%A4%8D%E7%89%A9%E7%8E%8B%E5%9B%BD%E7%AC%AC%E4%BA%8C%E9%9B%86%E8%93%9D%E5%85%89%E7%89%88%E4%B8%AD%E8%8B%B1%E6%96%87%E5%8F%8A%E5%8F%8C%E8%AF%AD%E5%AD%97%E5%B9%95.rar?_=1499423618&-=cf2f5266fe8012534e2c0a8c8ac8aafe\")\r\nprint (r.headers)\r\nprint (r.headers['Content-Disposition'].encode('iso-8859-1').decode('utf-8'))\r\n\r\nHTTPHeaderDict({'Server': 'openresty', 'Date': 'Fri, 07 Jul 2017 10:44:12 GMT', 'Content-Type': 'application/octet-stream', 'Content-Length': '62859', 'Connection': 'keep-alive', 'Last-Modified': 'Wed, 23 Mar 2016 13:15:41 GMT', 'ETag': '\"56f296fd-f58b\"', 'Servant': 'Berserker', 'Expires': 'Mon, 07 Aug 2017 10:44:12 GMT', 'Cache-Control': 'max-age=2678400', 'X-Cache': 'HIT', 'Content-Disposition': 'subtitle; filename=\"æ¤\\x8dç\\x89©ç\\x8e\\x8bå\\x9b½ç¬¬äº\\x8cé\\x9b\\x86è\\x93\\x9då\\x85\\x89ç\\x89\\x88ä¸\\xadè\\x8b±æ\\x96\\x87å\\x8f\\x8aå\\x8f\\x8cè¯\\xadå\\xad\\x97å¹\\x95.rar\"', 'Accept-Ranges': 'bytes'})\r\nsubtitle; filename=\"植物王国第二集蓝光版中英文及双语字幕.rar\"\r\n\r\n```",
"Sorry, I screwed it up with a regex matching on latin1 regex with unicode. Nvm.."
] |
https://api.github.com/repos/psf/requests/issues/4186
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4186/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4186/comments
|
https://api.github.com/repos/psf/requests/issues/4186/events
|
https://github.com/psf/requests/issues/4186
| 240,484,062 |
MDU6SXNzdWUyNDA0ODQwNjI=
| 4,186 |
Request with Empty Content Throws Errors When `.json()` is Called
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/702729?v=4",
"events_url": "https://api.github.com/users/joshmgrant/events{/privacy}",
"followers_url": "https://api.github.com/users/joshmgrant/followers",
"following_url": "https://api.github.com/users/joshmgrant/following{/other_user}",
"gists_url": "https://api.github.com/users/joshmgrant/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/joshmgrant",
"id": 702729,
"login": "joshmgrant",
"node_id": "MDQ6VXNlcjcwMjcyOQ==",
"organizations_url": "https://api.github.com/users/joshmgrant/orgs",
"received_events_url": "https://api.github.com/users/joshmgrant/received_events",
"repos_url": "https://api.github.com/users/joshmgrant/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/joshmgrant/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/joshmgrant/subscriptions",
"type": "User",
"url": "https://api.github.com/users/joshmgrant",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 9 |
2017-07-04T19:04:32Z
|
2021-09-08T08:00:38Z
|
2017-07-04T19:33:17Z
|
NONE
|
resolved
|
I'm running into an issue where calling `.json()` on a response with empty content is resulting in JSON errors.
## Expected Result
Calling `response.json()` results in creating some object that can be used appropriately by other functions.
## Actual Result
Calling `response.json()` results in a `KeyError`.
## Reproduction Steps
```python
session = requests.Session()
response = self.session.delete(
"{}{}".format(self.url, "api/delete_entity/123"),
data=json.dumps(valid_data),
headers=self.headers
)
return response.json()
```
The response above looks like this:
```python
response = {Response} <Response [204]>
_content = {bytes} b''
_content_consumed = {bool} True
apparent_encoding = {NoneType} None
connection = {HTTPAdapter} <requests.adapters.HTTPAdapter object at 0x104b71eb8>
content = {bytes} b''
cookies = {RequestsCookieJar} <RequestsCookieJar[<Cookie sessionid=XXX for 10.8.8.8/>]>
elapsed = {timedelta} 0:00:00.080925
encoding = {NoneType} None
headers = {CaseInsensitiveDict} {'Content-Length': '0', 'Vary': 'Accept, Cookie', 'Allow': 'GET, PUT, PATCH, DELETE, HEAD, OPTIONS', 'Server': 'nginx/1.4.6 (Ubuntu)', 'Connection': 'keep-alive', 'Set-Cookie': 'sessionid=XXX; expires=Wed, 05-Jul-2017 02:54:47
history = {list} <class 'list'>: []
is_permanent_redirect = {bool} False
is_redirect = {bool} False
links = {dict} {}
ok = {bool} True
raw = {HTTPResponse} <requests.packages.urllib3.response.HTTPResponse object at 0x104b632b0>
reason = {str} 'No Content'
request = {PreparedRequest} <PreparedRequest [DELETE]>
status_code = {int} 204
text = {str} ''
url = {str} 'http://10.8.8.8:8888/api/delete_entity/123'
```
## System Information
```
OS: MacOS Sierra 10.12.5
Python: 3.4.3 and Python 3.6.1
Requests: 2.18.1
```
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4",
"events_url": "https://api.github.com/users/Lukasa/events{/privacy}",
"followers_url": "https://api.github.com/users/Lukasa/followers",
"following_url": "https://api.github.com/users/Lukasa/following{/other_user}",
"gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Lukasa",
"id": 1382556,
"login": "Lukasa",
"node_id": "MDQ6VXNlcjEzODI1NTY=",
"organizations_url": "https://api.github.com/users/Lukasa/orgs",
"received_events_url": "https://api.github.com/users/Lukasa/received_events",
"repos_url": "https://api.github.com/users/Lukasa/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Lukasa",
"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/4186/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4186/timeline
| null |
completed
| null | null | false |
[
"Requests 2.13 is very old. This problem should be resolved by updating Requests.",
"This also occurrs using requests 2.18.1. I'll update the issue.",
"Can you provide the full traceback please?",
"Here's a traceback from a pytest run. Some values have been replaced with ### for security reasons (but those ###'s do represent valid values).\r\n\r\n-----------------------------\r\n\r\n```\r\nself = <json.decoder.JSONDecoder object at 0x101f9b6d8>, s = '', idx = 0\r\n\r\n def raw_decode(self, s, idx=0):\r\n \"\"\"Decode a JSON document from ``s`` (a ``str`` beginning with\r\n a JSON document) and return a 2-tuple of the Python\r\n representation and the index in ``s`` where the document ended.\r\n \r\n This can be used to decode a JSON document from a string that may\r\n have extraneous data at the end.\r\n \r\n \"\"\"\r\n try:\r\n> obj, end = self.scan_once(s, idx)\r\nE StopIteration: 0\r\n\r\n/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/json/decoder.py:355: StopIteration\r\n\r\nDuring handling of the above exception, another exception occurred:\r\n\r\nself = <test_create_entity.Test object at 0x10a4cf4a8>\r\ndata = <data.nectar_data.Data object at 0x103c36d30>\r\n\r\n def test_delete_impression_flight(self, data):\r\n \"\"\"Verify that an admin user can delete a flight from an impressions-based campaign.\"\"\"\r\n line = data.make(LineData)\r\n line_resp = self.nectar.create_line(line)\r\n line_id = line_resp['id']\r\n self.nectar.line_action(line_id, \"submit\", line)\r\n assert line_resp['status_code'] == 201\r\n \r\n flight = FlightData().make(line=line_resp['id'])\r\n flight_resp = self.nectar.create_flight(line_id)\r\n assert flight_resp['status_code'] == 201\r\n \r\n> del_flight = self.nectar.delete_flight(flight_resp['id'], flight)\r\n\r\ntest_create_flight.py:109: \r\n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \r\n\r\nself = <apiobjects.nectar_api.NectarAPI object at 0x103cb5b70>\r\nflight_id = ###, data = {'line': ###}\r\n\r\n def delete_flight(self, flight_id, data):\r\n> return self.delete(\"api/v2/flight/{}\".format(flight_id), data)\r\n\r\n../apiobjects/nectar_api.py:43: \r\n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \r\n\r\nself = <apiobjects.nectar_api.NectarAPI object at 0x103cb5b70>\r\napi_call = 'api/v2/flight/###', data = {'line': ###}\r\n\r\n def delete(self, api_call, data):\r\n response = self.session.delete(\r\n \"{}{}\".format(self.url, api_call),\r\n data=json.dumps(data),\r\n headers=self.headers\r\n )\r\n> return APIResponse(response)\r\n\r\n../apiobjects/base_api.py:53: \r\n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \r\n\r\nself = {}, response = <Response [204]>\r\n\r\n def __init__(self, response):\r\n self._response = response\r\n> super().__init__(response.json())\r\n\r\n../apiobjects/base_api.py:11: \r\n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \r\n\r\nself = <Response [204]>, kwargs = {}\r\n\r\n def json(self, **kwargs):\r\n r\"\"\"Returns the json-encoded content of a response, if any.\r\n \r\n :param \\*\\*kwargs: Optional arguments that ``json.loads`` takes.\r\n :raises ValueError: If the response body does not contain valid json.\r\n \"\"\"\r\n \r\n if not self.encoding and self.content and len(self.content) > 3:\r\n # No encoding set. JSON RFC 4627 section 3 states we should expect\r\n # UTF-8, -16 or -32. Detect which one to use; If the detection or\r\n # decoding fails, fall back to `self.text` (using chardet to make\r\n # a best guess).\r\n encoding = guess_json_utf(self.content)\r\n if encoding is not None:\r\n try:\r\n return complexjson.loads(\r\n self.content.decode(encoding), **kwargs\r\n )\r\n except UnicodeDecodeError:\r\n # Wrong UTF codec detected; usually because it's not UTF-8\r\n # but some other 8-bit codec. This is an RFC violation,\r\n # and the server didn't bother to tell us what codec *was*\r\n # used.\r\n pass\r\n> return complexjson.loads(self.text, **kwargs)\r\n\r\n../.venv/lib/python3.6/site-packages/requests/models.py:894: \r\n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \r\n\r\ns = '', encoding = None, cls = None, object_hook = None, parse_float = None\r\nparse_int = None, parse_constant = None, object_pairs_hook = None, kw = {}\r\n\r\n def loads(s, *, encoding=None, cls=None, object_hook=None, parse_float=None,\r\n parse_int=None, parse_constant=None, object_pairs_hook=None, **kw):\r\n \"\"\"Deserialize ``s`` (a ``str``, ``bytes`` or ``bytearray`` instance\r\n containing a JSON document) to a Python object.\r\n \r\n ``object_hook`` is an optional function that will be called with the\r\n result of any object literal decode (a ``dict``). The return value of\r\n ``object_hook`` will be used instead of the ``dict``. This feature\r\n can be used to implement custom decoders (e.g. JSON-RPC class hinting).\r\n \r\n ``object_pairs_hook`` is an optional function that will be called with the\r\n result of any object literal decoded with an ordered list of pairs. The\r\n return value of ``object_pairs_hook`` will be used instead of the ``dict``.\r\n This feature can be used to implement custom decoders that rely on the\r\n order that the key and value pairs are decoded (for example,\r\n collections.OrderedDict will remember the order of insertion). If\r\n ``object_hook`` is also defined, the ``object_pairs_hook`` takes priority.\r\n \r\n ``parse_float``, if specified, will be called with the string\r\n of every JSON float to be decoded. By default this is equivalent to\r\n float(num_str). This can be used to use another datatype or parser\r\n for JSON floats (e.g. decimal.Decimal).\r\n \r\n ``parse_int``, if specified, will be called with the string\r\n of every JSON int to be decoded. By default this is equivalent to\r\n int(num_str). This can be used to use another datatype or parser\r\n for JSON integers (e.g. float).\r\n \r\n ``parse_constant``, if specified, will be called with one of the\r\n following strings: -Infinity, Infinity, NaN.\r\n This can be used to raise an exception if invalid JSON numbers\r\n are encountered.\r\n \r\n To use a custom ``JSONDecoder`` subclass, specify it with the ``cls``\r\n kwarg; otherwise ``JSONDecoder`` is used.\r\n \r\n The ``encoding`` argument is ignored and deprecated.\r\n \r\n \"\"\"\r\n if isinstance(s, str):\r\n if s.startswith('\\ufeff'):\r\n raise JSONDecodeError(\"Unexpected UTF-8 BOM (decode using utf-8-sig)\",\r\n s, 0)\r\n else:\r\n if not isinstance(s, (bytes, bytearray)):\r\n raise TypeError('the JSON object must be str, bytes or bytearray, '\r\n 'not {!r}'.format(s.__class__.__name__))\r\n s = s.decode(detect_encoding(s), 'surrogatepass')\r\n \r\n if (cls is None and object_hook is None and\r\n parse_int is None and parse_float is None and\r\n parse_constant is None and object_pairs_hook is None and not kw):\r\n> return _default_decoder.decode(s)\r\n\r\n/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/json/__init__.py:354: \r\n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \r\n\r\nself = <json.decoder.JSONDecoder object at 0x101f9b6d8>, s = ''\r\n_w = <built-in method match of _sre.SRE_Pattern object at 0x101e60e70>\r\n\r\n def decode(self, s, _w=WHITESPACE.match):\r\n \"\"\"Return the Python representation of ``s`` (a ``str`` instance\r\n containing a JSON document).\r\n \r\n \"\"\"\r\n> obj, end = self.raw_decode(s, idx=_w(s, 0).end())\r\n\r\n/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/json/decoder.py:339: \r\n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \r\n\r\nself = <json.decoder.JSONDecoder object at 0x101f9b6d8>, s = '', idx = 0\r\n\r\n def raw_decode(self, s, idx=0):\r\n \"\"\"Decode a JSON document from ``s`` (a ``str`` beginning with\r\n a JSON document) and return a 2-tuple of the Python\r\n representation and the index in ``s`` where the document ended.\r\n \r\n This can be used to decode a JSON document from a string that may\r\n have extraneous data at the end.\r\n \r\n \"\"\"\r\n try:\r\n obj, end = self.scan_once(s, idx)\r\n except StopIteration as err:\r\n> raise JSONDecodeError(\"Expecting value\", s, err.value) from None\r\nE json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)\r\n\r\n/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/json/decoder.py:357: JSONDecodeError\r\n\r\n```",
"Ok, so this isn't a `KeyError`, it's a `JSONDecodeError`. That seems like exactly the error I'd expect to see: what's the problem here?",
"The problem (potentially) is that a valid response with empty content causes `response.json ()` to throw an exception. Is this buggy behavior? Should this case return in something like `{}` instead? I may be incorrect in my model of how such responses work.",
"No, the exception is the only safe outcome. \r\n\r\nIf we returned `{}`, it becomes difficult to tell the difference between no content and a JSON document that reads `{}`. The same applies to the empty string or to `None`: all are possible results of JSON decoding. \r\n\r\nSo I think the exception is correct. ",
"@joshmgrant specifically, this exception is thrown by `json.loads` which is in the standard library. If you call `response.json()` and the `response.content` is empty or even something that's invalid JSON, what else could we do but provide the exception? We didn't do anything wrong, ostensibly, you were expecting valid JSON but that's not what you received. Why would we hide that from you?",
"This is exactly the information I was missing! This makes sense now and I'll look for handling exceptions in the case of empty `response.content`. Thanks so much!"
] |
https://api.github.com/repos/psf/requests/issues/4185
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4185/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4185/comments
|
https://api.github.com/repos/psf/requests/issues/4185/events
|
https://github.com/psf/requests/issues/4185
| 240,481,029 |
MDU6SXNzdWUyNDA0ODEwMjk=
| 4,185 |
Allow feeding certificates via buffer (instead of path)
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/3209700?v=4",
"events_url": "https://api.github.com/users/mdaize/events{/privacy}",
"followers_url": "https://api.github.com/users/mdaize/followers",
"following_url": "https://api.github.com/users/mdaize/following{/other_user}",
"gists_url": "https://api.github.com/users/mdaize/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/mdaize",
"id": 3209700,
"login": "mdaize",
"node_id": "MDQ6VXNlcjMyMDk3MDA=",
"organizations_url": "https://api.github.com/users/mdaize/orgs",
"received_events_url": "https://api.github.com/users/mdaize/received_events",
"repos_url": "https://api.github.com/users/mdaize/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/mdaize/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/mdaize/subscriptions",
"type": "User",
"url": "https://api.github.com/users/mdaize",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 3 |
2017-07-04T18:38:01Z
|
2021-09-08T08:00:36Z
|
2017-07-20T11:17:12Z
|
NONE
|
resolved
|
Summary.
* I am trying to make a certificate-based request to an external URL using requests.get. I am trying to feed it the output of a call from the crypto library but it only allows paths.
What you expected.
* I should be able to feed `cert=(certificate, private_key)` as part of a request with byte strings instead of file paths (of course in addition to)
* This allows one to possibly avoid storing private keys at the path level and instead import a secured container (JKS for example) containing the key
What happened instead.
The request call seems to only take a file path and results in an error unable to find the file:
```OSError: Could not find the TLS certificate file, invalid path: b'-----BEGIN CERTIFICATE-----\n...\n-----END CERTIFICATE-----\n```
## Reproduction Steps
```python
import requests
import crypto
# Omitting argparse, file.read() commands for brevity in this example
p12 = crypto.load_pkcs12(keystoreFile, keystorePassphrase)
# These following commands output the contents of the loaded keystore
# In order to work around the error, they need to be redirected to new files (certificate.file, private_key.file
# These new file paths needs to be provided to the `requests.get` call
cert = crypto.dump_certificate(crypto.FILETYPE_PEM, p12.get_certificate())
caPem = crypto.dump_privatekey(crypto.FILETYPE_PEM, p12.get_privatekey())
resp = requests.get(APIURL, cert=(cert, caPem), verify=False)
```
## System Information
```
{
"chardet": {
"version": "3.0.4"
},
"cryptography": {
"version": "1.9"
},
"implementation": {
"name": "CPython",
"version": "3.6.1"
},
"platform": {
"release": "16.6.0",
"system": "Darwin"
},
"pyOpenSSL": {
"openssl_version": "1010006f",
"version": "17.1.0"
},
"requests": {
"version": "2.18.1"
},
"system_ssl": {
"version": "100020cf"
},
"urllib3": {
"version": "1.21.1"
},
"using_pyopenssl": true
}
```
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4",
"events_url": "https://api.github.com/users/Lukasa/events{/privacy}",
"followers_url": "https://api.github.com/users/Lukasa/followers",
"following_url": "https://api.github.com/users/Lukasa/following{/other_user}",
"gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Lukasa",
"id": 1382556,
"login": "Lukasa",
"node_id": "MDQ6VXNlcjEzODI1NTY=",
"organizations_url": "https://api.github.com/users/Lukasa/orgs",
"received_events_url": "https://api.github.com/users/Lukasa/received_events",
"repos_url": "https://api.github.com/users/Lukasa/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Lukasa",
"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/4185/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4185/timeline
| null |
completed
| null | null | false |
[
"So this is a sufficiently unusual use-case that we recommend solving this by passing a [`SSLContext` directly](https://lukasa.co.uk/2017/02/Configuring_TLS_With_Requests/). This can be configured with the appropriate client certs loaded from the underlying library as appropriate.\r\n\r\nDoes that sufficiently address your use case?",
"Hmm, passing certificates as env variables might also be a good use case here, it is often used in containerized environments.",
"@deejay1 Given that it's about three lines of product code to write it for your own apps, I'm not sure it's worth adding it to the core library. Again, I think the `SSLContext` is the best approach."
] |
https://api.github.com/repos/psf/requests/issues/4184
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4184/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4184/comments
|
https://api.github.com/repos/psf/requests/issues/4184/events
|
https://github.com/psf/requests/issues/4184
| 240,394,262 |
MDU6SXNzdWUyNDAzOTQyNjI=
| 4,184 |
Allow hooking (de)compression
|
{
"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 | 1 |
2017-07-04T11:33:24Z
|
2021-09-08T08:00:39Z
|
2017-07-04T13:28:20Z
|
NONE
|
resolved
|
I have searched the repo for strings "gzip", "zlib" and have not found this packages imported. It seems that (de)compression is done implicitly somewhere. It poses some problems, for example if I want to add support of some compression/decompression algo like brotli.
## Expected Result
There should be a dict mapping compression algo name from http headers to (de)compresssion function.
## Actual Result
I have not found such one.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4",
"events_url": "https://api.github.com/users/Lukasa/events{/privacy}",
"followers_url": "https://api.github.com/users/Lukasa/followers",
"following_url": "https://api.github.com/users/Lukasa/following{/other_user}",
"gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Lukasa",
"id": 1382556,
"login": "Lukasa",
"node_id": "MDQ6VXNlcjEzODI1NTY=",
"organizations_url": "https://api.github.com/users/Lukasa/orgs",
"received_events_url": "https://api.github.com/users/Lukasa/received_events",
"repos_url": "https://api.github.com/users/Lukasa/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Lukasa",
"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/4184/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4184/timeline
| null |
completed
| null | null | false |
[
"I don't think there is any need for this. I think it'll be sufficient to wrap the `read` function in the response object to achieve this goal. "
] |
https://api.github.com/repos/psf/requests/issues/4183
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4183/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4183/comments
|
https://api.github.com/repos/psf/requests/issues/4183/events
|
https://github.com/psf/requests/pull/4183
| 240,282,436 |
MDExOlB1bGxSZXF1ZXN0MTI4NzA2MzA3
| 4,183 |
Fix help ssl check
|
{
"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 | 2 |
2017-07-03T23:47:34Z
|
2021-09-05T00:07:11Z
|
2017-07-04T08:16:03Z
|
MEMBER
|
resolved
|
This will resolve the test failures discovered in #4182. We were retrieving the `OPENSSL_VERSION_NUMBER` from the system `ssl` module in all cases before now. This attribute doesn't exist in Python 2.6 causing new tests for the `info()` method to fail. This patch will return an empty value for Python 2.6 since we don't seem to have a way to reliably check the openssl version.
@Lukasa @sigmavirus24, I've pushed this branch up to the requests repo directly, so feel free to chop this up or do anything you feel is necessary to get #4182 moving. I don't know that the provided test is especially useful, but it does show that the fix here works.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4",
"events_url": "https://api.github.com/users/Lukasa/events{/privacy}",
"followers_url": "https://api.github.com/users/Lukasa/followers",
"following_url": "https://api.github.com/users/Lukasa/following{/other_user}",
"gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Lukasa",
"id": 1382556,
"login": "Lukasa",
"node_id": "MDQ6VXNlcjEzODI1NTY=",
"organizations_url": "https://api.github.com/users/Lukasa/orgs",
"received_events_url": "https://api.github.com/users/Lukasa/received_events",
"repos_url": "https://api.github.com/users/Lukasa/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Lukasa",
"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/4183/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4183/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/4183.diff",
"html_url": "https://github.com/psf/requests/pull/4183",
"merged_at": "2017-07-04T08:16:03Z",
"patch_url": "https://github.com/psf/requests/pull/4183.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/4183"
}
| true |
[
"Also, does this need a changelog entry?",
"@alexwlchan, we historically haven't done changelog entries with PRs in Requests, but I know @Lukasa has chosen to ask for that in other projects. Perhaps it's worth asking if we want to consider moving to that here, or continue to compile them once before a release."
] |
https://api.github.com/repos/psf/requests/issues/4182
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4182/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4182/comments
|
https://api.github.com/repos/psf/requests/issues/4182/events
|
https://github.com/psf/requests/pull/4182
| 240,275,443 |
MDExOlB1bGxSZXF1ZXN0MTI4NzAxNDM4
| 4,182 |
Add idna version info to requests.help
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/301220?v=4",
"events_url": "https://api.github.com/users/alexwlchan/events{/privacy}",
"followers_url": "https://api.github.com/users/alexwlchan/followers",
"following_url": "https://api.github.com/users/alexwlchan/following{/other_user}",
"gists_url": "https://api.github.com/users/alexwlchan/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/alexwlchan",
"id": 301220,
"login": "alexwlchan",
"node_id": "MDQ6VXNlcjMwMTIyMA==",
"organizations_url": "https://api.github.com/users/alexwlchan/orgs",
"received_events_url": "https://api.github.com/users/alexwlchan/received_events",
"repos_url": "https://api.github.com/users/alexwlchan/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/alexwlchan/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/alexwlchan/subscriptions",
"type": "User",
"url": "https://api.github.com/users/alexwlchan",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 11 |
2017-07-03T22:32:02Z
|
2021-09-05T00:07:07Z
|
2017-07-27T20:54:10Z
|
CONTRIBUTOR
|
resolved
|
Resolves #4180.
|
{
"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/4182/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4182/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/4182.diff",
"html_url": "https://github.com/psf/requests/pull/4182",
"merged_at": "2017-07-27T20:54:10Z",
"patch_url": "https://github.com/psf/requests/pull/4182.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/4182"
}
| true |
[
"I’d try to fix the failing tests, but I can’t see the Jenkins instance so I don’t know what’s gone wrong. 😕 \r\n\r\n(My two new tests seem like obvious culprits, but they’re passing locally.)",
"Hey @alexwlchan, the two new tests are failing but I don't believe it's related to your patch. Jenkins is complaining on Python 2.6 that `AttributeError: 'module' object has no attribute 'OPENSSL_VERSION_NUMBER'`.\r\n\r\nThe `info()` function was never tested before, and `OPENSSL_VERSION_NUMBER` doesn't appear to exist on the system [`ssl`](https://github.com/python/cpython/blob/2.6/Lib/ssl.py) module for Python 2.6. We'll need to fix that to get the tests passing. If you feel like throwing together another PR to fix that, it would be greatly appreciated. Otherwise, I'll put something together this evening.",
"> If you feel like throwing together another PR to fix that, it would be greatly appreciated.\r\n\r\nIt’s five past midnight here, so not right now. Maybe in the morning. 😉 ",
"No problem at all, @alexwlchan :) I've opened #4183 to address the test issue. Once we get another maintainer to green light that, we should be set here.",
"Okay, rebased against master, so (fingers crossed) this time the tests will pass.",
"Well this test output seems extremely problematic. @kennethreitz any reason all the tests are failing to build now?",
"OK, it looks like the builds are working again. @alexwlchan, would you mind rebasing this onto the current master branch?",
"> would you mind rebasing this onto the current master branch?\r\n\r\nDone.",
"Sorry for the CI issue, I didn't see this notification. ",
"Let me know if it happens again!",
"@kennethreitz, no worries 😄! "
] |
https://api.github.com/repos/psf/requests/issues/4181
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4181/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4181/comments
|
https://api.github.com/repos/psf/requests/issues/4181/events
|
https://github.com/psf/requests/issues/4181
| 239,822,221 |
MDU6SXNzdWUyMzk4MjIyMjE=
| 4,181 |
RFE: partial_updates
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1143630?v=4",
"events_url": "https://api.github.com/users/sergiomb2/events{/privacy}",
"followers_url": "https://api.github.com/users/sergiomb2/followers",
"following_url": "https://api.github.com/users/sergiomb2/following{/other_user}",
"gists_url": "https://api.github.com/users/sergiomb2/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/sergiomb2",
"id": 1143630,
"login": "sergiomb2",
"node_id": "MDQ6VXNlcjExNDM2MzA=",
"organizations_url": "https://api.github.com/users/sergiomb2/orgs",
"received_events_url": "https://api.github.com/users/sergiomb2/received_events",
"repos_url": "https://api.github.com/users/sergiomb2/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/sergiomb2/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/sergiomb2/subscriptions",
"type": "User",
"url": "https://api.github.com/users/sergiomb2",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 3 |
2017-06-30T16:01:07Z
|
2021-09-08T08:00:39Z
|
2017-06-30T16:15:40Z
|
NONE
|
resolved
|
http://docs.python-requests.org/en/master/api/ already have 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/4181/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4181/timeline
| null |
completed
| null | null | false |
[
"Hi @sergiomb2,\r\n\r\nThanks for opening an issue. There's very little detail here about what issues or enhancements you are seeing or would like to see. As such, I'm closing this until that detail presents itself in one way or another.\r\n\r\nCheers,\r\nIan",
"OK , link [1] fooled me because only show (...) HTTP request types: PUT, DELETE, HEAD and OPTIONS , should also refer to patch method ... \r\n\r\n[1]\r\nhttp://docs.python-requests.org/en/master/user/quickstart/#make-a-request\r\n",
"You can use any method verb you want with requests.\n\nhttp://docs.python-requests.org/en/master/user/advanced/#custom-verbs\n\nOn Sat, 1 Jul. 2017, 2:24 am Sérgio Basto, <[email protected]> wrote:\n\n> OK , link [1] fooled me because only show (...) HTTP request types: PUT,\n> DELETE, HEAD and OPTIONS , should also refer to patch method ...\n>\n> [1]\n> http://docs.python-requests.org/en/master/user/quickstart/#make-a-request\n>\n> —\n> You are receiving this because you are subscribed to this thread.\n> Reply to this email directly, view it on GitHub\n> <https://github.com/requests/requests/issues/4181#issuecomment-312312277>,\n> or mute the thread\n> <https://github.com/notifications/unsubscribe-auth/AGk_7QdoW49OCASc0hnOFaFDdOlfKTG-ks5sJSFBgaJpZM4OKxFC>\n> .\n>\n"
] |
https://api.github.com/repos/psf/requests/issues/4180
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4180/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4180/comments
|
https://api.github.com/repos/psf/requests/issues/4180/events
|
https://github.com/psf/requests/issues/4180
| 239,256,371 |
MDU6SXNzdWUyMzkyNTYzNzE=
| 4,180 |
support idna.__version__
|
{
"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 |
2017-06-28T18:36:41Z
|
2021-09-08T08:00:32Z
|
2017-07-27T20:54:10Z
|
CONTRIBUTOR
|
resolved
|
https://github.com/kjd/idna/issues/49#event-1142557883
|
{
"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/4180/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4180/timeline
| null |
completed
| null | null | false |
[] |
https://api.github.com/repos/psf/requests/issues/4179
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4179/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4179/comments
|
https://api.github.com/repos/psf/requests/issues/4179/events
|
https://github.com/psf/requests/pull/4179
| 238,890,786 |
MDExOlB1bGxSZXF1ZXN0MTI3NzIzOTM0
| 4,179 |
Fix chunked encoding with SSL via proxy
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/614635?v=4",
"events_url": "https://api.github.com/users/jamespic/events{/privacy}",
"followers_url": "https://api.github.com/users/jamespic/followers",
"following_url": "https://api.github.com/users/jamespic/following{/other_user}",
"gists_url": "https://api.github.com/users/jamespic/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/jamespic",
"id": 614635,
"login": "jamespic",
"node_id": "MDQ6VXNlcjYxNDYzNQ==",
"organizations_url": "https://api.github.com/users/jamespic/orgs",
"received_events_url": "https://api.github.com/users/jamespic/received_events",
"repos_url": "https://api.github.com/users/jamespic/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/jamespic/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jamespic/subscriptions",
"type": "User",
"url": "https://api.github.com/users/jamespic",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 14 |
2017-06-27T15:27:33Z
|
2021-08-30T00:06:29Z
|
2020-01-10T22:57:13Z
|
CONTRIBUTOR
|
resolved
|
This is a patch applying @bpitman's proposed fix for #3844.
Assuming a proxy is running on port 8875 (`docker run --rm --name='tinyproxy' -p 8875:8888 dannydirect/tinyproxy:latest ANY` works for me), the issue can be reproduced with
```
requests.put('https://www.google.com', data=iter('Hello World'), proxies={'https': 'http://localhost:8875'})
```
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/614635?v=4",
"events_url": "https://api.github.com/users/jamespic/events{/privacy}",
"followers_url": "https://api.github.com/users/jamespic/followers",
"following_url": "https://api.github.com/users/jamespic/following{/other_user}",
"gists_url": "https://api.github.com/users/jamespic/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/jamespic",
"id": 614635,
"login": "jamespic",
"node_id": "MDQ6VXNlcjYxNDYzNQ==",
"organizations_url": "https://api.github.com/users/jamespic/orgs",
"received_events_url": "https://api.github.com/users/jamespic/received_events",
"repos_url": "https://api.github.com/users/jamespic/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/jamespic/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jamespic/subscriptions",
"type": "User",
"url": "https://api.github.com/users/jamespic",
"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/4179/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4179/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/4179.diff",
"html_url": "https://github.com/psf/requests/pull/4179",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/4179.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/4179"
}
| true |
[
"Why aren't we taking the approach I suggested in #3844?",
"@Lukasa I don't know the codebase that well, so I couldn't figure out exactly how the approach you'd proposed would fit in with the existing code - I tried getting rid of the chunked branch and just adding a `chunked` parameter to the `conn.urlopen`, but it lead to a failed test that I couldn't make sense of. Whereas @bpitman's patch worked and passed the tests.",
"What test failed? Can you provide the test output?",
"Sure thing\r\n\r\n```\r\n_________________________________________________________________________________ TestTimeout.test_total_timeout_connect[timeout0] _________________________________________________________________________________\r\n[gw0] linux -- Python 3.5.2 /home/james/workspace/requests/.tox/py35/bin/python\r\n\r\nself = <tests.test_requests.TestTimeout object at 0x7f42473c8828>, timeout = (0.1, 0.1)\r\n\r\n @pytest.mark.parametrize(\r\n 'timeout', (\r\n (0.1, 0.1),\r\n Urllib3Timeout(connect=0.1, read=0.1)\r\n ))\r\n def test_total_timeout_connect(self, timeout):\r\n try:\r\n> requests.get(TARPIT, timeout=timeout)\r\n\r\ntests/test_requests.py:2077: \r\n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \r\nrequests/api.py:72: in get\r\n return request('get', url, params=params, **kwargs)\r\nrequests/api.py:58: in request\r\n return session.request(method=method, url=url, **kwargs)\r\nrequests/sessions.py:502: in request\r\n resp = self.send(prep, **send_kwargs)\r\nrequests/sessions.py:612: in send\r\n r = adapter.send(request, **kwargs)\r\n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \r\n\r\nself = <requests.adapters.HTTPAdapter object at 0x7f4247413b70>, request = <PreparedRequest [GET]>, stream = False, timeout = <urllib3.util.timeout.Timeout object at 0x7f4247413b38>, verify = True, cert = None\r\nproxies = OrderedDict()\r\n\r\n def send(self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None):\r\n \"\"\"Sends PreparedRequest object. Returns Response object.\r\n \r\n :param request: The :class:`PreparedRequest <PreparedRequest>` being sent.\r\n :param stream: (optional) Whether to stream the request content.\r\n :param timeout: (optional) How long to wait for the server to send\r\n data before giving up, as a float, or a :ref:`(connect timeout,\r\n read timeout) <timeouts>` tuple.\r\n :type timeout: float or tuple or urllib3 Timeout object\r\n :param verify: (optional) Either a boolean, in which case it controls whether\r\n we verify the server's TLS certificate, or a string, in which case it\r\n must be a path to a CA bundle to use\r\n :param cert: (optional) Any user-provided SSL certificate to be trusted.\r\n :param proxies: (optional) The proxies dictionary to apply to the request.\r\n :rtype: requests.Response\r\n \"\"\"\r\n \r\n conn = self.get_connection(request.url, proxies)\r\n \r\n self.cert_verify(conn, request.url, verify, cert)\r\n url = self.request_url(request, proxies)\r\n self.add_headers(request)\r\n \r\n chunked = not (request.body is None or 'Content-Length' in request.headers)\r\n \r\n if isinstance(timeout, tuple):\r\n try:\r\n connect, read = timeout\r\n timeout = TimeoutSauce(connect=connect, read=read)\r\n except ValueError as e:\r\n # this may raise a string formatting error.\r\n err = (\"Invalid timeout {0}. Pass a (connect, read) \"\r\n \"timeout tuple, or a single float to set \"\r\n \"both timeouts to the same value\".format(timeout))\r\n raise ValueError(err)\r\n elif isinstance(timeout, TimeoutSauce):\r\n pass\r\n else:\r\n timeout = TimeoutSauce(connect=timeout, read=timeout)\r\n \r\n try:\r\n resp = conn.urlopen(\r\n method=request.method,\r\n url=url,\r\n body=request.body,\r\n headers=request.headers,\r\n redirect=False,\r\n assert_same_host=False,\r\n preload_content=False,\r\n decode_content=False,\r\n retries=self.max_retries,\r\n timeout=timeout,\r\n chunked=chunked\r\n )\r\n \r\n except (ProtocolError, socket.error) as err:\r\n raise ConnectionError(err, request=request)\r\n \r\n except MaxRetryError as e:\r\n if isinstance(e.reason, ConnectTimeoutError):\r\n # TODO: Remove this in 3.0.0: see #2811\r\n if not isinstance(e.reason, NewConnectionError):\r\n raise ConnectTimeout(e, request=request)\r\n \r\n if isinstance(e.reason, ResponseError):\r\n raise RetryError(e, request=request)\r\n \r\n if isinstance(e.reason, _ProxyError):\r\n raise ProxyError(e, request=request)\r\n \r\n> raise ConnectionError(e, request=request)\r\nE requests.exceptions.ConnectionError: HTTPConnectionPool(host='10.255.255.1', port=80): Max retries exceeded with url: / (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f42473bb5f8>: Failed to establish a new connection: [Errno 113] No route to host',))\r\n\r\nrequests/adapters.py:458: ConnectionError\r\n=========================================================================== 1 failed, 481 passed, 12 skipped, 2 xpassed in 33.83 seconds ===========================================================================\r\n```\r\n\r\nWeirdly it only failed in Python 3. The same test passed in Python 2.",
"That failure should be unrelated: it seems to be changing from a connection timeout to an authoritative statement that no route exists to that host. Mind pushing the branch up so I can take a look at your change?",
"Sure thing: https://github.com/jamespic/requests/tree/chunked-parameter",
"Ok, so I think this test was accidentally relying on an environment behaviour. Mind pushing it to a branch that gets CI'd to see if our CI reproduces it? If it does I'll dive in myself.",
"Yep, absolutely.",
"I merge your code and test the code, but it's still hanging.\r\n\r\n```python\r\nimport requests\r\nresp = requests.get('https://baidu.com', proxies={'https': 'localhost:8899'})\r\n```\r\n\r\nI tried curl with this proxy server, it worked.",
"We are running in this to as well, and the patch resolved our problem/ Is there a plan to get this merged in to master?",
"Any update on this? I got the same problem with chunked requests (which I think I can avoid, I accidentally used chunked by providing a None value in the data dict).\r\n\r\n---\r\nHere is my analysis (done before I found #3844 and this PR):\r\nMinimal reproduced case:\r\n\r\nPython 3.7.0 (Mac OS)\r\nurllib3 1.23 \r\nrequests 2.19.1\r\n\r\nInstall tinyproxy (`brew install tinyproxy`), no configuration required.\r\nLaunch with `tinyproxy -d` \r\n\r\nPython code:\r\n```\r\nimport requests\r\nprint(requests.post('https://status.github.com',\r\n\t\t\t\t\tdata={'a':None},\r\n\t\t\t\t\tproxies={'https': 'http://127.0.0.1:8888'}))\r\n```\r\n\r\nResult:\r\n```\r\nTraceback (most recent call last):\r\n File \"/Users/johan/reqbug/venv/lib/python3.7/site-packages/requests/adapters.py\", line 471, in send\r\n low_conn.endheaders()\r\n File \"/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/lib/python3.7/http/client.py\", line 1224, in endheaders\r\n self._send_output(message_body, encode_chunked=encode_chunked)\r\n File \"/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/lib/python3.7/http/client.py\", line 1016, in _send_output\r\n self.send(msg)\r\n File \"/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/lib/python3.7/http/client.py\", line 956, in send\r\n self.connect()\r\n File \"/Users/johan/reqbug/venv/lib/python3.7/site-packages/urllib3/connection.py\", line 356, in connect\r\n ssl_context=context)\r\n File \"/Users/johan/reqbug/venv/lib/python3.7/site-packages/urllib3/util/ssl_.py\", line 359, in ssl_wrap_socket\r\n return context.wrap_socket(sock, server_hostname=server_hostname)\r\n File \"/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/lib/python3.7/ssl.py\", line 412, in wrap_socket\r\n session=session\r\n File \"/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/lib/python3.7/ssl.py\", line 850, in _create\r\n self.do_handshake()\r\n File \"/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/lib/python3.7/ssl.py\", line 1108, in do_handshake\r\n self._sslobj.do_handshake()\r\nssl.SSLError: [SSL: UNKNOWN_PROTOCOL] unknown protocol (_ssl.c:1045)\r\n\r\nDuring handling of the above exception, another exception occurred:\r\n\r\nTraceback (most recent call last):\r\n File \"test.py\", line 4, in <module>\r\n proxies={'https': 'http://localhost:8888'}))\r\n File \"/Users/johan/reqbug/venv/lib/python3.7/site-packages/requests/api.py\", line 112, in post\r\n return request('post', url, data=data, json=json, **kwargs)\r\n File \"/Users/johan/reqbug/venv/lib/python3.7/site-packages/requests/api.py\", line 58, in request\r\n return session.request(method=method, url=url, **kwargs)\r\n File \"/Users/johan/reqbug/venv/lib/python3.7/site-packages/requests/sessions.py\", line 512, in request\r\n resp = self.send(prep, **send_kwargs)\r\n File \"/Users/johan/reqbug/venv/lib/python3.7/site-packages/requests/sessions.py\", line 622, in send\r\n r = adapter.send(request, **kwargs)\r\n File \"/Users/johan/reqbug/venv/lib/python3.7/site-packages/requests/adapters.py\", line 503, in send\r\n raise ConnectionError(err, request=request)\r\nrequests.exceptions.ConnectionError: [SSL: UNKNOWN_PROTOCOL] unknown protocol (_ssl.c:1045)\r\n\r\n```\r\n\r\nThe key here is the `None` value in the data, which makes the `HTTPAdapter` pick the `chunked` route:\r\nhttps://github.com/requests/requests/blame/master/requests/adapters.py#L449\r\n\r\nThis means relying on `urllib3` internal functions.\r\nThe above blame indicats this was written 5 years ago.\r\nIn urllib3, 4 years ago, the code changed and (re?)introduced the `_prepare_proxy` call:\r\n\r\nhttps://github.com/urllib3/urllib3/blame/master/src/urllib3/connectionpool.py#L592\r\n\r\nBy adding the following code just after adapters.py:453 (`conn._get_conn(..)`), the request works as expected:\r\n```\r\n is_new_proxy_conn = conn.proxy is not None and not getattr(low_conn, 'sock', None)\r\n if is_new_proxy_conn:\r\n conn._prepare_proxy(low_conn)\r\n```\r\n\r\n",
"Commenting to bump. Am running into this when using chunked uploads viathe POST method using a proxy. Can confirm the above 3 liner is functional. Any chance this PR can get approved and pushed into the full module? ",
"@jamespic, this needs to be rebased, or closed if it has been resolved by other merged changes, esp https://github.com/psf/requests/pull/5128 which says it solves this problem.",
"I was experiencing the same issue (chunked encoding through an HTTPS proxy tunnel resulting in an SSL unknown protocol error) on a test case very similar to the one described by @stromnet above with requests 2.22.0.\r\n\r\nI upgraded to a9ee0eef5a70acb9ed35622b3675574b11f92cb4 and the issue disappeared :+1: . After spending some time analyzing the issue I'm confident that the fix came from #5128 as suggested by @jayvdb .\r\n\r\nSince as of Jan 10, 2020 the fix is not released I used this command to upgrade requests to head of master branch: ` pip install git+https://github.com/psf/requests.git --upgrade`\r\n"
] |
https://api.github.com/repos/psf/requests/issues/4178
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4178/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4178/comments
|
https://api.github.com/repos/psf/requests/issues/4178/events
|
https://github.com/psf/requests/issues/4178
| 238,481,499 |
MDU6SXNzdWUyMzg0ODE0OTk=
| 4,178 |
when connecting to https by IP address, client hello message has a server_name SNI block.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1396183?v=4",
"events_url": "https://api.github.com/users/tocklime/events{/privacy}",
"followers_url": "https://api.github.com/users/tocklime/followers",
"following_url": "https://api.github.com/users/tocklime/following{/other_user}",
"gists_url": "https://api.github.com/users/tocklime/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/tocklime",
"id": 1396183,
"login": "tocklime",
"node_id": "MDQ6VXNlcjEzOTYxODM=",
"organizations_url": "https://api.github.com/users/tocklime/orgs",
"received_events_url": "https://api.github.com/users/tocklime/received_events",
"repos_url": "https://api.github.com/users/tocklime/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/tocklime/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/tocklime/subscriptions",
"type": "User",
"url": "https://api.github.com/users/tocklime",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 1 |
2017-06-26T09:04:28Z
|
2021-09-08T08:00:41Z
|
2017-06-26T10:07:20Z
|
NONE
|
resolved
|
When connecting to https by IP address `requests.get("https://8.8.8.8/")`, the client hello message includes a server_name extension
## Expected Result
No server_name extension in the client hello. The server I am talking to immediately closes the connection when it sees a server_name block with a literal ipv4 address. The [SNI Spec](https://tools.ietf.org/html/rfc3546#section-3.1) says that `Literal IPv4 and IPv6 addresses are not permitted in "HostName".`
## Actual Result
There was a server_name extension in the client hello, and the server I am talking to immediately closes the connection.
## Reproduction Steps
1. Set up wireshark monitoring packets.
2. ```python
import requests
requests.get("https://8.8.8.8")
```
3. Observe the client hello message in wireshark:
```
Frame 570: 571 bytes on wire (4568 bits), 571 bytes captured (4568 bits) on interface 0
Ethernet II, Src: BizlinkK_XX:XX:XX (9c:eb:e8:XX:XX:XX), Dst: JuniperN_XX:XX:XX (08:81:f4:XX:XX:XX)
Internet Protocol Version 4, Src: 192.168.89.18, Dst: 8.8.8.8
Transmission Control Protocol, Src Port: 4811, Dst Port: 443, Seq: 1, Ack: 1, Len: 517
Secure Sockets Layer
TLSv1.2 Record Layer: Handshake Protocol: Client Hello
Content Type: Handshake (22)
Version: TLS 1.0 (0x0301)
Length: 512
Handshake Protocol: Client Hello
Handshake Type: Client Hello (1)
Length: 508
Version: TLS 1.2 (0x0303)
Random
Session ID Length: 0
Cipher Suites Length: 110
Cipher Suites (55 suites)
Compression Methods Length: 1
Compression Methods (1 method)
Extensions Length: 357
Extension: server_name
Type: server_name (0x0000)
Length: 12
Server Name Indication extension
Server Name list length: 10
Server Name Type: host_name (0)
Server Name length: 7
Server Name: 8.8.8.8
Extension: ec_point_formats
Extension: elliptic_curves
Extension: SessionTicket TLS
Extension: signature_algorithms
Extension: Heartbeat
Extension: Padding
```
## System Information
Windows 10 creators update, windows subsystem for linux.
```
$ uname -a
Linux ZeroGravitas 4.4.0-43-Microsoft #1-Microsoft Wed Dec 31 14:42:53 PST 2014 x86_64 x86_64 x86_64 GNU/Linux
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 16.04.2 LTS
Release: 16.04
Codename: xenial
$ apt policy python-requests
python-requests:
Installed: 2.9.1-3
Candidate: 2.9.1-3
Version table:
*** 2.9.1-3 500
500 http://archive.ubuntu.com/ubuntu xenial/main amd64 Packages
100 /var/lib/dpkg/status
```
Is is easy enough for me to work around this (refer to the machine by name), but it took me ages to figure out what was going wrong, so here is something hopefully googleable.
The server I was connecting to is Windows Server 2016 Datacenter (azure VM).
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4",
"events_url": "https://api.github.com/users/Lukasa/events{/privacy}",
"followers_url": "https://api.github.com/users/Lukasa/followers",
"following_url": "https://api.github.com/users/Lukasa/following{/other_user}",
"gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Lukasa",
"id": 1382556,
"login": "Lukasa",
"node_id": "MDQ6VXNlcjEzODI1NTY=",
"organizations_url": "https://api.github.com/users/Lukasa/orgs",
"received_events_url": "https://api.github.com/users/Lukasa/received_events",
"repos_url": "https://api.github.com/users/Lukasa/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Lukasa",
"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/4178/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4178/timeline
| null |
completed
| null | null | false |
[
"Yeah, this is a known limitation of Requests that boils down to the absence of a reliable tool for distinguishing IP addresses and hostnames. I think a sensible enhancement might be to use the `ipaddress` module if it's present in your environment, but this enhancement would have to be applied in urllib3. Do you mind opening a report over there?"
] |
https://api.github.com/repos/psf/requests/issues/4177
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4177/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4177/comments
|
https://api.github.com/repos/psf/requests/issues/4177/events
|
https://github.com/psf/requests/issues/4177
| 238,477,381 |
MDU6SXNzdWUyMzg0NzczODE=
| 4,177 |
sessions.py merge_setting(...)
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/25338837?v=4",
"events_url": "https://api.github.com/users/gfplk/events{/privacy}",
"followers_url": "https://api.github.com/users/gfplk/followers",
"following_url": "https://api.github.com/users/gfplk/following{/other_user}",
"gists_url": "https://api.github.com/users/gfplk/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/gfplk",
"id": 25338837,
"login": "gfplk",
"node_id": "MDQ6VXNlcjI1MzM4ODM3",
"organizations_url": "https://api.github.com/users/gfplk/orgs",
"received_events_url": "https://api.github.com/users/gfplk/received_events",
"repos_url": "https://api.github.com/users/gfplk/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/gfplk/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/gfplk/subscriptions",
"type": "User",
"url": "https://api.github.com/users/gfplk",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 1 |
2017-06-26T08:47:19Z
|
2021-09-08T08:00:41Z
|
2017-06-26T08:48:17Z
|
NONE
|
resolved
|
Hello, my head HTTP request is sent, although is ordered, but this is out of order, the anti spider detection target site to request the head not in the same order will ban off request. After finally put the code here watching, actually can bypass anti crawler mechanism.
你好,我发送http请求时的头部,虽然是有序的,但是这里是顺序被打乱,目标网站的反爬虫检测到请求头的顺序不一样就会ban掉请求. 最后把这里的代码注视之后,居然可以绕过反爬虫机制。
# merged_setting = dict_class(to_key_val_list(session_setting))
# merged_setting.update(to_key_val_list(request_setting))
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4",
"events_url": "https://api.github.com/users/Lukasa/events{/privacy}",
"followers_url": "https://api.github.com/users/Lukasa/followers",
"following_url": "https://api.github.com/users/Lukasa/following{/other_user}",
"gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Lukasa",
"id": 1382556,
"login": "Lukasa",
"node_id": "MDQ6VXNlcjEzODI1NTY=",
"organizations_url": "https://api.github.com/users/Lukasa/orgs",
"received_events_url": "https://api.github.com/users/Lukasa/received_events",
"repos_url": "https://api.github.com/users/Lukasa/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Lukasa",
"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/4177/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4177/timeline
| null |
completed
| null | null | false |
[
"Requests does not provide any ability to mandate ordering of HTTP headers. If that's a thing you need to do you'll need to drop down to a lower-level library."
] |
https://api.github.com/repos/psf/requests/issues/4176
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4176/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4176/comments
|
https://api.github.com/repos/psf/requests/issues/4176/events
|
https://github.com/psf/requests/issues/4176
| 238,465,228 |
MDU6SXNzdWUyMzg0NjUyMjg=
| 4,176 |
The right way to debug requests with https proxy
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/3056655?v=4",
"events_url": "https://api.github.com/users/tonywangcn/events{/privacy}",
"followers_url": "https://api.github.com/users/tonywangcn/followers",
"following_url": "https://api.github.com/users/tonywangcn/following{/other_user}",
"gists_url": "https://api.github.com/users/tonywangcn/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/tonywangcn",
"id": 3056655,
"login": "tonywangcn",
"node_id": "MDQ6VXNlcjMwNTY2NTU=",
"organizations_url": "https://api.github.com/users/tonywangcn/orgs",
"received_events_url": "https://api.github.com/users/tonywangcn/received_events",
"repos_url": "https://api.github.com/users/tonywangcn/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/tonywangcn/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/tonywangcn/subscriptions",
"type": "User",
"url": "https://api.github.com/users/tonywangcn",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 8 |
2017-06-26T07:51:02Z
|
2021-09-08T08:00:40Z
|
2017-06-28T09:51:57Z
|
NONE
|
resolved
|
Summary.
I have a proxy service that has been used for months. Everything works well until Twitter. The code here is a proxy test script between google and twitter. Of course Https.
For "https://www.google.com" and "https://mobile.twitter.com", the script both run 180 times. Most of google succeeded, however, all of twitter failed.
google:success times is 171, failed is 9, and total is 180
twitter:success times is 0, failed is 180, and total is 180
Half is "ConnectTimeoutError", and left is "ProxyError"
[Stackoverflow version](https://stackoverflow.com/questions/44750605/the-right-way-to-debug-python-requests-with-https-proxy)
## Expected Result
The success rate should keep the same
## Actual Result
```
HTTPSConnectionPool(host='mobile.twitter.com', port=443): Max retries exceeded with url: / (Caused by ConnectTimeoutError(<requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x107446150>, 'Connection to proxyip timed out. (connect timeout=10)'))
HTTPSConnectionPool(host='mobile.twitter.com', port=443): Max retries exceeded with url: / (Caused by ProxyError('Cannot connect to proxy.', error(54, 'Connection reset by peer')))
```
Without "Upgrade-Insecure-Requests", the errors keep the same.
So I'm curious about is there any method to debug these errors?
## Reproduction Steps
```python
from gevent import monkey, spawn, joinall, sleep
monkey.patch_all() # Magic!
import requests
import sys
s = requests.Session()
proxys = "https://username:password@ip:port"
class test_proxy:
success = 0
failed = 0
total = 0
def tweet(self):
#url = "https://www.google.com"
url = "https://mobile.twitter.com"
header = {
"Referer": url,
"Upgrade-Insecure-Requests": 1,
"User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.86 Safari/537.36",
}
try:
a = s.get(url, proxies={"https": proxys}, timeout=10)
self.success += 1
except Exception as e:
print(e)
self.failed += 1
self.total += 1
print("sucess times is {}, failed is {}, and total is {}".format(
self.success, self.failed, self.total))
test = test_proxy()
while True:
joinall([spawn(test.tweet) for _ in range(50)])
```
## System Information
```
python2.7
```
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4",
"events_url": "https://api.github.com/users/Lukasa/events{/privacy}",
"followers_url": "https://api.github.com/users/Lukasa/followers",
"following_url": "https://api.github.com/users/Lukasa/following{/other_user}",
"gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Lukasa",
"id": 1382556,
"login": "Lukasa",
"node_id": "MDQ6VXNlcjEzODI1NTY=",
"organizations_url": "https://api.github.com/users/Lukasa/orgs",
"received_events_url": "https://api.github.com/users/Lukasa/received_events",
"repos_url": "https://api.github.com/users/Lukasa/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Lukasa",
"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/4176/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4176/timeline
| null |
completed
| null | null | false |
[
"Is the proxy local, or is it provided by a third-party web service? It's quite possible that either the proxy or Twitter are refusing to co-operate.",
"Third-party. For another group of proxy, test results looks a little different , but not such significant. So I don't think it's the problem of proxys, it's the usage of requests or twitter. Should I use cert or something else to improve it efficiently?\r\n\r\n\r\n*Google*: sucess times is 114, failed is 231, and total is 345\r\n*Twitter*: sucess times is 12, failed is 343, and total is 355\r\n\r\n```\r\nanother_proxy = ['https://89.40.115.60:1189', 'https://52.14.213.166:8080', 'https://107.170.61.29:8799',\r\n 'https://94.177.240.167:1189', 'https://103.1.94.144:8080', 'https://45.77.63.43:1189',\r\n 'https://89.36.212.10:1189', 'https://45.76.45.250:1189', 'https://35.190.139.130:80',\r\n 'https://45.32.145.227:1189', 'https://89.38.151.144:1189', 'https://89.36.213.235:1189',\r\n 'https://130.211.110.105:80', 'https://94.177.232.98:1189', 'https://45.32.144.76:1189',\r\n 'https://89.40.112.173:1189', 'https://104.131.19.130:8080', 'https://36.66.64.74:8081',\r\n 'https://197.210.143.242:53281', 'https://45.123.3.105:8080', 'https://186.139.20.245:8080',\r\n 'https://45.76.45.178:1189', 'https://45.32.149.173:1189', 'https://107.191.62.169:1189',\r\n 'https://89.40.112.31:1189', 'https://109.87.145.9:53281', 'https://185.35.67.92:1189',\r\n 'https://94.177.237.100:1189', 'https://114.199.118.186:8080', 'https://107.191.46.61:1189',\r\n 'https://188.17.158.45:53281', 'https://46.73.33.253:8080', 'https://43.255.22.186:8080',\r\n 'https://197.210.246.30:8080', 'https://185.35.67.154:1189', 'https://109.200.155.196:8080',\r\n 'https://103.7.131.74:80', 'https://94.177.241.37:1189', 'https://89.38.148.210:1189',\r\n 'https://89.40.112.56:1189', 'https://45.76.47.194:1189', 'https://195.181.210.203:5033',\r\n 'https://104.238.189.2:1189', 'https://181.39.128.178:53281', 'https://104.238.188.146:1189',\r\n 'https://183.88.112.51:8080', 'https://31.25.141.148:8080']\r\n```",
"Hrm, very odd. However, what's likely to be relevant is that your proxies are all using `https` schemed URLs. Can you try setting your proxy url to have a `http` scheme and see if that improves things? Requests does not really formally support using TLS to connect to a proxy.",
" so weird, why would {\"http\":\"http://ip:port\"} work for https url .... ? I will have more test later....",
"It would not, but `{'https': 'http://ip:port'}` would, which is what I want you to try. =)",
"After a few more tests, {'https': 'http://ip:port'} doesn't work too. I\nthought {\"http\":\"http://ip:port\"} would work, but I figure it out now, the\nrequests were sent to target directly . so sad ......\n\n\n\nOn Mon, Jun 26, 2017 at 7:17 PM Cory Benfield <[email protected]>\nwrote:\n\n> It would not, but {'https': 'http://ip:port'} would, which is what I want\n> you to try. =)\n>\n> —\n> You are receiving this because you authored the thread.\n>\n>\n> Reply to this email directly, view it on GitHub\n> <https://github.com/requests/requests/issues/4176#issuecomment-311031219>,\n> or mute the thread\n> <https://github.com/notifications/unsubscribe-auth/AC6kD-jfhvyPizp1syOefrVz932lzEZ4ks5sH5NYgaJpZM4OE-bQ>\n> .\n>\n-- \n\nTony Wang\n\nWarm Regards\n",
"So this sounds enormously like there is a problem between your proxy and Twitter.",
"Maybe.... I will submit a ticket to the proxy service. Thanks for your kind\nof help\n\nOn Tue, Jun 27, 2017 at 1:51 AM Cory Benfield <[email protected]>\nwrote:\n\n> So this sounds enormously like there is a problem between your proxy and\n> Twitter.\n>\n> —\n> You are receiving this because you authored the thread.\n>\n>\n> Reply to this email directly, view it on GitHub\n> <https://github.com/requests/requests/issues/4176#issuecomment-311132648>,\n> or mute the thread\n> <https://github.com/notifications/unsubscribe-auth/AC6kDybAcWa82n4kv3Hmfv5ImdsadSWuks5sH--6gaJpZM4OE-bQ>\n> .\n>\n-- \n\nTony Wang\n\nWarm Regards\n"
] |
https://api.github.com/repos/psf/requests/issues/4175
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4175/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4175/comments
|
https://api.github.com/repos/psf/requests/issues/4175/events
|
https://github.com/psf/requests/pull/4175
| 238,452,739 |
MDExOlB1bGxSZXF1ZXN0MTI3NDA2Nzk2
| 4,175 |
add missing packages when parse document
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/454006?v=4",
"events_url": "https://api.github.com/users/9nix00/events{/privacy}",
"followers_url": "https://api.github.com/users/9nix00/followers",
"following_url": "https://api.github.com/users/9nix00/following{/other_user}",
"gists_url": "https://api.github.com/users/9nix00/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/9nix00",
"id": 454006,
"login": "9nix00",
"node_id": "MDQ6VXNlcjQ1NDAwNg==",
"organizations_url": "https://api.github.com/users/9nix00/orgs",
"received_events_url": "https://api.github.com/users/9nix00/received_events",
"repos_url": "https://api.github.com/users/9nix00/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/9nix00/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/9nix00/subscriptions",
"type": "User",
"url": "https://api.github.com/users/9nix00",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 5 |
2017-06-26T06:36:56Z
|
2021-09-05T00:07:12Z
|
2017-06-26T06:44:56Z
|
NONE
|
resolved
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4",
"events_url": "https://api.github.com/users/Lukasa/events{/privacy}",
"followers_url": "https://api.github.com/users/Lukasa/followers",
"following_url": "https://api.github.com/users/Lukasa/following{/other_user}",
"gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Lukasa",
"id": 1382556,
"login": "Lukasa",
"node_id": "MDQ6VXNlcjEzODI1NTY=",
"organizations_url": "https://api.github.com/users/Lukasa/orgs",
"received_events_url": "https://api.github.com/users/Lukasa/received_events",
"repos_url": "https://api.github.com/users/Lukasa/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Lukasa",
"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/4175/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4175/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/4175.diff",
"html_url": "https://github.com/psf/requests/pull/4175",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/4175.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/4175"
}
| true |
[
"Thanks for this! However, there is no need for it: when you install the Requests package by pip or setup.py those packages will be installed for you. ",
"Ah, I see. it looks my requests version is too old. I use `requests==2.13.0`.\r\n\r\nmaybe we should add some note in document to notice user ?\r\n",
"What would that look like?",
"I think maybe we can add it in [release-and-version-history](http://docs.python-requests.org/en/master/community/updates/#release-and-version-history) ?\r\n\r\nparse document should be no error. if user didn't install `requests` and they just need document. \r\nthey should know which package depends on. I still think a better way is to create a `requirements.txt` for document. this is a normal way.e.g:[scrapy](https://github.com/scrapy/scrapy/tree/master/docs)\r\n\r\nof course, different community,different rule. respect community leaders choice.\r\n\r\n\r\n",
"It is considered a bad idea to create `requirements.txt` for this. `requirements.txt` is really considered to be used only for a *specific installation*, not for a general statement of what is needed. `setup.py` is pretty much the standard way to do this.\r\n\r\nIf you want to build the docs then you *have* to install Requests, as we use Sphinx autodoc to build our API documentation, and that only works if you've installed the package."
] |
|
https://api.github.com/repos/psf/requests/issues/4174
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4174/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4174/comments
|
https://api.github.com/repos/psf/requests/issues/4174/events
|
https://github.com/psf/requests/pull/4174
| 238,391,960 |
MDExOlB1bGxSZXF1ZXN0MTI3MzcwMzMy
| 4,174 |
Removed legacy fallback for python3.2
|
{
"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 | 4 |
2017-06-25T16:51:24Z
|
2021-09-05T00:07:07Z
|
2017-07-27T15:51:34Z
|
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": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/4174/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4174/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/4174.diff",
"html_url": "https://github.com/psf/requests/pull/4174",
"merged_at": "2017-07-27T15:51:33Z",
"patch_url": "https://github.com/psf/requests/pull/4174.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/4174"
}
| true |
[
"Windows Jenkins builder appears to be offline, blocking CI.",
"@alex, would you mind rebasing this on the current master branch?",
"@nateprewitt merged master in, looks green still",
"Alright, I'm happy with this. Thanks @alex! ✨ "
] |
|
https://api.github.com/repos/psf/requests/issues/4173
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4173/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4173/comments
|
https://api.github.com/repos/psf/requests/issues/4173/events
|
https://github.com/psf/requests/pull/4173
| 238,348,797 |
MDExOlB1bGxSZXF1ZXN0MTI3MzQ2Njgz
| 4,173 |
Pass pool_kwargs rather than updating connection_pool_kw
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1977525?v=4",
"events_url": "https://api.github.com/users/jeremycline/events{/privacy}",
"followers_url": "https://api.github.com/users/jeremycline/followers",
"following_url": "https://api.github.com/users/jeremycline/following{/other_user}",
"gists_url": "https://api.github.com/users/jeremycline/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/jeremycline",
"id": 1977525,
"login": "jeremycline",
"node_id": "MDQ6VXNlcjE5Nzc1MjU=",
"organizations_url": "https://api.github.com/users/jeremycline/orgs",
"received_events_url": "https://api.github.com/users/jeremycline/received_events",
"repos_url": "https://api.github.com/users/jeremycline/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/jeremycline/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jeremycline/subscriptions",
"type": "User",
"url": "https://api.github.com/users/jeremycline",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 7 |
2017-06-24T23:12:46Z
|
2021-09-05T00:07:11Z
|
2017-06-27T13:54:40Z
|
CONTRIBUTOR
|
resolved
|
This addresses an issue where making HTTPS through proxies used the
default urllib3 connection pool settings.
fixes #3633
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4",
"events_url": "https://api.github.com/users/Lukasa/events{/privacy}",
"followers_url": "https://api.github.com/users/Lukasa/followers",
"following_url": "https://api.github.com/users/Lukasa/following{/other_user}",
"gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Lukasa",
"id": 1382556,
"login": "Lukasa",
"node_id": "MDQ6VXNlcjEzODI1NTY=",
"organizations_url": "https://api.github.com/users/Lukasa/orgs",
"received_events_url": "https://api.github.com/users/Lukasa/received_events",
"repos_url": "https://api.github.com/users/Lukasa/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Lukasa",
"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/4173/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4173/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/4173.diff",
"html_url": "https://github.com/psf/requests/pull/4173",
"merged_at": "2017-06-27T13:54:40Z",
"patch_url": "https://github.com/psf/requests/pull/4173.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/4173"
}
| true |
[
"This is only a problem in the proposed/3.0.0 branch so even though this breaks the API that's okay, right?",
"Yup, no problem at all.",
"I have made it so.",
"Failing tests. =)",
"Oh yeah, that's Python 2.6 because I used a dictionary comprehension in the tests. I can switch it to not use a comprehension, I just thought 2.6 was getting dropped in 3.0.0 and couldn't resist the opportunity to use them :smile:",
"heh, right now we can't remove them from the test matrix, so you might have to just tolerate not having it. :grin:",
"It's left me with a heavy heart, but the dictionary comprehension has been excised and tests pass on Python 2.6 again."
] |
https://api.github.com/repos/psf/requests/issues/4172
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4172/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4172/comments
|
https://api.github.com/repos/psf/requests/issues/4172/events
|
https://github.com/psf/requests/issues/4172
| 237,901,714 |
MDU6SXNzdWUyMzc5MDE3MTQ=
| 4,172 |
Support for http request batching
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/436360?v=4",
"events_url": "https://api.github.com/users/shiva404/events{/privacy}",
"followers_url": "https://api.github.com/users/shiva404/followers",
"following_url": "https://api.github.com/users/shiva404/following{/other_user}",
"gists_url": "https://api.github.com/users/shiva404/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/shiva404",
"id": 436360,
"login": "shiva404",
"node_id": "MDQ6VXNlcjQzNjM2MA==",
"organizations_url": "https://api.github.com/users/shiva404/orgs",
"received_events_url": "https://api.github.com/users/shiva404/received_events",
"repos_url": "https://api.github.com/users/shiva404/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/shiva404/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/shiva404/subscriptions",
"type": "User",
"url": "https://api.github.com/users/shiva404",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 1 |
2017-06-22T16:25:33Z
|
2021-09-08T08:00:41Z
|
2017-06-22T16:28:37Z
|
NONE
|
resolved
|
Support for http request batching
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4",
"events_url": "https://api.github.com/users/Lukasa/events{/privacy}",
"followers_url": "https://api.github.com/users/Lukasa/followers",
"following_url": "https://api.github.com/users/Lukasa/following{/other_user}",
"gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Lukasa",
"id": 1382556,
"login": "Lukasa",
"node_id": "MDQ6VXNlcjEzODI1NTY=",
"organizations_url": "https://api.github.com/users/Lukasa/orgs",
"received_events_url": "https://api.github.com/users/Lukasa/received_events",
"repos_url": "https://api.github.com/users/Lukasa/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Lukasa",
"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/4172/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4172/timeline
| null |
completed
| null | null | false |
[
"Sorry, but if you don't elaborate on what you want it's very hard for us to meaningfully decide whether we can support it or not."
] |
https://api.github.com/repos/psf/requests/issues/4171
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4171/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4171/comments
|
https://api.github.com/repos/psf/requests/issues/4171/events
|
https://github.com/psf/requests/issues/4171
| 237,848,205 |
MDU6SXNzdWUyMzc4NDgyMDU=
| 4,171 |
Problem finding certificate
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/4905917?v=4",
"events_url": "https://api.github.com/users/Bondifrench/events{/privacy}",
"followers_url": "https://api.github.com/users/Bondifrench/followers",
"following_url": "https://api.github.com/users/Bondifrench/following{/other_user}",
"gists_url": "https://api.github.com/users/Bondifrench/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Bondifrench",
"id": 4905917,
"login": "Bondifrench",
"node_id": "MDQ6VXNlcjQ5MDU5MTc=",
"organizations_url": "https://api.github.com/users/Bondifrench/orgs",
"received_events_url": "https://api.github.com/users/Bondifrench/received_events",
"repos_url": "https://api.github.com/users/Bondifrench/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Bondifrench/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Bondifrench/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Bondifrench",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 19 |
2017-06-22T13:37:02Z
|
2021-09-04T00:06:14Z
|
2017-06-22T13:39:02Z
|
NONE
|
resolved
|
Sorry, bit of a noob here.`
## Expected Result
Using Python 3.6 from Anaconda, after having installed `fix_yahoo_finance` package
## Actual Result
````
File "C:\Users\London\Anaconda3\lib\site-packages\requests\adapters.py", line 225, in cert_verify
raise IOError("Could not find a suitable TLS CA certificate bundle, "
OSError: Could not find a suitable TLS CA certificate bundle, invalid path: C:\Users\London\Anaconda3\lib\site-packages\requests\cacert.pem
````
I do have a certifi package which contains the file `cacert.pem`, but the path is `C:\Users\London\Anaconda3\Lib\site-packages\certifi`
## Reproduction Steps
Using this request:
```python
from pandas_datareader import data as pdr
import datetime
import fix_yahoo_finance
aapl = pdr.get_data_yahoo('AAPL',
start="2014-01-01",
end="2017-06-20")
```
## System Information
$ python -m requests.help
```
{
"chardet": {
"version": "3.0.4"
},
"cryptography": {
"version": "1.8.1"
},
"implementation": {
"name": "CPython",
"version": "3.6.1"
},
"platform": {
"release": "8.1",
"system": "Windows"
},
"pyOpenSSL": {
"openssl_version": "100020bf",
"version": "17.0.0"
},
"requests": {
"version": "2.18.1"
},
"system_ssl": {
"version": "100020bf"
},
"urllib3": {
"version": "1.21.1"
},
"using_pyopenssl": true
}
```
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4",
"events_url": "https://api.github.com/users/Lukasa/events{/privacy}",
"followers_url": "https://api.github.com/users/Lukasa/followers",
"following_url": "https://api.github.com/users/Lukasa/following{/other_user}",
"gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Lukasa",
"id": 1382556,
"login": "Lukasa",
"node_id": "MDQ6VXNlcjEzODI1NTY=",
"organizations_url": "https://api.github.com/users/Lukasa/orgs",
"received_events_url": "https://api.github.com/users/Lukasa/received_events",
"repos_url": "https://api.github.com/users/Lukasa/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Lukasa",
"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/4171/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4171/timeline
| null |
completed
| null | null | false |
[
"This is an anaconda issue I think: we're looking for the cacert.pem file in the Requests package, and it seems not to be there. You'll need to take it up with the person providing your Requests package.",
"I am pretty new to this whole programming thing but I have the same issue and am working on tracing the route cause. Found this in the Request package under adapters.py\r\n\r\n\r\n\r\nAnyone have thoughts where to look next? Thank you\r\n",
"@HydoCarbOxymora Can you provide the full traceback and error message please?",
"Here is the traceback error I get.... Any ideas on how to address this issue?\r\n\r\n---------------------------------------------------------------------------\r\nOSError Traceback (most recent call last)\r\n<ipython-input-13-4ee4865f4db8> in <module>()\r\n----> 1 result = flight.send_sync(use_containers=False)\r\n\r\n/Users/VieirasMac/anaconda/lib/python3.5/site-packages/pyflight/requester.py in send_sync(self, use_containers)\r\n 231 documentation for :meth:`pyflight.send_sync()`.\r\n 232 \"\"\"\r\n--> 233 return pyflight.send_sync(self, use_containers=use_containers)\r\n 234 \r\n 235 async def send_async(self, use_containers: bool=True) -> Union[Result, dict]:\r\n\r\n/Users/VieirasMac/anaconda/lib/python3.5/site-packages/pyflight/requester.py in send_sync(request_body, use_containers)\r\n 406 response = requester.post_request_sync(BASE_URL, request_body)\r\n 407 elif isinstance(request_body, Request):\r\n--> 408 response = requester.post_request_sync(BASE_URL, request_body.raw_data)\r\n 409 else:\r\n 410 raise ValueError('Unsupported Request Type')\r\n\r\n/Users/VieirasMac/anaconda/lib/python3.5/site-packages/pyflight/api.py in post_request_sync(self, url, payload)\r\n 98 \"\"\"\r\n 99 pyflight.rate_limiter.delay_sync()\r\n--> 100 r = requests.post(url + self.api_key, json=payload)\r\n 101 if r.status_code != 200:\r\n 102 resp = r.json()\r\n\r\n/Users/VieirasMac/anaconda/lib/python3.5/site-packages/requests/api.py in post(url, data, json, **kwargs)\r\n 110 \"\"\"\r\n 111 \r\n--> 112 return request('post', url, data=data, json=json, **kwargs)\r\n 113 \r\n 114 \r\n\r\n/Users/VieirasMac/anaconda/lib/python3.5/site-packages/requests/api.py in request(method, url, **kwargs)\r\n 56 # cases, and look like a memory leak in others.\r\n 57 with sessions.Session() as session:\r\n---> 58 return session.request(method=method, url=url, **kwargs)\r\n 59 \r\n 60 \r\n\r\n/Users/VieirasMac/anaconda/lib/python3.5/site-packages/requests/sessions.py in request(self, method, url, params, data, headers, cookies, files, auth, timeout, allow_redirects, proxies, hooks, stream, verify, cert, json)\r\n 516 \r\n 517 def options(self, url, **kwargs):\r\n--> 518 r\"\"\"Sends a OPTIONS request. Returns :class:`Response` object.\r\n 519 \r\n 520 :param url: URL for the new :class:`Request` object.\r\n\r\n/Users/VieirasMac/anaconda/lib/python3.5/site-packages/requests/sessions.py in send(self, request, **kwargs)\r\n 637 if history:\r\n 638 # Insert the first (original) request at the start\r\n--> 639 history.insert(0, r)\r\n 640 # Get the last request made\r\n 641 r = history.pop()\r\n\r\n/Users/VieirasMac/anaconda/lib/python3.5/site-packages/requests/adapters.py in send(self, request, stream, timeout, verify, cert, proxies)\r\n 403 \"\"\"\r\n 404 \r\n--> 405 conn = self.get_connection(request.url, proxies)\r\n 406 \r\n 407 self.cert_verify(conn, request.url, verify, cert)\r\n\r\n/Users/VieirasMac/anaconda/lib/python3.5/site-packages/requests/adapters.py in cert_verify(self, conn, url, verify, cert)\r\n 223 \r\n 224 if not cert_loc or not os.path.exists(cert_loc):\r\n--> 225 raise IOError(\"Could not find a suitable TLS CA certificate bundle, \"\r\n 226 \"invalid path: {0}\".format(cert_loc))\r\n 227 \r\n\r\nOSError: Could not find a suitable TLS CA certificate bundle, invalid path: /Users/VieirasMac/anaconda/lib/python3.5/site-packages/requests/cacert.pem\r\n",
"This appears to be a problem with your requests installation: we expect to find a file here that apparently doesn't exist. How did you install requests?",
"I work for Continuum, on the team that produces Anaconda. Sorry that this support request has fallen on you. Anaconda provides certs with the certifi package, which on windows places cacert.pem in Lib/site-packages/certifi. There's also the ca-certificates package, which puts them in Library/ssl, where curl looks for them. Does Anaconda really need to put them in requests, also? Every place that they are copied is another chance for them to be out-of-date.\r\n\r\nIf there's any configuration that Continuum could do to requests to point to one of the other locations, please let me know.",
"It seems there may be some other issue. certs.py has:\r\n\r\n```\r\ntry:\r\n from certifi import where\r\nexcept ImportError:\r\n def where():\r\n \"\"\"Return the preferred certificate bundle.\"\"\"\r\n # vendored bundle inside Requests\r\n return os.path.join(os.path.dirname(__file__), 'cacert.pem')\r\n```\r\n\r\nSo certifi should be in use. Seems to be some insane string bug: \r\n\r\n```\r\n(Pdb) > c:\\users\\builder\\miniconda2\\lib\\site-packages\\requests\\adapters.py(217)cert_verify()\r\n-> if verify is not True:\r\nverify\r\n(Pdb) 'True'\r\nverify == True\r\n(Pdb) False\r\n```\r\n\r\nI'll try to isolate it further.",
"Hi,\r\n\r\nI'm not sure that it's the same\r\n\r\n`IOError: Could not find a suitable TLS CA certificate bundle, invalid path: /anaconda/lib/python2.7/site-packages/requests/cacert.pem`\r\n\r\ngetting it's when running:\r\n```\r\nimport cufflinks as cf\r\nimport pandas as pd\r\n\r\ncf.set_config_file(world_readable=True,offline=False)\r\n\r\ncf.datagen.lines(1,500).ta_plot(study='sma',periods=[13,21,55],title='Simple Moving Averages')\r\n```\r\non Jupyter\r\n",
"Yup, it's the same: your packages have come from Anaconda. ",
"Sorry, but I didn't understand what is the solution?",
"Could we please take a step back and look for what might really be the issue? I've checked, and Continuum *is* shipping cacert.pem in the requests folder. See for yourself if you'd like: https://repo.continuum.io/pkgs/free/osx-64/requests-2.14.2-py36_0.tar.bz2\r\n\r\nThere's something else at play here, and it appears to be cross-platform. Has anything changed recently regarding how these certs get loaded? Are there any requirements of the certs that have changed recently?",
"Also, @Bondifrench where did you install requests from? It looks like you have version 2.18, but the official continuum package is out of date - 2.14 is current. If you got requests from pip, this could be a pip interaction problem with conda. If you got it from an anaconda.org channel, we need to follow up with the package authors. It looks like conda-forge does not ship cacert.pem, instead depending on certifi to provide that functionality.",
"@msarahan So the most important issue is that we *stopped* shipping it locally: we moved to using certifi instead of vendoring the cert bundle. You'll notice that in our tree `cacert.pem` is gone, and `certifi.where` is used directly. This leads us to our confusion: why is there a Requests version that appears to be colliding with what Anaconda wants, and why is it looking for a file we know we don't look for anymore?",
"I am also having this issue....even when replacing the cacert.pm file in the requests folder with the correct file, requests is unable to find it. Throwing SSL bad handshake error. When I feed requests the address to the cacert.pem file it doesn't seem to be an issue. What is the solution here?",
"To do what you're currently doing; feed Requests the cert bundle. 😁",
"Hi, I have encountered the same error: \"IOError: Could not find a suitable TLS CA certificate bundle, invalid path: c:\\apps\\Program Files\\Continuum\\Anaconda2.1\\lib\\site-packages\\requests\\cacert.pem\" when simply trying to run some code to make a Plotly graph.\r\n\r\nThe following is the first traceback error: \r\n\r\nIOError Traceback (most recent call last)\r\n<ipython-input-126-e7c617b8d2fb> in <module>()\r\n 12 data1 = Data([trace0, trace1])\r\n 13 \r\n---> 14 py.iplot(data1, filename = 'basic-line')\r\n\r\nIs there a way to fix this? Thanks",
"@ChaosPredictor I solved this by manually copying the cacert.pem file from /lib/site-packages/certifi to /lib/site-packages/requests and that solved the issue with plotly. Using Anaconda with Python 3.6 on OSX.\r\n\r\n",
"I solved the issue by uninstalling and reinstalling Anaconda. I use Anaconda3 4.4.0 and fix-yahoo-finance 0.0.19 on Ubuntu Linux.",
"> /lib/site-packages/certifi\r\n\r\nIt would really help if you make this a bit more complete. Which of the 2+ libs are you referring to?\r\n"
] |
https://api.github.com/repos/psf/requests/issues/4170
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4170/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4170/comments
|
https://api.github.com/repos/psf/requests/issues/4170/events
|
https://github.com/psf/requests/issues/4170
| 237,691,409 |
MDU6SXNzdWUyMzc2OTE0MDk=
| 4,170 |
How to respond to Form Submit click?
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1273014?v=4",
"events_url": "https://api.github.com/users/scheung38/events{/privacy}",
"followers_url": "https://api.github.com/users/scheung38/followers",
"following_url": "https://api.github.com/users/scheung38/following{/other_user}",
"gists_url": "https://api.github.com/users/scheung38/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/scheung38",
"id": 1273014,
"login": "scheung38",
"node_id": "MDQ6VXNlcjEyNzMwMTQ=",
"organizations_url": "https://api.github.com/users/scheung38/orgs",
"received_events_url": "https://api.github.com/users/scheung38/received_events",
"repos_url": "https://api.github.com/users/scheung38/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/scheung38/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/scheung38/subscriptions",
"type": "User",
"url": "https://api.github.com/users/scheung38",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 1 |
2017-06-21T23:22:28Z
|
2021-09-08T08:00:42Z
|
2017-06-22T01:11:45Z
|
NONE
|
resolved
|
How to respond to Form on HTML click and requests.post triggered as a response? Most examples showing it
r = requests.post(...)
but how to bind this to respond to Button on Form in HTML clicked?
<form method="post" class="navbar-form navbar-right" action="/shorten_url">
<div class="form-group">
<input type="text" id="url" name="url" class="form-control input-lg chat-input" placeholder="URL" />
<button type="submit" class="btn btn-lg btn-info">Submit</button>
</div>
</form>
|
{
"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/4170/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4170/timeline
| null |
completed
| null | null | false |
[
"Hey @scheung38, thanks for taking the time to submit this question. As a future reference, we usually prefer to have these kinds of questions posted on https://stackoverflow.com rather than the issue tracker for the project.\r\n\r\nCould you briefly clarify what you're looking to do here. Are you trying to submit the form to the server, or trigger another request after the form has been submitted?\r\n\r\nIf it's the former, you can find the \"action\" a submit button triggers by looking at the form `action` attribute. In this case it is calling the relative URL path `/shorten_url`. While these are often URL triggers, you may occasionally find calls to javascript functions which Requests does not support.\r\n\r\nIn this specific example, you'll want to provide a POST request to the full URL (e.g. `http://yourdomain.com/shorten_url`) with a body containing `url=http://theurltoshorten.com`.\r\n\r\n```python\r\nr = requests.post('http://yourdomain.com/shorten_url', data={'url': 'http://theurltoshorten.com'})\r\n```\r\n\r\nI'm going to close this out for now, but let us know if this isn't what you were asking."
] |
https://api.github.com/repos/psf/requests/issues/4169
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4169/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4169/comments
|
https://api.github.com/repos/psf/requests/issues/4169/events
|
https://github.com/psf/requests/issues/4169
| 236,910,626 |
MDU6SXNzdWUyMzY5MTA2MjY=
| 4,169 |
Make alternate json libraries a hook to replace builtin json.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/585003?v=4",
"events_url": "https://api.github.com/users/isaulv/events{/privacy}",
"followers_url": "https://api.github.com/users/isaulv/followers",
"following_url": "https://api.github.com/users/isaulv/following{/other_user}",
"gists_url": "https://api.github.com/users/isaulv/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/isaulv",
"id": 585003,
"login": "isaulv",
"node_id": "MDQ6VXNlcjU4NTAwMw==",
"organizations_url": "https://api.github.com/users/isaulv/orgs",
"received_events_url": "https://api.github.com/users/isaulv/received_events",
"repos_url": "https://api.github.com/users/isaulv/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/isaulv/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/isaulv/subscriptions",
"type": "User",
"url": "https://api.github.com/users/isaulv",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 3 |
2017-06-19T14:31:22Z
|
2021-09-01T00:11:34Z
|
2017-06-19T14:37:26Z
|
NONE
|
resolved
|
Currently, in the `_compat.py` module, if you have simplejson installed, it will use that over the standard built-in json.
This works fine in Python 2, since simplejson is typically faster than the built in json package, and it is more 'correct' in handling JSON.
However, in Python 3, simplejson is slower than the built in json package especially for smaller json payloads, which is probably a typical use case with the requests library. Even though simplejson handles various JSON strings better than the built in JSON, those cases are not typical.
I would like to see a hook that allows a user to opt to use a alternate JSON library so that a user can specify if they want to use rapidjson, ujson, simpleson for the `response.json()` decoding.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4",
"events_url": "https://api.github.com/users/Lukasa/events{/privacy}",
"followers_url": "https://api.github.com/users/Lukasa/followers",
"following_url": "https://api.github.com/users/Lukasa/following{/other_user}",
"gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Lukasa",
"id": 1382556,
"login": "Lukasa",
"node_id": "MDQ6VXNlcjEzODI1NTY=",
"organizations_url": "https://api.github.com/users/Lukasa/orgs",
"received_events_url": "https://api.github.com/users/Lukasa/received_events",
"repos_url": "https://api.github.com/users/Lukasa/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Lukasa",
"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/4169/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4169/timeline
| null |
completed
| null | null | false |
[
"The 3.0 release of Requests will remove the use of simplejson in favour of the stdlib module. Until that time, however, we cannot safely remove the option to use simplejson, as it would potentially represent a subtle backward-incompatible dependency change.\r\n\r\nI don't really see any reason to allow more general hooking of JSON libraries: ultimately, additional JSON features are not really a thing I think we need to support.\r\n\r\nThanks for your report!",
"What's the breaking change?",
"@SharpEdgeMarshall replacing the dependency on simplejson in https://github.com/psf/requests/blob/bbc3d43522bcb1363050557655508d66bfebcfcf/requests/compat.py#L28\r\n\r\nI still think you should be able to replace the JSON library used."
] |
https://api.github.com/repos/psf/requests/issues/4168
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4168/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4168/comments
|
https://api.github.com/repos/psf/requests/issues/4168/events
|
https://github.com/psf/requests/issues/4168
| 236,853,286 |
MDU6SXNzdWUyMzY4NTMyODY=
| 4,168 |
unusual url string crashs is py3
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/278728?v=4",
"events_url": "https://api.github.com/users/ReimarBauer/events{/privacy}",
"followers_url": "https://api.github.com/users/ReimarBauer/followers",
"following_url": "https://api.github.com/users/ReimarBauer/following{/other_user}",
"gists_url": "https://api.github.com/users/ReimarBauer/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/ReimarBauer",
"id": 278728,
"login": "ReimarBauer",
"node_id": "MDQ6VXNlcjI3ODcyOA==",
"organizations_url": "https://api.github.com/users/ReimarBauer/orgs",
"received_events_url": "https://api.github.com/users/ReimarBauer/received_events",
"repos_url": "https://api.github.com/users/ReimarBauer/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/ReimarBauer/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/ReimarBauer/subscriptions",
"type": "User",
"url": "https://api.github.com/users/ReimarBauer",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 4 |
2017-06-19T10:58:06Z
|
2021-09-08T02:09:52Z
|
2017-06-19T11:26:04Z
|
NONE
|
resolved
|
I installed the current master by pip install zipfile in a recent python3 conda environment
base_url = 'http://............127.0.0.1:8082'
request.get(base_url)
crashes
and ends with an UnidodeError
python3.6/encodings/idna.py",
line 165, in encode
raise UnicodeError("label empty or too long")
UnicodeError: label empty or too long
May be you can catch this?
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4",
"events_url": "https://api.github.com/users/Lukasa/events{/privacy}",
"followers_url": "https://api.github.com/users/Lukasa/followers",
"following_url": "https://api.github.com/users/Lukasa/following{/other_user}",
"gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Lukasa",
"id": 1382556,
"login": "Lukasa",
"node_id": "MDQ6VXNlcjEzODI1NTY=",
"organizations_url": "https://api.github.com/users/Lukasa/orgs",
"received_events_url": "https://api.github.com/users/Lukasa/received_events",
"repos_url": "https://api.github.com/users/Lukasa/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Lukasa",
"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/4168/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4168/timeline
| null |
completed
| null | null | false |
[
"For posterity, the complete traceback is this:\r\n\r\n```\r\n>>> requests.get(base_url)\r\nTraceback (most recent call last):\r\n File \"/Users/cory/.pyenv/versions/3.6.0/lib/python3.6/encodings/idna.py\", line 165, in encode\r\n raise UnicodeError(\"label empty or too long\")\r\nUnicodeError: label empty or too long\r\n\r\nThe above exception was the direct cause of the following exception:\r\n\r\nTraceback (most recent call last):\r\n File \"<stdin>\", line 1, in <module>\r\n File \"/Users/cory/Documents/Python/requests_org/requests/requests/api.py\", line 72, in get\r\n return request('get', url, params=params, **kwargs)\r\n File \"/Users/cory/Documents/Python/requests_org/requests/requests/api.py\", line 58, in request\r\n return session.request(method=method, url=url, **kwargs)\r\n File \"/Users/cory/Documents/Python/requests_org/requests/requests/sessions.py\", line 493, in request\r\n prep.url, proxies, stream, verify, cert\r\n File \"/Users/cory/Documents/Python/requests_org/requests/requests/sessions.py\", line 666, in merge_environment_settings\r\n env_proxies = get_environ_proxies(url, no_proxy=no_proxy)\r\n File \"/Users/cory/Documents/Python/requests_org/requests/requests/utils.py\", line 692, in get_environ_proxies\r\n if should_bypass_proxies(url, no_proxy=no_proxy):\r\n File \"/Users/cory/Documents/Python/requests_org/requests/requests/utils.py\", line 676, in should_bypass_proxies\r\n bypass = proxy_bypass(netloc)\r\n File \"/Users/cory/.pyenv/versions/3.6.0/lib/python3.6/urllib/request.py\", line 2616, in proxy_bypass\r\n return proxy_bypass_macosx_sysconf(host)\r\n File \"/Users/cory/.pyenv/versions/3.6.0/lib/python3.6/urllib/request.py\", line 2593, in proxy_bypass_macosx_sysconf\r\n return _proxy_bypass_macosx_sysconf(host, proxy_settings)\r\n File \"/Users/cory/.pyenv/versions/3.6.0/lib/python3.6/urllib/request.py\", line 2566, in _proxy_bypass_macosx_sysconf\r\n hostIP = socket.gethostbyname(hostonly)\r\nUnicodeError: encoding with 'idna' codec failed (UnicodeError: label empty or too long)\r\n```\r\n\r\nI don't think there's much we can do about this. The error is coming out of the standard library (specifically, in the urllib `proxy_bypass` function). It's present only on Python 3, which feels the need to call `socket.gethostbyname`. This function will automatically IDNA-encode a unicode hostname, even in situations like this where it's simply not necessary, and its IDNA encoder correctly rejects this.\r\n\r\nThe only way we can fix this is by moving to a *much* smarter URL handling implementation that normalizes URLs in some form. The best candidate is hyperlink, but hyperlink *also* barfs on this for a similar reason (it tries to IDNA-encode and fails).\r\n\r\nThis means that *at best* we could fix this by extending hyperlink with a URL host normalizer and then handle it. However, the WHATWG URL specification also appears to forbid this form of URL. If it does I'm not sure why, as Chrome normalizes it (though Safari does not).\r\n\r\nGiven the amount of work required to do this, I don't see any reason to tolerate it. The URL is just spectacularly far away from anything that can reasonably be expected to work, so I'm inclined to just close this as a won't fix.",
"I'm encountering this for a URL of the format:\r\n\r\n`https://key:[email protected]/path/file.json` \r\n\r\nand length of 132 characters.\r\n",
"@johnpaulhayes That's still not an issue with the requests library, but as I'm also running into it I figure I'll drop an update. \r\n\r\nIt's not the total length of the url that seems to do it, just a section of it. The idna encoder seems to break on urls when the first part of the host name is greater than 64 characters long. For whatever reason, it's including the key and secret in there as well. So either avoid python3 or avoid long \"key:secret@example\" strings (likely by avoiding long api keys) until the underlying functions are fixed. I submitted a bug for it to the python tracker yesterday.",
"For those interested in the issue on the python side \r\nhttps://bugs.python.org/issue32958"
] |
https://api.github.com/repos/psf/requests/issues/4167
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4167/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4167/comments
|
https://api.github.com/repos/psf/requests/issues/4167/events
|
https://github.com/psf/requests/issues/4167
| 236,749,806 |
MDU6SXNzdWUyMzY3NDk4MDY=
| 4,167 |
ConnectionRefusedError error on 302 redirects
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/220772?v=4",
"events_url": "https://api.github.com/users/rasa/events{/privacy}",
"followers_url": "https://api.github.com/users/rasa/followers",
"following_url": "https://api.github.com/users/rasa/following{/other_user}",
"gists_url": "https://api.github.com/users/rasa/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/rasa",
"id": 220772,
"login": "rasa",
"node_id": "MDQ6VXNlcjIyMDc3Mg==",
"organizations_url": "https://api.github.com/users/rasa/orgs",
"received_events_url": "https://api.github.com/users/rasa/received_events",
"repos_url": "https://api.github.com/users/rasa/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/rasa/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/rasa/subscriptions",
"type": "User",
"url": "https://api.github.com/users/rasa",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 3 |
2017-06-18T22:30:23Z
|
2021-09-08T08:00:43Z
|
2017-06-19T00:10:29Z
|
NONE
|
resolved
|
<a name="top"/>302 redirects insert localhost into url (and change scheme from https to http).
Aside: urllib3 works fine:
````python
http = urllib3.PoolManager()
url = 'https://www.apachelounge.com/download/VC14/binaries/httpd-2.4.26-win32-VC14.zip'
r = http.request('GET', url)
````
## Expected Result
No exception
## Actual Result
Exception raised (see below for both [2.7.13](#2.7.13) and [3.6.1](#3.6.1) failures)
## Reproduction Steps
````python
import requests
url = 'https://www.apachelounge.com/download/VC14/binaries/httpd-2.4.26-win32-VC14.zip'
r = requests.head(url)
print(r.status_code)
print(r.headers)
r = requests.head(url, allow_redirects=True)
print(r.status_code)
print(r.headers)
````
## System Information
````
{
"chardet": {
"version": "3.0.4"
},
"cryptography": {
"version": ""
},
"implementation": {
"name": "CPython",
"version": "3.6.1"
},
"platform": {
"release": "7",
"system": "Windows"
},
"pyOpenSSL": {
"openssl_version": "",
"version": null
},
"requests": {
"version": "2.18.1"
},
"system_ssl": {
"version": "100020bf"
},
"urllib3": {
"version": "1.21.1"
},
"using_pyopenssl": false
}
````
<a name="2.7.13"></a>
## Exception (Python 2.7.13) [↑back to top](#top)
````batch
C:\>py get.py
302
{'Keep-Alive': 'timeout=10, max=100', 'Server': 'Apache/2.4.26 (Win64)', 'Connection': 'Keep-Alive',
'Location': 'http://localhost/download/VC14/binaries/httpd-2.4.26-win32-VC14.zip', 'Da
te': 'Sun, 18 Jun 2017 22:33:13 GMT', 'Content-Type': 'text/html; charset=iso-8859-1'}
Traceback (most recent call last):
File "get.py", line 11, in <module>
r = requests.head(url, allow_redirects=True)
File "c:\python\lib\site-packages\requests\api.py", line 98, in head
return request('head', url, **kwargs)
File "c:\python\lib\site-packages\requests\api.py", line 58, in request
return session.request(method=method, url=url, **kwargs)
File "c:\python\lib\site-packages\requests\sessions.py", line 502, in request
resp = self.send(prep, **send_kwargs)
File "c:\python\lib\site-packages\requests\sessions.py", line 634, in send
history = [resp for resp in gen] if allow_redirects else []
File "c:\python\lib\site-packages\requests\sessions.py", line 212, in resolve_redirects
**adapter_kwargs
File "c:\python\lib\site-packages\requests\sessions.py", line 612, in send
r = adapter.send(request, **kwargs)
File "c:\python\lib\site-packages\requests\adapters.py", line 504, in send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=80): Max retries exceeded with url: /download/VC14/binaries/httpd-2.4.26-win32-VC14.zip (Caused by NewConnec
tionError('<urllib3.connection.HTTPConnection object at 0x00000000035D5D30>: Failed to establish a new connection: [Errno 10061] No connection could be made because the target machine act
ively refused it',))
````
<a name="3.6.1"></a>
## Exception (Python 3.6.1) [↑back to top](#top)
````batch
C:\>py get.py
302
{'Date': 'Sun, 18 Jun 2017 22:24:43 GMT', 'Server': 'Apache/2.4.26 (Win64)',
'Location': 'http://localhost/download/VC14/binaries/httpd-2.4.26-win32-VC14.zip', 'Content-Type': 'text/html;
charset=iso-8859-1', 'Keep-Alive': 'timeout=10, max=100', 'Connection': 'Keep-Alive'}
Traceback (most recent call last):
File "c:\python\lib\site-packages\urllib3\connection.py", line 141, in _new_conn
(self.host, self.port), self.timeout, **extra_kw)
File "c:\python\lib\site-packages\urllib3\util\connection.py", line 83, in create_connection
raise err
File "c:\python\lib\site-packages\urllib3\util\connection.py", line 73, in create_connection
sock.connect(sa)
ConnectionRefusedError: [WinError 10061] No connection could be made because the target machine actively refused it
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "c:\python\lib\site-packages\urllib3\connectionpool.py", line 600, in urlopen
chunked=chunked)
File "c:\python\lib\site-packages\urllib3\connectionpool.py", line 356, in _make_request
conn.request(method, url, **httplib_request_kw)
File "c:\python\lib\http\client.py", line 1239, in request
self._send_request(method, url, body, headers, encode_chunked)
File "c:\python\lib\http\client.py", line 1285, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "c:\python\lib\http\client.py", line 1234, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "c:\python\lib\http\client.py", line 1026, in _send_output
self.send(msg)
File "c:\python\lib\http\client.py", line 964, in send
self.connect()
File "c:\python\lib\site-packages\urllib3\connection.py", line 166, in connect
conn = self._new_conn()
File "c:\python\lib\site-packages\urllib3\connection.py", line 150, in _new_conn
self, "Failed to establish a new connection: %s" % e)
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x000000000354AF28>: 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:
Traceback (most recent call last):
File "c:\python\lib\site-packages\requests\adapters.py", line 440, in send
timeout=timeout
File "c:\python\lib\site-packages\urllib3\connectionpool.py", line 649, in urlopen
_stacktrace=sys.exc_info()[2])
File "c:\python\lib\site-packages\urllib3\util\retry.py", line 388, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=80): Max retries exceeded with url: /download/VC14/binaries/httpd-2.4.26-win32-VC14.zip (Caused by NewConnectio
nError('<urllib3.connection.HTTPConnection object at 0x000000000354AF28>: Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine act
ively refused it',))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "get.py", line 11, in <module>
r = requests.head(url, allow_redirects=True)
File "c:\python\lib\site-packages\requests\api.py", line 98, in head
return request('head', url, **kwargs)
File "c:\python\lib\site-packages\requests\api.py", line 58, in request
return session.request(method=method, url=url, **kwargs)
File "c:\python\lib\site-packages\requests\sessions.py", line 502, in request
resp = self.send(prep, **send_kwargs)
File "c:\python\lib\site-packages\requests\sessions.py", line 634, in send
history = [resp for resp in gen] if allow_redirects else []
File "c:\python\lib\site-packages\requests\sessions.py", line 634, in <listcomp>
history = [resp for resp in gen] if allow_redirects else []
File "c:\python\lib\site-packages\requests\sessions.py", line 212, in resolve_redirects
**adapter_kwargs
File "c:\python\lib\site-packages\requests\sessions.py", line 612, in send
r = adapter.send(request, **kwargs)
File "c:\python\lib\site-packages\requests\adapters.py", line 504, in send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=80): Max retries exceeded with url: /download/VC14/binaries/httpd-2.4.26-win32-VC14.zip (Caused by NewConnec
tionError('<urllib3.connection.HTTPConnection object at 0x000000000354AF28>: Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine
actively refused it',))
````
[↑back to top](#top)
|
{
"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/4167/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4167/timeline
| null |
completed
| null | null | false |
[
"Hey @rasa, you'll find that the redirect link being provided by this endpoint is `http://localhost/download/VC14/binaries/httpd-2.4.26-win32-VC14.zip`. Unless you're hosting this service on your machine on port 80, that connection will never be established. \r\n\r\nI ran a quick test with Curl, and you'll see a similar failure with that tool as well. This behaviour appears to be a failure on the part of the apachelounge.com server, and you'll want to contact them about getting that resolved.",
"@rasa, apologies. I replied a little too hastily. The issue you're seeing is related to the `User-Agent` you're providing the server. They've apparently blacklisted both Curl and Python-Requests as user agents, so you'll need to spoof it to access the download. This is why urllib3 works while the other two do not.\r\n\r\nYou can accomplish this by providing a header as shown below:\r\n\r\n```python\r\nimport requests\r\nurl = 'https://www.apachelounge.com/download/VC14/binaries/httpd-2.4.26-win32-VC14.zip'\r\nr = requests.get(url, headers={'User-Agent': 'Definitely-Not-Requests'})\r\n```",
"Thank you for the quick, and detailed, response!"
] |
https://api.github.com/repos/psf/requests/issues/4166
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4166/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4166/comments
|
https://api.github.com/repos/psf/requests/issues/4166/events
|
https://github.com/psf/requests/issues/4166
| 236,627,016 |
MDU6SXNzdWUyMzY2MjcwMTY=
| 4,166 |
Unable to trigger a Jenkins build remotely with a file parameter using python requests
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/3828412?v=4",
"events_url": "https://api.github.com/users/ankuagar/events{/privacy}",
"followers_url": "https://api.github.com/users/ankuagar/followers",
"following_url": "https://api.github.com/users/ankuagar/following{/other_user}",
"gists_url": "https://api.github.com/users/ankuagar/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/ankuagar",
"id": 3828412,
"login": "ankuagar",
"node_id": "MDQ6VXNlcjM4Mjg0MTI=",
"organizations_url": "https://api.github.com/users/ankuagar/orgs",
"received_events_url": "https://api.github.com/users/ankuagar/received_events",
"repos_url": "https://api.github.com/users/ankuagar/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/ankuagar/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/ankuagar/subscriptions",
"type": "User",
"url": "https://api.github.com/users/ankuagar",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 3 |
2017-06-17T00:34:15Z
|
2021-09-08T08:00:42Z
|
2017-06-20T07:26:00Z
|
NONE
|
resolved
|
I was trying to trigger a Jenkins build remotely with a file parameter using python requests
## Expected Result
I was expecting the remote job to be triggered with the contents of file.log saved in ${WORKSPACE}/files/abc.zip
## Actual Result
This code triggers a build.
## What happened instead.
But the file /some/file/path/file.log is not posted to the Jenkins job.
The contents are not available in ${WORKSPACE}/files/abc.zip
## Reproduction Steps
```
python
import requests
url = 'myurl/buildWithParameters'
data = {'Jenkins-Crumb': '8f4d0320c0982763098571789b2b65ec', 'token': 'mytoken'}
filepath='/some/file/path/file.log'
files = {'file': ('files/abc.zip', open(filepath, 'rb')) }
r = requests.post(url, data=data, files=files)
```
## System Information
$ python -m requests.help
```
{
"chardet": {
"version": "3.0.3"
},
"cryptography": {
"version": "1.9"
},
"implementation": {
"name": "CPython",
"version": "2.7.10"
},
"platform": {
"release": "16.6.0",
"system": "Darwin"
},
"pyOpenSSL": {
"openssl_version": "1010006f",
"version": "17.0.0"
},
"requests": {
"version": "2.17.3"
},
"system_ssl": {
"version": "9081df"
},
"urllib3": {
"version": "1.21.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).
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4",
"events_url": "https://api.github.com/users/Lukasa/events{/privacy}",
"followers_url": "https://api.github.com/users/Lukasa/followers",
"following_url": "https://api.github.com/users/Lukasa/following{/other_user}",
"gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Lukasa",
"id": 1382556,
"login": "Lukasa",
"node_id": "MDQ6VXNlcjEzODI1NTY=",
"organizations_url": "https://api.github.com/users/Lukasa/orgs",
"received_events_url": "https://api.github.com/users/Lukasa/received_events",
"repos_url": "https://api.github.com/users/Lukasa/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Lukasa",
"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/4166/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4166/timeline
| null |
completed
| null | null | false |
[
"Do you have some indication of what the format of a successful request should be? It's hard to debug this without knowing that success looks like. ",
"@Lukasa No sorry, I don't have format of a successful request. ",
"In that case we can't really help you: if we don't know what you're trying to produce, we can't tell you how to use Requests to do it. Sorry!"
] |
https://api.github.com/repos/psf/requests/issues/4165
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4165/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4165/comments
|
https://api.github.com/repos/psf/requests/issues/4165/events
|
https://github.com/psf/requests/issues/4165
| 236,557,902 |
MDU6SXNzdWUyMzY1NTc5MDI=
| 4,165 |
figure out sticker delivery
|
{
"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 | 4 |
2017-06-16T18:22:47Z
|
2021-11-24T07:00:23Z
|
2021-08-26T06:50:11Z
|
CONTRIBUTOR
|
resolved
|
- https://www.blackbox.cool
- https://maillift.com/
|
{
"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/4165/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4165/timeline
| null |
completed
| null | null | false |
[
"sir please describe the issue, i would like to work on it..",
"@techytushar, thanks for the interest in helping with Requests! This was a TODO for Kenneth to determine the best way for distributing Requests' stickers. I believe he settled on a solution [here](https://gumroad.com/l/requests-stickers) at gumroad.\r\n\r\n@kennethreitz, should we close this close out at this point, or did you have more outstanding tasks?",
"not figured out yet, just ordering is solved. planning on having my wife stuff envelopes at this point, but we’ll see. ",
"FWIW, I used to be a partner in a company that sold limited art editions online. The big game-changer for us in fulfillment was getting a thermal label printer. The thermal labels (or paper rolls) cost a bit more than inkjet/laser ones, but we could very quickly print them on-demand, one at a time. All the layouts/etc were just pdfs i generated in python from plaintext documents. We bought the first one new, but bought a second used off ebay for super cheap."
] |
https://api.github.com/repos/psf/requests/issues/4164
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4164/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4164/comments
|
https://api.github.com/repos/psf/requests/issues/4164/events
|
https://github.com/psf/requests/issues/4164
| 236,504,657 |
MDU6SXNzdWUyMzY1MDQ2NTc=
| 4,164 |
RuntimeError: More keyword list entries (7) than format specifiers (6)
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/7872259?v=4",
"events_url": "https://api.github.com/users/timmartin19/events{/privacy}",
"followers_url": "https://api.github.com/users/timmartin19/followers",
"following_url": "https://api.github.com/users/timmartin19/following{/other_user}",
"gists_url": "https://api.github.com/users/timmartin19/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/timmartin19",
"id": 7872259,
"login": "timmartin19",
"node_id": "MDQ6VXNlcjc4NzIyNTk=",
"organizations_url": "https://api.github.com/users/timmartin19/orgs",
"received_events_url": "https://api.github.com/users/timmartin19/received_events",
"repos_url": "https://api.github.com/users/timmartin19/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/timmartin19/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/timmartin19/subscriptions",
"type": "User",
"url": "https://api.github.com/users/timmartin19",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 2 |
2017-06-16T14:46:59Z
|
2021-11-26T05:00:32Z
|
2021-08-28T04:14:45Z
|
NONE
|
resolved
|
_Disclaimer_ I'm not sure if this is actually an issue with the requests library. Additionally, we have had significant trouble consistently reproducing this issue.
We are running a Flask app in AWS ECS. In order to [retrieve task credentials|http://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-iam-roles.html] in an ECS task, we need to send a request to `http://169.254.170.2/v2/credentials?task_id=:task_id`. Instead we're getting the very strange error in the title from `_socket.getaddrinfo`.
## Expected Result
We get a response (or at least a reasonable error message)
## Actual Result
*Note* Despite our best efforts, we have not been able to reliably reproduce this. It seems to start happening after a few hours.
```
ERROR in exceptions: More keyword list entries (7) than format specifiers (6)
Traceback (most recent call last):
File "/home/app/dashboard-api/dashboard_api/views/pilot_group.py", line 167, in
req = requests.get('http://169.254.170.2' + cred_uri)
File "/usr/local/lib/python3.5/site-packages/requests/api.py", line 72, in get
return request('get', url, params=params, **kwargs)
File "/usr/local/lib/python3.5/site-packages/requests/api.py", line 58, in request
return session.request(method=method, url=url, **kwargs)
File "/usr/local/lib/python3.5/site-packages/requests/sessions.py", line 502, in request
resp = self.send(prep, **send_kwargs)
File "/usr/local/lib/python3.5/site-packages/raven/breadcrumbs.py", line 297, in send
resp = real_send(self, request, *args, **kwargs)
File "/usr/local/lib/python3.5/site-packages/requests/sessions.py", line 612, in send
r = adapter.send(request, **kwargs)
File "/usr/local/lib/python3.5/site-packages/requests/adapters.py", line 440, in send
timeout=timeout
File "/usr/local/lib/python3.5/site-packages/urllib3/connectionpool.py", line 600, in urlopen
chunked=chunked)
File "/usr/local/lib/python3.5/site-packages/urllib3/connectionpool.py", line 356, in _make_request
conn.request(method, url, **httplib_request_kw)
File "/usr/local/lib/python3.5/http/client.py", line 1106, in request
self._send_request(method, url, body, headers)
File "/usr/local/lib/python3.5/http/client.py", line 1151, in _send_request
self.endheaders(body)
File "/usr/local/lib/python3.5/http/client.py", line 1102, in endheaders
self._send_output(message_body)
File "/usr/local/lib/python3.5/http/client.py", line 934, in _send_output
self.send(msg)
File "/usr/local/lib/python3.5/http/client.py", line 877, in send
self.connect()
File "/usr/local/lib/python3.5/site-packages/urllib3/connection.py", line 166, in connect
conn = self._new_conn()
File "/usr/local/lib/python3.5/site-packages/urllib3/connection.py", line 141, in _new_conn
(self.host, self.port), self.timeout, **extra_kw)
File "/usr/local/lib/python3.5/site-packages/urllib3/util/connection.py", line 60, in create_connection
for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
File "/usr/local/lib/python3.5/socket.py", line 732, in getaddrinfo
for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
RuntimeError: More keyword list entries (7) than format specifiers (6)
```
## Reproduction Steps
We are having a lot of trouble consistently reproducing this but this is the code that triggers it when it happens. Typically it starts failing after a few hours. Originally we thought it was an issue with botocore (and potentially refreshing credentials) so we added the following code but we kept getting the same error.
```python
import requests
# The request path from an environment variable populated by ECS
cred_uri = os.environ.get('AWS_CONTAINER_CREDENTIALS_RELATIVE_URI')
if cred_uri:
resp = requests.get('http://169.254.170.2' + cred_uri)
```
## System Information
$ python -m requests.help
```
{
"chardet": {
"version": "3.0.4"
},
"cryptography": {
"version": ""
},
"implementation": {
"name": "CPython",
"version": "3.5.2"
},
"platform": {
"release": "4.9.27-moby",
"system": "Linux"
},
"pyOpenSSL": {
"openssl_version": "",
"version": null
},
"requests": {
"version": "2.18.1"
},
"system_ssl": {
"version": "100020bf"
},
"urllib3": {
"version": "1.21.1"
},
"using_pyopenssl": false
}
```
Other interesting information:
Running on AWS EC2 Container Service (ECS)
Docker v: 17.03.1-ce
ECS agent version: 1.14.3
We're using [raven-python|https://github.com/getsentry/raven-python] which hooks into requests to log the results.
uwsgi is running it in a Flask app with multi processing and multithreading.
|
{
"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/4164/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4164/timeline
| null |
completed
| null | null | false |
[
"This error strikes me as being a follow-on. I suspect some exception is happening in or around getaddrinfo, and that error is being masked because an attempt is made to format a string that goes awry. The exception itself seems to be happening in the stdlib though. I'd recommend seeing if you can use strace or something similar to spot what is going on in the Python standard library there. One way or another, this error seems to be coming out of the low-level C code in the interpreter.",
"Resolving as this is quite old and we haven't had any follow up providing more information to investigate."
] |
https://api.github.com/repos/psf/requests/issues/4163
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4163/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4163/comments
|
https://api.github.com/repos/psf/requests/issues/4163/events
|
https://github.com/psf/requests/issues/4163
| 236,449,398 |
MDU6SXNzdWUyMzY0NDkzOTg=
| 4,163 |
can't POST
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/24896865?v=4",
"events_url": "https://api.github.com/users/ash73/events{/privacy}",
"followers_url": "https://api.github.com/users/ash73/followers",
"following_url": "https://api.github.com/users/ash73/following{/other_user}",
"gists_url": "https://api.github.com/users/ash73/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/ash73",
"id": 24896865,
"login": "ash73",
"node_id": "MDQ6VXNlcjI0ODk2ODY1",
"organizations_url": "https://api.github.com/users/ash73/orgs",
"received_events_url": "https://api.github.com/users/ash73/received_events",
"repos_url": "https://api.github.com/users/ash73/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/ash73/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/ash73/subscriptions",
"type": "User",
"url": "https://api.github.com/users/ash73",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 2 |
2017-06-16T10:55:57Z
|
2021-09-08T08:00:43Z
|
2017-06-16T10:58:36Z
|
NONE
|
resolved
|
Trying to use python requests to http post.
r = requests.post(address, data=payload)
r.url only shows the url, not the payload.
My php page is returning an error, but I can't see the full url passed to it.
How do I inspect the WHOLE url posted to the web server to debug it?
Whereas
r = requests.get(...)
r.url returns the entire url including the payload.
TIA.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4",
"events_url": "https://api.github.com/users/Lukasa/events{/privacy}",
"followers_url": "https://api.github.com/users/Lukasa/followers",
"following_url": "https://api.github.com/users/Lukasa/following{/other_user}",
"gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Lukasa",
"id": 1382556,
"login": "Lukasa",
"node_id": "MDQ6VXNlcjEzODI1NTY=",
"organizations_url": "https://api.github.com/users/Lukasa/orgs",
"received_events_url": "https://api.github.com/users/Lukasa/received_events",
"repos_url": "https://api.github.com/users/Lukasa/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Lukasa",
"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/4163/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4163/timeline
| null |
completed
| null | null | false |
[
"In requests, `data` *always* adds data to the request body, and `params` always adds data to the request URL. If you want data in the URL you *must* use `params`, and if you want it in the body you *must* use `data`. This is unrelated to the request verb you're using.",
"Many thanks - resolved."
] |
https://api.github.com/repos/psf/requests/issues/4162
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4162/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4162/comments
|
https://api.github.com/repos/psf/requests/issues/4162/events
|
https://github.com/psf/requests/pull/4162
| 236,288,405 |
MDExOlB1bGxSZXF1ZXN0MTI1ODkyODcx
| 4,162 |
Implement low-memory session
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/3999513?v=4",
"events_url": "https://api.github.com/users/y4n9squared/events{/privacy}",
"followers_url": "https://api.github.com/users/y4n9squared/followers",
"following_url": "https://api.github.com/users/y4n9squared/following{/other_user}",
"gists_url": "https://api.github.com/users/y4n9squared/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/y4n9squared",
"id": 3999513,
"login": "y4n9squared",
"node_id": "MDQ6VXNlcjM5OTk1MTM=",
"organizations_url": "https://api.github.com/users/y4n9squared/orgs",
"received_events_url": "https://api.github.com/users/y4n9squared/received_events",
"repos_url": "https://api.github.com/users/y4n9squared/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/y4n9squared/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/y4n9squared/subscriptions",
"type": "User",
"url": "https://api.github.com/users/y4n9squared",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 0 |
2017-06-15T19:18:51Z
|
2017-06-15T19:22:44Z
|
2017-06-15T19:21:18Z
|
NONE
| null |
This derived class of sessions.Session is particularly effective at obstruction.
|
{
"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/4162/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4162/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/4162.diff",
"html_url": "https://github.com/psf/requests/pull/4162",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/4162.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/4162"
}
| true |
[] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.