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/3760
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/3760/labels{/name}
https://api.github.com/repos/psf/requests/issues/3760/comments
https://api.github.com/repos/psf/requests/issues/3760/events
https://github.com/psf/requests/pull/3760
194,612,069
MDExOlB1bGxSZXF1ZXN0OTczMjAxMTc=
3,760
Add deprecation warnings for 3.0
{ "avatar_url": "https://avatars.githubusercontent.com/u/240830?v=4", "events_url": "https://api.github.com/users/sigmavirus24/events{/privacy}", "followers_url": "https://api.github.com/users/sigmavirus24/followers", "following_url": "https://api.github.com/users/sigmavirus24/following{/other_user}", "gists_url": "https://api.github.com/users/sigmavirus24/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/sigmavirus24", "id": 240830, "login": "sigmavirus24", "node_id": "MDQ6VXNlcjI0MDgzMA==", "organizations_url": "https://api.github.com/users/sigmavirus24/orgs", "received_events_url": "https://api.github.com/users/sigmavirus24/received_events", "repos_url": "https://api.github.com/users/sigmavirus24/repos", "site_admin": false, "starred_url": "https://api.github.com/users/sigmavirus24/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/sigmavirus24/subscriptions", "type": "User", "url": "https://api.github.com/users/sigmavirus24", "user_view_type": "public" }
[]
closed
true
null
[]
null
6
2016-12-09T14:41:16Z
2021-09-08T01:21:30Z
2016-12-09T14:48:42Z
CONTRIBUTOR
resolved
Add extra test parameter for basic auth encoding
{ "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/3760/reactions" }
https://api.github.com/repos/psf/requests/issues/3760/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/3760.diff", "html_url": "https://github.com/psf/requests/pull/3760", "merged_at": "2016-12-09T14:48:42Z", "patch_url": "https://github.com/psf/requests/pull/3760.patch", "url": "https://api.github.com/repos/psf/requests/pulls/3760" }
true
[ "Don't merge yet, I think I swapped the warning message and class", "r4r @Lukasa @nateprewitt ", "@Lukasa when you get another second to merge master into Proposed/3.0.0, I'll throw up the other patch.", "Already done. ;)", "hell yeah!", "Looks like we might be hitting a problem in 2.6 with zero length values in the string formatter (None specifically)." ]
https://api.github.com/repos/psf/requests/issues/3759
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/3759/labels{/name}
https://api.github.com/repos/psf/requests/issues/3759/comments
https://api.github.com/repos/psf/requests/issues/3759/events
https://github.com/psf/requests/issues/3759
194,476,114
MDU6SXNzdWUxOTQ0NzYxMTQ=
3,759
cookies.py why replace escaped quote with nothing?
{ "avatar_url": "https://avatars.githubusercontent.com/u/664265?v=4", "events_url": "https://api.github.com/users/saft/events{/privacy}", "followers_url": "https://api.github.com/users/saft/followers", "following_url": "https://api.github.com/users/saft/following{/other_user}", "gists_url": "https://api.github.com/users/saft/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/saft", "id": 664265, "login": "saft", "node_id": "MDQ6VXNlcjY2NDI2NQ==", "organizations_url": "https://api.github.com/users/saft/orgs", "received_events_url": "https://api.github.com/users/saft/received_events", "repos_url": "https://api.github.com/users/saft/repos", "site_admin": false, "starred_url": "https://api.github.com/users/saft/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/saft/subscriptions", "type": "User", "url": "https://api.github.com/users/saft", "user_view_type": "public" }
[]
open
false
null
[]
null
21
2016-12-08T23:47:56Z
2023-11-27T13:30:27Z
null
NONE
null
https://github.com/kennethreitz/requests/blob/master/requests/cookies.py#L346 Why do this? An escaped quote can be sent in the case of sending json in the cookie and this code mangles that json. I'm raising this because the http library seems to think that formatting the json this way on the server is the right way to do it. See http/cookies.py function _quote line 225 in my 3.4 version.
null
{ "+1": 3, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 3, "url": "https://api.github.com/repos/psf/requests/issues/3759/reactions" }
https://api.github.com/repos/psf/requests/issues/3759/timeline
null
null
null
null
false
[ "Can you provide an example of a server sending JSON in the cookie header? The RFCs ([6265](https://tools.ietf.org/html/rfc6265)) for Cookies are explicit and JSON really doesn't fit into the cookie header appropriately.", "The following library does it quite explicitly. I'm not sure how stable it is but it is referenced in the aiohttp documentation.\r\nhttps://github.com/aio-libs/aiohttp-session/blob/master/aiohttp_session/__init__.py#L219", "> I'm raising this because the http library seems to think that formatting the json this way on the server is the right way to do it.\r\n\r\nSo you seemed to mention that there was a server sending JSON in the set-cookie header. Now you're pointing at another library? I don't see how that library is storing JSON in a cookie at all. Do you mean that it allows for it?", "Maybe this line helps to illustrate where aiohttp_session puts json into the cookie:\r\nhttps://github.com/aio-libs/aiohttp-session/blob/master/aiohttp_session/__init__.py#L245\r\n\r\naiohttp_session uses aiohttp which uses http/cookies.py. The server is my own.\r\n\r\nTo look at it from the other perspective, why remove all escaped quotes from cookie data - 6265 doesn't disallow that?", "As always, the easiest thing to do when you're trying to work out the answer to a problem like this is to just look at the Git logs. If you do, they direct you to #1440.\r\n\r\nThe TL;DR is that unescaping all quotes was probably unnecessary. The goal of the original patch was simply to remove enclosing quote marks, but we took a (probably a bit too aggressive) shortcut. I'm open to a patch that changes that behaviour.", "From #1440 I can't figure out what the *end* intent of it was. Perhaps to be out-of-the-box compatible with Django? Certainly now set_cookie actually keeps the enclosing quote marks.\r\n\r\nOn further analysis, RFC6265 does seem to say that backslash and double quotes are invalid characters. However what set_cookie does is to just remove all occurrences of \\\\\".\r\n\r\nI would love to try to improve that bit of code but I'm not sure what I should be trying to improve it towards. ", "@saft The *end* intent was to unescape escaped quote marks that *surround* a cookie value. These are almost certainly in error. However, we seem to have done that by hitting the problem with a sledgehammer by just unescaping *all* quotes, which was probably unnecessary.\r\n\r\nSo the goal would be to craft a change here that uses a regular expression to only unquote quote marks at the start and end of the cookie value.", "Are you saying the the intent was to remove parts 2 and 4 of cookie value below if they exist?\r\n```\r\n 1 2 3 4 5\r\n[\"][\\\\\"][...][\\\\\"][\"]\r\n```\r\nIf so why do you want to do that as a special case?", "I think the intent was to change this\r\n`[\\\"]...[\\\"]`\r\nto this\r\n`[\"]...[\"]`\r\n", "@piotr-dobrogost is correct.", "OK, I think I'm out of place to continue to question (or maybe not in this forum) so please suggest we discontinue the conversation if you think so too. \r\n\r\nMy curiosity isn't quite satisfied though. The intent is not in line with RFC6265 so why is it desirable?", "@saft I'm not sure what you mean: we're agreeing that the current behaviour is wrong. We're just trying to discuss what the fix should be.\r\n\r\nAs to \"the intent is not in line with RFC 6265\": sure it is. RFC 6265 allows surrounding DQUOTE characters. This is to allow the possibility that someone has mistakenly escaped the DQUOTE values, which is *forbidden* by RFC 6265.\r\n\r\nHowever, it does end up seeming like this might be superfluous to needs. Right now I'm not able to reproduce a situation in which that behaviour is required.", "What is allowed in a cookie value has been traditionally very tricky question. I think the intent was to tolerate *reasonably looking* cookies. However now that there's good answer to the question what is allowed (in the form of RFC 6265) there's no reason to tolerate such invalid cookies anymore. If so then there's no need to unescape anything as any cookie's value including backspace or double quote is invalid. The only problem is backwards compatibility which prevents library from breaking some behavior even though it might have been wrong in the first place. This could be the reason to fix this bug by bringing behavior to what was intended (to tolerate escaped double quotes when they start and end the cookie's value) and not to what is allowed by current standard (RFC 6265).\r\n\r\n> RFC 6265 allows surrounding DQUOTE characters. \r\n\r\nYou mean RFC 6265 allows the cookie's value to be surrounded I guess :)\r\n", "Yes, they are missing a comma (and the last comma in this line is superfluous :)).\r\n\r\nAccording to RFC 2965:\r\n```\r\ncookie-value = NAME \"=\" VALUE [\";\" path] [\";\" domain] [\";\" port]\r\nVALUE = value\r\nvalue = token | quoted-string\r\n```\r\nand RFC 2616 defines:\r\n```\r\nquoted-string = ( <\"> *(qdtext | quoted-pair ) <\"> )\r\nqdtext = <any TEXT except <\">>\r\nquoted-pair = \"\\\" CHAR\r\n\r\ntoken = 1*<any CHAR except CTLs or separators>\r\nseparators = \"(\" | \")\" | \"<\" | \">\" | \"@\"\r\n | \",\" | \";\" | \":\" | \"\\\" | <\">\r\n | \"/\" | \"[\" | \"]\" | \"?\" | \"=\"\r\n | \"{\" | \"}\" | SP | HT\r\n```\r\nYou say that library does not allow `\\\\\"` substring. The question is if it's allowed by cited grammar rules. If it's not allowed then I think the library is right to disallow this.\r\n", "> I think the intent was to change this\r\n[\\\"]...[\\\"]\r\n\r\nOn second thought I don't agree with this because of:\r\n`if hasattr(cookie.value, 'startswith') and cookie.value.startswith('\"') and cookie.value.endswith('\"'):`\r\n\r\n> What is allowed in a cookie value has been traditionally very tricky question.\r\n\r\n+1\r\n> However now that there's good answer to the question what is allowed (in the form of RFC 6265) there's no reason to tolerate such invalid cookies anymore.\r\n\r\nPerhaps. I think this set_cookie is arbitrary. I'm still unconvinced of any justification for any stated intent so far.", "> Perhaps. I think this set_cookie is arbitrary. I'm still unconvinced of any justification for any stated intent so far.\r\n\r\nAnd?\r\n\r\nNo-one is disagreeing with the idea that this method is not achieving what it set out to. I am explaining the train of thought that led us here. I am not asserting that it was correct or useful, only that it's the reasoning. I am explaining this because your original issue was a question: \"why do this?\". I have pointed you to the why.\r\n\r\nHowever, both myself and @piotr-dobrogost have *already said* that we are open to changes in behaviour here. I don't know who you're trying to convince: there is no-one here arguing that the status quo is good. I feel like you're arguing against a non-existent opponent.\r\n\r\nThe TL;DR is this: this method seems like it's a waste of everyone's time, and probably should be removed. However, as the Requests project has learned all too clearly, *actually removing it* is likely to be a backward incompatible change. There are some hopes that we will remove or drastically rewrite this entire module, though, so I suspect this will go away.", "OK, my apologies. I see that I'm coming across argumentative to you. My intent was purely to educate myself and to help if I could at all. However, I hear you and am ready to drop this. You guys have been really really helpful. πŸ‘ \r\n\r\nTo be totally open and honest I don't feel like there was a coherent intent or 'why' explained. That is why I pursued it.\r\n\r\nBut, I did hear you say that you were open to changes. I doubly hear you that it will probably be a backward incompatible change for some. If we really understood the 'why' of why it was added and who would be burned we might be able to mitigate that.", "@saft Seems like a traditional case of crossed wires due to text-based communication. Thankyou for apologising: I'm sorry as well, I clearly misread your tone.\r\n\r\nBack to being productive. πŸ‘ \r\n\r\nSo, I think this is wrong. I am absolutely not an expert on cookies: they are the part of HTTP I know least about. However, as I understand from some of my collaborators on this project, our cookie stack is ultimately not very good. Part of this is because of the involvement of the standard library, whose cookie stack is *also* not very good.\r\n\r\nSo right now the cookie stack was worked on to the point where all the complaints went away. And they have! The cookie functionality is one of the least-complained-about parts of Requests. So that leads to a strong inclination to avoid making incremental changes to it, and to instead more-or-less leave it alone until such time as we can totally replace it.\r\n\r\nUltimately, I think the reason this patch was added was a sense of defensiveness against a problem that didn't fully exist. An enormous part of that is my responsibility: I reviewed and merged #1440, and ultimately probably should have done more investigating to prove that the problem existed. Certainly, trying today, I can't find any immediate adverse affects from removing that block of code. \r\n\r\nHowever, now that that has happened, there is a problem of inertia. Ultimately, it doesn't seem to be *hurting* many people. It's entirely circumventable, because we allow plugging in other cookiejar objects, so anyone it does inconvenience can nonetheless work around it. And it has been there for three years without so much as a whimper.\r\n\r\nMy strong inclination, then, is to leave it alone until such time as we consider a substantial change to the cookie stack. At that time, we can also include substantial testing of the cookie functionality so that we can do a much better job of indicating why certain bits of functionality are present.", "I see you're trying to get to **the truth** (even if it's only the *historic truth* :)) and not only I understand this but I applaud you for doing this. I'm with you because I have exactly the same attitude :) Once upon a time I was curious what can be escaped (if I remember well) in cookie-value and I raised issue at https://github.com/sashahart/cookies. However as you can see this repo has since moved and the Issues section is no more available :( That's a pity because I think you might find this issue and discussion there interesting :) I emailed Sasha asking if he could show Issues section again.", "Please stop babbling and start coding. Fix this. Thank you. πŸ™‚", "just add\r\n```python\r\ndel requests.cookies.RequestsCookieJar.set_cookie\r\n```\r\nif you want to use the cookie as you get from the request" ]
https://api.github.com/repos/psf/requests/issues/3758
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/3758/labels{/name}
https://api.github.com/repos/psf/requests/issues/3758/comments
https://api.github.com/repos/psf/requests/issues/3758/events
https://github.com/psf/requests/pull/3758
194,456,400
MDExOlB1bGxSZXF1ZXN0OTcyMDk3MjY=
3,758
adding string casting for non-bytes values
{ "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
5
2016-12-08T22:01:52Z
2021-09-08T01:21:34Z
2016-12-09T08:45:14Z
MEMBER
resolved
This addresses #3753, I'll open a PR for 3.0.0 removing this when we merge master.
{ "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/3758/reactions" }
https://api.github.com/repos/psf/requests/issues/3758/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/3758.diff", "html_url": "https://github.com/psf/requests/pull/3758", "merged_at": "2016-12-09T08:45:14Z", "patch_url": "https://github.com/psf/requests/pull/3758.patch", "url": "https://api.github.com/repos/psf/requests/pulls/3758" }
true
[ "i support this", "it's stupid, but no reason not to ", "LGTM. Thanks for this @nateprewitt! :sparkles:", "And I've just caught the 3.0.0 branch up, so you can go ahead and open the second PR now.", "@sigmavirus24 you're suggesting using `warnings.warn` to actively notify the user about the deprecation, correct? I can add that and the test here in a moment if you're not already working on it." ]
https://api.github.com/repos/psf/requests/issues/3757
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/3757/labels{/name}
https://api.github.com/repos/psf/requests/issues/3757/comments
https://api.github.com/repos/psf/requests/issues/3757/events
https://github.com/psf/requests/pull/3757
194,408,161
MDExOlB1bGxSZXF1ZXN0OTcxNzQzMTc=
3,757
301/302 redirects for non-POST with body
{ "avatar_url": "https://avatars.githubusercontent.com/u/5271761?v=4", "events_url": "https://api.github.com/users/nateprewitt/events{/privacy}", "followers_url": "https://api.github.com/users/nateprewitt/followers", "following_url": "https://api.github.com/users/nateprewitt/following{/other_user}", "gists_url": "https://api.github.com/users/nateprewitt/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/nateprewitt", "id": 5271761, "login": "nateprewitt", "node_id": "MDQ6VXNlcjUyNzE3NjE=", "organizations_url": "https://api.github.com/users/nateprewitt/orgs", "received_events_url": "https://api.github.com/users/nateprewitt/received_events", "repos_url": "https://api.github.com/users/nateprewitt/repos", "site_admin": false, "starred_url": "https://api.github.com/users/nateprewitt/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/nateprewitt/subscriptions", "type": "User", "url": "https://api.github.com/users/nateprewitt", "user_view_type": "public" }
[]
closed
true
null
[]
null
3
2016-12-08T18:23:36Z
2021-09-08T01:21:32Z
2016-12-12T15:54:17Z
MEMBER
resolved
This patch is an attempt to address #2590 by relaxing the way Requests handles redirects. Taking a look at how we’re handling stripping bodies, I modified the conditional to avoid an overly complicated check. The only requests we want to strip bodies off of are ones that have been modified from the redirect. That means the method will have already been changed to GET in `rebuild_method` and we can perform a uniform stripping for only GET requests. Personally, I'd like to have `rebuild_method` return a value, either a boolean or the new method, and use that as the parameter for the check. Then move the code inside the conditional into it's own function. This will help a bit with the overall size of `resolve_redirects`. I also removed the 302 catch-all which was put in place in #1704 when RFC 2616 was still the standard. The previous mandates for 302 aren’t included in [RFC 7231 6.4.3](https://tools.ietf.org/html/rfc7231#section-6.4.3) and don’t appear to be reproducible in Chrome or Firefox with any tools supporting PUT, PATCH, or DELETE. (Note: if there’s a repro for this that I’m missing please let me know and I’ll gladly revert this. I’m just going off of the information available.) The "test all methods" tests may be a bit overboard, I added them primarily for my own assurance to make sure I wasn't missing edge cases. I can remove those if they're deemed unnecessary.
{ "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/3757/reactions" }
https://api.github.com/repos/psf/requests/issues/3757/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/3757.diff", "html_url": "https://github.com/psf/requests/pull/3757", "merged_at": "2016-12-12T15:54:17Z", "patch_url": "https://github.com/psf/requests/pull/3757.patch", "url": "https://api.github.com/repos/psf/requests/pulls/3757" }
true
[ "Alright, comments updated.\r\n\r\n> Personally, I'd like to have rebuild_method return a value, either a boolean or the new method, and use that as the parameter for the check. Then move the code inside the conditional into it's own function. This will help a bit with the overall size of resolve_redirects.\r\n\r\nThoughts on mucking with this? If not, I think we're good to go.", "@Lukasa, I think this is ready for a peek whenever you've got a moment :)", "Ok, 301-303 individual tests removed in favor of the big ones." ]
https://api.github.com/repos/psf/requests/issues/3756
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/3756/labels{/name}
https://api.github.com/repos/psf/requests/issues/3756/comments
https://api.github.com/repos/psf/requests/issues/3756/events
https://github.com/psf/requests/issues/3756
194,406,787
MDU6SXNzdWUxOTQ0MDY3ODc=
3,756
ImportError: No module named urllib3
{ "avatar_url": "https://avatars.githubusercontent.com/u/3091956?v=4", "events_url": "https://api.github.com/users/mperino/events{/privacy}", "followers_url": "https://api.github.com/users/mperino/followers", "following_url": "https://api.github.com/users/mperino/following{/other_user}", "gists_url": "https://api.github.com/users/mperino/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/mperino", "id": 3091956, "login": "mperino", "node_id": "MDQ6VXNlcjMwOTE5NTY=", "organizations_url": "https://api.github.com/users/mperino/orgs", "received_events_url": "https://api.github.com/users/mperino/received_events", "repos_url": "https://api.github.com/users/mperino/repos", "site_admin": false, "starred_url": "https://api.github.com/users/mperino/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/mperino/subscriptions", "type": "User", "url": "https://api.github.com/users/mperino", "user_view_type": "public" }
[]
closed
true
null
[]
null
3
2016-12-08T18:17:12Z
2021-09-08T06:00:34Z
2016-12-08T18:21:39Z
NONE
resolved
On Python 2.6 on Solaris Did a pip install requests, and simple example code produces: the version is requests-2.12.3 Traceback (most recent call last): File "/www/htdocs/cgi-bin/scrapetest.py", line 7, in <module> from requests.auth import HTTPBasicAuth File "/opt/csw/lib/python2.6/site-packages/requests/__init__.py", line 60, in <module> from .packages.urllib3.exceptions import DependencyWarning File "/opt/csw/lib/python2.6/site-packages/requests/packages/__init__.py", line 29, in <module> import urllib3 ImportError: No module named urllib3 Tried Un-install, re-install neither fixes it. Tried installing urllib3 (urllib3-1.19.1) which produces a different traceback message: Traceback (most recent call last): File "/www/htdocs/cgi-bin/scrapetest.py", line 7, in <module> from requests.auth import HTTPBasicAuth File "/opt/csw/lib/python2.6/site-packages/requests/__init__.py", line 60, in <module> from .packages.urllib3.exceptions import DependencyWarning File "/opt/csw/lib/python2.6/site-packages/requests/packages/__init__.py", line 29, in <module> import urllib3 File "/opt/csw/lib/python2.6/site-packages/urllib3/__init__.py", line 8, in <module> from .connectionpool import ( File "/opt/csw/lib/python2.6/site-packages/urllib3/connectionpool.py", line 11, in <module> from .exceptions import ( File "/opt/csw/lib/python2.6/site-packages/urllib3/exceptions.py", line 2, in <module> from .packages.six.moves.http_client import ( File "/opt/csw/lib/python2.6/site-packages/urllib3/packages/six.py", line 27, in <module> import operator ImportError: ld.so.1: python2.6: fatal: relocation error: file /opt/csw/lib/python2.6/lib-dynload/operator.so: symbol _PyUnicodeUCS4_AsDefaultEncodedString: referenced symbol not found
{ "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/3756/reactions" }
https://api.github.com/repos/psf/requests/issues/3756/timeline
null
completed
null
null
false
[ "Your Python install seems extremely broken. Your Python is somehow unable to find files that pip should have installed in the same directory as Requests and as well seems to be unable to import six, which should be very simple, due to a symbol problem inside Python itself.\r\n\r\nYou will need to fix your Python before we can help you. ", "It's the one provided by Open CSW, which is fairly generic (albiet old).\r\nIm getting further with the Python 3.3 on the same system which gives many new and likely outside requests.", "# reason:\r\n\r\n- env: `mac osx 10.12.6 ` + `Python2.7.13` + `requests (2.12.4)`\r\n- you guys should check `openssl` version.\r\n- the mac osx default openssl version is `0.9.8zh 14 Jan 2016`.\r\n- when you use `brew install openssl`, the current version is `stable 1.0.2l`.\r\n- but if you use `brew install [email protected]`, this version will Cause `No Module Found Urllib3` issue.\r\n\r\n\r\n# How to fix:\r\n\r\n```bash\r\n\r\nbrew uninstall [email protected]\r\n\r\n# openssl: stable 1.0.2l\r\nbrew install openssl\r\n\r\n```\r\n\r\n- then, you will find `Urllib3` issue is fixed.\r\n\r\n\r\n\r\n\r\n\r\n## ref:\r\nhttps://github.com/pypa/pip/issues/3593#issuecomment-338539287\r\n\r\n" ]
https://api.github.com/repos/psf/requests/issues/3755
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/3755/labels{/name}
https://api.github.com/repos/psf/requests/issues/3755/comments
https://api.github.com/repos/psf/requests/issues/3755/events
https://github.com/psf/requests/issues/3755
194,246,481
MDU6SXNzdWUxOTQyNDY0ODE=
3,755
extensions issue with requests-2.12.3-py3.5.egg
{ "avatar_url": "https://avatars.githubusercontent.com/u/9314150?v=4", "events_url": "https://api.github.com/users/luwm001/events{/privacy}", "followers_url": "https://api.github.com/users/luwm001/followers", "following_url": "https://api.github.com/users/luwm001/following{/other_user}", "gists_url": "https://api.github.com/users/luwm001/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/luwm001", "id": 9314150, "login": "luwm001", "node_id": "MDQ6VXNlcjkzMTQxNTA=", "organizations_url": "https://api.github.com/users/luwm001/orgs", "received_events_url": "https://api.github.com/users/luwm001/received_events", "repos_url": "https://api.github.com/users/luwm001/repos", "site_admin": false, "starred_url": "https://api.github.com/users/luwm001/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/luwm001/subscriptions", "type": "User", "url": "https://api.github.com/users/luwm001", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2016-12-08T04:48:20Z
2021-09-08T13:05:42Z
2016-12-08T06:09:53Z
NONE
resolved
after upgarde to 2.12.3 under win10, below issue is encountered, any suggestion? File "d:\Anaconda3\lib\site-packages\requests-2.12.3-py3.5.egg\requests\sessions.py", line 535, in post return self.request('POST', url, data=data, json=json, **kwargs) File "d:\Anaconda3\lib\site-packages\requests-2.12.3-py3.5.egg\requests\sessions.py", line 488, in request resp = self.send(prep, **send_kwargs) File "d:\Anaconda3\lib\site-packages\requests-2.12.3-py3.5.egg\requests\sessions.py", line 609, in send r = adapter.send(request, **kwargs) File "d:\Anaconda3\lib\site-packages\requests-2.12.3-py3.5.egg\requests\adapters.py", line 423, in send timeout=timeout File "d:\Anaconda3\lib\site-packages\requests-2.12.3-py3.5.egg\requests\packages\urllib3\connectionpool.py", line 594, in urlopen chunked=chunked) File "d:\Anaconda3\lib\site-packages\requests-2.12.3-py3.5.egg\requests\packages\urllib3\connectionpool.py", line 350, in _make_request self._validate_conn(conn) File "d:\Anaconda3\lib\site-packages\requests-2.12.3-py3.5.egg\requests\packages\urllib3\connectionpool.py", line 835, in _validate_conn conn.connect() File "d:\Anaconda3\lib\site-packages\requests-2.12.3-py3.5.egg\requests\packages\urllib3\connection.py", line 330, in connect cert = self.sock.getpeercert() File "d:\Anaconda3\lib\site-packages\requests-2.12.3-py3.5.egg\requests\packages\urllib3\contrib\pyopenssl.py", line 324, in getpeercert 'subjectAltName': get_subj_alt_name(x509) File "d:\Anaconda3\lib\site-packages\requests-2.12.3-py3.5.egg\requests\packages\urllib3\contrib\pyopenssl.py", line 171, in get_subj_alt_name ext = cert.extensions.get_extension_for_class( AttributeError: 'Extensions' object has no attribute 'get_extension_for_class'
{ "avatar_url": "https://avatars.githubusercontent.com/u/9314150?v=4", "events_url": "https://api.github.com/users/luwm001/events{/privacy}", "followers_url": "https://api.github.com/users/luwm001/followers", "following_url": "https://api.github.com/users/luwm001/following{/other_user}", "gists_url": "https://api.github.com/users/luwm001/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/luwm001", "id": 9314150, "login": "luwm001", "node_id": "MDQ6VXNlcjkzMTQxNTA=", "organizations_url": "https://api.github.com/users/luwm001/orgs", "received_events_url": "https://api.github.com/users/luwm001/received_events", "repos_url": "https://api.github.com/users/luwm001/repos", "site_admin": false, "starred_url": "https://api.github.com/users/luwm001/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/luwm001/subscriptions", "type": "User", "url": "https://api.github.com/users/luwm001", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/3755/reactions" }
https://api.github.com/repos/psf/requests/issues/3755/timeline
null
completed
null
null
false
[ "Hey @luwm001, this appears to be a duplicate of #3710. I believe you'll be able to solve this issue by updating your `cryptography` module version.", "Thanks." ]
https://api.github.com/repos/psf/requests/issues/3754
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/3754/labels{/name}
https://api.github.com/repos/psf/requests/issues/3754/comments
https://api.github.com/repos/psf/requests/issues/3754/events
https://github.com/psf/requests/pull/3754
194,243,782
MDExOlB1bGxSZXF1ZXN0OTcwNTY5MjQ=
3,754
test auth doesn't generate incorrect http headers
{ "avatar_url": "https://avatars.githubusercontent.com/u/5271761?v=4", "events_url": "https://api.github.com/users/nateprewitt/events{/privacy}", "followers_url": "https://api.github.com/users/nateprewitt/followers", "following_url": "https://api.github.com/users/nateprewitt/following{/other_user}", "gists_url": "https://api.github.com/users/nateprewitt/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/nateprewitt", "id": 5271761, "login": "nateprewitt", "node_id": "MDQ6VXNlcjUyNzE3NjE=", "organizations_url": "https://api.github.com/users/nateprewitt/orgs", "received_events_url": "https://api.github.com/users/nateprewitt/received_events", "repos_url": "https://api.github.com/users/nateprewitt/repos", "site_admin": false, "starred_url": "https://api.github.com/users/nateprewitt/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/nateprewitt/subscriptions", "type": "User", "url": "https://api.github.com/users/nateprewitt", "user_view_type": "public" }
[]
closed
true
null
[]
null
3
2016-12-08T04:21:45Z
2021-09-08T01:21:35Z
2016-12-08T09:05:13Z
MEMBER
resolved
These are a few tests from #3338 which is slated for Proposed/3.0.0. #3066 is the issue #3338 was originally opened to fix, but has since been resolved on master with #3082 and #3535. Adding these tests will allow us to confirm #3066 is indeed resolved and help prevent regressions until 3.0.0 is released.
{ "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/3754/reactions" }
https://api.github.com/repos/psf/requests/issues/3754/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/3754.diff", "html_url": "https://github.com/psf/requests/pull/3754", "merged_at": "2016-12-08T09:05:13Z", "patch_url": "https://github.com/psf/requests/pull/3754.patch", "url": "https://api.github.com/repos/psf/requests/pulls/3754" }
true
[ "Is the plan for this to land in 3.0.0 or master? Your summary isn't entirely clear.", "Based on some of the other issues you linked I *think* you did want these tests in master.", "Yep, master was the goal here. Thanks!" ]
https://api.github.com/repos/psf/requests/issues/3753
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/3753/labels{/name}
https://api.github.com/repos/psf/requests/issues/3753/comments
https://api.github.com/repos/psf/requests/issues/3753/events
https://github.com/psf/requests/issues/3753
194,227,851
MDU6SXNzdWUxOTQyMjc4NTE=
3,753
Basic auth with integer username broken in 2.12.2
{ "avatar_url": "https://avatars.githubusercontent.com/u/278835?v=4", "events_url": "https://api.github.com/users/oschwald/events{/privacy}", "followers_url": "https://api.github.com/users/oschwald/followers", "following_url": "https://api.github.com/users/oschwald/following{/other_user}", "gists_url": "https://api.github.com/users/oschwald/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/oschwald", "id": 278835, "login": "oschwald", "node_id": "MDQ6VXNlcjI3ODgzNQ==", "organizations_url": "https://api.github.com/users/oschwald/orgs", "received_events_url": "https://api.github.com/users/oschwald/received_events", "repos_url": "https://api.github.com/users/oschwald/repos", "site_admin": false, "starred_url": "https://api.github.com/users/oschwald/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/oschwald/subscriptions", "type": "User", "url": "https://api.github.com/users/oschwald", "user_view_type": "public" }
[]
closed
true
null
[]
null
9
2016-12-08T02:01:25Z
2021-09-08T13:05:41Z
2016-12-09T17:17:48Z
NONE
resolved
Previously, it was possible to set `auth` to something like `(42,'password')`. This has worked fine since before requests hit 1.0. 2.12.2, a patch release, broke this, causing failures such as the ones seen in this [Travis build](https://travis-ci.org/maxmind/GeoIP2-python/jobs/181427000). I am not saying the new behavior is incorrect, but this is a breaking change. This is similar but not the same as #3750, #3736, and #3751.
{ "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/3753/reactions" }
https://api.github.com/repos/psf/requests/issues/3753/timeline
null
completed
null
null
false
[ "This is different to the other three issues. Those three issues are all passing `None` type to `auth()` - You're passing an `int` object instead.\r\n\r\nIt would appear that they were all caused by 329a5cf though. \r\n\r\nWhat decisions those that maintain requests want to make is up to them though, just thought I'd help debug this.", "A possible solution:\r\n`codecs.encode(\"{0}:{1}\".format(username, password).encode(), \"base-64\").strip()`\r\nNot sure how versatile this is though", "I've got a feeling this may fall under Requests' policy of \"All header values must be a string, bytestring, or unicode.\", since the Authorization field generated is a header, and the `auth` keyword is even discussed in the [Custom Headers](http://docs.python-requests.org/en/master/user/quickstart/#custom-headers) docs.\r\n\r\n@Lukasa may have different feelings on this, but trying to permit non-string values here seems to have the same ambiguity issues we've tried to avoid elsewhere. Just like how `None` hasn't been permitted because `None` is cast to a string, when the user much more likely wants `\"\"`, which will generate different auth values.", "This gets to be another entry on my list of problems with semantic versioning.\r\n\r\nWe never intended non-string values to work here. I didn't care about the removal of support for `None`, because it was a colossally stupid value to allow that would basically never do what people expected. But at this point we begin to go off the rails again. And semantic versioning, read strictly, doesn't allow tightening of any check at all in a minor release.\r\n\r\nI think the best thing to do is to re-add support for non-string values by checking for them and casting them to str explicitly. I don't want to hide it: I want us to put a big-ol' comment on top of it that says that this behaviour is dumb but we need to preserve it because people are relying on it. I then think we should catch-up master into proposed/3.0.0 and then merge a PR that *removes* that explicit cast.", "Ok, right now master and proposed/3.0.0 are caught up. So if someone wants to make this patch, I can walk them through the two PRs we'll need.", "For what it is worth, older versions of Requests did not work correctly with a username or password that were bytes on Python 3. They would produce authorization headers like `b'42':b'password'` when passed `(b'42', b'password')`; 2.12.2+ produce `42:password`.", "@oschwald, yeah that was the intent (or I had understood it to be part) of #3673 which ended up causing the failure you're experiencing. The idea was to allow the user to supply unicode encoded strings (bytes) and we'll simply base64 encode bytes rather than messing with string encoding issues.\r\n\r\nI can throw a patch for this together tonight or tomorrow morning if you're not interested in working on this.", "For the master branch we want a check that says `if not isinstance(user/pass, basestring)` then we cast to `str`.", "This will be resolved in a future release. =)" ]
https://api.github.com/repos/psf/requests/issues/3752
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/3752/labels{/name}
https://api.github.com/repos/psf/requests/issues/3752/comments
https://api.github.com/repos/psf/requests/issues/3752/events
https://github.com/psf/requests/issues/3752
194,161,171
MDU6SXNzdWUxOTQxNjExNzE=
3,752
https:// does not work with Python 3.6
{ "avatar_url": "https://avatars.githubusercontent.com/u/157597?v=4", "events_url": "https://api.github.com/users/juokaz/events{/privacy}", "followers_url": "https://api.github.com/users/juokaz/followers", "following_url": "https://api.github.com/users/juokaz/following{/other_user}", "gists_url": "https://api.github.com/users/juokaz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/juokaz", "id": 157597, "login": "juokaz", "node_id": "MDQ6VXNlcjE1NzU5Nw==", "organizations_url": "https://api.github.com/users/juokaz/orgs", "received_events_url": "https://api.github.com/users/juokaz/received_events", "repos_url": "https://api.github.com/users/juokaz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/juokaz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/juokaz/subscriptions", "type": "User", "url": "https://api.github.com/users/juokaz", "user_view_type": "public" }
[]
closed
true
null
[]
null
16
2016-12-07T20:32:44Z
2021-09-08T01:21:11Z
2016-12-07T21:14:42Z
NONE
resolved
When requesting a https:// url, `request` method falls into an infinite recursion. The issue is this method in `python/ssl.py`. ``` @options.setter def options(self, value): super(SSLContext, SSLContext).options.__set__(self, value) ``` The commit which introduced this line to python is this https://hg.python.org/cpython/rev/c32e9f9b00f7. The actual error looks like this: ``` File "/usr/local/lib/python3.6/site-packages/requests/sessions.py", line 501, in get return self.request('GET', url, **kwargs) File "/usr/local/lib/python3.6/site-packages/requests/sessions.py", line 488, in request resp = self.send(prep, **send_kwargs) File "/usr/local/lib/python3.6/site-packages/requests/sessions.py", line 609, in send r = adapter.send(request, **kwargs) File "/usr/local/lib/python3.6/site-packages/requests/adapters.py", line 423, in send timeout=timeout File "/usr/local/lib/python3.6/site-packages/requests/packages/urllib3/connectionpool.py", line 594, in urlopen chunked=chunked) File "/usr/local/lib/python3.6/site-packages/requests/packages/urllib3/connectionpool.py", line 350, in _make_request self._validate_conn(conn) File "/usr/local/lib/python3.6/site-packages/requests/packages/urllib3/connectionpool.py", line 835, in _validate_conn conn.connect() File "/usr/local/lib/python3.6/site-packages/requests/packages/urllib3/connection.py", line 311, in connect cert_reqs=resolve_cert_reqs(self.cert_reqs), File "/usr/local/lib/python3.6/site-packages/requests/packages/urllib3/util/ssl_.py", line 264, in create_urllib3_context context.options |= options File "/usr/local/lib/python3.6/ssl.py", line 459, in options super(SSLContext, SSLContext).options.__set__(self, value) File "/usr/local/lib/python3.6/ssl.py", line 459, in options super(SSLContext, SSLContext).options.__set__(self, value) File "/usr/local/lib/python3.6/ssl.py", line 459, in options super(SSLContext, SSLContext).options.__set__(self, value) [Previous line repeated 316 more times] RecursionError: maximum recursion depth exceeded while calling a Python object ``` Tested using `python 3.6.0b4`.
{ "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/3752/reactions" }
https://api.github.com/repos/psf/requests/issues/3752/timeline
null
completed
null
null
false
[ "This sounds like this is a bug in the standard library, actually: it seems like they introduced an infinite recursion when setting options directly. @tiran?", "I can't reproduce the issue on my machine (Python from latest hg 3.6 branch)\r\n\r\n```\r\n$ ./python \r\nPython 3.6.0+ (3.6:c4f39b6f3176, Dec 7 2016, 21:55:50) \r\n[GCC 6.2.1 20160916 (Red Hat 6.2.1-2)] on linux\r\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\r\n>>> import ssl\r\n>>> ctx = ssl.SSLContext(ssl.PROTOCOL_TLS)\r\n>>> ctx.options |= 5\r\n>>> class MySSLContext(ssl.SSLContext):\r\n... pass\r\n... \r\n>>> ctx = MySSLContext(ssl.PROTOCOL_TLS)\r\n>>> ctx.options |= 5\r\n```", "I just had a try to reproduce it from the requests end; I can’t hit it on 3.6.0b4 or 3.6.0rc1:\r\n\r\n```console\r\n$ python\r\nPython 3.6.0b4 (v3.6.0b4:18496abdb3d5, Nov 21 2016, 20:44:47)\r\n[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin\r\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\r\n>>> import requests\r\n>>> requests.get('https://github.com/kennethreitz/requests/issues/3752')\r\n<Response [200]>\r\n```\r\n\r\n```console\r\n$ python\r\nPython 3.6.0rc1 (v3.6.0rc1:29a273eee9a5, Dec 6 2016, 16:24:13)\r\n[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin\r\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\r\n>>> import requests\r\n>>> requests.get('https://github.com/kennethreitz/requests/issues/3752')\r\n<Response [200]>\r\n```\r\n\r\nCould it be something that’s platform or URL-specific?\r\n\r\n(OS X 10.12.1, 16B2659, for my part)", "Requests works with Python 3.6.0 from hg, too:\r\n\r\n```\r\n$ ./python -m venv venv\r\n$ venv/bin/pip install requests\r\nCollecting requests\r\n Using cached requests-2.12.3-py2.py3-none-any.whl\r\nInstalling collected packages: requests\r\nSuccessfully installed requests-2.12.3\r\n$ venv/bin/python\r\nPython 3.6.0+ (3.6:c4f39b6f3176, Dec 7 2016, 21:55:50) \r\n[GCC 6.2.1 20160916 (Red Hat 6.2.1-2)] on linux\r\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\r\n>>> import requests\r\n>>> requests.get('https://www.python.org')\r\n<Response [200]>\r\n```", "Ok, so right now this looks like a \"can't repro\" situation. Might be worth looking at your install @juokaz, seems to be misbehaving a bit.", "After further debugging, I was able to reproduce it as a `gevent` issue (which was the context I was using this in).\r\n\r\nI'm guessing I'm going to have to take it to gevent folks to have a look? Thanks for looking into this, everyone. \r\n\r\n```\r\nroot@8042e3f57981:/app# python\r\nPython 3.6.0b4 (default, Nov 23 2016, 21:34:29)\r\n[GCC 4.9.2] on linux\r\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\r\n>>> import gevent.monkey\r\n>>> gevent.monkey.patch_all()\r\n>>>\r\n>>> from requests.packages.urllib3.util.ssl_ import create_urllib3_context\r\n>>> create_urllib3_context()\r\nTraceback (most recent call last):\r\n File \"<stdin>\", line 1, in <module>\r\n File \"/usr/local/lib/python3.6/site-packages/requests/packages/urllib3/util/ssl_.py\", line 268, in create_urllib3_context\r\n context.options |= options\r\n File \"/usr/local/lib/python3.6/ssl.py\", line 459, in options\r\n super(SSLContext, SSLContext).options.__set__(self, value)\r\n File \"/usr/local/lib/python3.6/ssl.py\", line 459, in options\r\n super(SSLContext, SSLContext).options.__set__(self, value)\r\n File \"/usr/local/lib/python3.6/ssl.py\", line 459, in options\r\n super(SSLContext, SSLContext).options.__set__(self, value)\r\n [Previous line repeated 329 more times]\r\nRecursionError: maximum recursion depth exceeded while calling a Python object\r\n>>>\r\n```", "Yup, this is a gevent issue. I'd assume gevent doesn't yet work with Python 3.6.", "The super() call looks weird but it's correct. It's the generic way to fetch the attribute descriptor of the parent class. It's a necessary evil to change a property in a subclass. Ask Google for \"David Beazley subclass property\" and it will show you the same, https://www.safaribooksonline.com/library/view/python-cookbook-3rd/9781449357337/ch08s08.html\r\n\r\n```\r\n>>> from ssl import SSLContext\r\n>>> super(SSLContext, SSLContext).options\r\n<attribute 'options' of '_ssl._SSLContext' objects>\r\n>>> import _ssl\r\n>>> super(SSLContext, SSLContext).options is _ssl._SSLContext.options\r\nTrue\r\n```\r\n\r\nThe call ```super(SSLContext, SSLContext).options.__set__(self, value)``` is the same as setting options on an instance of the parent class.\r\n", "Here's the reference to the gevent ticket for the same issue: https://github.com/gevent/gevent/issues/903\r\nGevent has now been bumped to >1.2 by default. If you're still having this issue, it can be fixed with a simple `pip install --upgrade gevent`.", "@pirate that doesn't fix the issue for me. Any other ideas? The other thread is locked.", "@AeroNotix please don't use this issue or this project's tracker to discuss gevent problems.", "@pirate can you unlock that ticket, then? I'm still having the same issue on python 3.6 with upgraded versions of everything.", "Nope @AeroNotix , I'm not a contributor on either project, perhaps you can email/irc one of the people in the other thread directly?", "@pirata This issue still exists with `python 3.6.1`, `gevent 1.2.1`, `requests 2.13.0`. Steps to reproduce:\r\n\r\n```python\r\nimport requests\r\nimport gevent.monkey\r\ngevent.monkey.patch_ssl()\r\nrequests.get(\"https://google.com\")\r\n```\r\n\r\nIf I import `requests` after the patch, everything works. It used to be the case that it won't matter and I'm wondering if something can be changed to keep the old behavior. What do you think @Lukasa ?", "Requests has some problems with gevent and monkey patching because it performs feature detection on the select module at import time. A future release will bring it up to date with a newer urllib3 that contains fixes for this problem, but in the meantime gevent's monkey patch should be applied before importing requests. \r\n\r\n", "@Lukasa are you referring to [this release](https://github.com/requests/requests/blob/master/HISTORY.rst#2182-2017-07-25)?" ]
https://api.github.com/repos/psf/requests/issues/3751
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/3751/labels{/name}
https://api.github.com/repos/psf/requests/issues/3751/comments
https://api.github.com/repos/psf/requests/issues/3751/events
https://github.com/psf/requests/issues/3751
193,807,907
MDU6SXNzdWUxOTM4MDc5MDc=
3,751
Error Auth Basic (since 2.12.2)
{ "avatar_url": "https://avatars.githubusercontent.com/u/5459596?v=4", "events_url": "https://api.github.com/users/johaven/events{/privacy}", "followers_url": "https://api.github.com/users/johaven/followers", "following_url": "https://api.github.com/users/johaven/following{/other_user}", "gists_url": "https://api.github.com/users/johaven/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/johaven", "id": 5459596, "login": "johaven", "node_id": "MDQ6VXNlcjU0NTk1OTY=", "organizations_url": "https://api.github.com/users/johaven/orgs", "received_events_url": "https://api.github.com/users/johaven/received_events", "repos_url": "https://api.github.com/users/johaven/repos", "site_admin": false, "starred_url": "https://api.github.com/users/johaven/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/johaven/subscriptions", "type": "User", "url": "https://api.github.com/users/johaven", "user_view_type": "public" }
[]
closed
true
null
[]
null
3
2016-12-06T15:50:46Z
2021-09-08T13:05:42Z
2016-12-06T15:59:20Z
NONE
resolved
This error appears since last version (my code works with 2.11, 2.9 etc...) ```python File "C:\Users\vqmg0203\Desktop\app\core\models\database.py", line 211, in update_infos r = self.request_get(self.user_url) File "C:\Users\vqmg0203\Desktop\app\core\handlers\http.py", line 30, in wrapped return f(self, *args, **kwargs) File "C:\Users\vqmg0203\Desktop\app\core\handlers\http.py", line 130, in request_get allow_redirects=False) File "C:\Python27\lib\site-packages\requests\sessions.py", line 501, in get return self.request('GET', url, **kwargs) File "C:\Python27\lib\site-packages\requests\sessions.py", line 474, in request prep = self.prepare_request(req) File "C:\Python27\lib\site-packages\requests\sessions.py", line 407, in prepare_request hooks=merge_hooks(request.hooks, self.hooks), File "C:\Python27\lib\site-packages\requests\models.py", line 306, in prepare self.prepare_auth(auth, url) File "C:\Python27\lib\site-packages\requests\models.py", line 527, in prepare_auth r = auth(self) File "C:\Python27\lib\site-packages\requests\auth.py", line 68, in __call__ r.headers['Authorization'] = _basic_auth_str(self.username, self.password) File "C:\Python27\lib\site-packages\requests\auth.py", line 38, in _basic_auth_str b64encode(b':'.join((username, password))).strip() TypeError: sequence item 1: expected string, NoneType found ```
{ "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/3751/reactions" }
https://api.github.com/repos/psf/requests/issues/3751/timeline
null
completed
null
null
false
[ "You cannot pass `None` as an entry to basic auth. This never worked sensibly: we ended up just putting the literal string `\"None\"` into the basic auth header.", "In the future, please search **closed and** open issues before creating new ones that are duplicates.\r\n\r\nThis is a duplicate of **two** other issues: #3750 and #3736", "Sorry for the duplicate :( \r\nThanks for the explanation" ]
https://api.github.com/repos/psf/requests/issues/3750
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/3750/labels{/name}
https://api.github.com/repos/psf/requests/issues/3750/comments
https://api.github.com/repos/psf/requests/issues/3750/events
https://github.com/psf/requests/issues/3750
193,507,656
MDU6SXNzdWUxOTM1MDc2NTY=
3,750
Basic Auth broken when username / password is None
{ "avatar_url": "https://avatars.githubusercontent.com/u/209263?v=4", "events_url": "https://api.github.com/users/kirichkov/events{/privacy}", "followers_url": "https://api.github.com/users/kirichkov/followers", "following_url": "https://api.github.com/users/kirichkov/following{/other_user}", "gists_url": "https://api.github.com/users/kirichkov/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kirichkov", "id": 209263, "login": "kirichkov", "node_id": "MDQ6VXNlcjIwOTI2Mw==", "organizations_url": "https://api.github.com/users/kirichkov/orgs", "received_events_url": "https://api.github.com/users/kirichkov/received_events", "repos_url": "https://api.github.com/users/kirichkov/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kirichkov/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kirichkov/subscriptions", "type": "User", "url": "https://api.github.com/users/kirichkov", "user_view_type": "public" }
[]
closed
true
null
[]
null
3
2016-12-05T14:15:25Z
2021-09-08T13:05:44Z
2016-12-05T14:24:38Z
NONE
resolved
It appears commit 329a5cfdd4500fb1ce405a3242ef95f9197d24ba has broken `_basic_auth_str` and it now throws an exception `TypeError` (see below) when the supplied username and password is `None`. Befor this commit, in requests 2.1.1, it was possible to supply None values for username and password when authentication is optional - in this particular case Home Assistant writing to InfluxDB with default configuration. Exception thrown: ```python TypeError: sequence item 0: expected a bytes-like object, NoneType found ```
{ "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/3750/reactions" }
https://api.github.com/repos/psf/requests/issues/3750/timeline
null
completed
null
null
false
[ "This is a duplicate of #3736", "In the future, please search closed and open issues before creating new ones that are duplicates.", "Sorry. I looked at the open tickets only!" ]
https://api.github.com/repos/psf/requests/issues/3749
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/3749/labels{/name}
https://api.github.com/repos/psf/requests/issues/3749/comments
https://api.github.com/repos/psf/requests/issues/3749/events
https://github.com/psf/requests/issues/3749
193,342,323
MDU6SXNzdWUxOTMzNDIzMjM=
3,749
cmd
{ "avatar_url": "https://avatars.githubusercontent.com/u/12379211?v=4", "events_url": "https://api.github.com/users/FlyToTomorrow/events{/privacy}", "followers_url": "https://api.github.com/users/FlyToTomorrow/followers", "following_url": "https://api.github.com/users/FlyToTomorrow/following{/other_user}", "gists_url": "https://api.github.com/users/FlyToTomorrow/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/FlyToTomorrow", "id": 12379211, "login": "FlyToTomorrow", "node_id": "MDQ6VXNlcjEyMzc5MjEx", "organizations_url": "https://api.github.com/users/FlyToTomorrow/orgs", "received_events_url": "https://api.github.com/users/FlyToTomorrow/received_events", "repos_url": "https://api.github.com/users/FlyToTomorrow/repos", "site_admin": false, "starred_url": "https://api.github.com/users/FlyToTomorrow/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/FlyToTomorrow/subscriptions", "type": "User", "url": "https://api.github.com/users/FlyToTomorrow", "user_view_type": "public" }
[]
closed
true
null
[]
null
0
2016-12-04T09:55:51Z
2021-09-08T13:05:45Z
2016-12-04T09:56:21Z
NONE
resolved
{ "avatar_url": "https://avatars.githubusercontent.com/u/12379211?v=4", "events_url": "https://api.github.com/users/FlyToTomorrow/events{/privacy}", "followers_url": "https://api.github.com/users/FlyToTomorrow/followers", "following_url": "https://api.github.com/users/FlyToTomorrow/following{/other_user}", "gists_url": "https://api.github.com/users/FlyToTomorrow/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/FlyToTomorrow", "id": 12379211, "login": "FlyToTomorrow", "node_id": "MDQ6VXNlcjEyMzc5MjEx", "organizations_url": "https://api.github.com/users/FlyToTomorrow/orgs", "received_events_url": "https://api.github.com/users/FlyToTomorrow/received_events", "repos_url": "https://api.github.com/users/FlyToTomorrow/repos", "site_admin": false, "starred_url": "https://api.github.com/users/FlyToTomorrow/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/FlyToTomorrow/subscriptions", "type": "User", "url": "https://api.github.com/users/FlyToTomorrow", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/3749/reactions" }
https://api.github.com/repos/psf/requests/issues/3749/timeline
null
completed
null
null
false
[]
https://api.github.com/repos/psf/requests/issues/3748
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/3748/labels{/name}
https://api.github.com/repos/psf/requests/issues/3748/comments
https://api.github.com/repos/psf/requests/issues/3748/events
https://github.com/psf/requests/issues/3748
193,300,851
MDU6SXNzdWUxOTMzMDA4NTE=
3,748
requests get(URL) never returns, even with Proxy!
{ "avatar_url": "https://avatars.githubusercontent.com/u/18625267?v=4", "events_url": "https://api.github.com/users/arunchandramouli/events{/privacy}", "followers_url": "https://api.github.com/users/arunchandramouli/followers", "following_url": "https://api.github.com/users/arunchandramouli/following{/other_user}", "gists_url": "https://api.github.com/users/arunchandramouli/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/arunchandramouli", "id": 18625267, "login": "arunchandramouli", "node_id": "MDQ6VXNlcjE4NjI1MjY3", "organizations_url": "https://api.github.com/users/arunchandramouli/orgs", "received_events_url": "https://api.github.com/users/arunchandramouli/received_events", "repos_url": "https://api.github.com/users/arunchandramouli/repos", "site_admin": false, "starred_url": "https://api.github.com/users/arunchandramouli/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/arunchandramouli/subscriptions", "type": "User", "url": "https://api.github.com/users/arunchandramouli", "user_view_type": "public" }
[]
closed
true
null
[]
null
37
2016-12-03T16:59:31Z
2016-12-05T14:34:26Z
2016-12-03T20:36:49Z
NONE
null
99% of the times I use .get() i get responses in ms... but there are certain URLs that I work on, both http and https, they are available globally too(but can't be shared for some reason). What I found is that some of these .get() never actually returns a value instead .get() command never ends, it keeps running infinitely. What could be the reason?Is there any alternate, such as using Proxy or anything as such? Please suggest.
{ "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/3748/reactions" }
https://api.github.com/repos/psf/requests/issues/3748/timeline
null
completed
null
null
false
[ "@arunchandramouli have you considered setting a `timeout`?\r\n\r\nBeyond that, I'd advise you to not ask questions on a defect (issue) tracker. Instead, ask questions on [StackOverflow](stackoverflow.com).", "Yes I did timeout and it returns as 403/404 but not 200. I did see through SO, but didnt get similar query. I would like to know why a few sites don't return at all, but request.get() keep running infinitely", "@arunchandramouli There are two possibilities. Either 1) the network has hung, in which case a timeout will help because it'll throw an exception; or 2) the response is infinite in size. If the response is infinite in size and you don't use the `stream=True` parameter, Requests will attempt to read the entire response body. That obviously won't work. Eventually, such a use of Requests will cause you to run out of memory.", "@Lukasa - Great ! but when I did telnet proxy followed by get urlname, it actually returns me the content.it works that way. But I tried using requests.get(), urllib.urlopen() and httplib, it all fails, sounds a bit interesting. ", "@arunchandramouli That sounds very much like the proxy is misconfigured. Can you show me the *complete* response you got from the proxy, including the headers? The telnet request you sent would also be good.", "@Lukasa The Proxy / Normal request doesn't request anything at all , it keeps hanging unless I issue a timeout. Where as Telnet GET returns the url content. I couldn't share due to privacy and client protocol issues.", "@arunchandramouli If you can't share the data then I'm afraid we're essentially unable to help you. The best I can tell you is that the response is almost certainly ill-formed, which is why none of the Python HTTP libraries you've tried can parse it.", "I got it, that might the case. But I could see the responses in FF and Chrome.", "That means very little. Servers and proxies can mutate responses based on various properties of the request, and additionally browsers have very *lenient* parsers.\r\n\r\nBut again, we cannot help you if we cannot get more information about the response. Listing everything that *can* parse the response is not helpful, because we cannot turn that into a matrix of things we would need to change. Either we need to be able to reproduce this, or you're going to need to investigate without our assistance.", "will try to share.. But there is no response to share at all, all i gt is a timeout message, if I had given timeout else it keeps hanging.....", "@arunchandramouli Can you provide a stacktrace for your timeout?", "@Lukasa requests.exceptions.ReadTimeOut:HTTPSConnectionPool(host='***',port=443).Read Timed out.\r\n\r\napi.py -> sessions.py -> adapters.py (normal flow for HTTP/HTTPS connection)\r\nI couldn't copy the trace from the server", "I need the *complete* traceback. I need to know where we are. If I can't get function names and line numbers then I can't help you.", "let me tell you the flow;\r\napi.py(line 68) --> api.py(line 50) -->sessions.py(line 464) --> sessions.py(line 576) --> adpaters.py(line 433)\r\n\r\nthere in function send, I get raise readTimeout\r\n\r\n", "What version of Requests are you using?", "2.6.0", "Unfortunately, that traceback on that version is just not informative enough. Have you tried upgrading your Requests version?\r\n\r\n(The main problem here is that the traceback just points to where we threw our wrapper exception, and so without more detail (e.g. the complete text of the exception message) I can't work out where the inner exception came from.)", "I cant upgrade.. client permission restrictions.. but we use Anaconda to run d code too.. I tried via Interpreter and Anaconda, still fails at same point....\r\n\r\nrefer\r\nhttps://github.com/kennethreitz/requests/blob/master/requests/adapters.py\r\nline 498 , class HTTPAdapted, function send\r\n\r\n\r\nelif isinstance(e, ReadTimeoutError):\r\nraise ReadTimeout(e, request=request)", "Yeah, so as discussed, without being able to see the full text of the exception I can't be more helpful. It is a wrapper exception, so it contains an exception within it that may be a bit clearer.", "Something very similar to this, I get exception as same, but Readtimeout\r\n\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 70, in get\r\n return request('get', url, params=params, **kwargs)\r\n File \"C:\\Python27\\lib\\site-packages\\requests\\api.py\", line 56, in request\r\n return session.request(method=method, url=url, **kwargs)\r\n File \"C:\\Python27\\lib\\site-packages\\requests\\sessions.py\", line 488, in request\r\n resp = self.send(prep, **send_kwargs)\r\n File \"C:\\Python27\\lib\\site-packages\\requests\\sessions.py\", line 609, in send\r\n r = adapter.send(request, **kwargs)\r\n File \"C:\\Python27\\lib\\site-packages\\requests\\adapters.py\", line 487, in send\r\n raise ConnectionError(e, request=request)\r\nrequests.exceptions.ConnectionError: HTTPConnectionPool(host='www.somebadurl.com', port=80): Max retries exceeded with url: / (Caused by NewConnectionError('<requests.packages.urll\r\nonnection object at 0x0000000003E2E1D0>: Failed to establish a new connection: [Errno 11004] getaddrinfo failed',))\r\n>>>", "@arunchandramouli I care mostly about the bit at the end, where we have all this:\r\n\r\n`requests.exceptions.ConnectionError: HTTPConnectionPool(host='www.somebadurl.com', port=80): Max retries exceeded with url: / (Caused by NewConnectionError('<requests.packages.urll\r\nonnection object at 0x0000000003E2E1D0>: Failed to establish a new connection: [Errno 11004] getaddrinfo failed',))`\r\n\r\nI need to know what you see in that section.", "In the sample case that i tried, I had shared you the full ST. But in realtime client server;\r\n\r\nI get requests.exceptions.ReadTimeout:HTTPSConnectionPool(host=\"*\",port=443):Read timed out. (read time out = 10)\r\n\r\nSo, we can conclude that in real time, I dont get connection error but timeout(if I had specified it as a Param) else it continues to poll the request.get() infinitely", "Yup, so the question is going to be: where is that read timeout coming from? It can come in two places. One real possibility is that the response is simply not arriving on time. This can happen, particularly with proxies involved. In that case, the simplest thing to do is to just try again.", "Proxies didnt help either.. I tried a simple requests.get(URL,timeout=10) .. now i am trying with timeout as 500 secs.. but requests module in real time is so good that it returns in ms..", "timeout of 500 also failed", "tried using urllib and urllib2... they hang at this call;\r\nreq = urllib2.Request('*') - creates an urllib2.Request instance\r\nbut fails on calls made to addinfourl here;\r\nresponse = urllib2.urlopen(req)\r\n\r\nRefer ; https://github.com/python-git/python/blob/master/Lib/urllib.py ; line 965;\r\n\r\n\r\nclass addinfourl(addbase):\r\n \"\"\"class to add info() and geturl() methods to an open file.\"\"\"\r\n\r\n def __init__(self, fp, headers, url, code=None):\r\n addbase.__init__(self, fp)\r\n self.headers = headers\r\n self.url = url\r\n self.code = code\r\n\r\n def info(self):\r\n return self.headers\r\n\r\n def getcode(self):\r\n return self.code\r\n\r\n def geturl(self):\r\nreturn self.url", "Unfortunately, none of this detail really helps to narrow anything down. We need to see what's coming down the wire.", "What more info you want? Can you please specify?", "I need to see where the read timeout is occurring: whether it's occurring in the read of the body or of the headers. Can you set `stream=True` and tell me if you get the timeout in the call to `requests.get` or when you access the body content?", "when I set stream=True, timeout=20. It still gives me ReadTimeOut \r\n\r\n.get() fails yet" ]
https://api.github.com/repos/psf/requests/issues/3747
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/3747/labels{/name}
https://api.github.com/repos/psf/requests/issues/3747/comments
https://api.github.com/repos/psf/requests/issues/3747/events
https://github.com/psf/requests/issues/3747
193,232,667
MDU6SXNzdWUxOTMyMzI2Njc=
3,747
Max_redirect = 0; Location header missing
{ "avatar_url": "https://avatars.githubusercontent.com/u/13772695?v=4", "events_url": "https://api.github.com/users/arao-nnl/events{/privacy}", "followers_url": "https://api.github.com/users/arao-nnl/followers", "following_url": "https://api.github.com/users/arao-nnl/following{/other_user}", "gists_url": "https://api.github.com/users/arao-nnl/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/arao-nnl", "id": 13772695, "login": "arao-nnl", "node_id": "MDQ6VXNlcjEzNzcyNjk1", "organizations_url": "https://api.github.com/users/arao-nnl/orgs", "received_events_url": "https://api.github.com/users/arao-nnl/received_events", "repos_url": "https://api.github.com/users/arao-nnl/repos", "site_admin": false, "starred_url": "https://api.github.com/users/arao-nnl/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/arao-nnl/subscriptions", "type": "User", "url": "https://api.github.com/users/arao-nnl", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2016-12-02T22:24:29Z
2021-09-08T13:05:46Z
2016-12-02T22:40:06Z
NONE
resolved
Hi, Requests ver: 2.11.1 I'm using a session object (s) to make a POST to a specific URL: r=s.send(prepared) I expect this to return 302, which is happening. I set s.max_redirects=0 because I don't want Requests to automatically visit the new URL. So, I promptly receive a TooManyRedirects exception, which is good. However, in the exception handler, I'm unable to get hold of the header 'Location'. The response object itself is empty. I debugged it and saw that the Location header was captured correctly. But, when the exception is thrown, it's all gone. (Pdb) n > /Library/Python/2.7/site-packages/requests/adapters.py(275)build_response() -> return response (Pdb) response <Response [302]> (Pdb) response.__dict__ {'cookies': <RequestsCookieJar[]>, '_content': False, 'headers': {'Date': 'Fri, 02 Dec 2016 22:27:44 GMT', 'Content-Length': '0', 'Location': 'http://XXX:8080/openam?goto=https:YYY', 'Server': 'Apache-Coyote/1.1'}, 'url': u'https://XXX:8443/proxyplus/nnl/reg', 'status_code': 302, '_content_consumed': False, 'encoding': None, 'request': <PreparedRequest [POST]>, 'connection': <requests.adapters.HTTPAdapter object at 0x1053ae1d0>, 'elapsed': datetime.timedelta(0), 'raw': <requests.packages.urllib3.response.HTTPResponse object at 0x1055e3550>, 'reason': 'Found', 'history': []} As you can see, 'Location' is found at this stage in 'response', but when the exception is thrown, response becomes empty. Thanks!
{ "avatar_url": "https://avatars.githubusercontent.com/u/13772695?v=4", "events_url": "https://api.github.com/users/arao-nnl/events{/privacy}", "followers_url": "https://api.github.com/users/arao-nnl/followers", "following_url": "https://api.github.com/users/arao-nnl/following{/other_user}", "gists_url": "https://api.github.com/users/arao-nnl/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/arao-nnl", "id": 13772695, "login": "arao-nnl", "node_id": "MDQ6VXNlcjEzNzcyNjk1", "organizations_url": "https://api.github.com/users/arao-nnl/orgs", "received_events_url": "https://api.github.com/users/arao-nnl/received_events", "repos_url": "https://api.github.com/users/arao-nnl/repos", "site_admin": false, "starred_url": "https://api.github.com/users/arao-nnl/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/arao-nnl/subscriptions", "type": "User", "url": "https://api.github.com/users/arao-nnl", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/3747/reactions" }
https://api.github.com/repos/psf/requests/issues/3747/timeline
null
completed
null
null
false
[ "Hey @arao-nnl, in order to get the behaviour you're looking for, you'll need to use a slightly different mechanism. `max_redirects` is intended to raise an exception halting the request in the event of a redirection loop, or excessive redirects.\r\n\r\nFor your issue of trying to simply halt before a redirect is performed, I suggest using the `allow_redirects` parameter. This will retrieve the 302 and then leave the object untouched until you decide how to proceed (such as only reading the Location header).\r\n\r\n```python\r\ns = requests.Session()\r\nr = requests.Request('GET', 'http://httpbin.org/redirect-to?url=get')\r\nresp = s.send(r.prepare(), allow_redirects=False)\r\nloc = resp.headers['Location']\r\n```" ]
https://api.github.com/repos/psf/requests/issues/3746
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/3746/labels{/name}
https://api.github.com/repos/psf/requests/issues/3746/comments
https://api.github.com/repos/psf/requests/issues/3746/events
https://github.com/psf/requests/issues/3746
193,200,053
MDU6SXNzdWUxOTMyMDAwNTM=
3,746
No tests being run in CI against new pull requests
{ "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
3
2016-12-02T19:39:02Z
2021-09-08T13:05:46Z
2016-12-02T19:39:54Z
CONTRIBUTOR
resolved
It looks like there aren’t any tests being run in CI against pull requests, so there’s a bit of extra work for reviewers to get the patch locally and run the tests themselves. And running tests locally is more susceptible to environment-specific test quirks. It looks like there used to be CI on older pull requests from <http://ci.kennethreitz.org>, but that seems to be unresponsive now. 😒 Would you be interested in a patch that adds some config for Travis CI (and/or another CI service of your choice)?
{ "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/3746/reactions" }
https://api.github.com/repos/psf/requests/issues/3746/timeline
null
completed
null
null
false
[ "Sorry Alex, but this happens to all of us:\r\n\r\nClosing as a dupe of #3739.", "And not even an old issue either! Wow, I’m really not with it today.", ":wink: We all have off days, nothing to be worried about there. Just thought it was funny." ]
https://api.github.com/repos/psf/requests/issues/3745
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/3745/labels{/name}
https://api.github.com/repos/psf/requests/issues/3745/comments
https://api.github.com/repos/psf/requests/issues/3745/events
https://github.com/psf/requests/pull/3745
193,198,520
MDExOlB1bGxSZXF1ZXN0OTYzMzg2MjE=
3,745
Rebase #2431 against proposed/3.0.0
{ "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
5
2016-12-02T19:31:54Z
2021-09-07T00:06:38Z
2017-02-10T17:11:37Z
CONTRIBUTOR
resolved
This is really quite unexciting: #2431 had a tentative +1 from @Lukasa, pending a rebase and retargeting against 3.0.0, but it’s been sat unloved for nearly eight months. 😒 This patch does the required rebase and targets the 3.0.0 branch.
{ "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/3745/reactions" }
https://api.github.com/repos/psf/requests/issues/3745/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/3745.diff", "html_url": "https://github.com/psf/requests/pull/3745", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/3745.patch", "url": "https://api.github.com/repos/psf/requests/pulls/3745" }
true
[ "Woah, zombie PR back from the dead! I haven't worked in Python for over a year now, but I'll see if I can address the suggestions this weekend.", "I had a go at addressing the review markups, but I feel like more testing is required.\r\n\r\nI feel like there’s enough subtle behaviour here that we’d be better off with a whole stack of tests (probably using `@pytest.mark.parametrize`) that tests a whole variety of cases here. Which I may or may not get around to writing sometime this week. At a minimum, the cases described in [this comment](https://github.com/kennethreitz/requests/pull/2431#issuecomment-72333964).", "Yeah, I think more testing here would be fab. Not sure how we're going to get it though, especially if @alexwlchan doesn't have time to do it.", "I’ve stuck a note in my todo list to come back and write more tests here. I’ve built up a bit of a backlog of unfinished PRs, but hopefully I’ll find time to get back to this over Christmas.", "Closing this out due to lack of activity. Feel free to re-open once you get a chance! " ]
https://api.github.com/repos/psf/requests/issues/3744
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/3744/labels{/name}
https://api.github.com/repos/psf/requests/issues/3744/comments
https://api.github.com/repos/psf/requests/issues/3744/events
https://github.com/psf/requests/issues/3744
193,035,285
MDU6SXNzdWUxOTMwMzUyODU=
3,744
python requests post mp3 and data error
{ "avatar_url": "https://avatars.githubusercontent.com/u/11746057?v=4", "events_url": "https://api.github.com/users/467754239/events{/privacy}", "followers_url": "https://api.github.com/users/467754239/followers", "following_url": "https://api.github.com/users/467754239/following{/other_user}", "gists_url": "https://api.github.com/users/467754239/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/467754239", "id": 11746057, "login": "467754239", "node_id": "MDQ6VXNlcjExNzQ2MDU3", "organizations_url": "https://api.github.com/users/467754239/orgs", "received_events_url": "https://api.github.com/users/467754239/received_events", "repos_url": "https://api.github.com/users/467754239/repos", "site_admin": false, "starred_url": "https://api.github.com/users/467754239/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/467754239/subscriptions", "type": "User", "url": "https://api.github.com/users/467754239", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2016-12-02T05:05:12Z
2021-09-08T13:05:46Z
2016-12-02T08:28:09Z
NONE
resolved
#### coding ```python url = "" data = {'uuid':'-jx-1', 'alarmType':1, 'timeDuration':10} headers = {'Content-type': 'multipart/form-data'} mp3_fd = open('/home/ec2-user/voice/123.mp3', 'rb') files = {'messageFile': mp3_fd} req = requests.post(url, files=files, json=data, headers=headers) print req.status_code print req.content ``` ### error ``` 500 <html><head><title>Apache Tomcat/6.0.43 - Error report</title><style><!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}A.name {color : black;}HR {color : #525D76;}--></style> </head><body><h1>HTTP Status 500 - Request processing failed; nested exception is org.springframework.web.multipart.MultipartException: Could not parse multipart servlet request; nested exception is org.apache.commons.fileupload.FileUploadException: the request was rejected because no multipart boundary was found</h1><HR size="1" noshade="noshade"><p><b>type</b> Exception report</p><p><b>message</b> <u>Request processing failed; nested exception is org.springframework.web.multipart.MultipartException: Could not parse multipart servlet request; nested exception is org.apache.commons.fileupload.FileUploadException: the request was rejected because no multipart boundary was found</u></p><p><b>description</b> <u>The server encountered an internal error that prevented it from fulfilling this request.</u></p><p><b>exception</b> <pre>org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.springframework.web.multipart.MultipartException: Could not parse multipart servlet request; nested exception is org.apache.commons.fileupload.FileUploadException: the request was rejected because no multipart boundary was found org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:979) org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:869) javax.servlet.http.HttpServlet.service(HttpServlet.java:643) org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:843) javax.servlet.http.HttpServlet.service(HttpServlet.java:723) com.sengled.cloud.voice.common.filter.CheckLoginStatusFilter.doFilter(CheckLoginStatusFilter.java:54) com.sengled.cloud.voice.common.filter.EncodingFilter.doFilter(EncodingFilter.java:56) </pre></p><p><b>root cause</b> <pre>org.springframework.web.multipart.MultipartException: Could not parse multipart servlet request; nested exception is org.apache.commons.fileupload.FileUploadException: the request was rejected because no multipart boundary was found org.springframework.web.multipart.commons.CommonsMultipartResolver.parseRequest(CommonsMultipartResolver.java:165) org.springframework.web.multipart.commons.CommonsMultipartResolver.resolveMultipart(CommonsMultipartResolver.java:142) org.springframework.web.servlet.DispatcherServlet.checkMultipart(DispatcherServlet.java:1089) org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:928) org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:893) org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:967) org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:869) javax.servlet.http.HttpServlet.service(HttpServlet.java:643) org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:843) javax.servlet.http.HttpServlet.service(HttpServlet.java:723) com.sengled.cloud.voice.common.filter.CheckLoginStatusFilter.doFilter(CheckLoginStatusFilter.java:54) com.sengled.cloud.voice.common.filter.EncodingFilter.doFilter(EncodingFilter.java:56) </pre></p><p><b>root cause</b> <pre>org.apache.commons.fileupload.FileUploadException: the request was rejected because no multipart boundary was found org.apache.commons.fileupload.FileUploadBase$FileItemIteratorImpl.&lt;init&gt;(FileUploadBase.java:954) org.apache.commons.fileupload.FileUploadBase.getItemIterator(FileUploadBase.java:331) org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:351) org.apache.commons.fileupload.servlet.ServletFileUpload.parseRequest(ServletFileUpload.java:126) org.springframework.web.multipart.commons.CommonsMultipartResolver.parseRequest(CommonsMultipartResolver.java:158) org.springframework.web.multipart.commons.CommonsMultipartResolver.resolveMultipart(CommonsMultipartResolver.java:142) org.springframework.web.servlet.DispatcherServlet.checkMultipart(DispatcherServlet.java:1089) org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:928) org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:893) org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:967) org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:869) javax.servlet.http.HttpServlet.service(HttpServlet.java:643) org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:843) javax.servlet.http.HttpServlet.service(HttpServlet.java:723) com.sengled.cloud.voice.common.filter.CheckLoginStatusFilter.doFilter(CheckLoginStatusFilter.java:54) com.sengled.cloud.voice.common.filter.EncodingFilter.doFilter(EncodingFilter.java:56) </pre></p><p><b>note</b> <u>The full stack trace of the root cause is available in the Apache Tomcat/6.0.43 logs.</u></p><HR size="1" noshade="noshade"><h3>Apache Tomcat/6.0.43</h3></body></html> ```
{ "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/3744/reactions" }
https://api.github.com/repos/psf/requests/issues/3744/timeline
null
completed
null
null
false
[ "Please don't set the `Content-Type` header. You set it incorrectly, which is what broke your server. If you remove `headers=headers` from your command, you'll find it works." ]
https://api.github.com/repos/psf/requests/issues/3743
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/3743/labels{/name}
https://api.github.com/repos/psf/requests/issues/3743/comments
https://api.github.com/repos/psf/requests/issues/3743/events
https://github.com/psf/requests/issues/3743
192,977,428
MDU6SXNzdWUxOTI5Nzc0Mjg=
3,743
Requests won't follow some redirects
{ "avatar_url": "https://avatars.githubusercontent.com/u/2000204?v=4", "events_url": "https://api.github.com/users/timothyjlaurent/events{/privacy}", "followers_url": "https://api.github.com/users/timothyjlaurent/followers", "following_url": "https://api.github.com/users/timothyjlaurent/following{/other_user}", "gists_url": "https://api.github.com/users/timothyjlaurent/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/timothyjlaurent", "id": 2000204, "login": "timothyjlaurent", "node_id": "MDQ6VXNlcjIwMDAyMDQ=", "organizations_url": "https://api.github.com/users/timothyjlaurent/orgs", "received_events_url": "https://api.github.com/users/timothyjlaurent/received_events", "repos_url": "https://api.github.com/users/timothyjlaurent/repos", "site_admin": false, "starred_url": "https://api.github.com/users/timothyjlaurent/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/timothyjlaurent/subscriptions", "type": "User", "url": "https://api.github.com/users/timothyjlaurent", "user_view_type": "public" }
[]
closed
true
null
[]
null
3
2016-12-01T22:13:37Z
2021-09-08T13:05:47Z
2016-12-02T00:49:55Z
NONE
resolved
for example: ``` requests.get('http://archopht.jamanetwork.com/article.aspx?doi=10.1001/archopht.125.1.128') ``` Won't work ^ however you can do it with urllib, urllib2 ``` urllib2.urlopen('http://archopht.jamanetwork.com/article.aspx?doi=10.1001/archopht.125.1.128') ``` or with urllib3 ``` http = urllib3.PoolManager() http.request('GET', 'http://archopht.jamanetwork.com/article.aspx?doi=10.1001/archopht.125.1.128') ``` Is there any way to accomplish this with requests?
{ "avatar_url": "https://avatars.githubusercontent.com/u/240830?v=4", "events_url": "https://api.github.com/users/sigmavirus24/events{/privacy}", "followers_url": "https://api.github.com/users/sigmavirus24/followers", "following_url": "https://api.github.com/users/sigmavirus24/following{/other_user}", "gists_url": "https://api.github.com/users/sigmavirus24/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/sigmavirus24", "id": 240830, "login": "sigmavirus24", "node_id": "MDQ6VXNlcjI0MDgzMA==", "organizations_url": "https://api.github.com/users/sigmavirus24/orgs", "received_events_url": "https://api.github.com/users/sigmavirus24/received_events", "repos_url": "https://api.github.com/users/sigmavirus24/repos", "site_admin": false, "starred_url": "https://api.github.com/users/sigmavirus24/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/sigmavirus24/subscriptions", "type": "User", "url": "https://api.github.com/users/sigmavirus24", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/3743/reactions" }
https://api.github.com/repos/psf/requests/issues/3743/timeline
null
completed
null
null
false
[ "Hey @timothyjlaurent, the issue you're hitting is with the server rather than Requests. It looks like the base domain jamanetwork.com (where the redirect points you) may not want it crawled. The server has blacklisted any request with a User-Agent containing the word \"python\" or \"curl\".\r\n\r\nGiven their robots.txt doesn't specify a restriction on your request though, I think we can shrug and work around it. Simply supplying a custom 'User-Agent' header, whether it's your own or from a standard browser, will fix this.\r\n```python\r\nurl = 'http://archopht.jamanetwork.com/article.aspx?doi=10.1001/archopht.125.1.128'\r\nheaders = {'User-Agent': 'undercover-agent/1.0'}\r\nrequests.get(url, headers=headers)\r\n```", "Nicely caught @nateprewitt ", "Thanks @nateprewitt \r\n" ]
https://api.github.com/repos/psf/requests/issues/3742
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/3742/labels{/name}
https://api.github.com/repos/psf/requests/issues/3742/comments
https://api.github.com/repos/psf/requests/issues/3742/events
https://github.com/psf/requests/issues/3742
192,808,018
MDU6SXNzdWUxOTI4MDgwMTg=
3,742
Problems with requests version 2.12
{ "avatar_url": "https://avatars.githubusercontent.com/u/1842780?v=4", "events_url": "https://api.github.com/users/megies/events{/privacy}", "followers_url": "https://api.github.com/users/megies/followers", "following_url": "https://api.github.com/users/megies/following{/other_user}", "gists_url": "https://api.github.com/users/megies/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/megies", "id": 1842780, "login": "megies", "node_id": "MDQ6VXNlcjE4NDI3ODA=", "organizations_url": "https://api.github.com/users/megies/orgs", "received_events_url": "https://api.github.com/users/megies/received_events", "repos_url": "https://api.github.com/users/megies/repos", "site_admin": false, "starred_url": "https://api.github.com/users/megies/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/megies/subscriptions", "type": "User", "url": "https://api.github.com/users/megies", "user_view_type": "public" }
[]
closed
true
null
[]
null
20
2016-12-01T10:33:54Z
2021-09-08T13:05:43Z
2016-12-06T09:06:28Z
NONE
resolved
We're currently seeing problems with requests version 2.12.0 and 2.12.1, see obspy/obspy#1599. I don't have much time to investigate right now, unfortunately, but wanted to quickly report this here. This might be an interaction with `future` package, as we are using it for Python 2/3 compatibility. Steps to reproduce with anaconda: ```bash $ conda create -n requests_bug python=2.7 requests=2.12.1 obspy $ source activate requests_bug $ obspy-runtests core ``` ``` Traceback (most recent call last): File "/home/travis/miniconda/envs/test-environment/lib/python2.7/site-packages/obspy/core/tests/test_stream.py", line 1720, in test_read tr = read('https://examples.obspy.org/test.sac', dtype=np.int32)[0] File "<decorator-gen-31>", line 2, in read File "/home/travis/miniconda/envs/test-environment/lib/python2.7/site-packages/obspy/core/util/decorator.py", line 294, in _map_example_filename return func(*args, **kwargs) File "/home/travis/miniconda/envs/test-environment/lib/python2.7/site-packages/obspy/core/stream.py", line 225, in read download_to_file(url=pathname_or_url, filename_or_buffer=fh) File "/home/travis/miniconda/envs/test-environment/lib/python2.7/site-packages/obspy/core/util/base.py", line 602, in download_to_file r = requests.get(url, stream=True) File "/home/travis/miniconda/envs/test-environment/lib/python2.7/site-packages/requests/api.py", line 70, in get return request('get', url, params=params, **kwargs) File "/home/travis/miniconda/envs/test-environment/lib/python2.7/site-packages/requests/api.py", line 56, in request return session.request(method=method, url=url, **kwargs) File "/home/travis/miniconda/envs/test-environment/lib/python2.7/site-packages/requests/sessions.py", line 369, in __exit__ self.close() File "/home/travis/miniconda/envs/test-environment/lib/python2.7/site-packages/requests/sessions.py", line 690, in close v.close() File "/home/travis/miniconda/envs/test-environment/lib/python2.7/site-packages/requests/adapters.py", line 306, in close self.poolmanager.clear() File "/home/travis/miniconda/envs/test-environment/lib/python2.7/site-packages/requests/packages/urllib3/poolmanager.py", line 156, in clear self.pools.clear() File "/home/travis/miniconda/envs/test-environment/lib/python2.7/site-packages/requests/packages/urllib3/_collections.py", line 94, in clear self.dispose_func(value) File "/home/travis/miniconda/envs/test-environment/lib/python2.7/site-packages/requests/packages/urllib3/poolmanager.py", line 117, in <lambda> dispose_func=lambda p: p.close()) File "/home/travis/miniconda/envs/test-environment/lib/python2.7/site-packages/requests/packages/urllib3/connectionpool.py", line 423, in close conn = old_pool.get(block=False) File "/home/travis/miniconda/envs/test-environment/lib/python2.7/Queue.py", line 165, in get raise Empty Empty ```
{ "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/3742/reactions" }
https://api.github.com/repos/psf/requests/issues/3742/timeline
null
completed
null
null
false
[ "Can you check #2935, and in particular the solution linked by the solver of that issue [here](https://github.com/kennethreitz/requests/issues/2935)?", "The debugging like described [here](http://kronuz.io/nasty-bugs-crawling-in-some-python-libraries.html) indeed works, however if I do it, I don't get any exception whatsoever anymore.. which is kind of puzzling for me right now..", "@megies Interesting. However, you should check for that particular pattern of exception handling in your code and dependencies to see if you can find it.", "I just `grep`ped through my complete python installation but didn't see any suspicious-looking patterns, most of these look like they are used as intended (I was only checking the naming of the second item, to see if anything might get overwritten accidently)..\r\n\r\n```\r\n$ cd ~/anaconda2/envs/requests_bug/lib/python2.7\r\n$ ack-grep --python 'except [^()]*,[^()]*:'\r\n```\r\n\r\noutput: [here](https://gist.github.com/megies/6e28df8c061669165c7d8c85f9d3ee42)", "Hrm. Does any of your code do this? ", "No, just checked. We have parantheses on all `except` lines that have a comma in it. Also checked for `future` package, that is sometimes behind confusing problems.", "Ok, so you need to look to see if any third-or-first party code (yours or a dependency) is monkeypatching the queue module for any reason.", "Just guessing right now, but maybe this has to do with it: https://github.com/PythonCharmers/python-future/blob/master/src/future/standard_library/__init__.py#L107\r\n\r\nAnd when diffing for changes in `requests` (`git diff v2.10.0..v2.12.0`), I see the following:\r\n```diff\r\n--- a/requests/packages/urllib3/connectionpool.py\r\n+++ b/requests/packages/urllib3/connectionpool.py\r\n@@ -7,13 +7,6 @@ import warnings\r\n from socket import error as SocketError, timeout as SocketTimeout\r\n import socket\r\n \r\n-try: # Python 3\r\n- from queue import LifoQueue, Empty, Full\r\n-except ImportError:\r\n- from Queue import LifoQueue, Empty, Full\r\n- # Queue is imported for side effects on MS Windows\r\n- import Queue as _unused_module_Queue # noqa: unused\r\n-\r\n \r\n from .exceptions import (\r\n ClosedPoolError,\r\n@@ -32,6 +25,7 @@ from .exceptions import (\r\n )\r\n from .packages.ssl_match_hostname import CertificateError\r\n from .packages import six\r\n+from .packages.six.moves.queue import LifoQueue, Empty, Full\r\n from .connection import (\r\n port_by_scheme,\r\n DummyConnection,\r\n@@ -48,6 +42,10 @@ from .util.timeout import Timeout\r\n from .util.url import get_host, Url\r\n \r\n \r\n+if six.PY2:\r\n+ # Queue is imported for side effects on MS Windows\r\n+ import Queue as _unused_module_Queue # noqa: F401\r\n+\r\n xrange = six.moves.xrange\r\n \r\n log = logging.getLogger(__name__)\r\n```\r\n\r\nSo my best guess right now is that it might be a clash of `six` vs `future`..", "There is always a risk of that.", "I'm now 99% sure that this is an interaction of `six` and `future`.\r\n\r\nWith the following diff in `urllib3` the problem disappears:\r\n```diff\r\n--- connectionpool.py.orig\t2016-12-01 16:04:38.473636714 +0100\r\n+++ connectionpool.py.patched\t2016-12-01 16:04:46.713677773 +0100\r\n@@ -25,7 +25,7 @@\r\n )\r\n from .packages.ssl_match_hostname import CertificateError\r\n from .packages import six\r\n-from .packages.six.moves.queue import LifoQueue, Empty, Full\r\n+from .packages.six.moves import queue\r\n from .connection import (\r\n port_by_scheme,\r\n DummyConnection,\r\n@@ -61,7 +61,7 @@\r\n \"\"\"\r\n \r\n scheme = None\r\n- QueueCls = LifoQueue\r\n+ QueueCls = queue.LifoQueue\r\n \r\n def __init__(self, host, port=None):\r\n if not host:\r\n@@ -235,7 +235,7 @@\r\n except AttributeError: # self.pool is None\r\n raise ClosedPoolError(self, \"Pool is closed.\")\r\n \r\n- except Empty:\r\n+ except queue.Empty:\r\n if self.block:\r\n raise EmptyPoolError(self,\r\n \"Pool reached maximum size and no more \"\r\n@@ -274,7 +274,7 @@\r\n except AttributeError:\r\n # self.pool is None.\r\n pass\r\n- except Full:\r\n+ except queue.Full:\r\n # This should never happen if self.block == True\r\n log.warning(\r\n \"Connection pool is full, discarding connection: %s\",\r\n@@ -424,7 +424,7 @@\r\n if conn:\r\n conn.close()\r\n \r\n- except Empty:\r\n+ except queue.Empty:\r\n pass # Done.\r\n \r\n def is_same_host(self, url):\r\n@@ -612,7 +612,7 @@\r\n # Everything went great!\r\n clean_exit = True\r\n \r\n- except Empty:\r\n+ except queue.Empty:\r\n # Timed out by queue.\r\n raise EmptyPoolError(self, \"No pool connections are available.\")\r\n```\r\n\r\nI'll propose that change to the urllib3 guys upstream.", "Out of interest, why do you consider this to be urllib3's problem instead of future's problem?", "Don't get me wrong, I'm not considering it to be urllib3's problem, I consider it a combined six/future problem. But since I could come up with a simple and non-intrusive solution in urllib, why not go with it?\r\n\r\nFact is that there are some version combinations of future and urllib3 that don't work well with each other, I'm not saying it is anybody's fault, just trying to fix it.", "Sure thing. And we'll probably merge that fix in urllib3.\r\n\r\nBut ultimately, what urllib3 is doing is entirely reasonable. If a library is monkeypatching the standard library in any way, they need to be *extremely* cautious and ensure that their users import that library *before* anything else: otherwise, that monkeypatch can and will break other code.", "For the sake of completeness, commenting out the following line in `future` (which is for Py2.6 compatibility) also makes the problem go away (on Python 2.7, not on Py2.6 obviously):\r\n\r\nhttps://github.com/PythonCharmers/python-future/blob/v0.15.2/src/future/standard_library/__init__.py#L108", "> But ultimately, what urllib3 is doing is entirely reasonable.\r\n\r\nYeah, sure. Like stated, I'm just being pragmatic here. There's a problem, found a fix that won't hurt anybody (or I'd be really surprised again), so it's fine for me.", "@megies Out of interest, do you know what in your project or your dependencies imports future?", "We use `future` all across `obspy` for Py2/3 compatibilty. We even have a test that checks that certain `future` imports are done at the very top of every Python file.\r\nAt some point we decided to go with `future` so we're stuck with for now.", "> At some point we decided to go with future so we're stuck with for now.\r\n\r\nI'm so very sorry. That must be truly painful", "> I'm so very sorry. That must be truly painful\r\n\r\nIt is.\r\n\r\nFYI we can work around this within obspy (obspy/obspy#1612, obspy/obspy#1614), but it might still be good to solve this in requests/urllib3, mostly in case other packages use `future` and requests/urllib3.", "Resolved in shazow/urllib3#1061" ]
https://api.github.com/repos/psf/requests/issues/3741
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/3741/labels{/name}
https://api.github.com/repos/psf/requests/issues/3741/comments
https://api.github.com/repos/psf/requests/issues/3741/events
https://github.com/psf/requests/issues/3741
192,753,445
MDU6SXNzdWUxOTI3NTM0NDU=
3,741
The new 2.12.2 breaks certain docker-py's build's argument
{ "avatar_url": "https://avatars.githubusercontent.com/u/463631?v=4", "events_url": "https://api.github.com/users/huikang/events{/privacy}", "followers_url": "https://api.github.com/users/huikang/followers", "following_url": "https://api.github.com/users/huikang/following{/other_user}", "gists_url": "https://api.github.com/users/huikang/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/huikang", "id": 463631, "login": "huikang", "node_id": "MDQ6VXNlcjQ2MzYzMQ==", "organizations_url": "https://api.github.com/users/huikang/orgs", "received_events_url": "https://api.github.com/users/huikang/received_events", "repos_url": "https://api.github.com/users/huikang/repos", "site_admin": false, "starred_url": "https://api.github.com/users/huikang/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/huikang/subscriptions", "type": "User", "url": "https://api.github.com/users/huikang", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2016-12-01T04:44:36Z
2021-09-08T14:00:24Z
2016-12-01T08:08:37Z
NONE
resolved
see the issue in https://github.com/docker/docker-py/issues/1325, although I am not sure this is a right place to post.
{ "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/3741/reactions" }
https://api.github.com/repos/psf/requests/issues/3741/timeline
null
completed
null
null
false
[ "As per #3734 this is already getting worked on. The relevant issue to follow in Requests is #3735 \r\n\r\nAlso - If you had locked in docker/docker-py you'd see that they had already been talking about this over there in [docker/docker-py/#1321](https://github.com/docker/docker-py/issues/1321)", "Yup, this is a duplicate. Closing in favour of #3735." ]
https://api.github.com/repos/psf/requests/issues/3740
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/3740/labels{/name}
https://api.github.com/repos/psf/requests/issues/3740/comments
https://api.github.com/repos/psf/requests/issues/3740/events
https://github.com/psf/requests/issues/3740
192,747,179
MDU6SXNzdWUxOTI3NDcxNzk=
3,740
File download weirdness
{ "avatar_url": "https://avatars.githubusercontent.com/u/10678620?v=4", "events_url": "https://api.github.com/users/groutr/events{/privacy}", "followers_url": "https://api.github.com/users/groutr/followers", "following_url": "https://api.github.com/users/groutr/following{/other_user}", "gists_url": "https://api.github.com/users/groutr/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/groutr", "id": 10678620, "login": "groutr", "node_id": "MDQ6VXNlcjEwNjc4NjIw", "organizations_url": "https://api.github.com/users/groutr/orgs", "received_events_url": "https://api.github.com/users/groutr/received_events", "repos_url": "https://api.github.com/users/groutr/repos", "site_admin": false, "starred_url": "https://api.github.com/users/groutr/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/groutr/subscriptions", "type": "User", "url": "https://api.github.com/users/groutr", "user_view_type": "public" }
[]
closed
true
null
[]
null
5
2016-12-01T03:40:04Z
2021-09-08T13:05:47Z
2016-12-01T15:05:30Z
NONE
resolved
I noticed this issue building conda recipes. Conda uses requests to download files from the internet. The file that is being fetched is: https://dakota.sandia.gov/sites/default/files/distributions/public/dakota-6.5-public.src.tar.gz (link found here: https://dakota.sandia.gov/download.html) Downloading with curl -O filesize: 78MB md5: 02c46e904d40bba6b308065db34c1ad7 Downloading with urllib2 (from the standard library): filesize: 78MB md5: 02c46e904d40bba6b308065db34c1ad7 Downloading with requests-2.12.1 (supplied with conda) filesize: 248MB md5: 41e4268140d850756812510512d8eee8 tar -tf doesn't indicate any corruption. I'm not sure what is different with this particular URL, but the other files I tried with requests worked. I don't know where the extra 170MB is coming from? code used to download files: ```python def download_file(url, fn): r = requests.get(url, stream=True) with open(fn, 'wb') as f: for chunk in r.iter_content(chunk_size=1024): if chunk: f.write(chunk) def download_urllib2(url, fn): f = urllib2.urlopen(url) with open(fn, 'wb') as fh: for x in iter(lambda: f.read(1024), b''): fh.write(x) ```
{ "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/3740/reactions" }
https://api.github.com/repos/psf/requests/issues/3740/timeline
null
completed
null
null
false
[ "My best guess is that this is related to compression. Can you print the response headers from curl and from Requests please?", "curl\r\n```\r\nHTTP/1.1 200 OK\r\nDate: Thu, 01 Dec 2016 14:44:30 GMT\r\nServer: Apache/2.2.15 (Red Hat)\r\nX-Frame-Options: SAMEORIGIN\r\nX-Content-Type-Options: nosniff\r\nLast-Modified: Tue, 15 Nov 2016 17:15:23 GMT\r\nETag: \"3000ae5-4d831c8-5415a1a05c0c0\"\r\nAccept-Ranges: bytes\r\nContent-Length: 81277384\r\nCache-Control: max-age=1209600\r\nExpires: Thu, 15 Dec 2016 14:44:30 GMT\r\nContent-Disposition: attachment\r\nContent-Type: application/x-gzip\r\nContent-Encoding: x-gzip\r\n```\r\n\r\nRequests:\r\n```\r\n[('Accept-Ranges', 'bytes'),\r\n ('Cache-Control', 'max-age=1209600'),\r\n ('Connection', 'Keep-Alive'),\r\n ('Content-Disposition', 'attachment'),\r\n ('Content-Encoding', 'gzip'),\r\n ('Content-Length', '81277384'),\r\n ('Content-Type', 'application/x-gzip'),\r\n ('Date', 'Thu, 01 Dec 2016 14:35:58 GMT'),\r\n ('ETag', '\"3000ae5-4d831c8-5415a1a05c0c0\"'),\r\n ('Expires', 'Thu, 15 Dec 2016 14:35:58 GMT'),\r\n ('Keep-Alive', 'timeout=30, max=2500'),\r\n ('Last-Modified', 'Tue, 15 Nov 2016 17:15:23 GMT'),\r\n ('Server', 'Apache/2.2.15 (Red Hat)'),\r\n ('X-Content-Type-Options', 'nosniff'),\r\n ('X-Frame-Options', 'SAMEORIGIN')]\r\n```\r\n\r\nFrom urllib2\r\n```\r\n[('accept-ranges', 'bytes'),\r\n ('cache-control', 'max-age=1209600'),\r\n ('connection', 'close'),\r\n ('content-disposition', 'attachment'),\r\n ('content-encoding', 'x-gzip'),\r\n ('content-length', '81277384'),\r\n ('content-type', 'application/x-gzip'),\r\n ('date', 'Thu, 01 Dec 2016 14:36:09 GMT'),\r\n ('etag', '\"3000ae5-4d831c8-5415a1a05c0c0\"'),\r\n ('expires', 'Thu, 15 Dec 2016 14:36:09 GMT'),\r\n ('last-modified', 'Tue, 15 Nov 2016 17:15:23 GMT'),\r\n ('server', 'Apache/2.2.15 (Red Hat)'),\r\n ('x-content-type-options', 'nosniff'),\r\n ('x-frame-options', 'SAMEORIGIN')]\r\n```\r\n", "Yup, we definitely think it's 81mb too. Do you want to diff the file output to see what is different in them?", "Oh, nevermind, I think I know what's going on here.\r\n\r\nBy default, Requests will decompress the file. This is because it's been sent with Content-Encoding: gzip. The remote peer really shouldn't be saying `Content-Encoding: gzip` *and* `Content-Type: application/x-gzip`: that implies that the file is a gzipped gzip file, which is presumably not what is meant.\r\n\r\nThe way to deal with this, if you can't coerce the server to be less stupid, is to use `r.raw.read()` in a loop instead.", "Thank you for the tip." ]
https://api.github.com/repos/psf/requests/issues/3739
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/3739/labels{/name}
https://api.github.com/repos/psf/requests/issues/3739/comments
https://api.github.com/repos/psf/requests/issues/3739/events
https://github.com/psf/requests/issues/3739
192,697,230
MDU6SXNzdWUxOTI2OTcyMzA=
3,739
Is there a specific reason why there is no CI (Travis/Appveyor)?
{ "avatar_url": "https://avatars.githubusercontent.com/u/263007?v=4", "events_url": "https://api.github.com/users/obestwalter/events{/privacy}", "followers_url": "https://api.github.com/users/obestwalter/followers", "following_url": "https://api.github.com/users/obestwalter/following{/other_user}", "gists_url": "https://api.github.com/users/obestwalter/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/obestwalter", "id": 263007, "login": "obestwalter", "node_id": "MDQ6VXNlcjI2MzAwNw==", "organizations_url": "https://api.github.com/users/obestwalter/orgs", "received_events_url": "https://api.github.com/users/obestwalter/received_events", "repos_url": "https://api.github.com/users/obestwalter/repos", "site_admin": false, "starred_url": "https://api.github.com/users/obestwalter/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/obestwalter/subscriptions", "type": "User", "url": "https://api.github.com/users/obestwalter", "user_view_type": "public" }
[]
closed
true
null
[]
null
5
2016-11-30T22:22:49Z
2021-09-08T13:05:48Z
2016-12-01T13:14:18Z
NONE
resolved
I was surprised to see that requests is not making use of Travis/Appveyor CI. Is there a specific reason for that? I would be willing to send a PR implementing it, if the only reason is that no one got around to it yet. I also saw that `tox.ini` is in the .gitignore file - so is tox used locally by some devs but not part of the project? If so: what are the reasons for not having a `tox.ini` as part of the project? I would use tox.ini to integrate the project with the CI systems and also add a convenient way to run the tests on different interpreters.
{ "avatar_url": "https://avatars.githubusercontent.com/u/263007?v=4", "events_url": "https://api.github.com/users/obestwalter/events{/privacy}", "followers_url": "https://api.github.com/users/obestwalter/followers", "following_url": "https://api.github.com/users/obestwalter/following{/other_user}", "gists_url": "https://api.github.com/users/obestwalter/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/obestwalter", "id": 263007, "login": "obestwalter", "node_id": "MDQ6VXNlcjI2MzAwNw==", "organizations_url": "https://api.github.com/users/obestwalter/orgs", "received_events_url": "https://api.github.com/users/obestwalter/received_events", "repos_url": "https://api.github.com/users/obestwalter/repos", "site_admin": false, "starred_url": "https://api.github.com/users/obestwalter/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/obestwalter/subscriptions", "type": "User", "url": "https://api.github.com/users/obestwalter", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/3739/reactions" }
https://api.github.com/repos/psf/requests/issues/3739/timeline
null
completed
null
null
false
[ "Hey @obestwalter, I talked to @Lukasa about this a few weeks ago. To quote a bit of his response:\r\n\r\n>Requests moved away from Travis because it made a lot of live network requests in its test suite and Travis had frequent network outages that caused real problems with the test run. \r\n\r\nWhile a lot of these issues have been resolved, I think the general sentiment is Travis generates a fair amount of noise for the repo owner and has historically had quirks. Until recently, Requests ran CI on a Jenkins server, but that's since been removed.\r\n\r\nAs for tox, I think most of Requests' contributors are running a local tox.ini file for testing changes. If you run that in conjunction with something like [pyenv](https://github.com/yyuu/pyenv), you have an easy local equivalent of a Travis environment which has worked for the most part the last several months.\r\n\r\nNote this may no longer be the state of things, I just wanted save Lukasa from having to reiterate what he's conveyed recently via other channels.\r\n\r\nHere's the last couple of Kenneth's comments on the state of Requests' CI/Travis in 2016 too. [[Feb](https://github.com/kennethreitz/requests/pull/2991#issuecomment-178813436)] [[Apr](https://github.com/kennethreitz/requests/pull/3096#issuecomment-211701179)]", "@obestwalter All of these decisions are fundamentally @kennethreitz's: the other maintainers have no objection to re-adding Travis support and a toxfile.", "Hello @Lukasa and @nateprewitt,\r\n\r\nthanks for the explanation. Why is the tox.ini then not part of the project? Is there a problem to get it working for everyone involved? My naive thinking would be that once you have tox properly configured for the project it works for everyone involved. \r\n\r\nSo, if there are any concrete problems/bugs that prevent your project from adopting tox properly, just let us know here: https://github.com/tox-dev/tox (yes, we finally moved to Github :)).", "We have adopted tox heavily, but Kenneth didn't want a toxfile checked into the repository: that's why it's not part of the project. =) Once again, these particular decisions are made by Kenneth.", "Thank you - I was pointed to the relevant discussions. I should have looked a bit more closely before asking stupid questions. Sorry for the noise." ]
https://api.github.com/repos/psf/requests/issues/3738
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/3738/labels{/name}
https://api.github.com/repos/psf/requests/issues/3738/comments
https://api.github.com/repos/psf/requests/issues/3738/events
https://github.com/psf/requests/pull/3738
192,682,996
MDExOlB1bGxSZXF1ZXN0OTU5NzYyNzU=
3,738
Revert "Restrict URL preparation to HTTP/HTTPS"
{ "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
27
2016-11-30T21:22:10Z
2021-09-08T01:21:27Z
2016-12-01T10:45:25Z
MEMBER
resolved
This reverts commit 34af72c87d79bd8852e8564c050dd7711c6a08d6. This commit was added by @tiran to try to avoid the IDNA-encoding logic that we added in v2.12.0. I believe that the *other* workarounds we merged for that are sufficient, and this change broke docker-py and probably broke others. @tiran, can you confirm that your code continues to function with this change reverted? I'd like to be able to merge this and ship a v2.12.3 if at all possible. Resolves #3735.
{ "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/3738/reactions" }
https://api.github.com/repos/psf/requests/issues/3738/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/3738.diff", "html_url": "https://github.com/psf/requests/pull/3738", "merged_at": "2016-12-01T10:45:25Z", "patch_url": "https://github.com/psf/requests/pull/3738.patch", "url": "https://api.github.com/repos/psf/requests/pulls/3738" }
true
[ "@Lukasa, I think it would be beneficial readding the test after this reversion. It still provides a useful check going forward and will pass regardless of the tightened scheme check.", "Heh, I just noticed that that test never actually tested the relevant function. WHAT IDIOT REVIEWED THIS CODE THE LAST TIME? :wink:\r\n\r\nI'll write some new tests that actually codify our behaviour here so that we avoid regressing.", "I lost 6 hours of my day troubleshooting this bug 😨 πŸ”« ", "@Lukasa sorry for being a hound but do you have an eta on this 2.12.3 release? We just lost a day of dev / test trying to figure out what broke docker-py until we found this. Thx \r\n\r\n- MS", "@mshahpalerra just pin your requests dep to an older 2.11.x version and you'll be ok. @Lukasa please release a new version of requests ASAP or this will be another left-pad.", "@marcosnils - already being done but that has some other complications as we are changing this pinning on code that is pre prod so has to be retested (not your problem i know :) ) - thanks for the tip", "@marcosnils Well that's a ludicrously hyperbolic thing to say.\r\n\r\nThe left-pad incident broke all users of the package. This breaks docker-py, and docker-py only. The vast majority of our users have not noticed a problem with v2.12.2. There are several bug reports both here and on docker-py, there is a good temporary workaround, so if it's all the same to you I'm going to take long enough over this to get it *right*.\r\n\r\nIt is much more important to me that we don't keep rushing out v2.12.x releases that require further panicked fixes than it is that we make it possible for you to avoid placing pins in your dependency tree. In this case, the patch that we're reverting was added for a reason, and I'd like to ensure that that reason is still covered rather than re-break someone else.", "@mshahpalerra As to the ETA of v2.12.3, it will be as soon as I can get confirmation from @tiran that the problem he was originally trying to fix is still fixed in this branch. If it isn't, then it will be as soon as I can work with him to build a new patch that avoids this specific issue.", "ACK\r\n\r\nCustodia's test suite for my http+unix adapter is passing with @Lukasa 's branch.", "Ok, let's ship a 2.12.3 then. Thanks @tiran!", "> Custodia's test suite for my http+unix adapter is passing with @Lukasa 's branch.\r\n\r\nI it really amazing that `http+unix` t will work with python-requests-3.0. Unfortunately, python-requests-3.0 has not been released yet. But 2.12.3 is released and already in some distributions: fedora-26 and debian unstable and might get to debian testing in few days.\r\n\r\n2.12.0 introduced IDNA-encoding logic which broke `http+unix://` 2.12.3 with this patch reverted the fix due to #3735 but did not provide any alternative solution. And therefore `http+unix://` is broken again.\r\n\r\nIs there a reason why cannot be fixed in 2.12.* as well?", "@Islebodn could you provide an example http+unix:// URI/filepath that you're having issues with in 2.12.3? This should be fixed even without #3713 but perhaps we missed something.", "Correct, this should be fixed in 2.12.4.", ">> @Islebodn could you provide an example http+unix:// URI/filepath that you're having issues with in 2.12.3? This should be fixed even without #3713 but perhaps we missed something.\r\n>Correct, this should be fixed in 2.12.4.\r\nThank you very much for fast response. i really appreciate it.\r\n\r\nI did some tests with more version of pyhton-requests and I found out that 2.12.3 and 2.14.1 does not work well with upper case letters in path. The url is\r\n```\r\n>>> from requests.compat import quote\r\n>>> sock_path ='/tmp/UPPER/testing.socket'\r\n>>> url = 'http+unix://' + quote(sock_path, safe='')\r\n>>> print url\r\nhttp+unix://%2Ftmp%2FUPPER%2Ftesting.socket\r\n\r\n>>> import requests\r\n>>> r = requests.Request('GET', url=url)\r\n>>> p = r.prepare()\r\n>>> p.url\r\n'http+unix://%2ftmp%2fupper%2ftesting.socket/'\r\n```\r\n\r\nI've just tested and upper case letters works well in such situation with 2.10.0 and 2.11.1", "Hmm, so you're right. This is an issue in that this path will pass through IDNA without throwing an exception, but IDNA is forcing it to lowercase. This is valid behaviour for a hostname which should be case insensitive but doesn't work for paths (which really shouldn't be IDNA encoded in the first place). This is a bug, but the way unix sockets have worked in the past is kind of incorrect too. It supplies a path in place of the hostname we're expecting.\r\n\r\nI don't have an immediate solution for this other than suggesting you store the socket file in a lower-cased path. We'll have to wait for @Lukasa's opinion on this and I'll take a deeper dive if it's deemed needed.", ">Hmm, so you're right. This is an issue in that this path will pass through IDNA without throwing an exception, but IDNA is forcing it to lowercase.\r\n> This is valid behaviour for a hostname which should be case insensitive\r\n\r\nAgree; that's the reason why reverted patch tried to use IDNA only with `http://` and `https://`\r\n\r\n> but doesn't work for paths (which really shouldn't be IDNA encoded in the first place). This is a bug, but the way unix sockets have worked in the past is kind of incorrect too. It supplies a path in place of the hostname we're expecting.\r\n\r\nI am not sure whether it's incorrect. it is an URI with different protocol then `http`. The similar use case is with different protocols: `ldap`, `ldaps` which expect hostname/IP and `ldapi` which expect url encoded path to unix socket e.g. http://www.openldap.org/lists/openldap-devel/200201/msg00231.html\r\nhttp://www.openldap.org/doc/admin24/runningslapd.html", "So, I did some more investigating and this actually is completely unrelated to IDNA.\r\n\r\nshazow/urllib3#911 introduced a forced lowercasing of all host names in urllib3 which was released in urllib3 1.17. The version of urllib3 used in Requests prior to 2.12.0 was 1.16 which is why we hadn't hit this before. urllib3's behaviour here is completely correct because host names should be able to be lowercased without affecting the URIs usability.\r\n\r\nAs I said above, passing a path has worked in the past but is technically not in line with how we're parsing the URI. Again, I think we'll have to wait for @Lukasa to weigh in here. ", "> urllib3's behaviour here is completely correct because host names should be able to be lowercased without affecting the URIs usability.\r\n\r\nRight.\r\n\r\n> As I said above, passing a path has worked in the past but is technically not in line with how we're parsing the URI. Again, I think we'll have to wait for @Lukasa to weigh in here.\r\n\r\nSince there is no specification around UNIX socket URIs, I would think we'd treat that as a path, not a hostname. *shrug*", ">Since there is no specification around UNIX socket URIs, I would think we'd treat that as a path, not a hostname. *shrug*\r\n\r\nAgreed, that seems like the sensible thing to do if Requests is going to properly support unix sockets. We'd need to expand both how urllib3 parses URIs, and our flow in `prepare_url`, rather than relying on our current workarounds. That approach would fix a lot of the IDNA issues at their core too, because our primary conflict has been passing non-hostnames (IPs and paths) into the encoder. Maybe something to consider in 3.0.0.", "Hrm. This is not ideal. However, it's further evidence that Requests is really ill suited to handling these use-cases. It makes an enormous number of assumptions about URL structure that are simply not reasonable. \r\n\r\nI have no interest in expanding urllib3's notion of a URL to encompass this use-case. I would, however, be willing to add an extension to allow its URL case normalisation to apply only to specific schemes.", "So I have an issue ready to throw up on urllib3 to catalog this appropriately, but have another question before we start down the scheme specific normalization route.\r\n\r\nStoring something in the form `/tmp/path/out.socket` as the `host` and not `path` of the URI seems off. The authority component isn't required in the URI, so wouldn't it be more correct to detect a URI without a host and store the value in the `path` variable? I realize that we're adhering to the URL subset of URIs, but can't find anything specific on whether the authority requirement differs. Moving to using `path` would allow us to avoid this dance around values in the `host` param that aren't actually hosts.", "@nateprewitt I don't think we do store `/tmp/path/out.socket` as the `host`. I think we only store it if its urlencoded when we receive it, which seems more reasonable to me. Though admittedly I'm not the URI expert (that'd be @sigmavirus24).", "@Lukasa, you're right, I was conflating behaviours in my explanation. %-encoding the path is a hack around `prepare_url` because Requests refuses URLs without a host at the model level, rather than adapter. The host is mandated for http/https schemes but becomes a grey area with the use of \"http+\".\r\n\r\nIf we want to support \"http+{unix,docker,???}\", which seems poorly defined but in use, we'd probably need to relax the hard stop at no host until we get to the adapter. This would allow someone to pass `/tmp/path/out.socket` and we can treat it correctly as a path, without needing a work around. Then we can avoid modifying correctly functioning code to accommodate the hack. If we don't intend to support \"http+\" in 3.0.0 then this is probably a moot point.", "The % encoding of the path to the Unix socket file or abstract namespace is mandatory. How else would you distinguish between the file path and the HTTP path? Some implementations probe ever path segment until a socket file is found and then magically treat the remaining path segments as HTTP path. That's a dangerous hack. The socket path may include non-ASCII chars or a NULL byte for abstract namespace.\n\nAm 23. Dezember 2016 17:45:25 MEZ, schrieb Nate Prewitt <[email protected]>:\n>@Lukasa, you're right, I was conflating behaviours in my explanation.\n>%-encoding the path is a hack around `prepare_url` because Requests\n>refuses URLs without a host at the model level, rather than adapter.\n>The host is mandated for http/https schemes but becomes a grey area\n>with the use of \"http+\".\n>\n>If we want to support \"http+{unix,docker,???}\", which seems poorly\n>defined but in use, we'd probably need to relax the hard stop at no\n>host until we get to the adapter. This would allow someone to pass\n>`/tmp/path/out.socket` and we can treat it correctly as a path, without\n>needing a work around. Then we can avoid modifying correctly\n>functioning code to accommodate the hack. If we don't intend to support\n>\"http+\" in 3.0.0 then this is probably a moot point.\n>\n>-- \n>You are receiving this because you were mentioned.\n>Reply to this email directly or view it on GitHub:\n>https://github.com/kennethreitz/requests/pull/3738#issuecomment-269016139\n\nSent from my Android phone with K-9 Mail.", "@tiran thanks, for clarifying! I'll defer to those of you that are much more well versed in this space than I am :)\r\n\r\nI'll open the issue in urllib3 with Lukasa's originally suggested fix.", "One has to suffer a lot before one knows all pain points. :)\nSent from my Android phone with K-9 Mail.", "and a little bit broken python-requests 1.12.4 got to the debian testing\r\nhttps://packages.debian.org/search?suite=stretch&searchon=names&keywords=python-requests\r\nhttps://packages.debian.org/stretch/python-requests\r\nand of course python-urllib3 was upgraded as well\r\nhttps://packages.debian.org/search?suite=stretch&searchon=names&keywords=python-urllib3\r\nhttps://packages.debian.org/stretch/python-urllib3" ]
https://api.github.com/repos/psf/requests/issues/3737
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/3737/labels{/name}
https://api.github.com/repos/psf/requests/issues/3737/comments
https://api.github.com/repos/psf/requests/issues/3737/events
https://github.com/psf/requests/issues/3737
192,639,786
MDU6SXNzdWUxOTI2Mzk3ODY=
3,737
Requests 2.12.2 and PyInstaller not compatible?
{ "avatar_url": "https://avatars.githubusercontent.com/u/19777948?v=4", "events_url": "https://api.github.com/users/b0g3r/events{/privacy}", "followers_url": "https://api.github.com/users/b0g3r/followers", "following_url": "https://api.github.com/users/b0g3r/following{/other_user}", "gists_url": "https://api.github.com/users/b0g3r/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/b0g3r", "id": 19777948, "login": "b0g3r", "node_id": "MDQ6VXNlcjE5Nzc3OTQ4", "organizations_url": "https://api.github.com/users/b0g3r/orgs", "received_events_url": "https://api.github.com/users/b0g3r/received_events", "repos_url": "https://api.github.com/users/b0g3r/repos", "site_admin": false, "starred_url": "https://api.github.com/users/b0g3r/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/b0g3r/subscriptions", "type": "User", "url": "https://api.github.com/users/b0g3r", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2016-11-30T18:15:37Z
2021-09-08T14:00:25Z
2016-11-30T18:16:51Z
NONE
resolved
Windows 10 64b python 3.5 32b PyInstaller 3.3dev requests 1.12.2 problem: ``` test.py -------------- import requests print(requests.get('http://google.com').status_code) > python -m PyInstaller test.py ... > dist\test\test.exe Traceback (most recent call last): File "C:\Python35-32\lib\site-packages\requests\packages\__init__.py", line 27, in <module> from . import urllib3 File "C:\Python35-32\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 389, in load_module exec(bytecode, module.__dict__) File "C:\Python35-32\lib\site-packages\requests\packages\urllib3\__init__.py", line 8, in <module> from .connectionpool import ( File "C:\Python35-32\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 389, in load_module exec(bytecode, module.__dict__) File "C:\Python35-32\lib\site-packages\requests\packages\urllib3\connectionpool.py", line 28, in <module> from .packages.six.moves.queue import LifoQueue, Empty, Full File "C:\Python35-32\lib\site-packages\requests\packages\urllib3\packages\six.py", line 203, in load_module mod = mod._resolve() File "C:\Python35-32\lib\site-packages\requests\packages\urllib3\packages\six.py", line 115, in _resolve return _import_module(self.mod) File "C:\Python35-32\lib\site-packages\requests\packages\urllib3\packages\six.py", line 82, in _import_module __import__(name) ImportError: No module named 'queue' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "C:\TEMP\test.py", line 1, in <module> import requests File "C:\Python35-32\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 389, in load_module exec(bytecode, module.__dict__) File "C:\Python35-32\lib\site-packages\requests\__init__.py", line 63, in <module> from . import utils File "C:\Python35-32\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 389, in load_module exec(bytecode, module.__dict__) File "C:\Python35-32\lib\site-packages\requests\utils.py", line 24, in <module> from ._internal_utils import to_native_string File "C:\Python35-32\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 389, in load_module exec(bytecode, module.__dict__) File "C:\Python35-32\lib\site-packages\requests\_internal_utils.py", line 11, in <module> from .compat import is_py2, builtin_str File "C:\Python35-32\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 389, in load_module exec(bytecode, module.__dict__) File "C:\Python35-32\lib\site-packages\requests\compat.py", line 11, in <module> from .packages import chardet File "C:\Python35-32\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 389, in load_module exec(bytecode, module.__dict__) File "C:\Python35-32\lib\site-packages\requests\packages\__init__.py", line 29, in <module> import urllib3 File "C:\Python35-32\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 389, in load_module exec(bytecode, module.__dict__) File "C:\Python35-32\lib\site-packages\urllib3\__init__.py", line 8, in <module> from .connectionpool import ( File "C:\Python35-32\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 389, in load_module exec(bytecode, module.__dict__) File "C:\Python35-32\lib\site-packages\urllib3\connectionpool.py", line 28, in <module> from .packages.six.moves.queue import LifoQueue, Empty, Full File "C:\Python35-32\lib\site-packages\urllib3\packages\six.py", line 203, in load_module mod = mod._resolve() File "C:\Python35-32\lib\site-packages\urllib3\packages\six.py", line 115, in _resolve return _import_module(self.mod) File "C:\Python35-32\lib\site-packages\urllib3\packages\six.py", line 82, in _import_module __import__(name) ImportError: No module named 'queue' Failed to execute script test ``` The problem disappeared after the installation request 1.11.0 and rebuild
{ "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/3737/reactions" }
https://api.github.com/repos/psf/requests/issues/3737/timeline
null
completed
null
null
false
[ "This is a problem with pyinstaller. The `queue` module is part of the standard library, there is no reason for it not to be present." ]
https://api.github.com/repos/psf/requests/issues/3736
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/3736/labels{/name}
https://api.github.com/repos/psf/requests/issues/3736/comments
https://api.github.com/repos/psf/requests/issues/3736/events
https://github.com/psf/requests/issues/3736
192,635,737
MDU6SXNzdWUxOTI2MzU3Mzc=
3,736
empty username and password no longer generate basicauth authstring
{ "avatar_url": "https://avatars.githubusercontent.com/u/1172004?v=4", "events_url": "https://api.github.com/users/hummus/events{/privacy}", "followers_url": "https://api.github.com/users/hummus/followers", "following_url": "https://api.github.com/users/hummus/following{/other_user}", "gists_url": "https://api.github.com/users/hummus/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/hummus", "id": 1172004, "login": "hummus", "node_id": "MDQ6VXNlcjExNzIwMDQ=", "organizations_url": "https://api.github.com/users/hummus/orgs", "received_events_url": "https://api.github.com/users/hummus/received_events", "repos_url": "https://api.github.com/users/hummus/repos", "site_admin": false, "starred_url": "https://api.github.com/users/hummus/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/hummus/subscriptions", "type": "User", "url": "https://api.github.com/users/hummus", "user_view_type": "public" }
[]
closed
true
null
[]
null
4
2016-11-30T17:57:22Z
2021-09-08T14:00:24Z
2016-11-30T18:04:46Z
NONE
resolved
Possibly just a previously quirkly behavior that intentionally no longer works. For `requests<2.12.2` having `None` for username and password still resulted in a BasicAuth authstr being created. Starting in `2.12.2` it will raise an exception. ```Traceback (most recent call last): ... File "/blah/lib/python2.7/site-packages/requests/auth.py", line 38, in _basic_auth_str b64encode(b':'.join((username, password))).strip() TypeError: sequence item 0: expected string, NoneType found ``` here's the change, (which certainly seems desirable), but caused our upstream (`python-gitlab`) to break. https://github.com/kennethreitz/requests/commit/329a5cfdd4500fb1ce405a3242ef95f9197d24ba
{ "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/3736/reactions" }
https://api.github.com/repos/psf/requests/issues/3736/timeline
null
completed
null
null
false
[ "Uh...what basic auth string did it generate?", "```\r\n(Pdb) username is None\r\nTrue\r\n(Pdb) password is None\r\nTrue\r\n(Pdb) authstr\r\n'Basic Tm9uZTpOb25l'\r\n```\r\nyea i'm fully aware that this doesn't make much sense and closing wontfix seems entirely reasonable. Just figured I'd call it out in case anyone else was similarly relying on the behavior.", "Heh, yeah, that's the base64 encoded form of `None:None`. I think we can call this wontfix: that should never have worked, and it's quite surprising.", "@hummus should we file a ticket at [python-gitlab](https://github.com/gpocentek/python-gitlab/issues)'s issue tracker? I would do it myself but I don't know enough about the problem" ]
https://api.github.com/repos/psf/requests/issues/3735
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/3735/labels{/name}
https://api.github.com/repos/psf/requests/issues/3735/comments
https://api.github.com/repos/psf/requests/issues/3735/events
https://github.com/psf/requests/issues/3735
192,612,604
MDU6SXNzdWUxOTI2MTI2MDQ=
3,735
Requests v2.12.2 does not add parameters to URLs with schemes it does not understand.
{ "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" }
[ { "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" } ]
closed
true
null
[]
null
4
2016-11-30T16:28:44Z
2021-09-08T13:05:48Z
2016-12-01T10:45:25Z
MEMBER
resolved
Follows from #3734. When we patched to ignore all unrecognised schemes instead of just those that didn't begin `http`, we stopped handling parameters for those URLs. This may break some more benign uses such as `http+unix`, which wanted to add parameters to their URLs. While this is inline with our intended policies (we do not understand URLs that have schemes we don't know anything about), this, along with the IDNA behaviour in v2.12.{0,1} will probably have broken a whole bunch of people using these non-standard URL schemes. We should consider whether Session objects should have a registry of places to look for URL preparation based on scheme. This will allow people to opt-in to the HTTP-like processing of URLs, as well as to register their own.
{ "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/3735/reactions" }
https://api.github.com/repos/psf/requests/issues/3735/timeline
null
completed
null
null
false
[ "I should note that we have had this conversation with the docker-py folks before: see #1879.\r\n\r\nUltimately, there is a problem with how much people want us to understand URLs for non-standard HTTP schemes. People would like us to understand them enough to add query parameters, but not so much that we look for a hostname to internationalize.\r\n\r\nI am as conflicted as I was three years ago.", "Thanks @Lukasa for chiming in and looking into this!\r\n\r\nBeing able to rely on `requests` to make docker-py work has been a great boon for us, especially the ability to handle different transport formats (HTTP/s, UNIX sockets, and more recently Windows named pipes) through the same interface is a powerful feature for us.\r\n\r\nIf you see any way we could keep this flexibility while making things easier on the requests library to support our use-case(s), I'd be happy to hear them and consider any changes.\r\n\r\nThanks again for your help.", "In the short term, I think we need to back out the breakage: kicking things over with @graingert convinced me that ultimately, whether we ever intended docker-py's usage of Requests to actually work, it *has* worked for more than three years. If we're going to break that, we should break it on purpose, rather than by accident.\r\n\r\nSo this issue remains worth discussing because we should solidify our position on this kind of thing for 3.0.0. Either we'll want to add explicit support for having HTTP-like schemes, or we'll want to add support for custom schemes to register URL processing handlers, or we'll want to drop support entirely as we (accidentally) did in v2.12.2. We should discuss what of those we think we want to do, and make sure there is a transition plan in place for projects like docker-py.", "> In the short term, I think we need to back out the breakage\r\n\r\nhttps://github.com/kennethreitz/requests/pull/3738" ]
https://api.github.com/repos/psf/requests/issues/3734
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/3734/labels{/name}
https://api.github.com/repos/psf/requests/issues/3734/comments
https://api.github.com/repos/psf/requests/issues/3734/events
https://github.com/psf/requests/issues/3734
192,590,208
MDU6SXNzdWUxOTI1OTAyMDg=
3,734
docker-py breaks with some configurations of Requests v2.12.2
{ "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
19
2016-11-30T15:10:21Z
2021-09-08T14:00:26Z
2016-11-30T16:29:09Z
MEMBER
resolved
Reported by @graingert. The patch filed by @tiran in #3713 seems to have broken docker-py. They're using a custom URL scheme (`http+docker`), which we previously applied URL preparation to but now do not. This has therefore busted what they were up to in v2.12.2. I'm not immediately sure that we have a good way out of this. Prior to this patch docker-py users were *probably* at risk of encountering issues because the HTTP requests to the Docker API can be routed across unix domain sockets, which may entirely fail to contain hostnames and also fail to IDNA-encode. So I'm not sure that we don't need docker-py to route around this a different way.
{ "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/3734/reactions" }
https://api.github.com/repos/psf/requests/issues/3734/timeline
null
completed
null
null
false
[ "Corresponding docker-py issue is docker/docker-py#1321.", "What is unclear to me is exactly *why* this skip is happening. @graingert, if you can run your example under pdb can you set a breakpoint at `requests.sessions.Session.request` and run `print url` when it breaks?", "@Lukasa can do", "@Lukasa it's 'http+docker://localunixsocket/v1.24/images/create' but that gets handled by the mounted `docker.transport.unixconn.UnixAdapter`", "Heh, nevermind, I think I know what this is.\r\n\r\nThe *only* difference between the two Requests versions is this. In 2.12.1:\r\n\r\n```python\r\nPython 2.7.12 (default, Oct 13 2016, 13:16:42) \r\n[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.35)] on darwin\r\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\r\n>>> import requests\r\n>>> r = requests.Request('GET', 'http+docker://localunixsocket/v1.24/images/create')\r\n>>> p = r.prepare()\r\n>>> p.url\r\n'http+docker://localunixsocket/v1.24/images/create'\r\n```\r\n\r\nIn 2.12.2\r\n\r\n```python\r\nPython 2.7.12 (default, Oct 13 2016, 13:16:42) \r\n[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.35)] on darwin\r\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\r\n>>> import requests\r\n>>> r = requests.Request('GET', 'http+docker://localunixsocket/v1.24/images/create')\r\n>>> p = r.prepare()\r\n>>> p.url\r\nu'http+docker://localunixsocket/v1.24/images/create'\r\n```\r\n\r\nSpecifically, the issue is that when Requests processes the URL it ends up as a bytestring. When it does not, it ends up as whatever type was passed in: in the case of Python 3, unicode. That then trips something up lower down in the stack (probably in the docker-py adapter) which expects only bytes there.", "Yup, the criminal is `http.client`: the [auto-adding of Host headers](https://github.com/python/cpython/blob/3de470284c2e067ae445c572413a0290d58fb139/Lib/http/client.py#L1131) is only done if `url.startswith('http')`, which in Python 3 is not true for bytes URLs. This is a pretty dumb failure mode.", "Just as a little background here, #3713 was raised because unix sockets were hitting idna. The bypass (#3695) had addressed (at least from my tests) the socket path issues already. I didn't think it was worth noting because it seemed #3713 was providing some helpful constraint tightening, beyond fixing the immediate idna issue. As far as I can tell, avoiding that tightened bailout point would likely fix this issue.", "So, Requests can potentially address this with a feature: we could have a registry of schemes that we should just treat like HTTP (that is, we should assume that all our URL-processing logic can handle). That would allow docker-py to register \"http+docker\" as something that makes sense.\r\n\r\nHowever, given that docker-py are *already* lying to us by setting a hostname (hi there `localunixsocket`), why don't docker-py just use the URL `http://localunixsocket` and mount their adapter at that full-string?", "@Lukasa someone might come along and register the gtld localunixsocket", "@graingert That's fine, it won't matter. The adapter is selected based on a longest-prefix match, so the docker-py adapter will still be selected and knows it doesn't have to do a DNS lookup.", "Ok, so here's the thing: now that we're not processing the URL everything is off the table. Query parameters for example, are not handled any longer. This also probably breaks some docker-py stuff.", "@graingert has pointed out that in situations like this we should probably throw an exception if we were supposed to add any query parameters to the request.", "> Yup, the criminal is http.client: the auto-adding of Host headers is only done if url.startswith('http'), which in Python 3 is not true for bytes URLs. This is a pretty dumb failure mode.\r\n\r\nIt's not the missing Host header, the request still works fine without it. (currently it's set to 'Host: localhost' which doesn't mean anything to the docker process)\r\n\r\nThe issue is the params processing of the URL.", "Yeah, so once again, docker-py can get out of this by changing the way they handle their adapters. However, I'm not sure Requests should be processing schemes it doesn't understand, and our previous escape hatch wasn't great.", "@Lukasa should this handling be moved to the adaptor?", "Which handling?", "*URL processing", "No, I don't think so. I think it's right where it is. We can discuss whether there is a sensible feature addition that allows for Requests adapters to register scheme-specific URL processing logic, but that can't be shoved in for a little while and has to clear quite a high bar.", "Closing in favour of #3735." ]
https://api.github.com/repos/psf/requests/issues/3733
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/3733/labels{/name}
https://api.github.com/repos/psf/requests/issues/3733/comments
https://api.github.com/repos/psf/requests/issues/3733/events
https://github.com/psf/requests/pull/3733
192,224,170
MDExOlB1bGxSZXF1ZXN0OTU2NTA2ODA=
3,733
remove weird characters from README.rst
{ "avatar_url": "https://avatars.githubusercontent.com/u/14212780?v=4", "events_url": "https://api.github.com/users/jorgesumle/events{/privacy}", "followers_url": "https://api.github.com/users/jorgesumle/followers", "following_url": "https://api.github.com/users/jorgesumle/following{/other_user}", "gists_url": "https://api.github.com/users/jorgesumle/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/jorgesumle", "id": 14212780, "login": "jorgesumle", "node_id": "MDQ6VXNlcjE0MjEyNzgw", "organizations_url": "https://api.github.com/users/jorgesumle/orgs", "received_events_url": "https://api.github.com/users/jorgesumle/received_events", "repos_url": "https://api.github.com/users/jorgesumle/repos", "site_admin": false, "starred_url": "https://api.github.com/users/jorgesumle/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/jorgesumle/subscriptions", "type": "User", "url": "https://api.github.com/users/jorgesumle", "user_view_type": "public" }
[]
closed
true
null
[]
null
4
2016-11-29T09:02:57Z
2021-09-08T01:21:36Z
2016-11-29T09:06:33Z
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/3733/reactions" }
https://api.github.com/repos/psf/requests/issues/3733/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/3733.diff", "html_url": "https://github.com/psf/requests/pull/3733", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/3733.patch", "url": "https://api.github.com/repos/psf/requests/pulls/3733" }
true
[ "There's no reason to remove these. What are you trying to achieve here?", "What are they? And what are they for? They are not displayed well in my computer.\r\n\r\nFrom Readme in GitHub\r\n![captura de pantalla de 2016-11-29 10 05 31](https://cloud.githubusercontent.com/assets/14212780/20703284/76a287dc-b61b-11e6-8e4c-155b3a940b57.png)\r\nFrom pip\r\n![captura de pantalla de 2016-11-29 10 05 43](https://cloud.githubusercontent.com/assets/14212780/20703288/7a051336-b61b-11e6-8007-63c3aa0c15fc.png)\r\n", "They are [emoji](https://en.wikipedia.org/wiki/Emoji). They're pictograms that have been assigned Unicode glyphs. If your computer cannot render them you can either elect to resolve that by installing an emoji font, or you can simply ignore them: you aren't losing out on any critical data. The picture you can't see, for the record, is a slice of cake. ", "The cake is a lie." ]
https://api.github.com/repos/psf/requests/issues/3732
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/3732/labels{/name}
https://api.github.com/repos/psf/requests/issues/3732/comments
https://api.github.com/repos/psf/requests/issues/3732/events
https://github.com/psf/requests/issues/3732
192,159,995
MDU6SXNzdWUxOTIxNTk5OTU=
3,732
Mutual TLS failing for requests > 2.11.1
{ "avatar_url": "https://avatars.githubusercontent.com/u/2262214?v=4", "events_url": "https://api.github.com/users/kevgliss/events{/privacy}", "followers_url": "https://api.github.com/users/kevgliss/followers", "following_url": "https://api.github.com/users/kevgliss/following{/other_user}", "gists_url": "https://api.github.com/users/kevgliss/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kevgliss", "id": 2262214, "login": "kevgliss", "node_id": "MDQ6VXNlcjIyNjIyMTQ=", "organizations_url": "https://api.github.com/users/kevgliss/orgs", "received_events_url": "https://api.github.com/users/kevgliss/received_events", "repos_url": "https://api.github.com/users/kevgliss/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kevgliss/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kevgliss/subscriptions", "type": "User", "url": "https://api.github.com/users/kevgliss", "user_view_type": "public" }
[]
closed
true
null
[]
null
8
2016-11-29T00:59:04Z
2021-09-08T14:00:25Z
2016-11-30T17:28:47Z
NONE
resolved
Seeing the following errors when attempting to upgrade to 2.12.1. This most likely has to do with the underlying upgrade to urllib3. If that is deemed the case I can move this issue. 2.11.1 does not exhibit any issues. Requests was installed with pip and running under python3.5. Stacktrace: ``` Traceback (most recent call last): File "/apps/lemur/lib/python3.5/site-packages/requests/packages/urllib3/contrib/pyopenssl.py", line 417, in wrap_socket cnx.do_handshake() File "/apps/lemur/lib/python3.5/site-packages/OpenSSL/SSL.py", line 1424, in do_handshake self._raise_ssl_error(self._ssl, result) File "/apps/lemur/lib/python3.5/site-packages/OpenSSL/SSL.py", line 1172, in _raise_ssl_error _raise_current_error() File "/apps/lemur/lib/python3.5/site-packages/OpenSSL/_util.py", line 48, in exception_from_error_queue raise exception_type(errors) OpenSSL.SSL.Error: [('SSL routines', 'SSL3_READ_BYTES', 'tlsv1 alert unknown ca')] During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/apps/lemur/lib/python3.5/site-packages/requests/packages/urllib3/connectionpool.py", line 594, in urlopen chunked=chunked) File "/apps/lemur/lib/python3.5/site-packages/requests/packages/urllib3/connectionpool.py", line 350, in _make_request self._validate_conn(conn) File "/apps/lemur/lib/python3.5/site-packages/requests/packages/urllib3/connectionpool.py", line 835, in _validate_conn conn.connect() File "/apps/lemur/lib/python3.5/site-packages/requests/packages/urllib3/connection.py", line 323, in connect ssl_context=context) File "/apps/lemur/lib/python3.5/site-packages/requests/packages/urllib3/util/ssl_.py", line 324, in ssl_wrap_socket return context.wrap_socket(sock, server_hostname=server_hostname) File "/apps/lemur/lib/python3.5/site-packages/requests/packages/urllib3/contrib/pyopenssl.py", line 424, in wrap_socket raise ssl.SSLError('bad handshake: %r' % e) ssl.SSLError: ("bad handshake: Error([('SSL routines', 'SSL3_READ_BYTES', 'tlsv1 alert unknown ca')],)",) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/apps/lemur/lib/python3.5/site-packages/requests/adapters.py", line 423, in send timeout=timeout File "/apps/lemur/lib/python3.5/site-packages/requests/packages/urllib3/connectionpool.py", line 624, in urlopen raise SSLError(e) requests.packages.urllib3.exceptions.SSLError: ("bad handshake: Error([('SSL routines', 'SSL3_READ_BYTES', 'tlsv1 alert unknown ca')],)",) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/apps/lemur/lemur/common/schema.py", line 147, in decorated_function resp = f(*args, **kwargs) File "/apps/lemur/lemur/certificates/views.py", line 271, in post return service.create(**data) File "/apps/lemur/lemur/certificates/service.py", line 218, in create cert_body, private_key, cert_chain = mint(**kwargs) File "/apps/lemur/lemur/certificates/service.py", line 167, in mint cert_body, cert_chain = issuer.create_certificate(csr, kwargs) File "/apps/lemur/lemur-cloudca/lemur_cloudca/plugin.py", line 332, in create_certificate response = self.post(endpoint, cloudca_options) File "/apps/lemur/lemur-cloudca/lemur_cloudca/plugin.py", line 163, in post response = self.session.post(self.url + endpoint, data=dumps(data), timeout=10, verify=self.ca_bundle) File "/apps/lemur/lib/python3.5/site-packages/requests/sessions.py", line 535, in post return self.request('POST', url, data=data, json=json, **kwargs) File "/apps/lemur/lib/python3.5/site-packages/requests/sessions.py", line 488, in request resp = self.send(prep, **send_kwargs) File "/apps/lemur/lib/python3.5/site-packages/requests/sessions.py", line 609, in send r = adapter.send(request, **kwargs) File "/apps/lemur/lib/python3.5/site-packages/requests/adapters.py", line 497, in send raise SSLError(e, request=request) requests.exceptions.SSLError: ("bad handshake: Error([('SSL routines', 'SSL3_READ_BYTES', 'tlsv1 alert unknown ca')],)",) Traceback (most recent call last): File "/apps/lemur/lib/python3.5/site-packages/requests/packages/urllib3/connectionpool.py", line 594, in urlopen chunked=chunked) File "/apps/lemur/lib/python3.5/site-packages/requests/packages/urllib3/connectionpool.py", line 350, in _make_request self._validate_conn(conn) File "/apps/lemur/lib/python3.5/site-packages/requests/packages/urllib3/connectionpool.py", line 835, in _validate_conn conn.connect() File "/apps/lemur/lib/python3.5/site-packages/requests/packages/urllib3/connection.py", line 323, in connect ssl_context=context) File "/apps/lemur/lib/python3.5/site-packages/requests/packages/urllib3/util/ssl_.py", line 324, in ssl_wrap_socket return context.wrap_socket(sock, server_hostname=server_hostname) File "/apps/lemur/lib/python3.5/site-packages/requests/packages/urllib3/contrib/pyopenssl.py", line 424, in wrap_socket raise ssl.SSLError('bad handshake: %r' % e) ssl.SSLError: ("bad handshake: Error([('SSL routines', 'SSL3_READ_BYTES', 'tlsv1 alert unknown ca')],)",) ``` Reproduce with: ``` import requests class HostNameCheckingAdapter(HTTPAdapter): def cert_verify(self, conn, url, verify, cert): super(HostNameCheckingAdapter, self).cert_verify(conn, url, verify, cert) conn.assert_hostname = False s = requests.Session() s.mount('https://', HostNameCheckingAdapter()) s.cert = 'path-to-pem' s.get('https://example.com', verify='path-to-ca-bundle') ```
{ "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/3732/reactions" }
https://api.github.com/repos/psf/requests/issues/3732/timeline
null
completed
null
null
false
[ "Is your CA bundle a directory or a single file?", "The short explanation of this problem right now is that the server seems to be rejecting your certificate. My best guess on this is that the 2.11.1 Requests had a urllib3 that didn't work with PyOpenSSL, but now does, so you're bumping into a code problem with PyOpenSSL. Can you try `pip install requests` in a clean environment with no PyOpenSSL to see if you have the same problem?", "The CA bundle is a single file. I've tried it in a clean virtualenv and it seems to be fine. Does this point to a compatibility issue with PyOpenSSL and urllib3?", "It seems that I only directly rely on pyopenssl for crl checking:\r\nhttps://github.com/Netflix/lemur/blob/master/lemur/certificates/verify.py#L63\r\n\r\nIt looks as though this functionality was added to cryptography 1.1 per:\r\nhttps://cryptography.io/en/latest/changelog/?highlight=CRL#id18\r\n\r\nIf we think that removing the pyopenssl dependency removes this issue I will go ahead and move onto the cryptography implementation. ", "This suggests that there is an issue with the way urllib3's PyOpenSSL integration is functioning. I'll investigate tomorrow.", "Ok, I suspect I've found the problem. Can you set up an environment with the misbehaving install, and then edit line 379 of `requests/packages/urllib3/contrib/pyopenssl.py`? Change it from:\r\n\r\n```python\r\nself._ctx.use_certificate_file(certfile)\r\n```\r\n\r\nto\r\n\r\n```python\r\nself._ctx.use_certificate_chain_file(certfile)\r\n```\r\n\r\nand see if the problem still exists?", "It was on line 397. And that seems to fix it. :-)", "Ok, so that's a urllib3 bug. =)\r\n\r\nMind opening a bug report on urllib3 that points out that our pyopenssl support doesn't support certificate chains for client certs?" ]
https://api.github.com/repos/psf/requests/issues/3731
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/3731/labels{/name}
https://api.github.com/repos/psf/requests/issues/3731/comments
https://api.github.com/repos/psf/requests/issues/3731/events
https://github.com/psf/requests/issues/3731
191,959,378
MDU6SXNzdWUxOTE5NTkzNzg=
3,731
__bool__() and __nonzero__() of Response
{ "avatar_url": "https://avatars.githubusercontent.com/u/414336?v=4", "events_url": "https://api.github.com/users/guettli/events{/privacy}", "followers_url": "https://api.github.com/users/guettli/followers", "following_url": "https://api.github.com/users/guettli/following{/other_user}", "gists_url": "https://api.github.com/users/guettli/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/guettli", "id": 414336, "login": "guettli", "node_id": "MDQ6VXNlcjQxNDMzNg==", "organizations_url": "https://api.github.com/users/guettli/orgs", "received_events_url": "https://api.github.com/users/guettli/received_events", "repos_url": "https://api.github.com/users/guettli/repos", "site_admin": false, "starred_url": "https://api.github.com/users/guettli/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/guettli/subscriptions", "type": "User", "url": "https://api.github.com/users/guettli", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2016-11-28T09:43:24Z
2021-09-08T14:00:27Z
2016-11-28T09:55:09Z
NONE
resolved
Do you really like this? ``` class Response(...): def __bool__(self): """Returns true if :attr:`status_code` is 'OK'.""" return self.ok def __nonzero__(self): """Returns true if :attr:`status_code` is 'OK'.""" return self.ok ``` I had this code: ``` def foo(request, response=None): .... if response: do_something_with_response ``` It took some time to understand why this did not work like the way I wanted. I guess you don't want to change the current behaviour since it could break a lot of existing code. Question: Do you really like 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/3731/reactions" }
https://api.github.com/repos/psf/requests/issues/3731/timeline
null
completed
null
null
false
[ "Thanks for this report!\r\n\r\nIn the future, before filing issues against open source projects, please take the time to investigate whether they have seen an issue before. If you had searched \"bool\" in our issue tracker the first result you'd have seen would have been for #2002, which already tracks this issue. You'll notice that we agree with you that it's bad, and have removed it in our branch for the next major release of Requests. However, it's a breaking change, so we cannot ship it before the 3.0.0 release, which is currently not timetabled.\r\n\r\nSo, in answer to your question: no, we don't like it. There are many things we don't like, but we have *far* too many users to change these things without a good run-up.\r\n\r\n(While we're here: you should use this experience to get comfortable with using `if x is not None:` rather than `if x:`. Because of Python's booleanness rules, when you're checking a Nullable value like this one you should always explicitly look for the `None` singleton rather than rely on the fact that `None` is falsy. Most Python linters will flag this behaviour if they see it.)", "I went a little bit overboard when I wrote that. It's totally unnecessary when Resoponse.ok exists.\n\nSent from my iPhone\n\n> On Nov 28, 2016, at 4:55 AM, Cory Benfield <[email protected]> wrote:\n> \n> Thanks for this report!\n> \n> In the future, before filing issues against open source projects, please take the time to investigate whether they have seen an issue before. If you had searched \"bool\" in our issue tracker the first result you'd have seen would have been for #2002, which already tracks this issue. You'll notice that we agree with you that it's bad, and have removed it in our branch for the next major release of Requests. However, it's a breaking change, so we cannot ship it before the 3.0.0 release, which is currently not timetabled.\n> \n> So, in answer to your question: no, we don't like it. There are many things we don't like, but we have far too many users to change these things without a good run-up.\n> \n> (While we're here: you should use this experience to get comfortable with using if x is not None: rather than if x:. Because of Python's booleanness rules, when you're checking a Nullable value like this one you should always explicitly look for the None singleton rather than rely on the fact that None is falsy. Most Python linters will flag this behaviour if they see it.)\n> \n> β€”\n> You are receiving this because you are subscribed to this thread.\n> Reply to this email directly, view it on GitHub, or mute the thread.\n> \n" ]
https://api.github.com/repos/psf/requests/issues/3730
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/3730/labels{/name}
https://api.github.com/repos/psf/requests/issues/3730/comments
https://api.github.com/repos/psf/requests/issues/3730/events
https://github.com/psf/requests/issues/3730
191,843,805
MDU6SXNzdWUxOTE4NDM4MDU=
3,730
CLOSE_WAIT Issue
{ "avatar_url": "https://avatars.githubusercontent.com/u/5680206?v=4", "events_url": "https://api.github.com/users/venkat2111987/events{/privacy}", "followers_url": "https://api.github.com/users/venkat2111987/followers", "following_url": "https://api.github.com/users/venkat2111987/following{/other_user}", "gists_url": "https://api.github.com/users/venkat2111987/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/venkat2111987", "id": 5680206, "login": "venkat2111987", "node_id": "MDQ6VXNlcjU2ODAyMDY=", "organizations_url": "https://api.github.com/users/venkat2111987/orgs", "received_events_url": "https://api.github.com/users/venkat2111987/received_events", "repos_url": "https://api.github.com/users/venkat2111987/repos", "site_admin": false, "starred_url": "https://api.github.com/users/venkat2111987/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/venkat2111987/subscriptions", "type": "User", "url": "https://api.github.com/users/venkat2111987", "user_view_type": "public" }
[]
closed
true
null
[]
null
4
2016-11-27T05:42:48Z
2021-09-08T14:00:28Z
2016-11-27T08:36:02Z
NONE
resolved
Hi, We are developing a python application using tornado framework. The application consumes a REST end point exposed by splunk system to get some metrics data. A scheduled background process runs and populates our application local data-store. While tornado serves data to third party using the local data-store. We are using Requests==2.9.1 to communicate with Splunk Code snippet using which we are communicating to Splunk: ------------------------------------------------------------------ try: resp = requests.get(splunkapi,params = params, verify = False, headers = header ) if resp.status_code == 200 and (resp.content not in ['""','"None"']) : results = json.loads(resp.json()) with open("outfile.json" , 'w') as outfile: json.dump(results, outfile,indent=4) else: with open("outfile.json" , 'w') as outfile: json.dump(dict(), outfile,indent=4) except Exception,e: with open("outfile.json" as outfile: json.dump(dict(), outfile,indent=4) CLOSE_WAIT Issue: --------------------- Step 1: I bring up Tornado Application. Step 2: I bring up splunk system. Everything works fine Step 3: For some reason, the sys admins have to reboot the machine where tornado application is running. Lot of connections in CLOSE_WAIT status at splunk side. Step 4: Restart Splunk. Everything is cleaned up. The system continues to run smoothly. Step 5: Reboot the system where tornado application is running. Again same issue. Lot of CLOSE_WAIT connections at splunk side. Are the CLOSE_WAIT connections a result of "Requests" not communicating properly with splunk?
{ "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/3730/reactions" }
https://api.github.com/repos/psf/requests/issues/3730/timeline
null
completed
null
null
false
[ "No. \r\n\r\nCLOSE_WAIT is the TCP state that is entered by the TCP peer that initiates a connection close. It cannot be avoided: it exists to ensure that delayed or retransmitted packets belonging to a TCP connection are not lost.\r\n\r\nWhen the Tornado application is closed down, Requests' pooled sockets all get closed by the Python runtime or the OS. That means your Tornado application initiated the close, and so all those pooled sockets will enter TIME_WAIT. This is not a problem: it is expected behaviour for a TCP client.", "Ah, apologies, I see you're getting the CLOSE_WAIT on the other machine. That seems like Splunk is initiating an idle timeout. What Python interpreter are you using?", "We are using Python 2.7.5 for our tornado application (dockerized). The splunk version on the other machine is 6.4.0 which is packaged with python 2.7.11.\r\n\r\nThanks!", "Are you familiar with Wireshark? It would be interesting to see Wireshark traffic from the application. In particular, I'm interested to see whether the TCP connections your server sets up to splunk are cleaned up promptly in use or not." ]
https://api.github.com/repos/psf/requests/issues/3729
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/3729/labels{/name}
https://api.github.com/repos/psf/requests/issues/3729/comments
https://api.github.com/repos/psf/requests/issues/3729/events
https://github.com/psf/requests/issues/3729
191,606,444
MDU6SXNzdWUxOTE2MDY0NDQ=
3,729
iter_content slow with large chunk size on HTTPS connection
{ "avatar_url": "https://avatars.githubusercontent.com/u/1097609?v=4", "events_url": "https://api.github.com/users/pdknsk/events{/privacy}", "followers_url": "https://api.github.com/users/pdknsk/followers", "following_url": "https://api.github.com/users/pdknsk/following{/other_user}", "gists_url": "https://api.github.com/users/pdknsk/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/pdknsk", "id": 1097609, "login": "pdknsk", "node_id": "MDQ6VXNlcjEwOTc2MDk=", "organizations_url": "https://api.github.com/users/pdknsk/orgs", "received_events_url": "https://api.github.com/users/pdknsk/received_events", "repos_url": "https://api.github.com/users/pdknsk/repos", "site_admin": false, "starred_url": "https://api.github.com/users/pdknsk/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/pdknsk/subscriptions", "type": "User", "url": "https://api.github.com/users/pdknsk", "user_view_type": "public" }
[]
closed
true
null
[]
null
22
2016-11-25T00:40:08Z
2021-09-08T13:05:44Z
2016-11-28T12:32:10Z
NONE
resolved
```Python https = requests.get(url, stream=True) for content in https.iter_content(100 * 2 ** 20): # 100MB pass ``` This causes `100%` CPU and slows down throughput to less than `1MB/s`.
{ "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/3729/reactions" }
https://api.github.com/repos/psf/requests/issues/3729/timeline
null
completed
null
null
false
[ "Sorry, but right now you haven't given us anything like enough to go on. Please answer all of the following questions:\r\n\r\n- How does this behave on smaller chunk sizes?\r\n- What about larger ones?\r\n- What version of Requests are you using?\r\n- What version of Python are you using? \r\n- Can you share the URL in question?\r\n- What is the throughput when using `.content` directly?\r\n- What do the response headers include?", "I had wrongly assumed it's an universal bug affecting every HTTPS connection, which is why I didn't provide further information. I've done further investigation and it seems to affect only some CDNs, like _Akamai_ and _Azure_.\r\n\r\n[Example](https://az792536.vo.msecnd.net/vms/VMBuild_20161102/VirtualBox/MSEdge/MSEdge.Win10_preview.VirtualBox.zip) (affected). [Counter-example](https://cloudfront.debian.net/cdimage/release/current/amd64/iso-dvd/debian-8.6.0-amd64-DVD-1.iso) (not affected).\r\n\r\nAt `10MB`, there is no noticeable increase in CPU load, and no impact on throughput. At `1GB`, CPU load is at `100%`, just like with `100MB`, but throughput is reduced to below `100KB/s`, compared to `1MB/s` at `100MB`.\r\n\r\nI'm using the latest version on Python `2.7.12`, installed through _pip_.", "Is this true even with empty loop bodies as in your sample code? I ask because my normal instinct here would be that the repeated context switches back into Python are causing your performance problem, but *larger* chunks shouldn't exhibit that problem at all: they should be proportionally *more* efficient than the smaller chunk sizes.\r\n\r\nThis suggests that the problem is the manipulation of increasingly large chunks of memory. If this happens to you even with empty loop bodies then we have something really interesting to have to investigate.\r\n\r\nDo you have access to Python 3 on your machine?", "> Is this true even with empty loop bodies as in your sample code?\r\n\r\nYes.\r\n\r\n> Do you have access to Python 3 on your machine?\r\n\r\nI've tried Python `3.4.3` with requests `2.2.1` as provided by Ubuntu repositories, and the problem does not occur, even at ```1GB``` chunk size.\r\n\r\nI have figured out why. When I Ctrl+C the connection, the stack traces hold the clue.\r\n\r\nPython `2.7.12`\r\n```Python\r\nFile \"/home/user/.local/lib/python2.7/site-packages/OpenSSL/SSL.py\", line 1299, in recv\r\n buf = _ffi.new(\"char[]\", bufsiz)\r\n```\r\nPython `3.4.3`\r\n```Python\r\nFile \"/usr/lib/python3.4/ssl.py\", line 641, in read\r\n v = self._sslobj.read(len, buffer)\r\n```\r\nMaybe this works.\r\n```\r\n$ pip uninstall PyOpenSSL\r\n```\r\nPython ```2.7.12``` again.\r\n```Python\r\nFile \"/usr/local/lib/python2.7/ssl.py\", line 643, in read\r\n v = self._sslobj.read(len)\r\n```\r\nAnd the problem does not occur. No decrease in throughput or increase in CPU load.\r\n\r\nIt still doesn't answer the question why it manifests only with large chunk size in the first place.", "I've also figured out why the counter-example provided a few posts earlier does not exhibit the problem: it redirects to a HTTP server. So it does affect every HTTPS connection after all.", "I've only installed _PyOpenSSL_ to silence the [InsecurePlatformWarning](http://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings) on Python `2.7.6`, which I've since replaced with self-compiled Python `2.7.12`, so _PyOpenSSL_ is now obsolete and the problem fixed for me.\r\n\r\nI think there is still a bug here somewhere related to chunk size.", "Unfortunately I just noticed that some other packages installed through _pip_ since do also require _PyOpenSSL_.", "Ok, so then the next question is: is this merely a case of CFFI buffer allocation being slow, or is there something else going on? I'll need to investigate this further, as PyOpenSSL may not be at fault directly: it may be something to do with how we use it.", "@pdknsk It would be interesting to see if you continue to have this problem on Python 3 with `pip install requests[security]`. That will also bring in PyOpenSSL, which should cause the problem again.", "So, a quick test reveals that our use of CFFI is almost certainly the bottleneck here. I ran the following script (note the import from PyOpenSSL's FFI object, this was intended only for consistency and ease):\r\n\r\n```python\r\nfrom OpenSSL._util import ffi\r\n\r\nMB = 1024 * 1024\r\n\r\ndef test(alloc_size):\r\n buf = ffi.new(\"char[]\", alloc_size)\r\n\r\nimport timeit\r\n\r\nfor size in [1, 10, 100, 1000]:\r\n print \"Doing allocations of {}MB\".format(size)\r\n size = size * MB\r\n print timeit.repeat(\r\n \"test({})\".format(size), setup=\"from __main__ import test\", number=100\r\n )\r\n```\r\n\r\nThat gave me the following results:\r\n\r\n```\r\n% python test_cffi.py \r\nDoing allocations of 1MB\r\n[0.004097938537597656, 0.003545999526977539, 0.003551006317138672]\r\nDoing allocations of 10MB\r\n[0.07877898216247559, 0.07785892486572266, 0.06536316871643066]\r\nDoing allocations of 100MB\r\n[3.7023580074310303, 3.6858859062194824, 3.602185010910034]\r\nDoing allocations of 1000MB\r\n[65.49478697776794, 67.42595791816711, 67.89322805404663]\r\n```\r\n\r\nNote, essentially, that increasing the allocation size increases the cost of allocation by a factor of between 20 to 40. That's really quite unexpected. The next step is going to be trying to work out if this is a problem with CFFI or with malloc more generally.", "So I can't reproduce this behaviour in plain C code. That suggests that the problem is elsewhere. We might need to look at CFFI here.", "Ok, this is kinda CFFI's fault, but not really.\r\n\r\nWhen we do the initial buffer allocation CFFI kindly gives us a *zeroed* buffer. This zeroed buffer requires something that is basically the equivalent of `malloc` followed by `memset` (it's actually `calloc`, but that's neither here nor there). That means that allocations of buffers like this in CFFI have an approximately linear cost in the size of the allocation.\r\n\r\nSo, this isn't really CFFI's fault. Its strategy is reasonable. This is a problem higher up the stack. In the case of reading from a socket we don't need a zeroed buffer: we know how many bytes the code will write into it, so we can avoid doing anything silly. That's why CPython doesn't encounter the issue: I think they just directly malloc the underlying byte buffer.\r\n\r\nI guess the first line of attack would be to see if CFFI is interested in adding a non-zeroed buffer acquisition API. That, however, only solves the problem on newer CFFIs.\r\n\r\nAnother option is to adjust the logic in either PyOpenSSL or Requests to quietly ignore really large arguments to `recv` and to clamp them to the size of the socket buffer in the kernel. The socket buffer represents a hard upper limit on how much data the kernel can actually return in one call to `recv` on a socket. So we could pursue that fix as well.", "I read the _CFFI_ documentation briefly yesterday and noticed that ```ffi.new``` returns zero-initialised memory, but didn't mention it because I'm unfamiliar with all the machinery involved here, so wasn't sure that's the performance limitation.\r\n\r\nWhat I also noticed is function [```ffi.new_allocator```](http://cffi.readthedocs.io/en/latest/ref.html#ffi-new-allocator) which provides a way to use `malloc` directly.", "Yup, this has already been proposed as an alternative solution in the relevant pyopenssl issue. ", "I just tried the benchmark you posted earlier, with the line from [pyca/pyopenssl#577](https://github.com/pyca/pyopenssl/issues/577#issuecomment-263143734), and it returns instantly regardless of allocation size, as you'd expect. Problem solved.", "Ok, the underlying issue at PyOpenSSL has had a fix merged. This should *drastically* improve our performance in this edge case. Thanks for the report @pdknsk and thanks for working with us to narrow down the problem! :sparkles:", "It's interesting how a rare problem produced a fix with much wider application. I figure this will save quite a bit of CPU and thus electricity, and perhaps even yield noticeable performance improvements for every HTTPS connection on slow devices. A problem well worth reporting.", "...What's particularly mysterious here is that for large buffers (these definitely qualify), `calloc` should be about as cheap as `malloc`, and much cheaper than `malloc`+`memset`! Once you pass the size threshold where the heap allocator decides to go to the kernel to satisfy the request (128 KiB for glibc by default), then the kernel returns lazily-zeroed memory regardless. So `malloc` and `calloc` should be indistinguishable, and both should be O(1) because the kernel will zero the memory lazily as its faulted in.", "...darn, I got curious and investigated further. I have poor impulse control. Anyway, this is totally a bug in cffi: https://bitbucket.org/cffi/cffi/issues/295/cffinew-is-way-slower-than-it-should-be-it", "...annnnnd it's *also* a bug in MacOS: https://github.com/pyca/pyopenssl/pull/578#issuecomment-264800709\r\n\r\n@pdknsk what have you *done*", "So @pdknsk, after further investigation prodded by @njsmith, you've actually stumbled onto *two* bugs that are wasting a lot of CPU and electricity.\r\n\r\nThe first is that CFFI should be using more efficient allocation. The second, and *much more important*, is that there is a region of allocations between about 128kB and 125MB where macOS (and, presumably, iOS/watchOS/tvOS as well) forcibly page-in and zero memory when they don't need to, wasting a ton of CPU to do it.\r\n\r\nNicely done!", "This bug now also filed as rdar://29508271" ]
https://api.github.com/repos/psf/requests/issues/3718
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/3718/labels{/name}
https://api.github.com/repos/psf/requests/issues/3718/comments
https://api.github.com/repos/psf/requests/issues/3718/events
https://github.com/psf/requests/pull/3718
191,383,270
MDExOlB1bGxSZXF1ZXN0OTUwODE5ODQ=
3,718
Make Response.content() return None for an empty response
{ "avatar_url": "https://avatars.githubusercontent.com/u/4924623?v=4", "events_url": "https://api.github.com/users/nsoranzo/events{/privacy}", "followers_url": "https://api.github.com/users/nsoranzo/followers", "following_url": "https://api.github.com/users/nsoranzo/following{/other_user}", "gists_url": "https://api.github.com/users/nsoranzo/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/nsoranzo", "id": 4924623, "login": "nsoranzo", "node_id": "MDQ6VXNlcjQ5MjQ2MjM=", "organizations_url": "https://api.github.com/users/nsoranzo/orgs", "received_events_url": "https://api.github.com/users/nsoranzo/received_events", "repos_url": "https://api.github.com/users/nsoranzo/repos", "site_admin": false, "starred_url": "https://api.github.com/users/nsoranzo/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/nsoranzo/subscriptions", "type": "User", "url": "https://api.github.com/users/nsoranzo", "user_view_type": "public" }
[]
closed
true
null
[]
null
17
2016-11-23T21:26:30Z
2022-05-09T15:12:17Z
2016-11-24T13:35:37Z
CONTRIBUTOR
resolved
Fix #3698. This fixes also a traceback in https://github.com/galaxyproject/bioblend/blob/master/bioblend/galaxy/client.py#L135 where the `text` attribute of an empty `requests.Response()` object is used: ``` Traceback (most recent call last): File "/usr/users/ga002/soranzon/software/galaxyproject_bioblend/tests/TestGalaxyInstance.py", line 37, in test_get_retry self.gi.libraries.get_libraries() File "/usr/users/ga002/soranzon/software/galaxyproject_bioblend/bioblend/galaxy/libraries/__init__.py", line 218, in get_libraries libraries = self._get(deleted=deleted) File "/usr/users/ga002/soranzon/software/galaxyproject_bioblend/bioblend/galaxy/client.py", line 135, in _get raise ConnectionError(msg, body=r.text, File "/usr/users/ga002/soranzon/software/galaxyproject_bioblend/.tox/py27/local/lib/python2.7/site-packages/requests/models.py", line 796, in text if not self.content: File "/usr/users/ga002/soranzon/software/galaxyproject_bioblend/.tox/py27/local/lib/python2.7/site-packages/requests/models.py", line 772, in content self._content = bytes().join(self.iter_content(CONTENT_CHUNK_SIZE)) or bytes() File "/usr/users/ga002/soranzon/software/galaxyproject_bioblend/.tox/py27/local/lib/python2.7/site-packages/requests/models.py", line 705, in generate chunk = self.raw.read(chunk_size) AttributeError: 'NoneType' object has no attribute 'read' ```
{ "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/3718/reactions" }
https://api.github.com/repos/psf/requests/issues/3718/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/3718.diff", "html_url": "https://github.com/psf/requests/pull/3718", "merged_at": "2016-11-24T13:35:37Z", "patch_url": "https://github.com/psf/requests/pull/3718.patch", "url": "https://api.github.com/repos/psf/requests/pulls/3718" }
true
[ "Heh, I was going to say that we shouldn't tolerate silly status codes until I saw that we already tolerate `0`. That's really quite odd, but fair enough, I guess this is a logical extension of what we already do.", "However, before we merge this, can I ask you to please add a test for this logic?", "@Lukasa Do you mean a test that for an empty `requests.Response()` object, the `content` property is None?", "Yep. =)", "A couple of things here just for future readers. This unfortunately wouldn't fix the problem #3698 had because their mocking still required a valid status code in their empty response.\r\n\r\nThe other thing to think about is that with this patch, empty responses that used to work with valid bodies but no status code will now return `None`. Likely a rare edge case, but #3698 was thought to be unlikely too.", "I remain really unsure that we should tolerate content with no status codes, but clearly we have done it before so... πŸ˜• ", "I like the proposed logic. ", "Just another passing thought, while we're here. If we're going to loosen this up, should we also broaden the check to `or self.raw is None` so we're solving #3698? Otherwise we still have an awkward failure mode in the event of a valid status_code but no response body.", "Honestly, I really don't think we need to solve for #3698.\r\n\r\nThere's little in our documentation about creating custom Response objects and while Transport Adapters can do that, we don't document what they need to set. With that in mind, if someone's mocking out requests, they should probably be putting more effort into it than this Pull Request makes them. Why? Because that's not how we are expecting users to use the Response object. There are also *several* libraries for doing this, and if someone's using `mock` they can autospec a Response object.\r\n\r\nIn short, there's little value in this patch to the critical path of Requests.", "> but clearly we have done it before so... πŸ˜•\r\n\r\nI don't agree that because we've done something before we need to continue down that path. I especially feel we don't need to do this when we recognize that it was a mistake to do this previously.", "@nateprewitt I'd be happy to change the test to:\r\n```\r\nif self.status_code == 0 or self.raw is None:\r\n```\r\nor anything that makes:\r\n```\r\nr = requests.Response()\r\nr.content\r\n```\r\nreturn `None`. I think most programmers would expect this and that the traceback is a regression.", "> I think most programmers would expect this and that the traceback is a regression.\r\n\r\nWould most programmers expect this? I'm not sure that I would.\r\n\r\nI think the reality here is that we have discovered that a concern originally raised in #3607 was correct: our defense against `response.raw` being `None` was there not so much because we needed it but because downstream libraries were patching our objects in such a way that `response.raw` was `None`.\r\n\r\nFrom my perspective then, there are two sensible choices. Number one is to change this patch such that we tolerate the *actual problem*: namely, that `response.raw` is `None`. Number two is to decide that we simply don't support `response.raw` being `None`, and the error is exactly correct.\r\n\r\nI think I'm leaning towards number one, if only because we've handled this kind of problem in the past (admittedly with an overbroad `except` block).", "@Lukasa I'll try to explain why I think that this is the expected behaviour:\r\n\r\n- `requests.Response` class is clearly part of the `requests` API and creating such objects is useful when dealing with connection exceptions\r\n- the only `__init__` method of `requests.Response()` has no parameters\r\n- using a property of a legitimately created object shouldn't raise an error, unless there is a very good reason\r\n\r\n> Number one is to change this patch such that we tolerate the actual problem: namely, that response.raw is None.\r\n\r\nSo, is\r\n```\r\nif self.status_code == 0 or self.raw is None:\r\n```\r\na good solution for you?", "> I think I'm leaning towards number one, if only because we've handled this kind of problem in the past (admittedly with an overbroad except block).\r\n\r\nThis makes sense to me. We can add the requirement that raw not be None in 3.0\r\n\r\n@nsoranzo adding the explicit check for None works for me.", "@sigmavirus24 I've added the explicit check for None and also a test as requested by @Lukasa.", "The explicit check for `None` works. In an ideal world I'd rather change the logic to just check `raw` directly (presumably the status code `0` behaviour is meant to be a crutch for this), but I'd worry about regressing some other wacky edge case. So let's just accept that this is a mess and move on. =P", "Arg, github had refreshed, but not quite enough. =(" ]
https://api.github.com/repos/psf/requests/issues/3717
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/3717/labels{/name}
https://api.github.com/repos/psf/requests/issues/3717/comments
https://api.github.com/repos/psf/requests/issues/3717/events
https://github.com/psf/requests/pull/3717
191,183,331
MDExOlB1bGxSZXF1ZXN0OTQ5NDE1MTI=
3,717
streaming doc clarification
{ "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
2016-11-23T03:48:05Z
2021-09-08T01:21:35Z
2016-11-23T10:17:32Z
MEMBER
resolved
Minor example update and rewording in response to the continued discussion after merging #3704. @afeld, if you're inclined to comment, does this change still address your original concerns?
{ "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/3717/reactions" }
https://api.github.com/repos/psf/requests/issues/3717/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/3717.diff", "html_url": "https://github.com/psf/requests/pull/3717", "merged_at": "2016-11-23T10:17:32Z", "patch_url": "https://github.com/psf/requests/pull/3717.patch", "url": "https://api.github.com/repos/psf/requests/pulls/3717" }
true
[ ":+1:", "Thanks @afeld and @nateprewitt!" ]
https://api.github.com/repos/psf/requests/issues/3716
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/3716/labels{/name}
https://api.github.com/repos/psf/requests/issues/3716/comments
https://api.github.com/repos/psf/requests/issues/3716/events
https://github.com/psf/requests/issues/3716
191,107,106
MDU6SXNzdWUxOTExMDcxMDY=
3,716
Can't Get Version 2.2.1
{ "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
16
2016-11-22T19:50:03Z
2021-09-08T14:00:28Z
2016-11-22T20:25:24Z
NONE
resolved
I have a program that won't run without version 2.2.0 or higher. However, each time I try to install this with pip or easy_install, it only does 2.12.1 and even the --upgrade option says this is up to date. I know this exists, since it's listed [here](https://pypi.python.org/pypi/requests/2.2.1), not to mention that this program requires 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/3716/reactions" }
https://api.github.com/repos/psf/requests/issues/3716/timeline
null
completed
null
null
false
[ "@PatriotRDX have you tried using `pip install requests==2.2.1`?\r\n\r\nEdit: Sorry, let me clarify for a moment. Are you looking for a version that is lower than 2.12 but higher than 2.2.0? The minor version number is linear, so 2.2.0 is an older version than 2.12.1.", "@nateprewitt thanks this helped. However, it seems like [this documentation](https://pypi.python.org/pypi/requests/2.2.1) should be updated, since it's just flat out wrong.", "@PatriotRDX which part of the documentation do you feel is incorrect?", "@nateprewitt the documentation here says to run `pip install requests` in Terminal. However, this only installs 2.12.1. Not to mention the documentation here is exactly the same as the documentation for 2.12.1.", "@PatriotRDX so this is a bit harder because this is a reflection of the README.rst at the time of release. `pip install requests` is the correct command for installing requests on your machine. If you require an older version, the standard usage of pip has you specify a specific version number (`requests==2.2.1`) or a range (`requests>=2.6.0`). You can find more documentation on pip [here](https://pip.pypa.io/en/stable/).\r\n\r\nThis should be specified by whichever package you're trying to use in either the requirements.txt file, or setup.py. If it isn't, that should probably be brought up with the package maintainer.\r\n\r\n@Lukasa or Kenneth may have different opinions on retroactively updating older release docs, but I'm not sure it's likely.", "@nateprewitt there is no way to update it. @PatriotRDX we expect users to have some understanding of how to specify requirements themselves and use pip.", "> we expect users to have some understanding of how to specify requirements themselves and use pip.\r\n\r\n@sigmavirus24 wow that's brutal, only time I've used Python has been today.", "@PatriotRDX, I think there's just been a bit of confusion with what you were asking. I took a peek at the repository you're using and the requirements.txt is configured correctly. 2.12.1 is the latest release of Requests which satisfies the requirements of `requests>=2.2.0`.\r\n\r\nIf you use the command `pip install -r requirements.txt` in the future, version handling should be taken care of for you. `pip` is the standard package manager for Python, so you typically won't have to worry about downloading anything via your browser.\r\n\r\nHopefully this helps.", "@nateprewitt thank you for your help. I still get an error when running 2.12.1, so I'll just stick to 2.2.1 for now. Thank you again.", "This sounds like a [XY problem](http://xyproblem.info/). If the error you get is caused by Requests, you could open an issue here that describes the problem.", "@lutzhorn my issue was solved by @nateprewitt at the beginning of this thread. I don't have any other problems that need to be solved.", "> I still get an error when running 2.12.1, so I'll just stick to 2.2.1 for now.\r\n\r\nThat sounds like a problem to me.", "@lutzhorn it doesn't matter, as long as it works, it works. I don't need 2.12.1, this is only one small program I'm testing out.", "@nateprewitt, @lutzhorn, @sigmavirus24 thank you all for your help. Have a nice day.", "For posterity, it's not a requests problem. It was due to some pretty poor version checking in the project he was using. @PatriotRDX the error you're getting was fixed [here](https://github.com/wummel/linkchecker/commit/c2ce810c3fb00b895a841a7be6b2e78c64e7b042) if you care to follow it, however that fix isn't on PyPi which is why you're still seeing the error.", "@drpoggi thank you for the extra information on my other issue. I've got it working with 2.2.1 so it doesn't matter to me, however, someone else may find it useful." ]
https://api.github.com/repos/psf/requests/issues/3715
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/3715/labels{/name}
https://api.github.com/repos/psf/requests/issues/3715/comments
https://api.github.com/repos/psf/requests/issues/3715/events
https://github.com/psf/requests/issues/3715
190,974,287
MDU6SXNzdWUxOTA5NzQyODc=
3,715
URL has an invalid label when requesting https://r8---sn-q4f7snss.googlevideo.com
{ "avatar_url": "https://avatars.githubusercontent.com/u/15957250?v=4", "events_url": "https://api.github.com/users/aploium/events{/privacy}", "followers_url": "https://api.github.com/users/aploium/followers", "following_url": "https://api.github.com/users/aploium/following{/other_user}", "gists_url": "https://api.github.com/users/aploium/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/aploium", "id": 15957250, "login": "aploium", "node_id": "MDQ6VXNlcjE1OTU3MjUw", "organizations_url": "https://api.github.com/users/aploium/orgs", "received_events_url": "https://api.github.com/users/aploium/received_events", "repos_url": "https://api.github.com/users/aploium/repos", "site_admin": false, "starred_url": "https://api.github.com/users/aploium/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/aploium/subscriptions", "type": "User", "url": "https://api.github.com/users/aploium", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2016-11-22T11:26:42Z
2021-09-08T14:00:29Z
2016-11-22T11:53:29Z
NONE
resolved
```python >>> import requests >>> requests.get("https://r8---sn-q4f7snss.googlevideo.com") Traceback (most recent call last): File "/usr/local/lib/python3.4/dist-packages/requests/models.py", line 370, in prepare_url host = idna.encode(host, uts46=True).decode('utf-8') File "/usr/local/lib/python3.4/dist-packages/requests/packages/idna/core.py", line 355, in encode result.append(alabel(label)) File "/usr/local/lib/python3.4/dist-packages/requests/packages/idna/core.py", line 276, in alabel check_label(label) File "/usr/local/lib/python3.4/dist-packages/requests/packages/idna/core.py", line 253, in check_label raise InvalidCodepoint('Codepoint {0} at position {1} of {2} not allowed'.format(_unot(cp_value), pos+1, repr(label))) requests.packages.idna.core.InvalidCodepoint: Codepoint U+0027 at position 2 of "b'r8---sn-q4f7snss'" not allowed During handling of the above exception, another exception occurred: Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/local/lib/python3.4/dist-packages/requests/api.py", line 70, in get return request('get', url, params=params, **kwargs) File "/usr/local/lib/python3.4/dist-packages/requests/api.py", line 56, in request return session.request(method=method, url=url, **kwargs) File "/usr/local/lib/python3.4/dist-packages/requests/sessions.py", line 474, in request prep = self.prepare_request(req) File "/usr/local/lib/python3.4/dist-packages/requests/sessions.py", line 407, in prepare_request hooks=merge_hooks(request.hooks, self.hooks), File "/usr/local/lib/python3.4/dist-packages/requests/models.py", line 302, in prepare self.prepare_url(url, params) File "/usr/local/lib/python3.4/dist-packages/requests/models.py", line 372, in prepare_url raise InvalidURL('URL has an invalid label.') requests.exceptions.InvalidURL: URL has an invalid label. ``` requests 2.12.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" }
{ "+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/3715/reactions" }
https://api.github.com/repos/psf/requests/issues/3715/timeline
null
completed
null
null
false
[ "When reporting bugs in open source projects *please* check the open issues first before opening a new one. If you had done that you'd have found literally the text \"URL has an invalid label\" next to the word \"Bug\" four entries down.\r\n\r\nDuplicate of #3683, closing accordingly." ]
https://api.github.com/repos/psf/requests/issues/3714
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/3714/labels{/name}
https://api.github.com/repos/psf/requests/issues/3714/comments
https://api.github.com/repos/psf/requests/issues/3714/events
https://github.com/psf/requests/issues/3714
190,812,422
MDU6SXNzdWUxOTA4MTI0MjI=
3,714
Old "cryptography" package causes crash
{ "avatar_url": "https://avatars.githubusercontent.com/u/363982?v=4", "events_url": "https://api.github.com/users/aseering/events{/privacy}", "followers_url": "https://api.github.com/users/aseering/followers", "following_url": "https://api.github.com/users/aseering/following{/other_user}", "gists_url": "https://api.github.com/users/aseering/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/aseering", "id": 363982, "login": "aseering", "node_id": "MDQ6VXNlcjM2Mzk4Mg==", "organizations_url": "https://api.github.com/users/aseering/orgs", "received_events_url": "https://api.github.com/users/aseering/received_events", "repos_url": "https://api.github.com/users/aseering/repos", "site_admin": false, "starred_url": "https://api.github.com/users/aseering/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/aseering/subscriptions", "type": "User", "url": "https://api.github.com/users/aseering", "user_view_type": "public" }
[]
closed
true
null
[]
null
4
2016-11-21T19:28:17Z
2021-09-08T14:00:26Z
2016-11-21T19:29:49Z
NONE
resolved
As of `requests==2.12.1`, `requests[security]` depends on `cryptography>=1.3.4`. That's fine. However, `requests` (without `[security]`) crashes if `cryptography==1.0.2` is installed. This is a perfectly valid configuration of packages according to `pip`; as a user, I would expect it to behave as if I had not specified `[security]` (because I didn't specify it). The specific failure is discussed a bit more here: http://discuss.flexget.com/t/unhandled-error-in-plugin-configure-series-solved/2900 The crash was resolved, also as described at the above link, by running: ``` pip install --upgrade cryptography ``` Uninstalling `cryptography` would probably have worked fine too. The crash appears to be caused because `requests` internally tests for `[security]` by importing a thing which imports its bundled `pyopenssl` which imports `cryptography`; if that succeeds, the extra is used. But with a too-old version of `cryptography`, it imports just fine but it constructs objects that are missing required fields. I can think of a couple approaches here: * Catch this failure and print an error message that more-helpfully explains that your `cryptography` package needs updating * Validate the version/functionality of the `cryptography`package more carefully, and don't enable the `[security]` extra's features if an old version happens to be installed I'd be happy to post a PR for either approach. Right now I'm looking for feedback on whether it's worth addressing this (I'd certainly appreciate it) and on what approach you'd prefer.
{ "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/3714/reactions" }
https://api.github.com/repos/psf/requests/issues/3714/timeline
null
completed
null
null
false
[ "Thanks for this!\r\n\r\nI think this is actually fundamentally a problem with urllib3: urllib3's contrib module should be more aggressively checking for whether it possesses a suitable cryptography module before injecting itself. If you open an issue on that repository, we can take it forward from there.\r\n\r\nThanks again for the report!", "Thanks @Lukasa ! Posted an issue in (what I hope is) the main urllib3 repo. ", "Gentle *ping* here -- this has been fixed upstream; is there anything I can/should be doing to pull the fix in here?", "Nope. Updates to urllib3 are brought in as part of our release process. It'll get merged when it gets merged. " ]
https://api.github.com/repos/psf/requests/issues/3713
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/3713/labels{/name}
https://api.github.com/repos/psf/requests/issues/3713/comments
https://api.github.com/repos/psf/requests/issues/3713/events
https://github.com/psf/requests/pull/3713
190,778,731
MDExOlB1bGxSZXF1ZXN0OTQ2NTYwMDY=
3,713
Restrict URL preparation to HTTP/HTTPS
{ "avatar_url": "https://avatars.githubusercontent.com/u/444071?v=4", "events_url": "https://api.github.com/users/tiran/events{/privacy}", "followers_url": "https://api.github.com/users/tiran/followers", "following_url": "https://api.github.com/users/tiran/following{/other_user}", "gists_url": "https://api.github.com/users/tiran/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/tiran", "id": 444071, "login": "tiran", "node_id": "MDQ6VXNlcjQ0NDA3MQ==", "organizations_url": "https://api.github.com/users/tiran/orgs", "received_events_url": "https://api.github.com/users/tiran/received_events", "repos_url": "https://api.github.com/users/tiran/repos", "site_admin": false, "starred_url": "https://api.github.com/users/tiran/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/tiran/subscriptions", "type": "User", "url": "https://api.github.com/users/tiran", "user_view_type": "public" }
[]
closed
true
null
[]
null
4
2016-11-21T17:05:12Z
2021-09-08T01:21:38Z
2016-11-21T19:13:56Z
CONTRIBUTOR
resolved
Requests treats all URLs starting with the string 'http' as HTTP URLs. Preparation with IDNA breaks non-standard URIs like http+unix. Requests now prepares only URLs with prefix http:// and https://. Signed-off-by: Christian Heimes <[email protected]>
{ "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/3713/reactions" }
https://api.github.com/repos/psf/requests/issues/3713/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/3713.diff", "html_url": "https://github.com/psf/requests/pull/3713", "merged_at": "2016-11-21T19:13:56Z", "patch_url": "https://github.com/psf/requests/pull/3713.patch", "url": "https://api.github.com/repos/psf/requests/pulls/3713" }
true
[ "http+unix is used in Docker, Custodia and SSSD, e.g. https://github.com/latchset/custodia/blob/master/custodia/client.py#L60 with URI like ```http+unix://%2Fvar%2Frun%2Fcustodia.socket/secrets``` for HTTP over Unix sockets on socket file ```/var/run/custodia.socket```.", "This looks entirely reasonable to me, thanks @tiran!", "One note though: can we get a test for this?", "Cool, thanks @tiran! All tests pass, so it seems like it's good to go. Thanks so much! :sparkles: :cake: :sparkles:" ]
https://api.github.com/repos/psf/requests/issues/3712
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/3712/labels{/name}
https://api.github.com/repos/psf/requests/issues/3712/comments
https://api.github.com/repos/psf/requests/issues/3712/events
https://github.com/psf/requests/issues/3712
190,689,249
MDU6SXNzdWUxOTA2ODkyNDk=
3,712
Older changelog entries don't specify urllib3 versions
{ "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
2
2016-11-21T11:25:57Z
2021-09-08T14:00:30Z
2016-11-21T23:10:52Z
CONTRIBUTOR
resolved
Some of the older changelog entries, starting at 2.4.0 and working backward, mention that the urllib3 version was bumped but don't say what version it was bumped to. This can cause mildly annoying dependency resolution problems, especially if you partake in unsavory activities such as: * Installing requests from an RPM source that doesn't vendor urllib3 * Running extremely outdated versions of requests/urllib3 It would be useful if the changelog included these details (as newer changelog entries do). I'm happy to put in the time to do this, but probably not immediately.
{ "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" }
{ "+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/3712/reactions" }
https://api.github.com/repos/psf/requests/issues/3712/timeline
null
completed
null
null
false
[ "So, uh, this won't work as well as you think.\r\n\r\nPrior to v2.6.2 the Requests team didn't necessarily update to specific urllib3 versions but instead updated to the state of the urllib3 master branch. That means there often *is no* urllib3 version that directly matches what Requests was using. So my question is: why does your RPM source not appropriately state this dependency?", "That’s unfortunate.\r\n\r\nI’m not entirely sure where the RPM came from (somebody else put it in the codebase and didn’t update the urllib3 RPM). We’ve managed to resolve the current issue by updating to a newer-ish version, which seems to have resolved the current issues.\r\n\r\nSince there isnβ€˜t a nice mapping of requests versions::urllib3 versions, I guess I’ll leave this for now." ]
https://api.github.com/repos/psf/requests/issues/3711
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/3711/labels{/name}
https://api.github.com/repos/psf/requests/issues/3711/comments
https://api.github.com/repos/psf/requests/issues/3711/events
https://github.com/psf/requests/issues/3711
190,548,208
MDU6SXNzdWUxOTA1NDgyMDg=
3,711
Indna causes issues with Jython due to uts46data.py
{ "avatar_url": "https://avatars.githubusercontent.com/u/12439039?v=4", "events_url": "https://api.github.com/users/johnabooth/events{/privacy}", "followers_url": "https://api.github.com/users/johnabooth/followers", "following_url": "https://api.github.com/users/johnabooth/following{/other_user}", "gists_url": "https://api.github.com/users/johnabooth/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/johnabooth", "id": 12439039, "login": "johnabooth", "node_id": "MDQ6VXNlcjEyNDM5MDM5", "organizations_url": "https://api.github.com/users/johnabooth/orgs", "received_events_url": "https://api.github.com/users/johnabooth/received_events", "repos_url": "https://api.github.com/users/johnabooth/repos", "site_admin": false, "starred_url": "https://api.github.com/users/johnabooth/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/johnabooth/subscriptions", "type": "User", "url": "https://api.github.com/users/johnabooth", "user_view_type": "public" }
[]
closed
true
null
[]
null
8
2016-11-20T09:25:15Z
2021-09-08T13:05:37Z
2016-12-21T13:26:13Z
NONE
resolved
Unable to use requests in Jython 2.7 without some patches to Indna. I've made these at https://github.com/METAVERO/idna and notified main repo owners.
{ "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/3711/reactions" }
https://api.github.com/repos/psf/requests/issues/3711/timeline
null
completed
null
null
false
[ "Thanks for letting us know. You should strongly consider opening a pull request on the idna repository instead of just an issue.\n", "Hi Lukasa, I did open a pull request on my repository and then closed it. A little new to Github -- do I need to open another pull request or are you able to review the history in that repo?\n", "It's harder to review the history. It would be easier if you opened a pull request against the _original_ repository though. \n", "Please review - https://github.com/METAVERO/idna/pull/1\n\nI re-did the repo via a fork from original since it wasn't setup properly before. There is now an open pull request to the main Idna project.\n", "@johnabooth It doesn't look like you've actually opened a pull requests against the upstream repo [kjd/idna](https://github.com/kjd/idna). You'll need to visit that repo, use the \"New Pull Request\" button and select your branch `johnabooth-jython27-fix`. The maintainer of that repo should be able to perform a review on your proposed changes.", "https://github.com/kjd/idna/pull/33 was merged. It splits the large piece of code to smaller ones and should fix the Jython issue.\r\n\r\n`idna` released `https://github.com/kjd/idna/releases/tag/v2.2`, so if the dependency is adjusted, #3711 should be resolved. Should the entry in `setupy.py`'s `extras_require['security']` be increased to 2.2?", "I don't think we need to do that, no. Jython users will simply get the newest version as appropriate.", "Thanks all.\n\nSent from my iPhone\n\n> On Dec 21, 2016, at 7:26 AM, Cory Benfield <[email protected]> wrote:\n> \n> I don't think we need to do that, no. Jython users will simply get the newest version as appropriate.\n> \n> β€”\n> You are receiving this because you were mentioned.\n> Reply to this email directly, view it on GitHub, or mute the thread.\n> \n" ]
https://api.github.com/repos/psf/requests/issues/3710
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/3710/labels{/name}
https://api.github.com/repos/psf/requests/issues/3710/comments
https://api.github.com/repos/psf/requests/issues/3710/events
https://github.com/psf/requests/issues/3710
190,543,530
MDU6SXNzdWUxOTA1NDM1MzA=
3,710
'Extensions' object has no attribute 'get_extension_for_class'
{ "avatar_url": "https://avatars.githubusercontent.com/u/1267035?v=4", "events_url": "https://api.github.com/users/youyanggu/events{/privacy}", "followers_url": "https://api.github.com/users/youyanggu/followers", "following_url": "https://api.github.com/users/youyanggu/following{/other_user}", "gists_url": "https://api.github.com/users/youyanggu/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/youyanggu", "id": 1267035, "login": "youyanggu", "node_id": "MDQ6VXNlcjEyNjcwMzU=", "organizations_url": "https://api.github.com/users/youyanggu/orgs", "received_events_url": "https://api.github.com/users/youyanggu/received_events", "repos_url": "https://api.github.com/users/youyanggu/repos", "site_admin": false, "starred_url": "https://api.github.com/users/youyanggu/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/youyanggu/subscriptions", "type": "User", "url": "https://api.github.com/users/youyanggu", "user_view_type": "public" }
[]
closed
true
null
[]
null
5
2016-11-20T07:02:50Z
2021-09-08T14:00:27Z
2016-11-20T09:53:33Z
NONE
resolved
This occurred after I upgraded form 2.11.1 to 2.12.1. The error occurs arbitrarily for the URLs I tried. > requests.get('http://google.com') # works > requests.get('http://www.google.com') # works > requests.get('https://google.com') # does not work > requests.get('https://www.google.com') # does not work > requests.get('http://amazon.com') # sometimes works > requests.get('http://www.amazon.com') # does not work > requests.get('https://amazon.com') # does not work > requests.get('https://www.amazon.com') # does not work Below is the error: ```python /usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/connectionpool.pyc in _make_request(self, conn, method, url, timeout, chunked, **httplib_request_kw) 348 # Trigger any extra validation we need to do. 349 try: --> 350 self._validate_conn(conn) 351 except (SocketTimeout, BaseSSLError) as e: 352 # Py2 raises this as a BaseSSLError, Py3 raises it as socket timeout. /usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/connectionpool.pyc in _validate_conn(self, conn) 833 # Force connect early to allow us to validate the connection. 834 if not getattr(conn, 'sock', None): # AppEngine might not have `.sock` --> 835 conn.connect() 836 837 if not conn.is_verified: /usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/connection.pyc in connect(self) 328 elif context.verify_mode != ssl.CERT_NONE \ 329 and self.assert_hostname is not False: --> 330 cert = self.sock.getpeercert() 331 if not cert.get('subjectAltName', ()): 332 warnings.warn(( /usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/contrib/pyopenssl.pyc in getpeercert(self, binary_form) 322 (('commonName', x509.get_subject().CN),), 323 ), --> 324 'subjectAltName': get_subj_alt_name(x509) 325 } 326 /usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/contrib/pyopenssl.pyc in get_subj_alt_name(peer_cert) 169 # faster than looping in Python) 170 try: --> 171 ext = cert.extensions.get_extension_for_class( 172 x509.SubjectAlternativeName 173 ).value AttributeError: 'Extensions' object has no attribute 'get_extension_for_class' ``` Tried it on Ubuntu/Python 2.7.10 and macOS/Python 2.7.11. I have OpenSSL 1.0.2 for both. Same error on both.
{ "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/3710/reactions" }
https://api.github.com/repos/psf/requests/issues/3710/timeline
null
completed
null
null
false
[ "What version of `cryptography` do you have installed please?\n", "I have cryptography 1.0.2. Upgrading to the latest 1.5.3 solved the problem. Thanks!\n", "No problem! For anyone looking at this issue in future, our minimum cryptography version is currently 1.3.4, and that is expressed in the `'security'` extra for requests at this time.\n", "May the gods bless you for this post", "@andreleotorres πŸ™πŸΌ" ]
https://api.github.com/repos/psf/requests/issues/3709
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/3709/labels{/name}
https://api.github.com/repos/psf/requests/issues/3709/comments
https://api.github.com/repos/psf/requests/issues/3709/events
https://github.com/psf/requests/pull/3709
190,536,005
MDExOlB1bGxSZXF1ZXN0OTQ1MDUwOTA=
3,709
Added new function that returns json output in a pretty printed string form.
{ "avatar_url": "https://avatars.githubusercontent.com/u/3707038?v=4", "events_url": "https://api.github.com/users/rmhasan/events{/privacy}", "followers_url": "https://api.github.com/users/rmhasan/followers", "following_url": "https://api.github.com/users/rmhasan/following{/other_user}", "gists_url": "https://api.github.com/users/rmhasan/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/rmhasan", "id": 3707038, "login": "rmhasan", "node_id": "MDQ6VXNlcjM3MDcwMzg=", "organizations_url": "https://api.github.com/users/rmhasan/orgs", "received_events_url": "https://api.github.com/users/rmhasan/received_events", "repos_url": "https://api.github.com/users/rmhasan/repos", "site_admin": false, "starred_url": "https://api.github.com/users/rmhasan/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/rmhasan/subscriptions", "type": "User", "url": "https://api.github.com/users/rmhasan", "user_view_type": "public" }
[]
closed
true
null
[]
null
6
2016-11-20T03:03:26Z
2021-09-08T01:21:39Z
2016-11-20T07:45:36Z
CONTRIBUTOR
resolved
The function sjson in the Response class will return a json object in string form. Unless provided arguments, it will return a pretty printed string, when printed is human readable. You can look at the docs for the json module's dumps object to know which arguments to send to the sjson function for custom output.
{ "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/3709/reactions" }
https://api.github.com/repos/psf/requests/issues/3709/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/3709.diff", "html_url": "https://github.com/psf/requests/pull/3709", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/3709.patch", "url": "https://api.github.com/repos/psf/requests/pulls/3709" }
true
[ "![out](https://cloud.githubusercontent.com/assets/3707038/20460056/30a5c37a-aea5-11e6-923f-ecf4277e1907.png)\nThis is what the output should look like.\n", "I believe requests is in an API freeze at this point, especially when user code could do the same thing with `r.content` and their preferred indentation level and separators. Contributions are always welcome, but API changes are the type of thing that would be better served by raising an issue and getting feedback on the interface, before you spend your time writing the code. \n\nEDIT: Of course I'm not a requests maintainer, I'm just trying to give feedback based on what I've seen. Some interface of this type may well get accepted. \n", "@drpoggi Can you explain how users can create the same output with r.content. The output from r.content is different from r.json(). Also how do you provide preferred indentation level and separators. As far as I know it doesn't take any arguments. You can provide preferred indentation level and separators to r.sjson through key value arguments. You can look at the documentation for the dumps function in the json module to give custom arguments. The whole point of creating the function was so that users can get the json object in a human readable form with simple readable code. Also how do you know there is a freeze in requests. Was there a post somewhere, or is it in the documentation somewhere?\n\nEDIT: Also thanks for the feedback.\n", "@rmhasan, thanks for your interest in contributing to Requests. You can find information about the freeze and other contributing topics in Requests [Contributor's Guide](http://docs.python-requests.org/en/master/dev/contributing). The specific information you're looking for is under [feature requests](http://docs.python-requests.org/en/master/dev/contributing/#feature-requests).\n", "@nateprewitt Thanks. \n", "Thanks for this, but ultimately this duplicates the logic of the `pprint` module in the standard library. Because of that, and because the potential user base is fairly limited, I don't think this feature warrants an exception to the API freeze.\n\nThanks for your contribution though!\n" ]
https://api.github.com/repos/psf/requests/issues/3708
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/3708/labels{/name}
https://api.github.com/repos/psf/requests/issues/3708/comments
https://api.github.com/repos/psf/requests/issues/3708/events
https://github.com/psf/requests/issues/3708
190,438,200
MDU6SXNzdWUxOTA0MzgyMDA=
3,708
Allow domains instead urls
{ "avatar_url": "https://avatars.githubusercontent.com/u/20229528?v=4", "events_url": "https://api.github.com/users/sihaelov/events{/privacy}", "followers_url": "https://api.github.com/users/sihaelov/followers", "following_url": "https://api.github.com/users/sihaelov/following{/other_user}", "gists_url": "https://api.github.com/users/sihaelov/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/sihaelov", "id": 20229528, "login": "sihaelov", "node_id": "MDQ6VXNlcjIwMjI5NTI4", "organizations_url": "https://api.github.com/users/sihaelov/orgs", "received_events_url": "https://api.github.com/users/sihaelov/received_events", "repos_url": "https://api.github.com/users/sihaelov/repos", "site_admin": false, "starred_url": "https://api.github.com/users/sihaelov/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/sihaelov/subscriptions", "type": "User", "url": "https://api.github.com/users/sihaelov", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2016-11-18T22:34:14Z
2021-09-08T14:00:31Z
2016-11-18T22:40:24Z
NONE
resolved
``` requests.get('google.com') requests.exceptions.MissingSchema: Invalid URL 'google.com': No schema supplied. Perhaps you meant http://google.com? ``` Why does it not allow use domains? It looks as the simple task and I can do it. What do you think? I searched similar issues but did not find.
{ "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/3708/reactions" }
https://api.github.com/repos/psf/requests/issues/3708/timeline
null
completed
null
null
false
[ "It's impossible to know whether you wanted us to use HTTP or HTTPs, and in the face of uncertainty (especially when privacy is concerned) it's significantly more correct to not guess.\n\nYou can absolutely implement whatever behaviour you're thinking of in a wrapper. There's no need and no desire for it to live in Requests.\n" ]
https://api.github.com/repos/psf/requests/issues/3707
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/3707/labels{/name}
https://api.github.com/repos/psf/requests/issues/3707/comments
https://api.github.com/repos/psf/requests/issues/3707/events
https://github.com/psf/requests/issues/3707
190,200,325
MDU6SXNzdWUxOTAyMDAzMjU=
3,707
r=request.put(url,json={...}), put doesn't accept json as argument while post does?
{ "avatar_url": "https://avatars.githubusercontent.com/u/8951837?v=4", "events_url": "https://api.github.com/users/gladwig2/events{/privacy}", "followers_url": "https://api.github.com/users/gladwig2/followers", "following_url": "https://api.github.com/users/gladwig2/following{/other_user}", "gists_url": "https://api.github.com/users/gladwig2/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/gladwig2", "id": 8951837, "login": "gladwig2", "node_id": "MDQ6VXNlcjg5NTE4Mzc=", "organizations_url": "https://api.github.com/users/gladwig2/orgs", "received_events_url": "https://api.github.com/users/gladwig2/received_events", "repos_url": "https://api.github.com/users/gladwig2/repos", "site_admin": false, "starred_url": "https://api.github.com/users/gladwig2/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/gladwig2/subscriptions", "type": "User", "url": "https://api.github.com/users/gladwig2", "user_view_type": "public" }
[]
closed
true
null
[]
null
5
2016-11-17T23:59:49Z
2021-09-08T14:00:32Z
2016-11-18T08:34:18Z
NONE
resolved
http://stackoverflow.com/questions/9733638/post-json-using-python-requests shows r = requests.post('http://httpbin.org/post', json={"key": "value"}) but trying the same thing with put did not seem to work. had to #r = session.put(url, json=schema) (should work!) headers = {'Content-type': 'application/json'} r = session.put(url,data=json.dumps(jsonschema),headers=headers)
{ "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/3707/reactions" }
https://api.github.com/repos/psf/requests/issues/3707/timeline
null
completed
null
null
false
[ "Hey @githubnovice, I'm unfortunately unable to reproduce this issue with the current information. Could you please provide the version of Requests you're using, the exact request (with parameters), and possibly the traceback you're seeing?\n\nThese are the examples I tried.\n\n``` python\n>>> import requests\n>>> resp = requests.put('http://httpbin.org/put', json={\"key\": \"value\"})\n>>> resp.json()\n{u'url': u'http://httpbin.org/put', ... u'headers': {u'Content-Length': u'16', u'Accept-Encoding': u'gzip, deflate', u'Accept': u'*/*', u'User-Agent': u'python-requests/2.12.0', u'Host': u'httpbin.org', u'Content-Type': u'application/json'}, u'json': {u'key': u'value'}, u'data': u'{\"key\": \"value\"}'}\n\n>>> resp = requests.Session().put('http://httpbin.org/put', json={\"key\": \"value\"})\n>>> resp.json()\n{u'url': u'http://httpbin.org/put', ... u'headers': {u'Content-Length': u'16', u'Accept-Encoding': u'gzip, deflate', u'Accept': u'*/*', u'User-Agent': u'python-requests/2.12.0', u'Host': u'httpbin.org', u'Content-Type': u'application/json'}, u'json': {u'key': u'value'}, u'data': u'{\"key\": \"value\"}'}\n```\n", "## Hi Nate: thanks for the fast response!\n\nTypeError Traceback (most recent call last)\n/home/gladwig/GNS3/Python/mkint.py in <module>()\n 105\n 106 if **name** == \"**main**\":\n--> 107 main()\n\n/home/gladwig/GNS3/Python/mkint.py in main()\n 94 #print json.dumps(sla, indent=4, separators=(',', ': '))\n 95 #return\n---> 96 put_l2interface_state(s,controller_url,\"gigabitethernet1\",False)\n 97 l2 = get_l2interface_state(s,controller_url,\"gigabitethernet1\")\n 98 print \"g1 = \"\n\n/home/gladwig/GNS3/Python/mkint.py in put_l2interface_state(session, c_url, interface, enable)\n 61 url = c_url + 'api/v1/interfaces/' + interface +'/state'\n 62 pdb.set_trace()\n---> 63 resp = session.put(url, json=schema) #(should work!)\n 64 #headers = {'Content-type': 'application/json'}\n 65 #resp = session.put(url,data=json.dumps(schema),headers=headers)\n\n/usr/lib/python2.7/dist-packages/requests/sessions.pyc in put(self, url, data, *_kwargs)\n 505 \"\"\"\n 506\n--> 507 return self.request('PUT', url, data=data, *_kwargs)\n 508\n 509 def patch(self, url, data=None, **kwargs):\n\nTypeError: request() got an unexpected keyword argument 'json'\n\nThe version is: gladwig@ovs-linux-3:~/GNS3/Python$ pip show requests\nName: requests\nVersion: 2.12.1\nSummary: Python HTTP for Humans.\nThe variables before the call are:\n-> resp = session.put(url, json=schema) #(should work!)\n(Pdb) print url\nhttps://192.168.1.181:55443/api/v1/interfaces/gigabitethernet1/state\n(Pdb) print schema\n{'if-name': 'gigabitethernet1', 'enabled': False}\n(Pdb)\n\nFrom: Nate Prewitt [mailto:[email protected]]\nSent: Thursday, November 17, 2016 7:56 PM\nTo: kennethreitz/requests [email protected]\nCc: Geoff Ladwig [email protected]; Mention [email protected]\nSubject: Re: [kennethreitz/requests] r=request.put(url,json={...}), put doesn't accept json as argument while post does? (#3707)\n\nHey @githubnovicehttps://github.com/githubnovice, I'm unfortunately unable to reproduce this issue with the current information. Could you please provide the version of Requests you're using, the exact request (with parameters), and possibly the traceback you're seeing?\n\nThese are the examples I tried.\n\n> > > import requests\n> > > \n> > > resp = requests.put('http://httpbin.org/put', json={\"key\": \"value\"})\n> > > \n> > > resp.json()\n\n{u'url': u'http://httpbin.org/put', ... u'headers': {u'Content-Length': u'16', u'Accept-Encoding': u'gzip, deflate', u'Accept': u'_/_', u'User-Agent': u'python-requests/2.12.0', u'Host': u'httpbin.org', u'Content-Type': u'application/json'}, u'json': {u'key': u'value'}, u'data': u'{\"key\": \"value\"}'}\n\n> > > resp = requests.Session().put('http://httpbin.org/put', json={\"key\": \"value\"})\n> > > \n> > > resp.json()\n\n{u'url': u'http://httpbin.org/put', ... u'headers': {u'Content-Length': u'16', u'Accept-Encoding': u'gzip, deflate', u'Accept': u'_/_', u'User-Agent': u'python-requests/2.12.0', u'Host': u'httpbin.org', u'Content-Type': u'application/json'}, u'json': {u'key': u'value'}, u'data': u'{\"key\": \"value\"}'}\n\nβ€”\nYou are receiving this because you were mentioned.\nReply to this email directly, view it on GitHubhttps://github.com/kennethreitz/requests/issues/3707#issuecomment-261417796, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AIiYHe1b5pcybkaEAEMr_azFPMAh8xm2ks5q_PeHgaJpZM4K19xY.\n", "Hmm, so I'm still unable to reproduce this. I think I've got an idea of what the issue you're hitting now is though.\n\nIf you'll note the traceback you provided, the call to `return self.request('PUT', url, data=data, **kwargs)` in sessions.py occurs on line 507. The last time this line existed in that region of the code was in Requests 2.4.0 which was prior to the existence of the `json` param. You almost certainly have multiple copies of requests on your system and the older one is taking precedence here.\n\nI would encourage running your code into a [virtualenv](https://virtualenv.pypa.io/en/stable/), if you're not already using one. You may also consider taking a look at what's installed in /usr/lib/python2.7/dist-packages/requests. My guess is it will be Requests 2.4, or at least .pyc files containing that code. I'm afraid that's all the help I can provide without a simpler and complete reproduction example.\n", "You are probably right. I just recently load virtualenv (pyenv?) and am not expert at using it..\nI should have suspected it, but I just pip’d request and haven’t changed versions.. I’ll look further..\nGeoff\n\nFrom: Nate Prewitt [mailto:[email protected]]\nSent: Thursday, November 17, 2016 8:43 PM\nTo: kennethreitz/requests [email protected]\nCc: Geoff Ladwig [email protected]; Mention [email protected]\nSubject: Re: [kennethreitz/requests] r=request.put(url,json={...}), put doesn't accept json as argument while post does? (#3707)\n\nHmm, so I'm still unable to reproduce this. I think I've got an idea of what the issue you're hitting now is though.\n\nIf you'll note the traceback you provided, the call to return self.request('PUT', url, data=data, **kwargs) in sessions.py occurs on line 507. The last time this line existed in that region of the code was in Requests 2.4.0 which was prior to the existence of the json param. You almost certainly have multiple copies of requests on your system and the older one is taking precedence here.\n\nI would encourage running your code into a virtualenvhttps://virtualenv.pypa.io/en/stable/, if you're not already using one. You may also consider taking a look at what's installed in /usr/lib/python2.7/dist-packages/requests. My guess is it will be Requests 2.4, or at least .pyc files containing that code. I'm afraid that's all the help I can provide without a simpler and complete reproduction example.\n\nβ€”\nYou are receiving this because you were mentioned.\nReply to this email directly, view it on GitHubhttps://github.com/kennethreitz/requests/issues/3707#issuecomment-261425415, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AIiYHUdEmluX7Y-Dwq3TV9wjm1m5xU8Qks5q_QKZgaJpZM4K19xY.\n", "Ok. You are right.\nThis was a problem in my lib path.\nThanks,\nGeoff\n\nFrom: Nate Prewitt [mailto:[email protected]]\nSent: Thursday, November 17, 2016 8:43 PM\nTo: kennethreitz/requests [email protected]\nCc: Geoff Ladwig [email protected]; Mention [email protected]\nSubject: Re: [kennethreitz/requests] r=request.put(url,json={...}), put doesn't accept json as argument while post does? (#3707)\n\nHmm, so I'm still unable to reproduce this. I think I've got an idea of what the issue you're hitting now is though.\n\nIf you'll note the traceback you provided, the call to return self.request('PUT', url, data=data, **kwargs) in sessions.py occurs on line 507. The last time this line existed in that region of the code was in Requests 2.4.0 which was prior to the existence of the json param. You almost certainly have multiple copies of requests on your system and the older one is taking precedence here.\n\nI would encourage running your code into a virtualenvhttps://virtualenv.pypa.io/en/stable/, if you're not already using one. You may also consider taking a look at what's installed in /usr/lib/python2.7/dist-packages/requests. My guess is it will be Requests 2.4, or at least .pyc files containing that code. I'm afraid that's all the help I can provide without a simpler and complete reproduction example.\n\nβ€”\nYou are receiving this because you were mentioned.\nReply to this email directly, view it on GitHubhttps://github.com/kennethreitz/requests/issues/3707#issuecomment-261425415, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AIiYHUdEmluX7Y-Dwq3TV9wjm1m5xU8Qks5q_QKZgaJpZM4K19xY.\n" ]
https://api.github.com/repos/psf/requests/issues/3706
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/3706/labels{/name}
https://api.github.com/repos/psf/requests/issues/3706/comments
https://api.github.com/repos/psf/requests/issues/3706/events
https://github.com/psf/requests/issues/3706
190,180,090
MDU6SXNzdWUxOTAxODAwOTA=
3,706
requests not able to validate the self signed certificate but i can use it using curl
{ "avatar_url": "https://avatars.githubusercontent.com/u/12552530?v=4", "events_url": "https://api.github.com/users/kmala/events{/privacy}", "followers_url": "https://api.github.com/users/kmala/followers", "following_url": "https://api.github.com/users/kmala/following{/other_user}", "gists_url": "https://api.github.com/users/kmala/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kmala", "id": 12552530, "login": "kmala", "node_id": "MDQ6VXNlcjEyNTUyNTMw", "organizations_url": "https://api.github.com/users/kmala/orgs", "received_events_url": "https://api.github.com/users/kmala/received_events", "repos_url": "https://api.github.com/users/kmala/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kmala/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kmala/subscriptions", "type": "User", "url": "https://api.github.com/users/kmala", "user_view_type": "public" }
[]
closed
true
null
[]
null
13
2016-11-17T22:15:30Z
2021-09-08T14:00:30Z
2016-11-21T17:29:20Z
NONE
resolved
``` >>> requests.get('https://10.0.0.1:443/api', verify='/run/secrets/kubernetes.io/serviceaccount/ca.crt') Traceback (most recent call last): File "/usr/local/lib/python3.5/dist-packages/requests/packages/urllib3/contrib/pyopenssl.py", line 417, in wrap_socket cnx.do_handshake() File "/usr/local/lib/python3.5/dist-packages/OpenSSL/SSL.py", line 1426, in do_handshake self._raise_ssl_error(self._ssl, result) File "/usr/local/lib/python3.5/dist-packages/OpenSSL/SSL.py", line 1174, in _raise_ssl_error _raise_current_error() File "/usr/local/lib/python3.5/dist-packages/OpenSSL/_util.py", line 48, in exception_from_error_queue raise exception_type(errors) OpenSSL.SSL.Error: [('SSL routines', 'ssl3_get_server_certificate', 'certificate verify failed')] During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/local/lib/python3.5/dist-packages/requests/packages/urllib3/connectionpool.py", line 594, in urlopen chunked=chunked) File "/usr/local/lib/python3.5/dist-packages/requests/packages/urllib3/connectionpool.py", line 350, in _make_request self._validate_conn(conn) File "/usr/local/lib/python3.5/dist-packages/requests/packages/urllib3/connectionpool.py", line 835, in _validate_conn conn.connect() File "/usr/local/lib/python3.5/dist-packages/requests/packages/urllib3/connection.py", line 323, in connect ssl_context=context) File "/usr/local/lib/python3.5/dist-packages/requests/packages/urllib3/util/ssl_.py", line 324, in ssl_wrap_socket return context.wrap_socket(sock, server_hostname=server_hostname) File "/usr/local/lib/python3.5/dist-packages/requests/packages/urllib3/contrib/pyopenssl.py", line 424, in wrap_socket raise ssl.SSLError('bad handshake: %r' % e) ssl.SSLError: ("bad handshake: Error([('SSL routines', 'ssl3_get_server_certificate', 'certificate verify failed')],)",) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/local/lib/python3.5/dist-packages/requests/adapters.py", line 423, in send timeout=timeout File "/usr/local/lib/python3.5/dist-packages/requests/packages/urllib3/connectionpool.py", line 624, in urlopen raise SSLError(e) requests.packages.urllib3.exceptions.SSLError: ("bad handshake: Error([('SSL routines', 'ssl3_get_server_certificate', 'certificate verify failed')],)",) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/local/lib/python3.5/dist-packages/requests/api.py", line 70, in get return request('get', url, params=params, **kwargs) File "/usr/local/lib/python3.5/dist-packages/requests/api.py", line 56, in request return session.request(method=method, url=url, **kwargs) File "/usr/local/lib/python3.5/dist-packages/requests/sessions.py", line 488, in request resp = self.send(prep, **send_kwargs) File "/usr/local/lib/python3.5/dist-packages/requests/sessions.py", line 609, in send r = adapter.send(request, **kwargs) File "/usr/local/lib/python3.5/dist-packages/requests/adapters.py", line 497, in send raise SSLError(e, request=request) requests.exceptions.SSLError: ("bad handshake: Error([('SSL routines', 'ssl3_get_server_certificate', 'certificate verify failed')],)",) ``` Python 3.5.2 pyOpenSSL==16.2.0 requests==2.12.1 ``` $ openssl verify /var/run/secrets/kubernetes.io/serviceaccount/ca.crt /var/run/secrets/kubernetes.io/serviceaccount/ca.crt: CN = acsk8sca error 18 at 0 depth lookup:self signed certificate OK ``` with curl ``` curl -I -X GET https://10.0.0.1:443/api --header "Authorization: Bearer $TOKEN" --cacert /run/secrets/kubernetes.io/serviceaccount/ca.crt HTTP/1.1 200 OK Content-Type: application/json Date: Thu, 17 Nov 2016 21:57:41 GMT Content-Length: 183 ```
{ "avatar_url": "https://avatars.githubusercontent.com/u/12552530?v=4", "events_url": "https://api.github.com/users/kmala/events{/privacy}", "followers_url": "https://api.github.com/users/kmala/followers", "following_url": "https://api.github.com/users/kmala/following{/other_user}", "gists_url": "https://api.github.com/users/kmala/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kmala", "id": 12552530, "login": "kmala", "node_id": "MDQ6VXNlcjEyNTUyNTMw", "organizations_url": "https://api.github.com/users/kmala/orgs", "received_events_url": "https://api.github.com/users/kmala/received_events", "repos_url": "https://api.github.com/users/kmala/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kmala/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kmala/subscriptions", "type": "User", "url": "https://api.github.com/users/kmala", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/3706/reactions" }
https://api.github.com/repos/psf/requests/issues/3706/timeline
null
completed
null
null
false
[ "Can you show me the output of `openssl x509 -in /var/run/secrets/kubernetes.io/serviceaccount/ca.crt -noout -text` and the equivalent command run on the certificate being offered by 10.0.0.1 please?\n", "Client:\n\n```\nroot@deis-controller-1217413231-almny:/app# openssl x509 -in /var/run/secrets/kubernetes.io/serviceaccount/ca.crt -noout -text\nCertificate:\n Data:\n Version: 3 (0x2)\n Serial Number: 6985765230565584782 (0x60f26c770c22ef8e)\n Signature Algorithm: sha256WithRSAEncryption\n Issuer: CN=acsk8sca\n Validity\n Not Before: Nov 17 00:00:00 2016 GMT\n Not After : Nov 17 00:00:00 2018 GMT\n Subject: CN=acsk8sca\n Subject Public Key Info:\n Public Key Algorithm: rsaEncryption\n Public-Key: (2048 bit)\n Modulus:\n 00:aa:35:75:dc:40:18:0d:23:bb:b4:f4:04:b0:42:\n 14:70:4a:03:de:15:9b:60:e7:c2:35:a2:26:fd:ac:\n f2:f1:46:dd:9a:03:e3:2e:e9:a4:b6:74:f6:3f:2a:\n e0:1d:7a:21:e4:66:46:d8:66:8a:ea:c9:5b:af:c8:\n 88:f5:9b:a6:54:0e:cd:94:51:18:15:1f:e2:8a:0e:\n bc:e1:fe:4a:f3:96:e8:8c:7e:f5:02:62:b5:20:ab:\n ba:2f:d0:43:96:a9:06:fa:8e:d0:f5:15:18:cd:5a:\n 97:72:fd:80:47:33:d2:be:4c:4c:53:53:1d:16:7d:\n af:5d:a4:cc:29:60:9d:b5:6b:c2:4b:04:04:e0:c4:\n ea:0c:7c:2d:74:d0:47:8a:c5:70:fe:7f:74:67:80:\n ba:67:8f:2e:f1:f1:d6:02:ad:26:b1:3a:02:41:8d:\n ab:b5:a1:d1:60:0e:d5:65:89:e7:e1:8a:5b:e7:80:\n a3:2d:d3:ca:1a:22:bd:bc:46:c1:92:6f:88:b7:51:\n e0:71:85:52:49:ba:a6:c8:c3:50:2d:ee:8f:c2:2e:\n 3e:f2:62:b5:b5:31:08:6a:ec:83:25:4f:45:9e:39:\n b2:3c:b4:de:43:1c:eb:fd:bc:bc:0b:2b:a7:82:49:\n d8:03:22:e2:b9:f9:00:52:49:d8:3a:b0:38:a1:11:\n 72:cf\n Exponent: 65537 (0x10001)\n X509v3 extensions:\n X509v3 Authority Key Identifier: \n keyid:A9:16:EE:AB:29:FD:4E:96:97:C7:DB:E5:15:96:C3:41:DC:12:16:B7\n DirName:/CN=acsk8sca\n serial:60:F2:6C:77:0C:22:EF:8E\n\n X509v3 Subject Key Identifier: \n A9:16:EE:AB:29:FD:4E:96:97:C7:DB:E5:15:96:C3:41:DC:12:16:B7\n X509v3 Basic Constraints: critical\n CA:TRUE\n Signature Algorithm: sha256WithRSAEncryption\n 0b:aa:35:c1:5b:b3:97:a7:1a:34:d5:3d:08:c8:45:28:5d:95:\n 70:8f:ec:e1:c0:08:31:b4:cc:fe:2b:c3:16:46:d2:d4:77:19:\n 14:f5:02:67:05:b4:0b:0c:b4:5c:5a:c2:76:f3:73:92:bb:5b:\n 13:5b:8c:56:45:e1:6c:08:c0:56:eb:cc:d0:68:f9:4f:5a:8a:\n 5d:21:d2:31:56:fd:36:06:8f:71:3b:06:4a:5a:df:e3:b9:73:\n a8:86:59:59:aa:3b:47:04:14:71:a8:ac:09:4b:b0:03:08:22:\n aa:71:dc:16:b2:aa:9a:40:ac:d5:66:d9:5c:ec:c4:19:12:c7:\n 27:23:3b:d7:fe:20:87:39:f8:f1:46:3d:4f:bd:c8:10:9f:5c:\n ff:a9:74:e8:f3:6b:37:3c:f7:d0:48:b8:29:7d:42:da:be:15:\n ac:60:2e:cf:ca:9e:3e:08:15:57:32:ac:de:87:f8:c7:a9:87:\n 5d:fc:89:16:30:fa:d9:a7:a0:65:ba:03:33:aa:b3:15:72:d0:\n 6f:7d:94:6d:9a:cf:18:b4:82:a0:2a:38:04:b5:76:53:f8:e0:\n 35:4b:f3:6f:ce:db:c4:19:c8:1e:fd:d6:7f:15:b8:79:92:9f:\n 38:31:21:13:8a:36:24:84:a4:5c:e1:20:1a:f0:f9:e2:55:6b:\n 0d:66:02:c2\n```\n\nserver :\n\n```\nopenssl x509 -in /etc/kubernetes/certs/apiserver.crt -noout -text\nCertificate:\n Data:\n Version: 3 (0x2)\n Serial Number: 7125429247776946919 (0x62e29c2611ec7ae7)\n Signature Algorithm: sha256WithRSAEncryption\n Issuer: CN=acsk8sca\n Validity\n Not Before: Nov 17 00:00:00 2016 GMT\n Not After : Nov 17 00:00:00 2018 GMT\n Subject: CN=apiserver\n Subject Public Key Info:\n Public Key Algorithm: rsaEncryption\n Public-Key: (2048 bit)\n Modulus:\n 00:af:47:25:b5:d6:0d:2e:79:65:a3:e8:a7:6b:48:\n 53:b8:d6:0a:d1:fd:85:54:cb:ec:f9:5a:a2:75:6e:\n fc:95:97:02:db:aa:1c:ca:8a:60:c7:28:a7:9e:49:\n b7:94:16:c1:24:67:fb:08:82:cd:79:45:88:5a:a3:\n 8d:59:3d:3c:ea:d7:55:cc:76:a3:5a:e1:0a:4d:21:\n c6:c7:f2:a5:37:ff:87:b0:38:0c:a1:19:7d:65:dd:\n 5e:55:2d:1c:f6:05:80:d7:80:cc:e3:89:8b:7c:69:\n fa:74:4f:d6:aa:12:ab:a1:7c:60:34:7a:dd:ae:29:\n e0:b9:4a:df:da:36:2c:e2:d7:d9:bb:b6:c8:0d:54:\n 87:19:ca:59:e5:c3:d9:02:7b:df:e1:16:33:09:e7:\n 25:6c:0d:ed:3d:99:48:13:8a:72:f0:87:bb:ca:9c:\n 87:64:81:27:53:bb:34:2a:07:80:38:3b:d0:3a:36:\n 24:15:52:68:c6:df:06:6c:18:4a:b2:ce:72:0a:72:\n 29:de:e1:09:e1:5b:ee:60:0a:4b:5f:14:0d:9e:07:\n 3d:32:0a:c2:65:9b:e6:d2:f5:dd:4a:e5:e8:0a:c8:\n 52:87:18:ef:af:46:f6:45:51:05:f3:3b:df:0a:f0:\n f3:89:e4:b3:1e:c6:39:fa:c2:e4:0b:da:0b:ca:ba:\n 32:ab\n Exponent: 65537 (0x10001)\n X509v3 extensions:\n X509v3 Authority Key Identifier: \n keyid:A9:16:EE:AB:29:FD:4E:96:97:C7:DB:E5:15:96:C3:41:DC:12:16:B7\n DirName:/CN=acsk8sca\n serial:71:10:DD:F3:88:93:0D:A0\n\n X509v3 Subject Key Identifier: \n FA:2E:D5:34:E5:8E:F4:A0:3C:86:5A:85:5F:2E:4E:E2:31:46:2A:92\n X509v3 Basic Constraints: critical\n CA:FALSE\n X509v3 Subject Alternative Name: \n DNS:kmalamgmt.centralus.cloudapp.azure.com, IP Address:10.240.255.5, IP Address:10.0.0.1\n Signature Algorithm: sha256WithRSAEncryption\n 46:69:ec:5f:a9:f9:bc:e9:26:5a:97:a9:05:45:3b:a4:46:ae:\n d2:7d:a1:3f:ff:43:97:7c:9e:0f:13:87:4e:28:4b:01:dd:e9:\n 39:fe:36:76:1f:07:15:3a:9c:56:21:3a:6a:d3:58:6d:cd:ec:\n 81:3e:4d:92:79:ec:cf:e4:0e:d5:56:01:5b:c5:bb:8e:8a:ad:\n 4a:2c:1b:34:6f:5f:30:03:88:24:6a:09:d3:b9:79:b1:0e:03:\n 01:cf:5d:66:4e:d0:e3:0f:0e:e5:b8:cf:7b:6a:58:25:5e:f0:\n d7:9a:00:5b:f7:37:4b:a9:bf:e4:ab:30:9c:fd:3c:6e:6b:56:\n f9:cb:8f:11:5a:12:16:d7:8a:10:70:2b:50:10:03:9b:48:34:\n 88:1f:0c:1c:60:f3:b1:ca:0c:99:11:da:80:25:b0:c3:43:38:\n 92:ee:71:b3:24:be:fa:bd:3b:0a:d8:61:89:d7:27:c5:c3:a1:\n 2f:65:61:41:5e:1e:f2:ec:a1:ae:d9:55:48:6b:f2:64:49:d5:\n bd:1a:cb:f4:ca:c0:e7:35:46:4c:8b:79:2f:83:10:8c:52:1b:\n a6:db:b1:17:ce:02:9a:35:40:78:aa:78:19:5e:0b:12:47:8f:\n 07:ca:e0:bf:ca:77:62:4a:9b:d5:f7:09:c8:b5:43:b9:b8:22:\n f0:a6:7f:21\n```\n", "Hrm. What's the output of `openssl verify -CApath /var/run/secrets/kubernetes.io/serviceaccount/ca.crt </path/to/server/certificate>`?\n", "```\nopenssl verify -CApath client.crt /etc/kubernetes/certs/apiserver.crt\n/etc/kubernetes/certs/apiserver.crt: CN = apiserver\nerror 20 at 0 depth lookup:unable to get local issuer certificate\n```\n", "Is `client.crt` in this case the `ca.cert` you were using earlier? (The changing cert names make this a bit tricky).\n", "yes the client.crt is the same as `/var/run/secrets/kubernetes.io/serviceaccount/ca.crt`\n", "Ok, so that result suggests that OpenSSL is failing to validate the cert. Can you please provide `openssl version` and `curl -V` for me?\n", "```\n/app# openssl version\nOpenSSL 1.0.2g 1 Mar 2016\nroot@deis-controller-1217413231-almny:/app# curl -V\ncurl 7.47.0 (x86_64-pc-linux-gnu) libcurl/7.47.0 GnuTLS/3.4.10 zlib/1.2.8 libidn/1.32 librtmp/2.3\nProtocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtmp rtsp smb smbs smtp smtps telnet tftp \nFeatures: AsynchDNS IDN IPv6 Largefile GSS-API Kerberos SPNEGO NTLM NTLM_WB SSL libz TLS-SRP UnixSockets \n```\n", "to verify my client cert shouldn't i do \n\n```\nopenssl verify -CApath /etc/kubernetes/certs/apiserver.crt client.crt\nclient.crt: CN = acsk8sca\nerror 18 at 0 depth lookup:self signed certificate\nOK\n```\n", "@kmala No. `client.crt` is the _root_ certificate, and so is not the CA. The `client.crt` is the CA that should be in the CApath.\n", "Ok so that is probably why curl succeeded in validating: it isn't using OpenSSL for its cert validation, but Requests is.\n\nMy _suspicion_ is that the problem here is that the certificate serial number in the `Authority Key Identifier` field does not appear to match the serial number in the issuer certificate, but I'm not _sure_ of that. I'm going to page in @reaperhulk here to validate my answer.\n", "It's quite possible that's the problem. The AKI is indeed wrong for serial number (fine for dirname and keyid) and OpenSSL will attempt to use AKI to build chains in some scenarios.\n\nOn a side note it's weird to have a self-signed CA that has an AKI. That's not a useful extension in that context.\n", "Thanks @Lukasa @reaperhulk .Its indeed issue with the certificate. I used a certificate without AKI and it works fine." ]
https://api.github.com/repos/psf/requests/issues/3705
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/3705/labels{/name}
https://api.github.com/repos/psf/requests/issues/3705/comments
https://api.github.com/repos/psf/requests/issues/3705/events
https://github.com/psf/requests/issues/3705
190,129,276
MDU6SXNzdWUxOTAxMjkyNzY=
3,705
bug in PreparedRequests without simplejson library (under jython 2.7 only?)
{ "avatar_url": "https://avatars.githubusercontent.com/u/20236262?v=4", "events_url": "https://api.github.com/users/j-christ/events{/privacy}", "followers_url": "https://api.github.com/users/j-christ/followers", "following_url": "https://api.github.com/users/j-christ/following{/other_user}", "gists_url": "https://api.github.com/users/j-christ/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/j-christ", "id": 20236262, "login": "j-christ", "node_id": "MDQ6VXNlcjIwMjM2MjYy", "organizations_url": "https://api.github.com/users/j-christ/orgs", "received_events_url": "https://api.github.com/users/j-christ/received_events", "repos_url": "https://api.github.com/users/j-christ/repos", "site_admin": false, "starred_url": "https://api.github.com/users/j-christ/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/j-christ/subscriptions", "type": "User", "url": "https://api.github.com/users/j-christ", "user_view_type": "public" }
[]
closed
true
null
[]
null
3
2016-11-17T18:42:32Z
2021-09-08T14:00:32Z
2016-11-17T19:17:26Z
NONE
resolved
I noticed the following bug when running requests under jython 2.7 where I had not yet installed simplejson: In requests/models.py, the method PreparedRequest.prepare_body has the following code: ```` if not data and json is not None: # urllib3 requires a bytes-like body. Python 2's json.dumps # provides this natively, but Python 3 gives a Unicode string. content_type = 'application/json' body = complexjson.dumps(json) if not isinstance(body, bytes): body = body.encode('utf-8') ```` `json` in this case, is defined from the .compat file: ```` try: import simplejson as json except (ImportError, SyntaxError): # simplejson does not support Python 3.2, it throws a SyntaxError # because of u'...' Unicode literals. import json ```` If simplejson is not installed under jython, the code in models.py throws an exception because dumps is not defined in the json module.
{ "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/3705/reactions" }
https://api.github.com/repos/psf/requests/issues/3705/timeline
null
completed
null
null
false
[ "In this instance, I think I'm inclined to suggest that this is a JSON problem, not a Requests problem. json.dumps is not a new interface. And without it, our json parameter cannot possibly work anyway.\n", "@j-Christ, Jython 2.7 should support dumps without issue. I'd suggest checking your local directory or python path for another json.py file.\n", "@nateprewitt Thanks! That was the issue...somewhere in the jython path was a json package by patrickdlogan@[...].com, and requests was finding that one instead.\n" ]
https://api.github.com/repos/psf/requests/issues/3704
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/3704/labels{/name}
https://api.github.com/repos/psf/requests/issues/3704/comments
https://api.github.com/repos/psf/requests/issues/3704/events
https://github.com/psf/requests/pull/3704
190,110,115
MDExOlB1bGxSZXF1ZXN0OTQyMTE5ODc=
3,704
clarify that the `chunk_size` is optional when streaming to a file
{ "avatar_url": "https://avatars.githubusercontent.com/u/86842?v=4", "events_url": "https://api.github.com/users/afeld/events{/privacy}", "followers_url": "https://api.github.com/users/afeld/followers", "following_url": "https://api.github.com/users/afeld/following{/other_user}", "gists_url": "https://api.github.com/users/afeld/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/afeld", "id": 86842, "login": "afeld", "node_id": "MDQ6VXNlcjg2ODQy", "organizations_url": "https://api.github.com/users/afeld/orgs", "received_events_url": "https://api.github.com/users/afeld/received_events", "repos_url": "https://api.github.com/users/afeld/repos", "site_admin": false, "starred_url": "https://api.github.com/users/afeld/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/afeld/subscriptions", "type": "User", "url": "https://api.github.com/users/afeld", "user_view_type": "public" }
[]
closed
true
null
[]
null
5
2016-11-17T17:22:24Z
2021-09-08T01:21:39Z
2016-11-17T17:27:47Z
CONTRIBUTOR
resolved
Tripped me up briefly...figured others might run into the same thing. 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/3704/reactions" }
https://api.github.com/repos/psf/requests/issues/3704/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/3704.diff", "html_url": "https://github.com/psf/requests/pull/3704", "merged_at": "2016-11-17T17:27:47Z", "patch_url": "https://github.com/psf/requests/pull/3704.patch", "url": "https://api.github.com/repos/psf/requests/pulls/3704" }
true
[ "It's probably important to note that you _should_ provide a chunk_size here despite it being optional. The default of 1 is likely not what the user wants for any non-trivial file.\n", "@nateprewitt Yeah, thought about that...might make sense to give a value of `128` or something reasonable in the example, and just say that it can be changed. I'm no expert on this, so whatever y'all think!\n", "Great! How does changing the example to:\r\n\r\n```python\r\nwith open(filename, 'wb') as fd:\r\n for chunk in r.iter_content(chunk_size=128):\r\n fd.write(chunk)\r\n```\r\nand then that line saying you can adjust the chunk_size to a number that fits your requirements sound? This will probably better serve the user than pointing them towards the default behaviour of iter_content. That's just one guys thoughts though :)", "I'd be happy to merge that docs change. \n", "@afeld if you think this change is agreeable and have the inclination, feel free to throw the PR together. Otherwise, I'll try to open something next week.\n" ]
https://api.github.com/repos/psf/requests/issues/3703
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/3703/labels{/name}
https://api.github.com/repos/psf/requests/issues/3703/comments
https://api.github.com/repos/psf/requests/issues/3703/events
https://github.com/psf/requests/pull/3703
190,085,458
MDExOlB1bGxSZXF1ZXN0OTQxOTQxMjQ=
3,703
Revert "Adding 'import requests' to readme code snippet."
{ "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
2016-11-17T15:53:35Z
2021-09-06T00:06:52Z
2016-11-17T15:53:38Z
CONTRIBUTOR
resolved
Reverts kennethreitz/requests#3700
{ "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/3703/reactions" }
https://api.github.com/repos/psf/requests/issues/3703/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/3703.diff", "html_url": "https://github.com/psf/requests/pull/3703", "merged_at": "2016-11-17T15:53:38Z", "patch_url": "https://github.com/psf/requests/pull/3703.patch", "url": "https://api.github.com/repos/psf/requests/pulls/3703" }
true
[]
https://api.github.com/repos/psf/requests/issues/3702
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/3702/labels{/name}
https://api.github.com/repos/psf/requests/issues/3702/comments
https://api.github.com/repos/psf/requests/issues/3702/events
https://github.com/psf/requests/issues/3702
190,063,412
MDU6SXNzdWUxOTAwNjM0MTI=
3,702
SSLError: [SSL] PEM lib (_ssl.c:2603) when I want to connect to a server with TLS
{ "avatar_url": "https://avatars.githubusercontent.com/u/4517525?v=4", "events_url": "https://api.github.com/users/darakt/events{/privacy}", "followers_url": "https://api.github.com/users/darakt/followers", "following_url": "https://api.github.com/users/darakt/following{/other_user}", "gists_url": "https://api.github.com/users/darakt/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/darakt", "id": 4517525, "login": "darakt", "node_id": "MDQ6VXNlcjQ1MTc1MjU=", "organizations_url": "https://api.github.com/users/darakt/orgs", "received_events_url": "https://api.github.com/users/darakt/received_events", "repos_url": "https://api.github.com/users/darakt/repos", "site_admin": false, "starred_url": "https://api.github.com/users/darakt/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/darakt/subscriptions", "type": "User", "url": "https://api.github.com/users/darakt", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2016-11-17T14:33:40Z
2021-09-08T03:00:21Z
2016-11-17T14:34:16Z
NONE
resolved
Hi, I can't connect myself to an Apple server using requests. I can connect myself to this same server using openssl directly or using socket directly For instance, I'm doing that in such way with openssl `openssl s_client -CAfile GeoTrust_Global_CA.pem -connect api.push.apple.com:443 ` My code is pretty basic: `s = requests.session() s.cert = "GeoTrust_Global_CA.pem" s.port = 443 url = 'https://api.push.apple.com' r = s.get(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": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/3702/reactions" }
https://api.github.com/repos/psf/requests/issues/3702/timeline
null
completed
null
null
false
[ "@darakt You're using the `cert` argument, but you want to be using the `verify` argument.\n", "`requests.get('url', verify=True)` is causing this issue for me." ]
https://api.github.com/repos/psf/requests/issues/3701
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/3701/labels{/name}
https://api.github.com/repos/psf/requests/issues/3701/comments
https://api.github.com/repos/psf/requests/issues/3701/events
https://github.com/psf/requests/issues/3701
190,039,361
MDU6SXNzdWUxOTAwMzkzNjE=
3,701
AttributeError: 'X509' object has no attribute '_x509'
{ "avatar_url": "https://avatars.githubusercontent.com/u/633520?v=4", "events_url": "https://api.github.com/users/sapran/events{/privacy}", "followers_url": "https://api.github.com/users/sapran/followers", "following_url": "https://api.github.com/users/sapran/following{/other_user}", "gists_url": "https://api.github.com/users/sapran/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/sapran", "id": 633520, "login": "sapran", "node_id": "MDQ6VXNlcjYzMzUyMA==", "organizations_url": "https://api.github.com/users/sapran/orgs", "received_events_url": "https://api.github.com/users/sapran/received_events", "repos_url": "https://api.github.com/users/sapran/repos", "site_admin": false, "starred_url": "https://api.github.com/users/sapran/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/sapran/subscriptions", "type": "User", "url": "https://api.github.com/users/sapran", "user_view_type": "public" }
[]
closed
true
null
[]
null
37
2016-11-17T12:54:24Z
2021-09-03T00:10:46Z
2016-11-25T10:09:22Z
NONE
resolved
While trying to use Slack API using slacker module that is based on Requests, I receive this SSL-related error: ``` Python 2.7.12 (default, Oct 11 2016, 05:24:00) [GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.38)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> from slacker import Slacker >>> s=Slacker('<SLACK BOT API KEY>') >>> s.chat.post_message('#general', 'test') Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/local/lib/python2.7/site-packages/slacker/__init__.py", line 287, in post_message 'icon_emoji': icon_emoji File "/usr/local/lib/python2.7/site-packages/slacker/__init__.py", line 71, in post return self._request(requests.post, api, **kwargs) File "/usr/local/lib/python2.7/site-packages/slacker/__init__.py", line 57, in _request **kwargs) File "/usr/local/lib/python2.7/site-packages/requests/api.py", line 110, in post return request('post', url, data=data, json=json, **kwargs) File "/usr/local/lib/python2.7/site-packages/requests/api.py", line 56, in request return session.request(method=method, url=url, **kwargs) File "/usr/local/lib/python2.7/site-packages/requests/sessions.py", line 488, in request resp = self.send(prep, **send_kwargs) File "/usr/local/lib/python2.7/site-packages/requests/sessions.py", line 609, in send r = adapter.send(request, **kwargs) File "/usr/local/lib/python2.7/site-packages/requests/adapters.py", line 423, in send timeout=timeout File "/usr/local/lib/python2.7/site-packages/requests/packages/urllib3/connectionpool.py", line 594, in urlopen chunked=chunked) File "/usr/local/lib/python2.7/site-packages/requests/packages/urllib3/connectionpool.py", line 350, in _make_request self._validate_conn(conn) File "/usr/local/lib/python2.7/site-packages/requests/packages/urllib3/connectionpool.py", line 835, in _validate_conn conn.connect() File "/usr/local/lib/python2.7/site-packages/requests/packages/urllib3/connection.py", line 330, in connect cert = self.sock.getpeercert() File "/usr/local/lib/python2.7/site-packages/requests/packages/urllib3/contrib/pyopenssl.py", line 324, in getpeercert 'subjectAltName': get_subj_alt_name(x509) File "/usr/local/lib/python2.7/site-packages/requests/packages/urllib3/contrib/pyopenssl.py", line 166, in get_subj_alt_name cert = _Certificate(openssl_backend, peer_cert._x509) AttributeError: 'X509' object has no attribute '_x509' ``` I see that other users experience this too: http://stackoverflow.com/questions/40628315/python-requests-and-streaming-attributeerror-x509-object-has-no-attribute Downgrading from 2.12.1 to 2.11.1 removes 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": 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/3701/reactions" }
https://api.github.com/repos/psf/requests/issues/3701/timeline
null
completed
null
null
false
[ "What version of PyOpenSSL do you have installed?\n", "Also could you include the version of cryptography you have installed?\n", "```\nName: pyOpenSSL\nVersion: 16.2.0\nSummary: Python wrapper module around the OpenSSL library\nHome-page: https://pyopenssl.readthedocs.io/\nAuthor: Hynek Schlawack\nAuthor-email: [email protected]\nLicense: Apache License, Version 2.0\nLocation: /usr/local/lib/python2.7/site-packages\nRequires: six, cryptography\n---\nName: cryptography\nVersion: 1.5.3\nSummary: cryptography is a package which provides cryptographic recipes and primitives to Python developers.\nHome-page: https://github.com/pyca/cryptography\nAuthor: The cryptography developers\nAuthor-email: [email protected]\nLicense: BSD or Apache License, Version 2.0\nLocation: /usr/local/lib/python2.7/site-packages\nRequires: cffi, six, pyasn1, idna, enum34, setuptools, ipaddress\n```\n", "Hrm, I have both of those modules at those versions as well but cannot reproduce this error. I don't see how the object can have _no attribute_ `_x509`: there is no codepath where `_x509` doesn't get patched onto the object that I can see, and that code has remained unchanged since 2013.\n", "Can you try reinstalling pyopenssl and cryptography for me please?\n", "I did it in the morning :)\n\nReinstalled those and seen the same error after upgrading Requests.\n", "@sapran Ok, in that case I'll need you to try to run this under pdb and investigate why there appears to be no `_x509` attribute on that X509 object. In particular it would be good to check it on line `310` of `requests.packages.urllib3.contrib.pyopenssl`, to see what the return value of `get_peer_certificate` was and to investigate it there.\n", "When I update requests to version 2.12.1, I has the same issue also.\n", "@larryhq Can you please do the investigation I outlined above?\n\nTo anyone else who hits this issue, _please don't just say \"me too\"_. Please _investigate_ this issue as outlined above, because right now none of the maintainers can reproduce the bug.\n", "same thing\n\n```\npip show requests\nName: requests\nVersion: 2.12.1\n```\n\n```\npip show pyopenssl\nName: pyOpenSSL\nVersion: 16.2.0\n```\n\n```\npip show cryptography\nName: cryptography\nVersion: 1.5.3\n```\n\n```\nimport pdb\nimport requests\npdb.run('rs = requests.get( \"https://www.mail.ru\" )')\n> <string>(1)<module>()\n(Pdb) continue\nTraceback (most recent call last):\n File \"<stdin>\", line 1, in <module>\n File \"/usr/lib64/python2.7/pdb.py\", line 1238, in run\n Pdb().run(statement, globals, locals)\n File \"/usr/lib64/python2.7/bdb.py\", line 400, in run\n exec cmd in globals, locals\n File \"<string>\", line 1, in <module>\n File \"/usr/lib/python2.7/site-packages/requests/api.py\", line 70, in get\n return request('get', url, params=params, **kwargs)\n File \"/usr/lib/python2.7/site-packages/requests/api.py\", line 56, in request\n return session.request(method=method, url=url, **kwargs)\n File \"/usr/lib/python2.7/site-packages/requests/sessions.py\", line 488, in request\n resp = self.send(prep, **send_kwargs)\n File \"/usr/lib/python2.7/site-packages/requests/sessions.py\", line 609, in send\n r = adapter.send(request, **kwargs)\n File \"/usr/lib/python2.7/site-packages/requests/adapters.py\", line 423, in send\n timeout=timeout\n File \"/usr/lib/python2.7/site-packages/requests/packages/urllib3/connectionpool.py\", line 594, in urlopen\n chunked=chunked)\n File \"/usr/lib/python2.7/site-packages/requests/packages/urllib3/connectionpool.py\", line 350, in _make_request\n self._validate_conn(conn)\n File \"/usr/lib/python2.7/site-packages/requests/packages/urllib3/connectionpool.py\", line 835, in _validate_conn\n conn.connect()\n File \"/usr/lib/python2.7/site-packages/requests/packages/urllib3/connection.py\", line 330, in connect\n cert = self.sock.getpeercert()\n File \"/usr/lib/python2.7/site-packages/requests/packages/urllib3/contrib/pyopenssl.py\", line 324, in getpeercert\n 'subjectAltName': get_subj_alt_name(x509)\n File \"/usr/lib/python2.7/site-packages/requests/packages/urllib3/contrib/pyopenssl.py\", line 166, in get_subj_alt_name\n cert = _Certificate(openssl_backend, peer_cert._x509)\nAttributeError: 'X509' object has no attribute '_x509'\n```\n\nDowngrade to 2.11.1 is a fix ...\n", "@skob Please please _please_ read the other comments in this thread before posting. I have asked all people reporting to do an investigation and so far no-one has.\n\n**Let me be clear**: any furthe \"me too\" posts that don't acknowledge the investigation I have asked people to do will be summarily deleted.\n", "@Lukasa I had the same error, read your comments, reinstalled both libraries, pyopenssl and cryptography, and it worked. no more error. Thanks for your help. :) \n", "No problem. =) I'd like to make @reaperhulk aware of this issue at this time, as this seems to be related to pyopenssl and cryptography in a way I don't fully understand yet.\n", "I'm wondering if somehow Python is loading the wrong version of pyOpenSSL for people who are affected by this. the `X509` object most definitely has `_x509` (https://github.com/pyca/pyopenssl/blob/master/src/OpenSSL/crypto.py#L997-L1004) and has had it since 0.14 was released almost 3 years ago (https://github.com/pyca/pyopenssl/blob/0146d447e63a737b4f05a1164d5950eff68543e7/OpenSSL/crypto.py#L748-L752).", "I had the same issue on a new MBP with a 'vanilla' macOS Sierra. @Lukasa I uninstalled and re-installed pyOpenSSL and Cryptography and it all worked fine. Thanks.", "I had the same problem. And upgrading pyOpenSSL by 'pip install --upgrade pyOpenSSL' didn't solve the problem.\r\n\r\nI suspect that the reason is that there is another pyOpenSSL installation in the system, for my case, I have pyOpenSSL-0.13.1-3.el7.x86_64 installed by 'yum'. So I think if you use a CentOS 7 system and install pyOpenSSL-0.13.1-3.el7.x86_64 by yum, then install requests 2.12.1 by pip, then you might probably reproduce the problem.\r\n\r\nthe conflict between yum and pip is annoying.", "So can people also let us know the result of running `python -c 'import OpenSSL; print(OpenSSL.__version__)'` I suspect this is exactly what @reaperhulk has suggested and what @zhang-jingwang seems to have confirmed.", "On my OS X machine:\r\n```\r\n$ python -c 'import OpenSSL; print(OpenSSL.__version__)'\r\n0.13.1\r\n$ python --version\r\nPython 2.7.10\r\n$ sw_vers\r\nProductName:\tMac OS X\r\nProductVersion:\t10.11.5\r\nBuildVersion:\t15F34\r\n```", "Yup, that's too old. Our setup.py file requires at least 0.14", "Hey guys I had today the same error, using RHEL 7.3 and pyOpenSSL 0.13.1-3.el7. Uninstalling and then installing again pyOpenSSL and cryptography via pip works for me as well. Thanks for the info!", "Same error.\r\nrequests==2.12.1\r\ncryptography==1.5\r\npyOpenSSL not installed", "@jachymb PyOpenSSL *cannot* be not installed. Please open your Python shell and type `import OpenSSL`.", "I am sorry. It is pyOpenSSL=0.13.1", "Ok, that's too old. Our setup.py file requires at least 0.14.", "I've just closed this because it's now clear that *all* of these issues stem from having an out-of-date PyOpenSSL in your Python environment. If you encounter this issue, please update your PyOpenSSL to at least 0.14.", "```\r\n$ python -c 'import OpenSSL; print(OpenSSL.__version__)'\r\n16.2.0\r\n```\r\nStill broken…", "@sapran Please reinstall PyOpenSSL and its dependencies, and you will find it is not, in fact, broken.", "I have the same problem (even after reinstalling pyopenssl and cryptography).\r\n\r\nThe problem goes away when I rollback requests to 2.11 and comes back when I upgrade to 2.12 (or the current dev version)\r\n\r\nReinstalling pyopenssl does not help\r\n\r\nSo it is definitely part of requests (or it dependency description).", "@rjungbeck I cannot stress this enough: this problem is *not* part of Requests.\r\n\r\nTry a brand new virtual environment. Please also verify in your current environment that PyOpenSSL is the version you think it is. We do not support PyOpenSSL 0.13 any longer.", "I had this issue, and resolved it by doing this. After verifying a clean virtualenv works with only a 'pip install requests'\r\n\r\nsudo yum uninstall python-requests\r\nsudo pip uninstall pyopenssl cryptography requests\r\nsudo pip install requests" ]
https://api.github.com/repos/psf/requests/issues/3700
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/3700/labels{/name}
https://api.github.com/repos/psf/requests/issues/3700/comments
https://api.github.com/repos/psf/requests/issues/3700/events
https://github.com/psf/requests/pull/3700
189,954,132
MDExOlB1bGxSZXF1ZXN0OTQxMTA0MjU=
3,700
Adding 'import requests' to readme code snippet.
{ "avatar_url": "https://avatars.githubusercontent.com/u/3707038?v=4", "events_url": "https://api.github.com/users/rmhasan/events{/privacy}", "followers_url": "https://api.github.com/users/rmhasan/followers", "following_url": "https://api.github.com/users/rmhasan/following{/other_user}", "gists_url": "https://api.github.com/users/rmhasan/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/rmhasan", "id": 3707038, "login": "rmhasan", "node_id": "MDQ6VXNlcjM3MDcwMzg=", "organizations_url": "https://api.github.com/users/rmhasan/orgs", "received_events_url": "https://api.github.com/users/rmhasan/received_events", "repos_url": "https://api.github.com/users/rmhasan/repos", "site_admin": false, "starred_url": "https://api.github.com/users/rmhasan/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/rmhasan/subscriptions", "type": "User", "url": "https://api.github.com/users/rmhasan", "user_view_type": "public" }
[]
closed
true
null
[]
null
5
2016-11-17T06:40:03Z
2021-09-08T01:21:40Z
2016-11-17T08:23:57Z
CONTRIBUTOR
resolved
The interpreter snippet at the top of the readme.rst is the first snippet of code that users will see for using requests. I think an import statement should be shown at the top of the code snippet, so a novice or even intermediate python user will know to import the module first before attempting to use it. It makes the snippet more complete. I've seen other github projects include the import statement in snippets like the one in the readme. I changed the doc/index.rst file for consistency, since they are the same code snippet.
{ "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/3700/reactions" }
https://api.github.com/repos/psf/requests/issues/3700/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/3700.diff", "html_url": "https://github.com/psf/requests/pull/3700", "merged_at": "2016-11-17T08:23:57Z", "patch_url": "https://github.com/psf/requests/pull/3700.patch", "url": "https://api.github.com/repos/psf/requests/pulls/3700" }
true
[ "For instance [tensorflow](https://github.com/tensorflow/tensorflow)'s readme has a similar code snippet and it has the import statement at the top of the code snippet. \n", "Thanks for this!\n", "undo\n", "Hi @kennethreitz , I was wondering why my pull request got reverted.\n", "I prefer it the way it is, and it was made that way intentionally. \n\nI understand why you made this suggestion, and I appreciate it β€”Β but this is the way I want to present the project, for aesthetic reasons. \n" ]
https://api.github.com/repos/psf/requests/issues/3699
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/3699/labels{/name}
https://api.github.com/repos/psf/requests/issues/3699/comments
https://api.github.com/repos/psf/requests/issues/3699/events
https://github.com/psf/requests/issues/3699
189,915,270
MDU6SXNzdWUxODk5MTUyNzA=
3,699
Buggy servers with SNI give unrecognized_name
{ "avatar_url": "https://avatars.githubusercontent.com/u/13907452?v=4", "events_url": "https://api.github.com/users/rudolphi/events{/privacy}", "followers_url": "https://api.github.com/users/rudolphi/followers", "following_url": "https://api.github.com/users/rudolphi/following{/other_user}", "gists_url": "https://api.github.com/users/rudolphi/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/rudolphi", "id": 13907452, "login": "rudolphi", "node_id": "MDQ6VXNlcjEzOTA3NDUy", "organizations_url": "https://api.github.com/users/rudolphi/orgs", "received_events_url": "https://api.github.com/users/rudolphi/received_events", "repos_url": "https://api.github.com/users/rudolphi/repos", "site_admin": false, "starred_url": "https://api.github.com/users/rudolphi/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/rudolphi/subscriptions", "type": "User", "url": "https://api.github.com/users/rudolphi", "user_view_type": "public" }
[]
closed
true
null
[]
null
3
2016-11-17T02:20:11Z
2021-09-08T14:00:33Z
2016-11-17T08:34:58Z
NONE
resolved
When trying to open https://www.scbt.com with requests, an SSLError is raised, even though verify=False. Apache HttpClient has the same problem, but browsers open the page without any complaint. I was hoping requests would be more tolerant with such flawed servers, especially if the caller indicates that security is not of importance. [stacktrace.txt](https://github.com/kennethreitz/requests/files/596393/stacktrace.txt) Thanks! Felix
{ "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/3699/reactions" }
https://api.github.com/repos/psf/requests/issues/3699/timeline
null
completed
null
null
false
[ "Requests cannot be more tolerant of that server in the default configuration. The `unrecognized name` error you're seeing is an alert sent by the _remote server_: that is, our inability to set SNI means that the remote server is simply refusing to negotiate TLS with us. That means we cannot possibly be \"tolerant\" of that error: the remote server is being intolerant, not us.\n\nI should note that the remote server's intolerance is _entirely_ reasonable. SNI is not an optional feature on the modern web, it's mandatory. For most other users I'd say that you should install the `requests[security]` extra, but right now that won't work because it relies on a CFFI extension and Jython has no support for CFFI at this time.\n\nUnfortunately, that means that there's simply nothing we can do for you. Either Jython needs to add support for SNI, in which case Requests will automatically start using it, or Jython needs to add support for CFFI. Otherwise, however, we simply cannot help your use case.\n", "Thanks very much for your quick reply! I was hoping to be able to imitate what the browser does, but it seems quite difficult indeed. Other servers using https work fine, but that particular one seems quite \"tight\". :-)\n", "Sadly, the browser sends SNI, so it doesn't have this problem. 😞 \n" ]
https://api.github.com/repos/psf/requests/issues/3698
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/3698/labels{/name}
https://api.github.com/repos/psf/requests/issues/3698/comments
https://api.github.com/repos/psf/requests/issues/3698/events
https://github.com/psf/requests/issues/3698
189,821,447
MDU6SXNzdWUxODk4MjE0NDc=
3,698
AttributeError: 'NoneType' object has no attribute 'read'
{ "avatar_url": "https://avatars.githubusercontent.com/u/6023916?v=4", "events_url": "https://api.github.com/users/Makman2/events{/privacy}", "followers_url": "https://api.github.com/users/Makman2/followers", "following_url": "https://api.github.com/users/Makman2/following{/other_user}", "gists_url": "https://api.github.com/users/Makman2/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Makman2", "id": 6023916, "login": "Makman2", "node_id": "MDQ6VXNlcjYwMjM5MTY=", "organizations_url": "https://api.github.com/users/Makman2/orgs", "received_events_url": "https://api.github.com/users/Makman2/received_events", "repos_url": "https://api.github.com/users/Makman2/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Makman2/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Makman2/subscriptions", "type": "User", "url": "https://api.github.com/users/Makman2", "user_view_type": "public" }
[]
closed
true
null
[]
null
10
2016-11-16T19:44:20Z
2021-09-08T14:00:33Z
2016-11-16T20:59:22Z
NONE
resolved
Hello :) After a recent upgrade for our [coala](https://github.com/coala/coala) project to `requests` 2.12.1 we encounter an exception in our test suites which seems to be caused by `requests`. Build: https://ci.appveyor.com/project/coala/coala-bears/build/1.0.3537/job/1wm7b4u9yhgkxkgn Relevant part: ``` ================================== FAILURES =================================== _________________ InvalidLinkBearTest.test_redirect_threshold _________________ self = <tests.general.InvalidLinkBearTest.InvalidLinkBearTest testMethod=test_redirect_threshold> def test_redirect_threshold(self): long_url_redirect = """ https://bitbucket.org/api/301 https://bitbucket.org/api/302 """.splitlines() short_url_redirect = """ http://httpbin.org/status/301 """.splitlines() self.assertResult(valid_file=long_url_redirect, invalid_file=short_url_redirect, > settings={'follow_redirects': 'yeah'}) tests\general\InvalidLinkBearTest.py:157: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests\general\InvalidLinkBearTest.py:75: in assertResult out = list(uut.run("valid", valid_file, **settings)) bears\general\InvalidLinkBear.py:80: in run file, timeout, link_ignore_regex): bears\general\InvalidLinkBear.py:53: in find_links_in_file code = InvalidLinkBear.get_status_code(link, timeout) bears\general\InvalidLinkBear.py:37: in get_status_code timeout=timeout).status_code C:\Python34\lib\site-packages\requests\api.py:96: in head return request('head', url, **kwargs) C:\Python34\lib\site-packages\requests\api.py:56: in request return session.request(method=method, url=url, **kwargs) C:\Python34\lib\site-packages\requests\sessions.py:488: in request resp = self.send(prep, **send_kwargs) C:\Python34\lib\site-packages\requests_mock\mocker.py:69: in _fake_send return self._real_send(session, request, **kwargs) C:\Python34\lib\site-packages\requests\sessions.py:641: in send r.content C:\Python34\lib\site-packages\requests\models.py:772: in content self._content = bytes().join(self.iter_content(CONTENT_CHUNK_SIZE)) or bytes() _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def generate(): # Special case for urllib3. if hasattr(self.raw, 'stream'): try: for chunk in self.raw.stream(chunk_size, decode_content=True): yield chunk except ProtocolError as e: raise ChunkedEncodingError(e) except DecodeError as e: raise ContentDecodingError(e) except ReadTimeoutError as e: raise ConnectionError(e) else: # Standard file-like object. while True: > chunk = self.raw.read(chunk_size) E AttributeError: 'NoneType' object has no attribute 'read' C:\Python34\lib\site-packages\requests\models.py:705: AttributeError ``` happens on Windows and Linux. Thanks in advance :)
{ "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/3698/reactions" }
https://api.github.com/repos/psf/requests/issues/3698/timeline
null
completed
null
null
false
[ "@Makman2 it's not immediately obvious where the issue lies here. The specific traceback you're hitting is because the response value is None. I don't see any changes in the critical path for Requests since 2.11.1 that would affect this.\n\nI think it's possibly a gap in requests_mock that's not returning a valid response with a Requests-2.12 request.\n\nWould you be able to provide a repro of this without using the requests_mock module?\n", "Yup, I think @nateprewitt has it: if you can't get a repro that doesn't involve requests_mock I think this issue is almost certainly with their code.\n", "alright thx I'm filing the issue at `requests_mock` :+1:\n", "Submitted here: https://bugs.launchpad.net/requests-mock/+bug/1642396\n", "@Makman2 I went **way** down the rabbit hole and believe I've found an answer. This is in fact the product of a combination of changes in 2.12 and the way you're mocking objects in your tests.\n\nYou're currently mocking responses with a Response object that only the status_code initialized.\nThis is a really simple repro of your issue.\n\n``` python\nimport requests\nr = requests.Response()\nr.status_code = 200\nr.content\n```\n\n`send()` in `requests.Session` always calls `.content` on streams to ensure they're consumed. When this is called on the empty response, it raises an AttributeError previously caught. This exception was removed in 327512f, oddly enough as a fix for requests_mock, because it was deemed too broad. The implication of this is we now require all adapters to support `raw` in their responses which conflicts somewhat with our documentation. I'll leave it to @Lukasa to determine the next steps.\n\nAs for getting your tests working with Requests-2.12, I'd suggest simply setting `Response.raw = io.BytesIO()`, or some file-like object, [here](https://github.com/coala/coala-bears/blob/master/tests/general/InvalidLinkBearTest.py#L48).\n", "Just as another breadcrumb here, this was a concern raised in the PR (#3607) but the answer wasn't immediately clear.\n", "Hrm. I think we should resolve any documentation conflicts, but otherwise I'm fine with requiring that `raw` be present.\n", "I should note that actually the only requirement is that `.raw` be present while we don't have `._content`. \n", "Thanks very much, seems the `.raw = io.BytesIO` thing is working :) It's good to have higher versions of `requests` supported :+1: \n", "From a requests-mock perspective [bug 1642697](https://bugs.launchpad.net/requests-mock/+bug/1642697) was filed that was hit because of the exact same removal of AttributeError handling in 327512f. This only affects the requests-mock tests and not the mocking itself but is likely the same result.\n\nFrom a requests-mock usage perspective (which should probably go elsewhere, but i'm not sure where) there's a few things you can fix in your tests to not have this problem. \n\n1). It's unlikely you really want a custom matcher, A matcher is the code that checks if you want to return a response. When you do a requests_mock.get() or .register_uri() it creates a matcher for you and you can regexp or a whole variety of things there. You can then attach a function that fills in a response for you, and requests_mock will handle making it a response that requests understands [1].\n\nIt's fine/expected to make register each url you are using with it's own response rather than try to cram everything into the same custom matcher.\n\n2). requests_mock.create_response() is a function that is used to create a HTTPResponse that requests understands and it's public for just this reason. If you use this instead of constructing your own requests.Response it will patch all this stuff for you. \n\n3). update to requests_mock 1.x. There's no API break, it had just been stable long enough to not be considered a 0.x release any more. There's also probably not anything you really need from the 1.x branch but it will be less likely to break with new requests releases.\n\n[1] http://requests-mock.readthedocs.io/en/latest/response.html#dynamic-response\n" ]
https://api.github.com/repos/psf/requests/issues/3697
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/3697/labels{/name}
https://api.github.com/repos/psf/requests/issues/3697/comments
https://api.github.com/repos/psf/requests/issues/3697/events
https://github.com/psf/requests/pull/3697
189,778,916
MDExOlB1bGxSZXF1ZXN0OTQwMTEzNDE=
3,697
Fixed issue #3696. Added a test for it as well.
{ "avatar_url": "https://avatars.githubusercontent.com/u/2324958?v=4", "events_url": "https://api.github.com/users/hussaintamboli/events{/privacy}", "followers_url": "https://api.github.com/users/hussaintamboli/followers", "following_url": "https://api.github.com/users/hussaintamboli/following{/other_user}", "gists_url": "https://api.github.com/users/hussaintamboli/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/hussaintamboli", "id": 2324958, "login": "hussaintamboli", "node_id": "MDQ6VXNlcjIzMjQ5NTg=", "organizations_url": "https://api.github.com/users/hussaintamboli/orgs", "received_events_url": "https://api.github.com/users/hussaintamboli/received_events", "repos_url": "https://api.github.com/users/hussaintamboli/repos", "site_admin": false, "starred_url": "https://api.github.com/users/hussaintamboli/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/hussaintamboli/subscriptions", "type": "User", "url": "https://api.github.com/users/hussaintamboli", "user_view_type": "public" }
[]
closed
true
null
[]
null
0
2016-11-16T17:23:30Z
2021-09-08T01:21:41Z
2016-11-16T18:32:59Z
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/3697/reactions" }
https://api.github.com/repos/psf/requests/issues/3697/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/3697.diff", "html_url": "https://github.com/psf/requests/pull/3697", "merged_at": "2016-11-16T18:32:59Z", "patch_url": "https://github.com/psf/requests/pull/3697.patch", "url": "https://api.github.com/repos/psf/requests/pulls/3697" }
true
[]
https://api.github.com/repos/psf/requests/issues/3696
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/3696/labels{/name}
https://api.github.com/repos/psf/requests/issues/3696/comments
https://api.github.com/repos/psf/requests/issues/3696/events
https://github.com/psf/requests/issues/3696
189,751,036
MDU6SXNzdWUxODk3NTEwMzY=
3,696
A whitespace at the start of Url causes error on request
{ "avatar_url": "https://avatars.githubusercontent.com/u/2324958?v=4", "events_url": "https://api.github.com/users/hussaintamboli/events{/privacy}", "followers_url": "https://api.github.com/users/hussaintamboli/followers", "following_url": "https://api.github.com/users/hussaintamboli/following{/other_user}", "gists_url": "https://api.github.com/users/hussaintamboli/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/hussaintamboli", "id": 2324958, "login": "hussaintamboli", "node_id": "MDQ6VXNlcjIzMjQ5NTg=", "organizations_url": "https://api.github.com/users/hussaintamboli/orgs", "received_events_url": "https://api.github.com/users/hussaintamboli/received_events", "repos_url": "https://api.github.com/users/hussaintamboli/repos", "site_admin": false, "starred_url": "https://api.github.com/users/hussaintamboli/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/hussaintamboli/subscriptions", "type": "User", "url": "https://api.github.com/users/hussaintamboli", "user_view_type": "public" }
[ { "color": "e10c02", "default": false, "description": null, "id": 117744, "name": "Bug", "node_id": "MDU6TGFiZWwxMTc3NDQ=", "url": "https://api.github.com/repos/psf/requests/labels/Bug" }, { "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
4
2016-11-16T16:05:10Z
2021-09-08T14:00:34Z
2016-11-16T18:38:12Z
NONE
resolved
In [1]: import requests In [2]: requests.get("http://stackoverflow.com/") Out[2]: <Response [200]> In [3]: requests.get(" http://stackoverflow.com/") # ... stacktrace skipped ... InvalidSchema: No connection adapters were found for ' http://stackoverflow.com/' Url should have been stripped. But I may be missing something here.
{ "avatar_url": "https://avatars.githubusercontent.com/u/2324958?v=4", "events_url": "https://api.github.com/users/hussaintamboli/events{/privacy}", "followers_url": "https://api.github.com/users/hussaintamboli/followers", "following_url": "https://api.github.com/users/hussaintamboli/following{/other_user}", "gists_url": "https://api.github.com/users/hussaintamboli/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/hussaintamboli", "id": 2324958, "login": "hussaintamboli", "node_id": "MDQ6VXNlcjIzMjQ5NTg=", "organizations_url": "https://api.github.com/users/hussaintamboli/orgs", "received_events_url": "https://api.github.com/users/hussaintamboli/received_events", "repos_url": "https://api.github.com/users/hussaintamboli/repos", "site_admin": false, "starred_url": "https://api.github.com/users/hussaintamboli/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/hussaintamboli/subscriptions", "type": "User", "url": "https://api.github.com/users/hussaintamboli", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/3696/reactions" }
https://api.github.com/repos/psf/requests/issues/3696/timeline
null
completed
null
null
false
[ "I'm open to a PR that will cause us to strip URLs, that seems reasonable enough to me.\n", "Sure.\n", "I have created a pull request #3697. Please have a look.\n", "PR is merged. Closing it as it's fixed.\n" ]
https://api.github.com/repos/psf/requests/issues/3695
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/3695/labels{/name}
https://api.github.com/repos/psf/requests/issues/3695/comments
https://api.github.com/repos/psf/requests/issues/3695/events
https://github.com/psf/requests/pull/3695
189,702,776
MDExOlB1bGxSZXF1ZXN0OTM5NjQ4MzA=
3,695
idna bypass
{ "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
17
2016-11-16T13:24:32Z
2021-09-08T01:21:37Z
2016-11-25T13:18:01Z
MEMBER
resolved
This addresses #3687 allowing URLs that are already idna encoded to pass through while everything else is still properly encoded.
{ "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/3695/reactions" }
https://api.github.com/repos/psf/requests/issues/3695/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/3695.diff", "html_url": "https://github.com/psf/requests/pull/3695", "merged_at": "2016-11-25T13:18:01Z", "patch_url": "https://github.com/psf/requests/pull/3695.patch", "url": "https://api.github.com/repos/psf/requests/pulls/3695" }
true
[ "Alright, all systems are nominal. πŸš€\n", "Comment updated, hopefully that's a bit closer.\n", "Alright, ASCII check updated πŸ˜ƒ \n", "OK, we're all moved over to _internal_utils.\n", "> An alternative solution to this is to say that if the idna module fails to encode we'll just go ahead and try to encode as ASCII. If that works then we shrug our shoulders and say everything is probably ok, and if it fails we catch that and throw InvalidURL. @sigmavirus24, how does that sound?\n\n([comment](/kennethreitz/requests/issues/3683#issuecomment-261240279))\n\nDo we want to hold here until a decision is made on this so we're not having to back things out?\n", "It's certainly worth us holding off until we can resolve that ambiguity.\n", "That method sounds good to me. I'm not as familiar with the idna standard though, so while it sounds perfectly practical, I don't know if it fits in with the rest of the work around the standard.\n", "Ok then, let's go ahead with that and see how it goes.\n", "I guess we should probably clarify what we're attempting to do here. The above comment was in reference to the the inability to use IPv6 with Requests 2.12+. Personally, I think that definitely needs to be addressed, the other complaints I have no opinion on.\n\nThe fallback approach though essentially gives carte blanche to anything that can be ASCII encoded, which seems to defeat some benefits of doing IDNA encoding. They've special cased `.` delimiters in the IDNA library, I'm assuming for things like subdomains, which allows IPv4 addresses to pass through (unintentionally?). However, they don't appear to have taken into account IPv6 style addresses with `:` delimiters or wrapping brackets.\n\nFrom a cursory reading of [RFC5891](https://tools.ietf.org/html/rfc5891), it seems like IDNA is only intended for domain names. That would suggest to me we shouldn't be passing IP addresses into this function to begin with.\n\nIf we're ONLY attempting to handle IPv6, we can check to skip `host` values that are entirely numeric or delimiters. Otherwise, if we're entertaining allowing things like underscores then maybe the passthrough is the only viable option to avoid constantly programming around use cases.\n\n**Edit**: Sorry @Lukasa I just realized I essentially reiterated your entire thought process from the other thread. Vendoring in a dependency is likely not what we want to do. `any([c.isalpha() for c in host])` is probably kludgy enough to keep out of the main path for Requests. So I guess that leaves the bypass.\n", "Yup, that's why I landed on the bypass: it just seems like the simplest approach that is also in line with what most browsers do (i.e. try to do the right thing but allow the wrong thing if it's unambiguous). In this case I'd like to filter out certain obviously bad URLs that IDNA was saving us from (those with leading wildcards, for example), but otherwise if they're the kind of garden-variety bad that issue #3683 is discussing (or if they aren't hostnames at all!) then we can probably just pass them through and let the rest of the codebase handle them.\n", "Ok, I removed the initial check for `xn--` because we end up performing fairly redundant logic both before the try...except block and again in the except block itself.\n\nThis should work for our given test cases, as well as the other concerns about unix socket files and hostnames containing underscores, provided they're both only ASCII. Let me know if I'm leaving anything else out.\n", "Alright, tests extended and exception tightened.", "Yep, those were oversights. Should be updated now.", "Alright, I'm going to merge this now. @sigmavirus24 feel free to give feedback regardless, we can always revisit this. =) Thanks @nateprewitt!", "Guys, do you have any idea of when these changes could be released?", "I am tentatively considering next week for a possible release. No promises though.", "Thanks for prompt response!" ]
https://api.github.com/repos/psf/requests/issues/3694
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/3694/labels{/name}
https://api.github.com/repos/psf/requests/issues/3694/comments
https://api.github.com/repos/psf/requests/issues/3694/events
https://github.com/psf/requests/pull/3694
189,661,018
MDExOlB1bGxSZXF1ZXN0OTM5Mzk5OTE=
3,694
Prepare 2.12.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" }
[]
closed
true
null
[]
null
0
2016-11-16T10:35:41Z
2021-09-08T01:21:42Z
2016-11-16T10:44:02Z
MEMBER
resolved
Let's ship a bugfix.
{ "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/3694/reactions" }
https://api.github.com/repos/psf/requests/issues/3694/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/3694.diff", "html_url": "https://github.com/psf/requests/pull/3694", "merged_at": "2016-11-16T10:44:02Z", "patch_url": "https://github.com/psf/requests/pull/3694.patch", "url": "https://api.github.com/repos/psf/requests/pulls/3694" }
true
[]
https://api.github.com/repos/psf/requests/issues/3693
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/3693/labels{/name}
https://api.github.com/repos/psf/requests/issues/3693/comments
https://api.github.com/repos/psf/requests/issues/3693/events
https://github.com/psf/requests/pull/3693
189,660,216
MDExOlB1bGxSZXF1ZXN0OTM5Mzk0NzQ=
3,693
Change setuptools extra for secure extra.
{ "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
2016-11-16T10:32:25Z
2021-09-08T01:21:42Z
2016-11-16T10:33:48Z
MEMBER
resolved
Resolves #3689.
{ "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/3693/reactions" }
https://api.github.com/repos/psf/requests/issues/3693/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/3693.diff", "html_url": "https://github.com/psf/requests/pull/3693", "merged_at": "2016-11-16T10:33:47Z", "patch_url": "https://github.com/psf/requests/pull/3693.patch", "url": "https://api.github.com/repos/psf/requests/pulls/3693" }
true
[ "I took this version count from urllib3, which seems like a sensible lead to follow here.\n" ]
https://api.github.com/repos/psf/requests/issues/3692
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/3692/labels{/name}
https://api.github.com/repos/psf/requests/issues/3692/comments
https://api.github.com/repos/psf/requests/issues/3692/events
https://github.com/psf/requests/issues/3692
189,579,747
MDU6SXNzdWUxODk1Nzk3NDc=
3,692
Long timeout
{ "avatar_url": "https://avatars.githubusercontent.com/u/1137549?v=4", "events_url": "https://api.github.com/users/looping84/events{/privacy}", "followers_url": "https://api.github.com/users/looping84/followers", "following_url": "https://api.github.com/users/looping84/following{/other_user}", "gists_url": "https://api.github.com/users/looping84/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/looping84", "id": 1137549, "login": "looping84", "node_id": "MDQ6VXNlcjExMzc1NDk=", "organizations_url": "https://api.github.com/users/looping84/orgs", "received_events_url": "https://api.github.com/users/looping84/received_events", "repos_url": "https://api.github.com/users/looping84/repos", "site_admin": false, "starred_url": "https://api.github.com/users/looping84/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/looping84/subscriptions", "type": "User", "url": "https://api.github.com/users/looping84", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2016-11-16T04:00:55Z
2021-09-08T14:00:35Z
2016-11-16T08:43:49Z
NONE
resolved
I need check my service is ok or not。 sometimes it will breakdown. ### how to reproduce the issue ``` try: r = requests.get("http://xxx.com/",timeout=1) print(r.status_code) except requests.exceptions.Timeout: print 'timeout' except requests.exceptions.RequestException as e: print(e) ``` it always let me wait for 30 seconds `I hope it only waits one second, if server doesn't response or the link is unreachable, throw exception` below are exception message > Max retries exceeded with url: / (Caused by NewConnectionError('<requests.packages.urllib3.connection.HTTPConnection object at 0x3d344d0>: Failed to establish a new connection: [Errno 8] nodename nor servname provided, or not known',))
{ "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/3692/reactions" }
https://api.github.com/repos/psf/requests/issues/3692/timeline
null
completed
null
null
false
[ "The requests timeout parameter is _per connection_, and Requests will make as many connection attempts as there are domain names. However, Requests cannot control the timeout of the DNS lookup, which is the problem here. Unfortunately, Python doesn't allow us any way around this problem: there is just no cross-platform way to do a DNS lookup with a timeout using the things installed by default.\n\nSorry!\n" ]
https://api.github.com/repos/psf/requests/issues/3691
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/3691/labels{/name}
https://api.github.com/repos/psf/requests/issues/3691/comments
https://api.github.com/repos/psf/requests/issues/3691/events
https://github.com/psf/requests/pull/3691
189,574,777
MDExOlB1bGxSZXF1ZXN0OTM4OTU3MDM=
3,691
Fixes small readme typo - site => domain
{ "avatar_url": "https://avatars.githubusercontent.com/u/3649914?v=4", "events_url": "https://api.github.com/users/Cleod9/events{/privacy}", "followers_url": "https://api.github.com/users/Cleod9/followers", "following_url": "https://api.github.com/users/Cleod9/following{/other_user}", "gists_url": "https://api.github.com/users/Cleod9/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Cleod9", "id": 3649914, "login": "Cleod9", "node_id": "MDQ6VXNlcjM2NDk5MTQ=", "organizations_url": "https://api.github.com/users/Cleod9/orgs", "received_events_url": "https://api.github.com/users/Cleod9/received_events", "repos_url": "https://api.github.com/users/Cleod9/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Cleod9/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Cleod9/subscriptions", "type": "User", "url": "https://api.github.com/users/Cleod9", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2016-11-16T03:32:19Z
2021-09-08T01:21:42Z
2016-11-16T08:39:06Z
CONTRIBUTOR
resolved
Fixed readme typo - 'site' should be 'domain'
{ "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/3691/reactions" }
https://api.github.com/repos/psf/requests/issues/3691/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/3691.diff", "html_url": "https://github.com/psf/requests/pull/3691", "merged_at": "2016-11-16T08:39:06Z", "patch_url": "https://github.com/psf/requests/pull/3691.patch", "url": "https://api.github.com/repos/psf/requests/pulls/3691" }
true
[ "Referencing: https://github.com/kennethreitz/requests/issues/3672\n", "Thanks @Cleod9! :sparkles: :cake: :sparkles:\n" ]
https://api.github.com/repos/psf/requests/issues/3690
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/3690/labels{/name}
https://api.github.com/repos/psf/requests/issues/3690/comments
https://api.github.com/repos/psf/requests/issues/3690/events
https://github.com/psf/requests/pull/3690
189,570,357
MDExOlB1bGxSZXF1ZXN0OTM4OTM1ODE=
3,690
Clarify allow_redirects
{ "avatar_url": "https://avatars.githubusercontent.com/u/3253863?v=4", "events_url": "https://api.github.com/users/galgeek/events{/privacy}", "followers_url": "https://api.github.com/users/galgeek/followers", "following_url": "https://api.github.com/users/galgeek/following{/other_user}", "gists_url": "https://api.github.com/users/galgeek/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/galgeek", "id": 3253863, "login": "galgeek", "node_id": "MDQ6VXNlcjMyNTM4NjM=", "organizations_url": "https://api.github.com/users/galgeek/orgs", "received_events_url": "https://api.github.com/users/galgeek/received_events", "repos_url": "https://api.github.com/users/galgeek/repos", "site_admin": false, "starred_url": "https://api.github.com/users/galgeek/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/galgeek/subscriptions", "type": "User", "url": "https://api.github.com/users/galgeek", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2016-11-16T03:05:08Z
2021-09-08T01:21:43Z
2016-11-16T08:38:33Z
CONTRIBUTOR
resolved
Make consistent with quickstart doc. _If_ true, this would be better: :param allow_redirects: (optional) Boolean. Whether redirects will be followed. Defaults to False for HEAD requests, True for all other methods.
{ "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/3690/reactions" }
https://api.github.com/repos/psf/requests/issues/3690/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/3690.diff", "html_url": "https://github.com/psf/requests/pull/3690", "merged_at": "2016-11-16T08:38:33Z", "patch_url": "https://github.com/psf/requests/pull/3690.patch", "url": "https://api.github.com/repos/psf/requests/pulls/3690" }
true
[ "Thanks @galgeek!\n", ":sparkles: :cake: :sparkles:\n" ]
https://api.github.com/repos/psf/requests/issues/3689
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/3689/labels{/name}
https://api.github.com/repos/psf/requests/issues/3689/comments
https://api.github.com/repos/psf/requests/issues/3689/events
https://github.com/psf/requests/issues/3689
189,553,499
MDU6SXNzdWUxODk1NTM0OTk=
3,689
security extras need to be updated
{ "avatar_url": "https://avatars.githubusercontent.com/u/6504915?v=4", "events_url": "https://api.github.com/users/bmw/events{/privacy}", "followers_url": "https://api.github.com/users/bmw/followers", "following_url": "https://api.github.com/users/bmw/following{/other_user}", "gists_url": "https://api.github.com/users/bmw/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/bmw", "id": 6504915, "login": "bmw", "node_id": "MDQ6VXNlcjY1MDQ5MTU=", "organizations_url": "https://api.github.com/users/bmw/orgs", "received_events_url": "https://api.github.com/users/bmw/received_events", "repos_url": "https://api.github.com/users/bmw/repos", "site_admin": false, "starred_url": "https://api.github.com/users/bmw/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/bmw/subscriptions", "type": "User", "url": "https://api.github.com/users/bmw", "user_view_type": "public" }
[ { "color": "e10c02", "default": false, "description": null, "id": 117744, "name": "Bug", "node_id": "MDU6TGFiZWwxMTc3NDQ=", "url": "https://api.github.com/repos/psf/requests/labels/Bug" }, { "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
2
2016-11-16T01:03:01Z
2021-09-08T14:00:35Z
2016-11-16T10:33:47Z
NONE
resolved
Starting with `urllib3` 1.17, `ndg-httpsclient` and `pyasn1` are no longer required to inject `pyopenssl` into `urllib3`. `cryptography` and `idna` are required instead. The result of this is if an older version of `pyopenssl` is installed and you run `pip install requests[security]`, you will see import errors when trying to inject `pyopenssl`.
{ "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/3689/reactions" }
https://api.github.com/repos/psf/requests/issues/3689/timeline
null
completed
null
null
false
[ "Yup, you're entirely correct.\n", "Given that we're shipping a patch release, I may just fix this myself and ship it today.\n" ]
https://api.github.com/repos/psf/requests/issues/3688
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/3688/labels{/name}
https://api.github.com/repos/psf/requests/issues/3688/comments
https://api.github.com/repos/psf/requests/issues/3688/events
https://github.com/psf/requests/pull/3688
189,495,375
MDExOlB1bGxSZXF1ZXN0OTM4Mzk5Mjg=
3,688
spelling fix for release-process.rst
{ "avatar_url": "https://avatars.githubusercontent.com/u/5271761?v=4", "events_url": "https://api.github.com/users/nateprewitt/events{/privacy}", "followers_url": "https://api.github.com/users/nateprewitt/followers", "following_url": "https://api.github.com/users/nateprewitt/following{/other_user}", "gists_url": "https://api.github.com/users/nateprewitt/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/nateprewitt", "id": 5271761, "login": "nateprewitt", "node_id": "MDQ6VXNlcjUyNzE3NjE=", "organizations_url": "https://api.github.com/users/nateprewitt/orgs", "received_events_url": "https://api.github.com/users/nateprewitt/received_events", "repos_url": "https://api.github.com/users/nateprewitt/repos", "site_admin": false, "starred_url": "https://api.github.com/users/nateprewitt/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/nateprewitt/subscriptions", "type": "User", "url": "https://api.github.com/users/nateprewitt", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2016-11-15T20:16:59Z
2021-09-08T01:21:43Z
2016-11-15T20:30:21Z
MEMBER
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/3688/reactions" }
https://api.github.com/repos/psf/requests/issues/3688/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/3688.diff", "html_url": "https://github.com/psf/requests/pull/3688", "merged_at": "2016-11-15T20:30:21Z", "patch_url": "https://github.com/psf/requests/pull/3688.patch", "url": "https://api.github.com/repos/psf/requests/pulls/3688" }
true
[ "Thanks @nateprewitt! :sparkles: :cake: :sparkles:\n" ]
https://api.github.com/repos/psf/requests/issues/3687
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/3687/labels{/name}
https://api.github.com/repos/psf/requests/issues/3687/comments
https://api.github.com/repos/psf/requests/issues/3687/events
https://github.com/psf/requests/issues/3687
189,487,689
MDU6SXNzdWUxODk0ODc2ODk=
3,687
because of idna2008 enforcement some real urls that work in the browser are now broken
{ "avatar_url": "https://avatars.githubusercontent.com/u/423176?v=4", "events_url": "https://api.github.com/users/nlevitt/events{/privacy}", "followers_url": "https://api.github.com/users/nlevitt/followers", "following_url": "https://api.github.com/users/nlevitt/following{/other_user}", "gists_url": "https://api.github.com/users/nlevitt/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/nlevitt", "id": 423176, "login": "nlevitt", "node_id": "MDQ6VXNlcjQyMzE3Ng==", "organizations_url": "https://api.github.com/users/nlevitt/orgs", "received_events_url": "https://api.github.com/users/nlevitt/received_events", "repos_url": "https://api.github.com/users/nlevitt/repos", "site_admin": false, "starred_url": "https://api.github.com/users/nlevitt/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/nlevitt/subscriptions", "type": "User", "url": "https://api.github.com/users/nlevitt", "user_view_type": "public" }
[]
closed
true
null
[]
null
13
2016-11-15T19:46:09Z
2021-09-25T06:00:18Z
2016-11-30T15:07:36Z
NONE
resolved
Because of idna2008 enforcement 2.12.0 some real urls that work in the browser are now broken. For example: http://β˜ƒ.net/ http://xn--n3h.net/ My suggestion would be to try idna2008 first, catch exception, then try idna2003. ``` >>> requests.get('http://xn--n3h.net/') Traceback (most recent call last): File "/Users/nlevitt/workspace/warcprox/warcprox-ve35/lib/python3.5/site-packages/requests/models.py", line 370, in prepare_url host = idna.encode(host, uts46=True).decode('utf-8') File "/Users/nlevitt/workspace/warcprox/warcprox-ve35/lib/python3.5/site-packages/requests/packages/idna/core.py", line 355, in encode result.append(alabel(label)) File "/Users/nlevitt/workspace/warcprox/warcprox-ve35/lib/python3.5/site-packages/requests/packages/idna/core.py", line 276, in alabel check_label(label) File "/Users/nlevitt/workspace/warcprox/warcprox-ve35/lib/python3.5/site-packages/requests/packages/idna/core.py", line 253, in check_label raise InvalidCodepoint('Codepoint {0} at position {1} of {2} not allowed'.format(_unot(cp_value), pos+1, repr(label))) requests.packages.idna.core.InvalidCodepoint: Codepoint U+0027 at position 2 of "b'xn--n3h'" not allowed During handling of the above exception, another exception occurred: Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/Users/nlevitt/workspace/warcprox/warcprox-ve35/lib/python3.5/site-packages/requests/api.py", line 70, in get return request('get', url, params=params, **kwargs) File "/Users/nlevitt/workspace/warcprox/warcprox-ve35/lib/python3.5/site-packages/requests/api.py", line 56, in request return session.request(method=method, url=url, **kwargs) File "/Users/nlevitt/workspace/warcprox/warcprox-ve35/lib/python3.5/site-packages/requests/sessions.py", line 474, in request prep = self.prepare_request(req) File "/Users/nlevitt/workspace/warcprox/warcprox-ve35/lib/python3.5/site-packages/requests/sessions.py", line 407, in prepare_request hooks=merge_hooks(request.hooks, self.hooks), File "/Users/nlevitt/workspace/warcprox/warcprox-ve35/lib/python3.5/site-packages/requests/models.py", line 302, in prepare self.prepare_url(url, params) File "/Users/nlevitt/workspace/warcprox/warcprox-ve35/lib/python3.5/site-packages/requests/models.py", line 372, in prepare_url raise InvalidURL('URL has an invalid label.') requests.exceptions.InvalidURL: URL has an invalid label. ```
{ "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": 4, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 4, "url": "https://api.github.com/repos/psf/requests/issues/3687/reactions" }
https://api.github.com/repos/psf/requests/issues/3687/timeline
null
completed
null
null
false
[ "Thanks for this report!\n\nUltimately, I'm not sure I agree. Fundamentally, those URIs will stop working at some point as browsers move over to IDNA 2008. They _will_ have to move over time in at least some cases, because the `.de` domain mandates it, so there's no alternative there. So I have no objection to having \"http://β˜ƒ.net/\".\n\nRight now I think the _real_ issue is that we attempt to IDNA-encode _everything_, and probably shouldn't. When a domain that is _already_ IDNA-encoded is passed to us we should probably just leave it alone. The idna project is considering doing the same (see kjd/idna#27), but we can get there ahead of them by saying that for certain URIs we simply short-circuit the encoding.\n\nThe logic would have to be:\n- If the host portion of the URL begins with `xn--`\n- AND either\n - the URL is a bytestring that can be decoded using ASCII OR\n - the URL is a unicode string that can be encoded using ASCII\n- THEN we skip IDNA encoding\n- ELSE we do the IDNA encoding\n\nThat would, I think, cover this problem. How does that sound?\n", "That sounds ok.\n", "I believe we may not need to worry about the case where the URL is a bytestring. `prepare_url` [transforms](https://github.com/kennethreitz/requests/blob/master/requests/models.py#L341-L344) it into unicode at the beginning of the method and re-encodes it on the way out.\n\n@nlevitt were you interested in providing a patch for this? If not, I believe I have a fix ready to go but will gladly defer to you.\n", "Go for it @nateprewitt\n", "I've experienced this issue with pylxd using the unix socket interface and requests-unixsocket. In our case, we have to do `parse('/path/to/unix.socket', safe='')` as a raw unix path clearly doesn't substitute for a host. This breaks in requests 2.12+, as the urlencoded version `%2Fpath%2Fto%2Funix.socket` doesn't IDNA encode properly and raises an exception. I only comment here as it might make an interesting test case to prevent further regressions.\n", "In my case, one of my test url contain upper case letter, it worked with `idna2003 ` but not with `idna2008`, if we have a fallback option that will be great.\r\n\r\n```\r\nQ: How does IDNA2008 differ from IDNA2003?\r\nA: It disallows about eight thousand characters that used to be valid, including all uppercase characters, full/half-width variants, symbols, and punctuation. It also interprets four characters differently.\r\n```\r\nhttp://unicode.org/faq/idn.html", "Uppercase letters should be fine, we've enabled a mapping mode that should make it safe. Can you provide the URL that fails?", "after investigate, I notice the subdomain I am testing is like \r\n```\r\nhttp://subdomain_1.example.com\r\n```\r\n\r\nand the `_` breaks in `idna2008 `\r\n\r\nwhich already be covered in this issue https://github.com/kennethreitz/requests/issues/3683", "@jnozsc Thanks for the example, we've had discussion regarding underscores in a separate thread which is now locked but your issue will be resolved with #3695 soon.", "I have the same problem, which I reported in kjd/idna#32, but it seems more to be an issue in requests than in idna.\r\n\r\n@Lukasa's logic sounds right to me.", "Should be fixed in Requests v2.12.2.", "FWIW, I use requests in project(s) where I want to handle web sites like these, eg https://todayinmarch2020.🦈πŸ–₯.ws/ , with domains that are valid IDNA2003 but invalid IDNA2008. To do that, I had to add in the `domain2idna` package and write code like this:\r\n\r\n```py\r\ntry:\r\n resp = requests.get(url, ...)\r\nexcept requests.exceptions.InvalidURL:\r\n punycode = domain2idna(url)\r\n if punycode != url:\r\n # the domain is valid idna2003 but not idna2008. encode and try again.\r\n resp = requests.get(punycode, ...)\r\n```\r\n\r\nI get that these domains may break at some point in the future, but that's a big unknown, and they're registered and serving fine now. I don't have a specific proposal or stronger argument, I just wish I had a less awkward workaround. I have a wrapper around `requests.*()`, so fortunately I only had to do this in one place, but if i made direct requests calls everywhere and had to wrap every one, I'd be pretty unhappy.\r\n\r\nThanks in advance for listening!", "I ended up doing more research here, and I'm curious about a design decision. Was it a deliberate choice to build in just IDNA2008 and not full Punycode? Or was `idna` the only mature package you found, and it only supported IDNA2008? Or something else?\r\n\r\nIDNA2008 evidently doesn't apply to all TLDs. Notably, unlike gTLDs, ccTLDs generally get to choose their own domain policies - [background from Wikipedia](https://en.wikipedia.org/wiki/Country_code_top-level_domain), [ICANN](https://www.icann.org/resources/pages/cctlds-21-2012-02-25-en), [a GoDaddy representative](https://github.com/kjd/idna/issues/18#issuecomment-830969692) - and a handful of them have stuck with IDNA2003, UTS#46, or related variants. (Not to mention older proprietary schemes like [ThaiURL](https://en.wikipedia.org/wiki/ThaiURL) 😁.)\r\n\r\nSimilarly, afaik domain owners can do whatever they want with their own subdomains. So thanks to Punycode, third level (and beyond) hostnames like https://πŸŒβž‘βž‘β€πŸ”’.ayeshious.com and https://πŸ”’πŸ”’πŸ”’.scotthelme.co.uk are not at risk of breaking due to gTLD regstries enforcing IDNA2008 on pay-level domain registrations.\r\n\r\nI know you all thought this through back in 2016, eg here and in https://github.com/psf/requests/issues/3683#issuecomment-261240279, and settled on automatically encoding IDNA2008 and passing through already-encoded hostnames. That seems a bit surprising, since IDNA2008 is only a subset of the currently legal encodings. Mind elaborating on why you didn't either push all encoding onto users, or build in the other legal standard encodings too, notably IDNA2003?\r\n\r\n(Thanks again for listening!)" ]
https://api.github.com/repos/psf/requests/issues/3686
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/3686/labels{/name}
https://api.github.com/repos/psf/requests/issues/3686/comments
https://api.github.com/repos/psf/requests/issues/3686/events
https://github.com/psf/requests/issues/3686
189,475,881
MDU6SXNzdWUxODk0NzU4ODE=
3,686
v2.12.0: URL has an invalid label error
{ "avatar_url": "https://avatars.githubusercontent.com/u/4811329?v=4", "events_url": "https://api.github.com/users/sfedr/events{/privacy}", "followers_url": "https://api.github.com/users/sfedr/followers", "following_url": "https://api.github.com/users/sfedr/following{/other_user}", "gists_url": "https://api.github.com/users/sfedr/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/sfedr", "id": 4811329, "login": "sfedr", "node_id": "MDQ6VXNlcjQ4MTEzMjk=", "organizations_url": "https://api.github.com/users/sfedr/orgs", "received_events_url": "https://api.github.com/users/sfedr/received_events", "repos_url": "https://api.github.com/users/sfedr/repos", "site_admin": false, "starred_url": "https://api.github.com/users/sfedr/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/sfedr/subscriptions", "type": "User", "url": "https://api.github.com/users/sfedr", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2016-11-15T18:55:40Z
2021-09-08T14:00:36Z
2016-11-15T19:06:40Z
NONE
resolved
When url contains an underscore the request fails with 'URL has an invalid label error' Seems like a result of updating to urllib3 to 1.19. While underscores in the hostname would not meet strict RFC requirements it would still work in many scenarios, so I would propose to remove the check Example: ``` requests.get('http://test_t') *** InvalidURL: URL has an invalid label. ```
{ "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/3686/reactions" }
https://api.github.com/repos/psf/requests/issues/3686/timeline
null
completed
null
null
false
[ "Thanks for opening this issue, @afaicode. This is currently being tracked in #3683 which will be the official issue for further discussion. I believe @Lukasa has stated underscores in host names are not behaviour we likely want to support, but you're welcome to raise objections in the appropriate issue.\n", "Yup, closing in favour of #3683.\n" ]
https://api.github.com/repos/psf/requests/issues/3685
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/3685/labels{/name}
https://api.github.com/repos/psf/requests/issues/3685/comments
https://api.github.com/repos/psf/requests/issues/3685/events
https://github.com/psf/requests/issues/3685
189,470,909
MDU6SXNzdWUxODk0NzA5MDk=
3,685
ImportError no module named urlparse
{ "avatar_url": "https://avatars.githubusercontent.com/u/308610?v=4", "events_url": "https://api.github.com/users/jaraco/events{/privacy}", "followers_url": "https://api.github.com/users/jaraco/followers", "following_url": "https://api.github.com/users/jaraco/following{/other_user}", "gists_url": "https://api.github.com/users/jaraco/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/jaraco", "id": 308610, "login": "jaraco", "node_id": "MDQ6VXNlcjMwODYxMA==", "organizations_url": "https://api.github.com/users/jaraco/orgs", "received_events_url": "https://api.github.com/users/jaraco/received_events", "repos_url": "https://api.github.com/users/jaraco/repos", "site_admin": false, "starred_url": "https://api.github.com/users/jaraco/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/jaraco/subscriptions", "type": "User", "url": "https://api.github.com/users/jaraco", "user_view_type": "public" }
[]
closed
true
null
[]
null
10
2016-11-15T18:33:58Z
2021-09-08T14:00:34Z
2016-11-15T19:08:51Z
CONTRIBUTOR
resolved
In #3682, @leth reported an error which I've just encountered: ``` $ python -m rwt requests -- -c "from requests.packages.urllib3.contrib import appengine as gaecontrib" Collecting requests Using cached requests-2.12.0-py2.py3-none-any.whl Installing collected packages: requests Successfully installed requests-2.12.0 Traceback (most recent call last): File "<string>", line 1, in <module> File "/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rr0000gn/T/rwt-pu44a5vi/requests/packages/urllib3/contrib/appengine.py", line 45, in <module> from urlparse import urljoin ModuleNotFoundError: No module named 'urlparse' ``` Because the source of #3682 appears to be unrelated to this Python 3 only bug, I'm opening a new issue. I have the same issue as leth, and requests_toolbelt is unusable due to this bug. I don't think I can wait for due time to pass. Should requests_toolbelt be trapping this exception?
{ "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/3685/reactions" }
https://api.github.com/repos/psf/requests/issues/3685/timeline
null
completed
null
null
false
[ "@jaraco I believe what you're seeing is shazow/urllib3#1025. It has been patched on master for urllib3 but was caught after 1.19 released. This may be enough of an issue to warrant bumping urllib3 to 1.19.1 and adding it to a 2.12.1 release? Until then, you'll likely need to use 2.11.1 unless @sigmavirus24 has a solution via requests-toolbelt.\n", "I can confirm that pinning to requests 2.11.1 is sufficient to work around the issue.\n\n```\n$ python -m rwt requests_toolbelt requests==2.11.1 -- -c \"import requests_toolbelt\"\nCollecting requests_toolbelt\n Using cached requests_toolbelt-0.7.0-py2.py3-none-any.whl\nCollecting requests==2.11.1\n Using cached requests-2.11.1-py2.py3-none-any.whl\nInstalling collected packages: requests, requests-toolbelt\nSuccessfully installed requests-2.11.1 requests-toolbelt-0.7.0\n```\n\nThat serves my use case and eliminates the urgency from my perspective.\n", "I'm not really feeling like rushing up to a new urllib3 release for this bug. So I'm going to say that downgrading to 2.11.1 is the best course of action for now, and the next major release of Requests will fix this issue. 😊\n", "> This may be enough of an issue to warrant bumping urllib3 to 1.19.1 and adding it to a 2.12.1 release?\n\n@nateprewitt Requests release procedures are clearly documented. Please don't make up policy that we don't follow for us.\n", "Sorry @sigmavirus24, I wasn't attempting to insinuate anything about policy. I was simply asking a question about severity. Thanks for pointing that documentation out, I had previously missed the sentence on vendoring changes.\n", "> I'm not really feeling like rushing up to a new urllib3 release for this bug. So I'm going to say that downgrading to 2.11.1 is the best course of action for now, and the next major release of Requests will fix this issue. 😊\n\n@Lukasa @sigmavirus24 \nThe last major release was almost 3 years ago. I'm hoping you meant minor? I see procedure allows vendor updates in minor releases. \n\nAssuming you did is there anything interested parties can do to speed up the release? Minor releases seem to come ever 3-4 months. Which is a bit long to wait for 1 line of code and miss the improvements in 2.12.0. Its certainly not a pleasant situation, but having just done a release is now not the cheapest time to do another one? Given that there are minimal changes to requests to deal with.\n\nhttp://docs.python-requests.org/en/master/community/release-process/\n", "Sorry, I did mean minor.\n\n@tunezaq Sure, except of course that the fix is in urllib3. That means it requires a release of urllib3, and the current master of urllib3 contains _substantial_ functional changes. That means that we'd be forcing a rapid release of urllib3 and a rapid release of Requests to ship the fix for this bug, which means that the pretty substantial release of urllib3 would get dropped before it was really ready for use.\n\nUltimately, it's just not as easy as it seems like it would be. Sorry!\n", "@Lukasa My bad, I had thought the change was in a released version.\n\nLast attempt :), would you consider a hotfix (cherry-pick) release to get the change into a `1.19.1` urllib3? I wasn't able to find a documented release process for the project, but that would allow this issue to be resolved very timely. I see urllib3 releases a bit more often, I would guess by the time its released again requests may not be in a place for a minor release. Seems like this is a \"critical window\" where the issue can be resolved now or in a couple months.\n", "The biggest reason I can think of for doing this is that right now this change broke requests-toolbelt on Python 3, and so by extension also broke twine on Python 3. See also sigmavirus24/requests-toolbelt#167. We have, in the past, put a bugfix release of urllib3 into a patch release of Requests, so we can probably bear to do that again.\n\nThis is pretty frustrating, and I think if we hadn't broken such major consumers then I wouldn't be so worried: there is little in 2.12.0 that is desperately valuable.\n", "Ok, I have shipped 2.12.1 that should resolve this issue.\n" ]
https://api.github.com/repos/psf/requests/issues/3684
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/3684/labels{/name}
https://api.github.com/repos/psf/requests/issues/3684/comments
https://api.github.com/repos/psf/requests/issues/3684/events
https://github.com/psf/requests/pull/3684
189,460,707
MDExOlB1bGxSZXF1ZXN0OTM4MTQ5NzM=
3,684
Add method to url tests
{ "avatar_url": "https://avatars.githubusercontent.com/u/5271761?v=4", "events_url": "https://api.github.com/users/nateprewitt/events{/privacy}", "followers_url": "https://api.github.com/users/nateprewitt/followers", "following_url": "https://api.github.com/users/nateprewitt/following{/other_user}", "gists_url": "https://api.github.com/users/nateprewitt/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/nateprewitt", "id": 5271761, "login": "nateprewitt", "node_id": "MDQ6VXNlcjUyNzE3NjE=", "organizations_url": "https://api.github.com/users/nateprewitt/orgs", "received_events_url": "https://api.github.com/users/nateprewitt/received_events", "repos_url": "https://api.github.com/users/nateprewitt/repos", "site_admin": false, "starred_url": "https://api.github.com/users/nateprewitt/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/nateprewitt/subscriptions", "type": "User", "url": "https://api.github.com/users/nateprewitt", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2016-11-15T17:50:02Z
2021-09-08T01:21:44Z
2016-11-15T17:51:42Z
MEMBER
resolved
Looks like we forgot methods in the tests for #3620 πŸ˜‰ Proposed/3.0.0 is having a tantrum because we started checking for a non-None method there. We should probably get ahead of that and just patch it on master now though.
{ "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/3684/reactions" }
https://api.github.com/repos/psf/requests/issues/3684/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/3684.diff", "html_url": "https://github.com/psf/requests/pull/3684", "merged_at": "2016-11-15T17:51:42Z", "patch_url": "https://github.com/psf/requests/pull/3684.patch", "url": "https://api.github.com/repos/psf/requests/pulls/3684" }
true
[ "Thanks @nateprewitt!\n" ]
https://api.github.com/repos/psf/requests/issues/3683
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/3683/labels{/name}
https://api.github.com/repos/psf/requests/issues/3683/comments
https://api.github.com/repos/psf/requests/issues/3683/events
https://github.com/psf/requests/issues/3683
189,411,935
MDU6SXNzdWUxODk0MTE5MzU=
3,683
URL has an invalid label.
{ "avatar_url": "https://avatars.githubusercontent.com/u/118285?v=4", "events_url": "https://api.github.com/users/MikeVL/events{/privacy}", "followers_url": "https://api.github.com/users/MikeVL/followers", "following_url": "https://api.github.com/users/MikeVL/following{/other_user}", "gists_url": "https://api.github.com/users/MikeVL/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/MikeVL", "id": 118285, "login": "MikeVL", "node_id": "MDQ6VXNlcjExODI4NQ==", "organizations_url": "https://api.github.com/users/MikeVL/orgs", "received_events_url": "https://api.github.com/users/MikeVL/received_events", "repos_url": "https://api.github.com/users/MikeVL/repos", "site_admin": false, "starred_url": "https://api.github.com/users/MikeVL/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/MikeVL/subscriptions", "type": "User", "url": "https://api.github.com/users/MikeVL", "user_view_type": "public" }
[ { "color": "e10c02", "default": false, "description": null, "id": 117744, "name": "Bug", "node_id": "MDU6TGFiZWwxMTc3NDQ=", "url": "https://api.github.com/repos/psf/requests/labels/Bug" } ]
closed
true
null
[]
null
29
2016-11-15T14:50:57Z
2016-11-30T15:07:22Z
2016-11-30T15:07:22Z
NONE
null
requests v2.12.0 ```python >>> import requests >>> requests.get('http://vluki_develop_624_solr:8983/solr/vluki') Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/local/lib/python2.7/dist-packages/requests/api.py", line 70, in get return request('get', url, params=params, **kwargs) File "/usr/local/lib/python2.7/dist-packages/requests/api.py", line 56, in request return session.request(method=method, url=url, **kwargs) File "/usr/local/lib/python2.7/dist-packages/requests/sessions.py", line 474, in request prep = self.prepare_request(req) File "/usr/local/lib/python2.7/dist-packages/requests/sessions.py", line 407, in prepare_request hooks=merge_hooks(request.hooks, self.hooks), File "/usr/local/lib/python2.7/dist-packages/requests/models.py", line 302, in prepare self.prepare_url(url, params) File "/usr/local/lib/python2.7/dist-packages/requests/models.py", line 372, in prepare_url raise InvalidURL('URL has an invalid label.') requests.exceptions.InvalidURL: URL has an invalid label. ```
{ "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/3683/reactions" }
https://api.github.com/repos/psf/requests/issues/3683/timeline
null
completed
null
null
false
[ "So this is arguably an increase in strictness thanks to our new idna library, but underscores are _not_ allowed in hostnames. See kjd/idna#17 for more. While this previously worked, I suspect that really it shouldn't have. Underscores are perfectly allowed in _DNS_, which is why this never encountered a problem prior to this, but for hostnames they're entirely forbidden.\n\nI'm inclined to say that this is within the bounds of things that are allowed to stop working in a minor release, as it's simply outside the realm of what RFCs allow.\n", "To be clear, your suitable workarounds are either to downgrade Requests or to change your hostnames to use hyphens instead of underscores. I'm proposing not to consider this a Requests bug, so you'd either be stuck on 2.11.1 for the rest of eternity or you'll need to change your hostnames to use hyphens.\n", "Ok, thanks! I will change my urls.\n", "Thanks for the report! :sparkles:\n", "We encountered the same issue today and comes to the same conclusion that they are not officially supported. In our situation, we tried to use the devpi CLI against a docker image with the hostname `infrastructure_pythondevpi_1`. The hostname was auto-generated by docker-compose with its own algorithm which is more or less: `PWD-NAME_SERVICE-NAME_NUMBER`. The issue is well-known but not yet fixed: https://github.com/docker/compose/issues/229.\n\nWe downgraded requests to bypass the problem.\n\nWhile underscores are not officially support it seems that both Firefox (https://bugzilla.mozilla.org/show_bug.cgi?id=479520#c45) and curl seems to works well with underscores:\n\n```\ncurl -I http://infrastructure_pythondevpi_1:3141/root/staging/+api\nHTTP/1.1 200 OK\nConnection: close\nContent-Type: application/json\nDate: Tue, 15 Nov 2016 16:36:40 GMT\n```\n\nI didn't saw any option in the idna library to accept these characters, so apart from avoiding requests>2.12.0 when having underscore hostnames, we have no choices, right?\n", "I'm afraid that's correct. Other workarounds include adding hosts or DNS aliases for hostnames with underscores in them.\n", "I have updated `requests` to `2.12.0` today and I have the same problem. \n\nUnfortunately, it's not easy to remove `_` from my hostnames - I have hundreds of them (legacy stuff). And I don't want to downgrade `requests` and to use an older version forever.\n\nMaybe you could add _an option_ to disable this validation?\n", "@kottenator we don't add options for things like this.\n", "Just a quick question @sigmavirus24 / @Lukasa \n\nServices like Amazon's SES, and Sengrid, use CNAMES with underscores in them for DKIM authentication. \n\nhttp://docs.aws.amazon.com/ses/latest/DeveloperGuide/easy-dkim-dns-records.html\n\nAs you've mentioned before, these are fine for DNS, but not for Hostnames.\n\nWhen you say Hostnames, I'm assuming you're talking about DNS records that are used for browsers, or similar tools, to access data, not for records that are used for stuff like the aforementioned DKIM records?\n", "@TetraEtc Exactly so. Underscores in DNS names are reasonably common (e.g. SRV records have mandatory underscores in them), but for _hostnames_ (that is, anything in the host part of a URL) they are not allowed.\n", "Well, this is a pity, as e.g. [gitlab-ci](https://docs.gitlab.com/ce/ci/docker/using_docker_images.html) replaces / with __ to build the hostname from the docker image name, so my integration tests broke out-of-the-blue.\n", "@mfriedenhagen the GitLab team is very receptive to bug reports and I consider this to be a problem on their end. Regardless, I believe the solution being worked on in #3695 will help you\n", "Unfortunately, I don't think #3695 will address this problem. #3695 is solely for bypassing hostnames that were IDNA encoded before the request was made. I haven't seen any comment by @Lukasa about changing how we are now handling underscores in hostnames. @sigmavirus24's advice to raise a bug report with GitLab is the way to go.\n", "Yup, there's no plan to tolerate underscores: they're not valid in hostnames, and people should avoid using them.\n", "Hm, so a lot of other network utilities are just tolerant (`ping`, `curl`, `wget`, `python.urllib`, `python.urllib2`, `java.net.URL`) but `requests` will not be among them, that is sad.\n", "Understand the underscore, not valid.\nBut what about IPv6 ?\n\n``` python\nimport requests\nurl = \"http://[2003:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:ed3d]:12900/system\"\nresponse = requests.get(url, auth=('admin', 'foobar'))\nprint response.text\n```\n\nGot the same exception with requests==2.12.1 (and >= 2.12)\n\n``` shell\nTraceback (most recent call last):\n File \"test_requests.py\", line 6, in <module>\n response = requests.get(url, auth=authentication)\n File \"/usr/local/lib/python2.7/site-packages/requests/api.py\", line 70, in get\n return request('get', url, params=params, **kwargs)\n File \"/usr/local/lib/python2.7/site-packages/requests/api.py\", line 56, in request\n return session.request(method=method, url=url, **kwargs)\n File \"/usr/local/lib/python2.7/site-packages/requests/sessions.py\", line 474, in request\n prep = self.prepare_request(req)\n File \"/usr/local/lib/python2.7/site-packages/requests/sessions.py\", line 407, in prepare_request\n hooks=merge_hooks(request.hooks, self.hooks),\n File \"/usr/local/lib/python2.7/site-packages/requests/models.py\", line 302, in prepare\n self.prepare_url(url, params)\n File \"/usr/local/lib/python2.7/site-packages/requests/models.py\", line 372, in prepare_url\n raise InvalidURL('URL has an invalid label.')\nrequests.exceptions.InvalidURL: URL has an invalid label.\n\n```\n", "@mfriedenhagen None of those tools tolerate IDNs. In this case it's a matter of picking what you want: do users want us to correctly tolerate internationalized domain names, or do they want to do their own IDN handling? I'm prepared to believe that most users do not want to do their own IDN handling.\n\n@rsaikali So that seems to be a bigger issue. And at this point we're in a bit of a bind because by default there aren't good tools to spot this specific problem (namely, we have an IP address here, not a hostname, so skip IDNA), which means we'd have to vendor the ipaddress module to get that to work. Alternatively, we could use some heuristics to detect possible IP addresses in hostnames and skip IDNA encoding for those as well.\n\nI think that's definitely a problem though.\n\nAn alternative solution to this is to say that if the `idna` module fails to encode we'll just go ahead and try to encode as ASCII. If that works then we shrug our shoulders and say everything is probably ok, and if it fails we catch that and throw `InvalidURL`. @sigmavirus24, how does that sound?\n", "Do you want me to open a new ticket for that ? \"InvalidURL: URL has an invalid label. (with IPv6)\"\nThis one is currently closed.\n", "Nope. =)\n", "Just my 1c: I am all for standards! But I am also pragmatic -- in my case with this upgrade of `requests` I started to experience this behavior, whenever any other tool (browsers, etc) is working just fine. Hostname in my case is not to be immediately renamed and underscore version immediately abandoned since this is a project which was out there for years, referenced in many scientific papers, etc. So what should we do now? we apparently can't simply adhere to standard 100%, we can't simply rename and forward (once again -- url is already spread out), we can't demand downgrades of requests... \r\n\r\nActually! that restriction (no `_`) applies to **hostnames** not **DNS** records (see e.g. http://stackoverflow.com/a/2183140/1265472). Here we are actually talking about URLs and I do not think that those must contain only hostnames! (needless to say that not every URL points to a different host ;) ) See https://tools.ietf.org/html/rfc3986#section-3.2.2 which defines `reg-name` (not a hostname) and here is relevant description:\r\n\r\n```\r\n Such a name consists of a sequence of domain labels separated by \".\",\r\n each domain label starting and ending with an alphanumeric character\r\n and possibly also containing \"-\" characters. The rightmost domain\r\n label of a fully qualified domain name in DNS may be followed by a\r\n single \".\" and should be if it is necessary to distinguish between\r\n the complete domain name and some local domain.\r\n\r\n reg-name = *( unreserved / pct-encoded / sub-delims )\r\n```\r\nwhich refers to \"domain names\" (once again which might be hostnames or some other DNS records). So as far as I see it, it is actually `requests` which by using `idna` to verify that `reg-name` is a standard compliant **hostname**, unnecessarily imposes restriction that URLs must contain only hostnames in `reg-name`.\r\nWhat do you think? ;)\r\n\r\nCC: @chaselgrove ", "@yarikoptic It might have helped to read the discussion more carefully: the core devs are already in agreement with you, and we're taking steps to resolve the problem (see #3695). You could have saved yourself a bit of time by checking that first.\r\n\r\n*However*, addressing the substantive portion of your complaint:\r\n\r\n> So as far as I see it, it is actually `requests` which by using `idna` to verify that `reg-name` is a standard compliant **hostname**, unnecessarily imposes restriction that URLs must contain only hostnames in `reg-name`.\r\n\r\nA fuller read of that section will reveal to you that the only ambiguity is between `reg-name` and `IP-literal`/`IPv4address`. Again, as noted above, the Requests team is already in agreement that Requests has inadvertently blocked IP addresses. However, the `reg-name` argument is a bad one. `reg-name` is defined with a very general ABNF because, as the RFC states, it is not limited to DNS or any specific form of lookups. The host portion of a *general* URI may cover quite a lot of name formats.\r\n\r\nHowever, we aren't dealing with *general* URIs. We only support URIs that contain either IP address literals (in which case we do no name resolution) or hostnames (in which case we do an A lookup). These are not expected to be generalised names.\r\n\r\nHowever, we need to follow the furrow that browsers have ploughed for us, and they have no interest in enforcing restrictions on URL formatting. This is why we're working on a fix.\r\n\r\n\r\n**To all other readers of this issue: please do not add your 2Β’ or \"me too\"s. We already acknowledge this to be an issue. We are working on a fix. Please wait patiently for that fix to come through.**", "@Lukasa Thank you very much for the rapid reply!!! very much appreciated. And hopefully now ppl would see your statement in bold (feel free to remove my reply to not shadow it), and not e.g. `Yup, there's no plan to tolerate underscores: they're not valid in hostnames, and people should avoid using them.` just from few days back. Also if label `Propose Close` was replaced with `Fix pending` or something like that -- could help as well. another way is to adjust initial bug report description with pointer to a tentative fix.\r\nCheers!", "Re reg-name argument, just for my education sake, could you please point to the portion of some relevant RFC or any other document stating that URL, as a subset of URIs must use **hostname** and not a **domain name**? (as far as I see it, `A` DNS record not necessarily refers to a **hostname**, as far as I see from e.g. http://www.freesoft.org/CIE/RFC/1035/34.htm )", "`A` records aren't limited to hostnames: *Requests* is. Requests supports IP addresses (with no name resolution) or hostnames (with `A`/`AAAA` record lookup). We do not support any other method of identifying the authority.", "still confused (e.g. on either you are saying that `requests` intensionally not compliant with existing standards or limiting its applicability, or you are describing current broken state, or just me misunderstanding something) but that is ok -- I trust you guys to fix it properly and life becoming great again ;) Have a lovely week!", "Hello, I tried understanding rfc 3986 (URIs) and 3987 (IRIs) As outlined in http://stackoverflow.com/questions/1856785/characters-allowed-in-a-url as well, the two rfcs seem to allow the usage of underscores in hostnames if I am not mistaken.", "Ok, so to be clear: I am talking specifically about *hostnames*. Not URLs: those are a more general construct. Many valid URLs are not valid HTTP urls, and many of those are not accepted by Requests.\r\n\r\nHowever, and I cannot stress this enough, **we are already fixing the problem**. There is no argument to be won here. So rather than fill up my inbox with mail and force me to reply to you all, if you're interested in seeing this issue fixed I highly recommend you wait patiently.\r\n\r\nTo reduce the noise in this issue I'm locking it to contributors only until such time as we land the fix, at which point I will allow third party comments again.", "@mfriedenhagen to attempt to help with your confusion, you should be looking at the IDNA standard documents (which you can discover from https://tools.ietf.org/html/rfc5890)", "Should be resolved in v2.12.2. Thanks for your time all." ]
https://api.github.com/repos/psf/requests/issues/3682
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/3682/labels{/name}
https://api.github.com/repos/psf/requests/issues/3682/comments
https://api.github.com/repos/psf/requests/issues/3682/events
https://github.com/psf/requests/issues/3682
189,298,636
MDU6SXNzdWUxODkyOTg2MzY=
3,682
ImportError
{ "avatar_url": "https://avatars.githubusercontent.com/u/22092607?v=4", "events_url": "https://api.github.com/users/moyotar/events{/privacy}", "followers_url": "https://api.github.com/users/moyotar/followers", "following_url": "https://api.github.com/users/moyotar/following{/other_user}", "gists_url": "https://api.github.com/users/moyotar/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/moyotar", "id": 22092607, "login": "moyotar", "node_id": "MDQ6VXNlcjIyMDkyNjA3", "organizations_url": "https://api.github.com/users/moyotar/orgs", "received_events_url": "https://api.github.com/users/moyotar/received_events", "repos_url": "https://api.github.com/users/moyotar/repos", "site_admin": false, "starred_url": "https://api.github.com/users/moyotar/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/moyotar/subscriptions", "type": "User", "url": "https://api.github.com/users/moyotar", "user_view_type": "public" }
[]
closed
true
null
[]
null
21
2016-11-15T04:42:02Z
2021-09-08T14:00:31Z
2016-11-16T18:35:44Z
NONE
resolved
![image](https://cloud.githubusercontent.com/assets/22092607/20293383/d69fac28-ab30-11e6-955e-634e0568ea8f.png)
{ "avatar_url": "https://avatars.githubusercontent.com/u/240830?v=4", "events_url": "https://api.github.com/users/sigmavirus24/events{/privacy}", "followers_url": "https://api.github.com/users/sigmavirus24/followers", "following_url": "https://api.github.com/users/sigmavirus24/following{/other_user}", "gists_url": "https://api.github.com/users/sigmavirus24/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/sigmavirus24", "id": 240830, "login": "sigmavirus24", "node_id": "MDQ6VXNlcjI0MDgzMA==", "organizations_url": "https://api.github.com/users/sigmavirus24/orgs", "received_events_url": "https://api.github.com/users/sigmavirus24/received_events", "repos_url": "https://api.github.com/users/sigmavirus24/repos", "site_admin": false, "starred_url": "https://api.github.com/users/sigmavirus24/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/sigmavirus24/subscriptions", "type": "User", "url": "https://api.github.com/users/sigmavirus24", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/3682/reactions" }
https://api.github.com/repos/psf/requests/issues/3682/timeline
null
completed
null
null
false
[ "This looks like you have had a problem with your installation. Where did you install requests from?\n", "I'm seeing a potentially similar error on python 3; I believe it comes from https://github.com/kennethreitz/requests/blob/master/requests/packages/urllib3/contrib/appengine.py#L45\n\nNote the double traceback, the second error is misleading:\n\n```\nTraceback (most recent call last):\n File \".tox/py35/lib/python3.5/site-packages/requests_toolbelt/_compat.py\", line 49, in <module>\n from requests.packages.urllib3.contrib import appengine as gaecontrib\n File \".tox/py35/lib/python3.5/site-packages/requests/packages/urllib3/contrib/appengine.py\", line 45, in <module>\n from urlparse import urljoin\nImportError: No module named 'urlparse'\n\nDuring handling of the above exception, another exception occurred:\n\nTraceback (most recent call last):\n File \".tox/py35/lib/python3.5/site-packages/nose/failure.py\", line 39, in runTest\n raise self.exc_val.with_traceback(self.tb)\n File \".tox/py35/lib/python3.5/site-packages/nose/loader.py\", line 418, in loadTestsFromName\n addr.filename, addr.module)\n File \".tox/py35/lib/python3.5/site-packages/nose/importer.py\", line 47, in importFromPath\n return self.importFromDir(dir_path, fqname)\n File \".tox/py35/lib/python3.5/site-packages/nose/importer.py\", line 94, in importFromDir\n mod = load_module(part_fqname, fh, filename, desc)\n File \".tox/py35/lib/python3.5/imp.py\", line 234, in load_module\n return load_source(name, filename, file)\n File \".tox/py35/lib/python3.5/imp.py\", line 172, in load_source\n module = _load(spec)\n File \"<frozen importlib._bootstrap>\", line 693, in _load\n File \"<frozen importlib._bootstrap>\", line 673, in _load_unlocked\n File \"<frozen importlib._bootstrap_external>\", line 665, in exec_module\n File \"<frozen importlib._bootstrap>\", line 222, in _call_with_frames_removed\n File \"ttm_cli/tests/test_objects.py\", line 7, in <module>\n from ttm_cli.tests.mock_ttm import MockTTM\n File \"ttm_cli/tests/mock_ttm.py\", line 11, in <module>\n from ttm_cli.ttm import TTM\n File \"ttm_cli/ttm.py\", line 11, in <module>\n from requests_toolbelt import MultipartEncoder\n File \".tox/py35/lib/python3.5/site-packages/requests_toolbelt/__init__.py\", line 12, in <module>\n from .adapters import SSLAdapter, SourceAddressAdapter\n File \".tox/py35/lib/python3.5/site-packages/requests_toolbelt/adapters/__init__.py\", line 12, in <module>\n from .ssl import SSLAdapter\n File \".tox/py35/lib/python3.5/site-packages/requests_toolbelt/adapters/ssl.py\", line 16, in <module>\n from .._compat import poolmanager\n File \".tox/py35/lib/python3.5/site-packages/requests_toolbelt/_compat.py\", line 51, in <module>\n from urllib3.contrib import appengine as gaecontrib\nImportError: No module named 'urllib3'\n```\n", "I don't think that's quite the same: the traceback is different. \n", "Yeah it may be importing via a different route, but you see `ImportError: No module named 'urllib3'` when the issue is actually from `ImportError: No module named 'urlparse'`\n", "@leth That's a Python 3 specific traceback format, but Python 2 doesn't show that. And in this case, we can see where the failing import is, and it doesn't attempt to import the `gaecontrib` module. So it's definitely a different issue.\n", "@leth further, your traceback is from the requests_toolbelt, not requests itself.\n", "Okay, fine, you can reproduce it without toolbelt installed though, but perhaps this is unsupported: `python3 -c 'import requests.packages.urllib3.contrib.appengine'`\n", "@moyotar you seem to be using [ycmd](https://github.com/Valloric/ycmd) which uses [git submodules](https://github.com/Valloric/ycmd/tree/master/third_party) to vendory dependencies. Specifically it uses python-future, which has been known to break urllib3 because of the incredibly poor way in which it _attempts_ to provide python 2 and 3 compatibility.\n", "@leth It's not unsupported, please update requests to 2.12.0 which resolves that problem.\n", "@leth Sorry, that's not quite true: the issue is fixed in urllib3 master and will come through to Requests in due course. Right now urllib3's appengine support doesn't work on Python 3.\n", "@Lukasa I installed `ycmd` which includes `requests` in windows 7. I copied it to windows 10.\n", "@moyotar that doesn't really answer our question of what you used to install it.\n\nEither way, this seems (at first glance) to be an issue you should bring up with the [ycmd mailing list](https://groups.google.com/forum/?hl=en#!forum/ycmd-users).\n", "@sigmavirus24 I don't really understand what you mean. It's about my python version? If yes, it's python27.\n", "I just installed `ycmd` by following instruction. And the one thing I did is that I moved `ycmd` from win7 to win10.\n", "@Lukasa @sigmavirus24 Up to now, I don't kown why I got this error and have no ideas to solve it. I'd be really appreciate if you can give me some help.\n", "We're not really able to help you. You'll have to check with the `ycmd` folks to see what's going on, but their installation appears to be broken.\n", "I agree with @Lukasa. You've also provided us minimal information. I couldn't reproduce this if I tried because I don't know what instructions you followed and while we've asked for more detail you haven't provided it. We can't help you if you won't let us.\n", "@sigmavirus24 Sorry.I don't understand what info you need. The error output is as the pic. I followed [ycmd's building](https://github.com/Valloric/ycmd#building) to install it.\n", "@moyotar Moving ycmd from Win 7 to Win 10 is probably what's causing this, and that's the info we'd need. You're pretty vague about what you meant by \"moving\", did you reinstall, or did you copy a folder? You also mentioned Windows, and didn't actually link to ycmd's instructions for installing on Windows. You linked general build instructions that then pass you off to a different page for Windows.\n\nIf you want support for FOSS the goal should be to overflow the maintainers with information and reproducible steps for your bug. Most open source packages at this level function because the maintainers work for almost or literally free.\n\nThere's a pretty huge gulf between the stacktrace you get and what library maintainers need to actually resolve the issue, it seems like you're conflating the two.\n\nEDIT: I didn't mean to come off so harsh, it's just that I've seen the work the Requests team puts into this library, and they will go above what's reasonably expected to help you if you give them anything to work with.\n", "@drpoggi Thanks! Now I decide to reinstall `ycmd` to get it work.\n", "The issue was caused by different versions of Python 2 installed on the same machine. See https://github.com/Valloric/ycmd/issues/646 for details. Nothing to do with python-future.\n" ]
https://api.github.com/repos/psf/requests/issues/3681
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/3681/labels{/name}
https://api.github.com/repos/psf/requests/issues/3681/comments
https://api.github.com/repos/psf/requests/issues/3681/events
https://github.com/psf/requests/issues/3681
189,278,493
MDU6SXNzdWUxODkyNzg0OTM=
3,681
NewConnectionError [Errno 10060]
{ "avatar_url": "https://avatars.githubusercontent.com/u/15278783?v=4", "events_url": "https://api.github.com/users/LancelotHolmes/events{/privacy}", "followers_url": "https://api.github.com/users/LancelotHolmes/followers", "following_url": "https://api.github.com/users/LancelotHolmes/following{/other_user}", "gists_url": "https://api.github.com/users/LancelotHolmes/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/LancelotHolmes", "id": 15278783, "login": "LancelotHolmes", "node_id": "MDQ6VXNlcjE1Mjc4Nzgz", "organizations_url": "https://api.github.com/users/LancelotHolmes/orgs", "received_events_url": "https://api.github.com/users/LancelotHolmes/received_events", "repos_url": "https://api.github.com/users/LancelotHolmes/repos", "site_admin": false, "starred_url": "https://api.github.com/users/LancelotHolmes/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/LancelotHolmes/subscriptions", "type": "User", "url": "https://api.github.com/users/LancelotHolmes", "user_view_type": "public" }
[]
closed
true
null
[]
null
5
2016-11-15T01:54:52Z
2021-09-08T11:00:30Z
2016-11-30T15:07:45Z
NONE
resolved
I tried to use the `Geocoding API` of goole maps to convert the address to coordinates, but it failed which seems to be related to `requests` when I tried the sample code like: ``` gmaps=googlemaps.Client(key='MY_KEY') geocode_result=gmaps.geocode('1600 Amphitheatre Parkway, Mountain View, CA') print geocode_result ``` but I got an exception like ``` googlemaps.exceptions.TransportError: HTTPSConnectionPool(host='maps.googleapis.com', port=443): Max retries exceeded with url: /maps/api/geocode/json?address=1600+Amphitheatre+Parkway%2C+Mountain+View%2C+CA&key=AIzaSyBYdEWfcUNHUP3zLtc17nX-3aE4uPUkFnY (Caused by NewConnectionError('<requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x0000000016239278>: Failed to establish a new connection: [Errno 10060] ',)) ``` BTW, I am work on PyCharm with python version 2.7.12 and I am using a VPN, I wonder if it's related to this. Any help is appreciated, thanks in advance.
{ "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/3681/reactions" }
https://api.github.com/repos/psf/requests/issues/3681/timeline
null
completed
null
null
false
[ "This is almost certainly related to your networking setup. Essentially, \"failed to establish a new connection\" is telling you that we weren't able to connect to `maps.googleapis.com`. Exactly why and how to fix it is a different matter: there are lots of possible problems here.\n\nWhat kind of VPN are you using? What version of Requests is installed?\n", "thanks you @Lukasa ,I use `shadowsocks` and the version of my requests is `2.10.0` while it's used to be `2.9.1` and updated with the install of google map api;\nbtw, I can get a correct json format result if I hardcode the url `https://maps.googleapis.com/maps/api/geocode/json?address=1600+Amphitheatre+Parkway,+Mountain+View,+CA&key=AIzaSyBYdEWfcUNHUP3zLtc17nX-3aE4uPUkFnY` in my web browser.\n", "So you should consider upgrading to Requests 2.12.0: it's possible that you're bumping into problems with our SOCKS detection. The other possibility is that you're bumping into a Requests limitation, which is that we currently always do local DNS lookups rather than getting the proxy to do the DNS lookup.\n", "However, @googlemaps only support Requests <= `2.11.1`", "@fixablecar That seems like it's their problem, not ours." ]
https://api.github.com/repos/psf/requests/issues/3680
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/3680/labels{/name}
https://api.github.com/repos/psf/requests/issues/3680/comments
https://api.github.com/repos/psf/requests/issues/3680/events
https://github.com/psf/requests/pull/3680
189,245,462
MDExOlB1bGxSZXF1ZXN0OTM2NjIxNjU=
3,680
Create companies adresses Google +
{ "avatar_url": "https://avatars.githubusercontent.com/u/20781829?v=4", "events_url": "https://api.github.com/users/ClemHermann/events{/privacy}", "followers_url": "https://api.github.com/users/ClemHermann/followers", "following_url": "https://api.github.com/users/ClemHermann/following{/other_user}", "gists_url": "https://api.github.com/users/ClemHermann/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/ClemHermann", "id": 20781829, "login": "ClemHermann", "node_id": "MDQ6VXNlcjIwNzgxODI5", "organizations_url": "https://api.github.com/users/ClemHermann/orgs", "received_events_url": "https://api.github.com/users/ClemHermann/received_events", "repos_url": "https://api.github.com/users/ClemHermann/repos", "site_admin": false, "starred_url": "https://api.github.com/users/ClemHermann/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/ClemHermann/subscriptions", "type": "User", "url": "https://api.github.com/users/ClemHermann", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2016-11-14T22:32:18Z
2021-09-08T01:21:45Z
2016-11-14T22:50:13Z
NONE
resolved
{ "avatar_url": "https://avatars.githubusercontent.com/u/240830?v=4", "events_url": "https://api.github.com/users/sigmavirus24/events{/privacy}", "followers_url": "https://api.github.com/users/sigmavirus24/followers", "following_url": "https://api.github.com/users/sigmavirus24/following{/other_user}", "gists_url": "https://api.github.com/users/sigmavirus24/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/sigmavirus24", "id": 240830, "login": "sigmavirus24", "node_id": "MDQ6VXNlcjI0MDgzMA==", "organizations_url": "https://api.github.com/users/sigmavirus24/orgs", "received_events_url": "https://api.github.com/users/sigmavirus24/received_events", "repos_url": "https://api.github.com/users/sigmavirus24/repos", "site_admin": false, "starred_url": "https://api.github.com/users/sigmavirus24/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/sigmavirus24/subscriptions", "type": "User", "url": "https://api.github.com/users/sigmavirus24", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/3680/reactions" }
https://api.github.com/repos/psf/requests/issues/3680/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/3680.diff", "html_url": "https://github.com/psf/requests/pull/3680", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/3680.patch", "url": "https://api.github.com/repos/psf/requests/pulls/3680" }
true
[ "No thank you\n" ]
https://api.github.com/repos/psf/requests/issues/3679
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/3679/labels{/name}
https://api.github.com/repos/psf/requests/issues/3679/comments
https://api.github.com/repos/psf/requests/issues/3679/events
https://github.com/psf/requests/pull/3679
189,181,213
MDExOlB1bGxSZXF1ZXN0OTM2MTU3MTY=
3,679
Amplifies the timeout warning in the docs.
{ "avatar_url": "https://avatars.githubusercontent.com/u/236970?v=4", "events_url": "https://api.github.com/users/mlissner/events{/privacy}", "followers_url": "https://api.github.com/users/mlissner/followers", "following_url": "https://api.github.com/users/mlissner/following{/other_user}", "gists_url": "https://api.github.com/users/mlissner/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/mlissner", "id": 236970, "login": "mlissner", "node_id": "MDQ6VXNlcjIzNjk3MA==", "organizations_url": "https://api.github.com/users/mlissner/orgs", "received_events_url": "https://api.github.com/users/mlissner/received_events", "repos_url": "https://api.github.com/users/mlissner/repos", "site_admin": false, "starred_url": "https://api.github.com/users/mlissner/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/mlissner/subscriptions", "type": "User", "url": "https://api.github.com/users/mlissner", "user_view_type": "public" }
[]
closed
true
null
[]
null
4
2016-11-14T17:57:40Z
2021-09-08T01:21:46Z
2016-11-14T17:58:13Z
CONTRIBUTOR
resolved
Partially addresses #3070 until a fix can come in the next major version.
{ "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/3679/reactions" }
https://api.github.com/repos/psf/requests/issues/3679/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/3679.diff", "html_url": "https://github.com/psf/requests/pull/3679", "merged_at": "2016-11-14T17:58:13Z", "patch_url": "https://github.com/psf/requests/pull/3679.patch", "url": "https://api.github.com/repos/psf/requests/pulls/3679" }
true
[ "Thanks @mlissner! :sparkles:\n", "Sorry, I don't mean to be a squeaky wheel. Isn't this already stated two sentences later? We may want to delete one so we're not saying the same thing twice.\n\n> If no timeout is specified explicitly, requests do not time out.\n", "I don't think I mind the duplication here: they say the same thing in different language, which is potentially useful in a case like this.\n", "I'm fine with removing the second mention if folks want, but I agree with @Lukasa too. I didn't realize for ages that a request not timing out meant my program would hang until I killed it. It's a pretty critical issue in my opinion, so being super-duper, repetitively explicit doesn't seem like a bad thing to me.\n" ]
https://api.github.com/repos/psf/requests/issues/3678
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/3678/labels{/name}
https://api.github.com/repos/psf/requests/issues/3678/comments
https://api.github.com/repos/psf/requests/issues/3678/events
https://github.com/psf/requests/pull/3678
189,165,209
MDExOlB1bGxSZXF1ZXN0OTM2MDQwMjQ=
3,678
decoding fix for Streaming Requests docs
{ "avatar_url": "https://avatars.githubusercontent.com/u/5271761?v=4", "events_url": "https://api.github.com/users/nateprewitt/events{/privacy}", "followers_url": "https://api.github.com/users/nateprewitt/followers", "following_url": "https://api.github.com/users/nateprewitt/following{/other_user}", "gists_url": "https://api.github.com/users/nateprewitt/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/nateprewitt", "id": 5271761, "login": "nateprewitt", "node_id": "MDQ6VXNlcjUyNzE3NjE=", "organizations_url": "https://api.github.com/users/nateprewitt/orgs", "received_events_url": "https://api.github.com/users/nateprewitt/received_events", "repos_url": "https://api.github.com/users/nateprewitt/repos", "site_admin": false, "starred_url": "https://api.github.com/users/nateprewitt/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/nateprewitt/subscriptions", "type": "User", "url": "https://api.github.com/users/nateprewitt", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2016-11-14T16:54:19Z
2021-09-08T01:21:46Z
2016-11-14T16:55:33Z
MEMBER
resolved
This will address #3675 with 71b8941. I've added an additional commit (d81ad06) noting a suggested best practice of providing an encoding fallback when using the `decode_unicode` parameter. This is an optional improvement that I can strip if we only want the bare bones fix.
{ "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/3678/reactions" }
https://api.github.com/repos/psf/requests/issues/3678/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/3678.diff", "html_url": "https://github.com/psf/requests/pull/3678", "merged_at": "2016-11-14T16:55:33Z", "patch_url": "https://github.com/psf/requests/pull/3678.patch", "url": "https://api.github.com/repos/psf/requests/pulls/3678" }
true
[ "LGTM, let's do this! Thanks @nateprewitt! :sparkles: :cake: :sparkles:\n" ]
https://api.github.com/repos/psf/requests/issues/3677
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/3677/labels{/name}
https://api.github.com/repos/psf/requests/issues/3677/comments
https://api.github.com/repos/psf/requests/issues/3677/events
https://github.com/psf/requests/issues/3677
189,142,113
MDU6SXNzdWUxODkxNDIxMTM=
3,677
[Errno -3] Temporary failure in name resolution
{ "avatar_url": "https://avatars.githubusercontent.com/u/10743049?v=4", "events_url": "https://api.github.com/users/kalyanakannan/events{/privacy}", "followers_url": "https://api.github.com/users/kalyanakannan/followers", "following_url": "https://api.github.com/users/kalyanakannan/following{/other_user}", "gists_url": "https://api.github.com/users/kalyanakannan/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kalyanakannan", "id": 10743049, "login": "kalyanakannan", "node_id": "MDQ6VXNlcjEwNzQzMDQ5", "organizations_url": "https://api.github.com/users/kalyanakannan/orgs", "received_events_url": "https://api.github.com/users/kalyanakannan/received_events", "repos_url": "https://api.github.com/users/kalyanakannan/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kalyanakannan/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kalyanakannan/subscriptions", "type": "User", "url": "https://api.github.com/users/kalyanakannan", "user_view_type": "public" }
[]
closed
true
null
[]
null
13
2016-11-14T15:31:19Z
2018-10-06T23:25:16Z
2016-11-14T15:31:57Z
NONE
resolved
While trying to get access token from api I getting the follwoing error, ConnectionError: HTTPSConnectionPool(host='', port=443): Max retries exceeded with url: /oauth2/access_token/ (Caused by <class 'socket.gaierror'>: [Errno -3] Temporary failure in name resolution) Is there any way I can resolve this error? 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/3677/reactions" }
https://api.github.com/repos/psf/requests/issues/3677/timeline
null
completed
null
null
false
[ "This error means that a DNS problem occurred and we couldn't resolve the IP address. If you see this problem you should simply retry the request.\n", "Already I have tried that, but it's not working for me. Shall I try with IP address Or is there any other solution for this?\n", "Can you print the URL you're trying to reach?\n", "I tried the same API URL in postman, its working fine. But in my request method, it throws the above error.\n", "So this strongly suggests you have a problem with your OS or Python configuration, or possibly your URL, because it seems like the Python code cannot resolve the domain name.\n", "I am getting the right URL from requests. Following warning error message is displayed while running the script. Is there any issues?\n\n/usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/util/ssl_.py:315: SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validation failures. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#snimissingwarning.\n SNIMissingWarning\n/usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/util/ssl_.py:120: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.\n InsecurePlatformWarning\n", "Those error messages aren't going to be relevant, no. Can you set `allow_redirects=False` to see if you're being redirected away?\n", "it's working now. problem from dns system. thank you\n", "how did u resolve dns problem???", "I face the same problem, and solved by restart computer", "I fixed this by disabling my VPN", "You have issues with your DNS. Check on your system that public interface is configured to use correct DNS servers.", "For me, it was the firewall that was blocking the connection. I'm using ufw .. the following command fixed it for me.\r\n`sudo ufw allow out to any port 53`\r\ndon't forget to reload ufw\r\n`sudo ufw reload`" ]
https://api.github.com/repos/psf/requests/issues/3676
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/3676/labels{/name}
https://api.github.com/repos/psf/requests/issues/3676/comments
https://api.github.com/repos/psf/requests/issues/3676/events
https://github.com/psf/requests/issues/3676
189,112,748
MDU6SXNzdWUxODkxMTI3NDg=
3,676
SOCKS DNS lookup isn't through proxy
{ "avatar_url": "https://avatars.githubusercontent.com/u/1687787?v=4", "events_url": "https://api.github.com/users/owenson/events{/privacy}", "followers_url": "https://api.github.com/users/owenson/followers", "following_url": "https://api.github.com/users/owenson/following{/other_user}", "gists_url": "https://api.github.com/users/owenson/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/owenson", "id": 1687787, "login": "owenson", "node_id": "MDQ6VXNlcjE2ODc3ODc=", "organizations_url": "https://api.github.com/users/owenson/orgs", "received_events_url": "https://api.github.com/users/owenson/received_events", "repos_url": "https://api.github.com/users/owenson/repos", "site_admin": false, "starred_url": "https://api.github.com/users/owenson/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/owenson/subscriptions", "type": "User", "url": "https://api.github.com/users/owenson", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2016-11-14T13:31:04Z
2021-09-08T14:00:38Z
2016-11-14T13:31:43Z
NONE
resolved
{ "avatar_url": "https://avatars.githubusercontent.com/u/1687787?v=4", "events_url": "https://api.github.com/users/owenson/events{/privacy}", "followers_url": "https://api.github.com/users/owenson/followers", "following_url": "https://api.github.com/users/owenson/following{/other_user}", "gists_url": "https://api.github.com/users/owenson/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/owenson", "id": 1687787, "login": "owenson", "node_id": "MDQ6VXNlcjE2ODc3ODc=", "organizations_url": "https://api.github.com/users/owenson/orgs", "received_events_url": "https://api.github.com/users/owenson/received_events", "repos_url": "https://api.github.com/users/owenson/repos", "site_admin": false, "starred_url": "https://api.github.com/users/owenson/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/owenson/subscriptions", "type": "User", "url": "https://api.github.com/users/owenson", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/3676/reactions" }
https://api.github.com/repos/psf/requests/issues/3676/timeline
null
completed
null
null
false
[ "closed\n" ]
https://api.github.com/repos/psf/requests/issues/3675
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/3675/labels{/name}
https://api.github.com/repos/psf/requests/issues/3675/comments
https://api.github.com/repos/psf/requests/issues/3675/events
https://github.com/psf/requests/issues/3675
188,939,913
MDU6SXNzdWUxODg5Mzk5MTM=
3,675
Streaming Requests documentation error for Python 3
{ "avatar_url": "https://avatars.githubusercontent.com/u/5271761?v=4", "events_url": "https://api.github.com/users/nateprewitt/events{/privacy}", "followers_url": "https://api.github.com/users/nateprewitt/followers", "following_url": "https://api.github.com/users/nateprewitt/following{/other_user}", "gists_url": "https://api.github.com/users/nateprewitt/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/nateprewitt", "id": 5271761, "login": "nateprewitt", "node_id": "MDQ6VXNlcjUyNzE3NjE=", "organizations_url": "https://api.github.com/users/nateprewitt/orgs", "received_events_url": "https://api.github.com/users/nateprewitt/received_events", "repos_url": "https://api.github.com/users/nateprewitt/repos", "site_admin": false, "starred_url": "https://api.github.com/users/nateprewitt/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/nateprewitt/subscriptions", "type": "User", "url": "https://api.github.com/users/nateprewitt", "user_view_type": "public" }
[]
closed
true
null
[]
null
3
2016-11-12T22:59:34Z
2021-09-08T14:00:37Z
2016-11-14T16:56:48Z
MEMBER
resolved
The [documentation](http://docs.python-requests.org/en/master/user/advanced/#streaming-requests) for streaming requests supplies a code snippet (below) that hits #3359 which is also experienced in `iter_lines` due to its use of `iter_content`. ```python r = requests.get('http://httpbin.org/stream/20', stream=True) for line in r.iter_lines(): if line: print(json.loads(line)) ``` Since `iter_lines` default is `decode_unicode=False`, it returns bytes causing Python 3 to barf on `json.loads(lines)`. Unfortunately, `decode_unicode=True` doesn't work either because httpbin.org doesn't provide a charset in the Content-Type header. As for fixing the example, we can manually decode `line` before passing it into json.loads. This exposes some of our dirty laundry though, and may give the user the wrong idea that they need to manually decode their strings in all cases. Alternatively, we update httpbin to pass a charset with the Content-Type and change the example to use `decode_unicode=True`. Edit: Moving semi-related comment to appropriate issue. (#3359)
{ "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/3675/reactions" }
https://api.github.com/repos/psf/requests/issues/3675/timeline
null
completed
null
null
false
[ "I view this as strictly a Python 2 vs Python 3 problem, rather than a problem with `iter_lines`. `iter_lines` returns bytes by default, that's a good sensible default, so we should just decode those bytes ourselves.\n", "Alright, I'll update the example accordingly.\n", "Resolved with #3678.\n" ]
https://api.github.com/repos/psf/requests/issues/3674
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/3674/labels{/name}
https://api.github.com/repos/psf/requests/issues/3674/comments
https://api.github.com/repos/psf/requests/issues/3674/events
https://github.com/psf/requests/issues/3674
188,913,080
MDU6SXNzdWUxODg5MTMwODA=
3,674
Requests does not support session key logging
{ "avatar_url": "https://avatars.githubusercontent.com/u/5154337?v=4", "events_url": "https://api.github.com/users/wittrup/events{/privacy}", "followers_url": "https://api.github.com/users/wittrup/followers", "following_url": "https://api.github.com/users/wittrup/following{/other_user}", "gists_url": "https://api.github.com/users/wittrup/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/wittrup", "id": 5154337, "login": "wittrup", "node_id": "MDQ6VXNlcjUxNTQzMzc=", "organizations_url": "https://api.github.com/users/wittrup/orgs", "received_events_url": "https://api.github.com/users/wittrup/received_events", "repos_url": "https://api.github.com/users/wittrup/repos", "site_admin": false, "starred_url": "https://api.github.com/users/wittrup/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/wittrup/subscriptions", "type": "User", "url": "https://api.github.com/users/wittrup", "user_view_type": "public" }
[]
closed
true
null
[]
null
8
2016-11-12T14:00:38Z
2021-09-04T00:06:22Z
2016-11-12T14:12:15Z
NONE
resolved
I would really like requests to support session key logging. Firefox and Chrome both support logging the symmetric session key used to encrypt TLS traffic. This makes it easy to analyze traffic with Wireshark. Requests should write symmetric session keys to the file set in user variable β€œSSLKEYLOGFILE”.
{ "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/3674/reactions" }
https://api.github.com/repos/psf/requests/issues/3674/timeline
null
completed
null
null
false
[ "Requests cannot do this in normal operation because OpenSSL does not expose appropriate APIs to extract this keying information. Both Chrome and Firefox use other TLS implementations (BoringSSL and NSS) which do have the appropriate APIs.\n\nI am currently working on a patch to enable this functionality in openssl/openssl#1646. Please track that issue, as until it merges it will not be possible for Requests to support this function. It will also be limited to OpenSSL 1.1.0 and modern Python versions. \n", "Hi Cory, it seems your change has been merged to OpenSSL. Is the key logging supported in requests now?\r\n", "Nope. Adding support for this requires first that OpenSSL 1.1.1 be released, and second that bindings for these functions be added to our dependencies. When OpenSSL 1.1.1 releases I'll add bindings to PyOpenSSL, but the stdlib will take a long time to catch up.", "[OpenSSL 1.1.1 is out](https://www.openssl.org/blog/blog/2018/09/11/release111/)!\r\nNews on the dependencies front?", "Better to ask pyOpenSSL if they support it yet. Then convince urllib3 to expose a way to utilize it from their pyOpenSSL shim. .... Then it will be actually useful to bug us about how to use it within requests.", "Is this feature available yet in requests? It seems to still not be respecting the environment variable, but maybe I am just overlooking something? It would provide a very easy way to debug some of the requests in my script.\r\n\r\nAlso found this: https://bugs.python.org/issue34271", "Just use https://pypi.org/project/sslkeylog/, it works for me.", "@gtors \r\nI've tried the sslkeylog (0.2.0) module but with mixed success. A line is written into the sslkeylog.log file for each request.{get/put} but wireshark only seems to recognize and use some of them. For example, if my code has six requests.get() calls, six entries will be written to sslkeylog.log but wireshark will only be able to decode, say, three of the calls in a trace.\r\n\r\nI suspect this is because 'requests' uses 'pyopenssl' but that's just a guess. This code is beyond my python knowledge.\r\n\r\nIf anyone has a suggestion, I would love to hear it.\r\n\r\nThanks" ]
https://api.github.com/repos/psf/requests/issues/3673
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/3673/labels{/name}
https://api.github.com/repos/psf/requests/issues/3673/comments
https://api.github.com/repos/psf/requests/issues/3673/events
https://github.com/psf/requests/pull/3673
188,901,413
MDExOlB1bGxSZXF1ZXN0OTM0MzMyMTc=
3,673
Enable unicode in basic http auth
{ "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
0
2016-11-12T09:02:26Z
2021-09-08T01:21:39Z
2016-11-21T19:27:39Z
NONE
resolved
Fixed the issue with unicode characters in basic http auth
{ "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/3673/reactions" }
https://api.github.com/repos/psf/requests/issues/3673/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/3673.diff", "html_url": "https://github.com/psf/requests/pull/3673", "merged_at": "2016-11-21T19:27:39Z", "patch_url": "https://github.com/psf/requests/pull/3673.patch", "url": "https://api.github.com/repos/psf/requests/pulls/3673" }
true
[]
https://api.github.com/repos/psf/requests/issues/3672
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/3672/labels{/name}
https://api.github.com/repos/psf/requests/issues/3672/comments
https://api.github.com/repos/psf/requests/issues/3672/events
https://github.com/psf/requests/issues/3672
188,891,188
MDU6SXNzdWUxODg4OTExODg=
3,672
Typo in Quickstart Guide?
{ "avatar_url": "https://avatars.githubusercontent.com/u/3649914?v=4", "events_url": "https://api.github.com/users/Cleod9/events{/privacy}", "followers_url": "https://api.github.com/users/Cleod9/followers", "following_url": "https://api.github.com/users/Cleod9/following{/other_user}", "gists_url": "https://api.github.com/users/Cleod9/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Cleod9", "id": 3649914, "login": "Cleod9", "node_id": "MDQ6VXNlcjM2NDk5MTQ=", "organizations_url": "https://api.github.com/users/Cleod9/orgs", "received_events_url": "https://api.github.com/users/Cleod9/received_events", "repos_url": "https://api.github.com/users/Cleod9/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Cleod9/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Cleod9/subscriptions", "type": "User", "url": "https://api.github.com/users/Cleod9", "user_view_type": "public" }
[]
closed
true
null
[]
null
4
2016-11-12T04:14:45Z
2021-09-08T14:00:36Z
2016-11-16T08:39:26Z
CONTRIBUTOR
resolved
Reference: https://github.com/kennethreitz/requests/blob/master/docs/user/quickstart.rst#cookies ``` >>> jar.set('tasty_cookie', 'yum', site='httpbin.org', path='/cookies') >>> jar.set('gross_cookie', 'blech', site='httpbin.org', path='/elsewhere') ``` Running this example I get the following error: `TypeError: create_cookie() got unexpected keyword arguments: ['site']` Shouldn't `site=` be `domain=`? The error goes away if I try that. If so I'll be glad to make a PR, I just want to make sure I'm not missing something
{ "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/3672/reactions" }
https://api.github.com/repos/psf/requests/issues/3672/timeline
null
completed
null
null
false
[ "Good spot, @Cleod9! `domain` is definitely the keyword we want here. A PR for this would be very welcome.\n", "No problem, I should be able to get a PR up within the next couple days\n", "PR is up :)\n", "Resolved by #3691.\n" ]
https://api.github.com/repos/psf/requests/issues/3671
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/3671/labels{/name}
https://api.github.com/repos/psf/requests/issues/3671/comments
https://api.github.com/repos/psf/requests/issues/3671/events
https://github.com/psf/requests/pull/3671
188,623,237
MDExOlB1bGxSZXF1ZXN0OTMyMzQyMjU=
3,671
Document that Response.json() may raise ValueError
{ "avatar_url": "https://avatars.githubusercontent.com/u/399718?v=4", "events_url": "https://api.github.com/users/chris-martin/events{/privacy}", "followers_url": "https://api.github.com/users/chris-martin/followers", "following_url": "https://api.github.com/users/chris-martin/following{/other_user}", "gists_url": "https://api.github.com/users/chris-martin/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/chris-martin", "id": 399718, "login": "chris-martin", "node_id": "MDQ6VXNlcjM5OTcxOA==", "organizations_url": "https://api.github.com/users/chris-martin/orgs", "received_events_url": "https://api.github.com/users/chris-martin/received_events", "repos_url": "https://api.github.com/users/chris-martin/repos", "site_admin": false, "starred_url": "https://api.github.com/users/chris-martin/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/chris-martin/subscriptions", "type": "User", "url": "https://api.github.com/users/chris-martin", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2016-11-10T21:29:14Z
2021-09-08T02:10:12Z
2016-11-10T23:18:16Z
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/3671/reactions" }
https://api.github.com/repos/psf/requests/issues/3671/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/3671.diff", "html_url": "https://github.com/psf/requests/pull/3671", "merged_at": "2016-11-10T23:18:16Z", "patch_url": "https://github.com/psf/requests/pull/3671.patch", "url": "https://api.github.com/repos/psf/requests/pulls/3671" }
true
[ "Thanks!\n" ]
https://api.github.com/repos/psf/requests/issues/3670
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/3670/labels{/name}
https://api.github.com/repos/psf/requests/issues/3670/comments
https://api.github.com/repos/psf/requests/issues/3670/events
https://github.com/psf/requests/issues/3670
188,584,780
MDU6SXNzdWUxODg1ODQ3ODA=
3,670
Requests library becomes broken, forcing reinstallation solves the problem
{ "avatar_url": "https://avatars.githubusercontent.com/u/102495?v=4", "events_url": "https://api.github.com/users/ssbarnea/events{/privacy}", "followers_url": "https://api.github.com/users/ssbarnea/followers", "following_url": "https://api.github.com/users/ssbarnea/following{/other_user}", "gists_url": "https://api.github.com/users/ssbarnea/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/ssbarnea", "id": 102495, "login": "ssbarnea", "node_id": "MDQ6VXNlcjEwMjQ5NQ==", "organizations_url": "https://api.github.com/users/ssbarnea/orgs", "received_events_url": "https://api.github.com/users/ssbarnea/received_events", "repos_url": "https://api.github.com/users/ssbarnea/repos", "site_admin": false, "starred_url": "https://api.github.com/users/ssbarnea/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/ssbarnea/subscriptions", "type": "User", "url": "https://api.github.com/users/ssbarnea", "user_view_type": "public" }
[]
closed
true
null
[]
null
4
2016-11-10T18:35:56Z
2021-09-08T12:01:10Z
2016-11-10T19:05:30Z
CONTRIBUTOR
resolved
It seems that I am not the only one that discovered that his python-requests library is in a broken state. ``` import requests File "/usr/lib/python2.7/site-packages/requests/__init__.py", line 64, in <module> from . import utils File "/usr/lib/python2.7/site-packages/requests/utils.py", line 29, in <module> from .exceptions import InvalidURL, InvalidHeader, FileModeWarning ImportError: cannot import name InvalidHeader ``` See https://bugzilla.redhat.com/show_bug.cgi?id=1393979 and http://stackoverflow.com/questions/32986626/python-requests-importerror-cannot-import-name-headerparsingerror which are two unrelated occurences that are fixed by the same workaround: `pip install --upgrade --force-reinstall requestsexceptions requests requests-toolbelt` #### pip freeze I mention that the forced reinstallation did not change the reported versions but fixed the import error. ``` requests==2.11.1 requests-toolbelt==0.7.0 requestsexceptions==1.1.3 urllib3==1.15.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/3670/reactions" }
https://api.github.com/repos/psf/requests/issues/3670/timeline
null
completed
null
null
false
[ "This is unequivocally not a Requests issue. Requests defines `InvalidHeader` in the `exceptions` module, that import has to work. If it doesn't work, it's the result of something messing with the requests exceptions heirarchy. Given that you have installed a package called `requestsexceptions` you should strongly consider the possibility that _they_ broke your software, not us.\n", "FYI, requestsexceptions looks like it doesn't monkey-patch `requests.exceptions`: https://github.com/openstack-infra/requestsexceptions/blob/master/requestsexceptions/__init__.py.\n\nEither way, force reinstalling indicates that this is emphatically not our problem (as @Lukasa has already pointed out).\n", "Also, @ssbarnea, http://stackoverflow.com/questions/32986626/python-requests-importerror-cannot-import-name-headerparsingerror seems to be a different (although similar) issue. From the StackOverflow issue it looks like you have some left over bits of old versions of requests on your disk.\n", "For the lazy, the commands that successfully fixed this are:\r\n\r\n```\r\nsudo pip uninstall requests\r\nsudo pip install --upgrade requests\r\n```" ]
https://api.github.com/repos/psf/requests/issues/3669
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/3669/labels{/name}
https://api.github.com/repos/psf/requests/issues/3669/comments
https://api.github.com/repos/psf/requests/issues/3669/events
https://github.com/psf/requests/issues/3669
188,539,424
MDU6SXNzdWUxODg1Mzk0MjQ=
3,669
Setting Session Cookies
{ "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" }
[]
open
false
null
[]
null
0
2016-11-10T15:33:34Z
2016-11-10T15:33:34Z
null
MEMBER
null
This is a continuation of the original PR (#3595) to address how we set Session cookies in Requests. The PR had enough disagreement on how this should be addressed that I felt it was better to move this into a discussion. As noted in #3595, Requests currently allows the user to provide cookies as a dictionary. While we've allowed this for individual requests, because their domain is (mostly) scoped, there are some real security concerns for supporting this for Sessions. The issues ========= 1. If the user sets Session's `cookies` attribute to a `dict`, it will happily accept it, but crashes when you try to send anything. To correct this issue, the cookies need to be supplied as a `CookieJar` instance as noted in the [documentation](http://docs.python-requests.org/en/master/user/advanced/#session-objects). This is unideal because we allow users to use an idiom supported everywhere else in the API, and then fail later with a fairly unhelpful exception. 2. #3595 automated this suggested process from the documentation, as we do elsewhere in Requests, but it allows you to easily set session-wide cookies that aren't bounded by a domain. This means it's easy to unintentionally send sensitive cookie information to unintended recipients. 3. The currently proposed solution of using `add_dict_to_cookiejar` or `cookiejar_from_dict` provides no extra protection against the security issues raised in #3595. Solutions(?) ========== 1. I think this is a two step process. For Requests 2.x, I'm suggesting we add a warning to the user when they set Session `cookies` attribute to a `dict`. This points them at the documentation so they can at least *try* to do the right things. Otherwise, they're none the wiser until their program crashes with an error in a separate module and only minor clues on the cause. In 3.0.0, I think this warning should be raised an actual exception since we don't support cookies as dicts for Sessions. 2. (and also 3.) If we're going to require the extra step of making the user explicitly use `add_dict_to_cookiejar` or `cookie_from_dict`, then let's make them useful. They currently don't provide any benefit over the dictionary approach in #3595. We can emulate some of the functionality of how a browser handles cookies by allowing users to supply cookie parameters on a per-dictionary basis. This is similar to cookies set by individual page requests. ```python cookies = {'SessionID': '1234', 'SecretToken': 'efe077444d17b2de7feee356601d'} s = Session() add_dict_to_cookiejar( s.cookies, cookies, domain='auth.myauthsite.com', secure=True, expires='123456789' ) ``` This is a relatively simple changed as shown in an initial mockup in e2a4f9f & 4454849. This would need to be accompanied by a documentation update (something like 3e4e5b7) to explain how to do this properly. ---- @sigmavirus24, when you've got a moment, could you confirm this issue properly encapsulates your concerns and I didn't leave anything out? As for the possible solutions, are any of these amenable? I know your work in #2714 will help this a little bit with the default cookie policy change, but we still need to provide a way for the user to easily adhere to the safeguards we're putting in place.
null
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 1, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 1, "url": "https://api.github.com/repos/psf/requests/issues/3669/reactions" }
https://api.github.com/repos/psf/requests/issues/3669/timeline
null
null
null
null
false
[]
https://api.github.com/repos/psf/requests/issues/3668
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/3668/labels{/name}
https://api.github.com/repos/psf/requests/issues/3668/comments
https://api.github.com/repos/psf/requests/issues/3668/events
https://github.com/psf/requests/issues/3668
188,345,183
MDU6SXNzdWUxODgzNDUxODM=
3,668
If-Modified-Since is a "special" header?
{ "avatar_url": "https://avatars.githubusercontent.com/u/10715803?v=4", "events_url": "https://api.github.com/users/miscellainiac/events{/privacy}", "followers_url": "https://api.github.com/users/miscellainiac/followers", "following_url": "https://api.github.com/users/miscellainiac/following{/other_user}", "gists_url": "https://api.github.com/users/miscellainiac/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/miscellainiac", "id": 10715803, "login": "miscellainiac", "node_id": "MDQ6VXNlcjEwNzE1ODAz", "organizations_url": "https://api.github.com/users/miscellainiac/orgs", "received_events_url": "https://api.github.com/users/miscellainiac/received_events", "repos_url": "https://api.github.com/users/miscellainiac/repos", "site_admin": false, "starred_url": "https://api.github.com/users/miscellainiac/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/miscellainiac/subscriptions", "type": "User", "url": "https://api.github.com/users/miscellainiac", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2016-11-09T20:31:28Z
2021-09-08T14:00:39Z
2016-11-09T21:22:03Z
NONE
resolved
I am using requests (2.10.0) in Python 2.7.11 and I just ran across some very strange behavior with respect to this header. I would like to send along different formats than 'Tue, 08 Nov 2016 05:00:00 GMT' which seems to be passed along just fine, but if I try a string like '2016-11-08T00:00:00-05:00' something is munging that value, fails to parse it (but does not raise an error) and my services on the other side get a completely different date (Thu, 31 Dec 2015 00:00:00 GMT). So something is going on here, I'm just not sure where or even why. I am wondering if there is a way to simply pass along the string as-is...
{ "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/3668/reactions" }
https://api.github.com/repos/psf/requests/issues/3668/timeline
null
completed
null
null
false
[ "@miscellainiac we do not (nor does anything between us and the socket) munge that header. My guess is that there's something infront of the server (e.g., a proxy or load balancer) that does this to your request header. Either way, the correct format is like your first example. See\n- https://tools.ietf.org/html/rfc7231#section-5.2\n- https://tools.ietf.org/html/rfc7232#section-3.3\n- https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-Modified-Since\n\nThe first two are parts of the standard that define the behaviour and format of that header's value. The latter is a simplistic way of formatting it for ease.\n" ]
https://api.github.com/repos/psf/requests/issues/3667
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/3667/labels{/name}
https://api.github.com/repos/psf/requests/issues/3667/comments
https://api.github.com/repos/psf/requests/issues/3667/events
https://github.com/psf/requests/pull/3667
187,929,870
MDExOlB1bGxSZXF1ZXN0OTI3MzQxMDA=
3,667
Upgrade urllib3 to version 1.19
{ "avatar_url": "https://avatars.githubusercontent.com/u/299380?v=4", "events_url": "https://api.github.com/users/frankier/events{/privacy}", "followers_url": "https://api.github.com/users/frankier/followers", "following_url": "https://api.github.com/users/frankier/following{/other_user}", "gists_url": "https://api.github.com/users/frankier/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/frankier", "id": 299380, "login": "frankier", "node_id": "MDQ6VXNlcjI5OTM4MA==", "organizations_url": "https://api.github.com/users/frankier/orgs", "received_events_url": "https://api.github.com/users/frankier/received_events", "repos_url": "https://api.github.com/users/frankier/repos", "site_admin": false, "starred_url": "https://api.github.com/users/frankier/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/frankier/subscriptions", "type": "User", "url": "https://api.github.com/users/frankier", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2016-11-08T08:28:55Z
2021-09-08T02:10:13Z
2016-11-08T08:30:32Z
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/3667/reactions" }
https://api.github.com/repos/psf/requests/issues/3667/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/3667.diff", "html_url": "https://github.com/psf/requests/pull/3667", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/3667.patch", "url": "https://api.github.com/repos/psf/requests/pulls/3667" }
true
[ "Thanks for opening this, but this is usually done by maintainers as part of the release and maintenance process. In particular, it requires some care around handling the packaging side of things. Sorry, but that means we're not going to merge this.\n\nThanks for the work though!\n" ]
https://api.github.com/repos/psf/requests/issues/3666
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/3666/labels{/name}
https://api.github.com/repos/psf/requests/issues/3666/comments
https://api.github.com/repos/psf/requests/issues/3666/events
https://github.com/psf/requests/pull/3666
187,020,804
MDExOlB1bGxSZXF1ZXN0OTIxMjQ5NTI=
3,666
documentation line added for consistency with the post method
{ "avatar_url": "https://avatars.githubusercontent.com/u/8665709?v=4", "events_url": "https://api.github.com/users/hootnot/events{/privacy}", "followers_url": "https://api.github.com/users/hootnot/followers", "following_url": "https://api.github.com/users/hootnot/following{/other_user}", "gists_url": "https://api.github.com/users/hootnot/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/hootnot", "id": 8665709, "login": "hootnot", "node_id": "MDQ6VXNlcjg2NjU3MDk=", "organizations_url": "https://api.github.com/users/hootnot/orgs", "received_events_url": "https://api.github.com/users/hootnot/received_events", "repos_url": "https://api.github.com/users/hootnot/repos", "site_admin": false, "starred_url": "https://api.github.com/users/hootnot/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/hootnot/subscriptions", "type": "User", "url": "https://api.github.com/users/hootnot", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2016-11-03T10:20:19Z
2021-09-08T02:10:22Z
2016-11-03T10:39:47Z
CONTRIBUTOR
resolved
Docs PR regarding #3664 and #2979
{ "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/3666/reactions" }
https://api.github.com/repos/psf/requests/issues/3666/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/3666.diff", "html_url": "https://github.com/psf/requests/pull/3666", "merged_at": "2016-11-03T10:39:47Z", "patch_url": "https://github.com/psf/requests/pull/3666.patch", "url": "https://api.github.com/repos/psf/requests/pulls/3666" }
true
[ "Thanks @hootnot! :sparkles: :cake: :sparkles:\n" ]
https://api.github.com/repos/psf/requests/issues/3665
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/3665/labels{/name}
https://api.github.com/repos/psf/requests/issues/3665/comments
https://api.github.com/repos/psf/requests/issues/3665/events
https://github.com/psf/requests/issues/3665
186,980,976
MDU6SXNzdWUxODY5ODA5NzY=
3,665
connection pool exceed issue
{ "avatar_url": "https://avatars.githubusercontent.com/u/553215?v=4", "events_url": "https://api.github.com/users/KiritoStudio/events{/privacy}", "followers_url": "https://api.github.com/users/KiritoStudio/followers", "following_url": "https://api.github.com/users/KiritoStudio/following{/other_user}", "gists_url": "https://api.github.com/users/KiritoStudio/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/KiritoStudio", "id": 553215, "login": "KiritoStudio", "node_id": "MDQ6VXNlcjU1MzIxNQ==", "organizations_url": "https://api.github.com/users/KiritoStudio/orgs", "received_events_url": "https://api.github.com/users/KiritoStudio/received_events", "repos_url": "https://api.github.com/users/KiritoStudio/repos", "site_admin": false, "starred_url": "https://api.github.com/users/KiritoStudio/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/KiritoStudio/subscriptions", "type": "User", "url": "https://api.github.com/users/KiritoStudio", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2016-11-03T05:24:35Z
2021-09-08T14:00:40Z
2016-11-04T01:30:23Z
NONE
resolved
The issue like https://github.com/kennethreitz/requests/issues/3090, but socks5:// protocol seems has the same issue. After requesting a lot of urls, the connection pool will be exceeded.
{ "avatar_url": "https://avatars.githubusercontent.com/u/553215?v=4", "events_url": "https://api.github.com/users/KiritoStudio/events{/privacy}", "followers_url": "https://api.github.com/users/KiritoStudio/followers", "following_url": "https://api.github.com/users/KiritoStudio/following{/other_user}", "gists_url": "https://api.github.com/users/KiritoStudio/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/KiritoStudio", "id": 553215, "login": "KiritoStudio", "node_id": "MDQ6VXNlcjU1MzIxNQ==", "organizations_url": "https://api.github.com/users/KiritoStudio/orgs", "received_events_url": "https://api.github.com/users/KiritoStudio/received_events", "repos_url": "https://api.github.com/users/KiritoStudio/repos", "site_admin": false, "starred_url": "https://api.github.com/users/KiritoStudio/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/KiritoStudio/subscriptions", "type": "User", "url": "https://api.github.com/users/KiritoStudio", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/3665/reactions" }
https://api.github.com/repos/psf/requests/issues/3665/timeline
null
completed
null
null
false
[ "Are you sure? Can you provide some example of what exception you're hitting, and maybe some sample code to trigger it?\n" ]
https://api.github.com/repos/psf/requests/issues/3664
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/3664/labels{/name}
https://api.github.com/repos/psf/requests/issues/3664/comments
https://api.github.com/repos/psf/requests/issues/3664/events
https://github.com/psf/requests/pull/3664
186,936,516
MDExOlB1bGxSZXF1ZXN0OTIwNjczOTg=
3,664
json parameter added to patch and put methods
{ "avatar_url": "https://avatars.githubusercontent.com/u/8665709?v=4", "events_url": "https://api.github.com/users/hootnot/events{/privacy}", "followers_url": "https://api.github.com/users/hootnot/followers", "following_url": "https://api.github.com/users/hootnot/following{/other_user}", "gists_url": "https://api.github.com/users/hootnot/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/hootnot", "id": 8665709, "login": "hootnot", "node_id": "MDQ6VXNlcjg2NjU3MDk=", "organizations_url": "https://api.github.com/users/hootnot/orgs", "received_events_url": "https://api.github.com/users/hootnot/received_events", "repos_url": "https://api.github.com/users/hootnot/repos", "site_admin": false, "starred_url": "https://api.github.com/users/hootnot/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/hootnot/subscriptions", "type": "User", "url": "https://api.github.com/users/hootnot", "user_view_type": "public" }
[]
closed
true
null
[]
null
3
2016-11-02T22:24:13Z
2021-09-08T02:10:23Z
2016-11-03T10:03:59Z
CONTRIBUTOR
resolved
referring to #2979 ... this is answered that this can be done with **kwargs, which is true. But wouldn't that would go for **post** too ? It would make consistent use of parameters possible if **put** and **patch** would support the _json_ parameter also, so then there is no need for additional logic to distinguish between the different methods, take for example: ```python ... self.client = requests.Session() ... request_args = {} if method == 'get': request_args['params'] = params elif hasattr(endpoint, "data") and endpoint.data: request_args['json'] = endpoint.data .... func = getattr(self.client, method) response = func(url, stream=stream, headers=headers, **request_args) ... ``` post, put and patch can all be handled the same this way.
{ "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/3664/reactions" }
https://api.github.com/repos/psf/requests/issues/3664/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/3664.diff", "html_url": "https://github.com/psf/requests/pull/3664", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/3664.patch", "url": "https://api.github.com/repos/psf/requests/pulls/3664" }
true
[ "> if put and patch would support the json parameter also\n\nThey already do. \n", "Yup, you are right. \n\nSomehow reading the docs one gets a direction because the **post** method explicit names the **json** parameter in it's documentation. While the **put** and **post** don't, they indirectly refer to the params of request.\n", "@hootnot I think in this case this should be considered a documentation issue, rather than explicitly naming the parameters. Mind opening a docs PR?\n" ]
https://api.github.com/repos/psf/requests/issues/3663
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/3663/labels{/name}
https://api.github.com/repos/psf/requests/issues/3663/comments
https://api.github.com/repos/psf/requests/issues/3663/events
https://github.com/psf/requests/pull/3663
186,922,866
MDExOlB1bGxSZXF1ZXN0OTIwNTc0MTg=
3,663
fix path for cookiejar_from_dict in api.rst
{ "avatar_url": "https://avatars.githubusercontent.com/u/5271761?v=4", "events_url": "https://api.github.com/users/nateprewitt/events{/privacy}", "followers_url": "https://api.github.com/users/nateprewitt/followers", "following_url": "https://api.github.com/users/nateprewitt/following{/other_user}", "gists_url": "https://api.github.com/users/nateprewitt/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/nateprewitt", "id": 5271761, "login": "nateprewitt", "node_id": "MDQ6VXNlcjUyNzE3NjE=", "organizations_url": "https://api.github.com/users/nateprewitt/orgs", "received_events_url": "https://api.github.com/users/nateprewitt/received_events", "repos_url": "https://api.github.com/users/nateprewitt/repos", "site_admin": false, "starred_url": "https://api.github.com/users/nateprewitt/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/nateprewitt/subscriptions", "type": "User", "url": "https://api.github.com/users/nateprewitt", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2016-11-02T21:18:18Z
2021-09-08T02:10:21Z
2016-11-03T10:06:53Z
MEMBER
resolved
Right now the `cookiejar_from_dict` path provided to autofunction in api.rst is incorrect. It happens to work though because Sphinx is smart enough to correct the source url for us. This will make the display string consistent with the correct path.
{ "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/3663/reactions" }
https://api.github.com/repos/psf/requests/issues/3663/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/3663.diff", "html_url": "https://github.com/psf/requests/pull/3663", "merged_at": "2016-11-03T10:06:53Z", "patch_url": "https://github.com/psf/requests/pull/3663.patch", "url": "https://api.github.com/repos/psf/requests/pulls/3663" }
true
[ "Thanks @nateprewitt! :sparkles: :cake: :sparkles:\n" ]
https://api.github.com/repos/psf/requests/issues/3662
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/3662/labels{/name}
https://api.github.com/repos/psf/requests/issues/3662/comments
https://api.github.com/repos/psf/requests/issues/3662/events
https://github.com/psf/requests/issues/3662
186,834,701
MDU6SXNzdWUxODY4MzQ3MDE=
3,662
Basic http auth + unicode = error
{ "avatar_url": "https://avatars.githubusercontent.com/u/240594?v=4", "events_url": "https://api.github.com/users/sztomi/events{/privacy}", "followers_url": "https://api.github.com/users/sztomi/followers", "following_url": "https://api.github.com/users/sztomi/following{/other_user}", "gists_url": "https://api.github.com/users/sztomi/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/sztomi", "id": 240594, "login": "sztomi", "node_id": "MDQ6VXNlcjI0MDU5NA==", "organizations_url": "https://api.github.com/users/sztomi/orgs", "received_events_url": "https://api.github.com/users/sztomi/received_events", "repos_url": "https://api.github.com/users/sztomi/repos", "site_admin": false, "starred_url": "https://api.github.com/users/sztomi/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/sztomi/subscriptions", "type": "User", "url": "https://api.github.com/users/sztomi", "user_view_type": "public" }
[ { "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
10
2016-11-02T15:32:03Z
2021-09-07T00:06:19Z
2016-11-23T10:17:55Z
NONE
resolved
## Description It is not possible to send a basic http authentication using a username or password that contains Unicode data. ### What happens `UnicodeEncodeError` is thrown. Traceback: ``` File "(my code)", line 163, in _get auth=(self.user, self.password)) File "/usr/local/lib/python3.5/site-packages/requests/api.py", line 67, in get return request('get', url, params=params, **kwargs) File "/usr/local/lib/python3.5/site-packages/requests/api.py", line 53, in request return session.request(method=method, url=url, **kwargs) File "/usr/local/lib/python3.5/site-packages/requests/sessions.py", line 454, in request prep = self.prepare_request(req) File "/usr/local/lib/python3.5/site-packages/requests/sessions.py", line 388, in prepare_request hooks=merge_hooks(request.hooks, self.hooks), File "/usr/local/lib/python3.5/site-packages/requests/models.py", line 297, in prepare self.prepare_auth(auth, url) File "/usr/local/lib/python3.5/site-packages/requests/models.py", line 490, in prepare_auth r = auth(self) File "/usr/local/lib/python3.5/site-packages/requests/auth.py", line 51, in __call__ r.headers['Authorization'] = _basic_auth_str(self.username, self.password) File "/usr/local/lib/python3.5/site-packages/requests/auth.py", line 31, in _basic_auth_str b64encode(('%s:%s' % (username, password)).encode('latin1')).strip() UnicodeEncodeError: 'latin-1' codec can't encode character '\u0171' in position 7: ordinal not in range(256) ``` ### Expected behavior The authentication is encoded as utf-8 (at least if charset=utf-8 is provided in the header). ## How to reproduce Consider the following request: ```python user = 'Ε±ser' password = 'pÑéÑésswΕ‘rd' response = requests.get( url='http://example.com' headers={'Content-Type': 'application/xml; charset=utf-8'}, auth=(user, password)) ``` I think that the culprit is this line (https://github.com/kennethreitz/requests/blob/master/requests/auth.py#L32), which assumes latin-1 encoding regardless of the charset header: ```python def _basic_auth_str(username, password): """Returns a Basic Auth string.""" authstr = 'Basic ' + to_native_string( b64encode(('%s:%s' % (username, password)).encode('latin1')).strip() ) return authstr ``` ## Workaround This seems to work: ```python from requests.auth import to_native_string # ... snip ... auth = 'Basic ' + to_native_string(b64encode('{}:{}'.format(self.user, self.password).encode('utf-8')).strip()) response = requests.get( url=self.base_url + uri, headers={ 'Content-Type': 'application/xml; charset=utf-8', 'Authorization': auth }) ``` ## Version info ``` $ pip show requests --- Metadata-Version: 2.0 Name: requests Version: 2.9.1 Summary: Python HTTP for Humans. Home-page: http://python-requests.org Author: Kenneth Reitz Author-email: [email protected] Installer: pip License: Apache 2.0 Location: /usr/local/lib/python3.5/site-packages Requires: Classifiers: Development Status :: 5 - Production/Stable Intended Audience :: Developers Natural Language :: English License :: OSI Approved :: Apache Software License Programming Language :: Python Programming Language :: Python :: 2.7 Programming Language :: Python :: 3 Programming Language :: Python :: 3.3 Programming Language :: Python :: 3.4 Programming Language :: Python :: 3.5 ```
{ "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/3662/reactions" }
https://api.github.com/repos/psf/requests/issues/3662/timeline
null
completed
null
null
false
[ "Yeah, that looks like a bug.\n\nI think in this case the best fix is to allow the user to provide bytestrings for the username and password, and if they do that to simply use the bytestring directly rather than to try to encode.\n\nAre you interested in providing a test and patch for this?\n", "@Lukasa Gladly, but I'm a bit overburdened at the moment. I'll have spare time in 2-3 weeks, if it's still open, I'll take a peek.\n", "Ok cool, I'll mark this as contributor friendly and if no-one else picks it up by the time you have time you should take a swing at it.\n", "Hello, @lukasa!\n\nYour idea about byte strings looks very good and fully matches the white spaces in spec.\n\nBut.\n\nThere are two ways to release your idea:\n1) Save user/pass in bytes. Looks not good, because in fact we always need to check type of variable, before use it.\n2) Convert user/pass to strings in **init**(). Looks not good, because we lose the original values.\n\nAnd last, I think 95% peoples will be write code like this:\n\n``` python\nu = 'Π”ΠΌΠΈΡ‚Ρ€ΠΈΠΉ' # my name in Russian\np = 'password'\nr = request.get(url, auth=(u.encode('utf-8'), p))\n```\n\nTo my mind, it looks not 'for humans'.\nWithout this patch we can write this for same result:\n\n``` python\nr = request.get(url, auth=(u.encode('utf-8').decode('latin1'), p))\n```\n\nBut we can change only one line of code:\n\n``` python\n- b64encode(('%s:%s' % (username, password)).encode('latin1')).strip()\n+ b64encode(('%s:%s' % (username, password)).encode('utf-8')).strip() \n```\n\nAfter that the same code will look as:\n\n``` python\nr = request.get(url, auth=(u, p))\n```\n\nIt looks for Humans :)\n\nWhat do you think about all this?\n\nSorry for my grammar.\n", "@klimenko It does look better that way, but it's unfortunately just moving the problem. Now anyone whose server is expecting a non-UTF-8 encoded username is going to get tripped up, and so we'll have to re-open this issue when someone says \"my server wanted Latin1 and now doesn't get it\".\n\nIt's better to use bytestrings because that way we avoid making a guess that is wrong. If the users still want the helpful automatic choice, they can pass a unicode string, but if they want to do something more specific we have an escape hatch for them.\n", "Hi guys, I would like to take a crack at this.\n", "@rmhasan thanks for the interest in contributing! It may be important to note that PR #3673 is already open to address this. You may want to keep an eye on the outcome of that before spending time working on a solution.\n", "@nateprewitt I will keep an eye on it, thanks.\n", "Resolved by #3673.", "Thanks, I got past it!" ]
https://api.github.com/repos/psf/requests/issues/3661
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/3661/labels{/name}
https://api.github.com/repos/psf/requests/issues/3661/comments
https://api.github.com/repos/psf/requests/issues/3661/events
https://github.com/psf/requests/issues/3661
186,323,367
MDU6SXNzdWUxODYzMjMzNjc=
3,661
Close keep-alive connections after configurable period (aka keep-alive timeout)
{ "avatar_url": "https://avatars.githubusercontent.com/u/94327?v=4", "events_url": "https://api.github.com/users/tuukkamustonen/events{/privacy}", "followers_url": "https://api.github.com/users/tuukkamustonen/followers", "following_url": "https://api.github.com/users/tuukkamustonen/following{/other_user}", "gists_url": "https://api.github.com/users/tuukkamustonen/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/tuukkamustonen", "id": 94327, "login": "tuukkamustonen", "node_id": "MDQ6VXNlcjk0MzI3", "organizations_url": "https://api.github.com/users/tuukkamustonen/orgs", "received_events_url": "https://api.github.com/users/tuukkamustonen/received_events", "repos_url": "https://api.github.com/users/tuukkamustonen/repos", "site_admin": false, "starred_url": "https://api.github.com/users/tuukkamustonen/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/tuukkamustonen/subscriptions", "type": "User", "url": "https://api.github.com/users/tuukkamustonen", "user_view_type": "public" }
[]
closed
true
null
[]
null
7
2016-10-31T16:02:55Z
2021-09-05T00:06:48Z
2016-10-31T16:25:19Z
NONE
resolved
I am experiencing a race condition with a (Squid) proxy server, best described by @rdharrison2 in https://github.com/kennethreitz/requests/issues/2364#issuecomment-186214402: > In my case I'm making a large number of periodic https requests to a apache2 server with connection keep-alive timeout 5s. There is a race between the server closing a timed out persistent connection and the client making a request on the same connection. Given a bit of network latency the client can often attempt to send a request on the socket before it gets notified it as been closed. Rather than implementing a retry logic, I would like to ensure that my requests `Session` keep-alive "timeout" is lower than that of proxy's. But I cannot seem to find out how. Either I'm blind or it's just not supported?
{ "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/3661/reactions" }
https://api.github.com/repos/psf/requests/issues/3661/timeline
null
completed
null
null
false
[ "Requests doesn't have a keep-alive timeout, because such a notion doesn't make sense. HTTP \"keep-alive\" doesn't involve any socket activity: it just involves each end of the connection promising to keep it open as long as they can.\n\nIn this case, what happens is that when you go to make a request, Requests checks whether the socket appears to still be open (assuming it was on a keep-alive connection) by asking whether it's readable. If it is, that means the remote peer has closed the socket. If it isn't, then Requests goes ahead and sends the request on that connection. There is a small timing window between these two events during which a connection closure can be received.\n\nIn this instance, a retry is the correct thing to do. However, you don't have to implement retry logic yourself: just use urllib3's. Create and mount new [HTTPAdapter](http://docs.python-requests.org/en/master/api/#requests.adapters.HTTPAdapter) that has `max_retries` set to a value greater than 0.\n", "@Lukasa Thanks for the quick reply. I guess using `max_retries` would make the code a bit more fault-tolerant in generic sense.\n\nHowever, to fail-fast at least when developing, running tests or continuous integration, I would rather not retry but simply avoid using those connections that are in risk of being closed (I know proxy server's keep-alive timeout so I could just set my value to a second or two lower than that). Do you see this as totally stupid thing to do?\n", "> Do you see this as totally stupid thing to do?\n\nThe bigger problem is that this doesn't actually solve the issue.\n\nSpecifically, attempting to match your keep-alive timeout to the proxy's timeout can misbehave in a few different ways. The first, and most egregious, is that there is no reason to assume the clock as requests sees it will match the clock as the proxy sees it. Clock drift in distributed systems is well established, and two ends of a TCP connection form a distributed system: for that reason, it's all too easy for the view of the world that Requests has to become skewed from the view of the world that the proxy has, which can lead you to falling back into the same problem you have right now.\n\nAnother issue is that the proxy's keep-alive value is presumably not a _promise_ but a _target_. In particular, most servers reserve the right to close connections earlier than the keep-alive timeout if they need to (e.g. if they are running out of file handles). Once again, that means the configurable timeout is problematic.\n\nA third concern is that the Python standard library doesn't provide access to a monotonic clock until Python 3.3, meaning that such a feature would have alarming failure modes during DST switches on earlier versions of Python.\n\nA fourth concern is that different systems may handle monotonic clocks differently, which means that during DST switches we can still encounter problem 1 even when we _do_ have a monotonic clock.\n\nA fifth concern is that a keep-alive switch like this becomes an attractive nuisance. Users will be inclined to set it to try to avoid problems like this, but it will be a bad solution to that problem _and_ it will reduce the efficiency of their connection pooling by forcing perfectly good connections to close.\n\nGiven that retries in this situation are totally safe, and that they are a complete solution, and that they represent a substantial efficiency gain, and that the support for them is already built into the code, and that they work across all versions of Python on all systems, I'm not quite sure what advantage you perceive you'll get out of having the keep-alive switch.\n", "Well founded reasoning, I'll take your advice and use `HttpAdapter` with `max_retries`.\r\n\r\nA few thoughts out of curiosity:\r\n1. I wouldn't think clock drifting is a real problem here, because it's often quite minor and would not have any real effect when talking about days and weeks rather than seconds and minutes.\r\n2. Interesting.\r\n3. I wasn't even aware of such concept... Looks like there's a [backport in pypi](https://pypi.python.org/pypi/monotonic), but yeah it would be an extra dependency and doesn't look like it would run on PyPy and so on.\r\n4. Cool. I mean, not cool.\r\n5. True...\r\n", "> 1. I wouldn't think clock drifting is a real problem here, because it's often quite minor and would not have any real effect when talking about seconds and minutes rather than days and weeks.\n\nHeh, if only.\n\nThe reality is that clock drift can happen in all kinds of really exciting ways, all of which can affect real programs. Rather than go into much detail here, if you're interested I'll point you at [this blog post](https://aphyr.com/posts/299-the-trouble-with-timestamps) by the excellent Kyle Kingsbury (not tagged on GitHub because he won't care about this issue) which will go into very real detail about the many, many ways that clocks on computers can go wrong; and I'll also point you at [Julia Evans' post on clock skew](https://jvns.ca/blog/2016/02/09/til-clock-skew-exists/) which contains lots of good resources.\n\nThe high level thing here is that while clock drift _can_ be minor, it can also be _very major_, and in general it is best to avoid relying on a clock to achieve the affects you want if you can rely on something else instead.\n\nAny application you're going to want to deploy in production should have retry logic in it somewhere, and urllib3 makes _very powerful_ retry logic available if you want it. The urllib3 [`Retry` object](https://urllib3.readthedocs.io/en/latest/reference/urllib3.util.html#urllib3.util.retry.Retry) can be passed to the `max_retries` parameter if you want fine-grained control and some serious, hard-core resilience in the face of certain kinds of errors.\n", "Uh, Aphyr always gives me goosebumps... I'll check your pointers. Thanks for the guidance!\n", "@Lukasa I'm facing a similar issue where the server keep-alive connections for 30s, and I get sporadic errors when the client reuses a connection that the server is. Unfortunately, I'm making a POST request, and I cannot safely use the urllib3 `Retry` classes without risking causing duplicate updates. \r\n\r\nI'm wondering if I set a smaller `timeout` value when making the post request using a `Session` can help make sure the client close the connection before the server does? Essentially I'm trying to see if there is a way to ensure the connection is always closed by the client before the server." ]
https://api.github.com/repos/psf/requests/issues/3660
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/3660/labels{/name}
https://api.github.com/repos/psf/requests/issues/3660/comments
https://api.github.com/repos/psf/requests/issues/3660/events
https://github.com/psf/requests/pull/3660
186,286,848
MDExOlB1bGxSZXF1ZXN0OTE2MTExNjU=
3,660
[httpAdapter] allow empty password in proxy credentials
{ "avatar_url": "https://avatars.githubusercontent.com/u/2700942?v=4", "events_url": "https://api.github.com/users/pawelmhm/events{/privacy}", "followers_url": "https://api.github.com/users/pawelmhm/followers", "following_url": "https://api.github.com/users/pawelmhm/following{/other_user}", "gists_url": "https://api.github.com/users/pawelmhm/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/pawelmhm", "id": 2700942, "login": "pawelmhm", "node_id": "MDQ6VXNlcjI3MDA5NDI=", "organizations_url": "https://api.github.com/users/pawelmhm/orgs", "received_events_url": "https://api.github.com/users/pawelmhm/received_events", "repos_url": "https://api.github.com/users/pawelmhm/repos", "site_admin": false, "starred_url": "https://api.github.com/users/pawelmhm/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/pawelmhm/subscriptions", "type": "User", "url": "https://api.github.com/users/pawelmhm", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2016-10-31T13:45:59Z
2021-09-08T02:10:23Z
2016-10-31T13:59:16Z
CONTRIBUTOR
resolved
fixes #3659
{ "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/3660/reactions" }
https://api.github.com/repos/psf/requests/issues/3660/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/3660.diff", "html_url": "https://github.com/psf/requests/pull/3660", "merged_at": "2016-10-31T13:59:16Z", "patch_url": "https://github.com/psf/requests/pull/3660.patch", "url": "https://api.github.com/repos/psf/requests/pulls/3660" }
true
[ "Some things that could be improved in future:\n- add some unit test using real proxy, e.g. MITM-proxy, something along the lines of Scrapy: https://github.com/scrapy/scrapy/blob/129421c7e31b89b9b0f9c5f7d8ae59e47df36091/tests/test_proxy_connect.py#L35 where there is fake proxy started and all tests for proxy requests go via this fake proxy. This would be nice to have to test somethings with real proxies (instead of doing unit test of some specific adapter method).\n", "Cool, so this looks really good. You'll note we have some tests with proxies in `test_lowlevel.py`, so if you feel like adding more testing in this area I'll happily merge it. However, for this specific issue, I think this test is sufficient.\n\nThanks @pawelmhm! :sparkles: :cake: :sparkles:\n" ]
https://api.github.com/repos/psf/requests/issues/3659
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/3659/labels{/name}
https://api.github.com/repos/psf/requests/issues/3659/comments
https://api.github.com/repos/psf/requests/issues/3659/events
https://github.com/psf/requests/issues/3659
186,263,437
MDU6SXNzdWUxODYyNjM0Mzc=
3,659
URL proxy auth with empty passwords doesn't emit auth header.
{ "avatar_url": "https://avatars.githubusercontent.com/u/2700942?v=4", "events_url": "https://api.github.com/users/pawelmhm/events{/privacy}", "followers_url": "https://api.github.com/users/pawelmhm/followers", "following_url": "https://api.github.com/users/pawelmhm/following{/other_user}", "gists_url": "https://api.github.com/users/pawelmhm/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/pawelmhm", "id": 2700942, "login": "pawelmhm", "node_id": "MDQ6VXNlcjI3MDA5NDI=", "organizations_url": "https://api.github.com/users/pawelmhm/orgs", "received_events_url": "https://api.github.com/users/pawelmhm/received_events", "repos_url": "https://api.github.com/users/pawelmhm/repos", "site_admin": false, "starred_url": "https://api.github.com/users/pawelmhm/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/pawelmhm/subscriptions", "type": "User", "url": "https://api.github.com/users/pawelmhm", "user_view_type": "public" }
[]
closed
true
null
[]
null
7
2016-10-31T11:40:37Z
2021-09-08T14:00:41Z
2016-10-31T13:59:16Z
CONTRIBUTOR
resolved
I'm using a proxy that requires authentication to send request that receives 302 response with Location header. I would like python.requests to follow this redirect and make request via proxy with specified credentials. But it seems like this doesn't happen, if I provide credentials in HTTPProxyAuth they will work ok for 200 responses but will fail for 302. See below code sample: ```python import requests from requests.auth import HTTPProxyAuth sess = requests.Session() url1 = 'http://httpbin.org/' url2 = 'http://httpbin.org/redirect/2' auth = HTTPProxyAuth('frank', 'hunter2') proxies = { "http": "http://localhost:9000" } response1 = sess.get(url1, proxies=proxies, auth=auth) response1.raise_for_status() response2 = sess.get(url2, proxies=proxies, auth=auth) response2.raise_for_status() ``` Now launch MITM proxy on localhost ``` > mitmproxy -p 9000 --singleuser=frank:hunter2 ``` This fails with 407 for me, and proxy logs only two requests ``` response2.raise_for_status() File "----------", line 862, in raise_for_status raise HTTPError(http_error_msg, response=self) requests.exceptions.HTTPError: 407 Client Error: Proxy Authentication Required for url: http://httpbin.org/relative-redirect/1 ``` ``` >> GET http://httpbin.org/ ← 200 text/html 11.87kB 3.57MB/s GET http://httpbin.org/redirect/2 ← 302 text/html 247B 76.59kB/s ``` it does not log request to `Location`. I see that putting credentials in proxies dictionary somehow fixes this issue when I use MITM proxy but it doesn't fix it for my production proxy (can't share code or proxy details here, need to check closer why it doesn't work for my proxy). I guess some details in setup of proxies might vary. Is this a bug? I see some issues for proxy auth but they are mostly about HTTPS, not sure if someone reported this thing I describe here. Should this be fixed? EDIT: It looks like this always fails if proxy password is empty string. change auth to ```python auth = HTTPProxyAuth('frank', '') proxies = { "http": "http://frank:@localhost:9000" } ``` will now always fail on redirect. ```python auth = HTTPProxyAuth('frank', 'hunter2') proxies = { "http": "http://frank:hunter2@localhost:9000" } ``` works fine on redirects, but seems somewhat duplicated. I noticed this on Ubuntu 14.04, requests 2.11.1, python 2.7.6, mitmproxy 0.10.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/3659/reactions" }
https://api.github.com/repos/psf/requests/issues/3659/timeline
null
completed
null
null
false
[ "Ok, let's tightly restrict the scope of this bug.\n\nFirstly, HTTPProxyAuth is a backward compatibility auth. It does not integrate well with httplib's handling of proxies, especially for CONNECT HTTPS proxying. We don't want you to use it. Please put the auth into the proxy URL, as you have discovered.\n\nSo the second case is that you seem to be suggesting that if we proxy auth using an empty password, that gets stripped on redirects? If you remote the HTTPProxyAuth and just leave the auth in the proxy URL, do you still lose the auth on the redirect?\n", "Aha, ok, so it looks like if there is no password we don't emit auth _at all_ if it comes from the URL. This is presumably a URL parsing issue. Out of interest, why on earth do you have a proxy that requires authorization but allows an _empty_ password field?\n", "> Out of interest, why on earth do you have a proxy that requires authorization but allows an empty password field?\n\nproxy just uses apikey as username so that auth is: `\"bunch_of_illegible_tokens_some_sha226_or_something:<empty string>\"`. I was suprised by this too, but proxy developer told me: \"this becomes common convention for proxies\"\n", "> Firstly, HTTPProxyAuth is a backward compatibility auth. It does not integrate well with httplib's handling of proxies, especially for CONNECT HTTPS proxying. We don't want you to use it. Please put the auth into the proxy URL, as you have discovered.\n\nshould we add some deprecation warning for that? I can add it too, sounds like patch with 'easy' tag.\n", "That is totally bizarre. Utterly, totally bizarre. But ok. =P\n\nI'm happy for us to add a deprecation warning. And we clearly have a bug around the auth-in-url stuff. We should fix that. =D\n", "This issue looks easily fixed too: the `proxy_headers` method on the HTTPAdapter requires truthy values for both `username` and `password`. I recommend that that be changed to only require a truthy value for `username`, along with a test. Would you like to make that change @pawelmhm?\n", "sure will send pr\n" ]
https://api.github.com/repos/psf/requests/issues/3658
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/3658/labels{/name}
https://api.github.com/repos/psf/requests/issues/3658/comments
https://api.github.com/repos/psf/requests/issues/3658/events
https://github.com/psf/requests/pull/3658
186,226,139
MDExOlB1bGxSZXF1ZXN0OTE1NzAxMDI=
3,658
Formatted the example to fix the color highlighting
{ "avatar_url": "https://avatars.githubusercontent.com/u/973362?v=4", "events_url": "https://api.github.com/users/elzapp/events{/privacy}", "followers_url": "https://api.github.com/users/elzapp/followers", "following_url": "https://api.github.com/users/elzapp/following{/other_user}", "gists_url": "https://api.github.com/users/elzapp/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/elzapp", "id": 973362, "login": "elzapp", "node_id": "MDQ6VXNlcjk3MzM2Mg==", "organizations_url": "https://api.github.com/users/elzapp/orgs", "received_events_url": "https://api.github.com/users/elzapp/received_events", "repos_url": "https://api.github.com/users/elzapp/repos", "site_admin": false, "starred_url": "https://api.github.com/users/elzapp/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/elzapp/subscriptions", "type": "User", "url": "https://api.github.com/users/elzapp", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2016-10-31T08:09:47Z
2021-09-08T02:10:24Z
2016-10-31T08: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/3658/reactions" }
https://api.github.com/repos/psf/requests/issues/3658/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/3658.diff", "html_url": "https://github.com/psf/requests/pull/3658", "merged_at": "2016-10-31T08:53:04Z", "patch_url": "https://github.com/psf/requests/pull/3658.patch", "url": "https://api.github.com/repos/psf/requests/pulls/3658" }
true
[ "Thanks! :sparkles: :cake: :sparkles:\n" ]
https://api.github.com/repos/psf/requests/issues/3657
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/3657/labels{/name}
https://api.github.com/repos/psf/requests/issues/3657/comments
https://api.github.com/repos/psf/requests/issues/3657/events
https://github.com/psf/requests/issues/3657
186,176,805
MDU6SXNzdWUxODYxNzY4MDU=
3,657
Empty/whitespace-only values in requests.post data
{ "avatar_url": "https://avatars.githubusercontent.com/u/2373726?v=4", "events_url": "https://api.github.com/users/scubbo/events{/privacy}", "followers_url": "https://api.github.com/users/scubbo/followers", "following_url": "https://api.github.com/users/scubbo/following{/other_user}", "gists_url": "https://api.github.com/users/scubbo/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/scubbo", "id": 2373726, "login": "scubbo", "node_id": "MDQ6VXNlcjIzNzM3MjY=", "organizations_url": "https://api.github.com/users/scubbo/orgs", "received_events_url": "https://api.github.com/users/scubbo/received_events", "repos_url": "https://api.github.com/users/scubbo/repos", "site_admin": false, "starred_url": "https://api.github.com/users/scubbo/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/scubbo/subscriptions", "type": "User", "url": "https://api.github.com/users/scubbo", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2016-10-31T00:27:52Z
2021-09-08T14:00:41Z
2016-10-31T09:02:41Z
NONE
resolved
Either one or two issues here, but probably related (please let me know if you'd rather have them raised separately): 1. Entries in requests.post data that have empty values are not transmitted 2. Entries in requests.post data that have whitespace-only values are not transmitted when entered as a json string, but are when entered as a dictionary See the following demonstration code: ``` #!/usr/bin/env python from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer from threading import Thread import cgi import requests class Handler(BaseHTTPRequestHandler): def do_POST(self): print 'Got a post request' self.send_response(200) self.send_header('Content-type', 'application/json') self.end_headers() form = cgi.FieldStorage( fp=self.rfile, headers=self.headers, environ={ 'REQUEST_METHOD':'POST', 'CONTENT_TYPE':'application/json', }) print 'Data is:' + str(form) for key in form: print 'Key: ' + key + ', Value: ' + form[key].value return if __name__ == '__main__': server_address=('',8080) httpd = HTTPServer(server_address, Handler) Thread(target=httpd.serve_forever).start() requests.post('http://localhost:8080', data='{"key1":""}') requests.post('http://localhost:8080', data={'key2':''}) requests.post('http://localhost:8080', data='{"key3":" "}') requests.post('http://localhost:8080', data={'key4':' '}) httpd.shutdown() ``` Expected output: ``` Got a post request 127.0.0.1 - - [30/Oct/2016 17:24:20] "POST / HTTP/1.1" 200 - Data is:FieldStorage(None, None, [MiniFieldStorage('key1', '')]) Got a post request 127.0.0.1 - - [30/Oct/2016 17:24:20] "POST / HTTP/1.1" 200 - Data is:FieldStorage(None, None, [MiniFieldStorage('key2', '')]) Got a post request 127.0.0.1 - - [30/Oct/2016 17:24:20] "POST / HTTP/1.1" 200 - Data is:FieldStorage(None, None, [MiniFieldStorage('key3', ' ')]) Got a post request 127.0.0.1 - - [30/Oct/2016 17:24:20] "POST / HTTP/1.1" 200 - Data is:FieldStorage(None, None, [MiniFieldStorage('key4', ' ')]) Key: key4, Value: ``` Actual output: ``` Got a post request 127.0.0.1 - - [30/Oct/2016 17:24:20] "POST / HTTP/1.1" 200 - Data is:FieldStorage(None, None, []) Got a post request 127.0.0.1 - - [30/Oct/2016 17:24:20] "POST / HTTP/1.1" 200 - Data is:FieldStorage(None, None, []) Got a post request 127.0.0.1 - - [30/Oct/2016 17:24:20] "POST / HTTP/1.1" 200 - Data is:FieldStorage(None, None, []) Got a post request 127.0.0.1 - - [30/Oct/2016 17:24:20] "POST / HTTP/1.1" 200 - Data is:FieldStorage(None, None, [MiniFieldStorage('key4', ' ')]) Key: key4, Value: ```
{ "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/3657/reactions" }
https://api.github.com/repos/psf/requests/issues/3657/timeline
null
completed
null
null
false
[ "When you pass a string the `data` kwarg, we don't process it at all: we just send it on. That means that, for at least key1 and key3, the error in behaviour is with your server.\n\nNow, I suspect that's because you aren't sending a JSON content-type header, which means that the remote server has no idea what the content is. So let's consider only key2, which is the only part that is even slightly likely to be surprising. If I change your code to this:\n\n``` python\nr = requests.post('http://http2bin.org/post', data={'key2': ''})\nprint(r.json()[\"form\"])\n```\n\nYou'll see that http2bin has seen the empty field value. A wireshark trace of that request shows that Requests sent this:\n\n``` python\nPOST /post HTTP/1.1\nHost: http2bin.org\nConnection: keep-alive\nAccept-Encoding: gzip, deflate\nAccept: */*\nUser-Agent: python-requests/2.11.1\nContent-Length: 5\nContent-Type: application/x-www-form-urlencoded\n\nkey2=\n```\n\nSo this suggests that all of the observed problems you are seeing are to do with your _server_, and nothing to do with Requests.\n", "Thanks!\n" ]
https://api.github.com/repos/psf/requests/issues/3656
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/3656/labels{/name}
https://api.github.com/repos/psf/requests/issues/3656/comments
https://api.github.com/repos/psf/requests/issues/3656/events
https://github.com/psf/requests/pull/3656
186,156,911
MDExOlB1bGxSZXF1ZXN0OTE1MzI4NjM=
3,656
Drop Python 2.6 support
{ "avatar_url": "https://avatars.githubusercontent.com/u/294415?v=4", "events_url": "https://api.github.com/users/di/events{/privacy}", "followers_url": "https://api.github.com/users/di/followers", "following_url": "https://api.github.com/users/di/following{/other_user}", "gists_url": "https://api.github.com/users/di/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/di", "id": 294415, "login": "di", "node_id": "MDQ6VXNlcjI5NDQxNQ==", "organizations_url": "https://api.github.com/users/di/orgs", "received_events_url": "https://api.github.com/users/di/received_events", "repos_url": "https://api.github.com/users/di/repos", "site_admin": false, "starred_url": "https://api.github.com/users/di/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/di/subscriptions", "type": "User", "url": "https://api.github.com/users/di", "user_view_type": "public" }
[]
closed
true
null
[]
null
4
2016-10-30T19:27:57Z
2021-09-04T00:06:48Z
2016-10-30T20:08:22Z
MEMBER
resolved
Yesterday marks 3 years since the last release of Python 2.6! πŸŽ‰ To celebrate, I'm attempting to drop support for it from 156 prominent Python packages (one for every week it's past end-of-life)--including this one! I've tried my best to remove as much 2.6-specific cruft as I can, but at the very least, this PR will remove the `'Programming Language :: Python :: 2.6'` trove classifier from this projects `setup.py`.
{ "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/3656/reactions" }
https://api.github.com/repos/psf/requests/issues/3656/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/3656.diff", "html_url": "https://github.com/psf/requests/pull/3656", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/3656.patch", "url": "https://api.github.com/repos/psf/requests/pulls/3656" }
true
[ "No.\n", "Double no.\n", "One year on, any thoughts on dropping 2.6?\r\n\r\nIf not now, what are the reasons for keeping it and when might it be droppable?\r\n\r\nI see it's no longer being tested: https://github.com/requests/requests/commit/c3ecb825c41f90fb6bec28c282c70c84398e08c0.", "This was eventually done in #4118." ]
https://api.github.com/repos/psf/requests/issues/3655
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/3655/labels{/name}
https://api.github.com/repos/psf/requests/issues/3655/comments
https://api.github.com/repos/psf/requests/issues/3655/events
https://github.com/psf/requests/pull/3655
186,047,502
MDExOlB1bGxSZXF1ZXN0OTE0NzExODE=
3,655
Rewind readable body before POST redirect
{ "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
9
2016-10-29T00:18:10Z
2021-09-08T02:10:21Z
2016-11-03T10:31:04Z
MEMBER
resolved
This addresses the issue (#3079) of Requests hanging when a POST with a file-like body encounters a temporary redirect. This currently has the unmerged tests from #3536, so I'll need to remove those if we reach a point where we're ready to merge this. This approach has a couple of things that I'm not especially happy with but couldn't come up with a nicer alternative. I've added a few outstanding questions below. 1.) I feel like `body_position` should probably be `_body_position`, but we need to use it in the `Session` module. Making it a private var would require an additional getter method for `PreparedRequest` to expose the data to `Session`, but I wanted to run that by before adding more code. It just seems problematic to provide any encouragement to manually set `body_position` since it will lead to fairly unintuitive behaviour. 2.) As I noted in the comment [here](https://github.com/nateprewitt/requests/commit/b84d71461e238b123a39ce91a48a99e3eb03717c#commitcomment-19619276), this still allows for the possibility that a request with a file-like object, that has tell but no seek, to hang. I feel like we should raise an `IOError` if we can't rewind, at least allowing the user to manually recreate the body and POST it to the new URL. Does that seem reasonable?
{ "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/3655/reactions" }
https://api.github.com/repos/psf/requests/issues/3655/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/3655.diff", "html_url": "https://github.com/psf/requests/pull/3655", "merged_at": "2016-11-03T10:31:04Z", "patch_url": "https://github.com/psf/requests/pull/3655.patch", "url": "https://api.github.com/repos/psf/requests/pulls/3655" }
true
[ "Alright @Lukasa, I think everything in that last round should be addressed. A couple of notes on some decisions I made in these tweaks.\n\nPython 2.7 decided it needs to return a long from `tell` instead of an int like every other version. I've adjusted for that by casting it to int because we can't test for long in Py3.\n\nI didn't declare the \"sentinel object\" as a global because I couldn't come up with a scenario where it was equivocal to anything in the sessions module. Simply setting it to object accomplishes what we were looking for but perhaps there's a caveat I'm missing here?\n\n~~**Tests.** I went a little crazy. I have a few \"lifecycle\" tests, but found a snag when adding `test_rewind_body_failed_tell`. I realized things were failing in different ways (`_body_position` was never being set with the custom test objects) but the error messages produced were still \"correct\". In order to prevent accidental regressions, I add specific tests for setting `_body_position` and failure conditions in `rewind_body` by manually setting `_body_position`. Let me know if you want these collapsed back.~~\n\nEdit: I went ahead and expanded the test objects to simplify the testing.\n", "Here's another round of changes @Lukasa.\n\nI moved the `rewind_body` to a util function but when I started looking at moving tests over to `test_utils` they're going to bring a lot of import overhead with them. I can chop them up into individual `_body_position` and `rewind_body` tests and divide them up accordingly. Otherwise, we can leave them where they are.\n", "Alright, ValueError removed, tuple properly instantiated, and comment added. I also squashed most of the commits down. There's an unnecessary space I need to pull from beneath the `_body_position` declaration but I'll do that when I remove bc199e7 before merging. That is unless we have another round :)\n", "Want to do your final tidying up now, @nateprewitt? I don't think I'm going to have any further feedback at this time.\n", "Ok, I think things are good to go from my end.\n", "Just a reminder, we'll need to merge #3536 before this is merged.\n", "Ah, sorry, I didn't realise that's what was going on there. Can you merge the branch from #3536 into this branch and then I'll merge them both as one? I'd rather not have a weird interim master state where we have deliberately failing tests on the master branch.\n", "Ok, everything is merged in and this should be ready to go. It will now supersede #3536.\n", "Thanks for this @nateprewitt!\n" ]
https://api.github.com/repos/psf/requests/issues/3654
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/3654/labels{/name}
https://api.github.com/repos/psf/requests/issues/3654/comments
https://api.github.com/repos/psf/requests/issues/3654/events
https://github.com/psf/requests/pull/3654
185,920,009
MDExOlB1bGxSZXF1ZXN0OTEzNzkyOTk=
3,654
Accept integers in header
{ "avatar_url": "https://avatars.githubusercontent.com/u/7986123?v=4", "events_url": "https://api.github.com/users/ploth/events{/privacy}", "followers_url": "https://api.github.com/users/ploth/followers", "following_url": "https://api.github.com/users/ploth/following{/other_user}", "gists_url": "https://api.github.com/users/ploth/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/ploth", "id": 7986123, "login": "ploth", "node_id": "MDQ6VXNlcjc5ODYxMjM=", "organizations_url": "https://api.github.com/users/ploth/orgs", "received_events_url": "https://api.github.com/users/ploth/received_events", "repos_url": "https://api.github.com/users/ploth/repos", "site_admin": false, "starred_url": "https://api.github.com/users/ploth/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/ploth/subscriptions", "type": "User", "url": "https://api.github.com/users/ploth", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2016-10-28T13:13:48Z
2021-09-08T02:10:24Z
2016-10-28T13:15:00Z
NONE
resolved
This is a fix for the following crash of the utils.py I've encountered when syncing with vdirsyncer. Traceback (most recent call last): File "/usr/lib/python3.5/site-packages/vdirsyncer/cli/tasks.py", line 58, in sync_collection force_delete=force_delete File "/usr/lib/python3.5/site-packages/vdirsyncer/sync.py", line 169, in sync b_info.prepare_idents(storage_a.read_only) File "/usr/lib/python3.5/site-packages/vdirsyncer/sync.py", line 104, in prepare_idents for href, etag in self.storage.list(): File "/usr/lib/python3.5/site-packages/vdirsyncer/storage/dav.py", line 565, in list headers=headers) File "/usr/lib/python3.5/site-packages/vdirsyncer/storage/dav.py", line 322, in request return utils.http.request(method, url, session=self._session, *_more) File "/usr/lib/python3.5/site-packages/vdirsyncer/utils/http.py", line 79, in request r = func(method, url, *_kwargs) File "/usr/lib/python3.5/site-packages/requests/sessions.py", line 462, in request prep = self.prepare_request(req) File "/usr/lib/python3.5/site-packages/requests/sessions.py", line 395, in prepare_request hooks=merge_hooks(request.hooks, self.hooks), File "/usr/lib/python3.5/site-packages/requests/models.py", line 301, in prepare self.prepare_headers(headers) File "/usr/lib/python3.5/site-packages/requests/models.py", line 415, in prepare_headers check_header_validity(header) File "/usr/lib/python3.5/site-packages/requests/utils.py", line 794, in check_header_validity "not %s" % (value, type(value))) requests.exceptions.InvalidHeader: Header value 1 must be of type str or bytes, not <class 'int'>
{ "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/3654/reactions" }
https://api.github.com/repos/psf/requests/issues/3654/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/3654.diff", "html_url": "https://github.com/psf/requests/pull/3654", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/3654.patch", "url": "https://api.github.com/repos/psf/requests/pulls/3654" }
true
[ "Thanks! However, this is not considered a bug. See #3477 for more.\n" ]
https://api.github.com/repos/psf/requests/issues/3653
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/3653/labels{/name}
https://api.github.com/repos/psf/requests/issues/3653/comments
https://api.github.com/repos/psf/requests/issues/3653/events
https://github.com/psf/requests/issues/3653
185,862,484
MDU6SXNzdWUxODU4NjI0ODQ=
3,653
Chunked transfer encoding for SSE heartbeats failing
{ "avatar_url": "https://avatars.githubusercontent.com/u/694893?v=4", "events_url": "https://api.github.com/users/huntc/events{/privacy}", "followers_url": "https://api.github.com/users/huntc/followers", "following_url": "https://api.github.com/users/huntc/following{/other_user}", "gists_url": "https://api.github.com/users/huntc/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/huntc", "id": 694893, "login": "huntc", "node_id": "MDQ6VXNlcjY5NDg5Mw==", "organizations_url": "https://api.github.com/users/huntc/orgs", "received_events_url": "https://api.github.com/users/huntc/received_events", "repos_url": "https://api.github.com/users/huntc/repos", "site_admin": false, "starred_url": "https://api.github.com/users/huntc/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/huntc/subscriptions", "type": "User", "url": "https://api.github.com/users/huntc", "user_view_type": "public" }
[]
closed
true
null
[]
null
10
2016-10-28T08:05:58Z
2021-09-08T14:00:43Z
2016-10-28T08:18:11Z
NONE
resolved
When subscribing to a Server Sent Events endpoint, I notice an error given the processing of a heartbeat. Heartbeats in SSE can be sent as an empty line. Consider the following SSE reply for chunked transfer encoding: ``` 00000000 48 54 54 50 2f 31 2e 31 20 32 30 30 20 4f 4b 0d HTTP/1.1 200 OK. 00000010 0a 53 65 72 76 65 72 3a 20 6f 70 65 6e 72 65 73 .Server: openres 00000020 74 79 2f 31 2e 39 2e 31 35 2e 31 0d 0a 44 61 74 ty/1.9.1 5.1..Dat 00000030 65 3a 20 46 72 69 2c 20 32 38 20 4f 63 74 20 32 e: Fri, 28 Oct 2 00000040 30 31 36 20 30 32 3a 33 39 3a 35 34 20 47 4d 54 016 02:3 9:54 GMT 00000050 0d 0a 43 6f 6e 74 65 6e 74 2d 54 79 70 65 3a 20 ..Conten t-Type: 00000060 74 65 78 74 2f 65 76 65 6e 74 2d 73 74 72 65 61 text/eve nt-strea 00000070 6d 0d 0a 54 72 61 6e 73 66 65 72 2d 45 6e 63 6f m..Trans fer-Enco 00000080 64 69 6e 67 3a 20 63 68 75 6e 6b 65 64 0d 0a 43 ding: ch unked..C 00000090 6f 6e 6e 65 63 74 69 6f 6e 3a 20 6b 65 65 70 2d onnectio n: keep- 000000A0 61 6c 69 76 65 0d 0a 0d 0a alive... . 000000A9 31 0d 0a 0a 0d 0a 1..... ``` With the last line, the `31` indicates that there is just one byte to receive (ASCII `1`). The chunked size is then followed by a CRLF and then the empty line (`LF`), followed again by a CRLF. This appears to cause the following stacktrace: ``` ... File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/requests/utils.py", line 377, in stream_decode_response_unicode for chunk in iterator: File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/requests/models.py", line 676, in generate for chunk in self.raw.stream(chunk_size, decode_content=True): File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/requests/packages/urllib3/response.py", line 353, in stream for line in self.read_chunked(amt, decode_content=decode_content): File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/requests/packages/urllib3/response.py", line 502, in read_chunked self._update_chunk_length() File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/requests/packages/urllib3/response.py", line 448, in _update_chunk_length line = self._fp.fp.readline() AttributeError: 'NoneType' object has no attribute 'readline' ``` What I'm left wondering is whether chunked responses that only contain a newline cause the requests library a problem. I'm using requests 2.11.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/3653/reactions" }
https://api.github.com/repos/psf/requests/issues/3653/timeline
null
completed
null
null
false
[ "I can't reproduce a problem on my system by duplicating that output. Is it possible for you to provide the code you're using?\n", "I appreciate the situation, however a reproducer isn't immediately available. I'll try and work on something for you, but can't promise anything. Thanks for any further insights.\n", "Thanks @huntc. In the meantime, the best I can give you is the knowledge that this isn't immediately obviously a requests problem. =( Sorry!\n", "I've been looking at the request code most of today. The fact that it is throwing an error given a correct SSE reply should be cause for concern. My theory is that the body is consumed and eats the LF without considering that it is to be counted in the chunked reply. \n", "@huntc That theory has at least one counter-example:\n\n``` python\nimport socket\n\ns = socket.socket()\ns.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)\ns.bind(('', 8080))\ns.listen(5)\n\nwhile True:\n new_sock, _ = s.accept()\n data = b''\n while not data.endswith(b'\\r\\n\\r\\n'):\n data += new_sock.recv(8192)\n\n new_sock.sendall(\n b'HTTP/1.1 200 OK\\r\\n'\n b'Server: socket server\\r\\n'\n b'Transfer-Encoding: chunked\\r\\n'\n b'\\r\\n'\n )\n new_sock.sendall(b'1\\r\\n\\n\\r\\n')\n new_sock.sendall(b'1\\r\\n\\n\\r\\n')\n new_sock.sendall(b'5\\r\\nhello\\r\\n')\n new_sock.sendall(b'5\\r\\nworld\\r\\n')\n new_sock.sendall(b'0\\r\\n\\r\\n')\n new_sock.close()\n```\n\nIf you run that script and then do this:\n\n``` python\nr = requests.get('http://localhost:8080/', stream=True)\nfor chunk in r.iter_content(1024):\n print repr(chunk)\n```\n\nthen I encounter no error.\n", "Thanks. I'll look further. \n", "I've got a reproducer - same server code as your provided, but here's the client code. I shall investigate further, but I'm posting here in case you see anything obvious. The code was copied and modified from https://bitbucket.org/btubbs/sseclient, so I may have inherited a problem, or inadvertently introduced one.\n\n``` python\nimport requests\nimport re\n\n\nSSE_REQUEST_INPUT = {\n 'headers': {\n 'Cache-Control': 'no-cache',\n 'Accept': 'text/event-stream'\n }\n}\n\n\nSSE_END_OF_FIELD = re.compile(r'\\r\\n\\r\\n|\\r\\r|\\n\\n')\n\n\ndef is_event_complete(buf):\n return re.search(SSE_END_OF_FIELD, buf) is not None\n\n\ndef parse_event(raw_sse_string):\n event, data = None, None\n lines = raw_sse_string.split('\\n')\n for line in lines:\n if line.rstrip():\n key, value = line.split(':')\n if key == 'event':\n event = value\n elif key == 'data':\n data = value\n return Event(event, data)\n\n\nclass Event:\n def __init__(self, event, data):\n self.event = event\n self.data = data\n\n def __eq__(self, other):\n if type(other) is type(self):\n return self.__dict__ == other.__dict__\n else:\n return False\n\n def __ne__(self, other):\n return not self.__eq__(other)\n\n\nclass Client:\n \"\"\"\n The following SSE Client has been backported, cut down version of https://bitbucket.org/btubbs/sseclient -\n look at sseclient.py.\n\n We were not be able to use the SSE client library as it does not have the support for Python 3.2 due\n to the presence of unicode string declaration (i.e. u''). The unicode string declaration is valid from Python 3.3 and\n above, while in Python 3.2 it will result in Syntax error.\n\n Changes introduced as part of the backport:\n - Support for Python 3.2 (i.e. do not use u'')\n - Parse only for event and data string within SSE\n - No support for retries and last event id\n \"\"\"\n def __init__(self, url, headers=None):\n self.url = url\n self.headers = headers\n self.response = None\n\n def connect(self):\n sse_request_input = dict(SSE_REQUEST_INPUT)\n if self.headers:\n sse_request_input['headers'].update(self.headers)\n\n response = requests.get(self.url, stream=True, **sse_request_input)\n response.raise_for_status()\n self.response = response\n\n def __iter__(self):\n return self\n\n def __next__(self):\n buf = ''\n while not is_event_complete(buf):\n next_char = next(self.response.iter_content(decode_unicode=True))\n buf += next_char.decode('ascii')\n\n split = re.split(SSE_END_OF_FIELD, buf)\n raw_sse = split[0]\n return parse_event(raw_sse)\n\n\ndef get_events(url, headers=None):\n client = Client(url, headers)\n client.connect()\n return client\n\nsse_events = get_events('http://localhost:8080/')\nfor event in sse_events:\n print(repr(event))\n```\n", "Further investigations show that the problem is occurring within:\n\n``` python\n next_char = next(self.response.iter_content(decode_unicode=True))\n```\n\nHere's my stack trace:\n\n```\nChristohersMBP2:test huntc$ python3 client.py\nb'\\n'\nTraceback (most recent call last):\n File \"client.py\", line 97, in <module>\n for event in sse_events:\n File \"client.py\", line 82, in __next__\n next_char = next(self.response.iter_content(decode_unicode=True))\n File \"/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/requests/utils.py\", line 372, in stream_decode_response_unicode\n for item in iterator:\n File \"/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/requests/models.py\", line 676, in generate\n for chunk in self.raw.stream(chunk_size, decode_content=True):\n File \"/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/requests/packages/urllib3/response.py\", line 353, in stream\n for line in self.read_chunked(amt, decode_content=decode_content):\n File \"/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/requests/packages/urllib3/response.py\", line 502, in read_chunked\n self._update_chunk_length()\n File \"/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/requests/packages/urllib3/response.py\", line 448, in _update_chunk_length\n line = self._fp.fp.readline()\nAttributeError: 'NoneType' object has no attribute 'readline'\n```\n\nI will continue looking further over the w/e.\n", "That's ok, I've identified the problem. `iter_content` returns a _generator_, which necessarily contains some state. In the case of `iter_content` it contains two particularly important bits of state: one related to Unicode decoding (which you're using), and one related to response completion state. If you throw the generators away, or create more than one, you lose that state, which causes Requests to get confused about where the response body is or what data has already been read.\n\nChange your code to call `iter_content` once per response and save its return value in a variable, and then call `next` on that variable instead. This should resolve your problem.\n", "Got it! Thanks so much for your help!\n" ]
https://api.github.com/repos/psf/requests/issues/3652
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/3652/labels{/name}
https://api.github.com/repos/psf/requests/issues/3652/comments
https://api.github.com/repos/psf/requests/issues/3652/events
https://github.com/psf/requests/pull/3652
185,711,977
MDExOlB1bGxSZXF1ZXN0OTEyMzE1NDg=
3,652
The data= parameter barfs on all dictionary-like objects that don't subclass dict itself #3649
{ "avatar_url": "https://avatars.githubusercontent.com/u/4481232?v=4", "events_url": "https://api.github.com/users/lejkos/events{/privacy}", "followers_url": "https://api.github.com/users/lejkos/followers", "following_url": "https://api.github.com/users/lejkos/following{/other_user}", "gists_url": "https://api.github.com/users/lejkos/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/lejkos", "id": 4481232, "login": "lejkos", "node_id": "MDQ6VXNlcjQ0ODEyMzI=", "organizations_url": "https://api.github.com/users/lejkos/orgs", "received_events_url": "https://api.github.com/users/lejkos/received_events", "repos_url": "https://api.github.com/users/lejkos/repos", "site_admin": false, "starred_url": "https://api.github.com/users/lejkos/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/lejkos/subscriptions", "type": "User", "url": "https://api.github.com/users/lejkos", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2016-10-27T16:03:44Z
2021-09-08T02:10:24Z
2016-10-27T16:51:29Z
CONTRIBUTOR
resolved
requests.post does not accept custom mappings as data parameters. I changed the type check to Mapping. Original bug report can be found at #3649: The data= parameter barfs on all dictionary-like objects that don't subclass dict itself #3649
{ "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/3652/reactions" }
https://api.github.com/repos/psf/requests/issues/3652/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/3652.diff", "html_url": "https://github.com/psf/requests/pull/3652", "merged_at": "2016-10-27T16:51:29Z", "patch_url": "https://github.com/psf/requests/pull/3652.patch", "url": "https://api.github.com/repos/psf/requests/pulls/3652" }
true
[ "✨🍰✨\n" ]
https://api.github.com/repos/psf/requests/issues/3651
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/3651/labels{/name}
https://api.github.com/repos/psf/requests/issues/3651/comments
https://api.github.com/repos/psf/requests/issues/3651/events
https://github.com/psf/requests/issues/3651
185,554,840
MDU6SXNzdWUxODU1NTQ4NDA=
3,651
requests can't properly handle 'WWW-Authenticate' response header
{ "avatar_url": "https://avatars.githubusercontent.com/u/7598892?v=4", "events_url": "https://api.github.com/users/beruhan/events{/privacy}", "followers_url": "https://api.github.com/users/beruhan/followers", "following_url": "https://api.github.com/users/beruhan/following{/other_user}", "gists_url": "https://api.github.com/users/beruhan/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/beruhan", "id": 7598892, "login": "beruhan", "node_id": "MDQ6VXNlcjc1OTg4OTI=", "organizations_url": "https://api.github.com/users/beruhan/orgs", "received_events_url": "https://api.github.com/users/beruhan/received_events", "repos_url": "https://api.github.com/users/beruhan/repos", "site_admin": false, "starred_url": "https://api.github.com/users/beruhan/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/beruhan/subscriptions", "type": "User", "url": "https://api.github.com/users/beruhan", "user_view_type": "public" }
[]
closed
true
null
[]
null
5
2016-10-27T01:58:38Z
2021-09-08T14:00:43Z
2016-10-27T03:04:24Z
NONE
resolved
when the http response like this: `HTTP/1.1 401 Unauthorized\r\n Server: DNVRS-Webs\r\n Content-Type: text/html\r\n WWW-Authenticate: Basic realm="DVRNVRDVS"\r\n WWW-Authenticate: Digest realm="DVRNVRDVS", domain="::", qop="auth", nonce="2c4158c9159934737e69aa698494ae04", opaque="", algorithm="MD5", stale="FALSE"\r\n` I have print the response headers ,`{'Server': 'DNVRS-Webs', 'Content-Type': 'text/html', 'WWW-Authenticate': 'Basic realm="DVRNVRDVS", Digest realm="DVRNVRDVS", domain="::", qop="auth", nonce="2c4158c9159934737e69aa698494ae04", opaque="", algorithm="MD5", stale="FALSE"'}`,is this a bug? @nakajima @alex @mkomitee @thedaniel
{ "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/3651/reactions" }
https://api.github.com/repos/psf/requests/issues/3651/timeline
null
completed
null
null
false
[ "This isn't a bug in Requests. You're getting a 401, which means you're using or were provided the wrong credentials for the server you're attempting to authenticate to.\n", "@drpoggi is likely correct. Further, without extra information, it's hard for any of the people you tagged in this bug to help you (let alone the maintainers of this project).\n\nIf you have a _question_ please ask it on [StackOverflow](https://stackoverflow.com).\n", "I presume the _actual_ question is: is it a bug that the two WWW-Authenticate headers got merged into one.\n\nThe answer is no. WWW-Authenticate is defined as a list header, and the relevant RFC (RFC 7235 for those keeping track) explicitly points out that the header may contain multiple challenges, each of which is comma-separated, as well as the various comma-separated parameters. What requests did was totally fine here.\n", "here is a example,`import requests\nfrom requests.auth import *\nreq = requests.get('http://61.91.211.158:81/onvif/snapshot/101',timeout=3)\nprint req.headers`,but it raise timeout exception,I have used wireshark to capture the packets,It response quikly.`HTTP/1.1 401 Unauthorized\nDate: Sat, 29 Oct 2016 19:06:59 GMT\nServer: DNVRS-Webs\nCache-Control: no-cache\nContent-Type: text/html\nConnection: keep-alive\nKeep-Alive: timeout=60, max=99\nWWW-Authenticate: Basic realm=\"DVRNVRDVS\"\nWWW-Authenticate: Digest realm=\"DVRNVRDVS\", domain=\"::\", qop=\"auth\", nonce=\"71225169d5e6c3e80672d195911b6d23\", opaque=\"\", algorithm=\"MD5\", stale=\"FALSE\"`,why requests will raise timeout exception? ,and when I remove timeout param It will get 401 status code,but will wait a long long time.@Lukasa @sigmavirus24 @drpoggi \n", "I suspect that the issue is that the response is not correctly terminated, which causes Requests to expect more data to show up. Is there any body content? Because having a Content-Type suggests there is. \n" ]