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/2230
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/2230/labels{/name}
https://api.github.com/repos/psf/requests/issues/2230/comments
https://api.github.com/repos/psf/requests/issues/2230/events
https://github.com/psf/requests/issues/2230
43,096,088
MDU6SXNzdWU0MzA5NjA4OA==
2,230
requests will improperly raise errors as ConnectionError
{ "avatar_url": "https://avatars.githubusercontent.com/u/234019?v=4", "events_url": "https://api.github.com/users/kevinburke/events{/privacy}", "followers_url": "https://api.github.com/users/kevinburke/followers", "following_url": "https://api.github.com/users/kevinburke/following{/other_user}", "gists_url": "https://api.github.com/users/kevinburke/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kevinburke", "id": 234019, "login": "kevinburke", "node_id": "MDQ6VXNlcjIzNDAxOQ==", "organizations_url": "https://api.github.com/users/kevinburke/orgs", "received_events_url": "https://api.github.com/users/kevinburke/received_events", "repos_url": "https://api.github.com/users/kevinburke/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kevinburke/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kevinburke/subscriptions", "type": "User", "url": "https://api.github.com/users/kevinburke", "user_view_type": "public" }
[]
closed
true
null
[]
null
6
2014-09-18T05:36:29Z
2021-09-08T23:07:56Z
2014-10-05T18:47:30Z
CONTRIBUTOR
resolved
Let's say the server closes the request without sending any data. It's possible that the server began acting on the request (Twilio did this for several years), however requests will raise this as a ConnectionError. Deep down this gets raised as a BadStatusLine error which is caught by urllib3 and turned into a ProtocolError which is caught & re-raised as a ConnectionError. See also shazow/urllib3#470.
{ "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/2230/reactions" }
https://api.github.com/repos/psf/requests/issues/2230/timeline
null
completed
null
null
false
[ "I tried to produce a test case to demonstrate this, but couldn't figure out how to do this in a nice way. Count this as another vote for https://github.com/kennethreitz/httpbin/issues/153, maybe https://github.com/kevinburke/hamms can get ported/implemented on httpbin.\n", "Sorry @kevinburke, it's not clear to me what the bug is here.\n", "A ConnectionError implies that the server never received/began acting on\ndata. This way all ConnectionErrors are safe to retry.\n\nimagine you send a POST request to a server and then wait for a response\nfor 30 seconds, at which point the server closes the connection without\nsending data, headers, anything. Requests will raise a ConnectionError. Is\nthat appropriate?\n\nOn Wednesday, September 17, 2014, Cory Benfield [email protected]\nwrote:\n\n> Sorry @kevinburke https://github.com/kevinburke, it's not clear to me\n> what the bug is here.\n> \n> —\n> Reply to this email directly or view it on GitHub\n> https://github.com/kennethreitz/requests/issues/2230#issuecomment-55998776\n> .\n\n## \n\n## \n\nKevin Burke\nphone: 925.271.7005 | twentymilliseconds.com\n", "Ohhh, yes, that makes sense, but it's a misreading of what 'ConnectionError' means. It doesn't mean 'an error occurred while connecting', it means 'an error occurred that affects the connection'.\n\nWe may want to refactor the exception hierarchy to allow your use case (it sounds good to me), but it's a ton of work and requires a move to 3.0.\n", "Can we close this in deference to #2233?\n", "Suits me. =)\n" ]
https://api.github.com/repos/psf/requests/issues/2229
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/2229/labels{/name}
https://api.github.com/repos/psf/requests/issues/2229/comments
https://api.github.com/repos/psf/requests/issues/2229/events
https://github.com/psf/requests/issues/2229
42,945,644
MDU6SXNzdWU0Mjk0NTY0NA==
2,229
full URL sent instead of path when using https proxy
{ "avatar_url": "https://avatars.githubusercontent.com/u/1994957?v=4", "events_url": "https://api.github.com/users/newsham/events{/privacy}", "followers_url": "https://api.github.com/users/newsham/followers", "following_url": "https://api.github.com/users/newsham/following{/other_user}", "gists_url": "https://api.github.com/users/newsham/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/newsham", "id": 1994957, "login": "newsham", "node_id": "MDQ6VXNlcjE5OTQ5NTc=", "organizations_url": "https://api.github.com/users/newsham/orgs", "received_events_url": "https://api.github.com/users/newsham/received_events", "repos_url": "https://api.github.com/users/newsham/repos", "site_admin": false, "starred_url": "https://api.github.com/users/newsham/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/newsham/subscriptions", "type": "User", "url": "https://api.github.com/users/newsham", "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
9
2014-09-16T23:23:44Z
2021-09-08T23:04:49Z
2015-05-03T15:12:33Z
NONE
resolved
When using the requests library through a web proxy, requests includes a full URL in the request line instead of just the path for all https requests. Http requests send just the path, as expected. Https requests send the full URL in place of the path. This can cause problems with certain proxies (for example, the BURP proxy (http://portswigger.net/burp/download.html) will not properly process these requests unless the special "transparent" proxy mode is enabled). The following script demonstrates his problem: ``` #!/usr/bin/env python """ Requests library will send full URL as the request path when sending HTTPS requests to a proxy.. WHY? Run this script through a proxy listening on the local host, such as BURP, which records all traffic. Look at the proxy logs to see the request lines. Notice that this will send a full URL in the request line. """ import requests proxies = { 'http': 'http://127.0.0.1:8080/', 'https': 'https://127.0.0.1:8080/' } # sends full URL in the request line: r = requests.get("https://www.yahoo.com/the/path/goes/here", proxies=proxies, allow_redirects=False) # sends full just the path in the request line: r = requests.get("http://www.yahoo.com/the/path/goes/here", proxies=proxies, allow_redirects=False) ```
{ "avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4", "events_url": "https://api.github.com/users/Lukasa/events{/privacy}", "followers_url": "https://api.github.com/users/Lukasa/followers", "following_url": "https://api.github.com/users/Lukasa/following{/other_user}", "gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Lukasa", "id": 1382556, "login": "Lukasa", "node_id": "MDQ6VXNlcjEzODI1NTY=", "organizations_url": "https://api.github.com/users/Lukasa/orgs", "received_events_url": "https://api.github.com/users/Lukasa/received_events", "repos_url": "https://api.github.com/users/Lukasa/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions", "type": "User", "url": "https://api.github.com/users/Lukasa", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/2229/reactions" }
https://api.github.com/repos/psf/requests/issues/2229/timeline
null
completed
null
null
false
[ "Hmm, I'm honestly not sure. My gut is saying that this is because having a HTTPS scheme in a proxy URL just doesn't really work.\n", "So I think this might also have something to do with the `CONNECT` verb which we use when connecting to an `https` proxy. I know that for `CONNECT` you have to pass the authority portion of the request URI (e.g., `www.yahoo.com:443`) but I'm not sure if the RFC (7231 or 7232 now) says anything about including the path. I might look that up over lunch\n", "Compare this to the behavior of all other http request libraries (such as urllib) which do not send a full path for https proxies.\n\nTim Newsham | [email protected]:[email protected] | PGP: B415 550D BEE9 07DB B4C9 F96C 8EFE CB2F 402D 3DF0\n\nFrom: Cory Benfield [mailto:[email protected]]\nSent: Tuesday, September 16, 2014 8:17 PM\nTo: kennethreitz/requests\nCc: Tim Newsham\nSubject: Re: [requests] full URL sent instead of path when using https proxy (#2229)\n\nHmm, I'm honestly not sure. My gut is saying that this is because having a HTTPS scheme in a proxy URL just doesn't really work.\n\n—\nReply to this email directly or view it on GitHubhttps://github.com/kennethreitz/requests/issues/2229#issuecomment-55853284.\n", "To be fair, `urllib` is broken in many ways, so frankly comparing requests' behaviour to urllib's is not exactly a comparison that holds weight for me. If instead, you have a comparison to `cURL` that would hold more weight. Further if you can find the section in the RFC that declares how this should work, that'd be best.\n", "Here's what I was able to come up with.\n\nAccording to [RFC 7230](https://tools.ietf.org/html/rfc7230#section-5.3.2):\n\n> When making a request to a proxy, other than a CONNECT or server-wide OPTIONS request (as detailed below), a client MUST send the target URI in absolute-form as the request-target.... An example absolute-form of request-line would be:\n> GET http://www.example.org/pub/WWW/TheProject.html HTTP/1.1\n\nBut the `HTTPAdapter.proxy_manager_for` method uses urllib3's `ProxyManager`, which uses CONNECT for https requests. [A paragraph down in RFC 7230](https://tools.ietf.org/html/rfc7230#section-5.3.3):\n\n> When making a CONNECT request to establish a tunnel through one or more proxies, a client MUST send only the target URI's authority component (excluding any userinfo and its \"@\" delimiter) as the request-target. For example,\n> CONNECT www.example.com:80 HTTP/1.1\n\nTherefore, it looks to me like https requests should always only pass the authority-form of the request target (i.e. the path, not the full url). Then @newsham is seeing a bug in the https requests are handled. Am I missing anything?\n\nHowever, I wasn't able to reproduce the problem. On my own installation of BURP, the demonstration script created two requests, both of which were logged by BURP as only including the path (correct behavior). Furthermore the method was listed as GET for the https request, but I was expecting CONNECT. Could this be my unfamiliarity with BURP?\n", "@benjaminran Nope, it's a corner case in how requests handles proxies.\n\nIf you pass a proxy whose proxy url scheme is 'https://', we don't use CONNECT to tunnel through it, because what's the point? Instead, we connect directly to it over TLS and then treat it like a plaintext proxy, which explains the behaviour you're seeing.\n", "I thought I tracked down the code that handles that when I found the urllib3 ProxyManager in adapters.py:245. Where's the section that specifies to use TLS?\n\nThe first quotation (5.3.2) from RFC 7230 suggests that the behavior newsham is seeing is actually correct--most https requests should be sent with the target as a full url. But I still can't replicate the behavior. I'm running newsham's demonstration script into BURP and both requests have origin-form targets (paths, not urls). Is anyone else able to replicate this?\n", "I can no longer reproduce this issue with my original reproduction script, either.\n", "Closed as unreproducible. Please reopen if a new repro appears.\n" ]
https://api.github.com/repos/psf/requests/issues/2228
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/2228/labels{/name}
https://api.github.com/repos/psf/requests/issues/2228/comments
https://api.github.com/repos/psf/requests/issues/2228/events
https://github.com/psf/requests/issues/2228
42,893,830
MDU6SXNzdWU0Mjg5MzgzMA==
2,228
Documentation examples.
{ "avatar_url": "https://avatars.githubusercontent.com/u/72376?v=4", "events_url": "https://api.github.com/users/mountainpaul/events{/privacy}", "followers_url": "https://api.github.com/users/mountainpaul/followers", "following_url": "https://api.github.com/users/mountainpaul/following{/other_user}", "gists_url": "https://api.github.com/users/mountainpaul/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/mountainpaul", "id": 72376, "login": "mountainpaul", "node_id": "MDQ6VXNlcjcyMzc2", "organizations_url": "https://api.github.com/users/mountainpaul/orgs", "received_events_url": "https://api.github.com/users/mountainpaul/received_events", "repos_url": "https://api.github.com/users/mountainpaul/repos", "site_admin": false, "starred_url": "https://api.github.com/users/mountainpaul/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/mountainpaul/subscriptions", "type": "User", "url": "https://api.github.com/users/mountainpaul", "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" }, { "color": "fad8c7", "default": false, "description": null, "id": 136616769, "name": "Documentation", "node_id": "MDU6TGFiZWwxMzY2MTY3Njk=", "url": "https://api.github.com/repos/psf/requests/labels/Documentation" } ]
closed
true
null
[]
null
15
2014-09-16T15:15:50Z
2022-02-26T04:00:40Z
2021-11-28T03:00:28Z
NONE
resolved
Thanks for an excellent package. I believe the quick start examples should include a timeout value. This is the more common case, rather than the exception. In the more advanced documentation it maybe wise to mention that sockets.getdefaulttimeout() is not used when a value is not specified.
{ "avatar_url": "https://avatars.githubusercontent.com/u/18519037?v=4", "events_url": "https://api.github.com/users/sethmlarson/events{/privacy}", "followers_url": "https://api.github.com/users/sethmlarson/followers", "following_url": "https://api.github.com/users/sethmlarson/following{/other_user}", "gists_url": "https://api.github.com/users/sethmlarson/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/sethmlarson", "id": 18519037, "login": "sethmlarson", "node_id": "MDQ6VXNlcjE4NTE5MDM3", "organizations_url": "https://api.github.com/users/sethmlarson/orgs", "received_events_url": "https://api.github.com/users/sethmlarson/received_events", "repos_url": "https://api.github.com/users/sethmlarson/repos", "site_admin": false, "starred_url": "https://api.github.com/users/sethmlarson/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/sethmlarson/subscriptions", "type": "User", "url": "https://api.github.com/users/sethmlarson", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/2228/reactions" }
https://api.github.com/repos/psf/requests/issues/2228/timeline
null
completed
null
null
false
[ "Thanks for the suggestion! However, I disagree.\n\nIn many cases, users find it valuable to add a timeout to their calls. This is entirely reasonable. However, the quickstart code is not an example of 'general use', it's intended to be illustrative and educational. We should not obscure the pedagogical point in the pursuit of some form of pure correctness.\n\nThere is a [timeout section](http://docs.python-requests.org/en/latest/user/quickstart/#timeouts) in the quickstart docs, which we believe to be sufficient. Do you disagree?\n\nAs for mentioning the default socket timeout, I hadn't spotted that. That may actually be a bug. @sigmavirus24, what do you think: should we use the default socket timeout when no value is provided? If so, how do users specify they want no timeout at all? Am I overthinking the whole thing?\n", "@Lukasa I'm surprised that we don't use the default socket timeout. I'm more surprised that the \"default\" timeout is not automatically applied to a socket. That said, I don't think there's a good (or easy way) to handle adding this at this juncture. We could consider it for 3.0 but if we truly have no timeout set on sockets by default (which I'm prepared to believe), then we can't change it easily and it _should_ be documented for now.\n\nThe thing we should determine is whether we want that behaviour at all. The sad thing is that more often than not, not being able to put a timeout on `socket.getaddrinfo` has affected me more than a connection not timing out appropriately. \n", "I disagree that it is sufficient as timeouts are only mentioned at the\nvery bottom of the page. Users often base their solutions off of examples\nand don't read all the documentation, only what they need to get a result.\n While examples should be brief, they should not lead a user to writing\ncode that has a pretty strong potential to lock up.\n\nThe default socket timeout is used by urllib2 when a timeout is not\nspecified. This further compounds the above problem for people moving from\nthat library. To have no timeout specified I can see either None or 0\nbeing passed as the timeout value. Explicit is better than implicit.\n\nOn Tue, Sep 16, 2014 at 9:26 AM, Cory Benfield [email protected]\nwrote:\n\n> Thanks for the suggestion! However, I disagree.\n> \n> In many cases, users find it valuable to add a timeout to their calls.\n> This is entirely reasonable. However, the quickstart code is not an example\n> of 'general use', it's intended to be illustrative and educational. We\n> should not obscure the pedagogical point in the pursuit of some form of\n> pure correctness.\n> \n> There is a timeout section\n> http://docs.python-requests.org/en/latest/user/quickstart/#timeouts in\n> the quickstart docs, which we believe to be sufficient. Do you disagree?\n> \n> As for mentioning the default socket timeout, I hadn't spotted that. That\n> may actually be a bug. @sigmavirus24 https://github.com/sigmavirus24,\n> what do you think: should we use the default socket timeout when no value\n> is provided? If so, how do users specify they want no timeout at all? Am I\n> overthinking the whole thing?\n> \n> —\n> Reply to this email directly or view it on GitHub\n> https://github.com/kennethreitz/requests/issues/2228#issuecomment-55760567\n> .\n", "> @Lukasa I'm surprised that we don't use the default socket timeout. I'm more surprised that the \"default\" timeout is not automatically applied to a socket.\n\nOrdinarily it would be: this is a consequence of the way our library interacts with urllib3. We build a Timeout object with `None, None` as its values and send that down to urllib3. This looks for a sentinel object: if it finds it it'll set the timeout to the default. We aren't sending that sentinel object, we're sending `None, None`, which sets the socket timeout to `None`, which means it never times out. A bit sad really.\n\n> Users often base their solutions off of examples and don't read all the documentation, only what they need to get a result.\n\nYes, they do. However, this is not a justification for all examples being bulletproof. Our examples don't catch all exceptions, they don't list all possible failure cases, and they don't explain some of the ins-and-outs of weirder parts of the library. I'd argue they shouldn't. That overwhelms beginners by giving them far too many things to focus on at once, which prevents them from taking away the key lesson.\n\nOur position is that documentation should not be optimised for copy-and-paste coding sessions. You can see this by the fact that our quickstart code examples usually aren't code blocks, but representations of an interactive session. They are intended as a guide, not an example of how to build a production-ready requests application.\n\nThe correct way to handle this is not to litter our code examples with irrelevant noise to avoid a footgun in production code, but to remove the footgun entirely. Users should not be subject to the TCP timeout (often very long) in the _default_ case, they should be subject to something vaguely reasonable (in this case the default socket timeout).\n\nNote also that the timeouts are not a panacea. The timeouts apply to each connection event, but if `getaddrinfo` returns many many IP addresses it can take a _very_ long time to time them all out. This is not a _hang_, but it's frequently very close to one (and indeed we've seen it reported that way in the past).\n\n> Explicit is better than implicit.\n\nThis is a point that is extremely unclear with the Python community. Let me show you something that is unarguably explicit:\n\n``` python\nimport urllib2\nauth_handler = urllib2.HTTPBasicAuthHandler()\nauth_handler.add_password(realm='PDQ Application',\n uri='https://mahler:8092/site-updates.py',\n user='klem',\n passwd='kadidd!ehopper')\nopener = urllib2.build_opener(auth_handler)\nurllib2.install_opener(opener)\nurllib2.urlopen('http://www.example.com/login.html')\n```\n\n_Nothing_ happens automatically here, everything is stated explicitly. Realm, the URL to apply to, everything. Here's what we do:\n\n``` python\nimport requests\nr = requests.get('http://www.example.com/login.html', auth=('klem', 'kadidd!ehopper')\n```\n\nThere is so much that is implicit here. The auth type is implicit (Basic), the realm it applies to is not specified (because _no-one cares_, the realm is basically irrelevant on Basic auth), the URL it applies to is inferred by the library (anything on `http://www.example.com/`). But here's the thing: people love our way, and hate urllib2's way.\n\nThe Zen of Python is great, but every line of it needs to be followed by asterisks for qualification. It is not the dogma of Python. You cannot wave it at a solution you do not like to force compliance. And for every clause in it that supports your point, I can find plenty that don't:\n\n> Beautiful is better than ugly.\n> Simple is better than complex.\n> Readability counts.\n\nWe have timeouts, and we mention them in their own section in the quickstart guide. Users who care will find it. And if they don't find it, they clearly don't care about errors at all because the \"Errors and Exceptions\" section is _below_ the timeouts section!\n\nOur documentation cannot accommodate all cases, so we optimise. The quickstart guide is just that: a quickstart guide. We cannot prevent users doing something else with it, but that shouldn't change what _we_ do with it.\n\n**tl;dr**: I think the documentation isn't the problem, the default behaviour is the problem.\n", "@Lukasa hit every point on the head. Moving forward we can repurpose this issue to discuss setting the default socket timeout _or_ we can close this and open a new issue to discuss that.\n", "On Tue, Sep 16, 2014 at 11:26 AM, Cory Benfield [email protected]\nwrote:\n\n> @Lukasa https://github.com/Lukasa I'm surprised that we don't use the\n> default socket timeout. I'm more surprised that the \"default\" timeout is\n> not automatically applied to a socket.\n> \n> Ordinarily it would be: this is a consequence of the way our library\n> interacts with urllib3. We build a Timeout object with None, None as its\n> values and send that down to urllib3. This looks for a sentinel object: if\n> it finds it it'll set the timeout to the default. We aren't sending that\n> sentinel object, we're sending None, None, which sets the socket timeout\n> to None, which means it never times out. A bit sad really.\n> \n> Users often base their solutions off of examples and don't read all the\n> documentation, only what they need to get a result.\n> \n> Yes, they do. However, this is not a justification for all examples being\n> bulletproof. Our examples don't catch all exceptions, they don't list all\n> possible failure cases, and they don't explain some of the ins-and-outs of\n> weirder parts of the library. I'd argue they shouldn't. That overwhelms\n> beginners by giving them far too many things to focus on at once, which\n> prevents them from taking away the key lesson.\n> \n> Our position is that documentation should not be optimised for\n> copy-and-paste coding sessions. You can see this by the fact that our\n> quickstart code examples usually aren't code blocks, but representations of\n> an interactive session. They are intended as a guide, not an example of how\n> to build a production-ready requests application.\n> \n> The correct way to handle this is not to litter our code examples with\n> irrelevant noise to avoid a footgun in production code, but to remove the\n> footgun entirely. Users should not be subject to the TCP timeout (often\n> very long) in the _default_ case, they should be subject to something\n> vaguely reasonable (in this case the default socket timeout).\n> \n> I completely agree with this, my suggestion was only for if you decided to\n> leave the \"footgun\" in place. I would not consider adding the one\n> parameter, littering the code with irrelevant noise, but this maybe a\n> matter of taste as to where to draw the line and can appreciate your point\n> of view.\n> \n> Note also that the timeouts are not a panacea. The timeouts apply to each\n> connection event, but if getaddrinfo returns many many IP addresses it\n> can take a _very_ long time to time them all out. This is not a _hang_,\n> but it's frequently very close to one (and indeed we've seen it reported\n> that way in the past).\n> \n> Thanks for bringing that to my attention, and that is an interesting point.\n> \n> Explicit is better than implicit.\n> \n> This is a point that is extremely unclear with the Python community. Let\n> me show you something that is unarguably explicit:\n> \n> Good point. Although I still believe it is better to be explicit when the\n> behavior differs from the expected (using the default socket timeout).\n> \n> import urllib2auth_handler = urllib2.HTTPBasicAuthHandler()auth_handler.add_password(realm='PDQ Application',\n> uri='https://mahler:8092/site-updates.py',\n> user='klem',\n> passwd='kadidd!ehopper')opener = urllib2.build_opener(auth_handler)urllib2.install_opener(opener)urllib2.urlopen('http://www.example.com/login.html')\n> \n> _Nothing_ happens automatically here, everything is stated explicitly.\n> Realm, the URL to apply to, everything. Here's what we do:\n> \n> import requestsr = requests.get('http://www.example.com/login.html', auth=('klem', 'kadidd!ehopper')\n> \n> There is so much that is implicit here. The auth type is implicit (Basic),\n> the realm it applies to is not specified (because _no-one cares_, the\n> realm is basically irrelevant on Basic auth), the URL it applies to is\n> inferred by the library (anything on http://www.example.com/). But here's\n> the thing: people love our way, and hate urllib2's way.\n> \n> The Zen of Python is great, but every line of it needs to be followed by\n> asterisks for qualification. It is not the dogma of Python. You cannot wave\n> it at a solution you do not like to force compliance. And for every clause\n> in it that supports your point, I can find plenty that don't:\n> \n> Beautiful is better than ugly.\n> Simple is better than complex.\n> Readability counts.\n> \n> We have timeouts, and we mention them in their own section in the\n> quickstart guide. Users who care will find it. And if they don't find it,\n> they clearly don't care about errors at all because the \"Errors and\n> Exceptions\" section is _below_ the timeouts section!\n> \n> Our documentation cannot accommodate all cases, so we optimise. The\n> quickstart guide is just that: a quickstart guide. We cannot prevent users\n> doing something else with it, but that shouldn't change what _we_ do with\n> it.\n> \n> _tl;dr_: I think the documentation isn't the problem, the default\n> behaviour is the problem.\n> \n> AGREED! I just didn't know if you would be amenable to the change your\n> proposing and I whole heartily agree with.\n\nThank you one and all for your attention to this matter. It is greatly\nappreciated\n\n> —\n> Reply to this email directly or view it on GitHub\n> https://github.com/kennethreitz/requests/issues/2228#issuecomment-55779615\n> .\n", "Excellent, I think we're all on the same page! Now we just have to work out whether we can make this change before 3.0 or whether it's likely to break too many people's code. @sigmavirus24, you suggested we'd have to wait until 3.0: what makes you say that?\n", "So the current default for `timeout` is already `None`. It's also unclear how long ago we stopped using `socket.getdefaulttimeout()`. I'm not sure `timeout=0` will be clear enough to everyone either that it disables _all_ timeouts. I guess I'm more concerned with changing he API too dramatically. In the short term we can easily re-enable the usage of `socket.getdefaulttimeout`, I just can't think of a good value to indicate \"never set any timeout, default or otherwise\"\n", "I feel like `timeout=0` is probably clear enough.\n\nI think we stopped using it when @kevinburke did his really major timeout work, and we didn't spot that urllib3 uses a sentinel object where we use the `None` pattern. Just some crossed wires.\n", "Hi,\n\nsorry if I'm missing the obvious here, I'm rather new to Python (and to requests as well, of course) and I was thinking of picking this up. I noticed that @Lukasa did some changes in July 2015 after the last comment (https://github.com/kennethreitz/requests/issues/commit/e9a1e35f8989691afe99407d9b65a67684aa8bac). After looking at the code I'm not even sure if I'm getting the point here. Is this one still open? What is the desired behavior?\n", "My (naive) view is that there are three cases:\n\n1) The caller never explicitly sets any timeout. In this case requests should use default values and not tamper with any set timeouts. This is not the case right now as requests sends None, requests do not time out.\n\n2) The caller sets a timeout, requests should pass this on. This happens right now and requests time out.\n\n3) The caller doesn't want any timeout and explicitly tell requests to do so (e. g. timeout=0). This currently causes a problem with urllib3 as it ends with an BlockingIOError: [WinError 10035].\n\nAny change on this will change the behavior of requests and I think that this should be avoided for now. My recommendation is to add a description of the current behavior to master and the API change to proposed.\n\nYour input is appreciated.\n", "> 3) The caller doesn't want any timeout and explicitly tell requests to do so (e. g. timeout=0)\n\n`timeout=0` doesn't mean what you want it to mean. In Python setting a timeout of zero is documented as being the same as switching the socket into nonblocking mode, which Requests and urllib3 do not support. We could override the timeout of 0 to do what you're looking for here, but I think that's rather surprising given that we currently are pretty explicit that we set socket-level timeouts.\n\nI'm not entirely sure I agree with 1), either. While I appreciate the thought behind it, this puts Requests at risk of misbehaving due to weird global state that may have been set _very_ far away from the Requests call indeed.\n\nFrankly, I rather wish that the default socket timeout couldn't be set at all, but that instead it had to be set on a per-socket basis.\n", "I comprehend your concern regarding 1), but I do not see a solution to this unless Requests actively overdrives global states and it it impossible to decide when this is actually desirable, or am I overthinking this?\n\nI was not aware of the meaning of `timeout=0`, I agree that my proposal does not fit in here. I think I will pass this one as it is much more complicated for me right now. I still think that a hint about Requests' current behavior (no explicit option set->no timeout) should be added (\"When no timeout is set explicitly, requests do not time out.\", e. g.).\n", "@Brausepaul I would be delighted to merge a PR that adds a note in the documentation to clarify this.\n\nHopefully in the longer term we'll get rid of httplib and get to a place where we can set timeouts in a substantially more sensible manner than we currently do.\n", "I think this issue needs some revision. We might close this one and open a new one with a proper description of the underlying issue regarding timeouts.\n" ]
https://api.github.com/repos/psf/requests/issues/2227
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/2227/labels{/name}
https://api.github.com/repos/psf/requests/issues/2227/comments
https://api.github.com/repos/psf/requests/issues/2227/events
https://github.com/psf/requests/pull/2227
42,862,246
MDExOlB1bGxSZXF1ZXN0MjEyODY1NDA=
2,227
Added example of how to send multiple files in one request.
{ "avatar_url": "https://avatars.githubusercontent.com/u/142868?v=4", "events_url": "https://api.github.com/users/mjul/events{/privacy}", "followers_url": "https://api.github.com/users/mjul/followers", "following_url": "https://api.github.com/users/mjul/following{/other_user}", "gists_url": "https://api.github.com/users/mjul/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/mjul", "id": 142868, "login": "mjul", "node_id": "MDQ6VXNlcjE0Mjg2OA==", "organizations_url": "https://api.github.com/users/mjul/orgs", "received_events_url": "https://api.github.com/users/mjul/received_events", "repos_url": "https://api.github.com/users/mjul/repos", "site_admin": false, "starred_url": "https://api.github.com/users/mjul/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/mjul/subscriptions", "type": "User", "url": "https://api.github.com/users/mjul", "user_view_type": "public" }
[]
closed
true
null
[]
null
3
2014-09-16T09:39:48Z
2021-09-08T10:01:17Z
2014-09-18T01:06:54Z
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/2227/reactions" }
https://api.github.com/repos/psf/requests/issues/2227/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/2227.diff", "html_url": "https://github.com/psf/requests/pull/2227", "merged_at": "2014-09-18T01:06:54Z", "patch_url": "https://github.com/psf/requests/pull/2227.patch", "url": "https://api.github.com/repos/psf/requests/pulls/2227" }
true
[ "Thanks for this! I really like it, but I think it's too niche for the QuickStart section. If you move it to the advanced docs I'll happily merge it straight away. :cake:\n", "@Lukasa I'm -0 about the reference in the quickstart guide to the advanced section. How do you feel about it?\n", ":sparkles: :cake: :sparkles:\n" ]
https://api.github.com/repos/psf/requests/issues/2226
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/2226/labels{/name}
https://api.github.com/repos/psf/requests/issues/2226/comments
https://api.github.com/repos/psf/requests/issues/2226/events
https://github.com/psf/requests/issues/2226
42,846,571
MDU6SXNzdWU0Mjg0NjU3MQ==
2,226
Can't get ETag for some resource
{ "avatar_url": "https://avatars.githubusercontent.com/u/1519701?v=4", "events_url": "https://api.github.com/users/guhehehe/events{/privacy}", "followers_url": "https://api.github.com/users/guhehehe/followers", "following_url": "https://api.github.com/users/guhehehe/following{/other_user}", "gists_url": "https://api.github.com/users/guhehehe/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/guhehehe", "id": 1519701, "login": "guhehehe", "node_id": "MDQ6VXNlcjE1MTk3MDE=", "organizations_url": "https://api.github.com/users/guhehehe/orgs", "received_events_url": "https://api.github.com/users/guhehehe/received_events", "repos_url": "https://api.github.com/users/guhehehe/repos", "site_admin": false, "starred_url": "https://api.github.com/users/guhehehe/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/guhehehe/subscriptions", "type": "User", "url": "https://api.github.com/users/guhehehe", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2014-09-16T05:48:38Z
2021-09-08T23:08:07Z
2014-09-16T06:07:29Z
NONE
resolved
I am trying to send get requests to this url: http://data.sfgov.org/resource/rqzj-sfat.json, which will return a etag in the response header, but I just couldn't get it using requests' get method. This is what I did: ``` >>> r = requests.get('http://data.sfgov.org/resource/rqzj-sfat.json') >>> print r.headers.get('etag') >>> None ``` Every other fields are in the response header, except for 'etag'. Not sure if it's a bug or I missed something.
{ "avatar_url": "https://avatars.githubusercontent.com/u/1519701?v=4", "events_url": "https://api.github.com/users/guhehehe/events{/privacy}", "followers_url": "https://api.github.com/users/guhehehe/followers", "following_url": "https://api.github.com/users/guhehehe/following{/other_user}", "gists_url": "https://api.github.com/users/guhehehe/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/guhehehe", "id": 1519701, "login": "guhehehe", "node_id": "MDQ6VXNlcjE1MTk3MDE=", "organizations_url": "https://api.github.com/users/guhehehe/orgs", "received_events_url": "https://api.github.com/users/guhehehe/received_events", "repos_url": "https://api.github.com/users/guhehehe/repos", "site_admin": false, "starred_url": "https://api.github.com/users/guhehehe/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/guhehehe/subscriptions", "type": "User", "url": "https://api.github.com/users/guhehehe", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/2226/reactions" }
https://api.github.com/repos/psf/requests/issues/2226/timeline
null
completed
null
null
false
[ "Just dug a little bit into the requests' source code, and found requests will set a default header if no header is specified. It's the `Accept-Encoding` header somehow make the server stop sending `ETag`, so closing.\n" ]
https://api.github.com/repos/psf/requests/issues/2225
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/2225/labels{/name}
https://api.github.com/repos/psf/requests/issues/2225/comments
https://api.github.com/repos/psf/requests/issues/2225/events
https://github.com/psf/requests/issues/2225
42,764,925
MDU6SXNzdWU0Mjc2NDkyNQ==
2,225
Send delete with data
{ "avatar_url": "https://avatars.githubusercontent.com/u/3798140?v=4", "events_url": "https://api.github.com/users/temi4/events{/privacy}", "followers_url": "https://api.github.com/users/temi4/followers", "following_url": "https://api.github.com/users/temi4/following{/other_user}", "gists_url": "https://api.github.com/users/temi4/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/temi4", "id": 3798140, "login": "temi4", "node_id": "MDQ6VXNlcjM3OTgxNDA=", "organizations_url": "https://api.github.com/users/temi4/orgs", "received_events_url": "https://api.github.com/users/temi4/received_events", "repos_url": "https://api.github.com/users/temi4/repos", "site_admin": false, "starred_url": "https://api.github.com/users/temi4/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/temi4/subscriptions", "type": "User", "url": "https://api.github.com/users/temi4", "user_view_type": "public" }
[]
closed
true
null
[]
null
3
2014-09-15T12:00:25Z
2021-09-08T23:08:07Z
2014-09-15T19:07:26Z
NONE
resolved
Hello. How I may send delete request with data? This string don't work to send data: session.request('delete', url, data=data)
{ "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/2225/reactions" }
https://api.github.com/repos/psf/requests/issues/2225/timeline
null
completed
null
null
false
[ "@temi4 the following works for me:\n\n``` python\nimport requests\n\ns = requests.Session()\nr = s.delete('https://httpbin.org/delete', data={'foo': 'bar'})\nassert {'foo': 'bar'} == r.json()['form']\nr2 = s.request('DELETE', 'https://httpbin.org/delete', data={'fiz': 'buz'})\nassert {'fiz': 'buz'} == r.json()['form']\n```\n\nCould you describe how that is failing to work? Could you maybe show more code than what you have already shown? Is the URL one that you can share?\n", "@sigmavirus24, thanks\nI send this \n\n``` python\ndata = { 'Reason': u'123' }\nrequest = self.session.request('delete', self.url + '/goodhits/clients/'+client_id+'?token='+token, data=data)\n```\n\nat answer I get\n\n```\nERROR_PARAMETER_REASON_CAN_NOT_BE_EMPTY\n```\n\nhow I may look send or not data at request? \n\nThen I print header\n\n```\nprint(request.request.headers)\n```\n\nI look this\nhttp://c2n.me/iUQk1B\n", "Okay, so we agree that this is not a bug in how requests handles `DELETE` requests. In that case this belongs on [StackOverflow](https://stackoverflow.com/questions/tagged/python-requests) with as much data as you can provide, e.g., \n- how your server app is handling these requests\n- What happens when you do:\n\n``` python\nimport requests\nr = requests.delete(url, data={'Reason': '123'})\nprint(r.request.body)\n```\n\nFrankly this seems to be an issue with the server you're running. Perhaps it isn't looking for `Reason` but instead is expecting `reason` or `REASON`, but that is entirely opaque without more information. Even so that's not something for `requests` to solve, that's something you should figure out, potentially with the help of StackOverflow.\n" ]
https://api.github.com/repos/psf/requests/issues/2224
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/2224/labels{/name}
https://api.github.com/repos/psf/requests/issues/2224/comments
https://api.github.com/repos/psf/requests/issues/2224/events
https://github.com/psf/requests/pull/2224
42,640,115
MDExOlB1bGxSZXF1ZXN0MjExNTk1MDI=
2,224
Fix errors reported by frosted in tests
{ "avatar_url": "https://avatars.githubusercontent.com/u/9766?v=4", "events_url": "https://api.github.com/users/blueyed/events{/privacy}", "followers_url": "https://api.github.com/users/blueyed/followers", "following_url": "https://api.github.com/users/blueyed/following{/other_user}", "gists_url": "https://api.github.com/users/blueyed/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/blueyed", "id": 9766, "login": "blueyed", "node_id": "MDQ6VXNlcjk3NjY=", "organizations_url": "https://api.github.com/users/blueyed/orgs", "received_events_url": "https://api.github.com/users/blueyed/received_events", "repos_url": "https://api.github.com/users/blueyed/repos", "site_admin": false, "starred_url": "https://api.github.com/users/blueyed/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/blueyed/subscriptions", "type": "User", "url": "https://api.github.com/users/blueyed", "user_view_type": "public" }
[]
closed
true
null
[]
null
3
2014-09-12T15:22:27Z
2021-09-08T10:01:18Z
2014-09-12T15:47:27Z
CONTRIBUTOR
resolved
{ "avatar_url": "https://avatars.githubusercontent.com/u/240830?v=4", "events_url": "https://api.github.com/users/sigmavirus24/events{/privacy}", "followers_url": "https://api.github.com/users/sigmavirus24/followers", "following_url": "https://api.github.com/users/sigmavirus24/following{/other_user}", "gists_url": "https://api.github.com/users/sigmavirus24/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/sigmavirus24", "id": 240830, "login": "sigmavirus24", "node_id": "MDQ6VXNlcjI0MDgzMA==", "organizations_url": "https://api.github.com/users/sigmavirus24/orgs", "received_events_url": "https://api.github.com/users/sigmavirus24/received_events", "repos_url": "https://api.github.com/users/sigmavirus24/repos", "site_admin": false, "starred_url": "https://api.github.com/users/sigmavirus24/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/sigmavirus24/subscriptions", "type": "User", "url": "https://api.github.com/users/sigmavirus24", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/2224/reactions" }
https://api.github.com/repos/psf/requests/issues/2224/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/2224.diff", "html_url": "https://github.com/psf/requests/pull/2224", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/2224.patch", "url": "https://api.github.com/repos/psf/requests/pulls/2224" }
true
[ "@blueyed thanks but we do not follow `pep8` in requests. \n", "@sigmavirus24 \nIt's not about pep8, but comes from frosted (and maybe other type (not style) checkers).\n", "Oh right, frosted is the fork of pyflakes. Regardless, these changes are far from critical and are entirely unnecessary. `io` is not a builtin (it is a module) and shadowing it in a local variable is not harmful because the meaning is not being misconstrued. Also both the `url` and `f` are being used. Why they require `# noqa` comments on the same line is baffling. Pyflakes handles these just fine and I'm sure Pylint would as well.\n" ]
https://api.github.com/repos/psf/requests/issues/2223
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/2223/labels{/name}
https://api.github.com/repos/psf/requests/issues/2223/comments
https://api.github.com/repos/psf/requests/issues/2223/events
https://github.com/psf/requests/pull/2223
42,639,279
MDExOlB1bGxSZXF1ZXN0MjExNTg5Nzk=
2,223
Document skipping in PreparedRequest; followup to #2222
{ "avatar_url": "https://avatars.githubusercontent.com/u/9766?v=4", "events_url": "https://api.github.com/users/blueyed/events{/privacy}", "followers_url": "https://api.github.com/users/blueyed/followers", "following_url": "https://api.github.com/users/blueyed/following{/other_user}", "gists_url": "https://api.github.com/users/blueyed/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/blueyed", "id": 9766, "login": "blueyed", "node_id": "MDQ6VXNlcjk3NjY=", "organizations_url": "https://api.github.com/users/blueyed/orgs", "received_events_url": "https://api.github.com/users/blueyed/received_events", "repos_url": "https://api.github.com/users/blueyed/repos", "site_admin": false, "starred_url": "https://api.github.com/users/blueyed/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/blueyed/subscriptions", "type": "User", "url": "https://api.github.com/users/blueyed", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2014-09-12T15:14:15Z
2021-09-08T10:01:18Z
2014-09-12T16:54:40Z
CONTRIBUTOR
resolved
I've meant to add this to #2222, which has been merged already.
{ "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/2223/reactions" }
https://api.github.com/repos/psf/requests/issues/2223/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/2223.diff", "html_url": "https://github.com/psf/requests/pull/2223", "merged_at": "2014-09-12T16:54:40Z", "patch_url": "https://github.com/psf/requests/pull/2223.patch", "url": "https://api.github.com/repos/psf/requests/pulls/2223" }
true
[ "Look good to me. I'll just make sure Jenkins is happy with it and them I'll merge it. Thanks @blueyed \n", "Closed & re-opened to trigger a new build. HTTPBin is acting flakey again.\n" ]
https://api.github.com/repos/psf/requests/issues/2222
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/2222/labels{/name}
https://api.github.com/repos/psf/requests/issues/2222/comments
https://api.github.com/repos/psf/requests/issues/2222/events
https://github.com/psf/requests/pull/2222
42,587,804
MDExOlB1bGxSZXF1ZXN0MjExMjgwNjk=
2,222
Add tests to test_invalid_url for `InvalidSchema`
{ "avatar_url": "https://avatars.githubusercontent.com/u/9766?v=4", "events_url": "https://api.github.com/users/blueyed/events{/privacy}", "followers_url": "https://api.github.com/users/blueyed/followers", "following_url": "https://api.github.com/users/blueyed/following{/other_user}", "gists_url": "https://api.github.com/users/blueyed/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/blueyed", "id": 9766, "login": "blueyed", "node_id": "MDQ6VXNlcjk3NjY=", "organizations_url": "https://api.github.com/users/blueyed/orgs", "received_events_url": "https://api.github.com/users/blueyed/received_events", "repos_url": "https://api.github.com/users/blueyed/repos", "site_admin": false, "starred_url": "https://api.github.com/users/blueyed/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/blueyed/subscriptions", "type": "User", "url": "https://api.github.com/users/blueyed", "user_view_type": "public" }
[]
closed
true
null
[]
null
13
2014-09-12T01:15:37Z
2021-09-08T10:01:17Z
2014-09-12T14:16:11Z
CONTRIBUTOR
resolved
In b149be5d `PreparedRequest` was made to skip `parse_url` for e.g. `$HOST:$PORT`, which results in `MissingSchema` not being raised for `localhost:3128`.
{ "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/2222/reactions" }
https://api.github.com/repos/psf/requests/issues/2222/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/2222.diff", "html_url": "https://github.com/psf/requests/pull/2222", "merged_at": "2014-09-12T14:16:11Z", "patch_url": "https://github.com/psf/requests/pull/2222.patch", "url": "https://api.github.com/repos/psf/requests/pulls/2222" }
true
[ "I have created https://github.com/shazow/urllib3/issues/466 to possibly handle the \"oddball schemes\" in urllib3 directly.\n\nEDIT: not their job.\n", "@jvantuyl\nCan you remember and elaborate on why you've made this change (https://github.com/kennethreitz/requests/commit/b149be5d864cc7f65ac22113db3d0e4d2ed2b49e)?\n", "@blueyed I elaborated on this change in the issue you opened on shazow/urllib3. This allows for third-party developers to create adapters using the `file` protocol and has the side-effect of allowing `data` URLs as well even though requests will not handle them.\n", "Basically, it makes requests extensible with other protocols. It doesn't _add_ support, but it makes it at least possible. Two implementations (which I haven't tested in ages):\n\n[file protocol](/jvantuyl/requests-file)\n[data protocol](/jvantuyl/requests-data)\n\nI originally used them for testing and ad-hoc usage of some CLI tools I built for deployment.\n", "Also I'm fairly certain it allowed @asmeurer to use the file protocol in conda/conda.\n", "And, syntactically, \"localhost:8000\" does parse as a URL. It just uses the unknown scheme localhost. Interestingly, that's _exactly_ the error you're getting (although as an AssertionError, which is probably bad form). Perhaps you could replace that assertion with a different error (say UnrecognizedScheme), check for it, then implement the fallback behavior?\n", "I see.\n\nSo it's probably expected and sane to get a `InvalidSchema: No connection adapters were found for 'localhost:5432'` exception instead of `MissingSchema: Invalid URL 'localhost:5432': No schema supplied. Perhaps you meant http://localhost?` then.\n\nI've thought about adding a regex that would let it fall through, but it doesn't change much in the end.\n\nThe expected outcome should get added as test however.\n\n@jvantuyl \n\n> the error you're getting (although as an AssertionError, which is probably bad form). Perhaps you could replace that assertion with a different error (say UnrecognizedScheme), check for it, then implement the fallback behavior?\n\nI do not understand this. It appears to be a proper exception already (`InvalidSchema`).\nWhere do you mean to add the check and fallback?\n\nI came to this issue through pip and the handling of its proxy setting initially (IIRC, and unrelated).\n", "You are correct. I was just responding to the raising of AssertionError with a made-up error. I forgot that such an exception existed. Looks like that's been noted as #2222.\n", "conda uses https://github.com/conda/conda/blob/e082781cad83e0bc6a41a2870b605f4ee08bbd4d/conda/connection.py#L74-L120. I think I took it from pip. \n", "My problems centered around urllib.util.url.parse_url doing some interesting splitting when certain characters were involved and then further mangling inside of requests.models.prepare_url. If you have the wrong characters in your URL, interesting things can happen (and all of them are pretty clearly incorrect). I suspect that those same issues wouldn't be any better for anybody else if someone has exciting and interesting file paths. :/\n", "I've changed the PR to add more tests, which document/test the current behavior.\n", "Suits me. :cake:\n", "We haven't come across that issue in conda, but assumedly the fix is to first `urllib.parse.quote` the parts of the path. \n" ]
https://api.github.com/repos/psf/requests/issues/2221
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/2221/labels{/name}
https://api.github.com/repos/psf/requests/issues/2221/comments
https://api.github.com/repos/psf/requests/issues/2221/events
https://github.com/psf/requests/pull/2221
42,581,330
MDExOlB1bGxSZXF1ZXN0MjExMjQwODI=
2,221
Fix `prepend_scheme_if_needed` for $HOST:$PORT
{ "avatar_url": "https://avatars.githubusercontent.com/u/9766?v=4", "events_url": "https://api.github.com/users/blueyed/events{/privacy}", "followers_url": "https://api.github.com/users/blueyed/followers", "following_url": "https://api.github.com/users/blueyed/following{/other_user}", "gists_url": "https://api.github.com/users/blueyed/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/blueyed", "id": 9766, "login": "blueyed", "node_id": "MDQ6VXNlcjk3NjY=", "organizations_url": "https://api.github.com/users/blueyed/orgs", "received_events_url": "https://api.github.com/users/blueyed/received_events", "repos_url": "https://api.github.com/users/blueyed/repos", "site_admin": false, "starred_url": "https://api.github.com/users/blueyed/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/blueyed/subscriptions", "type": "User", "url": "https://api.github.com/users/blueyed", "user_view_type": "public" }
[]
closed
true
null
[]
null
5
2014-09-11T23:13:48Z
2021-09-08T10:01:14Z
2014-09-12T06:19:58Z
CONTRIBUTOR
resolved
`prepend_scheme_if_needed` is used for the proxy, but failed to do so properly for `host:port`. This PR addresses the first occasion in the docs I've stumbled upon, fixes the implementation and adds tests. (This is derived from https://github.com/kennethreitz/requests/pull/2219.) If this seems OK, the documentation at https://github.com/kennethreitz/requests/blame/master/docs/api.rst#L238-249 needs to get removed/addressed also.
{ "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/2221/reactions" }
https://api.github.com/repos/psf/requests/issues/2221/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/2221.diff", "html_url": "https://github.com/psf/requests/pull/2221", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/2221.patch", "url": "https://api.github.com/repos/psf/requests/pulls/2221" }
true
[ "So here's the thing, I can't think of any proxies that require a path or for which `hostname:port/` is normal practice. Everything about how we operate currently is perfectly fine for the 90% use case and we've had this support for over a year without a complaint. `urlparse` is far from perfect, I agree. Your documentation fix is also a good one. I am, however, against the change you've made to `prepend_scheme_if_needed`. It's entirely unnecessary. What we had previously is a very robust solution which also handles `//localhost:80` and other _valid_ variants on a URI. This would have us give up that solution for something that (in this case) produces `http:////localhost:80`. This would cause issues for a user as well.\n", "My objection to this functional change is simpler than @sigmavirus24's. URLs are not strings, and treating them like strings is how mistakes get made. I think the correct approach would be to try to use `urllib3`'s URL utilities for this.\n", "Thanks for your feedback.\n\n@Lukasa \nI've initially used urllib3's `Url` (https://github.com/blueyed/requests/commit/1bcc46e50661a68e08723571ac42d8069d2b4063 - was amended), but then noticed that I would have to handle `auth` explicitly, in the same way it gets done in PrepareRequest (IIRC), and \"simplified\" it.\n\nIf urllib3 had a method to \"urlunparse\" (proposed in https://github.com/shazow/urllib3/pull/394), this could be used here. But then it seems that urllib3 would also fail for `//localhost:80`, because my simplification was inspired by its scheme detection: https://github.com/shazow/urllib3/blob/master/urllib3/util/url.py#L111-L113:\n\n```\nutil.Url(\"//localhost:80\")\nUrl(scheme='//localhost:80', auth=None, host=None, port=None, path=None, query=None, fragment=None)\n```\n\nFor now, I propose to only change the documentation to state that the default scheme is \"http\".\nWhat about the documentation at https://github.com/kennethreitz/requests/blame/master/docs/api.rst#L238-249 ?\n\nAs for the approach to simplify it, it could get expanded to also check for `//` at the beginning of url.\n\nGiven that the function is meant to only prepend a scheme, it should be enough to detect if a scheme exists already, and that does not require to parse all of the url in the end.\n\nSide note: about the validity/usefulness of `//localhost`: would/could this be interpreted to be `https://localhost` for `https_proxy` and `http://localhost` for `http_proxy`? (relative to the protocol that is being accessed).\n([RFC](http://tools.ietf.org/html/rfc3986#page-26)).\n", "Let's do some blue-sky thinking for a moment.\n\nIs it possible for us to build a truly correct URL praser/unparser that assumes HTTP? I believe that it is, and I think we should do that first, and then switch to using it consistently throughout requests.\n", "@Lukasa if you build a good parser for RFC 3986 then it will. [rfc3986](/sigmavirus24/rfc3986) for example parses the examples here with ease:\n\n``` pycon\n>>> from rfc3986 import uri_reference\n>>> uri_reference('//localhost:3182')\nURIReference(scheme=None, authority=u'localhost:3182', path=None, query=None, fragment=None)\n>>> uri_reference('//localhost:3182/')\nURIReference(scheme=None, authority=u'localhost:3182', path=u'/', query=None, fragment=None)\n>>> uri_reference('//localhost.localdomain:3182/')\nURIReference(scheme=None, authority=u'localhost.localdomain:3182', path=u'/', query=None, fragment=None)\n```\n\nThe only hiccup is that RFC 3986 does not define every URI to have the structure `scheme://authority{/path}{?query}{#fragment}`. A valid URI, for example is: `mailto:[email protected]:port` and in this case `mailto` is the scheme, so the following happens:\n\n``` pycon\n>>> uri_reference('localhost.localdomain:3182')\nURIReference(scheme=u'localhost.localdomain', authority=None, path=u'3182', query=None, fragment=None)\n```\n\nSadly this isn't a bug and attempting to special case it will lead only to trouble in all likelihood.\n" ]
https://api.github.com/repos/psf/requests/issues/2220
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/2220/labels{/name}
https://api.github.com/repos/psf/requests/issues/2220/comments
https://api.github.com/repos/psf/requests/issues/2220/events
https://github.com/psf/requests/issues/2220
42,577,693
MDU6SXNzdWU0MjU3NzY5Mw==
2,220
Force specific proxy/proxies / skip looking at the environment
{ "avatar_url": "https://avatars.githubusercontent.com/u/9766?v=4", "events_url": "https://api.github.com/users/blueyed/events{/privacy}", "followers_url": "https://api.github.com/users/blueyed/followers", "following_url": "https://api.github.com/users/blueyed/following{/other_user}", "gists_url": "https://api.github.com/users/blueyed/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/blueyed", "id": 9766, "login": "blueyed", "node_id": "MDQ6VXNlcjk3NjY=", "organizations_url": "https://api.github.com/users/blueyed/orgs", "received_events_url": "https://api.github.com/users/blueyed/received_events", "repos_url": "https://api.github.com/users/blueyed/repos", "site_admin": false, "starred_url": "https://api.github.com/users/blueyed/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/blueyed/subscriptions", "type": "User", "url": "https://api.github.com/users/blueyed", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2014-09-11T22:21:14Z
2021-09-08T23:08:09Z
2014-09-12T06:17:01Z
CONTRIBUTOR
resolved
`requests` merges the proxies from the environment unconditionally (https://github.com/kennethreitz/requests/blob/master/requests/sessions.py#L439-443). The use case would be `pip --proxy localhost:3128 install example`, which should make `requests` use the specified proxy always. I could imagine `PipSession` to override `merge_environment_settings` and discard changes from the environment, but there should be cleaner way to indicate that only the explicitly provided proxies should be used. Another idea might be to set `PipSession.trust_env = False`, but that would also affect CA bundles and seems even more dirty. And while pip could unset the environment variables (in case a proxy is provided via its options), this requires to know the implementation details about looking them up. I would have assumed that `requests` take proxy information from the environment only if no proxies are provided through the API.
{ "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/2220/reactions" }
https://api.github.com/repos/psf/requests/issues/2220/timeline
null
completed
null
null
false
[ "> I would have assumed that requests take proxy information from the environment only if no proxies are provided through the API.\n\nThat's exactly what happens. You'll find this works a bit better if you read through to `merge_environment_settings`:\n\n``` python\nif self.trust_env:\n # Set environment's proxies.\n env_proxies = get_environ_proxies(url) or {}\n for (k, v) in env_proxies.items():\n proxies.setdefault(k, v)\n```\n\nThis call to `setdefault` does _not_ override any proxy passed to the functional API (e.g `requests.get(url, proxies=proxies)`. It only provides the value if no previous value was present.\n\nNow, we _do_ override things explicitly set on the `Session` with the environment. That is a bug already tracked under #2018.\n", "Yes, you're right. `pip` uses the `Session`.\n" ]
https://api.github.com/repos/psf/requests/issues/2219
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/2219/labels{/name}
https://api.github.com/repos/psf/requests/issues/2219/comments
https://api.github.com/repos/psf/requests/issues/2219/events
https://github.com/psf/requests/pull/2219
42,575,872
MDExOlB1bGxSZXF1ZXN0MjExMjA1MjQ=
2,219
Fix doc: scheme is not required with proxy URLs
{ "avatar_url": "https://avatars.githubusercontent.com/u/9766?v=4", "events_url": "https://api.github.com/users/blueyed/events{/privacy}", "followers_url": "https://api.github.com/users/blueyed/followers", "following_url": "https://api.github.com/users/blueyed/following{/other_user}", "gists_url": "https://api.github.com/users/blueyed/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/blueyed", "id": 9766, "login": "blueyed", "node_id": "MDQ6VXNlcjk3NjY=", "organizations_url": "https://api.github.com/users/blueyed/orgs", "received_events_url": "https://api.github.com/users/blueyed/received_events", "repos_url": "https://api.github.com/users/blueyed/repos", "site_admin": false, "starred_url": "https://api.github.com/users/blueyed/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/blueyed/subscriptions", "type": "User", "url": "https://api.github.com/users/blueyed", "user_view_type": "public" }
[]
closed
true
null
[]
null
6
2014-09-11T21:58:28Z
2021-09-08T10:01:19Z
2014-09-12T01:55:48Z
CONTRIBUTOR
resolved
`prepend_scheme_if_needed` is used to add `http` if necessary.
{ "avatar_url": "https://avatars.githubusercontent.com/u/9766?v=4", "events_url": "https://api.github.com/users/blueyed/events{/privacy}", "followers_url": "https://api.github.com/users/blueyed/followers", "following_url": "https://api.github.com/users/blueyed/following{/other_user}", "gists_url": "https://api.github.com/users/blueyed/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/blueyed", "id": 9766, "login": "blueyed", "node_id": "MDQ6VXNlcjk3NjY=", "organizations_url": "https://api.github.com/users/blueyed/orgs", "received_events_url": "https://api.github.com/users/blueyed/received_events", "repos_url": "https://api.github.com/users/blueyed/repos", "site_admin": false, "starred_url": "https://api.github.com/users/blueyed/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/blueyed/subscriptions", "type": "User", "url": "https://api.github.com/users/blueyed", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/2219/reactions" }
https://api.github.com/repos/psf/requests/issues/2219/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/2219.diff", "html_url": "https://github.com/psf/requests/pull/2219", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/2219.patch", "url": "https://api.github.com/repos/psf/requests/pulls/2219" }
true
[ "There's also a part in the API migration docs, which would be obsolete then (or needs clarification - see comments below): https://github.com/kennethreitz/requests/blame/master/docs/api.rst#L238-249\n", "I've tested it using the following code:\n\n```\nrequests.get(\"http://example.org\", proxies={'http': 'localhost:3128'})\n```\n\nBut when adding a slash/path it fails:\n\n```\nrequests.get(\"http://example.org\", proxies={'http': 'localhost:3128/'})\n\n\nFile \"…/pip/pip/_vendor/requests/adapters.py\", line 237, in get_connection\n proxy_manager = self.proxy_manager_for(proxy)\nFile \"…/pip/pip/_vendor/requests/adapters.py\", line 147, in proxy_manager_for\n **proxy_kwargs)\nFile \"…/pip/pip/_vendor/requests/packages/urllib3/poolmanager.py\", line 265, in proxy_from_url\n return ProxyManager(proxy_url=url, **kw)\nFile \"…/pip/pip/_vendor/requests/packages/urllib3/poolmanager.py\", line 216, in __init__\n 'Not supported proxy scheme %s' % proxy.scheme\nAssertionError: Not supported proxy scheme localhost\n```\n", "I guess it's only required really, if urlparse (for Python 3.4.1 in this case) might fail:\n\n```\n# in requests/utils.py(640)prepend_scheme_if_needed()\nipdb> url\n'localhost:3128/'\nipdb> urlparse(url)\nParseResult(scheme='localhost', netloc='', path='3128/', params='', query='', fragment='')\n```\n\n`prepend_scheme_if_needed` is not guaranteed to work, and in case of no scheme, an Exception might get thrown for consistency, instead of silently fixing `host:port`, but not `host:port/`.\n\nOTOH the documentation might get changed to only make the scheme a requirement, if a path is also provided, assuming that `prepend_scheme_if_needed` behaves consistent across python versions. There are no tests for it yet.\n", "Interestingly, `$HOST:$PORT` even fails to get handled properly with Python 2.6 (http://ci.kennethreitz.org/job/requests-pr/433/).\n", "It boils down to that `MissingSchema` is supposed to be raised, but that broke for `host:port` type URLs in https://github.com/kennethreitz/requests/commit/b149be5d864cc7f65ac22113db3d0e4d2ed2b49e.\nI've added a PR with failing tests to address/discuss this: https://github.com/kennethreitz/requests/pull/2222.\n", "I've added the commit from this PR also to #2221, which fixes and simplifies `prepend_scheme_if_needed`.\n\nI'm closing this PR in favor of #2221.\n\nThe previous comment is not really related, because it isn't related to the proxy url.\n" ]
https://api.github.com/repos/psf/requests/issues/2218
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/2218/labels{/name}
https://api.github.com/repos/psf/requests/issues/2218/comments
https://api.github.com/repos/psf/requests/issues/2218/events
https://github.com/psf/requests/pull/2218
42,516,983
MDExOlB1bGxSZXF1ZXN0MjEwODMyMjg=
2,218
Use `base_url` session param to construct relative URLs
{ "avatar_url": "https://avatars.githubusercontent.com/u/132355?v=4", "events_url": "https://api.github.com/users/singingwolfboy/events{/privacy}", "followers_url": "https://api.github.com/users/singingwolfboy/followers", "following_url": "https://api.github.com/users/singingwolfboy/following{/other_user}", "gists_url": "https://api.github.com/users/singingwolfboy/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/singingwolfboy", "id": 132355, "login": "singingwolfboy", "node_id": "MDQ6VXNlcjEzMjM1NQ==", "organizations_url": "https://api.github.com/users/singingwolfboy/orgs", "received_events_url": "https://api.github.com/users/singingwolfboy/received_events", "repos_url": "https://api.github.com/users/singingwolfboy/repos", "site_admin": false, "starred_url": "https://api.github.com/users/singingwolfboy/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/singingwolfboy/subscriptions", "type": "User", "url": "https://api.github.com/users/singingwolfboy", "user_view_type": "public" }
[]
closed
true
null
[]
null
4
2014-09-11T12:12:37Z
2021-09-08T10:01:19Z
2014-09-11T12:36:57Z
NONE
resolved
This bundles the [URLObject](https://github.com/zacharyvoase/urlobject) library, and uses it for constructing relative URLs.
{ "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/2218/reactions" }
https://api.github.com/repos/psf/requests/issues/2218/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/2218.diff", "html_url": "https://github.com/psf/requests/pull/2218", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/2218.patch", "url": "https://api.github.com/repos/psf/requests/pulls/2218" }
true
[ ":-1: This is not appropriate for requests. This is perfectly reasonable for an extension, but not for requests core. This is also available in https://github.com/dstufft/slumber\n", "Ah. When I submitted this to https://github.com/requests/requests-oauthlib/pull/147, there was some thought that perhaps this should go in requests core, but apparently not.\n", "Yeah I just found that myself and saw @Lukasa's [comment](https://github.com/requests/requests-oauthlib/pull/147#issuecomment-55255020). That's exactly how we feel and further this already exists elsewhere. Finally, URLObject's (un)license would prohibit us from actually being able to vendor it in this case. I don't believe it's compatible with Apache v2. [rfc3986](/sigmavirus24/rfc3986) would be vendorable but even so, we won't accept this functionality in requests.\n", "Thanks for thinking of us anyway @singingwolfboy and say hi to Ned for me. =D\n" ]
https://api.github.com/repos/psf/requests/issues/2217
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/2217/labels{/name}
https://api.github.com/repos/psf/requests/issues/2217/comments
https://api.github.com/repos/psf/requests/issues/2217/events
https://github.com/psf/requests/issues/2217
42,444,270
MDU6SXNzdWU0MjQ0NDI3MA==
2,217
Bug on upload file, file name with Latin characters: requests version 2.3.2 e 2.4.0
{ "avatar_url": "https://avatars.githubusercontent.com/u/2965643?v=4", "events_url": "https://api.github.com/users/Bleno/events{/privacy}", "followers_url": "https://api.github.com/users/Bleno/followers", "following_url": "https://api.github.com/users/Bleno/following{/other_user}", "gists_url": "https://api.github.com/users/Bleno/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Bleno", "id": 2965643, "login": "Bleno", "node_id": "MDQ6VXNlcjI5NjU2NDM=", "organizations_url": "https://api.github.com/users/Bleno/orgs", "received_events_url": "https://api.github.com/users/Bleno/received_events", "repos_url": "https://api.github.com/users/Bleno/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Bleno/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Bleno/subscriptions", "type": "User", "url": "https://api.github.com/users/Bleno", "user_view_type": "public" }
[]
closed
true
null
[]
null
3
2014-09-10T18:29:33Z
2021-09-08T23:08:09Z
2014-09-10T18:38:28Z
NONE
resolved
Hello friends. I spent a few days trying to upload files using the requests, but had issues with the **version 2.4.0** and python **version 3.2.2.** I have a web application that receives a file via a html form, this application sends the received file to a web service, **but when the file name contains Latin characters**, for example: "ç, ã, á, ú" web service can not receive the file name that is not given a cgi.FieldStorage. After several attempts trying to encode utf-8 which is already the default string sent did not succeed. I managed to solve the problem only when I made a downgrade to version 1.2.3 of requests, so it worked perfectly. Does anyone know what might be happening to most current versions of requests? An important detail: must do everything in memory, then pass the file name and bytes of it. I did the following test and it still fails: ``` python #!/usr/bin/env python # -*- coding: utf-8 -*- """ Test upload file Pyramid-based application namefile = self.post['filename_0'].filename #str input_file = self.post['filename_0'].file #bytes input_file.seek(0) #cursor position 0 binary_content = input_file.read() #read bytes file r = requests.post(url = "http://webservide.net", files = {'file': (filename, content)} ) Response(r.text) """ import requests f = open("Atenção 1ª.txt", "rb") filename = f.name print(filename) content = f.read() #print(content) r = requests.post(url = "http://webservice.net", files = {'file': (filename, content)} ) print(r.text) ``` **This even works with version 1.2.3** with latest versions like 2.3.2 and 2.4.0 code does **not work.** _It will be a bug in the file upload?_
{ "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/2217/reactions" }
https://api.github.com/repos/psf/requests/issues/2217/timeline
null
completed
null
null
false
[ "Hi there, thanks for reporting this issue!\n\nWhen you say it does not work, what exactly to you mean? In what way does this fail?\n", "@Lukasa this is a duplicate of https://github.com/kennethreitz/requests/issues/2117\n", "Good spot! In that case, let's close this. =)\n" ]
https://api.github.com/repos/psf/requests/issues/2216
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/2216/labels{/name}
https://api.github.com/repos/psf/requests/issues/2216/comments
https://api.github.com/repos/psf/requests/issues/2216/events
https://github.com/psf/requests/pull/2216
42,430,638
MDExOlB1bGxSZXF1ZXN0MjEwNDMzMTE=
2,216
Retries logic
{ "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" }
[ { "color": "02e10c", "default": false, "description": null, "id": 76800, "name": "Feature Request", "node_id": "MDU6TGFiZWw3NjgwMA==", "url": "https://api.github.com/repos/psf/requests/labels/Feature%20Request" }, { "color": "e10c02", "default": false, "description": null, "id": 117744, "name": "Bug", "node_id": "MDU6TGFiZWwxMTc3NDQ=", "url": "https://api.github.com/repos/psf/requests/labels/Bug" }, { "color": "fef2c0", "default": false, "description": null, "id": 60669570, "name": "Please Review", "node_id": "MDU6TGFiZWw2MDY2OTU3MA==", "url": "https://api.github.com/repos/psf/requests/labels/Please%20Review" } ]
closed
true
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
[ { "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" } ]
null
30
2014-09-10T16:12:40Z
2021-09-08T09:00:56Z
2014-12-01T19:45:27Z
CONTRIBUTOR
resolved
Currently our documentation tells user that by creating a custom `HTTPAdapter` they can pass `max_retries=n` and that will apply to connection and read retries. This is a lie at the moment (and has been probably since 2.4.0 was released with the new version of urllib3 that added the `Retry` class). In order to preserve backwards compatibility (and have passing tests) I remember upgrading the logic [here](https://github.com/kennethreitz/requests/blob/master/requests/adapters.py#L361) to pass `read=False` because some where we expected a plain `ReadTimeout` exception we were now getting a `MaxRetryError`. This, however, means that we have broken what we promised in the documentation (and what was likely present in even 2.3.0). At the moment we do not support passing a `Retry` instance from `urllib3`. I'd like to propose the following changes: - In `requests.adapters`, `DEFAULT_RETRIES` becomes a sentinel object, e.g., `DEFAULT_RETRIES = object()`. - In `HTTPAdatper.__init__`, we check for the sentinel object and if so set `self.max_retries` to `Retry(0, read=False)`. Otherwise, we do `self.max_retries = Retry.from_int(max_retries)` This should fix preserve the default existing behaviour that specifying `read=False` preserved but also allow users to do one of two things: 1. Import `Retry` from urllib3, construct their own `Retry` instance and then pass it as `max_retries` 2. Specify a number for both connection and read retries. Does this sound like a fair proposal? **Edit** I forgot to mention that @txtsd brought this to our attention in IRC. They get the credit for reporting this. Thank you @txtsd
{ "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/2216/reactions" }
https://api.github.com/repos/psf/requests/issues/2216/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/2216.diff", "html_url": "https://github.com/psf/requests/pull/2216", "merged_at": "2014-12-01T19:45:27Z", "patch_url": "https://github.com/psf/requests/pull/2216.patch", "url": "https://api.github.com/repos/psf/requests/pulls/2216" }
true
[ "If you do `self.max_retries = Retry.from_int(max_retries)` doesn't this mean that you can only pass an integer number of retries?\n", "I realize that using `0` will make it a magic number in this case. Perhaps on the sentinel object we set a `value`, e.g.,\n\n``` python\nDEFAULT_RETRIES = object()\nDEFAULT_RETRIES.value = 0\n\n# snip\n\nclass HTTPAdapter(BaseAdapter):\n def __init__(...):\n if max_retries is DEFAULT_RETRIES:\n self.max_retries = Retry(DEFAULT_RETRIES.value, read=False)\n else:\n self.max_retries = Retry.from_int(max_retries)\n```\n\nThis smells a bit to me because then someone might expect this to have the same behaviour as the else clause:\n\n``` python\nimport requests\n\nrequests.adapters.DEFAULT_RETRIES.value = n\n```\n", "> If you do self.max_retries = Retry.from_int(max_retries) doesn't this mean that you can only pass an integer number of retries?\n\nIf you look at [`Retry.from_int`](https://github.com/shazow/urllib3/blob/master/urllib3/util/retry.py#L145) it accepts an instance of `Retry` as well as `None`.\n", "ah.\n", "Sounds fair.\nEDIT: And thank you :)\n", "@kevinburke always read the source ;)\n", "Using this patch I see this behaviour:\n\n``` pycon\nrequests (retries-take-2) python\nPython 2.7.7 (default, Jun 14 2014, 23:12:13)\n[GCC 4.2.1 Compatible Apple LLVM 5.1 (clang-503.0.40)] on darwin\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\n>>> import requests\n>>> r = requests.get('https://httpbin.org/delay/20', timeout=5)\nTraceback (most recent call last):\n File \"<stdin>\", line 1, in <module>\n File \"requests/api.py\", line 59, in get\n return request('get', url, **kwargs)\n File \"requests/api.py\", line 48, in request\n return session.request(method=method, url=url, **kwargs)\n File \"requests/sessions.py\", line 451, in request\n resp = self.send(prep, **send_kwargs)\n File \"requests/sessions.py\", line 557, in send\n r = adapter.send(request, **kwargs)\n File \"requests/adapters.py\", line 425, in send\n raise ReadTimeout(e, request=request)\nrequests.exceptions.ReadTimeout: HTTPSConnectionPool(host='httpbin.org', port=443): Read timed out. (read timeout=5)\n>>> s = requests.session()\n>>> a = requests.adapters.HTTPAdapter(max_retries=3)\n>>> s.mount('https://', a)\n>>> r = s.get('https://httpbin.org/delay/20', timeout=2)\nTraceback (most recent call last):\n File \"<stdin>\", line 1, in <module>\n File \"requests/sessions.py\", line 463, in get\n return self.request('GET', url, **kwargs)\n File \"requests/sessions.py\", line 451, in request\n resp = self.send(prep, **send_kwargs)\n File \"requests/sessions.py\", line 557, in send\n r = adapter.send(request, **kwargs)\n File \"requests/adapters.py\", line 416, in send\n raise ConnectionError(e, request=request)\nrequests.exceptions.ConnectionError: HTTPSConnectionPool(host='httpbin.org', port=443): Max retries exceeded with url: /delay/20 (Caused by ReadTimeoutError(\"HTTPSConnectionPool(host='httpbin.org', port=443): Read timed out. (read timeout=2)\",))\n```\n\nI'll push this to a branch on sigmavirus24/requests called retries-take-2 if anyone wants to toy with it.\n", "Side note, this also works with custom `Retry` objects:\n\n``` pycon\n>>> from requests.packages.urllib3.util.retry import Retry\n>>> r = Retry(5, read=1)\n>>> import requests\n>>> s = requests.session()\n>>> a = requests.adapters.HTTPAdapter(max_retries=r)\n>>> s.mount('https://', a)\n>>> s.get('https://httpbin.org/delay/20', timeout=2)\nTraceback (most recent call last):\n File \"<stdin>\", line 1, in <module>\n File \"requests/sessions.py\", line 463, in get\n return self.request('GET', url, **kwargs)\n File \"requests/sessions.py\", line 451, in request\n resp = self.send(prep, **send_kwargs)\n File \"requests/sessions.py\", line 557, in send\n r = adapter.send(request, **kwargs)\n File \"requests/adapters.py\", line 416, in send\n raise ConnectionError(e, request=request)\nrequests.exceptions.ConnectionError: HTTPSConnectionPool(host='httpbin.org', port=443): Max retries exceeded with url: /delay/20 (Caused by ReadTimeoutError(\"HTTPSConnectionPool(host='httpbin.org', port=443): Read timed out. (read timeout=2)\",))\n```\n", "I'm happy with this approach. :cake:\n", "Converted this to a PR with the changes on my branch.\n", "prolly need to update the docs about max_retries to document the new type parameter\n", "@kevinburke how does \"If you need to provide granular detail about what to retry and how many times to retry it, import urllib3's `Retry` class and pass that instead.\" sound?\n", "Good! Id maybe pass a link to the object or the urllib3 docs too\n\nOn Wednesday, September 10, 2014, Ian Cordasco [email protected]\nwrote:\n\n> @kevinburke https://github.com/kevinburke how does \"If you need to\n> provide granular detail about what to retry and how many times to retry it,\n> import urllib3's Retry class and pass that instead.\" sound?\n> \n> —\n> Reply to this email directly or view it on GitHub\n> https://github.com/kennethreitz/requests/pull/2216#issuecomment-55174200\n> .\n\n## \n\n## \n\nKevin Burke\nphone: 925.271.7005 | twentymilliseconds.com\n", "Yeah I was thinking of linkifying 'Retry'.\n", "This isn't quite right because now any retry error gets reraised as a ConnectionError. I'm working on a fix.\n", "@kevinburke I would guess that `MaxRetryError` inherits from `ProtocolError` somewhere. While I have no strict opinions about the exception hierarchy in urllib3, this could simply mean that we need to re-order our except clauses in requests.\n", "There's also a small amount of weirdness in the way urllib3 raises MaxRetryErrors that should get resolved before determining the logic in Requests - see https://github.com/shazow/urllib3/pull/464 for more info.\n", "I think the sentinel object is unnecessary. Otherwise, +1\n", "@kennethreitz I removed the sentinel object and added a quick test. @kevinburke also pointed out that it makes sense for this to be able to raise a new exception since people will not run into this if they're not using the new logic.\n", "LGTM!\n\n(_pretends to know how to add a cake emoji_)\n\nOn Friday, October 24, 2014, Ian Cordasco [email protected] wrote:\n\n> @kennethreitz https://github.com/kennethreitz I removed the sentinel\n> object and added a quick test. @kevinburke https://github.com/kevinburke\n> also pointed out that it makes sense for this to be able to raise a new\n> exception since people will not run into this if they're not using the new\n> logic.\n> \n> —\n> Reply to this email directly or view it on GitHub\n> https://github.com/kennethreitz/requests/pull/2216#issuecomment-60470082\n> .\n\n## \n\n## \n\nKevin Burke\nphone: 925.271.7005 | twentymilliseconds.com\n", "+1 I would love this in pip so hard.\n", "Ping @kennethreitz ;)\n", "@kennethreitz I've rebased this.\n", ":shipit: \n", "yolo, as the kids say\n", "why not add a parameter to `requests.api.request` method? like `timeout` parameter.\n", "@dawncold the API is in feature freeze. Please read up on the current status of the project. We're not expanding or adding new parameters nor will we.\n", "@sigmavirus24 Sorry, I have searched some places on documents, but found nothing, can you provide me an URL?\n", "@dawncold searching for \"Feature Freeze\" in the documentation quickly reveals [this section](http://docs.python-requests.org/en/latest/dev/todo/?highlight=freeze#feature-freeze) and searching open and closed issues for (feature freeze) bring up #1165 and #1195.\n", "@sigmavirus24 no need to be smug :)\n" ]
https://api.github.com/repos/psf/requests/issues/2215
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/2215/labels{/name}
https://api.github.com/repos/psf/requests/issues/2215/comments
https://api.github.com/repos/psf/requests/issues/2215/events
https://github.com/psf/requests/issues/2215
42,405,822
MDU6SXNzdWU0MjQwNTgyMg==
2,215
Using st_size on FIFO files or stdin will cause super_len to return 0 as the length
{ "avatar_url": "https://avatars.githubusercontent.com/u/3018448?v=4", "events_url": "https://api.github.com/users/cecton/events{/privacy}", "followers_url": "https://api.github.com/users/cecton/followers", "following_url": "https://api.github.com/users/cecton/following{/other_user}", "gists_url": "https://api.github.com/users/cecton/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/cecton", "id": 3018448, "login": "cecton", "node_id": "MDQ6VXNlcjMwMTg0NDg=", "organizations_url": "https://api.github.com/users/cecton/orgs", "received_events_url": "https://api.github.com/users/cecton/received_events", "repos_url": "https://api.github.com/users/cecton/repos", "site_admin": false, "starred_url": "https://api.github.com/users/cecton/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/cecton/subscriptions", "type": "User", "url": "https://api.github.com/users/cecton", "user_view_type": "public" }
[ { "color": "02e10c", "default": false, "description": null, "id": 76800, "name": "Feature Request", "node_id": "MDU6TGFiZWw3NjgwMA==", "url": "https://api.github.com/repos/psf/requests/labels/Feature%20Request" }, { "color": "0b02e1", "default": false, "description": null, "id": 191274, "name": "Contributor Friendly", "node_id": "MDU6TGFiZWwxOTEyNzQ=", "url": "https://api.github.com/repos/psf/requests/labels/Contributor%20Friendly" } ]
closed
true
null
[]
null
14
2014-09-10T12:10:28Z
2021-09-08T20:01:02Z
2015-12-02T14:35:41Z
NONE
resolved
Hello, ### Use Case I run a process using `subprocess` and give the stdout as data of a POST request. Since it is a file-descriptor, it has a fileno, and `super_len()` "stat" the file descriptor and use the st_size to determine the length. The problem is: if the st_size returned is 0, it is possibly due to other reasons, in this case: the length is not determined (despite st_size is 0). But `requests` send a header specifying a `Content-Length` of 0 whilst it is actually not determined. ### Work Around Wrap the stream in a generator, so the method `fileno()` cannot be accessed anymore. ``` python request.post(url, data=(x for x in p.stdout)) ``` ### Another Use Case ``` [14:05:31] ~ > mkfifo /tmp/a [14:05:35] ~ > stat /tmp/a File: ‘/tmp/a’ Size: 0 Blocks: 0 IO Block: 4096 fifo Device: 1eh/30d Inode: 514910 Links: 1 Access: (0644/prw-r--r--) Uid: ( 1001/ openerp) Gid: ( 100/ users) Access: 2014-09-10 14:05:35.415835558 +0200 Modify: 2014-09-10 14:05:35.415835558 +0200 Change: 2014-09-10 14:05:35.415835558 +0200 Birth: - ``` The size of a named pipe is 0. ### Fix According to `man 2 stat`: > For most files under the /proc directory, stat() does not return the file size in the st_size field; instead the field is returned with the value 0. I guess `super_len()` should return st_size if st_size if bigger than 0, otherwise `None`.
{ "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/2215/reactions" }
https://api.github.com/repos/psf/requests/issues/2215/timeline
null
completed
null
null
false
[ "Thanks for reporting this issue!\n\nThis is an interesting case. Here are my thoughts. First, on the positive side, the effect of this change is that we'd switch to chunked encoding for the upload. This is good, that's clearly the correct behaviour when passed a named pipe.\n\nOn the downside, how should we react to a user passing us a file of zero length to upload? Sending content-length 0 has always been fairly clear. Sending a chunked upload of zero length is a bit weird, but not the end of the world, and it works fine.\n\nIn practice I'm +0.5 on the proposed change. I think we gain more than we lose.\n", "Maybe we should check if the user has specified `Transfer-Encoding` in the header, because, according to the RFC, it conflicts with Content-Length and therefore there is no use to check the file size.\n\nMy code will look like this instead:\n\n``` python\nrequest.post(url, data=p.stdout,\n headers={\n 'Content-Type': \"octet/stream\",\n 'Transfer-Encoding': \"chunked\",\n })\n```\n\n...which makes a lot more sense.\n\n_Note:_ actually I just tested with curl and curl automatically removed the `Content-Length` because I specified `Transfer-Encoding`.\n", "> Maybe we should check if the user has specified Transfer-Encoding in the header, because, according to the RFC, it conflicts with Content-Length and therefore there is no use to check the file size.\n\nExcept we have a policy of _not_ doing that. We will check for the existence of headers specified by the user before trying to set those same headers (e.g., if you specify `'Content-Length': '10'`, we won't set that), but checking values of other headers is not currently acceptable.\n\nThat said, I'm +0 on the proposal of not returning anything that is non-positive from `super_len`. I think restricting it to: do not return non-positive values of `fd.st_size` is better though.\n\nFinally,\n\n> Note: actually I just tested with curl and curl automatically removed the Content-Length because I specified Transfer-Encoding.\n\nI hate reiterating this, but there are many things that cURL does. Most of those things we do not do. The list is pretty long, so this holds little weight in this discussion (in my opinion).\n", "Ok @sigmavirus24 , I didn't know your policy about that but that sounds consistent.\n\n> That said, I'm +0 on the proposal of not returning anything that is non-positive from `super_len`.\n\nI totally agree with you. This is definitely not acceptable, `super_len` has specific behavior depending the object it gets. So testing the non-positive value should be considered _only_ when using st_size of the stat of the fileno.\n\n> Sending a chunked upload of zero length is a bit weird, but not the end of the world, and it works fine.\n\nMaybe that's the best solution after all...\n\n...or not guessing the size of a file descriptor no matter what (and let the user deal with it)? This super power may looks handy but at the end this is not an accurate behavior.\n", "Letting the user deal with it is not the requests way. If you know how big it is, by all means set the size, but we're going to be as helpful as we can be. I guarantee to you that most requests users passing something with a file descriptor are passing a real file: the case of passing a named pipe is certainly not the norm. =)\n\nI'm happy with the proposal of not allowing non-positive values of `fd.st_size`.\n", "Ah, last update...\n\nActually now I have a problem with the server, I've never really tried the POST chunked and now that I'm testing it, it seems it's not implemented in werkzeug's server. I will have to parse the chunked content on my own...\n\nSo maybe I will fallback to the temporary file on the disk (^_^;) what a shame...\n", "=P Chunked upload is frequently extremely poorly supported by servers, which is odd, because it's really not that complicated.\n\nNote that you can force us to do a streamed upload by wrapping the file object in something with size. For example, you can try to use an intermediate file-like object (`BytesIO is tempting`). That only works if you can read all of stdin into memory, of course: if you can't then chunking is really the only way to go.\n", "No there is no way it would enter in memory... Actually they are database dumps and it seems, some of them are huge like 13GB.\n\nBut you're right, it doesn't look complicated to implement. I will think of it if I want to implement it for the server. On werkzeug I can use `request.input_stream` to access the raw body, so it's definitely possible, but I prefer to keep the code clean from very specific handling like this.\n\nBut thank you very much for your help @Lukasa here and on urllib3. (^_^)/\n", "@cecton is there any way that you can determine the size in advance? If so, I may have something you can use without having to implement anything yourself.\n", "@cecton are you okay with me making the name of this bug a bit more clear/descriptive?\n", "Sure!\n\nOn Fri, Sep 12, 2014 at 6:55 PM, Ian Cordasco [email protected]\nwrote:\n\n> @cecton https://github.com/cecton are you okay with me making the name\n> of this bug a bit more clear/descriptive?\n> \n> —\n> Reply to this email directly or view it on GitHub\n> https://github.com/kennethreitz/requests/issues/2215#issuecomment-55431222\n> .\n", "Thanks @cecton \n", "Ok, I think we should fix this. Basically right now the behaviour is a bug, because you get this (using a named pipe that contains a few characters from a separate python file):\n\n```\nPOST /post HTTP/1.1\nHost: http2bin.org\nContent-Length: 0\nUser-Agent: python-requests/2.7.0 CPython/2.7.10 Darwin/15.0.0\nConnection: keep-alive\nAccept: */*\nAccept-Encoding: gzip, deflate\n\nfrom test_pb2.py import *\n```\n\nThat's an invalid request, so this is just a straight up bug.\n", "Given that the fallback for zero-length files is safe (basically an empty chunked body), I think that we're probably ok having that fallback. I'm going to use that as the fix.\n" ]
https://api.github.com/repos/psf/requests/issues/2214
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/2214/labels{/name}
https://api.github.com/repos/psf/requests/issues/2214/comments
https://api.github.com/repos/psf/requests/issues/2214/events
https://github.com/psf/requests/issues/2214
42,318,247
MDU6SXNzdWU0MjMxODI0Nw==
2,214
verify=False and requests.packages.urllib3.disable_warnings()
{ "avatar_url": "https://avatars.githubusercontent.com/u/2525006?v=4", "events_url": "https://api.github.com/users/invisiblethreat/events{/privacy}", "followers_url": "https://api.github.com/users/invisiblethreat/followers", "following_url": "https://api.github.com/users/invisiblethreat/following{/other_user}", "gists_url": "https://api.github.com/users/invisiblethreat/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/invisiblethreat", "id": 2525006, "login": "invisiblethreat", "node_id": "MDQ6VXNlcjI1MjUwMDY=", "organizations_url": "https://api.github.com/users/invisiblethreat/orgs", "received_events_url": "https://api.github.com/users/invisiblethreat/received_events", "repos_url": "https://api.github.com/users/invisiblethreat/repos", "site_admin": false, "starred_url": "https://api.github.com/users/invisiblethreat/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/invisiblethreat/subscriptions", "type": "User", "url": "https://api.github.com/users/invisiblethreat", "user_view_type": "public" }
[ { "color": "02e10c", "default": false, "description": null, "id": 76800, "name": "Feature Request", "node_id": "MDU6TGFiZWw3NjgwMA==", "url": "https://api.github.com/repos/psf/requests/labels/Feature%20Request" }, { "color": "e102d8", "default": false, "description": null, "id": 117745, "name": "Planned", "node_id": "MDU6TGFiZWwxMTc3NDU=", "url": "https://api.github.com/repos/psf/requests/labels/Planned" }, { "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
57
2014-09-09T15:23:03Z
2017-01-21T16:42:04Z
2016-01-30T02:49:22Z
NONE
null
As of 1.9 of `urllib3`, the following warning appears once per invocation: ``` /usr/local/lib/python2.7/site-packages/requests-2.4.0-py2.7.egg/requests/packages/urllib3/connectionpool.py:730: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.org/en/latest/security.html (This warning will only appear once by default.) InsecureRequestWarning) ``` When using `verify=False` would it be useful to also set `requests.packages.urllib3.disable_warnings()`? I understand that this is a design decision that not everyone might agree with. :)
{ "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/2214/reactions" }
https://api.github.com/repos/psf/requests/issues/2214/timeline
null
completed
null
null
false
[ "I think you can disable these at a global level with the `warnings` module. Further, to work with logging (if I remember correctly) you need to reach into `urllib3` (and we document that), so I'm not against documenting this for users who are not going to use certificate verification for HTTPS connections.\n", "I remain strongly in favour of leaving these warnings in place. Yes, they're annoying, but they're also there for a reason. If anything, I'm tempted to switch it off and replace it with one of our own! =P\n", "At this point it's fairly obvious that @Lukasa and I are -1 on this feature. @kennethreitz @shazow any opinions?\n", "To some extent, I agree that the warnings are important, but I think that there are multiple factors that might need to be considered.\n\nFrom a developer perspective, know that I know about this, I can just turn this off if I feel inclined. I'm newer to packages, so it when I read the docs, in the warning, that solution didn't actually work. I like the idea that @Lukasa presented about making something that 's specific to `requests`. \n\nFrom a user perspective, I installed `pyvmomi` with `pip`today, which uses `requests` in its internals. It's really a non-transparent error that gets emitted back to the user in a case where `requests` is a silent supporting library.\n", "Yes, `requests.packages.urllib3.disable_warnings()` is a shortcut for turning it off using the warnings module's filtering.\n\nI'd strongly recommend having some kind of warning to this effect. +0.5 on having the urllib3 one propagate, +1 if you want to put in the effort and adding a requests-specific one. -1 on having no warning.\n\nIf you'd like, we can make the urllib3 warning message configurable and you can override it so you can piggyback on the same logic otherwise.\n", "Once again, I don't consider this message user-hostile, I consider it extremely valuable. You now know that pyvmomi has turned off TLS certificate verification, which is fairly important information!\n\nThat said, I don't object to us having a more requests-y way to silence it.\n", "Yeah, really I think this is a bug in `pyvmomi`. If they don't want to be embarrassed like this, they should be disabling warnings in their tool. It isn't our job to _not_ warn users that the connections some tool is making could expose them to MITM attacks because the tool is not performing certificate verification.\n", "Thanks for the discussion folks! I do appreciate everyone commenting, and helping me see the value in the way that things are done, and why. I was having a hard time seeing the more general cases! :)\n\nWill work on a patch today, as time allows, to have a 'requests-y' way to silence. Feedback will be welcome!\n", "@invisiblethreat feel free to hop into IRC if you have questions\n", "Just wondering if you considered the case where requests is used in a webhook. I have to suppress the warning so it doesn't pollute the JSON output of the script (or am I missing something?)\n", "@macterra I'm not sure I understand. Are you looking for alternative strategies for disabling the warning or ...?\n", "It's also extremely unclear to me why your webhook is disabling certificate verification. I'd be wanting to leave that on.\n", "Further, if you're piping stdout from some script to get the results, warnings will come out from stderr so they should not pollute your JSON output.\n", "Right, if the warning is on stderr then no problem. I couldn't tell from looking at the output in the console, my mistake.\n", "I think we should customize this to point to the requests documentation instead of urllib3's documentation.\n", "I'm not sure I understand what this warning feature is meant to achieve and how the warning is meant to be controlled.\n\nI have a module which uses `requests` and has to make requests with the `verify=False` argument. This causes the users of my module to see the unnecessary warning. Unnecessary warnings make important warnings more difficult to see,\n\nIt would make sense for my module to disable the warning, but then _I would be disabling the warning also in any other module_ using `requests` in the application! \n\nThings are not better if I need to instruct the user of my module to disable the warning: The fact that I'm using `requests` is normally just an invisible implementation detail the user shouldn't need to know. And the user still would only have the option to silence everything or noting.\n\nI don't think global warnings are going to be helpful.\n\nI could subclass `urllib3.HTTPSConnectionPool` and override `_validate_conn()` and make `requests` use that in my module to avoid hiding warnings from other modules, but that seems to be too much work for a simple thing.\n", "> I'm not sure I understand what this warning feature is meant to achieve\n> \n> causes the users of my module to see the unnecessary warning.\n\nWhen you set `verify=False` you are no longer securing your network connections. That, IMHO, is _not_ an unnecessary warning, it's a hugely relevant warning. Your users, who previously had no idea that you weren't verifying certificates, now know this to be true.\n\nIf the warning is not valuable for your module, it is not likely to be valuable for any other module in the application (once you've thrown away security in one network point there's no point crowing about it everywhere else). I don't really see a problem with disabling it globally.\n", "When the user explicitly requests `verify=False` for a particular request, I don't see the value of showing a warning. When I as a module author set `verify=False`, I set it by user's request (or I'm being malicious, but the warning doesn't help there either, because I can silence the warnings). Indeed, I want to avoid being malicious and don't want to globally silence warnings, because that takes away the useful warning for those requests some other part of the application is unknowingly making insecurely.\n\nAlso, having the warning on for those requests where verification is explicitly turned off by by the user also hides the requests where the user would want the warning, since the warning is given only once. The warning is also not really helpful for the user, since it doesn't mention the URL of the particular request.\n\nI don't agree that throwing away security in one network point somehow makes any security checks useless in the application, neither do any browser vendors. Browsers let me bypass security checks for individual URLs but keep checking the rest and I like that.\n\nWhen I have a tool which talks to an internal server with a self-signed cert in an internal network, but also communicates with outside hosts, I do want to verify the outside communication. This would be the situation where I would like as a user to see warnings about accidentally unsecured requests.\n\nConsider I'm making `service_foo` and someone uses it in an app:\n\n``` python\nimport service_foo\nimport requests\n\nsession = service_foo.Session('https://10.0.0.1', verify=False)\ndata = session.get_data()\nrequests.put('https://example.com/submit', data=data)\n```\n\nI have 2 options for `service_foo`:\n1. I keep global security warning on\n - User always gets a warning when the application talks to `https://10.0.0.1`\n - User never gets a warning even if request to `https://example.com/submit` is not safe\n2. Turn off global security warning:\n - User never gets a warning even if request to `https://example.com/submit` is not safe\n\nI don't think either option is good, but option 1 is worse, because it is giving false alarms. But I'm not comfortable having security checks turned off for the user as a side-effect of using my module.\n\nIf I would do this with a shell script, the user would be happier and safer:\n\n```\ncurl --insecure -o data https://10.0.0.1/get_data\ncurl --upload-file data https://example.com/submit\n```\n\nTo me it only makes sense to give a warning if the configuration of the Python platform is broken. The page https://urllib3.readthedocs.org/en/latest/security.html linked to in the `InsecureRequestWarning` message is indeed geared to show how to fix problems in the platform. If the user requests to skip verification, there shouldn't be a warning like there isn't a warning if the user requests an `http` URL instead of an `https` one.\n", "> When the user explicitly requests verify=False for a particular request, I don't see the value of showing a warning.\n\nWho is the 'user'? Throughout your post this question kept coming to my mind, because I believe you're conflating two audiences.\n\n> When I as a module author set verify=False, I set it by user's request (or I'm being malicious).\n\nOr you're being negligent. You have had had users complain that they couldn't interop with their self-signed certs and so you turned cert verification off, despite the fact that turning off cert verification is _not_ the way to deal with that problem.\n\n> that takes away the useful warning for those requests some other part of the application is unknowingly making insecurely\n\nThis sentence baffles me. It suggests that it is acceptable to warn when an application _unknowingly_ makes insecure requests, but that an application _knowingly_ making them is somehow OK. I do not see how knowingly making insecure requests should in any way be considered 'more secure' than unknowingly doing so.\n\n> Also, having the warning on for those requests where verification is explicitly turned off by by the user\n\nWhich user? How are we to distinguish between the module author and the 'user', whoever they may be?\n\n> The warning is also not really helpful for the user, since it doesn't mention the URL of the particular request.\n\nThe warning should not mention the URL of the request, because that would risk generating warning spam. We warn _once_, saying 'this application is at risk', not 'this particular communication is at risk'.\n\n> Browsers let me bypass security checks for individual URLs but keep checking the rest and I like that.\n\nBrowser vendors _warn_ when you access a URL with an invalid cert! They print dialog boxes and highlight the URL bar in red! That's _exactly_ what we're doing. We aren't stopping you from doing anything, we're just saying \"hey, this is bad!\" What you're asking us to do is the same as asking browser vendors to allow users to turn off that red warning for particular URLs, and I guarantee that they will refuse to do so because the security implications are monstrous.\n\n> When I have a tool which talks to an internal server with a self-signed cert in an internal network, but also communicates with outside hosts, I do want to verify the outside communication.\n\nNo, you want to verify _all_ the communication. Verify the self-signed cert! Validate that you got the certificate you expected to get. `verify=False` should be considered a sledgehammer approach to security, effectively saying \"screw security, just make it work\". That's absolutely fine, you have a right to say that, but we have an obligation to call it out as insecure.\n\n> I don't think either option is good, but option 1 is worse, because it is giving false alarms.\n\nOption 1 is not giving false alarms, it's giving real alarms. The communication to 10.0.0.1 is _insecure_, and we should not be pretending otherwise.\n\n> If I would do this with a shell script, the user would be happier and safer.\n\nThe user may well be happier, but they wouldn't be safer. They'd be exactly as safe as they were before. You seem to be under the impression that turning off this warning somehow magically makes certificate verification go away, and it does not. I'll touch on this again at the end of this response.\n\n> To me it only makes sense to give a warning if the configuration of the Python platform is broken. \n\nNo, we should fail hard if the configuration of the Python platform is broken and you didn't ask for unverified requests. If your platform cannot make safe TLS connections then we absolutely should not be making them, except in the situation where our user expressly tells us not to care (by setting `verify=False`), in which case we should warn that what you're about to do is dangerous.\n\nI think you're labouring under a misapprehension, so I'd like to make something very clear: there is no way to make an unvalidated HTTPS request with requests without either a) setting `verify=False` (our warn behaviour) or b) deliberately sabotaging the `ssl` module. We cannot catch b) and do not warn on it. This is the only situation that would fall under the notion you raised of \"problems with the platform\". The advice on urllib3's help page does not apply to us because we take all the necessary platform related steps, including bundling trusted certs and manually verifying certificates.\n\nThere is a dangerous view in the web community that you should only verify certificates signed by trusted root certificates. This view is utterly misguided. If you're encountering self-signed certificates you should damn well validate them. That's totally do-able! Add the self-signed cert to a `.pem` file and pass it as an argument to `verify`!\n\nIf you're having trouble with combining that with the bundled `.pem` file, please let me know and I'll enhance mkcert.org to enable you to concatenate your own certificates with the trusted roots. But please, don't pretend that setting `verify=False` is safe: it simply isn't.\n", "> Also, having the warning on for those requests where verification is explicitly turned off by by the user also hides the requests where the user would want the warning, since the warning is given only once.\n\nThis is also a bit baffling. By setting `verify=False` you maybe explicitly turning it off for just that request, but there is no way to convey that beyond the point where we construct our request. There's also no reason to convey it beyond that point because you've disabled certificate verification. The context in which you did so is of no consequence to us or anyone using your app.\n", "> What you're asking us to do is the same as asking browser vendors to allow users to turn off that red warning for particular URLs, and I guarantee that they will refuse to do so because the security implications are monstrous.\n\nMy browsers allow me to permanently accept an unverified certificate, which is \"monstrously insecure\".\n\n> The communication to 10.0.0.1 is insecure, and we should not be pretending otherwise.\n\nThe connection is insecure in the way that you can't verify a digital certificate, but verifying a certificate doesn't really tell you whether the server you are talking to is secure. But when I'm talking to a server in a closed network I can really make sure the security of the server.\n\n> I think you're labouring under a misapprehension, so I'd like to make something very clear: there is no way to make an unvalidated HTTPS request with requests without either a) setting verify=False (our warn behaviour) or b) deliberately sabotaging the ssl\n\nI'm trying to wonder how I could be a good citizen in my module by honoring the user's wish to ignore certificate checks and warnings for the URL they give to me. And what value the warning model adds. What is the case where a request with `verify=False` should show a warning to the user?\n\nI don't see how the warning mechanism can catch negligent code, since it can't distinguish whether a request is made because of sloppy coding or because a user requested so. I don't think a module like `requests` should dictate a security policy either. I've understood warnings are usually aimed for developers so they can fix incorrect code, but this warning isn't like that. If the warning is just for the general education of the user, there should be an easy way for the user to hide it.\n\nGetting the warning isn't only cosmetic either, because it messes the output of a program.\n\nI only see negative value of the warning so I'm turning it off in my module even if I hate to hide such a global policy change there.\n\n> There is a dangerous view in the web community that you should only verify certificates signed by trusted root certificates. This view is utterly misguided.\n\nDidn't know there's a view like that. A cert signed by a root cert doesn't really prove anything about the security of the site. It's cheap to get an anonymous cert if you want to do bad things.\n\n> If you're encountering self-signed certificates you should damn well validate them. That's totally do-able! Add the self-signed cert to a .pem file and pass it as an argument to verify!\n\nThe user would need a secure channel to obtain the cert, like an internal trusted network. But if the server is itself in the same internal network, there is not much gained. But this is in any case something the user decides, I can't impose a policy in my module.\n", "I agree with @kankri, for the most part. That was the original design intention.\n\nI propose something — that we disable by default but have our own function for re-enabling it, or documenting how to turn it on. I don't want out users to have to go out of the way to use the code as intended. `verify=False` is a feature, albeit not a best-practice one. That's none of our business. \n", "I agree that `verify=False` is a feature, but I don't agree that it's a feature on the same level as `params=` or `cert=`. It's a feature that defaults to a secure value and may be set to an insecure one. It's a giant, tempting option for people to throw security out the window for the sake of expediency, and I think that impulse should be resisted (but not disallowed). I will always lean towards the 'you must explicitly be insecure' school of thought, and I don't care if that means flicking two switches and not one.\n\nRegardless, this is your call not mine. =)\n", "Just wanted to say I agree with @kankri and that @kennethreitz's remark\n\n> verify=False is a feature, albeit not a best-practice one. That's none of our business. \n\nsums it up well.\n", "For those who also want to disable the warnings, this is how to do it. You need to use the [warnings modules](https://docs.python.org/2/library/warnings.html), which is part of the standard library:\n\n```\nimport warnings\nimport requests\nfrom requests.packages.urllib3 import exceptions\n\nwith warnings.catch_warnings():\n warnings.simplefilter(\"ignore\", exceptions.InsecureRequestWarning)\n warnings.warn('a non-requests warning is not blocked')\n print requests.get('https://rsa-md5.ssl.hboeck.de/', verify=False)\n```\n\nThis configures a warning filter that will ignore any warning of category `InsecureRequestWarning`. The output looks like:\n\n```\ntest.py:46: UserWarning: a non-requests warning\n warnings.warn('a non-requests warning is not blocked')\n<Response [403]>\n```\n\n(The test site happens to return a 403 Forbidden page, but that's not important here.)\n\nNote that you need to use the class from the bundled `urllib3` package, and not the class from a top-level `urllib3` package, if you happen to have one installed.\n\nYou can (and probably should) make a small function that uses the context manager in the smallest possible region of code:\n\n```\ndef silent_unverified_get(*args, **kwargs):\n kwargs['verify'] = False\n with warnings.catch_warnings():\n warnings.simplefilter(\"ignore\", exceptions.InsecureRequestWarning)\n return requests.get(*args, **kwargs)\n```\n", "Or simply do this:\n\n``` python\nrequests.packages.urllib3.disable_warnings()\n```\n", "@Lukasa \n\n> Or simply do this:\n> \n> ```\n> requests.packages.urllib3.disable_warnings()\n> ```\n\nExcept that I find no mention of this function in the requests manual.\n\nWhile it is far from everybody who knows about it, I would argue that the `warnings` module _is_ the standard tool a Python programmer should look to when he wants to disable warnings. It is part of the standard library and is well documented.\n\nI suggest putting a reference to `warnings` into the `requests` documentation — or to the convenience `disable_warnings` function if you like, as long as there is a corresponding `enable_warnings` function (it [seems that there isn't such a function](https://urllib3.readthedocs.org/en/latest/security.html#insecurerequestwarning)).\n", "Once again: I don't want to disable warnings in general. I just want this particular warning to go away when I _explicitly_ set verify=False in my code. There may be other, useful, warnings, unlike this particular, useless, warning. What is so difficult to understand about this?!\n", "@zaitcev At the risk of repeating myself:\n\n``` python\nrequests.packages.urllib3.disable_warnings()\n```\n", "And if even that is too broad for you:\n\n``` python\nfrom requests.packages.urllib3.exceptions import InsecureRequestWarning\n\nrequests.packages.urllib3.disable_warnings(InsecureRequestWarning)\n```\n" ]
https://api.github.com/repos/psf/requests/issues/2213
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/2213/labels{/name}
https://api.github.com/repos/psf/requests/issues/2213/comments
https://api.github.com/repos/psf/requests/issues/2213/events
https://github.com/psf/requests/pull/2213
42,279,429
MDExOlB1bGxSZXF1ZXN0MjA5Mzg2MDA=
2,213
Request->Response.
{ "avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4", "events_url": "https://api.github.com/users/Lukasa/events{/privacy}", "followers_url": "https://api.github.com/users/Lukasa/followers", "following_url": "https://api.github.com/users/Lukasa/following{/other_user}", "gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Lukasa", "id": 1382556, "login": "Lukasa", "node_id": "MDQ6VXNlcjEzODI1NTY=", "organizations_url": "https://api.github.com/users/Lukasa/orgs", "received_events_url": "https://api.github.com/users/Lukasa/received_events", "repos_url": "https://api.github.com/users/Lukasa/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions", "type": "User", "url": "https://api.github.com/users/Lukasa", "user_view_type": "public" }
[]
closed
true
null
[]
null
0
2014-09-09T07:45:27Z
2021-09-08T10:01:20Z
2014-09-09T07:45:30Z
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/2213/reactions" }
https://api.github.com/repos/psf/requests/issues/2213/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/2213.diff", "html_url": "https://github.com/psf/requests/pull/2213", "merged_at": "2014-09-09T07:45:30Z", "patch_url": "https://github.com/psf/requests/pull/2213.patch", "url": "https://api.github.com/repos/psf/requests/pulls/2213" }
true
[]
https://api.github.com/repos/psf/requests/issues/2212
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/2212/labels{/name}
https://api.github.com/repos/psf/requests/issues/2212/comments
https://api.github.com/repos/psf/requests/issues/2212/events
https://github.com/psf/requests/issues/2212
42,265,356
MDU6SXNzdWU0MjI2NTM1Ng==
2,212
Documentation error
{ "avatar_url": "https://avatars.githubusercontent.com/u/3065290?v=4", "events_url": "https://api.github.com/users/jgaul/events{/privacy}", "followers_url": "https://api.github.com/users/jgaul/followers", "following_url": "https://api.github.com/users/jgaul/following{/other_user}", "gists_url": "https://api.github.com/users/jgaul/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/jgaul", "id": 3065290, "login": "jgaul", "node_id": "MDQ6VXNlcjMwNjUyOTA=", "organizations_url": "https://api.github.com/users/jgaul/orgs", "received_events_url": "https://api.github.com/users/jgaul/received_events", "repos_url": "https://api.github.com/users/jgaul/repos", "site_admin": false, "starred_url": "https://api.github.com/users/jgaul/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/jgaul/subscriptions", "type": "User", "url": "https://api.github.com/users/jgaul", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2014-09-09T02:40:32Z
2021-09-08T23:08:10Z
2014-09-09T07:45:50Z
NONE
resolved
Hi there! Apologies that this probably isn't the ideal place to file this, but I think there's a documentation error at http://requests.readthedocs.org/en/latest/user/quickstart/#make-a-request. Where it reads "Now, we have a Request object called r", I think it should be "Now, we have a Response object called r", per [the code](https://github.com/kennethreitz/requests/blob/359659cf4b9dbeeef1ed832501dc1f99b0f0beac/requests/api.py#L19) and a test like this: >>> requests.get('https://api.github.com/events') <Response [200]>
{ "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/2212/reactions" }
https://api.github.com/repos/psf/requests/issues/2212/timeline
null
completed
null
null
false
[ "Great spot, thank you!\n\nIt should be fixed now. =)\n", ":thumbsup:! you're welcome--have a good one!\n" ]
https://api.github.com/repos/psf/requests/issues/2211
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/2211/labels{/name}
https://api.github.com/repos/psf/requests/issues/2211/comments
https://api.github.com/repos/psf/requests/issues/2211/events
https://github.com/psf/requests/issues/2211
42,225,593
MDU6SXNzdWU0MjIyNTU5Mw==
2,211
Subdomain that ends with dash works in OSX but not Linux
{ "avatar_url": "https://avatars.githubusercontent.com/u/7129564?v=4", "events_url": "https://api.github.com/users/feus4177/events{/privacy}", "followers_url": "https://api.github.com/users/feus4177/followers", "following_url": "https://api.github.com/users/feus4177/following{/other_user}", "gists_url": "https://api.github.com/users/feus4177/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/feus4177", "id": 7129564, "login": "feus4177", "node_id": "MDQ6VXNlcjcxMjk1NjQ=", "organizations_url": "https://api.github.com/users/feus4177/orgs", "received_events_url": "https://api.github.com/users/feus4177/received_events", "repos_url": "https://api.github.com/users/feus4177/repos", "site_admin": false, "starred_url": "https://api.github.com/users/feus4177/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/feus4177/subscriptions", "type": "User", "url": "https://api.github.com/users/feus4177", "user_view_type": "public" }
[]
closed
true
null
[]
null
9
2014-09-08T18:09:45Z
2021-09-08T23:08:07Z
2014-09-12T20:13:19Z
NONE
resolved
For example the URL dev-.domain.com would work in OSX but not Linux. The URL dev-sub.domain.com works in both. The problem occurs in both requests 2.1.0 and 2.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" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/2211/reactions" }
https://api.github.com/repos/psf/requests/issues/2211/timeline
null
completed
null
null
false
[ "Wow, this is a specific problem. When you say \"Doesn't work\", what exactly does that mean?\n", "I am pretty sure labels ending with a dash are forbidden. I'll look into the spec\n", "I get the Max retries exceeded exception.\n", "@feus4177 Can you provide the entire traceback, including the full text of the exception?\n", "This seems oddly specific and more bizarrely unlikely. Do you have something in your `/etc/hosts` on OSX that you don't have on Linux?\n", "The only reason I brought up that it works on OSX is just that I thought it might be helpful in troubleshooting what's going on. I believe everything in /etc/hosts is default.\n\nTraceback:\n\n```\n>>> requests.get('https://dev-.skyforge.co')\nTraceback (most recent call last):\n File \"<stdin>\", line 1, in <module>\n File \"/usr/local/lib/python2.7/dist-packages/requests/api.py\", line 55, in get\n return request('get', url, **kwargs)\n File \"/usr/local/lib/python2.7/dist-packages/requests/api.py\", line 44, in request\n return session.request(method=method, url=url, **kwargs)\n File \"/usr/local/lib/python2.7/dist-packages/requests/sessions.py\", line 382, in request\n resp = self.send(prep, **send_kwargs)\n File \"/usr/local/lib/python2.7/dist-packages/requests/sessions.py\", line 485, in send\n r = adapter.send(request, **kwargs)\n File \"/usr/local/lib/python2.7/dist-packages/requests/adapters.py\", line 372, in send\n raise ConnectionError(e)\nrequests.exceptions.ConnectionError: HTTPSConnectionPool(host='dev-.skyforge.co', port=443): Max retries exceeded with url: / (Caused by <class 'socket.gaierror'>: [Errno -2] Name or service not known)\n```\n\n/etc/hosts for Linux:\n\n```\n127.0.0.1 localhost\n::1 localhost ip6-localhost ip6-loopback\nfe00::0 ip6-localnet\nff00::0 ip6-mcastprefix\nff02::1 ip6-allnodes\nff02::2 ip6-allrouters\n\n127.0.1.1 raspberrypi\n```\n\n/etc/hosts for OSX:\n\n```\n127.0.0.1 localhost\n255.255.255.255 broadcasthost\n::1 localhost\nfe80::1%lo0 localhost\n```\n", "I finally got around to testing this on a linux box. It helped me realize the important part of the exception `Caused by <class 'socket.gaierror'>: [Errno -2] Name or service not known` (also I assume not staring at this for a day or two helped too). Namely `socket.gaierror` is raised when using `socket.getaddrinfo`. If you were to open up an interactive console and you did\n\n``` pycon\n>>> import socket\n>>> socket.getaddrinfo('dev-.skyforge.co', 443)\n```\n\nYou'll get an exception. On OS X you should instead see a list returned of tuples, e.g.,\n\n``` python\n[(2, 2, 17, '', ('198.199.118.90', 443)), (2, 1, 6, '', ('198.199.118.90', 443))]\n```\n\nWith that said, there's nothing we can do to fix this since it is strictly based on how your machine implements the API defined in `<socket.h>` which the `socket` module wraps for Python. Sorry, but this isn't a bug in requests.\n", "Ah, I see. Thanks for your help. 'ppreciate it.\n", "## Sorry we can't really be more helpful. If you find out why this happens feel free to comment here and let us know\n\nSent from my Android device with K-9 Mail. Please excuse my brevity.\n" ]
https://api.github.com/repos/psf/requests/issues/2210
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/2210/labels{/name}
https://api.github.com/repos/psf/requests/issues/2210/comments
https://api.github.com/repos/psf/requests/issues/2210/events
https://github.com/psf/requests/pull/2210
42,146,542
MDExOlB1bGxSZXF1ZXN0MjA4NjE5NjE=
2,210
Fix #2207
{ "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" }
[ { "color": "009800", "default": false, "description": null, "id": 44501218, "name": "Ready To Merge", "node_id": "MDU6TGFiZWw0NDUwMTIxOA==", "url": "https://api.github.com/repos/psf/requests/labels/Ready%20To%20Merge" }, { "color": "207de5", "default": false, "description": null, "id": 60620163, "name": "Minion Seal of Approval", "node_id": "MDU6TGFiZWw2MDYyMDE2Mw==", "url": "https://api.github.com/repos/psf/requests/labels/Minion%20Seal%20of%20Approval" } ]
closed
true
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
[ { "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" } ]
null
3
2014-09-07T17:03:09Z
2021-09-08T10:01:16Z
2014-09-09T14:24:24Z
CONTRIBUTOR
resolved
@Lukasa wrote the fix in #2207 With this, the expected behaviour is restored (a `TooManyRedirects` error); ``` pycon >>> import requests >>> r = requests.get('http://www.dx.com/p/-268479') Traceback (most recent call last): File "<stdin>", line 1, in <module> File "./requests/api.py", line 59, in get return request('get', url, **kwargs) File "./requests/api.py", line 48, in request return session.request(method=method, url=url, **kwargs) File "./requests/sessions.py", line 451, in request resp = self.send(prep, **send_kwargs) File "./requests/sessions.py", line 583, in send history = [resp for resp in gen] if allow_redirects else [] File "./requests/sessions.py", line 583, in <listcomp> history = [resp for resp in gen] if allow_redirects else [] File "./requests/sessions.py", line 111, in resolve_redirects raise TooManyRedirects('Exceeded %s redirects.' % self.max_redirects) requests.exceptions.TooManyRedirects: Exceeded 30 redirects. ```
{ "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/2210/reactions" }
https://api.github.com/repos/psf/requests/issues/2210/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/2210.diff", "html_url": "https://github.com/psf/requests/pull/2210", "merged_at": "2014-09-09T14:24:24Z", "patch_url": "https://github.com/psf/requests/pull/2210.patch", "url": "https://api.github.com/repos/psf/requests/pulls/2210" }
true
[ "I'm an obvious +1. :cake: :stars:\n", "should we add a test for this ? \n", "> should we add a test for this ?\n\nI'm wont to add a test that will cause our tests to slow-down and may eventually break the tests (if the domain in the original bug fixes its redirects).\n" ]
https://api.github.com/repos/psf/requests/issues/2209
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/2209/labels{/name}
https://api.github.com/repos/psf/requests/issues/2209/comments
https://api.github.com/repos/psf/requests/issues/2209/events
https://github.com/psf/requests/pull/2209
42,143,236
MDExOlB1bGxSZXF1ZXN0MjA4NjA1MjM=
2,209
Download time of response body is not included in Response.elapsed
{ "avatar_url": "https://avatars.githubusercontent.com/u/54217?v=4", "events_url": "https://api.github.com/users/heyman/events{/privacy}", "followers_url": "https://api.github.com/users/heyman/followers", "following_url": "https://api.github.com/users/heyman/following{/other_user}", "gists_url": "https://api.github.com/users/heyman/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/heyman", "id": 54217, "login": "heyman", "node_id": "MDQ6VXNlcjU0MjE3", "organizations_url": "https://api.github.com/users/heyman/orgs", "received_events_url": "https://api.github.com/users/heyman/received_events", "repos_url": "https://api.github.com/users/heyman/repos", "site_admin": false, "starred_url": "https://api.github.com/users/heyman/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/heyman/subscriptions", "type": "User", "url": "https://api.github.com/users/heyman", "user_view_type": "public" }
[ { "color": "e11d21", "default": false, "description": null, "id": 44501305, "name": "Not Ready To Merge", "node_id": "MDU6TGFiZWw0NDUwMTMwNQ==", "url": "https://api.github.com/repos/psf/requests/labels/Not%20Ready%20To%20Merge" }, { "color": "e11d21", "default": false, "description": null, "id": 78002701, "name": "Do Not Merge", "node_id": "MDU6TGFiZWw3ODAwMjcwMQ==", "url": "https://api.github.com/repos/psf/requests/labels/Do%20Not%20Merge" } ]
closed
true
null
[]
null
17
2014-09-07T14:25:36Z
2021-09-08T08:00:55Z
2015-04-05T16:03:15Z
CONTRIBUTOR
resolved
When doing a request with stream=False, to an endpoint that responds with a streaming/chunked response, the download time of the response body is not included in the Response.elapsed timedelta. This pull request adds a test for this that currently fails. In Requests 2.2 the behaviour was different, and this test passes. If the current behaviour is the intended, I guess one could just modify the test in this pull request to reflect the expected behaviour.
{ "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/2209/reactions" }
https://api.github.com/repos/psf/requests/issues/2209/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/2209.diff", "html_url": "https://github.com/psf/requests/pull/2209", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/2209.patch", "url": "https://api.github.com/repos/psf/requests/pulls/2209" }
true
[ "I don't believe the behaviour in 2.2 was intentional. In all likelihood it was entirely accidental. That aside, I'll have to do some research before I'm confident that we want to either restore that behaviour or keep the current one.\n\nWith that in mind, can you please rewrite your test to follow the style of the tests in `test_requests.py`? We do not use the xUnit style assertion methods.\n", "So the calculation of the elapsed time per-request is done in `requests/sessions.py` and hasn't changed between 2.2.0 and 2.4.0. It still does this:\n\n``` python\nstart = datetime.utcnow()\nr = adapter.send(request, **kwargs)\nr.elapsed = datetime.utcnow() - start\n```\n\nThis is entirely related to something that @kevinburke pointed out though. In [HTTPAdapter#send](https://github.com/kennethreitz/requests/blob/master/requests/adapters.py#L315) we do not use the `stream` parameter any longer. In 2.2.0, if stream was not truthy, at the end of the `send` method we would do `r.content` which would consume everything. I'm not sure when or why that was removed, but I'll check into that.\n\n**Edit** This check for `stream` is also not present in [2.3.0](https://github.com/kennethreitz/requests/blob/6366d3dd190a9e58ca582955cddf7e2ac5f32dcc/requests/adapters.py#L380..L388). It is present in [2.2.1](https://github.com/kennethreitz/requests/blob/33735480f77891754304e7f13e3cdf83aaaa76aa/requests/adapters.py#L393)\n", "So that check was moved out of `requests/adapters.py` into `requests/sessions.py` in 343db403754da3334673d1474da0ebe86457ca03, specifically it occurs now at the end of [Session#send](https://github.com/kennethreitz/requests/commit/343db403754da3334673d1474da0ebe86457ca03#diff-28e67177469c0d36b068d68d9f6043bfR595). That's a merge commit though, so I'm still tracking down which commit exactly did this. I suspect it has to do with our `redirect` changes that were being discussed/proposed around that time.\n", "So the actual change was made by @schlamar in https://github.com/kennethreitz/requests/commit/59c8d813818110aac29fd104c2fa012387c2004c. It was part of https://github.com/kennethreitz/requests/pull/1944. Now to figure out why that was moved. It's not apparent from the bug report that it was necessary to move it to `Session#send`.\n", "Final comment of the morning (as I have other things I have to do), I'm not sure there is anything preventing us from moving that consumption back to `HTTPAdapter#send`. I'm genuinely interested in @schlamar's reason for moving it though if they can remember it.\n\nAlso, @heyman thank you for changing the test style. We may not end up merging this right away, but your cooperation and bug report are much appreciated.\n", "@sigmavirus24 Thanks for your thorough response!\n\nJust a quick note. I tried to move the consumption of r.content back into HTTPAdapter.send. As expected it fixes the test I've supplied, but it also makes the `test_redirect_with_wrong_gzipped_header` test (https://github.com/kennethreitz/requests/blob/359659cf4b9dbeeef1ed832501dc1f99b0f0beac/test_requests.py#L978) fail with a ContentDecodingError.\n", "Ah, I believe the reason we don't get a ContentDecodingError when response.content is consumed in `Session.send()`, is that the content has then already been consumed in `SessionRedirectMixin.resolve_redirects()`, where `ContentDecodingError` is catched and handled (https://github.com/kennethreitz/requests/blob/359659cf4b9dbeeef1ed832501dc1f99b0f0beac/requests/sessions.py#L106).\n", "The redirect issue is exactly why we moved it. We were encountering problems on redirect where we'd barf on invalid response bodies, even though we didn't really need them to proceed. We judged that to be a bad idea, so we moved the decode to ensure that it would happen in a guarded block for redirects, but still fail hard for non-redirected requests.\n\nAs @sigmavirus24 has observed, this bug is an accidental consequence of that change. Thanks for the fix, I'll review it shortly.\n", "Ah, I misunderstood: this PR is the test, but not the fix. @heyman were you planning to provide the fix as well? Were you looking for guidance in how to do that?\n", "The initial reason that I opened the issue was that I wanted to know if this was intended (though I suspected it wasn't), in which case we would have to do our own work around in Locust (https://github.com/locustio/locust/) which uses requests, and where response time values is of high importance (since it's a tool for load testing). I figured a test would be a good way to explain the issue.\n\nNow that I know that it's considered a bug, I guess I can take a stab at fixing it.\n", "I've now made some changes that I believe fixes the issue. I moved back the consumption of `Response.content` from `Session` into `HTTPAdapter`, but added the condition `response.is_redirect == False` for the consumption to happen.\n\nAll test passes, but I'm not super familiar with the code base so there might be a better way to do it.\n\nAs I'm typing this, I also realise that there might still be an issue where the downloading of the body is not included in elapsed time for streamed responses that are redirects (do they exist?).\n", "I've been thinking about this for most of today and I'm not certain that there's a _good_ way to solve this. I had a similar idea to yours @heyman but one of the catches with that is the use case where the user decides to handle redirects themselves, e.g.,\n\n``` python\nimport requests\n\nr = requests.get('http://httpbin.org/redirect/2', allow_redirects=False)\n```\n\nIn that case, `r`'s content will not be consumed. Prior to this, it was guaranteed to be consumed (unless the user specifies `stream=True`). In this case, we're breaking that guarantee for the user.\n", "Ah, I see.\n\nWith the current code in master, wouldn't you get an exception (`ContentDecodingError`) if you do a request with `allow_redirects=False`, and the server returns an invalid response body?\n", "@heyman Yes. That's considered to be OK: with allow_redirects set to false you really need to handle all the redirect logic yourself. We simply don't know what you want to do.\n", "Okay, we currently have 10 pull requests open for this project, many of which are labelled \"do not merge\". \n\nLet's get this cleaned up. \n", "@sigmavirus24 and I talked about doing a big issue and pull request cleanup at PyCon.\n\n> On 2 Apr 2015, at 19:38, Kenneth Reitz [email protected] wrote:\n> \n> Okay, we currently have 10 pull requests open for this project, many of which are labelled \"do not merge\".\n> \n> Let's get this cleaned up.\n> \n> —\n> Reply to this email directly or view it on GitHub.\n", "I think our documentation now very clearly illustrates that the elapsed time is always the time to the first byte of the body. Which means that this can be closed as we no longer expect this behaviour. @Lukasa or @kennethreitz should re-open this if they disagree.\n" ]
https://api.github.com/repos/psf/requests/issues/2208
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/2208/labels{/name}
https://api.github.com/repos/psf/requests/issues/2208/comments
https://api.github.com/repos/psf/requests/issues/2208/events
https://github.com/psf/requests/pull/2208
42,129,526
MDExOlB1bGxSZXF1ZXN0MjA4NTQ1MTM=
2,208
Changes the fallback text encoding to cp1252
{ "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
5
2014-09-06T23:12:58Z
2021-09-08T10:01:21Z
2014-09-07T05:41:49Z
CONTRIBUTOR
resolved
In my use of Requests, [I noticed at some point](https://stackoverflow.com/questions/11588458/how-to-handle-encodings-using-python-requests-library) that text that was encoded as cp1252 was coming back as ISO-8859-1. While in many cases, that's a fine fallback encoding, cp1252 is a superset of ISO-8859-1, making it right even more often. Walking through the scenarios, just to make sure I'm not missing something: 1. Text is encoded as cp1252, but is misidentified as ISO-8859-1. Result: Characters from the cp1252 superset will be mojibake. 2. Text is encoded as cp1252 and is identified as cp1252. Result: All good. 3. Text is encoded as ISO-8859-1, but is misidentified as cp1252. Result: All good. Superset in cp1252 encoding won't cause a problem. 4. Text is encoded as ISO-8859-1 and is identified as ISO-8859-1. Result: All good. So, I think this can only do good, but encodings have never been my friend, and I'd be only slightly surprised if I missed 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/2208/reactions" }
https://api.github.com/repos/psf/requests/issues/2208/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/2208.diff", "html_url": "https://github.com/psf/requests/pull/2208", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/2208.patch", "url": "https://api.github.com/repos/psf/requests/pulls/2208" }
true
[ "Thanks for this!\n\nUnfortunately you've stumbled into a thorny problem. Most of the background is in #2086. The short position here is that we used to fall back to ISO-8859-1 because the spec told us to, but that spec note got removed. For that reason we plan to remove the fallback entirely, not change it to another encoding. The encoding fallback always presented a problem (it was often wrong), so we'd really like to get rid of it entirely.\n\nSorry about that!\n", "Good lord, that's well above my pay grade and beyond any pay grade I aspire to. I summarily rescind my suggestion and hope that a sane solution can be bartered.\n", "@mlissner it's above all of our paygrades ;)\n", "@mlissner Trust me, this is one of those situations where you'd really rather not know. Get out, get out now. This way lies madness. Dive not into the murky world of HTTP, for monsters lurk in the depths.\n", "All hail the dragon slayers.\n" ]
https://api.github.com/repos/psf/requests/issues/2207
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/2207/labels{/name}
https://api.github.com/repos/psf/requests/issues/2207/comments
https://api.github.com/repos/psf/requests/issues/2207/events
https://github.com/psf/requests/issues/2207
42,112,045
MDU6SXNzdWU0MjExMjA0NQ==
2,207
TooManyRedirects not working in 2.4.0
{ "avatar_url": "https://avatars.githubusercontent.com/u/1665772?v=4", "events_url": "https://api.github.com/users/ondrejsika/events{/privacy}", "followers_url": "https://api.github.com/users/ondrejsika/followers", "following_url": "https://api.github.com/users/ondrejsika/following{/other_user}", "gists_url": "https://api.github.com/users/ondrejsika/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/ondrejsika", "id": 1665772, "login": "ondrejsika", "node_id": "MDQ6VXNlcjE2NjU3NzI=", "organizations_url": "https://api.github.com/users/ondrejsika/orgs", "received_events_url": "https://api.github.com/users/ondrejsika/received_events", "repos_url": "https://api.github.com/users/ondrejsika/repos", "site_admin": false, "starred_url": "https://api.github.com/users/ondrejsika/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/ondrejsika/subscriptions", "type": "User", "url": "https://api.github.com/users/ondrejsika", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2014-09-06T08:30:44Z
2021-09-08T23:08:06Z
2014-09-09T14:24:24Z
NONE
resolved
hi, if i try page which has permanent redirect to it self, requests (2.4.0) cant raise TooManyRedirects exception. In 2.3.0 works fine. try: ``` import requests requests.get('http://www.dx.com/p/-268479') ```
{ "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/2207/reactions" }
https://api.github.com/repos/psf/requests/issues/2207/timeline
null
completed
null
null
false
[ "Hurrah! As I predicted in #2095, our redirect cache has introduced a bug.\n\nSpecifically, if a website sets a permanent redirect to itself we will spin in an infinite loop forever on line 535 of `sessions.py`, trying to find the \"real\" url.\n\nMy proposed fix would be to change the logic where we add to the redirect cache (L138 of `sessions.py`) from this:\n\n``` python\nif resp.is_permanent_redirect:\n self.redirect_cache[req.url] = prepared_request.url\n```\n\nto this:\n\n``` python\n# Cache the URL unless it's a redirect to self.\nif resp._is_permanent_redirect and req.url != prepared_request.url:\n self.redirect_cache[req.url] = prepared_request.url\n```\n", "Don't be too happy @Lukasa. =P\n" ]
https://api.github.com/repos/psf/requests/issues/2206
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/2206/labels{/name}
https://api.github.com/repos/psf/requests/issues/2206/comments
https://api.github.com/repos/psf/requests/issues/2206/events
https://github.com/psf/requests/issues/2206
42,086,301
MDU6SXNzdWU0MjA4NjMwMQ==
2,206
problems with get_encodings_from_content
{ "avatar_url": "https://avatars.githubusercontent.com/u/64992?v=4", "events_url": "https://api.github.com/users/jab/events{/privacy}", "followers_url": "https://api.github.com/users/jab/followers", "following_url": "https://api.github.com/users/jab/following{/other_user}", "gists_url": "https://api.github.com/users/jab/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/jab", "id": 64992, "login": "jab", "node_id": "MDQ6VXNlcjY0OTky", "organizations_url": "https://api.github.com/users/jab/orgs", "received_events_url": "https://api.github.com/users/jab/received_events", "repos_url": "https://api.github.com/users/jab/repos", "site_admin": false, "starred_url": "https://api.github.com/users/jab/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/jab/subscriptions", "type": "User", "url": "https://api.github.com/users/jab", "user_view_type": "public" }
[]
closed
true
null
[]
null
16
2014-09-05T20:23:59Z
2021-09-08T05:00:42Z
2014-09-11T17:33:21Z
NONE
resolved
Here is the code for `get_encodings_from_content` in the requests.utils module: ``` python def get_encodings_from_content(content): """Returns encodings from given content string. :param content: bytestring to extract encodings from. """ charset_re = re.compile(r'<meta.*?charset=["\']*(.+?)["\'>]', flags=re.I) pragma_re = re.compile(r'<meta.*?content=["\']*;?charset=(.+?)["\'>]', flags=re.I) xml_re = re.compile(r'^<\?xml.*?encoding=["\']*(.+?)["\'>]') return (charset_re.findall(content) + pragma_re.findall(content) + xml_re.findall(content)) ``` Is there any reason to recompile the regexes on every call rather than making them module-level constants? More fundamentally, wouldn't it be more useful to have a function that just returned the first match, rather than a tuple of all matches, and therefore could often stop processing the input after a few lines, rather than always having to do three passes through the entire thing? That way, if you're fetching a large html document using `stream=True` from a server that may not have sent the charset in a Content-Type header, we can write: ``` python encoding = get_encoding_from_headers(res.headers) or \ get_encoding_from_content(raw) # just get the first encoding declared in content, if any ``` which is all we care about. (Assume `raw` has been set already with something like: ``` python bio = BytesIO() bytesread = 0 for chunk in res.iter_content(chunk_size=CHUNK_SIZE): bio.write(chunk) bytesread += len(chunk) if bytesread > RES_MAX_BYTES: return _too_big() raw = bio.getvalue() ``` )
{ "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/2206/reactions" }
https://api.github.com/repos/psf/requests/issues/2206/timeline
null
completed
null
null
false
[ "Oy, I just realized `get_encoding_from_headers()` returns a fallback value of 'ISO-8859-1' if no encoding was found in the headers, and there's no way to control this behavior:\n\n``` python\ndef get_encoding_from_headers(headers):\n \"\"\"Returns encodings from given HTTP Header Dict.\n\n :param headers: dictionary to extract encoding from.\n \"\"\"\n\n content_type = headers.get('content-type')\n\n if not content_type:\n return None\n\n content_type, params = cgi.parse_header(content_type)\n\n if 'charset' in params:\n return params['charset'].strip(\"'\\\"\")\n\n if 'text' in content_type:\n return 'ISO-8859-1'\n```\n\nWould you accept a PR to change this to something like:\n\n``` python\ndef get_encoding_from_headers(headers, text_fallback='ISO-8859-1'):\n \"\"\"Returns encodings from given HTTP Header Dict.\n\n :param headers: dictionary to extract encoding from.\n \"\"\"\n\n content_type = headers.get('content-type')\n\n if not content_type:\n return None\n\n content_type, params = cgi.parse_header(content_type)\n\n if 'charset' in params:\n return params['charset'].strip(\"'\\\"\")\n\n if text_fallback and 'text' in content_type:\n return text_fallback\n```\n\n?\n\nThat way you could write:\n\n``` python\nencoding = get_encoding_from_headers(headers, text_fallback=None) or \\\n get_encoding_from_content(raw)\n```\n\nwhen that's what you need.\n", "There is a good reason not to do it on the module scope. That function is so rarely used by 98% of requests users that triggering the compile when they do `import requests` will hurt their performance for no real benefit. That said, how would you determine which was the first encoding in the body? You could do something like:\n\n``` python\nm1 = charset_re.search(raw)\nm2 = pragma_re.search(raw)\nm3 = xml_re.search(raw)\n\nfirst = sorted([m1, m2, m3], keyfunc=lambda m: m.start())[0]\n\nreturn first.groups()\n```\n\nBut that seems kind of arbitrary. On the one hand, returning all of them is also arbitrary but if we had written it the way you want, someone else would have wanted us to write it the way it is currently written.\n\nTo address your concern about `get_encoding_from_headers` that is now not conformant with RFC 7230 and we have plans to change that in #2086. Right now, we _could_ accept that pull request but I'm not sure if it's desirable. I'll have to think about it and wait for @Lukasa would have to weigh in too.\n", "Thanks for the thorough reply, @sigmavirus24.\n\n> There is a good reason not to do it on the module scope. That function is so rarely used by 98% of requests users that triggering the compile when they do import requests will hurt their performance for no real benefit.\n\nA typical solution is to compile them lazily (on first use) then, no? That way when you don't need to use the function you don't have to pay for it, and when you do, you're not punished for it on every call.\n\nThat said, out of curiosity I measured the performance impact of adding\n\n``` python\nimport re\nCHARSET_RE = compile(r'<meta.*?charset=[\"\\']*(.+?)[\"\\'>]', flags=re.I)\nPRAGMA_RE = compile(r'<meta.*?content=[\"\\']*;?charset=(.+?)[\"\\'>]', flags=re.I)\nXML_RE = compile(r'^<\\?xml.*?encoding=[\"\\']*(.+?)[\"\\'>]')\n```\n\nto an otherwise empty module, and the difference was indistinguishable from noise. Did I measure wrong?\n\n> That said, how would you determine which was the first encoding in the body? You could do something like...\n\n(I was even thinking something simpler, something like:\n\n``` python\nfor p in (CHARSET_RE, PRAGMA_RE, XML_RE): # compile these lazily if you like\n match = p.search(raw)\n if match:\n return match.group()\n```\n\n)\n\n> But that seems kind of arbitrary. On the one hand, returning all of them is also arbitrary but if we had written it the way you want, someone else would have wanted us to write it the way it is currently written.\n\nHm. Having a function that returned the first match rather than all matches for all three patterns makes the use case of getting the charset declared in the head of a large html document much more efficient. That seems like a primary use case for this function, in light of `get_unicode_from_response`'s docstring (though see #2205). So it's not arbitrary. At least, an additional `get_first_encoding_from_content` function could be offered to facilitate this use case.\n\nI did a github code search for `get_encodings_from_content` to see how people are using this and so far most are using it like [this](https://github.com/ackwell/ninjabot/blob/68163212380a1cd82fda4e0c6e0d1b09a7c5a64e/plugins/web/linkinfo.py#L49..L51):\n\n``` python\n if 'charset' not in content_type:\n # requests only looks at headers to detect the encoding, we must find the charset ourselves\n # we can't use req.content because regex doesn't work on bytestrings apparently\n encodings = get_encodings_from_content(req.text)\n if encodings:\n req.encoding = encodings[0]\n```\n\nI'm not sure if you've gotten any requests for it to be the way it's currently written, but the way I'm proposing seems more efficient for the use cases I'm finding.\n\nThanks for the pointer to #2086. I'll keep an eye on that and also look forward to others' feedback on this.\n", "Our position on `get_encodings_from_content` is very clear: we don't expect to use it automatically. Requests is a _HTTP_ library: we should not be reaching into body content without the user's say-so. We provide `get_encodings_from_content` as a helper function, but I would be strongly opposed to ever using it automatically.\n\nNote that your proposed `get_first_encoding_from_content` does not check which one occurs first, it _prioritises_ them. That's a very different thing to do.\n", "As for #2086, our position is unclear: I haven't been able to have a chat with Kenneth yet.\n", "> Our position on get_encodings_from_content is very clear: we don't expect to use it automatically. Requests is a HTTP library: we should not be reaching into body content without the user's say-so. We provide get_encodings_from_content as a helper function, but I would be strongly opposed to ever using it automatically.\n\nSorry if I didn't explain clearly? Not proposing using it automatically. Proposing a version that returns just the first match. If you're talking about #2205, then that's only using it from another utility function which is documented to do so, so not in some hidden and inappropriate way.\n\n> Note that your proposed get_first_encoding_from_content does not check which one occurs first, it prioritises them. That's a very different thing to do.\n\nThat's what I intended, sorry if I didn't explain it as clearly as I should have.\n", "Ok, sorry, I misunderstood the meaning of 'first'. I presumed that 'first' meant 'first to occur in the response', not first to occur in some other ordering. In that case I'm very much neutral on all of these changes. =)\n", "I don't have time to respond but wanted to respond to this:\n\n> I misunderstood the meaning of 'first'. I presumed that 'first' meant 'first to occur in the response', not first to occur in some other ordering.\n\nThis is how I understood \"first\" too.\n", "Yeah, saw that from the code example you gave, sorry again for not being clearer. Trying the regexes in an order prioritized by how commonly they occur and just returning the first match seems principled / reasonable enough, and better supports both users' and request.utils.get_unicode_from_response's use cases.\n", "> A typical solution is to compile them lazily (on first use) then, no? That way when you don't need to use the function you don't have to pay for it, and when you do, you're not punished for it on every call.\n\nYeah, I'm not adverse to a pattern like this:\n\n``` python\nXML_RE = None\n\ndef get_encodings_from_content(content):\n global XML_RE\n if XML_RE is None:\n XML_RE = re.compile('...')\n```\n\n> That said, out of curiosity I measured the performance impact [...] Did I measure wrong?\n\nYou didn't show us how you measured it.\n\n> At least, an additional get_first_encoding_from_content function could be offered to facilitate this use case.\n\nI'm not sure it's necessary though. I understand there are a lot of people using this just like you describe but I also found plenty of people using the entire list. \n\n> I'm not sure if you've gotten any requests for it to be the way it's currently written, but the way I'm proposing seems more efficient for the use cases I'm finding.\n\nI wouldn't be surprised if it were. That said, I'd like to reiterate @Lukasa's assertion that requests is fundamentally a HTTP library. I have not so quietly been an advocate of not having this in `requests.utils` at all. Further a function as you describe is something I don't feel comfortable including. If we include the first of the three that match, then someone will want to reorder the list of regular expressions we use. That will only lead to pain for @Lukasa and myself. The whole soup-y mess that consistently results in the `get_encodings_from_content` function is enough to make me want to push to remove it yet again.\n\nFew people can agree on how it should behave, and some of the decisions have been quite arbitrary.\n", "> Yeah, I'm not adverse to a pattern like this: [...]\n\nLGTM\n\n> You didn't show us how you measured it.\n\n`python -m timeit 'import foo'` where foo.py was blank vs. having the 3 compile calls.\n\n> I have not so quietly been an advocate of not having this in requests.utils at all. [...]\n> Few people can agree on how it should behave, and some of the decisions have been quite arbitrary.\n\nI'm new to this code / not privy to the history, so just offering feedback based on what I find there now. Doesn't seem crazy to me to keep this in given it's just a few lines and seems like it could provide useful, related, and fairly oft-needed functionality for library users who'd otherwise end up having to duplicate it but maybe not get it quite as right as requests could, but I of course defer to maintainers' better wisdom. If requests.utils is going to keep `get_unicode_from_response` and friends, it seems reasonable to make this change, but if you're going to get rid of them due to maintenance burden exceeding benefit, totally understandable.\n", "> I'm new to this code / not privy to the history, so just offering feedback based on what I find there now. \n\nI understand that. I'm not upset with you. This code is a hold over from before 1.0 and should have been excised then in my opinion. \n\n> if you're going to get rid of them due to maintenance burden exceeding benefit\n\nWe likely won't, but every so often issues like this pop up and the most frustrating part is that we can't easily accommodate everyone. We would love to maximize our users' happiness but we have to reject some ideas. For example, we can't just change what `get_encodings_from_content` returns. We could add `get_first_encoding_from_content` but that implementation would cause some level of inevitable debate about which would be the best way. Introducing more points of contention is exactly the last thing I want for requests.\n\n> python -m timeit 'import foo' where foo.py was blank vs. having the 3 compile calls.\n\nThat's not how I would measure it. I would move the compilation step out of the function in `requests.utils` and then `python -m timeit \"import requests\"`.\n", "> I would move the compilation step out of the function in requests.utils and then python -m timeit \"import requests\"\n\nDone. Moving the re.compile calls to module scope had no effect on import speed.\n\n```\n> python -m timeit 'import requests'\n1000000 loops, best of 3: 0.478 usec per loop\n> vim path/to/requests/utils.py # move compile calls to module scope\n> python -m timeit 'import requests'\n1000000 loops, best of 3: 0.478 usec per loop\n```\n\nI actually got literally the exact same time before and after.\n\nWould be interested to hear if you get different results. If not, if you want to make that change, cool, otherwise, feel free to close this as WONTFIX.\n", "My position here is basically a less negative version of @sigmavirus24's. I simple _don't care_ about these functions. They used to be used by requests pre-1.0 and aren't now, but we left them in because some people found them and used them. They aren't documented and the maintainers don't advertise them, but ordinarily they don't represent a maintenance cost to us.\n\nHowever, fundamentally, all of these functions are _trivial_ utilities. My recommendation is that, rather than change behaviour or add yet another function I'll studiously ignore, people should just copy the function out of `utils.py` and change it to do what they need it to do. It should take all of 10 seconds. =)\n", "I think we've come to the conclusion that we will not be fixing this then. @Lukasa are you okay with my closing this?\n", "Suits me. =)\n" ]
https://api.github.com/repos/psf/requests/issues/2205
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/2205/labels{/name}
https://api.github.com/repos/psf/requests/issues/2205/comments
https://api.github.com/repos/psf/requests/issues/2205/events
https://github.com/psf/requests/issues/2205
42,080,188
MDU6SXNzdWU0MjA4MDE4OA==
2,205
problems with get_unicode_from_response
{ "avatar_url": "https://avatars.githubusercontent.com/u/64992?v=4", "events_url": "https://api.github.com/users/jab/events{/privacy}", "followers_url": "https://api.github.com/users/jab/followers", "following_url": "https://api.github.com/users/jab/following{/other_user}", "gists_url": "https://api.github.com/users/jab/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/jab", "id": 64992, "login": "jab", "node_id": "MDQ6VXNlcjY0OTky", "organizations_url": "https://api.github.com/users/jab/orgs", "received_events_url": "https://api.github.com/users/jab/received_events", "repos_url": "https://api.github.com/users/jab/repos", "site_admin": false, "starred_url": "https://api.github.com/users/jab/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/jab/subscriptions", "type": "User", "url": "https://api.github.com/users/jab", "user_view_type": "public" }
[]
closed
true
null
[]
null
3
2014-09-05T19:19:29Z
2021-09-08T23:06:52Z
2014-12-07T18:56:04Z
NONE
resolved
It looks like there are some problems with the `get_unicode_from_response()` function from requests.utils. The docstring says: ``` Returns the requested content back in unicode. :param r: Response object to get unicode content from. Tried: 1. charset from content-type 2. every encodings from ``<meta ... charset=XXX>`` 3. fall back and replace all unicode characters ``` but here is the code: ``` python def get_unicode_from_response(): tried_encodings = [] # Try charset from content-type encoding = get_encoding_from_headers(r.headers) if encoding: try: return str(r.content, encoding) except UnicodeError: tried_encodings.append(encoding) # Fall back: try: return str(r.content, encoding, errors='replace') except TypeError: return r.content ``` Step 1 and step 3 of the docstring are there, but it looks like step 2 is missing. It looks like the intention was to call `get_encodings_from_content` if the result of `get_encoding_from_headers` didn't pan out, but it's not actually doing that. A more minor issue is the `tried_encodings` list doesn't appear to be serving any benefit, so I'm not sure it's worth its memory / GC cost. Please advise if you'd accept a pull request or have feedback otherwise. Thanks! P.S. In researching this issue I noticed that a tag for v2.4.0 is missing: https://github.com/kennethreitz/requests/tags Here is a reference to this code in the most recent tag available: https://github.com/kennethreitz/requests/blob/v2.3.0/requests/utils.py#L346..L376
{ "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/2205/reactions" }
https://api.github.com/repos/psf/requests/issues/2205/timeline
null
completed
null
null
false
[ "> Step 1 and step 3 of the docstring are there, but it looks like step 2 is missing.\n\nGood catch.\n\n> A more minor issue is the tried_encodings list doesn't appear to be serving any benefit, so I'm not sure it's worth its memory / GC cost.\n\nYou're right that it's unnecessary, but it's not incurring any great amount of memory or going to cause a big GC issue (unless you're doing millions of requests an hour or something really incredible, in which case GC is likely the least of your concerns).\n\n> P.S. In researching this issue I noticed that a tag for v2.4.0 is missing: https://github.com/kennethreitz/requests/tags\n\nThat's already tracked in #2190. Thanks, though\n", "Looks like it's time to close this issue.\n", "Good catch @ibnIrshad \n" ]
https://api.github.com/repos/psf/requests/issues/2204
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/2204/labels{/name}
https://api.github.com/repos/psf/requests/issues/2204/comments
https://api.github.com/repos/psf/requests/issues/2204/events
https://github.com/psf/requests/issues/2204
41,973,348
MDU6SXNzdWU0MTk3MzM0OA==
2,204
2.4.0 request refused raises different exception (breaking change)
{ "avatar_url": "https://avatars.githubusercontent.com/u/450860?v=4", "events_url": "https://api.github.com/users/ThisGuyCodes/events{/privacy}", "followers_url": "https://api.github.com/users/ThisGuyCodes/followers", "following_url": "https://api.github.com/users/ThisGuyCodes/following{/other_user}", "gists_url": "https://api.github.com/users/ThisGuyCodes/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/ThisGuyCodes", "id": 450860, "login": "ThisGuyCodes", "node_id": "MDQ6VXNlcjQ1MDg2MA==", "organizations_url": "https://api.github.com/users/ThisGuyCodes/orgs", "received_events_url": "https://api.github.com/users/ThisGuyCodes/received_events", "repos_url": "https://api.github.com/users/ThisGuyCodes/repos", "site_admin": false, "starred_url": "https://api.github.com/users/ThisGuyCodes/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/ThisGuyCodes/subscriptions", "type": "User", "url": "https://api.github.com/users/ThisGuyCodes", "user_view_type": "public" }
[]
closed
true
null
[]
null
6
2014-09-04T19:04:22Z
2021-09-08T23:08:03Z
2014-09-04T19:22:52Z
NONE
resolved
(related: #2190) in 2.3.0 the following code worked: ``` python server_is_down = True while server_is_down: try: requests.get(somehost) except requests.ConnectionError: sleep(0.1) continue server_is_down = False ``` in 2.4.0 this instead raises some urllib3 error: `ProtocolError: ('Connection aborted.', error(111, 'Connection refused'))` this may just be another instance of #1572
{ "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/2204/reactions" }
https://api.github.com/repos/psf/requests/issues/2204/timeline
null
completed
null
null
false
[ "Why the hell isn't this wrapped? It looks like it should have raised a MaxRetryError which we'd have wrapped, but it just doesn't. Odd.\n", "@kevinburke Did retry logic change to not raise MaxRetryErrors when `retries=0`?\n", "@Lukasa `retries=False` does not raise `MaxRetryError`s, not sure if the same is true for `retries=0`.\n", "I'm pretty sure this is new: we used to get MaxRetryErrors in our default case. That's going to break a lot of our logic because we don't catch urllib3 HTTPErrors. We probably should treat them like MaxRetryErrors.\n", "@Lukasa I think this is fixed in #2193 since this is very related to #2192.\n", "I actually think this is exactly fixed by #2193. =P \n" ]
https://api.github.com/repos/psf/requests/issues/2203
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/2203/labels{/name}
https://api.github.com/repos/psf/requests/issues/2203/comments
https://api.github.com/repos/psf/requests/issues/2203/events
https://github.com/psf/requests/pull/2203
41,970,663
MDExOlB1bGxSZXF1ZXN0MjA3NjM3OTk=
2,203
Remove hard certifi dependency and document.
{ "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
6
2014-09-04T18:41:19Z
2021-09-08T10:01:23Z
2014-09-05T15:11:57Z
MEMBER
resolved
As discussed in #2124.
{ "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/2203/reactions" }
https://api.github.com/repos/psf/requests/issues/2203/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/2203.diff", "html_url": "https://github.com/psf/requests/pull/2203", "merged_at": "2014-09-05T15:11:57Z", "patch_url": "https://github.com/psf/requests/pull/2203.patch", "url": "https://api.github.com/repos/psf/requests/pulls/2203" }
true
[ "@kevinburke Done. =)\n", "Perhaps a separate extra for certifi? `pip install requests[with_certifi]`\n", "beautiful\n", "`requests[certs]`\n", "meh, let's just include it in the existing security one\n", "all 'o nothin'!\n" ]
https://api.github.com/repos/psf/requests/issues/2202
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/2202/labels{/name}
https://api.github.com/repos/psf/requests/issues/2202/comments
https://api.github.com/repos/psf/requests/issues/2202/events
https://github.com/psf/requests/issues/2202
41,946,311
MDU6SXNzdWU0MTk0NjMxMQ==
2,202
HISTORY.rst contains character unprocessable by ascii library
{ "avatar_url": "https://avatars.githubusercontent.com/u/3494636?v=4", "events_url": "https://api.github.com/users/broink/events{/privacy}", "followers_url": "https://api.github.com/users/broink/followers", "following_url": "https://api.github.com/users/broink/following{/other_user}", "gists_url": "https://api.github.com/users/broink/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/broink", "id": 3494636, "login": "broink", "node_id": "MDQ6VXNlcjM0OTQ2MzY=", "organizations_url": "https://api.github.com/users/broink/orgs", "received_events_url": "https://api.github.com/users/broink/received_events", "repos_url": "https://api.github.com/users/broink/repos", "site_admin": false, "starred_url": "https://api.github.com/users/broink/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/broink/subscriptions", "type": "User", "url": "https://api.github.com/users/broink", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2014-09-04T14:56:16Z
2021-09-08T23:10:36Z
2014-09-04T14:59:17Z
NONE
resolved
Hi Tried to install today, and got an ascii error on illegal character in HISTORY.rst. Traceback (most recent call last): File "setup.py", line 33, in <module> history = f.read() File "/usr/lib/python3.4/encodings/ascii.py", line 26, in decode return codecs.ascii_decode(input, self.errors)[0] UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 472: ordinal not in range(128) Turns out it is the line just before 'Session.merge_enfiroment_settings' under 2.4.0 (2014-08-29). It is not a normal "-" but some other kind of horizontal line. Creating an empty HISTORY.rst solves the problem.
{ "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/2202/reactions" }
https://api.github.com/repos/psf/requests/issues/2202/timeline
null
completed
null
null
false
[ "Thanks for this! It's a known issue, and will be fixed by #2199.\n" ]
https://api.github.com/repos/psf/requests/issues/2201
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/2201/labels{/name}
https://api.github.com/repos/psf/requests/issues/2201/comments
https://api.github.com/repos/psf/requests/issues/2201/events
https://github.com/psf/requests/issues/2201
41,875,098
MDU6SXNzdWU0MTg3NTA5OA==
2,201
WARNING - [Errno 1] _ssl.c:504: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
{ "avatar_url": "https://avatars.githubusercontent.com/u/519545?v=4", "events_url": "https://api.github.com/users/stantonk/events{/privacy}", "followers_url": "https://api.github.com/users/stantonk/followers", "following_url": "https://api.github.com/users/stantonk/following{/other_user}", "gists_url": "https://api.github.com/users/stantonk/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/stantonk", "id": 519545, "login": "stantonk", "node_id": "MDQ6VXNlcjUxOTU0NQ==", "organizations_url": "https://api.github.com/users/stantonk/orgs", "received_events_url": "https://api.github.com/users/stantonk/received_events", "repos_url": "https://api.github.com/users/stantonk/repos", "site_admin": false, "starred_url": "https://api.github.com/users/stantonk/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/stantonk/subscriptions", "type": "User", "url": "https://api.github.com/users/stantonk", "user_view_type": "public" }
[]
closed
true
null
[]
null
13
2014-09-03T22:22:58Z
2014-11-26T04:25:24Z
2014-09-05T18:02:44Z
NONE
null
As of August 30, 2014, seeing this error on every request. Server is Ubuntu 12.04: ``` $ cat /etc/*-release DISTRIB_ID=Ubuntu DISTRIB_RELEASE=12.04 DISTRIB_CODENAME=precise DISTRIB_DESCRIPTION="Ubuntu 12.04.5 LTS" NAME="Ubuntu" VERSION="12.04.5 LTS, Precise Pangolin" ID=ubuntu ID_LIKE=debian PRETTY_NAME="Ubuntu precise (12.04.5 LTS)" VERSION_ID="12.04" ``` Running requests 2.0.1. Tried upgrading to 2.1.0 as I saw CA Bundle was updated then, to no avail. ``` >>> import requests >>> requests.__version__ '2.1.0' ```
{ "avatar_url": "https://avatars.githubusercontent.com/u/519545?v=4", "events_url": "https://api.github.com/users/stantonk/events{/privacy}", "followers_url": "https://api.github.com/users/stantonk/followers", "following_url": "https://api.github.com/users/stantonk/following{/other_user}", "gists_url": "https://api.github.com/users/stantonk/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/stantonk", "id": 519545, "login": "stantonk", "node_id": "MDQ6VXNlcjUxOTU0NQ==", "organizations_url": "https://api.github.com/users/stantonk/orgs", "received_events_url": "https://api.github.com/users/stantonk/received_events", "repos_url": "https://api.github.com/users/stantonk/repos", "site_admin": false, "starred_url": "https://api.github.com/users/stantonk/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/stantonk/subscriptions", "type": "User", "url": "https://api.github.com/users/stantonk", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/2201/reactions" }
https://api.github.com/repos/psf/requests/issues/2201/timeline
null
completed
null
null
false
[ "Is it safe to assume that you're using `apt` to install requests? If so, I'm not sure they will continue to vendor the `cacert.pem` file like we do. So it could be that they force the default to be the system store. I'll fire up a virtual machine soon to check on this.\n\nFor the record, the latest version is 2.4.0.\n", "I answered my own question. It seems that the default ubuntu repositories ship v0.8.2 as python-requests. I installed 2.0.1 with pip on 12.04 and 2.1.0 and I'm not seeing any errors. Can you provide the URLs you're trying to use as well as any information about proxies that you may be using?\n", "This is almost certainly because you're using the system trust store, not ours.\n\nYou can test it by installing the `certifi` package and then running `r = requests.get(your_url, verify=certifi.where()`.\n", "No, we're installing requests via pip in a virtualenv.\n", "Obligatory question whether the system time is correct.\n", "@Lukasa still doesn't work:\n\n```\nPython 2.7.3 (default, Sep 26 2013, 20:03:06)\n[GCC 4.6.3] on linux2\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\n>>> import requests\n>>> requests.__version__\n'2.1.0'\n>>> requests.get('https://graph.facebook.com/spotify')\nTraceback (most recent call last):\n File \"<stdin>\", line 1, in <module>\n File \"/data/app/local/lib/python2.7/site-packages/requests/api.py\", line 55, in get\n return request('get', url, **kwargs)\n File \"/data/app/local/lib/python2.7/site-packages/requests/api.py\", line 44, in request\n return session.request(method=method, url=url, **kwargs)\n File \"/data/app/local/lib/python2.7/site-packages/requests/sessions.py\", line 382, in request\n resp = self.send(prep, **send_kwargs)\n File \"/data/app/local/lib/python2.7/site-packages/requests/sessions.py\", line 485, in send\n r = adapter.send(request, **kwargs)\n File \"/data/app/local/lib/python2.7/site-packages/requests/adapters.py\", line 379, in send\n raise SSLError(e)\nrequests.exceptions.SSLError: [Errno 1] _ssl.c:504: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed\n>>> import certifi\n>>> certifi.__version__\nTraceback (most recent call last):\n File \"<stdin>\", line 1, in <module>\nAttributeError: 'module' object has no attribute '__version__'\n>>> requests.get('https://graph.facebook.com/spotify', verify=certifi.where())\nTraceback (most recent call last):\n File \"<stdin>\", line 1, in <module>\n File \"/data/app/local/lib/python2.7/site-packages/requests/api.py\", line 55, in get\n return request('get', url, **kwargs)\n File \"/data/app/local/lib/python2.7/site-packages/requests/api.py\", line 44, in request\n return session.request(method=method, url=url, **kwargs)\n File \"/data/app/local/lib/python2.7/site-packages/requests/sessions.py\", line 382, in request\n resp = self.send(prep, **send_kwargs)\n File \"/data/app/local/lib/python2.7/site-packages/requests/sessions.py\", line 485, in send\n r = adapter.send(request, **kwargs)\n File \"/data/app/local/lib/python2.7/site-packages/requests/adapters.py\", line 379, in send\n raise SSLError(e)\nrequests.exceptions.SSLError: [Errno 1] _ssl.c:504: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed\n```\n", "@t-8ch system time is correct.\n\nOddly, requests made with the oauth2 lib works when I use certify:\n\n```\nimport oauth2 as oauth\nimport certifi\n...\nclient = oauth.Client(self._consumer, token)\nclient.ca_certs = certifi.where()\n```\n", "Requests 2.1.0 likely has an older copy of the trust store. Try this:\n\n``` python\nimport requests\nimport certifi\n\nr = requests.get('https://graph.facebook.com/spotify', verify=certifi.where())\n```\n", "The openssl s_client command gives way better error messages than the ssl module\n\n``` sh\nopenssl s_client -connect graph.facebook.com:443 -CAfile $(python -m certifi)\n```\n", "@Lukasa i did try it with cerifi above, it still fails\n\n```\n>>> import certifi\n>>> requests.get('https://graph.facebook.com/spotify', verify=certifi.where())\n\nTraceback (most recent call last):\n File \"<stdin>\", line 1, in <module>\n File \"/data/app/local/lib/python2.7/site-packages/requests/api.py\", line 55, in get\n return request('get', url, **kwargs)\n File \"/data/app/local/lib/python2.7/site-packages/requests/api.py\", line 44, in request\n return session.request(method=method, url=url, **kwargs)\n File \"/data/app/local/lib/python2.7/site-packages/requests/sessions.py\", line 382, in request\n resp = self.send(prep, **send_kwargs)\n File \"/data/app/local/lib/python2.7/site-packages/requests/sessions.py\", line 485, in send\n r = adapter.send(request, **kwargs)\n File \"/data/app/local/lib/python2.7/site-packages/requests/adapters.py\", line 379, in send\n raise SSLError(e)\nrequests.exceptions.SSLError: [Errno 1] _ssl.c:504: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed\n```\n", "@t-8ch NICE! That exposed the issue. The problem is that we were statically routing in /etc/hosts through an Nginx proxy with a self-signed cert :) Closing as this is not a requests issue.\n\nThanks for all your help guys!\n", "@stantonk Hi, how did you solve the issue specifically. I've ran into the same particular issue. I'm using a self signed certificate served via gunicorn\n", "This is not the place to discuss non-requests related problems. Please take your conversation to email.\n" ]
https://api.github.com/repos/psf/requests/issues/2200
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/2200/labels{/name}
https://api.github.com/repos/psf/requests/issues/2200/comments
https://api.github.com/repos/psf/requests/issues/2200/events
https://github.com/psf/requests/issues/2200
41,800,365
MDU6SXNzdWU0MTgwMDM2NQ==
2,200
urllib3 ProtocolError exception not caught
{ "avatar_url": "https://avatars.githubusercontent.com/u/305104?v=4", "events_url": "https://api.github.com/users/joneskoo/events{/privacy}", "followers_url": "https://api.github.com/users/joneskoo/followers", "following_url": "https://api.github.com/users/joneskoo/following{/other_user}", "gists_url": "https://api.github.com/users/joneskoo/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/joneskoo", "id": 305104, "login": "joneskoo", "node_id": "MDQ6VXNlcjMwNTEwNA==", "organizations_url": "https://api.github.com/users/joneskoo/orgs", "received_events_url": "https://api.github.com/users/joneskoo/received_events", "repos_url": "https://api.github.com/users/joneskoo/repos", "site_admin": false, "starred_url": "https://api.github.com/users/joneskoo/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/joneskoo/subscriptions", "type": "User", "url": "https://api.github.com/users/joneskoo", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2014-09-03T10:06:40Z
2021-09-08T23:10:37Z
2014-09-03T10:13:14Z
NONE
resolved
On the topic of requests not mapping exceptions to its own exceptions... `requests.packages.urllib3.exceptions.ProtocolError` is not caught. Reproduction: invalid status line. Server: `$ echo | nc -l 8000` requests: ``` import requests try: requests.get('http://localhost:8000') except Exception as e: print (e.__class__) ``` Output: <class 'requests.packages.urllib3.exceptions.ProtocolError'> I would expect this to be mapped to a requests exception. Connection refused comes out also as ProtocolError. This is requests 2.4.0. Ping @Lukasa , @sigmavirus24 Also happens with connection refused. This should be covered by requests unittests in the future. ``` Traceback (most recent call last): File "/Users/joneskoo/git/requests/ve/lib/python3.4/site-packages/requests/packages/urllib3/connectionpool.py", line 516, in urlopen body=body, headers=headers) File "/Users/joneskoo/git/requests/ve/lib/python3.4/site-packages/requests/packages/urllib3/connectionpool.py", line 308, in _make_request conn.request(method, url, **httplib_request_kw) File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/http/client.py", line 1090, in request self._send_request(method, url, body, headers) File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/http/client.py", line 1128, in _send_request self.endheaders(body) File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/http/client.py", line 1086, in endheaders self._send_output(message_body) File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/http/client.py", line 924, in _send_output self.send(msg) File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/http/client.py", line 859, in send self.connect() File "/Users/joneskoo/git/requests/ve/lib/python3.4/site-packages/requests/packages/urllib3/connection.py", line 154, in connect conn = self._new_conn() File "/Users/joneskoo/git/requests/ve/lib/python3.4/site-packages/requests/packages/urllib3/connection.py", line 133, in _new_conn (self.host, self.port), self.timeout, **extra_kw) File "/Users/joneskoo/git/requests/ve/lib/python3.4/site-packages/requests/packages/urllib3/util/connection.py", line 87, in create_connection raise err File "/Users/joneskoo/git/requests/ve/lib/python3.4/site-packages/requests/packages/urllib3/util/connection.py", line 78, in create_connection sock.connect(sa) ConnectionRefusedError: [Errno 61] Connection refused During handling of the above exception, another exception occurred: Traceback (most recent call last): File "<ipython-input-14-1e96a12a07a3>", line 1, in <module> try: requests.get('http://localhost:8000') File "/Users/joneskoo/git/requests/ve/lib/python3.4/site-packages/requests/api.py", line 55, in get return request('get', url, **kwargs) File "/Users/joneskoo/git/requests/ve/lib/python3.4/site-packages/requests/api.py", line 44, in request return session.request(method=method, url=url, **kwargs) File "/Users/joneskoo/git/requests/ve/lib/python3.4/site-packages/requests/sessions.py", line 448, in request resp = self.send(prep, **send_kwargs) File "/Users/joneskoo/git/requests/ve/lib/python3.4/site-packages/requests/sessions.py", line 554, in send r = adapter.send(request, **kwargs) File "/Users/joneskoo/git/requests/ve/lib/python3.4/site-packages/requests/adapters.py", line 359, in send timeout=timeout File "/Users/joneskoo/git/requests/ve/lib/python3.4/site-packages/requests/packages/urllib3/connectionpool.py", line 559, in urlopen _pool=self, _stacktrace=stacktrace) File "/Users/joneskoo/git/requests/ve/lib/python3.4/site-packages/requests/packages/urllib3/util/retry.py", line 245, in increment raise six.reraise(type(error), error, _stacktrace) File "/Users/joneskoo/git/requests/ve/lib/python3.4/site-packages/requests/packages/urllib3/packages/six.py", line 309, in reraise raise value.with_traceback(tb) File "/Users/joneskoo/git/requests/ve/lib/python3.4/site-packages/requests/packages/urllib3/connectionpool.py", line 516, in urlopen body=body, headers=headers) File "/Users/joneskoo/git/requests/ve/lib/python3.4/site-packages/requests/packages/urllib3/connectionpool.py", line 308, in _make_request conn.request(method, url, **httplib_request_kw) File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/http/client.py", line 1090, in request self._send_request(method, url, body, headers) File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/http/client.py", line 1128, in _send_request self.endheaders(body) File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/http/client.py", line 1086, in endheaders self._send_output(message_body) File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/http/client.py", line 924, in _send_output self.send(msg) File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/http/client.py", line 859, in send self.connect() File "/Users/joneskoo/git/requests/ve/lib/python3.4/site-packages/requests/packages/urllib3/connection.py", line 154, in connect conn = self._new_conn() File "/Users/joneskoo/git/requests/ve/lib/python3.4/site-packages/requests/packages/urllib3/connection.py", line 133, in _new_conn (self.host, self.port), self.timeout, **extra_kw) File "/Users/joneskoo/git/requests/ve/lib/python3.4/site-packages/requests/packages/urllib3/util/connection.py", line 87, in create_connection raise err File "/Users/joneskoo/git/requests/ve/lib/python3.4/site-packages/requests/packages/urllib3/util/connection.py", line 78, in create_connection sock.connect(sa) requests.packages.urllib3.exceptions.ProtocolError: ('Connection aborted.', ConnectionRefusedError(61, 'Connection refused')) ```
{ "avatar_url": "https://avatars.githubusercontent.com/u/305104?v=4", "events_url": "https://api.github.com/users/joneskoo/events{/privacy}", "followers_url": "https://api.github.com/users/joneskoo/followers", "following_url": "https://api.github.com/users/joneskoo/following{/other_user}", "gists_url": "https://api.github.com/users/joneskoo/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/joneskoo", "id": 305104, "login": "joneskoo", "node_id": "MDQ6VXNlcjMwNTEwNA==", "organizations_url": "https://api.github.com/users/joneskoo/orgs", "received_events_url": "https://api.github.com/users/joneskoo/received_events", "repos_url": "https://api.github.com/users/joneskoo/repos", "site_admin": false, "starred_url": "https://api.github.com/users/joneskoo/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/joneskoo/subscriptions", "type": "User", "url": "https://api.github.com/users/joneskoo", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/2200/reactions" }
https://api.github.com/repos/psf/requests/issues/2200/timeline
null
completed
null
null
false
[ "Sorry, missed #2192 . Duplicate.\n" ]
https://api.github.com/repos/psf/requests/issues/2199
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/2199/labels{/name}
https://api.github.com/repos/psf/requests/issues/2199/comments
https://api.github.com/repos/psf/requests/issues/2199/events
https://github.com/psf/requests/pull/2199
41,789,547
MDExOlB1bGxSZXF1ZXN0MjA2NjAyNjU=
2,199
Open README and HISTORY as utf-8 encoded files (fixes #2196)
{ "avatar_url": "https://avatars.githubusercontent.com/u/51503?v=4", "events_url": "https://api.github.com/users/mtorromeo/events{/privacy}", "followers_url": "https://api.github.com/users/mtorromeo/followers", "following_url": "https://api.github.com/users/mtorromeo/following{/other_user}", "gists_url": "https://api.github.com/users/mtorromeo/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/mtorromeo", "id": 51503, "login": "mtorromeo", "node_id": "MDQ6VXNlcjUxNTAz", "organizations_url": "https://api.github.com/users/mtorromeo/orgs", "received_events_url": "https://api.github.com/users/mtorromeo/received_events", "repos_url": "https://api.github.com/users/mtorromeo/repos", "site_admin": false, "starred_url": "https://api.github.com/users/mtorromeo/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/mtorromeo/subscriptions", "type": "User", "url": "https://api.github.com/users/mtorromeo", "user_view_type": "public" }
[ { "color": "009800", "default": false, "description": null, "id": 44501218, "name": "Ready To Merge", "node_id": "MDU6TGFiZWw0NDUwMTIxOA==", "url": "https://api.github.com/repos/psf/requests/labels/Ready%20To%20Merge" }, { "color": "207de5", "default": false, "description": null, "id": 60620163, "name": "Minion Seal of Approval", "node_id": "MDU6TGFiZWw2MDYyMDE2Mw==", "url": "https://api.github.com/repos/psf/requests/labels/Minion%20Seal%20of%20Approval" } ]
closed
true
null
[]
null
4
2014-09-03T07:42:02Z
2021-09-08T10:01:24Z
2014-09-04T18:41:46Z
CONTRIBUTOR
resolved
This is a fix for #2196 where if you tried running setup.py with some LANG it would throws an exception when reading HISTORY with non-ascii characters. Try it with ``` LANG=C python setup.py ```
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/2199/reactions" }
https://api.github.com/repos/psf/requests/issues/2199/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/2199.diff", "html_url": "https://github.com/psf/requests/pull/2199", "merged_at": "2014-09-04T18:41:46Z", "patch_url": "https://github.com/psf/requests/pull/2199.patch", "url": "https://api.github.com/repos/psf/requests/pulls/2199" }
true
[ "The build broke but that's pypy specific and unrelated to this change\n\nLGTM! :cake:\n", "Are you sure the upload to PyPI won't fail?\n", "@sigmavirus24 Why do we think it might?\n", "Nevermind, I asked @r1chardj0n3s and he assuaged my concerns.\n" ]
https://api.github.com/repos/psf/requests/issues/2198
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/2198/labels{/name}
https://api.github.com/repos/psf/requests/issues/2198/comments
https://api.github.com/repos/psf/requests/issues/2198/events
https://github.com/psf/requests/issues/2198
41,691,956
MDU6SXNzdWU0MTY5MTk1Ng==
2,198
requests.exceptions.SSLError: EOF occurred in violation of protocol (_ssl.c:598)
{ "avatar_url": "https://avatars.githubusercontent.com/u/8625986?v=4", "events_url": "https://api.github.com/users/gdparker/events{/privacy}", "followers_url": "https://api.github.com/users/gdparker/followers", "following_url": "https://api.github.com/users/gdparker/following{/other_user}", "gists_url": "https://api.github.com/users/gdparker/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/gdparker", "id": 8625986, "login": "gdparker", "node_id": "MDQ6VXNlcjg2MjU5ODY=", "organizations_url": "https://api.github.com/users/gdparker/orgs", "received_events_url": "https://api.github.com/users/gdparker/received_events", "repos_url": "https://api.github.com/users/gdparker/repos", "site_admin": false, "starred_url": "https://api.github.com/users/gdparker/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/gdparker/subscriptions", "type": "User", "url": "https://api.github.com/users/gdparker", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2014-09-02T09:45:52Z
2021-09-08T23:10:37Z
2014-09-02T14:08:39Z
NONE
resolved
Hi there! When i'm trying to execute the code: ``` python import requests requests.get('https://www.atarisupport.com/') ``` i get the error: ``` bash Traceback (most recent call last): File "C:\Python34\lib\site-packages\requests\packages\urllib3\connectionpool.py", line 516, in urlopen body=body, headers=headers) File "C:\Python34\lib\site-packages\requests\packages\urllib3\connectionpool.py", line 304, in _make_request self._validate_conn(conn) File "C:\Python34\lib\site-packages\requests\packages\urllib3\connectionpool.py", line 722, in _validate_conn conn.connect() File "C:\Python34\lib\site-packages\requests\packages\urllib3\connection.py", line 229, in connect ssl_version=resolved_ssl_version) File "C:\Python34\lib\site-packages\requests\packages\urllib3\util\ssl_.py", line 123, in ssl_wrap_socket return context.wrap_socket(sock, server_hostname=server_hostname) File "C:\Python34\lib\ssl.py", line 364, in wrap_socket _context=self) File "C:\Python34\lib\ssl.py", line 578, in __init__ self.do_handshake() File "C:\Python34\lib\ssl.py", line 805, in do_handshake self._sslobj.do_handshake() ssl.SSLEOFError: EOF occurred in violation of protocol (_ssl.c:598) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "C:\Python34\lib\site-packages\requests\adapters.py", line 359, in send timeout=timeout File "C:\Python34\lib\site-packages\requests\packages\urllib3\connectionpool.py", line 543, in urlopen raise SSLError(e) requests.packages.urllib3.exceptions.SSLError: EOF occurred in violation of protocol (_ssl.c:598) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "<stdin>", line 1, in <module> File "C:\Python34\lib\site-packages\requests\api.py", line 55, in get return request('get', url, **kwargs) File "C:\Python34\lib\site-packages\requests\api.py", line 44, in request return session.request(method=method, url=url, **kwargs) File "C:\Python34\lib\site-packages\requests\sessions.py", line 448, in request resp = self.send(prep, **send_kwargs) File "C:\Python34\lib\site-packages\requests\sessions.py", line 554, in send r = adapter.send(request, **kwargs) File "C:\Python34\lib\site-packages\requests\adapters.py", line 417, in send raise SSLError(e, request=request) requests.exceptions.SSLError: EOF occurred in violation of protocol (_ssl.c:598) ``` Any suggestions?
{ "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/2198/reactions" }
https://api.github.com/repos/psf/requests/issues/2198/timeline
null
completed
null
null
false
[ "So if you do\n\n```\n$ openssl s_client -connect atarisupport.com:443\n```\n\nThe command will hang, I suspect this is strongly related to the SSLError.\n", "`atarisupport.com` does not respond to the SSL client hello. We emit the first portion of the SSL handshake, and in return the remote website sends us an immediate TCP FIN and tears the connection down.\n\nIf you use the [SSLAdapter](http://toolbelt.readthedocs.org/en/latest/user.html#ssladapter) from the requests toolbelt and force the handshake to TLSv1, we are able to establish the connection. Looks like a buggy upstream server to me. =)\n" ]
https://api.github.com/repos/psf/requests/issues/2197
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/2197/labels{/name}
https://api.github.com/repos/psf/requests/issues/2197/comments
https://api.github.com/repos/psf/requests/issues/2197/events
https://github.com/psf/requests/pull/2197
41,607,725
MDExOlB1bGxSZXF1ZXN0MjA1NTUzNzQ=
2,197
Replaces offending character in HISTORY.rst with dash.
{ "avatar_url": "https://avatars.githubusercontent.com/u/3847427?v=4", "events_url": "https://api.github.com/users/whereskenneth/events{/privacy}", "followers_url": "https://api.github.com/users/whereskenneth/followers", "following_url": "https://api.github.com/users/whereskenneth/following{/other_user}", "gists_url": "https://api.github.com/users/whereskenneth/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/whereskenneth", "id": 3847427, "login": "whereskenneth", "node_id": "MDQ6VXNlcjM4NDc0Mjc=", "organizations_url": "https://api.github.com/users/whereskenneth/orgs", "received_events_url": "https://api.github.com/users/whereskenneth/received_events", "repos_url": "https://api.github.com/users/whereskenneth/repos", "site_admin": false, "starred_url": "https://api.github.com/users/whereskenneth/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/whereskenneth/subscriptions", "type": "User", "url": "https://api.github.com/users/whereskenneth", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2014-09-01T05:30:06Z
2021-09-08T11:00:45Z
2014-09-03T09:30:05Z
NONE
resolved
Replaces em dash in HISTORY.rst with ascii dash.
{ "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/2197/reactions" }
https://api.github.com/repos/psf/requests/issues/2197/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/2197.diff", "html_url": "https://github.com/psf/requests/pull/2197", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/2197.patch", "url": "https://api.github.com/repos/psf/requests/pulls/2197" }
true
[ "#2199 is the preferred approach here I think. :cake:\n\nThanks for this though!\n" ]
https://api.github.com/repos/psf/requests/issues/2196
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/2196/labels{/name}
https://api.github.com/repos/psf/requests/issues/2196/comments
https://api.github.com/repos/psf/requests/issues/2196/events
https://github.com/psf/requests/issues/2196
41,607,465
MDU6SXNzdWU0MTYwNzQ2NQ==
2,196
UnicodeDecodeError when reading HISTORY.rst (v2.4.0)
{ "avatar_url": "https://avatars.githubusercontent.com/u/3847427?v=4", "events_url": "https://api.github.com/users/whereskenneth/events{/privacy}", "followers_url": "https://api.github.com/users/whereskenneth/followers", "following_url": "https://api.github.com/users/whereskenneth/following{/other_user}", "gists_url": "https://api.github.com/users/whereskenneth/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/whereskenneth", "id": 3847427, "login": "whereskenneth", "node_id": "MDQ6VXNlcjM4NDc0Mjc=", "organizations_url": "https://api.github.com/users/whereskenneth/orgs", "received_events_url": "https://api.github.com/users/whereskenneth/received_events", "repos_url": "https://api.github.com/users/whereskenneth/repos", "site_admin": false, "starred_url": "https://api.github.com/users/whereskenneth/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/whereskenneth/subscriptions", "type": "User", "url": "https://api.github.com/users/whereskenneth", "user_view_type": "public" }
[]
closed
true
null
[]
null
3
2014-09-01T05:21:31Z
2021-09-08T23:10:36Z
2014-09-04T18:41:47Z
NONE
resolved
Whe installing requests-2.4.0 using pip in python3.4, line 32-33 in setup.py ``` with open('HISTORY.rst') as f: history = f.read() ``` is throwing a UnicodeDecodeError caused by the elongated dash on line 18 of HISTORY.rst Offending line in HISTORY.rst ``` $ head -18 HISTORY.rst | tail -1 - Refactored settings loading from environment ��� new `Session.merge_environment_settings`. ``` Output from running the setup directly: ``` $ python setup.py install Traceback (most recent call last): File "setup.py", line 33, in <module> history = f.read() File "/usr/lib/python3.4/encodings/ascii.py", line 26, in decode return codecs.ascii_decode(input, self.errors)[0] UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 472: ordinal not in range(128) ```
{ "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/2196/reactions" }
https://api.github.com/repos/psf/requests/issues/2196/timeline
null
completed
null
null
false
[ "Thanks! The fix you've proposed in #2197 will definitely work, but I briefly wonder whether we shouldn't try to fix the underlying problem instead. We may want to be able to use non-ascii characters in future.\n", "Sounds good. I'll use 2.3.0 for the time being. Feel free to close the pr if you decide to go another route.\n", "Thanks for reporting this @whereskenneth \n" ]
https://api.github.com/repos/psf/requests/issues/2195
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/2195/labels{/name}
https://api.github.com/repos/psf/requests/issues/2195/comments
https://api.github.com/repos/psf/requests/issues/2195/events
https://github.com/psf/requests/pull/2195
41,541,903
MDExOlB1bGxSZXF1ZXN0MjA1MjQ5MzI=
2,195
Add betterssl extra
{ "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
15
2014-08-29T21:39:35Z
2021-09-08T10:01:23Z
2014-09-04T18:36:56Z
CONTRIBUTOR
resolved
Fixes #1995
{ "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/2195/reactions" }
https://api.github.com/repos/psf/requests/issues/2195/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/2195.diff", "html_url": "https://github.com/psf/requests/pull/2195", "merged_at": "2014-09-04T18:36:56Z", "patch_url": "https://github.com/psf/requests/pull/2195.patch", "url": "https://api.github.com/repos/psf/requests/pulls/2195" }
true
[ "+1\n", "Could we use another name which doesn't sound like it will solve all problems?\n", "So, I'm going to raise a question!\n\nI was the one who opened the original ticket, but I wonder if it makes sense to do this anymore. On Python 3.4+ and Python 2.7.9+ it's not better anymore. On Python 3.2 and 3.3 it's better, but not in ways that couldn't be reproduced without extra dependencies.\n\nEither way, this PR looks good to me, the only question is if we still need/want it just for Python 2.6 and Python <=2.7.8.\n", "I don't think it will hurt to have it for 2.6 or <= 2.7.8.\n", "I agree that it won't hurt us to have, but I agree with @t-8ch that we should avoid the slightly prejudicial name. Maybe just call it `pyopenssl`?\n", "I really have no opinion on the name. I would think `with_sni` (i.e., `pip install requests[with_sni]` reads well) would be most descriptive of the use case for the largest number of users, but `pyopenssl` is fine too. I'll wait for @kennethreitz to decide.\n", "I'd rather give it a more generic/rememberable name. \n\n`security`\n", "Updated to `security`. Now, let's document it!\n", "I fear this generic and positive name will lead to people enabling it that don't need it. Triggering compilation of pyopenssl, breakage when missing development tools etc. And on Python3 it will be ignored anyways. \n", "@t-8ch false\n", "urllib3 uses ndg-httpsclient. Importing this on py3 will raise a syntax error\nand abort the import -> PyOpenSSL is not used.\nIn requests < 2.4.0 The syntax error will even bubble up and just crash\neverything.\n", "we can fix that in setup.py\n", "You mean: requests[betterssl] on Py3 will just be a noop?\n", "@t-8ch I don't understand your concerns in this statement:\n\n> In requests < 2.4.0 The syntax error will even bubble up and just crash everything.\n\nThe extra does not ship with anything `<= 2.4.0`. How does this affect those people?\n", "Just an example for downsides which can arise when using the pyopenssl backend\n" ]
https://api.github.com/repos/psf/requests/issues/2194
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/2194/labels{/name}
https://api.github.com/repos/psf/requests/issues/2194/comments
https://api.github.com/repos/psf/requests/issues/2194/events
https://github.com/psf/requests/pull/2194
41,539,656
MDExOlB1bGxSZXF1ZXN0MjA1MjM1MTQ=
2,194
Add test that an invalid domain raises a ConnectionError
{ "avatar_url": "https://avatars.githubusercontent.com/u/234019?v=4", "events_url": "https://api.github.com/users/kevinburke/events{/privacy}", "followers_url": "https://api.github.com/users/kevinburke/followers", "following_url": "https://api.github.com/users/kevinburke/following{/other_user}", "gists_url": "https://api.github.com/users/kevinburke/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kevinburke", "id": 234019, "login": "kevinburke", "node_id": "MDQ6VXNlcjIzNDAxOQ==", "organizations_url": "https://api.github.com/users/kevinburke/orgs", "received_events_url": "https://api.github.com/users/kevinburke/received_events", "repos_url": "https://api.github.com/users/kevinburke/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kevinburke/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kevinburke/subscriptions", "type": "User", "url": "https://api.github.com/users/kevinburke", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2014-08-29T21:08:05Z
2021-09-08T11:00:46Z
2014-08-29T21:50:47Z
CONTRIBUTOR
resolved
{ "avatar_url": "https://avatars.githubusercontent.com/u/240830?v=4", "events_url": "https://api.github.com/users/sigmavirus24/events{/privacy}", "followers_url": "https://api.github.com/users/sigmavirus24/followers", "following_url": "https://api.github.com/users/sigmavirus24/following{/other_user}", "gists_url": "https://api.github.com/users/sigmavirus24/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/sigmavirus24", "id": 240830, "login": "sigmavirus24", "node_id": "MDQ6VXNlcjI0MDgzMA==", "organizations_url": "https://api.github.com/users/sigmavirus24/orgs", "received_events_url": "https://api.github.com/users/sigmavirus24/received_events", "repos_url": "https://api.github.com/users/sigmavirus24/repos", "site_admin": false, "starred_url": "https://api.github.com/users/sigmavirus24/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/sigmavirus24/subscriptions", "type": "User", "url": "https://api.github.com/users/sigmavirus24", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/2194/reactions" }
https://api.github.com/repos/psf/requests/issues/2194/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/2194.diff", "html_url": "https://github.com/psf/requests/pull/2194", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/2194.patch", "url": "https://api.github.com/repos/psf/requests/pulls/2194" }
true
[ "You could add another test for closed ports\n", "@kevinburke I'll take care of that as I pull this into my PR. Thanks\n" ]
https://api.github.com/repos/psf/requests/issues/2193
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/2193/labels{/name}
https://api.github.com/repos/psf/requests/issues/2193/comments
https://api.github.com/repos/psf/requests/issues/2193/events
https://github.com/psf/requests/pull/2193
41,535,919
MDExOlB1bGxSZXF1ZXN0MjA1MjExMjE=
2,193
Capture and re-raise urllib3 ProtocolError
{ "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" }
[ { "color": "009800", "default": false, "description": null, "id": 44501218, "name": "Ready To Merge", "node_id": "MDU6TGFiZWw0NDUwMTIxOA==", "url": "https://api.github.com/repos/psf/requests/labels/Ready%20To%20Merge" }, { "color": "207de5", "default": false, "description": null, "id": 60620163, "name": "Minion Seal of Approval", "node_id": "MDU6TGFiZWw2MDYyMDE2Mw==", "url": "https://api.github.com/repos/psf/requests/labels/Minion%20Seal%20of%20Approval" } ]
closed
true
null
[]
null
15
2014-08-29T20:16:54Z
2021-09-08T10:01:21Z
2014-09-04T18:39:41Z
CONTRIBUTOR
resolved
Fixes #2192
{ "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/2193/reactions" }
https://api.github.com/repos/psf/requests/issues/2193/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/2193.diff", "html_url": "https://github.com/psf/requests/pull/2193", "merged_at": "2014-09-04T18:39:41Z", "patch_url": "https://github.com/psf/requests/pull/2193.patch", "url": "https://api.github.com/repos/psf/requests/pulls/2193" }
true
[ "LGTM. :cake:\n", "+1, though the code block is the same as lines 403-405... could just catch both in one go?\n", "I added a failing test for this in #2194\n", "@kevinburke are you okay with me pulling #2194 in here to keep things simple?\n", "Yep\n\n## \n\nKevin Burke\nphone: 925.271.7005 | twentymilliseconds.com\n\nOn Fri, Aug 29, 2014 at 2:26 PM, Ian Cordasco [email protected]\nwrote:\n\n> @kevinburke https://github.com/kevinburke are you okay with me pulling\n> #2194 https://github.com/kennethreitz/requests/pull/2194 in here to\n> keep things simple?\n> \n> —\n> Reply to this email directly or view it on GitHub\n> https://github.com/kennethreitz/requests/pull/2193#issuecomment-53931737\n> .\n", "I think a test against `http://localhost:0/` would also make sense. IIRC `0` means in UNIX that the OS should assign the program a free port.\n", "> +1, though the code block is the same as lines 403-405... could just catch both in one go?\n\nI was concerned others might disagree that it was simply a `ConnectionError`. If anyone is terribly concerned, I can merge the two sets of lines.\n", "+1 Thanks for getting to this quickly.\n", "Is a release coming soon with this? It's not super annoying for me (just giving users a huge traceback instead of a nice error message), but for others it is a critical API break. \n", "@asmeurer hopefully 2.4.1 will be out in a relatively short period of time.\n", "@sigmavirus24 should we cut it?\n", "@kennethreitz I think we should. This also forced OpenStack to pin to 2.3.0 in some (if not all) projects.\n", "This also is preventing requests upgrade in pip\n\nOn Sunday, September 7, 2014, Ian Cordasco [email protected] wrote:\n\n> @kennethreitz https://github.com/kennethreitz I think we should. This\n> also forced OpenStack to pin to 2.3.0 in some (if not all) projects.\n> \n> —\n> Reply to this email directly or view it on GitHub\n> https://github.com/kennethreitz/requests/pull/2193#issuecomment-54752715\n> .\n\n## \n\n## \n\nKevin Burke\nphone: 925.271.7005 | twentymilliseconds.com\n", "Actually wait. We should fix https://github.com/kennethreitz/requests/issues/2207 first. Let me get a PR in\n", "Fixed in #2210 \n" ]
https://api.github.com/repos/psf/requests/issues/2192
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/2192/labels{/name}
https://api.github.com/repos/psf/requests/issues/2192/comments
https://api.github.com/repos/psf/requests/issues/2192/events
https://github.com/psf/requests/issues/2192
41,531,008
MDU6SXNzdWU0MTUzMTAwOA==
2,192
[regression] urllib3.exceptions.ProtocolError not wrapped
{ "avatar_url": "https://avatars.githubusercontent.com/u/717901?v=4", "events_url": "https://api.github.com/users/t-8ch/events{/privacy}", "followers_url": "https://api.github.com/users/t-8ch/followers", "following_url": "https://api.github.com/users/t-8ch/following{/other_user}", "gists_url": "https://api.github.com/users/t-8ch/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/t-8ch", "id": 717901, "login": "t-8ch", "node_id": "MDQ6VXNlcjcxNzkwMQ==", "organizations_url": "https://api.github.com/users/t-8ch/orgs", "received_events_url": "https://api.github.com/users/t-8ch/received_events", "repos_url": "https://api.github.com/users/t-8ch/repos", "site_admin": false, "starred_url": "https://api.github.com/users/t-8ch/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/t-8ch/subscriptions", "type": "User", "url": "https://api.github.com/users/t-8ch", "user_view_type": "public" }
[]
closed
true
{ "avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4", "events_url": "https://api.github.com/users/Lukasa/events{/privacy}", "followers_url": "https://api.github.com/users/Lukasa/followers", "following_url": "https://api.github.com/users/Lukasa/following{/other_user}", "gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Lukasa", "id": 1382556, "login": "Lukasa", "node_id": "MDQ6VXNlcjEzODI1NTY=", "organizations_url": "https://api.github.com/users/Lukasa/orgs", "received_events_url": "https://api.github.com/users/Lukasa/received_events", "repos_url": "https://api.github.com/users/Lukasa/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions", "type": "User", "url": "https://api.github.com/users/Lukasa", "user_view_type": "public" }
[ { "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" } ]
null
10
2014-08-29T19:11:03Z
2021-09-08T23:08:02Z
2014-09-04T18:39:41Z
CONTRIBUTOR
resolved
``` py >>> requests.__version__ '2.4.0' >>> requests.get('http://localhost:1') # ... stacktrace requests.packages.urllib3.exceptions.ProtocolError: ('Connection aborted.', ConnectionRefusedError(111, 'Connection refused')) ```
{ "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/2192/reactions" }
https://api.github.com/repos/psf/requests/issues/2192/timeline
null
completed
null
null
false
[ "Yup I'm hitting this too. Is this going to be fixed quick or should I fix my code? :)\n", "Same issue here.\n", "I'll take a look at this this weekend. =) Thanks for reporting folks!\n", "Looking at it right now @Lukasa \n", "Ok, suits me. =) If you get there before me I'll happily accept not doing the work. =D\n", "Thanks for the quick turnaround in looking at it guys!\n", "Ditto. This passes on `2.3.0` but fails with `2.4.0`.\n\n``` python\ndef test_connect_fail(self):\n try:\n requests.get(\"http://localhost:62123\")\n assert False, \"The connect() request should be refused.\"\n except ConnectionError as e:\n assert isinstance(e, ConnectionError)\n```\n", "Thanks all for the reports! Please note that a provisional fix is ready in #2193: further +1s and 'me too's are not needed. =)\n", "Is this a related issue ?\n\n File \"build/bdist.linux-x86_64/egg/pyVim/connect.py\", line 435, in __GetServiceVersionDescription\n sock = requests.get(url, verify=False)\n File \"/usr/lib/python2.7/dist-packages/requests/api.py\", line 55, in get\n return request('get', url, *_kwargs)\n File \"/usr/lib/python2.7/dist-packages/requests/api.py\", line 44, in request\n return session.request(method=method, url=url, *_kwargs)\n File \"/usr/lib/python2.7/dist-packages/requests/sessions.py\", line 383, in request\n resp = self.send(prep, *_send_kwargs)\n File \"/usr/lib/python2.7/dist-packages/requests/sessions.py\", line 486, in send\n r = adapter.send(request, *_kwargs)\n File \"/usr/lib/python2.7/dist-packages/requests/adapters.py\", line 385, in send\n raise SSLError(e)\nSSLError: [Errno 1] _ssl.c:510: error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol\n", "No, it is a broken server configuration (or you are talking to something which is not talking SSL back to you).\nTake a look at http://toolbelt.readthedocs.org/en/latest/user.html#ssladapter\n" ]
https://api.github.com/repos/psf/requests/issues/2191
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/2191/labels{/name}
https://api.github.com/repos/psf/requests/issues/2191/comments
https://api.github.com/repos/psf/requests/issues/2191/events
https://github.com/psf/requests/pull/2191
41,530,707
MDExOlB1bGxSZXF1ZXN0MjA1MTc3NDU=
2,191
add trailing comma
{ "avatar_url": "https://avatars.githubusercontent.com/u/234019?v=4", "events_url": "https://api.github.com/users/kevinburke/events{/privacy}", "followers_url": "https://api.github.com/users/kevinburke/followers", "following_url": "https://api.github.com/users/kevinburke/following{/other_user}", "gists_url": "https://api.github.com/users/kevinburke/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kevinburke", "id": 234019, "login": "kevinburke", "node_id": "MDQ6VXNlcjIzNDAxOQ==", "organizations_url": "https://api.github.com/users/kevinburke/orgs", "received_events_url": "https://api.github.com/users/kevinburke/received_events", "repos_url": "https://api.github.com/users/kevinburke/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kevinburke/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kevinburke/subscriptions", "type": "User", "url": "https://api.github.com/users/kevinburke", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2014-08-29T19:07:09Z
2021-09-08T10:01:25Z
2014-09-04T18:39:23Z
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/2191/reactions" }
https://api.github.com/repos/psf/requests/issues/2191/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/2191.diff", "html_url": "https://github.com/psf/requests/pull/2191", "merged_at": "2014-09-04T18:39:23Z", "patch_url": "https://github.com/psf/requests/pull/2191.patch", "url": "https://api.github.com/repos/psf/requests/pulls/2191" }
true
[ "+0 It isn't that big of a deal\n" ]
https://api.github.com/repos/psf/requests/issues/2190
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/2190/labels{/name}
https://api.github.com/repos/psf/requests/issues/2190/comments
https://api.github.com/repos/psf/requests/issues/2190/events
https://github.com/psf/requests/issues/2190
41,530,607
MDU6SXNzdWU0MTUzMDYwNw==
2,190
Git tag for 2.4.0 is missing on GitHub
{ "avatar_url": "https://avatars.githubusercontent.com/u/717901?v=4", "events_url": "https://api.github.com/users/t-8ch/events{/privacy}", "followers_url": "https://api.github.com/users/t-8ch/followers", "following_url": "https://api.github.com/users/t-8ch/following{/other_user}", "gists_url": "https://api.github.com/users/t-8ch/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/t-8ch", "id": 717901, "login": "t-8ch", "node_id": "MDQ6VXNlcjcxNzkwMQ==", "organizations_url": "https://api.github.com/users/t-8ch/orgs", "received_events_url": "https://api.github.com/users/t-8ch/received_events", "repos_url": "https://api.github.com/users/t-8ch/repos", "site_admin": false, "starred_url": "https://api.github.com/users/t-8ch/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/t-8ch/subscriptions", "type": "User", "url": "https://api.github.com/users/t-8ch", "user_view_type": "public" }
[]
closed
true
null
[]
null
0
2014-08-29T19:05:36Z
2021-09-08T23:08:10Z
2014-09-09T21:09:43Z
CONTRIBUTOR
resolved
See subject
{ "avatar_url": "https://avatars.githubusercontent.com/u/717901?v=4", "events_url": "https://api.github.com/users/t-8ch/events{/privacy}", "followers_url": "https://api.github.com/users/t-8ch/followers", "following_url": "https://api.github.com/users/t-8ch/following{/other_user}", "gists_url": "https://api.github.com/users/t-8ch/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/t-8ch", "id": 717901, "login": "t-8ch", "node_id": "MDQ6VXNlcjcxNzkwMQ==", "organizations_url": "https://api.github.com/users/t-8ch/orgs", "received_events_url": "https://api.github.com/users/t-8ch/received_events", "repos_url": "https://api.github.com/users/t-8ch/repos", "site_admin": false, "starred_url": "https://api.github.com/users/t-8ch/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/t-8ch/subscriptions", "type": "User", "url": "https://api.github.com/users/t-8ch", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/2190/reactions" }
https://api.github.com/repos/psf/requests/issues/2190/timeline
null
completed
null
null
false
[]
https://api.github.com/repos/psf/requests/issues/2189
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/2189/labels{/name}
https://api.github.com/repos/psf/requests/issues/2189/comments
https://api.github.com/repos/psf/requests/issues/2189/events
https://github.com/psf/requests/issues/2189
41,528,790
MDU6SXNzdWU0MTUyODc5MA==
2,189
All PyPy builds failing on ci.kennethreitz.org
{ "avatar_url": "https://avatars.githubusercontent.com/u/234019?v=4", "events_url": "https://api.github.com/users/kevinburke/events{/privacy}", "followers_url": "https://api.github.com/users/kevinburke/followers", "following_url": "https://api.github.com/users/kevinburke/following{/other_user}", "gists_url": "https://api.github.com/users/kevinburke/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kevinburke", "id": 234019, "login": "kevinburke", "node_id": "MDQ6VXNlcjIzNDAxOQ==", "organizations_url": "https://api.github.com/users/kevinburke/orgs", "received_events_url": "https://api.github.com/users/kevinburke/received_events", "repos_url": "https://api.github.com/users/kevinburke/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kevinburke/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kevinburke/subscriptions", "type": "User", "url": "https://api.github.com/users/kevinburke", "user_view_type": "public" }
[]
closed
true
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
[ { "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" } ]
null
2
2014-08-29T18:44:22Z
2021-09-08T23:10:35Z
2014-09-04T18:46:24Z
CONTRIBUTOR
resolved
Example output is: ``` Started by upstream project "requests-pr" build number 401 originally caused by: GitHub pull request #2188 of commit 6b1a30b7059859c18f1d44d58011ac405e750f26 automatically merged. Building in workspace /var/lib/jenkins/jobs/requests-pr/workspace/PYTHON/pypy-1.8 > git rev-parse --is-inside-work-tree # timeout=10 Fetching changes from the remote Git repository > git config remote.origin.url https://github.com/kennethreitz/requests.git # timeout=10 Fetching upstream changes from https://github.com/kennethreitz/requests.git > git --version # timeout=10 > git fetch --tags --progress https://github.com/kennethreitz/requests.git +refs/pull/*:refs/remotes/origin/pr/* Checking out Revision 69c7bb1506e5378c22bb6164451f1acc07bf138a (detached) > git config core.sparsecheckout # timeout=10 > git checkout -f 69c7bb1506e5378c22bb6164451f1acc07bf138a > git rev-list 56abf36d19e82fa27bbdf85c7c6528cf1d1a6e13 # timeout=10 [pypy-1.8] $ /usr/bin/pypy /var/lib/jenkins/shiningpanda/jobs/038a7fc3/virtualenv.py /var/lib/jenkins/shiningpanda/jobs/038a7fc3/virtualenvs/d41d8cd9 New pypy executable in /var/lib/jenkins/shiningpanda/jobs/038a7fc3/virtualenvs/d41d8cd9/bin/pypy Installing setuptools, pip... Complete output from command /var/lib/jenkins/shi...vs/d41d8cd9/bin/pypy -c "import sys, pip; sys...d\"] + sys.argv[1:]))" setuptools pip: Ignoring indexes: https://pypi.python.org/simple/ Downloading/unpacking setuptools Downloading/unpacking pip Installing collected packages: setuptools, pip Cleaning up... Exception: Traceback (most recent call last): File "/var/lib/jenkins/shiningpanda/jobs/038a7fc3/pip-0-py2.py3-none-any.whl/pip/basecommand.py", line 122, in main status = self.run(options, args) File "/var/lib/jenkins/shiningpanda/jobs/038a7fc3/pip-0-py2.py3-none-any.whl/pip/commands/install.py", line 283, in run requirement_set.install(install_options, global_options, root=options.root_path) File "/var/lib/jenkins/shiningpanda/jobs/038a7fc3/pip-0-py2.py3-none-any.whl/pip/req.py", line 1435, in install requirement.install(install_options, global_options, *args, **kwargs) File "/var/lib/jenkins/shiningpanda/jobs/038a7fc3/pip-0-py2.py3-none-any.whl/pip/req.py", line 671, in install self.move_wheel_files(self.source_dir, root=root) File "/var/lib/jenkins/shiningpanda/jobs/038a7fc3/pip-0-py2.py3-none-any.whl/pip/req.py", line 901, in move_wheel_files pycompile=self.pycompile, File "/var/lib/jenkins/shiningpanda/jobs/038a7fc3/pip-0-py2.py3-none-any.whl/pip/wheel.py", line 162, in move_wheel_files compileall.compile_dir(source, force=True, quiet=True) File "/usr/lib/pypy/lib-python/2.7/compileall.py", line 60, in compile_dir quiet, legacy): File "/usr/lib/pypy/lib-python/2.7/compileall.py", line 52, in compile_dir if not compile_file(fullname, ddir, force, rx, quiet, legacy): File "/usr/lib/pypy/lib-python/2.7/compileall.py", line 91, in compile_file cfile = imp.cache_from_source(fullname) ValueError: Not a .py file: /var/lib/jenkins/shiningpanda/jobs/038a7fc3/virtualenvs/d41d8cd9/build/setuptools/setuptools/cli-32.exe Storing debug log for failure in /var/lib/jenkins/.pip/pip.log ---------------------------------------- ...Installing setuptools, pip...done. Traceback (most recent call last): File "app_main.py", line 51, in run_toplevel File "/var/lib/jenkins/shiningpanda/jobs/038a7fc3/virtualenv.py", line 2338, in <module> main() File "/var/lib/jenkins/shiningpanda/jobs/038a7fc3/virtualenv.py", line 824, in main symlink=options.symlink) File "/var/lib/jenkins/shiningpanda/jobs/038a7fc3/virtualenv.py", line 992, in create_environment install_wheel(to_install, py_executable, search_dirs) File "/var/lib/jenkins/shiningpanda/jobs/038a7fc3/virtualenv.py", line 960, in install_wheel 'PIP_NO_INDEX': '1' File "/var/lib/jenkins/shiningpanda/jobs/038a7fc3/virtualenv.py", line 902, in call_subprocess % (cmd_desc, proc.returncode)) OSError: Command /var/lib/jenkins/shi...vs/d41d8cd9/bin/pypy -c "import sys, pip; sys...d\"] + sys.argv[1:]))" setuptools pip failed with error code 2 Build step 'Virtualenv Builder' marked build as failure Finished: FAILURE ``` Example failure: http://ci.kennethreitz.org/job/requests-pr/PYTHON=pypy-1.8/401/console
{ "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/2189/reactions" }
https://api.github.com/repos/psf/requests/issues/2189/timeline
null
completed
null
null
false
[ "The only person who can fix this is @kennethreitz \n", "Disabled pypy for now. Need to update it anyway. \n" ]
https://api.github.com/repos/psf/requests/issues/2188
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/2188/labels{/name}
https://api.github.com/repos/psf/requests/issues/2188/comments
https://api.github.com/repos/psf/requests/issues/2188/events
https://github.com/psf/requests/pull/2188
41,528,659
MDExOlB1bGxSZXF1ZXN0MjA1MTY0MTI=
2,188
Dummy commit
{ "avatar_url": "https://avatars.githubusercontent.com/u/234019?v=4", "events_url": "https://api.github.com/users/kevinburke/events{/privacy}", "followers_url": "https://api.github.com/users/kevinburke/followers", "following_url": "https://api.github.com/users/kevinburke/following{/other_user}", "gists_url": "https://api.github.com/users/kevinburke/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kevinburke", "id": 234019, "login": "kevinburke", "node_id": "MDQ6VXNlcjIzNDAxOQ==", "organizations_url": "https://api.github.com/users/kevinburke/orgs", "received_events_url": "https://api.github.com/users/kevinburke/received_events", "repos_url": "https://api.github.com/users/kevinburke/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kevinburke/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kevinburke/subscriptions", "type": "User", "url": "https://api.github.com/users/kevinburke", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2014-08-29T18:42:37Z
2021-09-08T11:00:46Z
2014-08-29T18:45:34Z
CONTRIBUTOR
resolved
I think the Pypy build commands may be broken, testing with a new commit
{ "avatar_url": "https://avatars.githubusercontent.com/u/234019?v=4", "events_url": "https://api.github.com/users/kevinburke/events{/privacy}", "followers_url": "https://api.github.com/users/kevinburke/followers", "following_url": "https://api.github.com/users/kevinburke/following{/other_user}", "gists_url": "https://api.github.com/users/kevinburke/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kevinburke", "id": 234019, "login": "kevinburke", "node_id": "MDQ6VXNlcjIzNDAxOQ==", "organizations_url": "https://api.github.com/users/kevinburke/orgs", "received_events_url": "https://api.github.com/users/kevinburke/received_events", "repos_url": "https://api.github.com/users/kevinburke/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kevinburke/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kevinburke/subscriptions", "type": "User", "url": "https://api.github.com/users/kevinburke", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/2188/reactions" }
https://api.github.com/repos/psf/requests/issues/2188/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/2188.diff", "html_url": "https://github.com/psf/requests/pull/2188", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/2188.patch", "url": "https://api.github.com/repos/psf/requests/pulls/2188" }
true
[ "Yeah, looks like everything is failing, documented as https://github.com/kennethreitz/requests/issues/2189\n" ]
https://api.github.com/repos/psf/requests/issues/2187
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/2187/labels{/name}
https://api.github.com/repos/psf/requests/issues/2187/comments
https://api.github.com/repos/psf/requests/issues/2187/events
https://github.com/psf/requests/pull/2187
41,528,151
MDExOlB1bGxSZXF1ZXN0MjA1MTYwOTA=
2,187
Document Timeout behaviour
{ "avatar_url": "https://avatars.githubusercontent.com/u/234019?v=4", "events_url": "https://api.github.com/users/kevinburke/events{/privacy}", "followers_url": "https://api.github.com/users/kevinburke/followers", "following_url": "https://api.github.com/users/kevinburke/following{/other_user}", "gists_url": "https://api.github.com/users/kevinburke/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kevinburke", "id": 234019, "login": "kevinburke", "node_id": "MDQ6VXNlcjIzNDAxOQ==", "organizations_url": "https://api.github.com/users/kevinburke/orgs", "received_events_url": "https://api.github.com/users/kevinburke/received_events", "repos_url": "https://api.github.com/users/kevinburke/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kevinburke/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kevinburke/subscriptions", "type": "User", "url": "https://api.github.com/users/kevinburke", "user_view_type": "public" }
[]
closed
true
null
[]
null
3
2014-08-29T18:36:44Z
2021-09-08T11:00:45Z
2014-09-04T18:39:12Z
CONTRIBUTOR
resolved
Adds better documentation of `timeout` behavior - "How long to wait for the server to send data before giving up, as a float, or a (connect timeout, read timeout) tuple." was as short as I could get to accurately describe the behavior. - Sphinx puts the description of timeouts on the line below the parameter name, but this is not true for other parameters. I'm curious why this is but I can't see any differences. - We don't use the `stream` parameter anywhere in the `adapters.send` method, so I removed the "Behavior" section that described the behavior of requests incorrectly. May also want to remove the parameter description from the documentation, or state that it's not actually used anywhere.
{ "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/2187/reactions" }
https://api.github.com/repos/psf/requests/issues/2187/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/2187.diff", "html_url": "https://github.com/psf/requests/pull/2187", "merged_at": "2014-09-04T18:39:12Z", "patch_url": "https://github.com/psf/requests/pull/2187.patch", "url": "https://api.github.com/repos/psf/requests/pulls/2187" }
true
[ "Also, does requests use british/canadian or US spellings? I see \"behavior\" spelled both ways in the docs\n", "This change only affects documentation, the test failure looks to be global & related to a bad configuration, see https://github.com/kennethreitz/requests/issues/2189\n", "I think I can safely speak for Cory (and myself) in saying we prefer the King's English (British spelling). We have accepted both though.\n" ]
https://api.github.com/repos/psf/requests/issues/2186
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/2186/labels{/name}
https://api.github.com/repos/psf/requests/issues/2186/comments
https://api.github.com/repos/psf/requests/issues/2186/events
https://github.com/psf/requests/pull/2186
41,280,494
MDExOlB1bGxSZXF1ZXN0MjAzNzE0Mjg=
2,186
Change request to make keep alive more human
{ "avatar_url": "https://avatars.githubusercontent.com/u/407189?v=4", "events_url": "https://api.github.com/users/tychotatitscheff/events{/privacy}", "followers_url": "https://api.github.com/users/tychotatitscheff/followers", "following_url": "https://api.github.com/users/tychotatitscheff/following{/other_user}", "gists_url": "https://api.github.com/users/tychotatitscheff/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/tychotatitscheff", "id": 407189, "login": "tychotatitscheff", "node_id": "MDQ6VXNlcjQwNzE4OQ==", "organizations_url": "https://api.github.com/users/tychotatitscheff/orgs", "received_events_url": "https://api.github.com/users/tychotatitscheff/received_events", "repos_url": "https://api.github.com/users/tychotatitscheff/repos", "site_admin": false, "starred_url": "https://api.github.com/users/tychotatitscheff/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/tychotatitscheff/subscriptions", "type": "User", "url": "https://api.github.com/users/tychotatitscheff", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2014-08-27T12:59:32Z
2021-09-08T11:00:48Z
2014-08-27T13:02:11Z
NONE
resolved
Not sure if this is the right way & design to do this: - I added a new property to request and session - I used existing merge function to assure that if something is set in request parameter, it will overides sessions´s ones. - I keep it disable by deafault as https://github.com/kennethreitz/requests/issues/2169#issuecomment-53496634 stated. More info in https://github.com/kennethreitz/requests/issues/2169 thread.
{ "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/2186/reactions" }
https://api.github.com/repos/psf/requests/issues/2186/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/2186.diff", "html_url": "https://github.com/psf/requests/pull/2186", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/2186.patch", "url": "https://api.github.com/repos/psf/requests/pulls/2186" }
true
[ "Thanks for this!\n\nThis is not normally the way we'd go about this. In particular, we're averse to adding more keyword arguments to the request methods. I don't think this approach is going to be the one we take: we should just be setting this appropriately in the headers and allowing users to override it.\n", "Ok. I have no global view of the project.\nI just tryed to match the verify=False, but it may just been added here ( https://github.com/kennethreitz/requests/blob/master/requests/utils.py#L553) once you reach 3.0.0.\n" ]
https://api.github.com/repos/psf/requests/issues/2185
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/2185/labels{/name}
https://api.github.com/repos/psf/requests/issues/2185/comments
https://api.github.com/repos/psf/requests/issues/2185/events
https://github.com/psf/requests/issues/2185
41,277,532
MDU6SXNzdWU0MTI3NzUzMg==
2,185
socket.error raised from r.iter_content
{ "avatar_url": "https://avatars.githubusercontent.com/u/305104?v=4", "events_url": "https://api.github.com/users/joneskoo/events{/privacy}", "followers_url": "https://api.github.com/users/joneskoo/followers", "following_url": "https://api.github.com/users/joneskoo/following{/other_user}", "gists_url": "https://api.github.com/users/joneskoo/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/joneskoo", "id": 305104, "login": "joneskoo", "node_id": "MDQ6VXNlcjMwNTEwNA==", "organizations_url": "https://api.github.com/users/joneskoo/orgs", "received_events_url": "https://api.github.com/users/joneskoo/received_events", "repos_url": "https://api.github.com/users/joneskoo/repos", "site_admin": false, "starred_url": "https://api.github.com/users/joneskoo/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/joneskoo/subscriptions", "type": "User", "url": "https://api.github.com/users/joneskoo", "user_view_type": "public" }
[]
closed
true
null
[]
null
4
2014-08-27T12:22:05Z
2021-09-08T23:00:53Z
2014-08-27T13:00:57Z
NONE
resolved
My code ``` r = requests.get(url, stream=True) for chunk in r.iter_content(chunk_size=16*1024): if chunk: # filter out keep-alive new chunks f.write(chunk) f.flush() ``` raises an exception socket.error; I would expect it to be mapped to requests.exceptions instead. ``` for chunk in r.iter_content(chunk_size=16*1024): File "/usr/lib/python2.7/dist-packages/requests/models.py", line 616, in generate decode_content=True): File "/usr/lib/python2.7/dist-packages/urllib3/response.py", line 225, in stream data = self.read(amt=amt, decode_content=decode_content) File "/usr/lib/python2.7/dist-packages/urllib3/response.py", line 174, in read data = self._fp.read(amt) File "/usr/lib/python2.7/httplib.py", line 567, in read s = self.fp.read(amt) File "/usr/lib/python2.7/socket.py", line 380, in read data = self._sock.recv(left) File "/usr/lib/python2.7/ssl.py", line 341, in recv return self.read(buflen) File "/usr/lib/python2.7/ssl.py", line 260, in read return self._sslobj.read(len) error: [Errno 104] Connection reset by peer ``` @Lukasa, since you fixed another exception handling issue already, would you care to take a look at some point? Easy enough to work around but should be fixed to maintain a human API.
{ "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/2185/reactions" }
https://api.github.com/repos/psf/requests/issues/2185/timeline
null
completed
null
null
false
[ "Agreed. Either we should catch it ourselves, or urllib3 should catch this stuff from read or stream. @shazow?\n", "Isn't there already an open issue for this?\n", "Ugh, we actually already fixed it. =( I just totally missed it in my code read. Should be fixed in the next release! =)\n", "with what exception I can solve this issue?\n" ]
https://api.github.com/repos/psf/requests/issues/2184
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/2184/labels{/name}
https://api.github.com/repos/psf/requests/issues/2184/comments
https://api.github.com/repos/psf/requests/issues/2184/events
https://github.com/psf/requests/issues/2184
41,223,455
MDU6SXNzdWU0MTIyMzQ1NQ==
2,184
Port test suite to pytest-httpbin
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
[ { "color": "f7c6c7", "default": false, "description": null, "id": 167537670, "name": "Propose Close", "node_id": "MDU6TGFiZWwxNjc1Mzc2NzA=", "url": "https://api.github.com/repos/psf/requests/labels/Propose%20Close" } ]
closed
true
null
[]
null
24
2014-08-26T21:18:47Z
2021-09-08T21:00:45Z
2015-11-05T15:37:22Z
CONTRIBUTOR
resolved
https://github.com/kevin1024/pytest-httpbin
{ "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/2184/reactions" }
https://api.github.com/repos/psf/requests/issues/2184/timeline
null
completed
null
null
false
[ "Just attempted, but can't figure out how to use default funcargs with class-style tests.\n", " Duplicate of https://github.com/kennethreitz/requests/issues/2093 ?\n", "Yup.\n", "@kennethreitz yeah, pytest makes this a bit awkward, so I just released a new version of pytest-httpbin to make this easier. Check out this section of the readme: https://github.com/kevin1024/pytest-httpbin#using-pytest-httpbin-with-unittest-style-test-cases\n\nHere is the example usage:\n\n``` python\nimport pytest_httpbin\n\n@pytest_httpbin.use_class_based_httpbin\n@pytest_httpbin.use_class_based_httpbin_secure\nclass TestClassBassedTests(unittest.TestCase):\n def test_http(self):\n assert requests.get(self.httpbin.url + '/get').response\n\n def test_http_secure(self):\n assert requests.get(self.httpbin_secure.url + '/get').response\n```\n", "That's perfect, thanks! This will allow us to just use it for the baseclass. \n", "Cool! Let me know if you run up against anything else.\n", "Closing due to inactivity \n", "Aww too bad. Was there something blocking this? Would you merge a pull request adding this?\n", "I'm still taking a look at this. Right now it's _mostly_ working, but there are a few tests that don't really function appropriately. Going to see if I can get the whole suite functioning again.\n", "Ok, I don't think this will work just yet. There are a few problems in pytest-httpbin that I can't work around yet. The most severe one is that it seems to be unable to send chunk-encoded responses, which breaks a couple of our streaming tests. I consider this a bug in pytest-httpbin.\n\nAlso, `test_DIGESTAUTH_THREADED` has a tendency to fail miserably (usually with `EPIPE`). I suspect this is because pytest-httpbin is single-threaded. I'm not sure what to do about this yet, but we don't need to decide until everything else is working.\n", "This also reveals a bug in the way we mock out `get_netrc_auth` in `test_basicauth_with_netrc`, which is unfortunate. We can work around that too.\n", "Ok, bugs raised against upstream projects: kevin1024/pytest-httpbin#27 and Runscope/httpbin#259. Until this gets resolved and a new release of httpbin is pushed, however, I don't believe we can move forward with this. I've pushed my work to the pytest-httpbin branch of this repository for safe-keeping.\n", "OK, the bug is fixed upstream in httpbin and a new version is released, 0.4.0.\n\nLet me know how it goes with the threaded test.\n", "Ok, so the threaded test is the only problem at this point: all the rest is green. I've pushed up the new pin and a minor fix to the pytest-httpbin branch.\n\nAt this point, I may need to play around with putting gunicorn or something similar in front of pytest-httpbin. It may be that something like Twisted or Tornado is a better choice here: anything that can meaningfully handle some number of concurrent connections.\n", "Twisted can be used to run any wsgi app as I understand it. It may be worth attempting to run httpbin on top of that in that case.\n", "Hmm, maybe I can use werkzeug's http server instead of wsgiref, since it's already a requirement of httpbin (-> flask -> werkzeug).\n", "OK, I just released a multithreaded version of pytest-httpbin! The requests test suite seems to be running well for me with my updated version.\n\nOne thing to note though: 2 of the tests request a /delay/10 endpoint, and then time out before the response comes back. You will see the error message from the HTTP server saying \"broken pipe\". This is because the httpbin server tries to return the response to a client that has gone away. Not really anything to worry about but might be scary for someone new to the test suite.\n", "Alrighty, so I removed the threaded digest auth test entirely because it just doesn't behave well in this kind of environment. At some point we do need to go back and retest it, but I don't think we can do that until we totally revamp our testing.\n\nIn the meantime, the proposed switch to move offline is in #2859. We need to be really careful about when this gets merged to make sure there's no explicit calls to httpbin.org again, but we can do that.\n", "I'm curious about the problems you were having with the threaded test. Can you elaborate?\n", "Two problems.\n\nFirstly, the test had a tendency to vomit a lot of logs from the httpbin process into stdout, which ruins the test output. Not good.\n\nNext, it failed a lot. About 50% of the time in my viewing.\n", "@lukasa did you try the version I released a a couple weeks with a threaded server? You shouldn't be getting test failures. The error messages are still a problem though. Noticed the requirements.txt in requests still has pytest-httpbin pinned to an older version so I'm wondering if you didn't see my above message from 14 days ago. Regardless, I'm super excited you're using my library. Cheers!\n", "Thanks for the work @kevin1024! I did see the message, but the scary test output was a bigger problem. ;) I think it'd be better to come up with a different way to test this scenario.\n\nThanks for your library!\n", "Oh well, it was worth a shot!\n", "To be clear, @kennethreitz, the current test suite has been ported to use pytest-httpbin. =D At PyCon 2016 we'll probably want to have a discussion about the longer-term approach to testing in requests, but for now this is good enough. =)\n" ]
https://api.github.com/repos/psf/requests/issues/2183
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/2183/labels{/name}
https://api.github.com/repos/psf/requests/issues/2183/comments
https://api.github.com/repos/psf/requests/issues/2183/events
https://github.com/psf/requests/pull/2183
41,210,483
MDExOlB1bGxSZXF1ZXN0MjAzMzA4ODk=
2,183
Fix #2180.
{ "avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4", "events_url": "https://api.github.com/users/Lukasa/events{/privacy}", "followers_url": "https://api.github.com/users/Lukasa/followers", "following_url": "https://api.github.com/users/Lukasa/following{/other_user}", "gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Lukasa", "id": 1382556, "login": "Lukasa", "node_id": "MDQ6VXNlcjEzODI1NTY=", "organizations_url": "https://api.github.com/users/Lukasa/orgs", "received_events_url": "https://api.github.com/users/Lukasa/received_events", "repos_url": "https://api.github.com/users/Lukasa/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions", "type": "User", "url": "https://api.github.com/users/Lukasa", "user_view_type": "public" }
[]
closed
true
null
[]
null
3
2014-08-26T19:20:57Z
2021-09-08T10:01:15Z
2014-08-26T19:41:44Z
MEMBER
resolved
@kennethreitz?
{ "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/2183/reactions" }
https://api.github.com/repos/psf/requests/issues/2183/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/2183.diff", "html_url": "https://github.com/psf/requests/pull/2183", "merged_at": "2014-08-26T19:41:44Z", "patch_url": "https://github.com/psf/requests/pull/2183.patch", "url": "https://api.github.com/repos/psf/requests/pulls/2183" }
true
[ ":+1: \n", "Any reason why only the first reference to `timeline.json` is fixed? Are the [other](https://github.com/kennethreitz/requests/blame/7e24176ca137cfc1c134343d991163d5f8779333/docs/user/quickstart.rst#L84) references to it valid?\n", "@myint No, I just missed them. This should be fixed in master now. Thanks for reporting it!\n" ]
https://api.github.com/repos/psf/requests/issues/2182
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/2182/labels{/name}
https://api.github.com/repos/psf/requests/issues/2182/comments
https://api.github.com/repos/psf/requests/issues/2182/events
https://github.com/psf/requests/issues/2182
41,210,308
MDU6SXNzdWU0MTIxMDMwOA==
2,182
Add "Low-Level Internals" to documentation
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
[]
closed
true
null
[]
null
3
2014-08-26T19:19:14Z
2021-09-04T00:06:31Z
2019-07-02T03:02:39Z
CONTRIBUTOR
resolved
Feedback welcome, but I think this would be absolutely incredible to have.
{ "avatar_url": "https://avatars.githubusercontent.com/u/8712070?v=4", "events_url": "https://api.github.com/users/kobayashi/events{/privacy}", "followers_url": "https://api.github.com/users/kobayashi/followers", "following_url": "https://api.github.com/users/kobayashi/following{/other_user}", "gists_url": "https://api.github.com/users/kobayashi/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kobayashi", "id": 8712070, "login": "kobayashi", "node_id": "MDQ6VXNlcjg3MTIwNzA=", "organizations_url": "https://api.github.com/users/kobayashi/orgs", "received_events_url": "https://api.github.com/users/kobayashi/received_events", "repos_url": "https://api.github.com/users/kobayashi/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kobayashi/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kobayashi/subscriptions", "type": "User", "url": "https://api.github.com/users/kobayashi", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/2182/reactions" }
https://api.github.com/repos/psf/requests/issues/2182/timeline
null
completed
null
null
false
[ ":+1:\n", ":+1: \n", "This is described at [lower level classes](https://2.python-requests.org/en/master/api/#lower-level-classes) ." ]
https://api.github.com/repos/psf/requests/issues/2181
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/2181/labels{/name}
https://api.github.com/repos/psf/requests/issues/2181/comments
https://api.github.com/repos/psf/requests/issues/2181/events
https://github.com/psf/requests/issues/2181
41,200,903
MDU6SXNzdWU0MTIwMDkwMw==
2,181
Requests is slow to upload large files
{ "avatar_url": "https://avatars.githubusercontent.com/u/446219?v=4", "events_url": "https://api.github.com/users/Tech356/events{/privacy}", "followers_url": "https://api.github.com/users/Tech356/followers", "following_url": "https://api.github.com/users/Tech356/following{/other_user}", "gists_url": "https://api.github.com/users/Tech356/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Tech356", "id": 446219, "login": "Tech356", "node_id": "MDQ6VXNlcjQ0NjIxOQ==", "organizations_url": "https://api.github.com/users/Tech356/orgs", "received_events_url": "https://api.github.com/users/Tech356/received_events", "repos_url": "https://api.github.com/users/Tech356/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Tech356/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Tech356/subscriptions", "type": "User", "url": "https://api.github.com/users/Tech356", "user_view_type": "public" }
[ { "color": "f7c6c7", "default": false, "description": null, "id": 167537670, "name": "Propose Close", "node_id": "MDU6TGFiZWwxNjc1Mzc2NzA=", "url": "https://api.github.com/repos/psf/requests/labels/Propose%20Close" } ]
closed
true
null
[]
null
21
2014-08-26T17:46:30Z
2021-08-29T00:06:38Z
2015-01-19T09:20:41Z
NONE
resolved
I am using requests to POST data to a server. In testing with a 14.4 MB file, `requests` took 16.5 seconds and `cURL` took 3.3 seconds. The following image shows the 3 tests I ran. The first bump is using `requests` with `MultipartEncoder` from `requests-toolbelt`. The second bump is just using `requests`. The last bump is `cURL`. ![request_speed](https://cloud.githubusercontent.com/assets/446219/4048836/621e85ea-2d47-11e4-8fbc-1bc5f07e50c3.PNG) I am using Python 3.4.0, requests 2.3.0, and requests-toolbelt 0.3.1 on Windows 7 x64. Are there any settings I can tune to speed up `requests`?
{ "avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4", "events_url": "https://api.github.com/users/Lukasa/events{/privacy}", "followers_url": "https://api.github.com/users/Lukasa/followers", "following_url": "https://api.github.com/users/Lukasa/following{/other_user}", "gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Lukasa", "id": 1382556, "login": "Lukasa", "node_id": "MDQ6VXNlcjEzODI1NTY=", "organizations_url": "https://api.github.com/users/Lukasa/orgs", "received_events_url": "https://api.github.com/users/Lukasa/received_events", "repos_url": "https://api.github.com/users/Lukasa/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions", "type": "User", "url": "https://api.github.com/users/Lukasa", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/2181/reactions" }
https://api.github.com/repos/psf/requests/issues/2181/timeline
null
completed
null
null
false
[ "That's very interesting: can I see the code?\n", "So if you're using the `MultipartEncoder` then what happens is that the object is passed down to `httplib` which has a fixed read size of `8192` bytes. So it takes 1,844 reads to upload the file. If you're passing a file-like object to requests the same thing happens.\n\nI assume that the graph you show is of your memory consumption. `cURL` is a bit more advantageous. Unfortunately there's no way for you stream files faster. If your server can handle `chunked` Transfer-Encoding you might be able to pass an iterator that will return larger chunks but I'm not sure if `httplib` handles those and if it does, how it does so.\n\nIn short, there are no settings you can use. This is a fundamental (and unchangeable) limitation of `httplib` (or as it is called on 3.4 `http`).\n", "@sigmavirus24 Nope, that's a graph of network throughput (IIRC). We should be able to get this at least as fast, even if it means working out what the hell httplib is doing.\n", "Here are the relevant sections of [`http`](http://hg.python.org/cpython/file/5c585929658a/Lib/http/client.py#l865) and [`httplib`](http://hg.python.org/cpython/file/37ebb0d44808/Lib/httplib.py#l818)\n", "Ugh, that's terrible. It really should use `sendfile` if that's available. (Which I imagine is what curl does.)\n", "@sigmavirus24 we should document this wealth of information you have in your brain :)\n", "We could add a \"low-level details\" section to the documentation. I think that would be wildly advanteous to our power users. \n", "That's a neat idea. We can explain some weird edge-cases, like why the read timeout works the way it works.\n", "@sigmavirus24 The graph is from the networking tab of Windows Task Manger. It is indeed showing network throughput. \n\nHere is the code for `requests` using `MultipartEncoder`. \n\n```\ndef upload_artifact_multi(self, group, version, file_path, artifact, packaging):\n head, tail = os.path.split(file_path)\n\n assert all([self.repository, packaging, group, artifact, version, file_path, tail])\n post_fields = [\n ('hasPom', 'false'),\n ('r', self.repository),\n ('e', packaging),\n ('g', group),\n ('a', artifact),\n ('v', version),\n ('p', packaging),\n ('file', (tail, open(file_path, 'rb'), 'application/octet-stream'))\n ]\n m = MultipartEncoder.from_fields(fields=post_fields)\n\n url = self._nexus_upload_url()\n r = self.session.post(url, data=m, headers={'Content-Type': m.content_type})\n r.raise_for_status()\n return r\n```\n\nAnd here is the code that is just using `requests`\n\n```\ndef upload_artifact(self, group, version, file_path, artifact, packaging):\n # only works for files smaller then 2GiB\n if os.path.getsize(file_path) > (2 * 10 ** 9):\n raise NotImplementedError(\"Cannot handle files larger then 2GiB\")\n\n form_data = {\n 'hasPom': 'false',\n 'r': self.repository,\n 'e': packaging,\n 'g': group,\n 'a': artifact,\n 'v': version,\n 'p': packaging,\n }\n url = self._nexus_upload_url()\n r = self.session.post(url, data=form_data, files={'file': open(file_path, 'rb')})\n r.raise_for_status()\n return r\n```\n\nAnd lastly, the command for `cURL`\n\n```\ncurl -v -F r=\"repo\" -F hasPom=false -F e=\"ext\" -F g=\"test.speed\" -F a=\"test1\" -F v=\"3.1.1\" -F p=\"ext\" -F file=@\"file.ext\" -u \"user\":\"pass\" http://example.com/upload\n```\n\nHere is the output from `cURL`\n\n```\n* Hostname was NOT found in DNS cache \n* Trying 10.0.0.73... \n* Connected to example.com (10.0.0.73) port 80 (#0) \n* Server auth using Basic with user 'user' \n> POST /upload HTTP/1.1 \n> Authorization: Basic d32SrwoxTADXP5vavYm90NQc= \n> User-Agent: curl/7.37.1 \n> Host: example.com \n> Accept: */* \n> Content-Length: 14737022 \n> Expect: 100-continue \n> Content-Type: multipart/form-data; boundary=------------------------ed123815827ca70f \n> \n< HTTP/1.1 100 Continue \n< HTTP/1.1 201 Created \n< Date: Tue, 26 Aug 2014 17:29:45 GMT \n* Server Nexus/2.8.1-01 is not blacklisted \n< Server: Nexus/2.8.1-01 \n< X-Frame-Options: SAMEORIGIN \n< X-Content-Type-Options: nosniff \n< Set-Cookie: rememberMe=deleteMe; Path=/nexus; Max-Age=0; Expires=Mon, 25-Aug-2014 17:29:45 GMT \n< Content-Type: text/html; charset=UTF-8 \n< Date: Tue, 26 Aug 2014 17:29:48 GMT \n* Server Noelios-Restlet-Engine/1.1.6-SONATYPE-5348-V8 is not blacklisted \n< Server: Noelios-Restlet-Engine/1.1.6-SONATYPE-5348-V8 \n< Content-Length: 86 \n< \n{\"groupId\":\"test.speed\",\"artifactId\":\"test1\",\"version\":\"3.1.1\",\"packaging\":\"ext\"}\n* Connection #0 to host example.com left intact \n```\n\nIt does not seem to make a difference whether `MultipartEncoder` is in use. Both uploads using `requests` take ~16.5 seconds. \n", "Yeah, I gotta believe that curl is avoiding the small `send` chunks.\n", "Oh how I hate `httplib`. Another item on my list of things to fix.\n", "Stupid httplib.\n", "Sorry to bring this back from the dead, but have there been any developments on this front? \n", "There have not. Sorry!\n", "@lifeofdave you could try to adapt something like https://github.com/sigmavirus24/requests-toolbelt/pull/84 to your needs. That code is not merged into the toolbelt and not really well tested. That said, it forces the a larger read than what httplib asks for meaning it will send more data than httplib intends. That said, it's probably not a good long-term solution.\n", "Hi,\r\n\r\nbringing this back from the dead once more -- sorry!\r\n\r\nI saw that httplib seems to have added a `blocksize` parameter for Python 3.7 ([Documentation Link](https://docs.python.org/3/library/http.client.html)). It defaults to 8k, but higher values can be supplied.\r\n\r\nLooking at the Requests docs, I cannot say if it's possible to set this parameter so it gets passed down to `http.client.HTTPConnection`. Is there a way to achieve this?\r\n\r\nRegards\r\nKaspar", "At the moment, no", "@kpflugshaupt I've managed to change it like this:\r\n```python\r\nfrom http.client import HTTPConnection\r\nHTTPConnection.__init__.__defaults__ = tuple(\r\n x if x != 8192 else 64*1024\r\n for x in HTTPConnection.__init__.__defaults__\r\n)\r\n```\r\n", "> @kpflugshaupt I've managed to change it like this:\n> \n> ```python\n> \n> from http.client import HTTPConnection\n> \n> HTTPConnection.__init__.__defaults__ = tuple(\n> \n> x if x != 8192 else 64*1024\n> \n> for x in HTTPConnection.__init__.__defaults__\n> \n> )\n> \n> ```\n> \n> \n\nI will try that out! Thanks for posting. ", "@kpflugshaupt Did this solution worked?\r\n\r\n> > @kpflugshaupt I've managed to change it like this:\r\n> > ```python\r\n> > from http.client import HTTPConnection\r\n> > \r\n> > HTTPConnection.__init__.__defaults__ = tuple(\r\n> > \r\n> > x if x != 8192 else 64*1024\r\n> > \r\n> > for x in HTTPConnection.__init__.__defaults__\r\n> > \r\n> > )\r\n> > ```\r\n> \r\n> I will try that out! Thanks for posting.\r\n\r\n", "> @kpflugshaupt Did this solution worked?\n> \n> \n> \n> > > @kpflugshaupt I've managed to change it like this:\n> \n> > > ```python\n> \n> > > from http.client import HTTPConnection\n> \n> > > \n> \n> > > HTTPConnection.__init__.__defaults__ = tuple(\n> \n> > > \n> \n> > > x if x != 8192 else 64*1024\n> \n> > > \n> \n> > > for x in HTTPConnection.__init__.__defaults__\n> \n> > > \n> \n> > > )\n> \n> > > ```\n> \n> > \n> \n> > I will try that out! Thanks for posting.\n> \n> \n> \n> \n\nYes, it works. But I feel it's a bit fragile, as it depends on the current internals of http.client, which may change. \n\nStill, I may end up using it if I run into performance problems. So far, I avoided them by keeping my transfers small. \n\nCheers & thanks\nKaspar" ]
https://api.github.com/repos/psf/requests/issues/2180
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/2180/labels{/name}
https://api.github.com/repos/psf/requests/issues/2180/comments
https://api.github.com/repos/psf/requests/issues/2180/events
https://github.com/psf/requests/issues/2180
41,126,980
MDU6SXNzdWU0MTEyNjk4MA==
2,180
Github timeline no longer available - makes poor example
{ "avatar_url": "https://avatars.githubusercontent.com/u/640535?v=4", "events_url": "https://api.github.com/users/Rosuav/events{/privacy}", "followers_url": "https://api.github.com/users/Rosuav/followers", "following_url": "https://api.github.com/users/Rosuav/following{/other_user}", "gists_url": "https://api.github.com/users/Rosuav/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Rosuav", "id": 640535, "login": "Rosuav", "node_id": "MDQ6VXNlcjY0MDUzNQ==", "organizations_url": "https://api.github.com/users/Rosuav/orgs", "received_events_url": "https://api.github.com/users/Rosuav/received_events", "repos_url": "https://api.github.com/users/Rosuav/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Rosuav/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Rosuav/subscriptions", "type": "User", "url": "https://api.github.com/users/Rosuav", "user_view_type": "public" }
[]
closed
true
null
[]
null
7
2014-08-26T01:02:41Z
2021-09-08T23:10:40Z
2014-08-26T19:41:45Z
NONE
resolved
The quickstart tutorial recommends fetching https://github.com/timeline.json, which does technically work, and it does return a block of JSON text. But it's an unideal example, because all it tells you is "this service isn't available, go use the Events API". Could do with replacement, I think.
{ "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/2180/reactions" }
https://api.github.com/repos/psf/requests/issues/2180/timeline
null
completed
null
null
false
[ "Good catch! @sigmavirus24, you know the GitHub API best, what endpoint should we hit?\n", "It wasn't actually me who caught it, but a student I'm mentoring. He sent me his non-working code, I tried it on my system (it worked - he had a completely unrelated issue), and that's where I saw this. :)\n", "So that used to be the public timeline of events on GitHub apparently. If we want to just replace the URL, we could use `https://api.github.com/events`. That'll return the latest 25 events.\n", "Let's do that.\n", "Looks good to me!\n", "we could always do httpbin too\n", "We do httpbin elsewhere in that example, but I liked that it was useful information.\n" ]
https://api.github.com/repos/psf/requests/issues/2179
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/2179/labels{/name}
https://api.github.com/repos/psf/requests/issues/2179/comments
https://api.github.com/repos/psf/requests/issues/2179/events
https://github.com/psf/requests/pull/2179
41,104,327
MDExOlB1bGxSZXF1ZXN0MjAyNzEwMDY=
2,179
Updates urllib3 to 528ad3c
{ "avatar_url": "https://avatars.githubusercontent.com/u/234019?v=4", "events_url": "https://api.github.com/users/kevinburke/events{/privacy}", "followers_url": "https://api.github.com/users/kevinburke/followers", "following_url": "https://api.github.com/users/kevinburke/following{/other_user}", "gists_url": "https://api.github.com/users/kevinburke/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kevinburke", "id": 234019, "login": "kevinburke", "node_id": "MDQ6VXNlcjIzNDAxOQ==", "organizations_url": "https://api.github.com/users/kevinburke/orgs", "received_events_url": "https://api.github.com/users/kevinburke/received_events", "repos_url": "https://api.github.com/users/kevinburke/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kevinburke/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kevinburke/subscriptions", "type": "User", "url": "https://api.github.com/users/kevinburke", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2014-08-25T20:47:33Z
2021-09-08T11:00:48Z
2014-08-26T19:10:51Z
CONTRIBUTOR
resolved
This includes fixes for openssl running with Pypy, so SSL connections can be made if ndg-httpsclient, pyopenssl and pyasn1 are installed. see also: - https://github.com/shazow/urllib3/issues/449 - https://github.com/pypa/pip/issues/1988
{ "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/2179/reactions" }
https://api.github.com/repos/psf/requests/issues/2179/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/2179.diff", "html_url": "https://github.com/psf/requests/pull/2179", "merged_at": "2014-08-26T19:10:51Z", "patch_url": "https://github.com/psf/requests/pull/2179.patch", "url": "https://api.github.com/repos/psf/requests/pulls/2179" }
true
[ "many thanks!\n" ]
https://api.github.com/repos/psf/requests/issues/2178
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/2178/labels{/name}
https://api.github.com/repos/psf/requests/issues/2178/comments
https://api.github.com/repos/psf/requests/issues/2178/events
https://github.com/psf/requests/pull/2178
40,984,512
MDExOlB1bGxSZXF1ZXN0MjAyMTM2Nzc=
2,178
Add Session method to merge environment settings with per-request settings
{ "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
{ "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" }
[ { "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" } ]
null
5
2014-08-23T20:52:48Z
2021-09-08T11:00:49Z
2014-08-26T19:44:51Z
CONTRIBUTOR
resolved
See also #2129
{ "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/2178/reactions" }
https://api.github.com/repos/psf/requests/issues/2178/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/2178.diff", "html_url": "https://github.com/psf/requests/pull/2178", "merged_at": "2014-08-26T19:44:51Z", "patch_url": "https://github.com/psf/requests/pull/2178.patch", "url": "https://api.github.com/repos/psf/requests/pulls/2178" }
true
[ "One minor note, otherwise LGTM.\n", "Tests fail. \n", "Tests were passing locally so I rebased and pushed hoping that solves the issue.\n", "Looks like httpbin is having intermittent failures? The same tests aren't failing on the same Python versions, and there is a lot of this\n\nProtocolError: ('Connection aborted.', error(110, 'Connection timed out'))\n", "Hmm, just changed the deployment configuration. \n" ]
https://api.github.com/repos/psf/requests/issues/2177
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/2177/labels{/name}
https://api.github.com/repos/psf/requests/issues/2177/comments
https://api.github.com/repos/psf/requests/issues/2177/events
https://github.com/psf/requests/issues/2177
40,983,426
MDU6SXNzdWU0MDk4MzQyNg==
2,177
Update PyPy version on ci.kennethreitz.org
{ "avatar_url": "https://avatars.githubusercontent.com/u/234019?v=4", "events_url": "https://api.github.com/users/kevinburke/events{/privacy}", "followers_url": "https://api.github.com/users/kevinburke/followers", "following_url": "https://api.github.com/users/kevinburke/following{/other_user}", "gists_url": "https://api.github.com/users/kevinburke/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kevinburke", "id": 234019, "login": "kevinburke", "node_id": "MDQ6VXNlcjIzNDAxOQ==", "organizations_url": "https://api.github.com/users/kevinburke/orgs", "received_events_url": "https://api.github.com/users/kevinburke/received_events", "repos_url": "https://api.github.com/users/kevinburke/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kevinburke/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kevinburke/subscriptions", "type": "User", "url": "https://api.github.com/users/kevinburke", "user_view_type": "public" }
[]
closed
true
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
[ { "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" } ]
null
4
2014-08-23T19:57:18Z
2021-09-08T23:10:38Z
2014-08-29T14:25:57Z
CONTRIBUTOR
resolved
The latest version of PyPy is 2.3.1 (Python 2.7.6), but the Jenkins boxes are running pypy 1.8 The pypy docs mention something about a sandboxed version shipping with 1.8, is that why it's so old on those machines?
{ "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/2177/reactions" }
https://api.github.com/repos/psf/requests/issues/2177/timeline
null
completed
null
null
false
[ "@kennethreitz, we're going to need your input on this one.\n", "Relatedly, we should be adding Python 3.4 to the test matrix.\n", "I'll have to do the dirty work soon :)\n", "Python 3.4 added. PyPy isn't a big deal.\n" ]
https://api.github.com/repos/psf/requests/issues/2176
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/2176/labels{/name}
https://api.github.com/repos/psf/requests/issues/2176/comments
https://api.github.com/repos/psf/requests/issues/2176/events
https://github.com/psf/requests/pull/2176
40,983,105
MDExOlB1bGxSZXF1ZXN0MjAyMTMwMzU=
2,176
Add support for connect timeouts
{ "avatar_url": "https://avatars.githubusercontent.com/u/234019?v=4", "events_url": "https://api.github.com/users/kevinburke/events{/privacy}", "followers_url": "https://api.github.com/users/kevinburke/followers", "following_url": "https://api.github.com/users/kevinburke/following{/other_user}", "gists_url": "https://api.github.com/users/kevinburke/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kevinburke", "id": 234019, "login": "kevinburke", "node_id": "MDQ6VXNlcjIzNDAxOQ==", "organizations_url": "https://api.github.com/users/kevinburke/orgs", "received_events_url": "https://api.github.com/users/kevinburke/received_events", "repos_url": "https://api.github.com/users/kevinburke/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kevinburke/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kevinburke/subscriptions", "type": "User", "url": "https://api.github.com/users/kevinburke", "user_view_type": "public" }
[]
closed
true
null
[]
null
11
2014-08-23T19:39:43Z
2021-09-08T11:00:47Z
2014-08-26T19:13:30Z
CONTRIBUTOR
resolved
Modifies the timeout interface to also accept a tuple (connect, read) which would be used to set individual connect and read timeouts for Requests. Adds Advanced documentation explaining the interface and providing guidance for timeout values.
{ "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/2176/reactions" }
https://api.github.com/repos/psf/requests/issues/2176/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/2176.diff", "html_url": "https://github.com/psf/requests/pull/2176", "merged_at": "2014-08-26T19:13:30Z", "patch_url": "https://github.com/psf/requests/pull/2176.patch", "url": "https://api.github.com/repos/psf/requests/pulls/2176" }
true
[ "For perspective, this is basically a rebase/rewrite of #1801.\n\nI have always been in favour of this change, at least in principle, and I'm happy with the implementation as well. =)\n", "okay I killed the extra format try/catch & rebased\n", "So there is a latent issue here.\n\nIn the event that Requests supports the `urllib3.util.Retry` class at some future point, more things may be raised as MaxRetryError, including read timeouts. \n\nI don't know that there's anything to do right now since requests controls how retry is used, but worth mentioning.\n", "Let's deal with one problem at a time. That's not a bug _right now_, it's just a trap for anyone who wants to implement that support (inevitably it would be you, Kevin, so it's all good. ;) )\n", "I think the way we currently use the `Retry` class would allow users to import and use the `Retry` class with requests. I might be remembering incorrectly though.\n", ":sparkles: :cake: :sparkles:\n", "Time for a new release, once #2178 is ready. \n", "I would petition that we wait until @willingc can get her `json` parameter pull request in good shape for us to review.\n", "@sigmavirus24 that can be 2.4.1 :)\n", "@kevinburke want to add some docs? :)\n", "@kennethreitz I added this section on timeouts:\nhttp://docs.python-requests.org/en/latest/user/advanced/#timeouts\n\nJust noticed I missed some method signatures, will add the docs for those\nnow.\n\n## \n\nKevin Burke\nphone: 925.271.7005 | twentymilliseconds.com\n\nOn Fri, Aug 29, 2014 at 7:28 AM, Kenneth Reitz [email protected]\nwrote:\n\n> @kevinburke https://github.com/kevinburke want to add some docs? :)\n> \n> —\n> Reply to this email directly or view it on GitHub\n> https://github.com/kennethreitz/requests/pull/2176#issuecomment-53882868\n> .\n" ]
https://api.github.com/repos/psf/requests/issues/2175
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/2175/labels{/name}
https://api.github.com/repos/psf/requests/issues/2175/comments
https://api.github.com/repos/psf/requests/issues/2175/events
https://github.com/psf/requests/pull/2175
40,982,781
MDExOlB1bGxSZXF1ZXN0MjAyMTI4OTE=
2,175
add bad host test
{ "avatar_url": "https://avatars.githubusercontent.com/u/234019?v=4", "events_url": "https://api.github.com/users/kevinburke/events{/privacy}", "followers_url": "https://api.github.com/users/kevinburke/followers", "following_url": "https://api.github.com/users/kevinburke/following{/other_user}", "gists_url": "https://api.github.com/users/kevinburke/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kevinburke", "id": 234019, "login": "kevinburke", "node_id": "MDQ6VXNlcjIzNDAxOQ==", "organizations_url": "https://api.github.com/users/kevinburke/orgs", "received_events_url": "https://api.github.com/users/kevinburke/received_events", "repos_url": "https://api.github.com/users/kevinburke/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kevinburke/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kevinburke/subscriptions", "type": "User", "url": "https://api.github.com/users/kevinburke", "user_view_type": "public" }
[ { "color": "e11d21", "default": false, "description": null, "id": 78002701, "name": "Do Not Merge", "node_id": "MDU6TGFiZWw3ODAwMjcwMQ==", "url": "https://api.github.com/repos/psf/requests/labels/Do%20Not%20Merge" } ]
closed
true
null
[]
null
0
2014-08-23T19:23:01Z
2021-09-08T11:00:53Z
2014-08-23T21:19:04Z
CONTRIBUTOR
resolved
Please don't merge this, I'm trying to track down behavior issues in CPython + Pypy
{ "avatar_url": "https://avatars.githubusercontent.com/u/234019?v=4", "events_url": "https://api.github.com/users/kevinburke/events{/privacy}", "followers_url": "https://api.github.com/users/kevinburke/followers", "following_url": "https://api.github.com/users/kevinburke/following{/other_user}", "gists_url": "https://api.github.com/users/kevinburke/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kevinburke", "id": 234019, "login": "kevinburke", "node_id": "MDQ6VXNlcjIzNDAxOQ==", "organizations_url": "https://api.github.com/users/kevinburke/orgs", "received_events_url": "https://api.github.com/users/kevinburke/received_events", "repos_url": "https://api.github.com/users/kevinburke/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kevinburke/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kevinburke/subscriptions", "type": "User", "url": "https://api.github.com/users/kevinburke", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/2175/reactions" }
https://api.github.com/repos/psf/requests/issues/2175/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/2175.diff", "html_url": "https://github.com/psf/requests/pull/2175", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/2175.patch", "url": "https://api.github.com/repos/psf/requests/pulls/2175" }
true
[]
https://api.github.com/repos/psf/requests/issues/2174
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/2174/labels{/name}
https://api.github.com/repos/psf/requests/issues/2174/comments
https://api.github.com/repos/psf/requests/issues/2174/events
https://github.com/psf/requests/pull/2174
40,979,992
MDExOlB1bGxSZXF1ZXN0MjAyMTE2NDU=
2,174
Clarify which tests to run in the Makefile
{ "avatar_url": "https://avatars.githubusercontent.com/u/234019?v=4", "events_url": "https://api.github.com/users/kevinburke/events{/privacy}", "followers_url": "https://api.github.com/users/kevinburke/followers", "following_url": "https://api.github.com/users/kevinburke/following{/other_user}", "gists_url": "https://api.github.com/users/kevinburke/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kevinburke", "id": 234019, "login": "kevinburke", "node_id": "MDQ6VXNlcjIzNDAxOQ==", "organizations_url": "https://api.github.com/users/kevinburke/orgs", "received_events_url": "https://api.github.com/users/kevinburke/received_events", "repos_url": "https://api.github.com/users/kevinburke/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kevinburke/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kevinburke/subscriptions", "type": "User", "url": "https://api.github.com/users/kevinburke", "user_view_type": "public" }
[ { "color": "009800", "default": false, "description": null, "id": 44501218, "name": "Ready To Merge", "node_id": "MDU6TGFiZWw0NDUwMTIxOA==", "url": "https://api.github.com/repos/psf/requests/labels/Ready%20To%20Merge" }, { "color": "207de5", "default": false, "description": null, "id": 60620163, "name": "Minion Seal of Approval", "node_id": "MDU6TGFiZWw2MDYyMDE2Mw==", "url": "https://api.github.com/repos/psf/requests/labels/Minion%20Seal%20of%20Approval" } ]
closed
true
null
[]
null
1
2014-08-23T17:06:15Z
2021-09-08T11:00:49Z
2014-08-26T19:15:28Z
CONTRIBUTOR
resolved
If you put your Virtualenv in the same folder as Requests (as I usually do), py.test will pick up any test_\* files inside the virtualenv and attempt to run them too, leading to the following error: https://gist.github.com/kevinburke/1aa2b07e01de3a7daa15 Instead specify the test file we would like to run in the Makefile.
{ "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/2174/reactions" }
https://api.github.com/repos/psf/requests/issues/2174/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/2174.diff", "html_url": "https://github.com/psf/requests/pull/2174", "merged_at": "2014-08-26T19:15:28Z", "patch_url": "https://github.com/psf/requests/pull/2174.patch", "url": "https://api.github.com/repos/psf/requests/pulls/2174" }
true
[ ":+1: :cake:\n\nThis is a PITA. Let's do it.\n" ]
https://api.github.com/repos/psf/requests/issues/2173
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/2173/labels{/name}
https://api.github.com/repos/psf/requests/issues/2173/comments
https://api.github.com/repos/psf/requests/issues/2173/events
https://github.com/psf/requests/pull/2173
40,889,586
MDExOlB1bGxSZXF1ZXN0MjAxNTkyNzY=
2,173
Documentation update : connection keep alive
{ "avatar_url": "https://avatars.githubusercontent.com/u/407189?v=4", "events_url": "https://api.github.com/users/tychotatitscheff/events{/privacy}", "followers_url": "https://api.github.com/users/tychotatitscheff/followers", "following_url": "https://api.github.com/users/tychotatitscheff/following{/other_user}", "gists_url": "https://api.github.com/users/tychotatitscheff/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/tychotatitscheff", "id": 407189, "login": "tychotatitscheff", "node_id": "MDQ6VXNlcjQwNzE4OQ==", "organizations_url": "https://api.github.com/users/tychotatitscheff/orgs", "received_events_url": "https://api.github.com/users/tychotatitscheff/received_events", "repos_url": "https://api.github.com/users/tychotatitscheff/repos", "site_admin": false, "starred_url": "https://api.github.com/users/tychotatitscheff/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/tychotatitscheff/subscriptions", "type": "User", "url": "https://api.github.com/users/tychotatitscheff", "user_view_type": "public" }
[]
closed
true
null
[]
null
3
2014-08-22T08:45:23Z
2021-09-08T11:00:47Z
2014-08-22T10:47:35Z
NONE
resolved
Concerning #2169, i get a problem with automatic keep alive. @sigmavirus24 has commented this saying that was in documentation but can have been lost.
{ "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/2173/reactions" }
https://api.github.com/repos/psf/requests/issues/2173/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/2173.diff", "html_url": "https://github.com/psf/requests/pull/2173", "merged_at": "2014-08-22T10:47:35Z", "patch_url": "https://github.com/psf/requests/pull/2173.patch", "url": "https://api.github.com/repos/psf/requests/pulls/2173" }
true
[ "Thanks for this! :cake: :star:\n", "Thank you @tychotatitscheff!! :sparkles: :cake: :sparkles: \n", "The documentation was right, the code was wrong. \n" ]
https://api.github.com/repos/psf/requests/issues/2172
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/2172/labels{/name}
https://api.github.com/repos/psf/requests/issues/2172/comments
https://api.github.com/repos/psf/requests/issues/2172/events
https://github.com/psf/requests/pull/2172
40,833,628
MDExOlB1bGxSZXF1ZXN0MjAxMjc5OTk=
2,172
Add to authors and fix case
{ "avatar_url": "https://avatars.githubusercontent.com/u/7707694?v=4", "events_url": "https://api.github.com/users/ContinuousFunction/events{/privacy}", "followers_url": "https://api.github.com/users/ContinuousFunction/followers", "following_url": "https://api.github.com/users/ContinuousFunction/following{/other_user}", "gists_url": "https://api.github.com/users/ContinuousFunction/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/ContinuousFunction", "id": 7707694, "login": "ContinuousFunction", "node_id": "MDQ6VXNlcjc3MDc2OTQ=", "organizations_url": "https://api.github.com/users/ContinuousFunction/orgs", "received_events_url": "https://api.github.com/users/ContinuousFunction/received_events", "repos_url": "https://api.github.com/users/ContinuousFunction/repos", "site_admin": false, "starred_url": "https://api.github.com/users/ContinuousFunction/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/ContinuousFunction/subscriptions", "type": "User", "url": "https://api.github.com/users/ContinuousFunction", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2014-08-21T18:27:35Z
2021-09-08T11:00:55Z
2014-08-22T13:04:50Z
CONTRIBUTOR
resolved
Fix sentence case requests by sigmavirus24 here: https://github.com/kennethreitz/requests/pull/2168 Added myself to authors.
{ "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/2172/reactions" }
https://api.github.com/repos/psf/requests/issues/2172/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/2172.diff", "html_url": "https://github.com/psf/requests/pull/2172", "merged_at": "2014-08-22T13:04:50Z", "patch_url": "https://github.com/psf/requests/pull/2172.patch", "url": "https://api.github.com/repos/psf/requests/pulls/2172" }
true
[ "Many thank yous :)\n" ]
https://api.github.com/repos/psf/requests/issues/2171
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/2171/labels{/name}
https://api.github.com/repos/psf/requests/issues/2171/comments
https://api.github.com/repos/psf/requests/issues/2171/events
https://github.com/psf/requests/issues/2171
40,784,032
MDU6SXNzdWU0MDc4NDAzMg==
2,171
https requests error
{ "avatar_url": "https://avatars.githubusercontent.com/u/3103577?v=4", "events_url": "https://api.github.com/users/crouse/events{/privacy}", "followers_url": "https://api.github.com/users/crouse/followers", "following_url": "https://api.github.com/users/crouse/following{/other_user}", "gists_url": "https://api.github.com/users/crouse/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/crouse", "id": 3103577, "login": "crouse", "node_id": "MDQ6VXNlcjMxMDM1Nzc=", "organizations_url": "https://api.github.com/users/crouse/orgs", "received_events_url": "https://api.github.com/users/crouse/received_events", "repos_url": "https://api.github.com/users/crouse/repos", "site_admin": false, "starred_url": "https://api.github.com/users/crouse/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/crouse/subscriptions", "type": "User", "url": "https://api.github.com/users/crouse", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2014-08-21T08:45:57Z
2021-09-08T23:10:39Z
2014-08-27T19:35:24Z
NONE
resolved
Just see my example: it works with curl [root@localhost ~]# curl -X GET https://openapi/face/ --cacert /export/server.pem {"datetime": "2014-08-21 08:30:30.896918", "face": "a smiling face"}[root@localhost ~]# But requests did not work, see > > > r = requests.get('https://openapi/face/', cert='/export/server.pem') > > > Traceback (most recent call last): > > > File "<stdin>", line 1, in <module> > > > File "/usr/lib/python2.6/site-packages/requests/api.py", line 55, in get > > > return request('get', url, *_kwargs) > > > File "/usr/lib/python2.6/site-packages/requests/api.py", line 44, in request > > > return session.request(method=method, url=url, *_kwargs) > > > File "/usr/lib/python2.6/site-packages/requests/sessions.py", line 456, in request > > > resp = self.send(prep, *_send_kwargs) > > > File "/usr/lib/python2.6/site-packages/requests/sessions.py", line 559, in send > > > r = adapter.send(request, *_kwargs) > > > File "/usr/lib/python2.6/site-packages/requests/adapters.py", line 382, in send > > > raise SSLError(e, request=request) > > > requests.exceptions.SSLError: [Errno 336265225] _ssl.c:339: error:140B0009:SSL routines:SSL_CTX_use_PrivateKey_file:PEM lib Can anybody help me
{ "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/2171/reactions" }
https://api.github.com/repos/psf/requests/issues/2171/timeline
null
completed
null
null
false
[ "You're using the wrong argument. The `cert` command line argument provides a _client_ certificate, you want to provide the server certificate. Try this:\n\n``` python\nr = requests.get('https://openapi/face/', verify='/export/server.pem')\n```\n" ]
https://api.github.com/repos/psf/requests/issues/2170
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/2170/labels{/name}
https://api.github.com/repos/psf/requests/issues/2170/comments
https://api.github.com/repos/psf/requests/issues/2170/events
https://github.com/psf/requests/issues/2170
40,750,463
MDU6SXNzdWU0MDc1MDQ2Mw==
2,170
SSL verification failing for a valid GeoTrust Global CA certificate
{ "avatar_url": "https://avatars.githubusercontent.com/u/1622880?v=4", "events_url": "https://api.github.com/users/guardrex/events{/privacy}", "followers_url": "https://api.github.com/users/guardrex/followers", "following_url": "https://api.github.com/users/guardrex/following{/other_user}", "gists_url": "https://api.github.com/users/guardrex/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/guardrex", "id": 1622880, "login": "guardrex", "node_id": "MDQ6VXNlcjE2MjI4ODA=", "organizations_url": "https://api.github.com/users/guardrex/orgs", "received_events_url": "https://api.github.com/users/guardrex/received_events", "repos_url": "https://api.github.com/users/guardrex/repos", "site_admin": false, "starred_url": "https://api.github.com/users/guardrex/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/guardrex/subscriptions", "type": "User", "url": "https://api.github.com/users/guardrex", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2014-08-20T22:04:27Z
2021-09-08T23:10:40Z
2014-08-20T22:24:46Z
NONE
resolved
I'm having trouble with SSL cert verification for a valid CA-signed cert ... and I can't seem to add the CA cert that I need to the cacert.pem file. Computer: Raspberry Pi connecting to a website on IIS8/WS2012 (TLS 1.0/1.1/1.2; Note: SSL3 is not supported by this server) OS: Arch Linux (3.12.26-1-ARCH) Language: Python 3.4.1 Certificate Chain: my_site_cert > RapidSSL CA (Serial #: 0236d1) > GeoTrust Global CA (Serial #: 023456) Trying to get an secure session open to some valid CA-signed endpionts (e.g,. Microsoft Azure endpoints with certificates signed by Baltimore CyberTrust Root) work fine with requests. However, attempting to open a secure connection to a website with an equally valid certificate signed by a GeoTrust Global CA fails with the invalid certificate error. It looks like requests is using the CA bundle at: ``` /usr/lib/python3.4/site-packages/requests/cacert.pem ``` ... and that bundle does contain a GeoTrust Global CA. Looking at the cert entry for the GeoTrust Global CA entry, I can see that it does not match the base64-encoded cert that I pulled down from my certificate chain. The serial numbers don't match either. I took the base64-encoded certificate block for the one I presumably need ``` -----BEGIN CERTIFICATE----- xxxxxxx -----END CERTIFICATE----- ``` ... and pasted it into the cacert.pem file that requests uses. I rebooted. This did not work. I'm still getting the exception: ``` [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:598) ``` What do I need to do to get my CA cert installed in such a way that requests will pick it up and grant my secure connection? The docs are too vague about the specific path to use for other ca bundles in Arch Linux (e.g., ca-certificates or openssl ca bundles), and there is no information about getting other CA certs in the right spot for requests to pick them up. I certainly don't want to run a production system with `verify=False`.
{ "avatar_url": "https://avatars.githubusercontent.com/u/1622880?v=4", "events_url": "https://api.github.com/users/guardrex/events{/privacy}", "followers_url": "https://api.github.com/users/guardrex/followers", "following_url": "https://api.github.com/users/guardrex/following{/other_user}", "gists_url": "https://api.github.com/users/guardrex/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/guardrex", "id": 1622880, "login": "guardrex", "node_id": "MDQ6VXNlcjE2MjI4ODA=", "organizations_url": "https://api.github.com/users/guardrex/orgs", "received_events_url": "https://api.github.com/users/guardrex/received_events", "repos_url": "https://api.github.com/users/guardrex/repos", "site_admin": false, "starred_url": "https://api.github.com/users/guardrex/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/guardrex/subscriptions", "type": "User", "url": "https://api.github.com/users/guardrex", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/2170/reactions" }
https://api.github.com/repos/psf/requests/issues/2170/timeline
null
completed
null
null
false
[ "Is your system time correct?\n", "Good grief! It's amazing how simple it was to fix this. Thank you so much for that. It turns out that I had the wrong command in my service shell script that runs on boot to move the hardware clock time to the system time (I see now that the correct command is `hwclock --hctosys`). DOH! Bart! I'm a .NET guy, so what do I know about Linux ... still way way back on the learning curve. Thanks again. I recommend this tiny little tip be put into the docs in the SSL Verification section.\n" ]
https://api.github.com/repos/psf/requests/issues/2169
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/2169/labels{/name}
https://api.github.com/repos/psf/requests/issues/2169/comments
https://api.github.com/repos/psf/requests/issues/2169/events
https://github.com/psf/requests/issues/2169
40,489,816
MDU6SXNzdWU0MDQ4OTgxNg==
2,169
Connection keep alive issue
{ "avatar_url": "https://avatars.githubusercontent.com/u/407189?v=4", "events_url": "https://api.github.com/users/tychotatitscheff/events{/privacy}", "followers_url": "https://api.github.com/users/tychotatitscheff/followers", "following_url": "https://api.github.com/users/tychotatitscheff/following{/other_user}", "gists_url": "https://api.github.com/users/tychotatitscheff/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/tychotatitscheff", "id": 407189, "login": "tychotatitscheff", "node_id": "MDQ6VXNlcjQwNzE4OQ==", "organizations_url": "https://api.github.com/users/tychotatitscheff/orgs", "received_events_url": "https://api.github.com/users/tychotatitscheff/received_events", "repos_url": "https://api.github.com/users/tychotatitscheff/repos", "site_admin": false, "starred_url": "https://api.github.com/users/tychotatitscheff/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/tychotatitscheff/subscriptions", "type": "User", "url": "https://api.github.com/users/tychotatitscheff", "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": "fef2c0", "default": false, "description": null, "id": 60669570, "name": "Please Review", "node_id": "MDU6TGFiZWw2MDY2OTU3MA==", "url": "https://api.github.com/repos/psf/requests/labels/Please%20Review" } ]
closed
true
null
[]
null
26
2014-08-18T13:51:38Z
2021-09-08T23:10:38Z
2014-08-29T14:24:23Z
NONE
resolved
_Maybe it is not the right place to report this, its one of my first issue report_ Winows 7 Python 3.4 Request 2.3 In requests' main site it's said: > > connection keepalive should be 100% automatic. However in my case: - on a ssl connection - throught http proxy I had to add the `"connection" : "keep-alive"` header. But it took me so much time to find it because the exceeption raised was a `requests.exceptions.ProxyError` So i went into the code and find that: ``` python httplib_response = conn.getresponse() ``` in `_make_request()` function in `connection_pool.py` raise a `SocketError` wich is converted to a `ReadTimeoutError` : all correct for now since no connection then we come to a timeout. But then this error is rewrap to something incorrect in `connectionpool.py`. ``` python except (TimeoutError, HTTPException, SocketError) as e: if conn: # Discard the connection for these exceptions. It will be # be replaced during the next _get_conn() call. conn.close() conn = None if not retries: if isinstance(e, TimeoutError): # TimeoutError is exempt from MaxRetryError-wrapping. # FIXME: ... Not sure why. Add a reason here. raise # Wrap unexpected exceptions with the most appropriate # module-level exception and re-raise. if isinstance(e, SocketError) and self.proxy: raise ProxyError('Cannot connect to proxy.', e) if retries is False: raise ConnectionError('Connection failed.', e) raise MaxRetryError(self, url, e) # Keep track of the error for the retry warning. err = e ``` and since there is a proxy. Boom. proxy error. So **WRONG** advice in requests site and **bug** in urllib3. Hope it can help.
{ "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/2169/reactions" }
https://api.github.com/repos/psf/requests/issues/2169/timeline
null
completed
null
null
false
[ "I could have sworn this was already documented (that in order to enable keep-alive you had to set that header yourself). It seems to have been lost. The documentation is only partially incorrect in this case. There is no bug in urllib3 as I understand it.\n", "Was no critic, but an improvement suggestion.\n\nYes bug is stronger term but I think that rewrapping a `SocketError` to a `ProxyError` as soon as their is a proxy and even if these is no `ProxyError` can be misleading. I don't study the code deep enough but maybe adding a function that can sort of heartbeet through the ssl socket can determine if it is really a proxy error or just the connection is closed.\n\nMaybe it can be possible in future request version to add this header as default. I think that all browser nowdays use persistent request, isn't it.\nBut maybe request is no the place to do it and it shall be done directly in `http.client` _(client.py)_ as it is already been done for Accept-Encoding:\n\n``` python\nif not skip_host:\n # this header is issued *only* for HTTP/1.1\n # connections. more specifically, this means it is\n # only issued when the client uses the new\n # HTTPConnection() class. backwards-compat clients\n # will be using HTTP/1.0 and those clients may be\n # issuing this header themselves. we should NOT issue\n # it twice; some web servers (such as Apache) barf\n # when they see two Host: headers\n\n # If we need a non-standard port,include it in the\n # header. If the request is going through a proxy,\n # but the host of the actual URL, not the host of the\n # proxy.\n\n netloc = ''\n if url.startswith('http'):\n nil, netloc, nil, nil, nil = urlsplit(url)\n\n if netloc:\n try:\n netloc_enc = netloc.encode(\"ascii\")\n except UnicodeEncodeError:\n netloc_enc = netloc.encode(\"idna\")\n self.putheader('Host', netloc_enc)\n else:\n if self._tunnel_host:\n host = self._tunnel_host\n port = self._tunnel_port\n else:\n host = self.host\n port = self.port\n\n try:\n host_enc = host.encode(\"ascii\")\n except UnicodeEncodeError:\n host_enc = host.encode(\"idna\")\n\n # As per RFC 273, IPv6 address should be wrapped with []\n # when used as Host header\n\n if host.find(':') >= 0:\n host_enc = b'[' + host_enc + b']'\n\n if port == self.default_port:\n self.putheader('Host', host_enc)\n else:\n host_enc = host_enc.decode(\"ascii\")\n self.putheader('Host', \"%s:%s\" % (host_enc, port))\n\n# note: we are assuming that clients will not attempt to set these\n# headers since *this* library must deal with the\n# consequences. this also means that when the supporting\n# libraries are updated to recognize other forms, then this\n# code should be changed (removed or updated).\n\n# we only want a Content-Encoding of \"identity\" since we don't\n# support encodings such as x-gzip or x-deflate.\nif not skip_accept_encoding:\n self.putheader('Accept-Encoding', 'identity')\n\n# we can accept \"chunked\" Transfer-Encodings, but no others\n# NOTE: no TE header implies *only* \"chunked\"\n#self.putheader('TE', 'chunked')\n\n# if TE is supplied in the header, then it must appear in a\n# Connection header.\n#self.putheader('Connection', 'TE')\n```\n", "This seems like a major bug to me — has this always been the case?\n\nKeep alive should absolutely be automatic, just like it is in a web browser. \n\nIs there something preventing us from doing that?\n", "I wonder if @kevinburke or someone else removed it in one of their PRs modifying the default headers we set\n", "Uh, by default we emit 'Connection: close':\n\n``` python\n>>> r = requests.get('http://httpbin.org/get')\n>>> print r.json()['headers'][u'Connection']\nclose\n```\n\nThat seems like it's the source of the problem. =P\n", "Hi,\nindead all the browser nowadays include by defalt this header.\nA solution may be to add the kwargs `{keepalive=True}` that automaticaly put the header.\nIf the user need to desctive it he can just set it back to False.\n\nShould this be fix in request lib or direcly in `http.client`\n", "Suspect requests should just set the header, the user can always override it.\n\nMaybe make it a default field in `Session.headers`?\n", "Are we sure this didn't change in urllib3 at some point?\n\nI'm okay with making it default, but feel very confident that this used to be something the user _had_ to set in order to have the behaviour. If I remember correctly, setting the header is all the user needs to do.\n", "I don't think so. Our docs strongly suggest it's always been automatic. It's possible urllib3 changed it, I suppose.\n", "So looking at our git history makes me think this used to be part of 0.x's config options and that urllib3 made it possible to not have to set anything on our end. 1c20d01f10e13a0c2f9348b062d04d5f222542db seems to indicate, however, that we never set the header and users would need to set it themselves. All in all, this makes me think the documentation was strongly misleading (and a bit contradictory) in assuming it would be automatic.\n", "Well, not setting it by default make very hard to find problems:\n1. there is no clue this can be this cause the exception is raise on ssl socket level and then badly rewritten (cf first post, in wich it appears as proxy error as soon as a proxy exists)\n2. all the browser (and **also curl**) set it automaticly so for users using for instance chrome developper tools or firefox ones to watch request and then redo it, they will search for a lot of time before thinking to this\n", "I think Heroku may be emitting that header when it passes the connection to\nyour app\n\n``` python\nr = requests.get('http://httpbin.org/headers'); r.request.headers\n{'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'User-Agent':\n'python-requests/2.3.0 PyPy/2.3.1 Darwin/13.3.0'}\n```\n\nVersus\n\n``` python\n>>>> requests.get('http://httpbin.org/headers')\n<Response [200]>\n>>>> r = _\n>>>> r.content\n'{\\n \"headers\": {\\n \"Accept\": \"*/*\", \\n \"Accept-Encoding\": \"gzip,\ndeflate\", \\n \"Connection\": \"close\", \\n \"Host\": \"httpbin.org\", \\n\n \"User-Agent\": \"python-requests/2.3.0 PyPy/2.3.1 Darwin/13.3.0\", \\n\n \"X-Request-Id\": \"0d7b324b-0979-44a3-823b-547484c8f51b\"\\n }\\n}'\n```\n\n## \n\nKevin Burke\nphone: 925.271.7005 | kev.inburke.com\n\nOn Tue, Aug 26, 2014 at 12:33 PM, Cory Benfield [email protected]\nwrote:\n\n> Uh, by default we emit 'Connection: close':\n> \n> > > > r = requests.get('http://httpbin.org/get')>>> print r.json()['headers'][u'Connection']close\n> \n> That seems like it's the source of the problem. =P\n> \n> —\n> Reply to this email directly or view it on GitHub\n> https://github.com/kennethreitz/requests/issues/2169#issuecomment-53475860\n> .\n", "I set up a Flask app that shows no connection header is being sent\n\nhttps://gist.github.com/kevinburke/bf5d6e30aa8588ba5b16\n\n## \n\nKevin Burke\nphone: 925.271.7005 | kev.inburke.com\n\nOn Tue, Aug 26, 2014 at 2:20 PM, Kevin Burke [email protected] wrote:\n\n> I think Heroku may be emitting that header when it passes the connection\n> to your app\n> \n> ``` python\n> r = requests.get('http://httpbin.org/headers'); r.request.headers\n> {'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'User-Agent':\n> 'python-requests/2.3.0 PyPy/2.3.1 Darwin/13.3.0'}\n> ```\n> \n> Versus\n> \n> ``` python\n> >>>> requests.get('http://httpbin.org/headers')\n> <Response [200]>\n> >>>> r = _\n> >>>> r.content\n> '{\\n \"headers\": {\\n \"Accept\": \"*/*\", \\n \"Accept-Encoding\": \"gzip,\n> deflate\", \\n \"Connection\": \"close\", \\n \"Host\": \"httpbin.org\", \\n\n> \"User-Agent\": \"python-requests/2.3.0 PyPy/2.3.1 Darwin/13.3.0\", \\n\n> \"X-Request-Id\": \"0d7b324b-0979-44a3-823b-547484c8f51b\"\\n }\\n}'\n> ```\n> \n> ## \n> \n> Kevin Burke\n> phone: 925.271.7005 | kev.inburke.com\n> \n> On Tue, Aug 26, 2014 at 12:33 PM, Cory Benfield [email protected]\n> wrote:\n> \n> > Uh, by default we emit 'Connection: close':\n> > \n> > > > > r = requests.get('http://httpbin.org/get')>>> print r.json()['headers'][u'Connection']close\n> > \n> > That seems like it's the source of the problem. =P\n> > \n> > —\n> > Reply to this email directly or view it on GitHub\n> > https://github.com/kennethreitz/requests/issues/2169#issuecomment-53475860\n> > .\n", "> 1. all the browser (and also curl) \n\n@tychotatitscheff requests is not a browser nor is it curl. Some of our behaviour is informed by them because how they behave is the de facto way servers expect all user-agents to behave. Regardless, it's a moot point because we all seem to be in agreement that this should be set by default.\n\nThe discussion that should have happened here (not where it did happen) is how adding this now will affect users of requests. The fact that this likely disappeared in 1.0 means that no one has really missed this significantly in almost a year and a half (if not 2 years). That said, the consequences of forcing it in something like 2.3.1 or 2.4.0 are unclear right now. It's possible this will affect larger consumers of requests like RedHat, Rackspace, OpenStack, and Runscope. For now, the solution is fairly simple: use a `session` object on which you set `session.headers['Connection'] = 'keep-alive'`.\n", "@kevinburke Interesting! I didn't have wireshark working at the time so I didn't check it. You're right though, we just aren't emitting it at all. Not quite so bad. =)\n\nI'm with @sigmavirus24 on this: we should definitely set it by default, but we should hold off until at least 2.4.0 and possible until 3.0.\n", "Change request #2186 compliant with previous comment and more human.\n", "So as I understand, we just wait to `3.0.0` and then add to https://github.com/kennethreitz/requests/blob/master/requests/utils.py#L553 ?\n", "@tychotatitscheff I believe that's closer to what we want to do, yeah. We'll see, it depends a bit on what @kennethreitz wants.\n", "Also I'll be spending some time tonight checking if adding this by default will really harm any of our consumers. We've already done this once very recently by caching 301 redirects. We need to be more aware of how harmful things that seem like minor fixes really can be.\n", "Seems legit.\nGood luck and please let me know if you need my help for anything.\nI just poke @shazow, so he can read the wrong (imao) rewrapping of `SocketError` to `ProxyError` (first post) and say me if i shall open an issue on https://github.com/shazow/urllib3\nCheers\n", "Concerning #2186, the main advantage is that it allow situation like:\n- one makes `keep_alive` parameter for the session\n- the ones specify `keep_alive` false for one request\n\nLike `verify`, it thus allow setings default and overrititng it just for the request. Simple and easy. \nWithout that, one shall do PreparedRequest then manually deleted the header. I personnally find this way less logic but I understand the concern not polluated the API.\n", "To override the keep alive when used as a default header, do this:\n\n``` python\ns = requests.Session()\ns.headers['Connection'] = 'close'\n```\n\nStill very simple.\n\nRemember that we always prioritise headers set by the user over ones we set ourselves.\n", "I just feel stupid :|\n", "@sigmavirus24 what were the results of your investigation? I intend to cut 2.4.0 shortly, which will add the proper header in the defaults. \n", "They were inconclusive. From what I can tell I don't think there will be problems, but I can't be 100% certain. The alternative to @Lukasa's suggestion of using `'close'` is also to set the value to `None`.\n", "Fixed!\n" ]
https://api.github.com/repos/psf/requests/issues/2168
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/2168/labels{/name}
https://api.github.com/repos/psf/requests/issues/2168/comments
https://api.github.com/repos/psf/requests/issues/2168/events
https://github.com/psf/requests/pull/2168
40,450,360
MDExOlB1bGxSZXF1ZXN0MTk4OTY3MzY=
2,168
Tracking Previous Requests
{ "avatar_url": "https://avatars.githubusercontent.com/u/7707694?v=4", "events_url": "https://api.github.com/users/ContinuousFunction/events{/privacy}", "followers_url": "https://api.github.com/users/ContinuousFunction/followers", "following_url": "https://api.github.com/users/ContinuousFunction/following{/other_user}", "gists_url": "https://api.github.com/users/ContinuousFunction/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/ContinuousFunction", "id": 7707694, "login": "ContinuousFunction", "node_id": "MDQ6VXNlcjc3MDc2OTQ=", "organizations_url": "https://api.github.com/users/ContinuousFunction/orgs", "received_events_url": "https://api.github.com/users/ContinuousFunction/received_events", "repos_url": "https://api.github.com/users/ContinuousFunction/repos", "site_admin": false, "starred_url": "https://api.github.com/users/ContinuousFunction/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/ContinuousFunction/subscriptions", "type": "User", "url": "https://api.github.com/users/ContinuousFunction", "user_view_type": "public" }
[ { "color": "e11d21", "default": false, "description": null, "id": 44501305, "name": "Not Ready To Merge", "node_id": "MDU6TGFiZWw0NDUwMTMwNQ==", "url": "https://api.github.com/repos/psf/requests/labels/Not%20Ready%20To%20Merge" } ]
closed
true
null
[]
null
4
2014-08-18T02:19:45Z
2021-09-08T11:00:55Z
2014-08-21T17:43:23Z
CONTRIBUTOR
resolved
Addresses the issue brought up here: https://github.com/kennethreitz/requests/issues/1929
{ "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/2168/reactions" }
https://api.github.com/repos/psf/requests/issues/2168/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/2168.diff", "html_url": "https://github.com/psf/requests/pull/2168", "merged_at": "2014-08-21T17:43:23Z", "patch_url": "https://github.com/psf/requests/pull/2168.patch", "url": "https://api.github.com/repos/psf/requests/pulls/2168" }
true
[ "This looks good to me! I've made a few notes inline. Do you mind fixing them up?\n", "@Lukasa I will try to come up with a better way to test.\n", "Shouldn't be too hard. The final response's history (`r.history`) contains the list of all responses in order. Each of those responses should have a slice of that history in its own history in the region `[0, i)`, where `i` is the index of the response in the original response's history.\n", "@Lukasa I believe I have made the appropriate changes.\n" ]
https://api.github.com/repos/psf/requests/issues/2167
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/2167/labels{/name}
https://api.github.com/repos/psf/requests/issues/2167/comments
https://api.github.com/repos/psf/requests/issues/2167/events
https://github.com/psf/requests/issues/2167
40,386,154
MDU6SXNzdWU0MDM4NjE1NA==
2,167
Session dropping proxy for https redirects
{ "avatar_url": "https://avatars.githubusercontent.com/u/640318?v=4", "events_url": "https://api.github.com/users/mmessmore/events{/privacy}", "followers_url": "https://api.github.com/users/mmessmore/followers", "following_url": "https://api.github.com/users/mmessmore/following{/other_user}", "gists_url": "https://api.github.com/users/mmessmore/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/mmessmore", "id": 640318, "login": "mmessmore", "node_id": "MDQ6VXNlcjY0MDMxOA==", "organizations_url": "https://api.github.com/users/mmessmore/orgs", "received_events_url": "https://api.github.com/users/mmessmore/received_events", "repos_url": "https://api.github.com/users/mmessmore/repos", "site_admin": false, "starred_url": "https://api.github.com/users/mmessmore/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/mmessmore/subscriptions", "type": "User", "url": "https://api.github.com/users/mmessmore", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2014-08-15T21:26:04Z
2021-09-08T23:10:41Z
2014-08-15T21:45:40Z
NONE
resolved
I noticed it when trying to add proxy support to python-foreman, but have reduced it down to just being an issue with requests. The cert on my destination is self-signed, but verify is set to false. The following code reproduces the problem. When I observe the traffic I see it make a request out to the proxy server, then it follows up by trying to make a request directly to the server without using the proxy and times out because it can't get there. I'm not seeing other people complain about this issue, and wonder if I'm just missing something. ``` #!/usr/bin/env python import requests s = requests.Session() s.proxies = { 'http': 'proxy.example.com:3128', 'https': 'proxy.example.com:3128' } s.get('https://uri.that.redirects.example.com', verify=False) ``` I've tried setting the environment variables HTTP_PROXY and HTTPS_PROXY, and setting explicitly on my session object, or passing it to each Session.get() request as part of the **kwargs (like verify). I've tried with http:// URI's and with just host:port for the proxy values in both the internal dict and the env variables, as the documentation seems to suggest both in different places. I can provide more specific details or a packet dump if necessary.
{ "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/2167/reactions" }
https://api.github.com/repos/psf/requests/issues/2167/timeline
null
completed
null
null
false
[ "Ah, yes, this is a well known issue. It's the same as pypa/pip#1805. This should be fixed in the next release of requests. =)\n" ]
https://api.github.com/repos/psf/requests/issues/2166
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/2166/labels{/name}
https://api.github.com/repos/psf/requests/issues/2166/comments
https://api.github.com/repos/psf/requests/issues/2166/events
https://github.com/psf/requests/issues/2166
40,320,474
MDU6SXNzdWU0MDMyMDQ3NA==
2,166
Requests support HTTPS proxies timeout
{ "avatar_url": "https://avatars.githubusercontent.com/u/2490900?v=4", "events_url": "https://api.github.com/users/macdonjo/events{/privacy}", "followers_url": "https://api.github.com/users/macdonjo/followers", "following_url": "https://api.github.com/users/macdonjo/following{/other_user}", "gists_url": "https://api.github.com/users/macdonjo/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/macdonjo", "id": 2490900, "login": "macdonjo", "node_id": "MDQ6VXNlcjI0OTA5MDA=", "organizations_url": "https://api.github.com/users/macdonjo/orgs", "received_events_url": "https://api.github.com/users/macdonjo/received_events", "repos_url": "https://api.github.com/users/macdonjo/repos", "site_admin": false, "starred_url": "https://api.github.com/users/macdonjo/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/macdonjo/subscriptions", "type": "User", "url": "https://api.github.com/users/macdonjo", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2014-08-15T03:32:07Z
2021-09-08T23:10:41Z
2014-08-15T07:26:15Z
NONE
resolved
Is requests timeout supposed to work with HTTPS proxies? I know urllib2 does not support this: https://docs.python.org/2/howto/urllib2.html#proxies "Note: Currently urllib2 does not support fetching of https locations through a proxy. However, this can be enabled by extending urllib2 as shown in the recipe [7]."
{ "avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4", "events_url": "https://api.github.com/users/Lukasa/events{/privacy}", "followers_url": "https://api.github.com/users/Lukasa/followers", "following_url": "https://api.github.com/users/Lukasa/following{/other_user}", "gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Lukasa", "id": 1382556, "login": "Lukasa", "node_id": "MDQ6VXNlcjEzODI1NTY=", "organizations_url": "https://api.github.com/users/Lukasa/orgs", "received_events_url": "https://api.github.com/users/Lukasa/received_events", "repos_url": "https://api.github.com/users/Lukasa/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions", "type": "User", "url": "https://api.github.com/users/Lukasa", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/2166/reactions" }
https://api.github.com/repos/psf/requests/issues/2166/timeline
null
completed
null
null
false
[ "Yes. =)\n" ]
https://api.github.com/repos/psf/requests/issues/2165
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/2165/labels{/name}
https://api.github.com/repos/psf/requests/issues/2165/comments
https://api.github.com/repos/psf/requests/issues/2165/events
https://github.com/psf/requests/issues/2165
40,073,532
MDU6SXNzdWU0MDA3MzUzMg==
2,165
post() hangs when data is large(-ish)
{ "avatar_url": "https://avatars.githubusercontent.com/u/1308749?v=4", "events_url": "https://api.github.com/users/ekw/events{/privacy}", "followers_url": "https://api.github.com/users/ekw/followers", "following_url": "https://api.github.com/users/ekw/following{/other_user}", "gists_url": "https://api.github.com/users/ekw/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/ekw", "id": 1308749, "login": "ekw", "node_id": "MDQ6VXNlcjEzMDg3NDk=", "organizations_url": "https://api.github.com/users/ekw/orgs", "received_events_url": "https://api.github.com/users/ekw/received_events", "repos_url": "https://api.github.com/users/ekw/repos", "site_admin": false, "starred_url": "https://api.github.com/users/ekw/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/ekw/subscriptions", "type": "User", "url": "https://api.github.com/users/ekw", "user_view_type": "public" }
[]
closed
true
null
[]
null
4
2014-08-12T16:33:55Z
2021-09-08T23:10:42Z
2014-08-12T17:56:57Z
NONE
resolved
This is the call in question: ``` r = requests.post(url, auth=creds, data=json.dumps(post_data), headers={'content-type':'application/json'}) ``` post_data is a dictionary. post_data['x'] is a string of varying length: ``` post_data['x'] = '.' * L ``` (a) For L < 3487 and creds is correct username/password, I receive expected 200 response right away. (b) For L < 3487 and creds is incorrect username/password, I receive expected 401 response right away. (c) For L >= 3487 and creds is correct username/password, I receive expected 200 response right away. (d) For L >= 3487 and creds is incorrect username/password, the call hangs for about a minute and then I receive 401 response, but the data is empty (r.text is empty string). I expect a JSON response which I do receive properly in (b) above. On the server hosting the url, I see the response go out right away in all cases. Is there anything more I can do to further isolate this and figure out what's going on? I don't know if L=3487 is specific to my system or not; could be higher or lower for others. I am using Python 2.7 and requests 2.3.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": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/2165/reactions" }
https://api.github.com/repos/psf/requests/issues/2165/timeline
null
completed
null
null
false
[ "Interesting.\n\nHere's the way the requests stack works. When we send a request in this form, we send all the headers and then immediately send the body. What we _don't_ do is attempt to read the response before sending the body: this is simply not a flow that `httplib` allows.\n\nIf the endpoint server _knows_ that it doesn't want to accept the message (because the auth credentials are wrong), it may want to immediately return the 401 and then disregard our body data. That's totally fine, but I wonder what happens if it then stops pumping the socket for data. I suspect it will fill up the TCP buffer, causing the TCP congestion window to kick in and slow data transfer. That would explain the long latency in getting the response: the latency is actually in the call to send data.\n\nAs for the response data being empty, that won't be requests' problem. Either the server is at fault (it never sent the data), or `httplib` is.\n\nThe best way to profile this would be to dump the traffic using tcpdump and then analyse it. I have two questions: a) is your traffic going over HTTP or HTTPS; and b) are you familiar with tcpdump?\n", "a) HTTP at the moment. HTTPS will come when plain HTTP is working.\nb) No, but I can get familiar with it. Or could I use Wireshark? The server is a flask app running on Linux. I'm running the python client on Win7. \n", "OK, got familiar with tcpdump . It's so much easier than Wireshark for analysis. Issue is not with requests. In case (b) and (d) from original post, server was returning HTTP response with content length of 132 (as expected). In case (b), the JSON response was included to fulfill the length of 132. In case (d), the JSON response was not included so I guess client is waiting for the JSON response that never comes and then times out. Weird thing is, once I started debug printing out the request content on the server-side flask app, I started getting the JSON response for L>3487 and things are working perfectly now. But anyway, thanks @Lukasa for your help.\n", "No problem. I'm going to close the issue (as it's not a requests bug), but feel free to hop into our IRC channel if you'd like further help debugging. =)\n" ]
https://api.github.com/repos/psf/requests/issues/2164
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/2164/labels{/name}
https://api.github.com/repos/psf/requests/issues/2164/comments
https://api.github.com/repos/psf/requests/issues/2164/events
https://github.com/psf/requests/issues/2164
40,038,011
MDU6SXNzdWU0MDAzODAxMQ==
2,164
python requests session failed to read the response
{ "avatar_url": "https://avatars.githubusercontent.com/u/1951487?v=4", "events_url": "https://api.github.com/users/msrajan/events{/privacy}", "followers_url": "https://api.github.com/users/msrajan/followers", "following_url": "https://api.github.com/users/msrajan/following{/other_user}", "gists_url": "https://api.github.com/users/msrajan/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/msrajan", "id": 1951487, "login": "msrajan", "node_id": "MDQ6VXNlcjE5NTE0ODc=", "organizations_url": "https://api.github.com/users/msrajan/orgs", "received_events_url": "https://api.github.com/users/msrajan/received_events", "repos_url": "https://api.github.com/users/msrajan/repos", "site_admin": false, "starred_url": "https://api.github.com/users/msrajan/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/msrajan/subscriptions", "type": "User", "url": "https://api.github.com/users/msrajan", "user_view_type": "public" }
[]
closed
true
null
[]
null
12
2014-08-12T09:24:23Z
2021-09-08T14:00:41Z
2014-08-27T19:35:42Z
NONE
resolved
python requests session failed to read the response after reading a large response content python version 2.7 requests 2.3.0 I am using requests.Session in a REST client to talk to REST Server. Some of my endpoints are reading file content and producing file contents as response content. So whenever the response content is more than certain size like 10240 bytes then the subsequent request in the same session is failing(First request succeeds(which response is more than 10240 bytes) and second request keeps on waiting to read the response). ``` sess = requests.Session() sess.verify = False host = "https://somehost/endpoint/" res = sess.get(url = host+'obj1/28/content', headers = headers) print res # this result received successfully with 200 response status code url = host + 'obj2/1/content' res = sess.get(url = url, headers=headers) # the execution struck here. I need to kill the process to exit. print "content ", res.content # this line never gets executed... ``` But the same set of requests works fine with out 'requests.Session' using 'requests.get'. Looks like an issue in the urllib3/requests module but I am not sure. The below are the stack trace when I exited the client manually. ``` File "/opt/lib/python2.7/site-packages/requests/sessions.py", line 556, in send r = adapter.send(request, **kwargs) File "/opt/lib/python2.7/site-packages/requests/adapters.py", line 391, in send r.content File "/opt/lib/python2.7/site-packages/requests/models.py", line 690, in content self._content = bytes().join(self.iter_content(CONTENT_CHUNK_SIZE)) or bytes() File "/opt/lib/python2.7/site-packages/requests/models.py", line 628, in generate for chunk in self.raw.stream(chunk_size, decode_content=True): File "/opt/lib/python2.7/site-packages/requests/packages/urllib3/response.py", line 240, in stream data = self.read(amt=amt, decode_content=decode_content) File "/opt/lib/python2.7/site-packages/requests/packages/urllib3/response.py", line 187, in read data = self._fp.read(amt) File "/opt/lib/python2.7/httplib.py", line 567, in read s = self.fp.read(amt) File "/opt/lib/python2.7/httplib.py", line 1313, in read return s + self._file.read(amt - len(s)) File "/opt/lib/python2.7/socket.py", line 380, in read data = self._sock.recv(left) File "/opt/lib/python2.7/ssl.py", line 242, in recv return self.read(buflen) File "/opt/lib/python2.7/ssl.py", line 161, in read return self._sslobj.read(len) ```
{ "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/2164/reactions" }
https://api.github.com/repos/psf/requests/issues/2164/timeline
null
completed
null
null
false
[ "Thanks for this!\n\nYou've cut out the actual exception raised, you're only showing the traceback. What exact exception is being thrown?\n", "Closing for inactivity.\n", "Hi,\n\nGive me some more time. I will reproduce this and will provide with more information.\n", "@msrajan when you do, we'll reopen the issue if it's truly a bug in requests.\n", "Is it connected to this stack overflow question http://stackoverflow.com/questions/25255900/python-requests-session-failed-to-read-the-response-after-reading-a-big-more-th\n", "@mobcdi this issue was opened after @msrajan was told to open it on StackOverflow. That said, no one has been able to reproduce this or provide sufficient information for us to debug it. Further, please do not revive old issues unless you have something to add in the way of information.\n", "Hi,\n\nI am able to reproduce this issue. Please let me know what information do I need to provide for further investigation. Stacktrace is same as given by msrajan.\n\n```\n File \"/localdisk/myProject/env/lib/python2.7/site-packages/requests/sessions.py\", line 487, in get\n return self.request('GET', url, **kwargs)\n File \"/localdisk/myProject/env/lib/python2.7/site-packages/requests/sessions.py\", line 475, in request\n resp = self.send(prep, **send_kwargs)\n File \"/localdisk/myProject/env/lib/python2.7/site-packages/requests/sessions.py\", line 585, in send\n r = adapter.send(request, **kwargs)\n File \"/localdisk/myProject/env/lib/python2.7/site-packages/requests/adapters.py\", line 403, in send\n timeout=timeout\n File \"/localdisk/myProject/env/lib/python2.7/site-packages/requests/packages/urllib3/connectionpool.py\", line 578, in urlopen\n chunked=chunked)\n File \"/localdisk/myProject/env/lib/python2.7/site-packages/requests/packages/urllib3/connectionpool.py\", line 385, in _make_request\n httplib_response = conn.getresponse(buffering=True)\n File \"/usr/lib64/python2.7/httplib.py\", line 1045, in getresponse\n response.begin()\n File \"/usr/lib64/python2.7/httplib.py\", line 409, in begin\n version, status, reason = self._read_status()\n File \"/usr/lib64/python2.7/httplib.py\", line 365, in _read_status\n line = self.fp.readline(_MAXLINE + 1)\n File \"/usr/lib64/python2.7/socket.py\", line 476, in readline\n data = self._sock.recv(self._rbufsize)\n File \"/usr/lib64/python2.7/ssl.py\", line 241, in recv\n return self.read(buflen)\n File \"/usr/lib64/python2.7/ssl.py\", line 160, in read\n return self._sslobj.read(len)\nKeyboardInterrupt\n```\n", "Do you have sample code we can run to verify the problem?\n", "Well the code is IP so I can not possibly share here, sorry for that.\n\nBut the steps are exactly same as mentioned by msrajan above.\n", "@kagupta28 Are you talking to a proprietary server, or one that I can reach on the open web?\n\nThis issue is almost certainly caused by the combination of the request that we emit and the response we receive, and if I can't reproduce or see those it is very difficult for me to assist you.\n", "@Lukasa understand that... talking to a proprietary server. Just thinking what can be done to help investigate this issue further.\n", "If you're able to, you can pass me a wireshark trace to my personal email address that I'll keep private. Otherwise, there is very little we can do to assist you.\n" ]
https://api.github.com/repos/psf/requests/issues/2163
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/2163/labels{/name}
https://api.github.com/repos/psf/requests/issues/2163/comments
https://api.github.com/repos/psf/requests/issues/2163/events
https://github.com/psf/requests/issues/2163
40,025,276
MDU6SXNzdWU0MDAyNTI3Ng==
2,163
Multiple consequtive requests on Session throws TunnelError on https proxies.
{ "avatar_url": "https://avatars.githubusercontent.com/u/5163640?v=4", "events_url": "https://api.github.com/users/m-novikov/events{/privacy}", "followers_url": "https://api.github.com/users/m-novikov/followers", "following_url": "https://api.github.com/users/m-novikov/following{/other_user}", "gists_url": "https://api.github.com/users/m-novikov/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/m-novikov", "id": 5163640, "login": "m-novikov", "node_id": "MDQ6VXNlcjUxNjM2NDA=", "organizations_url": "https://api.github.com/users/m-novikov/orgs", "received_events_url": "https://api.github.com/users/m-novikov/received_events", "repos_url": "https://api.github.com/users/m-novikov/repos", "site_admin": false, "starred_url": "https://api.github.com/users/m-novikov/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/m-novikov/subscriptions", "type": "User", "url": "https://api.github.com/users/m-novikov", "user_view_type": "public" }
[]
closed
true
null
[]
null
5
2014-08-12T05:18:00Z
2021-09-08T23:10:39Z
2014-08-27T17:03:56Z
NONE
resolved
If you make consecutive requests on Session with set https proxy. import requests ``` s = requests.session() s.proxies = {'https': 'https://xxx.xxx.xxx.xxx:8888'} s.get("https://www.tumblr.com/") s.post("https://www.tumblr.com/") ``` You get this error `ProxyError: Cannot connect to proxy. Socket error: Tunnel connection failed: 400 Bad Request.`
{ "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/2163/reactions" }
https://api.github.com/repos/psf/requests/issues/2163/timeline
null
completed
null
null
false
[ "@m-novikov we need more information.\n1. What kind of proxy are you using?\n2. What is the full traceback?\n3. What is the exact version of python you're using (e.g., 3.4.1)\n4. What is the version of requests you're using?\n5. Can you still reproduce this with the version of requests present in `master`?\n", "We should also note that this may well be related to pypa/pip#1805.\n", "@Lukasa that was why I asked question 5. I just didn't want to jump the gun on the association.\n", "@sigmavirus24 \nSorry for late answer.\n- Random https proxies from public lists\n- Traceback\n\n``` python\nTraceback (most recent call last):\n File \"<stdin>\", line 1, in <module>\n File \"/usr/lib/python2.7/dist-packages/requests/sessions.py\", line 425, in post\n return self.request('POST', url, data=data, **kwargs)\n File \"/usr/lib/python2.7/dist-packages/requests/sessions.py\", line 383, in request\n resp = self.send(prep, **send_kwargs)\n File \"/usr/lib/python2.7/dist-packages/requests/sessions.py\", line 486, in send\n r = adapter.send(request, **kwargs)\n File \"/usr/lib/python2.7/dist-packages/requests/adapters.py\", line 381, in send\n raise ProxyError(e)\nrequests.exceptions.ProxyError: Cannot connect to proxy. Socket error: Tunnel connection failed: 400 Bad Request.\n```\n- Python 2.7.6\n- tested on requests 2.2.1, requests 2.3.0\n- Looks like it's fixed in master.\n", "Suspect then that it is identical to pypa/pip#1805. =)\n\nThanks for the report!\n" ]
https://api.github.com/repos/psf/requests/issues/2162
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/2162/labels{/name}
https://api.github.com/repos/psf/requests/issues/2162/comments
https://api.github.com/repos/psf/requests/issues/2162/events
https://github.com/psf/requests/issues/2162
40,016,199
MDU6SXNzdWU0MDAxNjE5OQ==
2,162
Cookies lost on redirect
{ "avatar_url": "https://avatars.githubusercontent.com/u/2872377?v=4", "events_url": "https://api.github.com/users/fenume/events{/privacy}", "followers_url": "https://api.github.com/users/fenume/followers", "following_url": "https://api.github.com/users/fenume/following{/other_user}", "gists_url": "https://api.github.com/users/fenume/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/fenume", "id": 2872377, "login": "fenume", "node_id": "MDQ6VXNlcjI4NzIzNzc=", "organizations_url": "https://api.github.com/users/fenume/orgs", "received_events_url": "https://api.github.com/users/fenume/received_events", "repos_url": "https://api.github.com/users/fenume/repos", "site_admin": false, "starred_url": "https://api.github.com/users/fenume/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/fenume/subscriptions", "type": "User", "url": "https://api.github.com/users/fenume", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2014-08-12T01:11:00Z
2021-09-08T23:10:42Z
2014-08-12T02:10:44Z
NONE
resolved
Hi, i'm using requsts 2.3.0 from PyPi and get blank cookies after 302 redirect ``` python Python 2.7.5+ (default, Sep 19 2013, 13:48:49) [GCC 4.8.1] on linux2 >>> import requests >>> requests.__version__ '2.3.0' >>> r = requests.get('http://mlgame.us/?state=register_simple_new') >>> print r.cookies <<class 'requests.cookies.RequestsCookieJar'>[]> >>> print r.history[0].cookies <<class 'requests.cookies.RequestsCookieJar'>[<Cookie PORTAL_SESSIONID=vhjyfqxwh3oh1mtvxly7lqwf1 for mlgame.us/>]> ``` In version 1.2.0 all worked fine: ``` python Python 2.7.3 (default, Sep 26 2012, 21:53:58) [GCC 4.7.2] on linux2 >>> import requests >>> requests.__version__ '1.2.0' >>> r = requests.get('http://mlgame.us/?state=register_simple_new') >>> print r.cookies <<class 'requests.cookies.RequestsCookieJar'>[<Cookie PORTAL_SESSIONID=8r6iqae7yirj1gxx7x9biwiov for mlgame.us/>]> ```
{ "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/2162/reactions" }
https://api.github.com/repos/psf/requests/issues/2162/timeline
null
completed
null
null
false
[ "@fenume they're not \"lost\". See @lukasa's [comment](https://github.com/kennethreitz/requests/issues/1446#issuecomment-20658864) on #1446. This was intentional because a single response's CookieJar should represent the cookies sent by the server in _that_ response. If you want what used to work in version 1.2.0, I would advise you start using a session.\n\n``` pycon\n>>> s = requests.Session()\n>>> r = s.get('http://mlgame.us/?state=register_simple_new')\n>>> s.cookies\n<<class 'requests.cookies.RequestsCookieJar'>[Cookie(version=0, name='PORTAL_SESSIONID', value='15nalzaawi5yf9njecyoec73f', port=None, port_specified=False, domain='mlgame.us', domain_specified=False, domain_initial_dot=False, path='/', path_specified=True, secure=False, expires=None, discard=True, comment=None, comment_url=None, rest={}, rfc2109=False)]>\n```\n" ]
https://api.github.com/repos/psf/requests/issues/2161
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/2161/labels{/name}
https://api.github.com/repos/psf/requests/issues/2161/comments
https://api.github.com/repos/psf/requests/issues/2161/events
https://github.com/psf/requests/pull/2161
39,688,464
MDExOlB1bGxSZXF1ZXN0MTk0NDU1ODU=
2,161
add auto detect charset from http body when http headers not seted
{ "avatar_url": "https://avatars.githubusercontent.com/u/1175571?v=4", "events_url": "https://api.github.com/users/likexian/events{/privacy}", "followers_url": "https://api.github.com/users/likexian/followers", "following_url": "https://api.github.com/users/likexian/following{/other_user}", "gists_url": "https://api.github.com/users/likexian/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/likexian", "id": 1175571, "login": "likexian", "node_id": "MDQ6VXNlcjExNzU1NzE=", "organizations_url": "https://api.github.com/users/likexian/orgs", "received_events_url": "https://api.github.com/users/likexian/received_events", "repos_url": "https://api.github.com/users/likexian/repos", "site_admin": false, "starred_url": "https://api.github.com/users/likexian/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/likexian/subscriptions", "type": "User", "url": "https://api.github.com/users/likexian", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2014-08-07T03:32:45Z
2021-09-08T11:00:56Z
2014-08-07T11:15:58Z
NONE
resolved
requests detect page's charset/encoding from responsed http headers, but many servers won't set it in headers. In this case, requests will set the charset/encoding to the default 'ISO-8859-1', and result in decoded error, many Chinese developers get lose and complain. For example: ``` print requests.get('http://www.126.com/').text ``` This commit will detect charset/encoding from http headers, if no, from http body, for most situations, everything goes well now.
{ "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/2161/reactions" }
https://api.github.com/repos/psf/requests/issues/2161/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/2161.diff", "html_url": "https://github.com/psf/requests/pull/2161", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/2161.patch", "url": "https://api.github.com/repos/psf/requests/pulls/2161" }
true
[ "Thanks for this!\n\nThis is a change that has been discussed many, many times. A sample of issues that touch it are: #1604, #1774, #1604, #1589, #1588, #1546, and #2042. We also mention it in the documentation [here](http://docs.python-requests.org/en/latest/user/advanced/#encodings). Though it's an easy mistake to make, in future you really should search both open and closed issues before making a change like this because you'll save yourself time and effort.\n\nWe aren't going to merge this. Previously we wouldn't have merged this because of the explanation given in the issues mentioned above (namely, that the behaviour is deliberate, and that we aren't a HTML library so we won't introspect content). Currently, this behaviour is tracked under the _open_ issue #2086, which will change this behaviour in a different way. If you'd found that issue you'd have saved yourself some time.\n\nI'm sorry that we can't take this change, please don't let it dissuade you from continuing to contribute!\n" ]
https://api.github.com/repos/psf/requests/issues/2160
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/2160/labels{/name}
https://api.github.com/repos/psf/requests/issues/2160/comments
https://api.github.com/repos/psf/requests/issues/2160/events
https://github.com/psf/requests/issues/2160
39,579,201
MDU6SXNzdWUzOTU3OTIwMQ==
2,160
requests.codes.continue raises SyntaxError
{ "avatar_url": "https://avatars.githubusercontent.com/u/74351?v=4", "events_url": "https://api.github.com/users/maxcountryman/events{/privacy}", "followers_url": "https://api.github.com/users/maxcountryman/followers", "following_url": "https://api.github.com/users/maxcountryman/following{/other_user}", "gists_url": "https://api.github.com/users/maxcountryman/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/maxcountryman", "id": 74351, "login": "maxcountryman", "node_id": "MDQ6VXNlcjc0MzUx", "organizations_url": "https://api.github.com/users/maxcountryman/orgs", "received_events_url": "https://api.github.com/users/maxcountryman/received_events", "repos_url": "https://api.github.com/users/maxcountryman/repos", "site_admin": false, "starred_url": "https://api.github.com/users/maxcountryman/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/maxcountryman/subscriptions", "type": "User", "url": "https://api.github.com/users/maxcountryman", "user_view_type": "public" }
[]
closed
true
null
[]
null
3
2014-08-06T00:25:52Z
2021-09-08T23:10:45Z
2014-08-06T00:36:08Z
CONTRIBUTOR
resolved
``` python >>> import requests >>> requests.codes.continue File "<stdin>", line 1 requests.codes.continue ^ SyntaxError: invalid syntax ``` We expect to see the Informational HTTP status code, 100, but instead an error is raised. `requests.codes['continue']` works as a workaround. Presumably this happens because `continue` is a keyword in Python and therefore cannot be used as an attribute name. Python 2.7.6, OS X 10.10.
{ "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/2160/reactions" }
https://api.github.com/repos/psf/requests/issues/2160/timeline
null
completed
null
null
false
[ "It's not really clear what we can do about this. Continue is and always will be a keyword.\n", "The _best_ we could do is support case-insensitive attribute access but that would certainly be useful to an extremely tiny subset of users. (In other words, you would be able to get around this with requests.codes.Continue.)\n", "The fact that Python does not have contextual kewords is PITA. Compare with C# - http://msdn.microsoft.com/en-us/library/x53a06bb.aspx\n\nWait, there [was](http://fiber-space.de/wordpress/2009/03/22/contextual-keywords/) one contextual keyword - \n\n> The word `as` was such a contextual keyword in Python until it became a proper keyword in version 2.5.\n\nRelevant SO question - [Why can't attribute names be Python keywords?](http://stackoverflow.com/q/9746838/95735)\n" ]
https://api.github.com/repos/psf/requests/issues/2159
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/2159/labels{/name}
https://api.github.com/repos/psf/requests/issues/2159/comments
https://api.github.com/repos/psf/requests/issues/2159/events
https://github.com/psf/requests/issues/2159
39,345,367
MDU6SXNzdWUzOTM0NTM2Nw==
2,159
readline() takes exactly 1 argument (2 given)
{ "avatar_url": "https://avatars.githubusercontent.com/u/1780945?v=4", "events_url": "https://api.github.com/users/kiarashplusplus/events{/privacy}", "followers_url": "https://api.github.com/users/kiarashplusplus/followers", "following_url": "https://api.github.com/users/kiarashplusplus/following{/other_user}", "gists_url": "https://api.github.com/users/kiarashplusplus/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kiarashplusplus", "id": 1780945, "login": "kiarashplusplus", "node_id": "MDQ6VXNlcjE3ODA5NDU=", "organizations_url": "https://api.github.com/users/kiarashplusplus/orgs", "received_events_url": "https://api.github.com/users/kiarashplusplus/received_events", "repos_url": "https://api.github.com/users/kiarashplusplus/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kiarashplusplus/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kiarashplusplus/subscriptions", "type": "User", "url": "https://api.github.com/users/kiarashplusplus", "user_view_type": "public" }
[ { "color": "f7c6c7", "default": false, "description": null, "id": 167537670, "name": "Propose Close", "node_id": "MDU6TGFiZWwxNjc1Mzc2NzA=", "url": "https://api.github.com/repos/psf/requests/labels/Propose%20Close" } ]
closed
true
null
[]
null
18
2014-08-02T08:53:44Z
2021-09-08T15:00:38Z
2015-01-18T20:23:10Z
NONE
resolved
I'm trying to make connections with proxies. and some of the times I get this error. I put the traceback below. The command I use is this: `requests.get(w, verify=False, timeout=4, proxies=proxy)` `w` is a url and `proxy` is a dictionary.. something I make like this: ``` python http_proxy = "http://"+ip.strip() https_proxy = http_proxy proxyDict = { "http" : http_proxy, "https" : https_proxy, } ``` ``` Traceback (most recent call last): File "explore_proxies.py", line 13, in onewebsite r= requests.get(w, verify=False, timeout=4, proxies=proxy) File "/usr/lib/python2.7/dist-packages/requests/api.py", line 55, in get return request('get', url, **kwargs) File "/usr/lib/python2.7/dist-packages/requests/api.py", line 44, in request return session.request(method=method, url=url, **kwargs) File "/usr/lib/python2.7/dist-packages/requests/sessions.py", line 383, in req uest resp = self.send(prep, **send_kwargs) File "/usr/lib/python2.7/dist-packages/requests/sessions.py", line 486, in sen d r = adapter.send(request, **kwargs) File "/usr/lib/python2.7/dist-packages/requests/adapters.py", line 330, in sen d timeout=timeout File "/usr/lib/python2.7/dist-packages/urllib3/connectionpool.py", line 537, i n urlopen conn = self._get_conn(timeout=pool_timeout) File "/usr/lib/python2.7/dist-packages/urllib3/connectionpool.py", line 299, i n _get_conn return conn or self._new_conn() File "/usr/lib/python2.7/dist-packages/urllib3/connectionpool.py", line 719, i n _new_conn return self._prepare_conn(connection) File "/usr/lib/python2.7/dist-packages/urllib3/connectionpool.py", line 686, i n _prepare_conn connection.connect() File "/usr/lib/python2.7/dist-packages/urllib3/connectionpool.py", line 124, i n connect self._tunnel() File "/usr/lib/python2.7/httplib.py", line 759, in _tunnel line = response.fp.readline(_MAXLINE + 1) TypeError: readline() takes exactly 1 argument (2 given) ```
{ "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/2159/reactions" }
https://api.github.com/repos/psf/requests/issues/2159/timeline
null
completed
null
null
false
[ "What exact version of Python are you using? (e.g., 2.7.8)\n", "Hi, thanks for raising this issue!\n\nThis is a known bug in the Python standard library, [issue 17849](http://bugs.python.org/issue17849). I have submitted a patch for this bug upstream, but it hasn't been merged at this time (despite being submitted in January). The best way to get this properly fixed is to try to agitate to get that patch merged.\n\nWe _may_ be able to fix this by doing #1869. @sigmavirus24, do you think it's worth it?\n", "My only hesitation is @kennethreitz's previous resistance to the idea. Perhaps with the relatively recent release of the new version of HTTP/1.1 (which removes the necessity to support HTTP/0.9) he will be more willing.\n", "I'm confident I could sell him on the idea. =)\n\n> On 2 Aug 2014, at 10:35, Ian Cordasco [email protected] wrote:\n> \n> My only hesitation is @kennethreitz's previous resistance to the idea. Perhaps with the relatively recent release of the new version of HTTP/1.1 (which removes the necessity to support HTTP/0.9) he will be more willing.\n> \n> —\n> Reply to this email directly or view it on GitHub.\n", "This also stops pip>1.3.1 from proxying to pypi from a more local cheeseshop.\n", "@bmcorser could you elaborate?\n", "@bmcorser As discussed, this limitation is not in requests and there's really nothing we can do to speed things up. I recommend doing a code review of the patch I submitted to make it easier for the CPython maintainers to get it merged.\n", "@Lukasa didn't we merge a PR that fixes this?\n", "Yes. =)\n", "Today when I was installing flask-mongoengine using pip, the same problem occured.\nI executed \n\n``` bash\npip install flask-mongoengine\n```\n\nand returned \n\n``` bash\nDownloading/unpacking flask-mongoengine\nCleaning up...\nException:\nTraceback (most recent call last):\n File \"/usr/lib/python2.7/dist-packages/pip/basecommand.py\", line 122, in main\n status = self.run(options, args)\n File \"/usr/lib/python2.7/dist-packages/pip/commands/install.py\", line 278, in run\n requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)\n File \"/usr/lib/python2.7/dist-packages/pip/req.py\", line 1177, in prepare_files\n url = finder.find_requirement(req_to_install, upgrade=self.upgrade)\n File \"/usr/lib/python2.7/dist-packages/pip/index.py\", line 194, in find_requirement\n page = self._get_page(main_index_url, req)\n File \"/usr/lib/python2.7/dist-packages/pip/index.py\", line 568, in _get_page\n session=self.session,\n File \"/usr/lib/python2.7/dist-packages/pip/index.py\", line 670, in get_page\n resp = session.get(url, headers={\"Accept\": \"text/html\"})\n File \"/usr/lib/python2.7/dist-packages/requests/sessions.py\", line 468, in get\n return self.request('GET', url, **kwargs)\n File \"/usr/lib/python2.7/dist-packages/pip/download.py\", line 237, in request\n return super(PipSession, self).request(method, url, *args, **kwargs)\n File \"/usr/lib/python2.7/dist-packages/requests/sessions.py\", line 456, in request\n resp = self.send(prep, **send_kwargs)\n File \"/usr/lib/python2.7/dist-packages/requests/sessions.py\", line 559, in send\n r = adapter.send(request, **kwargs)\n File \"/usr/lib/python2.7/dist-packages/requests/adapters.py\", line 327, in send\n timeout=timeout\n File \"/usr/lib/python2.7/dist-packages/urllib3/connectionpool.py\", line 491, in urlopen\n conn = self._get_conn(timeout=pool_timeout)\n File \"/usr/lib/python2.7/dist-packages/urllib3/connectionpool.py\", line 230, in _get_conn\n return conn or self._new_conn()\n File \"/usr/lib/python2.7/dist-packages/urllib3/connectionpool.py\", line 680, in _new_conn\n return self._prepare_conn(conn)\n File \"/usr/lib/python2.7/dist-packages/urllib3/connectionpool.py\", line 653, in _prepare_conn\n conn.connect()\n File \"/usr/lib/python2.7/dist-packages/urllib3/connection.py\", line 205, in connect\n self._tunnel()\n File \"/usr/lib/python2.7/httplib.py\", line 780, in _tunnel\n line = response.fp.readline(_MAXLINE + 1)\nTypeError: readline() takes exactly 1 argument (2 given)\n```\n\nMy python version is 2.7.9, and my os is ubuntu14.10, does this bug still exist?\n", "What version of pip are you using?\n", "pip 1.5.6\n", "That version of pip does not contain our fix, it's too old. Please upgrade. =)\n", "I upgrade to pip 6.1.1 and the bug disappears. Thanks! :-)\n", "Today when I was installing pb_tool using pip, the same problem occurred.\nI executed\n\npip install pb_tool\n\nand returned\n\nCollecting pb-tool\nException:\nTraceback (most recent call last):\n File \"C:\\OSGEO4~1\\apps\\Python27\\Lib\\site-packages\\pip\\basecommand.py\", line 20\n9, in main\n status = self.run(options, args)\n File \"C:\\OSGEO4~1\\apps\\Python27\\Lib\\site-packages\\pip\\commands\\install.py\", li\nne 299, in run\n requirement_set.prepare_files(finder)\n File \"C:\\OSGEO4~1\\apps\\Python27\\Lib\\site-packages\\pip\\req\\req_set.py\", line 36\n0, in prepare_files\n ignore_dependencies=self.ignore_dependencies))\n File \"C:\\OSGEO4~1\\apps\\Python27\\Lib\\site-packages\\pip\\req\\req_set.py\", line 51\n2, in _prepare_file\n finder, self.upgrade, require_hashes)\n File \"C:\\OSGEO4~1\\apps\\Python27\\Lib\\site-packages\\pip\\req\\req_install.py\", lin\ne 273, in populate_link\n self.link = finder.find_requirement(self, upgrade)\n File \"C:\\OSGEO4~1\\apps\\Python27\\Lib\\site-packages\\pip\\index.py\", line 440, in\nfind_requirement\n all_candidates = self.find_all_candidates(req.name)\n File \"C:\\OSGEO4~1\\apps\\Python27\\Lib\\site-packages\\pip\\index.py\", line 398, in\nfind_all_candidates\n for page in self._get_pages(url_locations, project_name):\n File \"C:\\OSGEO4~1\\apps\\Python27\\Lib\\site-packages\\pip\\index.py\", line 543, in\n_get_pages\n page = self._get_page(location)\n File \"C:\\OSGEO4~1\\apps\\Python27\\Lib\\site-packages\\pip\\index.py\", line 646, in\n_get_page\n return HTMLPage.get_page(link, session=self.session)\n File \"C:\\OSGEO4~1\\apps\\Python27\\Lib\\site-packages\\pip\\index.py\", line 755, in\nget_page\n \"Cache-Control\": \"max-age=600\",\n File \"C:\\OSGEO4~1\\apps\\Python27\\Lib\\site-packages\\pip_vendor\\requests\\session\ns.py\", line 480, in get\n return self.request('GET', url, *_kwargs)\n File \"C:\\OSGEO4~1\\apps\\Python27\\Lib\\site-packages\\pip\\download.py\", line 378,\nin request\n return super(PipSession, self).request(method, url, *args, *_kwargs)\n File \"C:\\OSGEO4~1\\apps\\Python27\\Lib\\site-packages\\pip_vendor\\requests\\session\ns.py\", line 468, in request\n resp = self.send(prep, *_send_kwargs)\n File \"C:\\OSGEO4~1\\apps\\Python27\\Lib\\site-packages\\pip_vendor\\requests\\session\ns.py\", line 576, in send\n r = adapter.send(request, *_kwargs)\n File \"C:\\OSGEO4~1\\apps\\Python27\\Lib\\site-packages\\pip_vendor\\cachecontrol\\ada\npter.py\", line 46, in send\n resp = super(CacheControlAdapter, self).send(request, **kw)\n File \"C:\\OSGEO4~1\\apps\\Python27\\Lib\\site-packages\\pip_vendor\\requests\\adapter\ns.py\", line 376, in send\n timeout=timeout\n File \"C:\\OSGEO4~1\\apps\\Python27\\Lib\\site-packages\\pip_vendor\\requests\\package\ns\\urllib3\\connectionpool.py\", line 554, in urlopen\n self._prepare_proxy(conn)\n File \"C:\\OSGEO4~1\\apps\\Python27\\Lib\\site-packages\\pip_vendor\\requests\\package\ns\\urllib3\\connectionpool.py\", line 750, in _prepare_proxy\n conn.connect()\n File \"C:\\OSGEO4~1\\apps\\Python27\\Lib\\site-packages\\pip_vendor\\requests\\package\ns\\urllib3\\connection.py\", line 230, in connect\n self._tunnel()\n File \"C:\\OSGEO4~1\\apps\\Python27\\lib\\httplib.py\", line 759, in _tunnel\n line = response.fp.readline(_MAXLINE + 1)\nTypeError: readline() takes exactly 1 argument (2 given)\n\nmy python version is 2.7 and pip is 8.1.1.\n", "What version of Python 2.7 please?\n", "2.7.5\n", "Ok, your error is likely the result of proxy configuration. Are you expecting to use a proxy? Because pip is trying to route through one, and that proxy is misbehaving quite badly. This was a known manifestation of a weird bug in CPython that was fixed [a year ago](https://bugs.python.org/issue17849), but was only triggered when a proxy was incorrectly configured.\n" ]
https://api.github.com/repos/psf/requests/issues/2158
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/2158/labels{/name}
https://api.github.com/repos/psf/requests/issues/2158/comments
https://api.github.com/repos/psf/requests/issues/2158/events
https://github.com/psf/requests/issues/2158
39,313,898
MDU6SXNzdWUzOTMxMzg5OA==
2,158
Capture server IP address as part of a Requests object
{ "avatar_url": "https://avatars.githubusercontent.com/u/403763?v=4", "events_url": "https://api.github.com/users/zapman449/events{/privacy}", "followers_url": "https://api.github.com/users/zapman449/followers", "following_url": "https://api.github.com/users/zapman449/following{/other_user}", "gists_url": "https://api.github.com/users/zapman449/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/zapman449", "id": 403763, "login": "zapman449", "node_id": "MDQ6VXNlcjQwMzc2Mw==", "organizations_url": "https://api.github.com/users/zapman449/orgs", "received_events_url": "https://api.github.com/users/zapman449/received_events", "repos_url": "https://api.github.com/users/zapman449/repos", "site_admin": false, "starred_url": "https://api.github.com/users/zapman449/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/zapman449/subscriptions", "type": "User", "url": "https://api.github.com/users/zapman449", "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
14
2014-08-01T18:10:59Z
2021-06-28T11:07:38Z
2016-04-06T18:54:17Z
NONE
resolved
Please provide a way to query the request object for the IP address of the server connected to to fulfill the request. Example: >>> r = requests.get("http://www.google.com") >>> r.ip '74.125.225.242'
{ "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/2158/reactions" }
https://api.github.com/repos/psf/requests/issues/2158/timeline
null
completed
null
null
false
[ "Hey @zapman449!\n\nThanks for your suggestion! We really appreciate the fact that you took the time to file this. Unfortunately we're not adding anything new to the requests API at this time.\n\nI'll wait for @Lukasa to chime in before closing this though.\n", "Correct, we're not adding anything at this time. It's information that urllib3 could potentially expose, however, which would make it available through the `Response.raw` property.\n", "Hey I researched into this issue.\n\n```\nrsp = requests.get(...)\nrsp.raw._fp.fileno() \n```\n\nthis should get the underline socket the connect points to, however for some reason, urllib3 made sure its set to null here\n\nhttps://github.com/shazow/urllib3/blob/master/urllib3/response.py#L303 (related: http://bugs.python.org/issue16298)\n\n```\ndef read(...)\n self._fp.close()\n```\n\nwhich leads us to CPython `httplib` code here\n\nhttps://github.com/python/cpython/blob/2.7/Lib/httplib.py#L561\n\n```\ndef close(self):\n fp = self.fp\n if fp:\n self.fp = None\n fp.close()\n```\n\nSo, it's gone forever. Bummer\n", "On second thought, I cracked it.\n\n```\nrsp = requests.get('http://google.com', stream=True)\n# grab the IP while you can, before you consume the body!!!!!!!!\nprint rsp.raw._fp.fp._sock.getpeername()\n# consume the body, which calls the read(), after that fileno is no longer available.\nprint rsp.content \n```\n", "This solution right here simply must be added to the docs, brilliant work @est.\n", "I have tried est's fix using 2.9.1 on Ubuntu 14.04 and I am getting \nAttributeError: '_io.BufferedReader' object has no attribute '_sock'\n\nMy script is trying to grab the IP before the content read as advised too\nr = requests.get(start_url, headers=headers, timeout=7.0, verify=False, stream=True)\nip = r.raw._fp.fp._sock.getpeername()\n", "Hmmm, we could add this as `Response.origin`, but I'm not convinced that it would be very useful. \n", "@shaky You seem to be using Python 3. That changes the layout of the socket object. You should change your `ip =` line to `ip = r.raw._fp.fp.raw._sock.getpeername()`.\n", "@Lukasa what are your thoughts/feelings on a `Response.origin`? Seems like it would be a nice addition to me. \n", "Eh. I'm probably -0 on it: I think the value-add is too small to justify adding to the `Response` API. I'd be more open to adding it on the urllib3 object and then pushing people to grab it from `Response.raw`.\n\nAs a side note, `origin` is a _bad_ name for it: origin is a term with a specific meaning in HTTP, and that meaning is not the IP address of the server.\n", "I like the idea of urllib3 exposing it, as that's a lower-level connection detail. \n", "```python\r\nwith requests.get(\"https://httpbin.org\", stream=True) as response:\r\n ip21 = response.raw.connection.sock.getsockname()\r\n print(ip21)\r\n # ('192.168.100.104', 58254)\r\n \r\n ip22 = response.raw.connection.sock.getpeername()\r\n print(ip22)\r\n # ('52.3.177.149', 443)\r\n```", "```python\r\nwith requests.get(\"https://httpbin.org\", stream=True) as rsp:\r\n ip, port = rsp.raw._connection.sock.getpeername()\r\n print(ip, port)\r\n```", "> ```python\r\n> with requests.get(\"https://httpbin.org\", stream=True) as rsp:\r\n> ip, port = rsp.raw._connection.sock.getpeername()\r\n> print(ip, port)\r\n> ```\r\n\r\nit does not work with `verify=False`," ]
https://api.github.com/repos/psf/requests/issues/2157
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/2157/labels{/name}
https://api.github.com/repos/psf/requests/issues/2157/comments
https://api.github.com/repos/psf/requests/issues/2157/events
https://github.com/psf/requests/pull/2157
39,271,542
MDExOlB1bGxSZXF1ZXN0MTkxOTkwMDE=
2,157
Changed url in the sidebar for github stars iframe
{ "avatar_url": "https://avatars.githubusercontent.com/u/769447?v=4", "events_url": "https://api.github.com/users/atmb4u/events{/privacy}", "followers_url": "https://api.github.com/users/atmb4u/followers", "following_url": "https://api.github.com/users/atmb4u/following{/other_user}", "gists_url": "https://api.github.com/users/atmb4u/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/atmb4u", "id": 769447, "login": "atmb4u", "node_id": "MDQ6VXNlcjc2OTQ0Nw==", "organizations_url": "https://api.github.com/users/atmb4u/orgs", "received_events_url": "https://api.github.com/users/atmb4u/received_events", "repos_url": "https://api.github.com/users/atmb4u/repos", "site_admin": false, "starred_url": "https://api.github.com/users/atmb4u/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/atmb4u/subscriptions", "type": "User", "url": "https://api.github.com/users/atmb4u", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2014-08-01T08:45:00Z
2021-09-08T11:00:57Z
2014-08-01T11:19:35Z
NONE
resolved
This is the one which shows up first in Google search results and looks odd with broken sidebar below the logo. ![requests-docs-broken](https://cloud.githubusercontent.com/assets/769447/3776643/f362af58-1957-11e4-94ce-93806eca40b0.png)
{ "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/2157/reactions" }
https://api.github.com/repos/psf/requests/issues/2157/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/2157.diff", "html_url": "https://github.com/psf/requests/pull/2157", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/2157.patch", "url": "https://api.github.com/repos/psf/requests/pulls/2157" }
true
[ "As I see, this issue was fixed on the master branch on the latest version. \nIs there a way to edit the documentation here : http://docs.python-requests.org/en/v0.10.7/user/quickstart/ ?\n", "@atmb4u Sadly there isn't. That is built directly off a git tag, which is a static reference to a single commit, we can't update it.\n" ]
https://api.github.com/repos/psf/requests/issues/2156
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/2156/labels{/name}
https://api.github.com/repos/psf/requests/issues/2156/comments
https://api.github.com/repos/psf/requests/issues/2156/events
https://github.com/psf/requests/issues/2156
39,264,592
MDU6SXNzdWUzOTI2NDU5Mg==
2,156
Not supported proxy scheme socks5
{ "avatar_url": "https://avatars.githubusercontent.com/u/3938751?v=4", "events_url": "https://api.github.com/users/eromoe/events{/privacy}", "followers_url": "https://api.github.com/users/eromoe/followers", "following_url": "https://api.github.com/users/eromoe/following{/other_user}", "gists_url": "https://api.github.com/users/eromoe/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/eromoe", "id": 3938751, "login": "eromoe", "node_id": "MDQ6VXNlcjM5Mzg3NTE=", "organizations_url": "https://api.github.com/users/eromoe/orgs", "received_events_url": "https://api.github.com/users/eromoe/received_events", "repos_url": "https://api.github.com/users/eromoe/repos", "site_admin": false, "starred_url": "https://api.github.com/users/eromoe/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/eromoe/subscriptions", "type": "User", "url": "https://api.github.com/users/eromoe", "user_view_type": "public" }
[]
closed
true
null
[]
null
3
2014-08-01T06:28:48Z
2021-09-08T20:01:04Z
2014-08-01T11:21:21Z
NONE
resolved
I see https://github.com/kennethreitz/requests/pull/478 is closed, but why I can not use socks5 proxy? define as: ` PROXIES = { "http": "socks5://127.0.0.1:7070", "https": "socks5://127.0.0.1:7070", } ` I use above proxy , and requests raise error `Not supported proxy scheme socks5`
{ "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/2156/reactions" }
https://api.github.com/repos/psf/requests/issues/2156/timeline
null
completed
null
null
false
[ "The error is perfectly clear. We do not support SOCKS5 proxies at this time. If you'd read #478 more closely you'd have seen [this comment](https://github.com/kennethreitz/requests/pull/478#issuecomment-24914571) I made:\n\n> We currently do not have SOCKS proxy support, we're waiting for that code to be included in urllib3. There are plans afoot for this, but no definitive schedule at this time.\n\nThis remains true.\n", "[`urllib3` is an implementation detail](https://github.com/kennethreitz/requests/pull/1812#issuecomment-30854316). \n\nIf the issue is not fixed; it should not be closed unless the answer is that `requests` will never support SOCKS5 proxies.\n", "The fact that urllib3 is an implementation detail is relevant for our features. For features we don't have, implementation is critical. For example, `httplib` is an implementation detail but it's also _why_ we don't have Twisted support. \n\nI was not blaming urllib3, I was providing a path to get this feature. \n" ]
https://api.github.com/repos/psf/requests/issues/2155
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/2155/labels{/name}
https://api.github.com/repos/psf/requests/issues/2155/comments
https://api.github.com/repos/psf/requests/issues/2155/events
https://github.com/psf/requests/issues/2155
39,202,386
MDU6SXNzdWUzOTIwMjM4Ng==
2,155
Streaming gzipped responses
{ "avatar_url": "https://avatars.githubusercontent.com/u/159414?v=4", "events_url": "https://api.github.com/users/hheimbuerger/events{/privacy}", "followers_url": "https://api.github.com/users/hheimbuerger/followers", "following_url": "https://api.github.com/users/hheimbuerger/following{/other_user}", "gists_url": "https://api.github.com/users/hheimbuerger/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/hheimbuerger", "id": 159414, "login": "hheimbuerger", "node_id": "MDQ6VXNlcjE1OTQxNA==", "organizations_url": "https://api.github.com/users/hheimbuerger/orgs", "received_events_url": "https://api.github.com/users/hheimbuerger/received_events", "repos_url": "https://api.github.com/users/hheimbuerger/repos", "site_admin": false, "starred_url": "https://api.github.com/users/hheimbuerger/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/hheimbuerger/subscriptions", "type": "User", "url": "https://api.github.com/users/hheimbuerger", "user_view_type": "public" }
[ { "color": "e102d8", "default": false, "description": null, "id": 117745, "name": "Planned", "node_id": "MDU6TGFiZWwxMTc3NDU=", "url": "https://api.github.com/repos/psf/requests/labels/Planned" }, { "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" }, { "color": "fad8c7", "default": false, "description": null, "id": 136616769, "name": "Documentation", "node_id": "MDU6TGFiZWwxMzY2MTY3Njk=", "url": "https://api.github.com/repos/psf/requests/labels/Documentation" } ]
open
false
null
[]
null
10
2014-07-31T14:55:22Z
2018-09-24T09:33:32Z
null
NONE
null
I need to process big XML responses as a stream. The uncompressed responses can be multiple hundred megabytes in size, so loading them entirely into memory before handing them to the XML parser is not an option. I'm using lxml to parse and I just hand the `response.raw` to its `iterparse()` function, as described somewhere in the requests docs. This works fine for uncompressed responses. Unfortunately, the API I'm calling isn't particularly good. So it will sometimes return `Content-Encoding: gzip` even if I explicitly ask for uncompressed data. Also, the compression ratio on these extremely repetitive and verbose XML files is really good (10x+), so I'd really like to make use of compressed responses. Is this possible with requests? I couldn't find it in the documentation. Researching deeper into urllib3, its [HTTPResponse.read()](https://github.com/shazow/urllib3/blob/master/urllib3/response.py#L140) method seems to support a `decode_content` parameter. If not set, urllib3 falls back to what's set in the constructor. When requests calls the constructor in [requests.adapters.HTTPAdapter.send()](https://github.com/kennethreitz/requests/blob/fe693c492242ae532211e0c173324f09ca8cf227/requests/adapters.py#L343), it explicitly sets `decode_content` to False. Is there a reason why requests does that? Strangely, `iter_content()` actually sets `decode_content=True` while reading. Why here? It all appears a bit arbitrary. I don't really understand the motivation for doing it one way here and another way there. Personally, I can't really use `iter_content()` of course because I need a file-like object for lxml. I previously wrote my own file-like object that I can hook in between requests and lxml, but of course buffering is hard and I feel like smarter people than me have written this before, so I'd prefer to not have to roll my own. What's your advice how to handle this? Should requests be changed to default to setting `decode_content=True` in urllib3?
null
{ "+1": 2, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 2, "url": "https://api.github.com/repos/psf/requests/issues/2155/reactions" }
https://api.github.com/repos/psf/requests/issues/2155/timeline
null
null
null
null
false
[ "No it should not default to setting that for a wide variety of reasons. What you should do is use `functools.partial` to replace the `read` method on the response (or just wrap it another way) so that you do something like:\n\n``` python\nresponse.raw.read = functools.partial(response.raw.read, decode_content=True)\n```\n\nand then pass `response.raw` to your parser.\n", "@sigmavirus24 Thanks, that's definitely an elegant solution to the problem I outlined above!\n\nI would recommend adding that to requests' documentation, e.g. in the FAQ: http://docs.python-requests.org/en/latest/community/faq/#encoded-data \nCurrently, the statement \"Requests automatically decompresses gzip-encoded responses\" is not correct for the `stream=True` case and can lead to surprises.\n\nAs for my problem, as you've read on the [urllib3 issue](https://github.com/shazow/urllib3/issues/437), the urllib3 implementation of the gzip decompression has its own little quirks I have to work around in my code, but that is no longer a problem for requests.\n", "> but that is no longer a problem for requests.\n\nAs in you feel this can be closed?\n", "@sigmavirus24 I believe it should be documented, as the current documentation is incorrect.\n\nBut if you disagree with that, yes, close away!\n", "The documentation could be clearer. To me (and this is entirely because I'm a core developer) the first paragraph speaks to the 90% of users who will never touch the raw response, while the second paragraph contradicts the first in saying \"but if you need to access the raw data, it's there for you\". Like I said, that's apparent to me, but I can see how that could be made clearer. I'll work on that tonight.\n", "For me, it's more that I would have interpreted \"raw data\" as \"raw payload\", i.e. a decompressed stream. I just have to read it in whatever chunks I need. As opposed to `.content`, which is a decompressed blob (also the payload, but in a different form).\n\nThe actual decompression feels like a concern of the HTTP library to me—an implementation detail of HTTP if you will, one that I would expect requests to abstract away. Whether I read the payload from requests as a stream or as a prefetched blob of data wouldn't make a difference. Either way, requests would abstract the implementation detail 'compression'.\n\n(This assumption was also at the core of my original request to default `decode_content` to `True`. Of course now that I see what a leaky abstraction this is, I'm no longer suggesting that.)\n\nBut yeah, I absolutely agree that 99% of your users will never be affected by this detail.\n\nFeel free to close this issue.\n", "So this actually leads to something that's been rattling around in my head for a while and which I haven't proposed yet because it would be a significant API change.\n\nI don't like the fact that we suggest people use `r.raw` because it's an object which we don't document and it's an object provided by `urllib3` (which we've claimed in the past is more of an implementation detail). With that in mind, I've been toying with the idea of providing methods on a `Response` object which just proxy to the `urllib3` methods (`read` would just proxy to `raw.read`, etc.). This gives us extra flexibility around `urllib3` and allows us to handle (on behalf of the users) an API change in `urllib3` (which historically has almost never been a problem, so there isn't any urgency in that).\n\nWith that said, we already have enough methods on a Response object in my opinion and growing our API isn't ideal. The best API is the API from which there's nothing left to remove. So I'm continuously on the fence about this.\n\n---\n\n> This assumption was also at the core of my original request to default decode_content to True. Of course now that I see what a leaky abstraction this is, I'm no longer suggesting that.\n\nFor others who find this and may not be certain why this is true, allow me to explain.\n\nThere are several users of requests who turn off automatic decompression to validate the length of a response, or to do other important things with it. One consumer of the former kind is OpenStack. Many of the OpenStack clients validate the `Content-Length` header sent to the client and the actual length of the body received. To them, handling decompression is a fair trade-off to be certain they're receiving and handling a valid response.\n\nAnother consumer is Betamax (or really any tool that (re)constructs Response objects) because when it is handling the full process of making a totally valid response, it needs the content to be in the compressed format.\n\nI'm sure there are others that neither @Lukasa or I know about that also rely heavily on this behaviour.\n", "Hit the same issue today, and ended up making the same assumption as there is no other way to stream responses at the moment.\n\nRather than multiple new methods on Response why not a single new attribute e.g. `response.stream` which would play the same role of proxy to `.raw`? It would also nicely mirror the `stream=True` setting/parameter, and would not affect users needing the current `.raw` behavior.\n", "I've done this in the past\r\n\r\n```python\r\nr = requests.get('url', stream=True)\r\nr.raw.decode_content = True\r\n...\r\n```", "Note that the [workaround](https://github.com/requests/requests/issues/2155#issuecomment-50771010) by @sigmavirus24 breaks the semantics of the `tell` method, which will return incorrect offsets.\r\n\r\nI ran into this when streaming a response as a resumable upload into the Google Cloud Storage API, which uses `tell()` to figure out the number of bytes that were just read ([here](https://github.com/GoogleCloudPlatform/google-resumable-media-python/blob/50f4c4d22cdaea71c794639226e819197f11f555/google/resumable_media/_upload.py#L804))." ]
https://api.github.com/repos/psf/requests/issues/2154
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/2154/labels{/name}
https://api.github.com/repos/psf/requests/issues/2154/comments
https://api.github.com/repos/psf/requests/issues/2154/events
https://github.com/psf/requests/issues/2154
39,059,024
MDU6SXNzdWUzOTA1OTAyNA==
2,154
Putting a literal encoded + in the request without it encoding.
{ "avatar_url": "https://avatars.githubusercontent.com/u/85492?v=4", "events_url": "https://api.github.com/users/encompass/events{/privacy}", "followers_url": "https://api.github.com/users/encompass/followers", "following_url": "https://api.github.com/users/encompass/following{/other_user}", "gists_url": "https://api.github.com/users/encompass/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/encompass", "id": 85492, "login": "encompass", "node_id": "MDQ6VXNlcjg1NDky", "organizations_url": "https://api.github.com/users/encompass/orgs", "received_events_url": "https://api.github.com/users/encompass/received_events", "repos_url": "https://api.github.com/users/encompass/repos", "site_admin": false, "starred_url": "https://api.github.com/users/encompass/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/encompass/subscriptions", "type": "User", "url": "https://api.github.com/users/encompass", "user_view_type": "public" }
[]
closed
true
null
[]
null
6
2014-07-30T04:17:52Z
2021-09-08T23:10:45Z
2014-07-30T10:50:00Z
NONE
resolved
I have to connect to a searching feature, amongst many other features, and I have so far been able to do it easily with one command with python requests. However, when I use the search I need to send one parameter with +'s in it. This person has this same issue... http://stackoverflow.com/questions/12527959/passing-the-character-in-a-post-request-in-python But I feel it's a bit silly considering I am using requests so heavily here. ``` python def send_message(command, payload = {}): command_version = {'offers': "2.1", 'categories': '1.0'} url = BASE_URL + "/" + command_version[command] + "/" + command headers = {"X-Apikey":API_KEY} return requests.get(url, params = payload, headers=headers) send_message('offers', payload={'searchword':search_term, 'limit':page_size+1, 'offset':offset*page_size, "deleted":0}).json()['offers'] ``` As you can see in calling the method, search_term will have text like this: "one+2+three" but the message is encoded as stated in the stackoverflow link I posted. Is there a way I can stop the encoding of the + without having to create a new messaging system just for searches?
{ "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/2154/reactions" }
https://api.github.com/repos/psf/requests/issues/2154/timeline
null
completed
null
null
false
[ "There are a number of options, but the easiest thing to do is probably to use the [`PreparedRequest`](http://docs.python-requests.org/en/latest/user/advanced/#prepared-requests) flow. Building the `PreparedRequest` will let you arbitrarily mutate its encoded `r.url` property, and you can then use the tools in `urllib` to make whatever changes you need to make, or indeed to entirely rebuild it as suggested in Marijn's SO answer.\n", "Do you mean like this?\n\n``` python\ndef send_message(command, payload = {}):\n import urllib\n command_version = {'offers': \"2.1\", 'categories': '1.0'}\n url = OIKIAN_URL + \"/\" + command_version[command] + \"/\" + command\n headers = {\"X-Apikey\":API_KEY}\n\n from requests import Request, Session\n s = Session()\n if \"searchword\" in payload:\n print \"found search word... Trying to properly encoding it.\"\n payload['searchword'] = urllib.quote(payload['searchword'], safe='+')\n req = Request('GET', url,\n params = payload,\n headers = headers\n )\n prepped = req.prepare()\n # do something with prepped.body\n # do something with prepped.headers\n return s.send(prepped)\n```\n\nIt seems to have the same effect. Sadly.\nAny idea what I am doing wrong and why?\n", "I did not mean like that, I meant manipulating the URL _after_ the call to `req.prepare()`.\n", "Ah yes.... to be clear, here was my solution.\n\n``` python\ndef send_message(command, payload = {}):\n import urllib\n command_version = {'offers': \"2.1\", 'categories': '1.0'}\n url = OIKIAN_URL + \"/\" + command_version[command] + \"/\" + command\n headers = {\"X-Apikey\":API_KEY}\n\n from requests import Request, Session\n s = Session()\n req = Request('GET', url,\n params = payload,\n headers = headers\n )\n prepped = req.prepare()\n prepped.url = (prepped.url).replace(\"%2B\", \"+\")\n return s.send(prepped)\n```\n\nIt's too bad I can't define that information when passing the params. That would be much cleaner than this. Perhaps:\n\n``` python\nr = requests.get('https://api.example.com/test', params = cheese_dict, safe=\"+\" )\n```\n\nAnd it would only apply that to params.\nYou probably know best.\nThanks!\n", "Yeah, sorry, but our position is that we support the 90% use-case. This allows us to keep our API clean and clear. Every use-case in the remaining 10% we want to make _possible_, but we won't accept API extensions for.\n", "Totally understandable. Thank you.\n" ]
https://api.github.com/repos/psf/requests/issues/2153
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/2153/labels{/name}
https://api.github.com/repos/psf/requests/issues/2153/comments
https://api.github.com/repos/psf/requests/issues/2153/events
https://github.com/psf/requests/pull/2153
39,057,455
MDExOlB1bGxSZXF1ZXN0MTkwNjc4ODA=
2,153
handle urllib3 api changes; closes #2045
{ "avatar_url": "https://avatars.githubusercontent.com/u/2245080?v=4", "events_url": "https://api.github.com/users/jschneier/events{/privacy}", "followers_url": "https://api.github.com/users/jschneier/followers", "following_url": "https://api.github.com/users/jschneier/following{/other_user}", "gists_url": "https://api.github.com/users/jschneier/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/jschneier", "id": 2245080, "login": "jschneier", "node_id": "MDQ6VXNlcjIyNDUwODA=", "organizations_url": "https://api.github.com/users/jschneier/orgs", "received_events_url": "https://api.github.com/users/jschneier/received_events", "repos_url": "https://api.github.com/users/jschneier/repos", "site_admin": false, "starred_url": "https://api.github.com/users/jschneier/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/jschneier/subscriptions", "type": "User", "url": "https://api.github.com/users/jschneier", "user_view_type": "public" }
[ { "color": "009800", "default": false, "description": null, "id": 44501218, "name": "Ready To Merge", "node_id": "MDU6TGFiZWw0NDUwMTIxOA==", "url": "https://api.github.com/repos/psf/requests/labels/Ready%20To%20Merge" }, { "color": "207de5", "default": false, "description": null, "id": 60620163, "name": "Minion Seal of Approval", "node_id": "MDU6TGFiZWw2MDYyMDE2Mw==", "url": "https://api.github.com/repos/psf/requests/labels/Minion%20Seal%20of%20Approval" } ]
closed
true
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
[ { "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" } ]
null
3
2014-07-30T03:32:34Z
2021-09-08T11:00:56Z
2014-08-02T01:33:56Z
CONTRIBUTOR
resolved
urllib3 changed and now catches all of the exceptions in `iter_content` that requests was working around. This patch addresses those changes so that the proper exceptions are being caught and rethrown.
{ "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/2153/reactions" }
https://api.github.com/repos/psf/requests/issues/2153/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/2153.diff", "html_url": "https://github.com/psf/requests/pull/2153", "merged_at": "2014-08-02T01:33:56Z", "patch_url": "https://github.com/psf/requests/pull/2153.patch", "url": "https://api.github.com/repos/psf/requests/pulls/2153" }
true
[ ":heart: Thanks @jschneier !\n\nLGTM! :+1: \n", ":cake: LGTM also.\n", "wonderous!\n" ]
https://api.github.com/repos/psf/requests/issues/2152
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/2152/labels{/name}
https://api.github.com/repos/psf/requests/issues/2152/comments
https://api.github.com/repos/psf/requests/issues/2152/events
https://github.com/psf/requests/issues/2152
38,845,129
MDU6SXNzdWUzODg0NTEyOQ==
2,152
Raise exception if status code doesn't equal 200
{ "avatar_url": "https://avatars.githubusercontent.com/u/1218474?v=4", "events_url": "https://api.github.com/users/Matt3o12/events{/privacy}", "followers_url": "https://api.github.com/users/Matt3o12/followers", "following_url": "https://api.github.com/users/Matt3o12/following{/other_user}", "gists_url": "https://api.github.com/users/Matt3o12/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Matt3o12", "id": 1218474, "login": "Matt3o12", "node_id": "MDQ6VXNlcjEyMTg0NzQ=", "organizations_url": "https://api.github.com/users/Matt3o12/orgs", "received_events_url": "https://api.github.com/users/Matt3o12/received_events", "repos_url": "https://api.github.com/users/Matt3o12/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Matt3o12/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Matt3o12/subscriptions", "type": "User", "url": "https://api.github.com/users/Matt3o12", "user_view_type": "public" }
[]
closed
true
null
[]
null
3
2014-07-27T16:20:08Z
2021-09-08T23:10:46Z
2014-07-27T16:30:16Z
NONE
resolved
Hello, I often expect the request to have status code 200 and if it doesn't there isn't much I can do about (seriously when the server returns with error 500, I won't be able to do something). So I need to write code like this: ``` r = requests.get(self.url(False)) if r.status_code != 200: raise requests.ConnectionError("Expected status code 200, but got {}".format(page.status_code)) ``` I think a kwarg called allowed_status_codes would be very convenient. It could be implemented like this: By default it is `None`. `None`, and an empty list or tuple means allow all status codes. It may be an integer, list, tuple, or enum. If it is an integer, only allow this specific status code. In case it is a list or tuple, only status codes that are inside of the list/tuple are allowed. The list may have integers and/or enums. Enums should be a little bit more flexible. For instance, if I wanted to allow all "successful" (2xx) requests, I could write: allowed_status_codes=requests.ALLOW_SUCCESS, which will throw an exception unless the status code is 2xx. If I only wanted to disallow server errors (and thus handle not authenticated errors), I could simply write allowed_status_codes=requests.DISALLOW_SERVER_ERROR, which will raise an exception if the server code is 5xx. Of course there should be lots of enums that cover specific cases. And one should also be able to use it combined within a list (e.g. `(200, ALLOW_REDIRECTIONS)`). If the status code isn't allowed, a `StatusCodeError(RequestException)` will be raised. --- Even though I mentioned enums, I'm not talking about Python 3.4's enumerated values. I was talking rather about constants. Enums (constants) could be implemented like this: ``` #request model. ALLOW_SUCCESS = AllowSuccessEnum() # other enums class RequestEnum(object): def is_status_code_allowed(status_code): raise NotImplementedError class AllowSuccessEnum(RequestEnum): def is_status_code_allowed(status_code): # return false unless status code is 2xx ```
{ "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/2152/reactions" }
https://api.github.com/repos/psf/requests/issues/2152/timeline
null
completed
null
null
false
[ "Thanks for this idea!\n\nIt's not clear why this belongs in requests itself. The code required is not complex, and I do not believe we would add much value by having this code in the library. We _would_, however, be adding another keyword argument to the API, which is something we're disinclined to do most of the time. \n", "Also, doesn't each `Response` have a `raise_for_status` method that will raise an exception if the status code isn't 200?\n\n``` pycon\nPython 2.7.7 (default, Jun 2 2014, 18:55:26)\n[GCC 4.2.1 Compatible Apple LLVM 5.1 (clang-503.0.40)] on darwin\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\n>>> import requests\n>>> r = requests.get('http://httpbin.org/404')\n>>> r\n<Response [404]>\n>>> r.raise_for_status()\nTraceback (most recent call last):\n File \"<stdin>\", line 1, in <module>\n File \"/usr/local/lib/python2.7/site-packages/requests/models.py\", line 795, in raise_for_status\n raise HTTPError(http_error_msg, response=self)\nrequests.exceptions.HTTPError: 404 Client Error: NOT FOUND\n```\n", "@Lukasa Because it is very convenient, can save lots of code (let's just say a project uses request. This project uses about 100 times a request. So, it _could_ save 200 lines of code, and prevent typos because I would have to write the exception 100 times (in case I don't use a method for raising an exception), and it unifies exceptions/errors (another API may use requests and raise a custom error in case of an invalid status code. I like it better if it throws the same exception as requests does). \n\n@sigmavirus24 Sorry, I didn't know this method exists. You should mention that an HTTPError can be raised by raise_for_status in Error and Exceptions section in the docs. An HTTPError currently claims only to be raised \"In the rare event of an invalid HTTP response\". \nYou could also consider implementing some of my ideas into my raise_for_status so that it can allow other status codes, too. \n" ]
https://api.github.com/repos/psf/requests/issues/2151
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/2151/labels{/name}
https://api.github.com/repos/psf/requests/issues/2151/comments
https://api.github.com/repos/psf/requests/issues/2151/events
https://github.com/psf/requests/issues/2151
38,817,425
MDU6SXNzdWUzODgxNzQyNQ==
2,151
HTTP Status Code always 404
{ "avatar_url": "https://avatars.githubusercontent.com/u/237062?v=4", "events_url": "https://api.github.com/users/tvrcgo/events{/privacy}", "followers_url": "https://api.github.com/users/tvrcgo/followers", "following_url": "https://api.github.com/users/tvrcgo/following{/other_user}", "gists_url": "https://api.github.com/users/tvrcgo/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/tvrcgo", "id": 237062, "login": "tvrcgo", "node_id": "MDQ6VXNlcjIzNzA2Mg==", "organizations_url": "https://api.github.com/users/tvrcgo/orgs", "received_events_url": "https://api.github.com/users/tvrcgo/received_events", "repos_url": "https://api.github.com/users/tvrcgo/repos", "site_admin": false, "starred_url": "https://api.github.com/users/tvrcgo/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/tvrcgo/subscriptions", "type": "User", "url": "https://api.github.com/users/tvrcgo", "user_view_type": "public" }
[]
closed
true
null
[]
null
4
2014-07-26T13:25:55Z
2021-09-08T23:10:47Z
2014-07-26T14:38:05Z
NONE
resolved
http status code always 404 even though link actually exists and can be accessed directly.
{ "avatar_url": "https://avatars.githubusercontent.com/u/240830?v=4", "events_url": "https://api.github.com/users/sigmavirus24/events{/privacy}", "followers_url": "https://api.github.com/users/sigmavirus24/followers", "following_url": "https://api.github.com/users/sigmavirus24/following{/other_user}", "gists_url": "https://api.github.com/users/sigmavirus24/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/sigmavirus24", "id": 240830, "login": "sigmavirus24", "node_id": "MDQ6VXNlcjI0MDgzMA==", "organizations_url": "https://api.github.com/users/sigmavirus24/orgs", "received_events_url": "https://api.github.com/users/sigmavirus24/received_events", "repos_url": "https://api.github.com/users/sigmavirus24/repos", "site_admin": false, "starred_url": "https://api.github.com/users/sigmavirus24/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/sigmavirus24/subscriptions", "type": "User", "url": "https://api.github.com/users/sigmavirus24", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/2151/reactions" }
https://api.github.com/repos/psf/requests/issues/2151/timeline
null
completed
null
null
false
[ "This bug report is seriously incomplete.\n\nCan you suggest what the link is? Can you provide some sample code that reproduces the bug?\n", "When I try to open that URL from my browser I also get a 404. Are you sure this URL is correct?\n", "sample code:\n\nimport requests\n\nif **name** == \"**main**\":\n r = requests.get(\"http://movie.douban.com/subject/1459804/\")\n print(r.status_code)\n input()\n\noutput:\n![default](https://cloud.githubusercontent.com/assets/237062/3711232/1bfc271a-14ca-11e4-86d1-2c5a4122e6d2.png)\n\nthe page:\n![2](https://cloud.githubusercontent.com/assets/237062/3711238/5e542c66-14ca-11e4-8c4c-ffef3e6a7c54.png)\n", "The fact that we 404 in this case suggests a number of possibilities. One option is that the website is only available from a certain set of IP addresses, e.g. via a proxy. Another option is that you need to have the appropriate User Agent set. You can do both of those things in requests, but you'll have to investigate: without knowing the configuration of your machine I cannot help debug it.\n\nRegardless, it is the _website_ that is breaking your code, not requests. =)\n" ]
https://api.github.com/repos/psf/requests/issues/2150
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/2150/labels{/name}
https://api.github.com/repos/psf/requests/issues/2150/comments
https://api.github.com/repos/psf/requests/issues/2150/events
https://github.com/psf/requests/issues/2150
38,732,431
MDU6SXNzdWUzODczMjQzMQ==
2,150
requests loosing cookies
{ "avatar_url": "https://avatars.githubusercontent.com/u/1548328?v=4", "events_url": "https://api.github.com/users/s0rg/events{/privacy}", "followers_url": "https://api.github.com/users/s0rg/followers", "following_url": "https://api.github.com/users/s0rg/following{/other_user}", "gists_url": "https://api.github.com/users/s0rg/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/s0rg", "id": 1548328, "login": "s0rg", "node_id": "MDQ6VXNlcjE1NDgzMjg=", "organizations_url": "https://api.github.com/users/s0rg/orgs", "received_events_url": "https://api.github.com/users/s0rg/received_events", "repos_url": "https://api.github.com/users/s0rg/repos", "site_admin": false, "starred_url": "https://api.github.com/users/s0rg/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/s0rg/subscriptions", "type": "User", "url": "https://api.github.com/users/s0rg", "user_view_type": "public" }
[]
closed
true
null
[]
null
4
2014-07-25T13:52:38Z
2021-09-08T23:10:47Z
2014-07-25T14:28:18Z
NONE
resolved
Because of dict-like headers requests can loose one ore more cookies (i.e. http://www.lineage2dex.com/): Set-Cookie: __HFCTL=0; path=/ Set-Cookie: PHPSESSID=7c3129a98cc6a75e0cbf71b7a3513364; path=/ But in requests i have only one (the first). I think the solution is to take othe data structure (like http://werkzeug.pocoo.org/docs/datastructures/#werkzeug.datastructures.MultiDict from werkzeug) that will not break api, but can hadle this situation.
{ "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/2150/reactions" }
https://api.github.com/repos/psf/requests/issues/2150/timeline
null
completed
null
null
false
[ "@s0rg you didn't tell us which version of requests you're using so we can't even test this to ensure that it's a problem.\n", "Besides that, this appears to be an issue with `httplib`:\n\n``` pycon\n>>> conn = httplib.HTTPConnection('www.lineage2dex.com')\n>>> conn.request('GET', 'http://www.lineage2dex.com/')\n>>> r = conn.getresponse()\n>>> r\n<httplib.HTTPResponse instance at 0x10d4b8488>\n>>> r.getheaders()\n[('content-length', '633'), ('set-cookie', '__HFCTL=1; path=/'), ('expires', 'Fri, 25 Jul 2014 14:24:57 GMT'), ('ddos', 'Protected by HyperFilter : http://www.hyperfilter.com'), ('server', 'HyperFilter FastCache v1.0'), ('hf-wall', 'HIT-3'), ('connection', 'close'), ('cache-control', 'no-cache'), ('date', 'Fri, 25 Jul 2014 14:24:58 GMT'), ('p3p', 'CP=\"IDC DSP COR CURa ADMa OUR IND PHY ONL COM STA\"')]\n```\n\nTherefore it is something requests can not fix for you. Using `urllib2` would cause the same problem:\n\n``` pycon\n>>> r = urllib2.urlopen('http://www.lineage2dex.com/')\n>>> r.headers\n<httplib.HTTPMessage instance at 0x10e00ad40>\n>>> r.headers.getheaders('set-cookie')\n['__HFCTL=1; path=/']\n```\n", "Ok, thanks.\n", "@s0rg if you upgrade to Python 3 this should be fixed http://bugs.python.org/issue1660009\n" ]
https://api.github.com/repos/psf/requests/issues/2149
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/2149/labels{/name}
https://api.github.com/repos/psf/requests/issues/2149/comments
https://api.github.com/repos/psf/requests/issues/2149/events
https://github.com/psf/requests/issues/2149
38,715,791
MDU6SXNzdWUzODcxNTc5MQ==
2,149
How to make spaces to encode as %20 instead of +?
{ "avatar_url": "https://avatars.githubusercontent.com/u/5586633?v=4", "events_url": "https://api.github.com/users/Greblys/events{/privacy}", "followers_url": "https://api.github.com/users/Greblys/followers", "following_url": "https://api.github.com/users/Greblys/following{/other_user}", "gists_url": "https://api.github.com/users/Greblys/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Greblys", "id": 5586633, "login": "Greblys", "node_id": "MDQ6VXNlcjU1ODY2MzM=", "organizations_url": "https://api.github.com/users/Greblys/orgs", "received_events_url": "https://api.github.com/users/Greblys/received_events", "repos_url": "https://api.github.com/users/Greblys/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Greblys/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Greblys/subscriptions", "type": "User", "url": "https://api.github.com/users/Greblys", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2014-07-25T10:10:54Z
2021-09-08T23:10:47Z
2014-07-25T10:15:13Z
NONE
resolved
`print requests.get("http://url.com", params={"key" : "asd asd").url` I want this output: `http://url.com?key=asd%20asd`, but I get this: `http://url.com?key=asd+asd`
{ "avatar_url": "https://avatars.githubusercontent.com/u/5586633?v=4", "events_url": "https://api.github.com/users/Greblys/events{/privacy}", "followers_url": "https://api.github.com/users/Greblys/followers", "following_url": "https://api.github.com/users/Greblys/following{/other_user}", "gists_url": "https://api.github.com/users/Greblys/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Greblys", "id": 5586633, "login": "Greblys", "node_id": "MDQ6VXNlcjU1ODY2MzM=", "organizations_url": "https://api.github.com/users/Greblys/orgs", "received_events_url": "https://api.github.com/users/Greblys/received_events", "repos_url": "https://api.github.com/users/Greblys/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Greblys/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Greblys/subscriptions", "type": "User", "url": "https://api.github.com/users/Greblys", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/2149/reactions" }
https://api.github.com/repos/psf/requests/issues/2149/timeline
null
completed
null
null
false
[ "Requests provides no easy way to do this, because it follows the W3C standard for urlencoding that specifies that urlencoded spaces map to '+' chars, not %20.\n\nYou'll notice we map to %20 in other parts of the URL.\n" ]
https://api.github.com/repos/psf/requests/issues/2148
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/2148/labels{/name}
https://api.github.com/repos/psf/requests/issues/2148/comments
https://api.github.com/repos/psf/requests/issues/2148/events
https://github.com/psf/requests/pull/2148
38,673,757
MDExOlB1bGxSZXF1ZXN0MTg4NjM4NzY=
2,148
Handle socket errors in iter_content
{ "avatar_url": "https://avatars.githubusercontent.com/u/132421?v=4", "events_url": "https://api.github.com/users/romanlevin/events{/privacy}", "followers_url": "https://api.github.com/users/romanlevin/followers", "following_url": "https://api.github.com/users/romanlevin/following{/other_user}", "gists_url": "https://api.github.com/users/romanlevin/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/romanlevin", "id": 132421, "login": "romanlevin", "node_id": "MDQ6VXNlcjEzMjQyMQ==", "organizations_url": "https://api.github.com/users/romanlevin/orgs", "received_events_url": "https://api.github.com/users/romanlevin/received_events", "repos_url": "https://api.github.com/users/romanlevin/repos", "site_admin": false, "starred_url": "https://api.github.com/users/romanlevin/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/romanlevin/subscriptions", "type": "User", "url": "https://api.github.com/users/romanlevin", "user_view_type": "public" }
[ { "color": "009800", "default": false, "description": null, "id": 44501218, "name": "Ready To Merge", "node_id": "MDU6TGFiZWw0NDUwMTIxOA==", "url": "https://api.github.com/repos/psf/requests/labels/Ready%20To%20Merge" }, { "color": "207de5", "default": false, "description": null, "id": 60620163, "name": "Minion Seal of Approval", "node_id": "MDU6TGFiZWw2MDYyMDE2Mw==", "url": "https://api.github.com/repos/psf/requests/labels/Minion%20Seal%20of%20Approval" } ]
closed
true
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
[ { "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" } ]
null
4
2014-07-24T21:03:03Z
2021-09-08T11:00:57Z
2014-07-27T13:59:08Z
CONTRIBUTOR
resolved
My first PR for Requests, so I probably did something terribly wrong. Closes #2144.
{ "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/2148/reactions" }
https://api.github.com/repos/psf/requests/issues/2148/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/2148.diff", "html_url": "https://github.com/psf/requests/pull/2148", "merged_at": "2014-07-27T13:59:08Z", "patch_url": "https://github.com/psf/requests/pull/2148.patch", "url": "https://api.github.com/repos/psf/requests/pulls/2148" }
true
[ "![:+1:](https://d16jfyletng9p5.cloudfront.net/media/bOUbNyILuU56U/giphy.gif)\n", "This looks good to me. =)\n", "@sigmavirus24 @alex Fixed. Not sure what I was thinking, there.\n", ":sparkles: :cake: :sparkles: \n" ]
https://api.github.com/repos/psf/requests/issues/2147
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/2147/labels{/name}
https://api.github.com/repos/psf/requests/issues/2147/comments
https://api.github.com/repos/psf/requests/issues/2147/events
https://github.com/psf/requests/issues/2147
38,563,168
MDU6SXNzdWUzODU2MzE2OA==
2,147
requests does not use custom transport adapter settings after a redirect
{ "avatar_url": "https://avatars.githubusercontent.com/u/7874479?v=4", "events_url": "https://api.github.com/users/s-dixit/events{/privacy}", "followers_url": "https://api.github.com/users/s-dixit/followers", "following_url": "https://api.github.com/users/s-dixit/following{/other_user}", "gists_url": "https://api.github.com/users/s-dixit/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/s-dixit", "id": 7874479, "login": "s-dixit", "node_id": "MDQ6VXNlcjc4NzQ0Nzk=", "organizations_url": "https://api.github.com/users/s-dixit/orgs", "received_events_url": "https://api.github.com/users/s-dixit/received_events", "repos_url": "https://api.github.com/users/s-dixit/repos", "site_admin": false, "starred_url": "https://api.github.com/users/s-dixit/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/s-dixit/subscriptions", "type": "User", "url": "https://api.github.com/users/s-dixit", "user_view_type": "public" }
[]
closed
true
null
[]
null
4
2014-07-23T19:31:53Z
2021-09-08T23:10:48Z
2014-07-23T19:37:18Z
NONE
resolved
![requests-capture-1](https://cloud.githubusercontent.com/assets/7874479/3678984/e50e403e-129f-11e4-824a-6b2d88003a20.JPG) Hi I am seeing an issue where after a 302 redirect, requests does not use custom adapter attached to the session. The custom adapter is a subclass of requests HTTPAdapter and uses 'source_address' property of HTTPLib. For the first session.get, it uses the source IP address from the custom adapter. However, when a request is redirected, it uses a the default IP address on the machine. For the ifconfig below, first GET it sent out with IP 20.20.1.4 which is set in the custom transport adapter. Redirect request uses IP= 20.20.1.3. Please see attached image of PCAP. eth1 Link encap:Ethernet HWaddr 00:50:56:98:40:3c inet addr:20.20.1.3 Bcast:20.20.1.255 Mask:255.255.255.0 inet6 addr: fe80::250:56ff:fe98:403c/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:11604716 errors:0 dropped:0 overruns:0 frame:0 TX packets:5560908 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:15153507687 (15.1 GB) TX bytes:532461537 (532.4 MB) eth1:1 Link encap:Ethernet HWaddr 00:50:56:98:40:3c inet addr:20.20.1.4 Bcast:20.20.1.255 Mask:255.255.255.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 --- ## Here is the code in main ... HTTPHeaders = {'Connection': 'keep-alive', 'Cache-Control': 'no-cache', 'Accept-Encoding': 'gzip,deflate,sdch', 'Accept-Language': 'en-US'} srcIP = '20.20.1.4' s1 = requests.session() s1.mount('http://20.20.1.2/', customTransportAdapter(srcIP)) s1.auth = HTTPCustomNtlmAuth('systemqa\tester1', '12345678', srcIP) response1 = s1.get('http://20.20.1.2/dbx.html', headers=HTTPHeaders, timeout=1) # end of main --- ## Custom transport adapter # !/home/tester/HTTP_AUTH/bin/python import requests import requests.adapters from requests.adapters import HTTPAdapter DEFAULT_POOLBLOCK = False DEFAULT_POOLSIZE = 10 DEFAULT_RETRIES = 0 class customTransportAdapter(HTTPAdapter): def **init**(self, sourceIP): self.sourceIP = sourceIP HTTPAdapter.**init**(self, pool_connections=DEFAULT_POOLSIZE, pool_maxsize=DEFAULT_POOLSIZE, max_retries=DEFAULT_RETRIES, pool_block=DEFAULT_POOLBLOCK) ``` def init_poolmanager(self, connections, maxsize, block=DEFAULT_POOLBLOCK): # save these values for pickling self._pool_connections = connections self._pool_maxsize = maxsize self._pool_block = block self.poolmanager = requests.adapters.PoolManager(num_pools=connections, maxsize=maxsize, block=block, source_address=(self.sourceIP, 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": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/2147/reactions" }
https://api.github.com/repos/psf/requests/issues/2147/timeline
null
completed
null
null
false
[ "You've mounted your source address adapter to `http://20.20.1.2/`, but the redirect takes you off that host, to `http://20.20.1.1/`. We evaluate which adapter to use for each request independently.\n\nMount a source address adapter for `http://20.20.1.1/` as well and you'll be fine. Alternatively, mount it to `http://20.20.1`, which will match both.\n", "Hi Lukasa,\n\nI tried the solution, you provided. However, it does not work as expected. I still see the same behavior. \n", "Can you demonstrate your code?\n", "Okay fixed. Basically I have an inline proxy which sends the URL with 302. I need to set the FQDN of proxy while mounting the adapter, not the IP address of proxy.\nThank your help and time. \n" ]
https://api.github.com/repos/psf/requests/issues/2146
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/2146/labels{/name}
https://api.github.com/repos/psf/requests/issues/2146/comments
https://api.github.com/repos/psf/requests/issues/2146/events
https://github.com/psf/requests/issues/2146
38,499,051
MDU6SXNzdWUzODQ5OTA1MQ==
2,146
Invocation of `SSLContext.load_verify_locations` causes intermittent hanging
{ "avatar_url": "https://avatars.githubusercontent.com/u/1829591?v=4", "events_url": "https://api.github.com/users/scott-coates/events{/privacy}", "followers_url": "https://api.github.com/users/scott-coates/followers", "following_url": "https://api.github.com/users/scott-coates/following{/other_user}", "gists_url": "https://api.github.com/users/scott-coates/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/scott-coates", "id": 1829591, "login": "scott-coates", "node_id": "MDQ6VXNlcjE4Mjk1OTE=", "organizations_url": "https://api.github.com/users/scott-coates/orgs", "received_events_url": "https://api.github.com/users/scott-coates/received_events", "repos_url": "https://api.github.com/users/scott-coates/repos", "site_admin": false, "starred_url": "https://api.github.com/users/scott-coates/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/scott-coates/subscriptions", "type": "User", "url": "https://api.github.com/users/scott-coates", "user_view_type": "public" }
[ { "color": "e11d21", "default": false, "description": null, "id": 136589914, "name": "Needs Info", "node_id": "MDU6TGFiZWwxMzY1ODk5MTQ=", "url": "https://api.github.com/repos/psf/requests/labels/Needs%20Info" }, { "color": "f7c6c7", "default": false, "description": null, "id": 167537670, "name": "Propose Close", "node_id": "MDU6TGFiZWwxNjc1Mzc2NzA=", "url": "https://api.github.com/repos/psf/requests/labels/Propose%20Close" } ]
closed
true
null
[]
null
2
2014-07-23T06:14:57Z
2021-09-08T23:06:07Z
2015-01-19T09:20:52Z
NONE
resolved
I have a background worker that makes many http requests to various APIs. I've found that every time my job runs, a few requests appear to just "hang" for quite a long time. I've investigated further and it appears the requests are not actually hanging, but my python code "hangs" when it invokes `OpenSSL's` `SSL_CTX_load_verify_locations` function. I forked `requests` and added some more logging. The last entry to be logged in my code is `begin: ssl_wrap_socket: load verify locations` and that corresponds to [this line](https://github.com/WiFL-co/requests/blob/master/requests/packages/urllib3/util/ssl_.py#L118). One possible conclusion is that SSL_CTX_load_verify_locations is hanging because of parallel file access or the version of OpenSSL on my Heroku dyno has a bug. FYI the `requests` library is calling python's `load_verify_locations` which is what then calls `OpenSSL`. I am not invoking these functions manually. [I've created a question on StackOverflow](http://stackoverflow.com/questions/24628866/why-does-my-program-hang-after-urllib3-logs-starting-new-https-connection) that provides extensive information. I am using the following dependencies: ``` python 3.4 requests==2.3.0. Rabbit 3.1.3 celery:3.1.11 (Cipater w/ Prefork) kombu:3.0.16 billiard:3.3.0.17 py-amqp:1.4.5 ``` @Lukasa has been really helpful thus far, and I've been able to narrow it down. I figured i'd throw this issue up and see if anyone else has some insight.
{ "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/2146/reactions" }
https://api.github.com/repos/psf/requests/issues/2146/timeline
null
completed
null
null
false
[ "I'm really interested to see what people can come up with here. I cannot see any good reason for `SSL_CTX_load_verify_locations` to hang.\n", "Closed for inactivity.\n" ]
https://api.github.com/repos/psf/requests/issues/2145
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/2145/labels{/name}
https://api.github.com/repos/psf/requests/issues/2145/comments
https://api.github.com/repos/psf/requests/issues/2145/events
https://github.com/psf/requests/pull/2145
38,418,399
MDExOlB1bGxSZXF1ZXN0MTg3MjU0ODI=
2,145
Update faq.rst
{ "avatar_url": "https://avatars.githubusercontent.com/u/72590?v=4", "events_url": "https://api.github.com/users/TkTech/events{/privacy}", "followers_url": "https://api.github.com/users/TkTech/followers", "following_url": "https://api.github.com/users/TkTech/following{/other_user}", "gists_url": "https://api.github.com/users/TkTech/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/TkTech", "id": 72590, "login": "TkTech", "node_id": "MDQ6VXNlcjcyNTkw", "organizations_url": "https://api.github.com/users/TkTech/orgs", "received_events_url": "https://api.github.com/users/TkTech/received_events", "repos_url": "https://api.github.com/users/TkTech/repos", "site_admin": false, "starred_url": "https://api.github.com/users/TkTech/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/TkTech/subscriptions", "type": "User", "url": "https://api.github.com/users/TkTech", "user_view_type": "public" }
[]
closed
true
null
[]
null
4
2014-07-22T16:38:13Z
2021-09-08T11:00:58Z
2014-07-22T20:20:37Z
CONTRIBUTOR
resolved
Removed an unnecessary "to" in the "What are "hostname doesn't match" errors?" section.
{ "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/2145/reactions" }
https://api.github.com/repos/psf/requests/issues/2145/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/2145.diff", "html_url": "https://github.com/psf/requests/pull/2145", "merged_at": "2014-07-22T20:20:37Z", "patch_url": "https://github.com/psf/requests/pull/2145.patch", "url": "https://api.github.com/repos/psf/requests/pulls/2145" }
true
[ "Why don't we just rewrite that entire sentence? Something like:\n\n\"This is important when servers are using Virtual Hosting (include link). When these servers are hosting several SSL sites they need to be able to return the appropriate certificate based on the hostname the client is connecting to.\"\n", "@sigmavirus24 I've updated the wording - comments?\n", "It may be beneficial to include a link to confirm if SNI support is available. For this, https://sni.velox.ch seems reliable (has been around more than a year and is referenced in the Mozzila bug tracker). It's also the URL used by PHP's tests (http://gcov.php.net/viewer.php?version=PHP_5_4&func=tests&file=ext%2Fopenssl%2Ftests%2Fsni_001.phpt)\n", "@TkTech I completely agree! A pull requests that added that would be accepted :)\n" ]
https://api.github.com/repos/psf/requests/issues/2144
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/2144/labels{/name}
https://api.github.com/repos/psf/requests/issues/2144/comments
https://api.github.com/repos/psf/requests/issues/2144/events
https://github.com/psf/requests/issues/2144
38,386,919
MDU6SXNzdWUzODM4NjkxOQ==
2,144
socket.error exception not caught/wrapped in a requests exception (ConnectionError perhaps?)
{ "avatar_url": "https://avatars.githubusercontent.com/u/5319942?v=4", "events_url": "https://api.github.com/users/rtdean/events{/privacy}", "followers_url": "https://api.github.com/users/rtdean/followers", "following_url": "https://api.github.com/users/rtdean/following{/other_user}", "gists_url": "https://api.github.com/users/rtdean/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/rtdean", "id": 5319942, "login": "rtdean", "node_id": "MDQ6VXNlcjUzMTk5NDI=", "organizations_url": "https://api.github.com/users/rtdean/orgs", "received_events_url": "https://api.github.com/users/rtdean/received_events", "repos_url": "https://api.github.com/users/rtdean/repos", "site_admin": false, "starred_url": "https://api.github.com/users/rtdean/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/rtdean/subscriptions", "type": "User", "url": "https://api.github.com/users/rtdean", "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
1
2014-07-22T10:23:48Z
2021-09-08T23:10:46Z
2014-07-27T13:59:08Z
NONE
resolved
I just noticed a case where I had a socket reset on me, and was raised to me as a raw socket error as opposed to something like a requests.exceptions.ConnectionError: ``` File "/home/rtdean/***/***/***/***/***/***.py", line 67, in dir_parse root = ElementTree.fromstring(response.text) File "/home/rtdean/.pyenv/versions/2.7.6/lib/python2.7/site-packages/requests-2.3.0-py2.7.egg/requests/models.py", line 721, in text if not self.content: File "/home/rtdean/.pyenv/versions/2.7.6/lib/python2.7/site-packages/requests-2.3.0-py2.7.egg/requests/models.py", line 694, in content self._content = bytes().join(self.iter_content(CONTENT_CHUNK_SIZE)) or bytes() File "/home/rtdean/.pyenv/versions/2.7.6/lib/python2.7/site-packages/requests-2.3.0-py2.7.egg/requests/models.py", line 627, in generate for chunk in self.raw.stream(chunk_size, decode_content=True): File "/home/rtdean/.pyenv/versions/2.7.6/lib/python2.7/site-packages/requests-2.3.0-py2.7.egg/requests/packages/urllib3/response.py", line 240, in stream data = self.read(amt=amt, decode_content=decode_content) File "/home/rtdean/.pyenv/versions/2.7.6/lib/python2.7/site-packages/requests-2.3.0-py2.7.egg/requests/packages/urllib3/response.py", line 187, in read data = self._fp.read(amt) File "/home/rtdean/.pyenv/versions/2.7.6/lib/python2.7/httplib.py", line 543, in read return self._read_chunked(amt) File "/home/rtdean/.pyenv/versions/2.7.6/lib/python2.7/httplib.py", line 612, in _read_chunked value.append(self._safe_read(chunk_left)) File "/home/rtdean/.pyenv/versions/2.7.6/lib/python2.7/httplib.py", line 658, in _safe_read chunk = self.fp.read(min(amt, MAXAMOUNT)) File "/home/rtdean/.pyenv/versions/2.7.6/lib/python2.7/socket.py", line 380, in read data = self._sock.recv(left) File "/home/rtdean/.pyenv/versions/2.7.6/lib/python2.7/site-packages/gevent-1.0.1-py2.7-linux-x86_64.egg/gevent/socket.py", line 385, in recv return sock.recv(*args) socket.error: [Errno 104] Connection reset by peer ``` Not sure if this is by accident or design... in general, I guess I'd expect a requests exception when using requests, but I can start looking for socket errors and the like as well.
{ "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/2144/reactions" }
https://api.github.com/repos/psf/requests/issues/2144/timeline
null
completed
null
null
false
[ "No, this looks like an error.\n\n`iter_content` doesn't seem to expect any socket errors, but it should. We need to fix this.\n" ]
https://api.github.com/repos/psf/requests/issues/2143
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/2143/labels{/name}
https://api.github.com/repos/psf/requests/issues/2143/comments
https://api.github.com/repos/psf/requests/issues/2143/events
https://github.com/psf/requests/issues/2143
38,339,059
MDU6SXNzdWUzODMzOTA1OQ==
2,143
Incomplete support for OPTIONS method
{ "avatar_url": "https://avatars.githubusercontent.com/u/8227993?v=4", "events_url": "https://api.github.com/users/jeffg-vsn/events{/privacy}", "followers_url": "https://api.github.com/users/jeffg-vsn/followers", "following_url": "https://api.github.com/users/jeffg-vsn/following{/other_user}", "gists_url": "https://api.github.com/users/jeffg-vsn/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/jeffg-vsn", "id": 8227993, "login": "jeffg-vsn", "node_id": "MDQ6VXNlcjgyMjc5OTM=", "organizations_url": "https://api.github.com/users/jeffg-vsn/orgs", "received_events_url": "https://api.github.com/users/jeffg-vsn/received_events", "repos_url": "https://api.github.com/users/jeffg-vsn/repos", "site_admin": false, "starred_url": "https://api.github.com/users/jeffg-vsn/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/jeffg-vsn/subscriptions", "type": "User", "url": "https://api.github.com/users/jeffg-vsn", "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
10
2014-07-21T20:01:38Z
2021-09-08T23:08:08Z
2014-09-12T15:58:06Z
NONE
resolved
The specification for the OPTIONS method in [RFC 2616, section 9.2](http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9.2) includes the following: > If the Request-URI is an asterisk ("*"), the OPTIONS request is intended to apply to the server in general rather than to a specific resource. Since a server's communication options typically depend on the resource, the "*" request is only useful as a "ping" or "no-op" type of method; it does nothing beyond allowing the client to test the capabilities of the server. For example, this can be used to test a proxy for HTTP/1.1 compliance (or lack thereof). Because the Requests API only uses full URLs, it is currently impossible to make an `OPTIONS *` request as described above.
{ "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/2143/reactions" }
https://api.github.com/repos/psf/requests/issues/2143/timeline
null
completed
null
null
false
[ "You're quite right.\n\nI'm not sure that's so big a problem though. As discussed, it's not a hugely useful request in and of itself, and it's deeply unclear how we'd structure the API to make such a request useful. What's your use case?\n", "My particular use case for such a request is that I'm using it as a lightweight \"ping\" to allow a server to identify itself to clients as a basic sanity check in the client code (e.g.: instantiating the client with \"example.com\" as the server URL will raise an exception unless the IANA makes some malicious changes).\n\nI agree that it's not terribly clear how the API would be structured; the best that I can come up with would be to accept an iterable pair of strings as an alternative to the single string URL parameter. i.e.:\n\n```\n# request \"OPTIONS *\" from the server at example.com\nrequests.request(\"OPTIONS\", (\"http://example.com\", \"*\"), *args, **kwargs)\n\n# request \"GET /index.html\" from the server at example.com\nrequests.get((\"http://example.com\", \"/index.html\"), *args, **kwargs)\n\n# request \"GET /\" from the server at example.com\nrequest.get(\"http://example.com\", *args, **kwargs)\n```\n", "Hmm: is there any reason using the root isn't good enough? e.g. ending up with `OPTIONS / HTTP/1.1`?\n", "As a side note, the correct updated references are [RFC 7230, Section 5.3.4](http://tools.ietf.org/html/rfc7230#section-5.3.4) and [RFC 7231, Section 4.3.7](http://tools.ietf.org/html/rfc7231#section-4.3.7)\n", "> Hmm: is there any reason using the root isn't good enough? e.g. ending up with `OPTIONS / HTTP/1.1`?\n\nFor my particular use case: No, there really isn't. Arguably, the HEAD method could probably work, too.\n\nThere are probably use cases out there which would require the use of `OPTIONS *` over `OPTIONS /`, but it does not seem to be used very heavily, so this issue definitely doesn't demand a very high priority. Still, because it is a gap in the library's implementation of the HTTP spec, it's an issue that I thought may need to be addressed in the long run. But then again, it may not; after all, the standard `httplib` module does indeed provide this less-used functionality at the cost of a lower-level interface and more complex API.\n", "@jeffg-vsn the problem is that I'm not even confident that `urllib3` supports this behaviour, which makes requests support of it that much more difficult.\n", "I'm quite prepared to believe that nothing above `httplib` makes this possible.\n", "I guess you _could_ do something like this **in** `httplib`:\n\n``` python\nimport httplib\n\nconn = httplib.HTTPConnection('domain', 80)\nconn.request('OPTIONS', '*')\nr = conn.getresponse()\n```\n\nBut I just cannot imagine how we would accept that in urllib3 or requests.\n", "We would have to special-case this the whole way down the stack.\n", "@Lukasa yeah. I'm pretty sure we can't really do anything about this sadly. Closing until that changes.\n" ]
https://api.github.com/repos/psf/requests/issues/2142
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/2142/labels{/name}
https://api.github.com/repos/psf/requests/issues/2142/comments
https://api.github.com/repos/psf/requests/issues/2142/events
https://github.com/psf/requests/pull/2142
38,332,012
MDExOlB1bGxSZXF1ZXN0MTg2NzE4MTI=
2,142
Upgrade urllib3 to 1.9.x
{ "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
2014-07-21T18:46:08Z
2021-09-08T11:00:57Z
2014-07-22T20:21:05Z
CONTRIBUTOR
resolved
It seems urllib3 changed the timeout logic such that, we now have a failing test (`test_stream_timeout`). We now receive a `MaxRetryError` instead of a `TimeoutError` from urllib3. Either we have to adjust or this is a bug that needs to be fixed in urllib3. Thoughts @shazow @lukasa?
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/2142/reactions" }
https://api.github.com/repos/psf/requests/issues/2142/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/2142.diff", "html_url": "https://github.com/psf/requests/pull/2142", "merged_at": "2014-07-22T20:21:05Z", "patch_url": "https://github.com/psf/requests/pull/2142.patch", "url": "https://api.github.com/repos/psf/requests/pulls/2142" }
true
[ "Don't think it's strictly a urllib3 bug: I seem to recall @shazow had a comment in his urllib3 code wondering why `Timeout`s weren't wrapped in `MaxRetryError`s.\n\nAs for what to do, I'm not sure. Check what the wrapped exception is, maybe?\n", "I'm not convinced that `ReadTimeoutError`s are the same as a `MaxRetryError`. I certainly agree that a `ConnectTimeoutError` is, I'm just not convinced that a `ReadTimeoutError` is. Perhaps `urllib3` should be checking more carefully which `TimeoutError` it is receiving and rethrowing as a `MaxRetryError`?\n", "This is intentional. Our default retry logic handles a lot more cases now,\nincluding read errors in some scenarios.\n\nYou can disable urllib3 retries altogether by passing False and the\nexceptions won't get wrapped.\nOn Jul 21, 2014 12:05 PM, \"Ian Cordasco\" [email protected] wrote:\n\n> I'm not convinced that ReadTimeoutErrors are the same as a MaxRetryError.\n> I certainly agree that a ConnectTimeoutError is, I'm just not convinced\n> that a ReadTimeoutError is. Perhaps urllib3 should be checking more\n> carefully which TimeoutError it is receiving and rethrowing as a\n> MaxRetryError?\n> \n> —\n> Reply to this email directly or view it on GitHub\n> https://github.com/kennethreitz/requests/pull/2142#issuecomment-49650248\n> .\n", "I'm going to investigate the urllib3 API some more to investigate the ability to pass a list of exceptions to not retry. If that's not possible, I might be able to override one or more of the helper methods around this.\n\nI should also mention that I'm 100% against inspecting the error messages in this case because it will inevitably lead to someone else sending a PR to unveil a wrapped exception that they want to deal with (in requests) in some specialized way and they'll point to this as a reason why their PR should be accepted. I'm basically 110% in favor of anything that keeps us from having to inspect the exceptions urllib3 is wrapping.\n", "If you pass `Retry(read=False)` then it won't retry anything related to read errors [as defined here](https://github.com/shazow/urllib3/blob/master/urllib3/util/retry.py#L186). I believe it won't wrap it either (I could be mistaken).\n", "Assuming we're good now. \n" ]
https://api.github.com/repos/psf/requests/issues/2141
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/2141/labels{/name}
https://api.github.com/repos/psf/requests/issues/2141/comments
https://api.github.com/repos/psf/requests/issues/2141/events
https://github.com/psf/requests/pull/2141
38,193,066
MDExOlB1bGxSZXF1ZXN0MTg1OTYzODk=
2,141
Docs: Using print() function instead print command on advanced & quickstart
{ "avatar_url": "https://avatars.githubusercontent.com/u/1037088?v=4", "events_url": "https://api.github.com/users/esparta/events{/privacy}", "followers_url": "https://api.github.com/users/esparta/followers", "following_url": "https://api.github.com/users/esparta/following{/other_user}", "gists_url": "https://api.github.com/users/esparta/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/esparta", "id": 1037088, "login": "esparta", "node_id": "MDQ6VXNlcjEwMzcwODg=", "organizations_url": "https://api.github.com/users/esparta/orgs", "received_events_url": "https://api.github.com/users/esparta/received_events", "repos_url": "https://api.github.com/users/esparta/repos", "site_admin": false, "starred_url": "https://api.github.com/users/esparta/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/esparta/subscriptions", "type": "User", "url": "https://api.github.com/users/esparta", "user_view_type": "public" }
[]
closed
true
null
[]
null
4
2014-07-18T16:51:21Z
2021-09-08T22:01:17Z
2014-07-18T20:17:43Z
CONTRIBUTOR
resolved
Half of documentation use print() & half the print command.
{ "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/2141/reactions" }
https://api.github.com/repos/psf/requests/issues/2141/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/2141.diff", "html_url": "https://github.com/psf/requests/pull/2141", "merged_at": "2014-07-18T20:17:43Z", "patch_url": "https://github.com/psf/requests/pull/2141.patch", "url": "https://api.github.com/repos/psf/requests/pulls/2141" }
true
[ "This looks good to me. We're already using the print function in several places on the advanced.rst page. Any objections @Lukasa ?\n", "None at all. =) Let's do it.\n", ":cake:\n", "nice :) \n" ]
https://api.github.com/repos/psf/requests/issues/2140
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/2140/labels{/name}
https://api.github.com/repos/psf/requests/issues/2140/comments
https://api.github.com/repos/psf/requests/issues/2140/events
https://github.com/psf/requests/pull/2140
38,155,587
MDExOlB1bGxSZXF1ZXN0MTg1NzI0MzY=
2,140
Linkify Github usernames in authors list
{ "avatar_url": "https://avatars.githubusercontent.com/u/836426?v=4", "events_url": "https://api.github.com/users/dpursehouse/events{/privacy}", "followers_url": "https://api.github.com/users/dpursehouse/followers", "following_url": "https://api.github.com/users/dpursehouse/following{/other_user}", "gists_url": "https://api.github.com/users/dpursehouse/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/dpursehouse", "id": 836426, "login": "dpursehouse", "node_id": "MDQ6VXNlcjgzNjQyNg==", "organizations_url": "https://api.github.com/users/dpursehouse/orgs", "received_events_url": "https://api.github.com/users/dpursehouse/received_events", "repos_url": "https://api.github.com/users/dpursehouse/repos", "site_admin": false, "starred_url": "https://api.github.com/users/dpursehouse/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/dpursehouse/subscriptions", "type": "User", "url": "https://api.github.com/users/dpursehouse", "user_view_type": "public" }
[ { "color": "e11d21", "default": false, "description": null, "id": 44501305, "name": "Not Ready To Merge", "node_id": "MDU6TGFiZWw0NDUwMTMwNQ==", "url": "https://api.github.com/repos/psf/requests/labels/Not%20Ready%20To%20Merge" } ]
closed
true
null
[]
null
3
2014-07-18T08:01:47Z
2021-09-08T11:00:56Z
2014-07-22T06:57:25Z
CONTRIBUTOR
resolved
- Linkify github usernames - Remove usernames that do not exist Change-Id: Ib88b70a3010e915b3570ae5062c8cb416c9a6462
{ "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/2140/reactions" }
https://api.github.com/repos/psf/requests/issues/2140/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/2140.diff", "html_url": "https://github.com/psf/requests/pull/2140", "merged_at": "2014-07-22T06:57:25Z", "patch_url": "https://github.com/psf/requests/pull/2140.patch", "url": "https://api.github.com/repos/psf/requests/pulls/2140" }
true
[ "Fixup those who used Twitter and we're good to go. =)\n", "Added a commit to linkify the Twitter accounts.\n", "LGTM, thanks for this! :cake:\n" ]
https://api.github.com/repos/psf/requests/issues/2139
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/2139/labels{/name}
https://api.github.com/repos/psf/requests/issues/2139/comments
https://api.github.com/repos/psf/requests/issues/2139/events
https://github.com/psf/requests/pull/2139
38,155,546
MDExOlB1bGxSZXF1ZXN0MTg1NzI0MDk=
2,139
More line wrapping
{ "avatar_url": "https://avatars.githubusercontent.com/u/836426?v=4", "events_url": "https://api.github.com/users/dpursehouse/events{/privacy}", "followers_url": "https://api.github.com/users/dpursehouse/followers", "following_url": "https://api.github.com/users/dpursehouse/following{/other_user}", "gists_url": "https://api.github.com/users/dpursehouse/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/dpursehouse", "id": 836426, "login": "dpursehouse", "node_id": "MDQ6VXNlcjgzNjQyNg==", "organizations_url": "https://api.github.com/users/dpursehouse/orgs", "received_events_url": "https://api.github.com/users/dpursehouse/received_events", "repos_url": "https://api.github.com/users/dpursehouse/repos", "site_admin": false, "starred_url": "https://api.github.com/users/dpursehouse/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/dpursehouse/subscriptions", "type": "User", "url": "https://api.github.com/users/dpursehouse", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2014-07-18T08:01:16Z
2021-09-08T22:01:19Z
2014-07-18T09:59:48Z
CONTRIBUTOR
resolved
Wrapping lines at around 80 chars.
{ "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/2139/reactions" }
https://api.github.com/repos/psf/requests/issues/2139/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/2139.diff", "html_url": "https://github.com/psf/requests/pull/2139", "merged_at": "2014-07-18T09:59:48Z", "patch_url": "https://github.com/psf/requests/pull/2139.patch", "url": "https://api.github.com/repos/psf/requests/pulls/2139" }
true
[ ":cake:\n" ]
https://api.github.com/repos/psf/requests/issues/2138
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/2138/labels{/name}
https://api.github.com/repos/psf/requests/issues/2138/comments
https://api.github.com/repos/psf/requests/issues/2138/events
https://github.com/psf/requests/pull/2138
38,151,009
MDExOlB1bGxSZXF1ZXN0MTg1Njk3NzU=
2,138
More doc updates
{ "avatar_url": "https://avatars.githubusercontent.com/u/836426?v=4", "events_url": "https://api.github.com/users/dpursehouse/events{/privacy}", "followers_url": "https://api.github.com/users/dpursehouse/followers", "following_url": "https://api.github.com/users/dpursehouse/following{/other_user}", "gists_url": "https://api.github.com/users/dpursehouse/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/dpursehouse", "id": 836426, "login": "dpursehouse", "node_id": "MDQ6VXNlcjgzNjQyNg==", "organizations_url": "https://api.github.com/users/dpursehouse/orgs", "received_events_url": "https://api.github.com/users/dpursehouse/received_events", "repos_url": "https://api.github.com/users/dpursehouse/repos", "site_admin": false, "starred_url": "https://api.github.com/users/dpursehouse/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/dpursehouse/subscriptions", "type": "User", "url": "https://api.github.com/users/dpursehouse", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2014-07-18T06:23:02Z
2021-09-08T22:01:20Z
2014-07-18T07:24:27Z
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/2138/reactions" }
https://api.github.com/repos/psf/requests/issues/2138/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/2138.diff", "html_url": "https://github.com/psf/requests/pull/2138", "merged_at": "2014-07-18T07:24:27Z", "patch_url": "https://github.com/psf/requests/pull/2138.patch", "url": "https://api.github.com/repos/psf/requests/pulls/2138" }
true
[ "One note here, otherwise it's good to go.\n", ":cake: :star:\n" ]
https://api.github.com/repos/psf/requests/issues/2137
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/2137/labels{/name}
https://api.github.com/repos/psf/requests/issues/2137/comments
https://api.github.com/repos/psf/requests/issues/2137/events
https://github.com/psf/requests/issues/2137
38,094,498
MDU6SXNzdWUzODA5NDQ5OA==
2,137
proxy not used for second connect
{ "avatar_url": "https://avatars.githubusercontent.com/u/3251523?v=4", "events_url": "https://api.github.com/users/emdete/events{/privacy}", "followers_url": "https://api.github.com/users/emdete/followers", "following_url": "https://api.github.com/users/emdete/following{/other_user}", "gists_url": "https://api.github.com/users/emdete/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/emdete", "id": 3251523, "login": "emdete", "node_id": "MDQ6VXNlcjMyNTE1MjM=", "organizations_url": "https://api.github.com/users/emdete/orgs", "received_events_url": "https://api.github.com/users/emdete/received_events", "repos_url": "https://api.github.com/users/emdete/repos", "site_admin": false, "starred_url": "https://api.github.com/users/emdete/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/emdete/subscriptions", "type": "User", "url": "https://api.github.com/users/emdete", "user_view_type": "public" }
[]
closed
true
null
[]
null
3
2014-07-17T15:38:26Z
2021-09-08T23:10:49Z
2014-07-17T17:59:55Z
NONE
resolved
Hi, we encountered a strange problem where requests stops using the proxy. if a http(s) connection to a server is not using keep-alive a new connection to that server is made per request. while the first connection uses the proxy well the second connection times out because it does not use the proxy anymore. i figured out a fast-fix by re-evaluating the proxy object always. i just removed the line 209 in requests/adapters.py to always call proxy_from_url. this works for us. if needed i could dive deeper into it to help to get more information if wanted. regards, michael
{ "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/2137/reactions" }
https://api.github.com/repos/psf/requests/issues/2137/timeline
null
completed
null
null
false
[ "This seems like it is related to https://github.com/pypa/pip/issues/1805. \n", "Agreed.\n", "That means this will be fixed by the next release of requests, when we pull in a new urllib3.\n" ]
https://api.github.com/repos/psf/requests/issues/2136
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/2136/labels{/name}
https://api.github.com/repos/psf/requests/issues/2136/comments
https://api.github.com/repos/psf/requests/issues/2136/events
https://github.com/psf/requests/pull/2136
37,952,323
MDExOlB1bGxSZXF1ZXN0MTg0NTEzNDA=
2,136
Fix name misspelling
{ "avatar_url": "https://avatars.githubusercontent.com/u/836426?v=4", "events_url": "https://api.github.com/users/dpursehouse/events{/privacy}", "followers_url": "https://api.github.com/users/dpursehouse/followers", "following_url": "https://api.github.com/users/dpursehouse/following{/other_user}", "gists_url": "https://api.github.com/users/dpursehouse/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/dpursehouse", "id": 836426, "login": "dpursehouse", "node_id": "MDQ6VXNlcjgzNjQyNg==", "organizations_url": "https://api.github.com/users/dpursehouse/orgs", "received_events_url": "https://api.github.com/users/dpursehouse/received_events", "repos_url": "https://api.github.com/users/dpursehouse/repos", "site_admin": false, "starred_url": "https://api.github.com/users/dpursehouse/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/dpursehouse/subscriptions", "type": "User", "url": "https://api.github.com/users/dpursehouse", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2014-07-16T06:22:04Z
2021-09-08T23:01:01Z
2014-07-16T12:14:36Z
CONTRIBUTOR
resolved
See http://pydanny.com/
{ "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/2136/reactions" }
https://api.github.com/repos/psf/requests/issues/2136/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/2136.diff", "html_url": "https://github.com/psf/requests/pull/2136", "merged_at": "2014-07-16T12:14:36Z", "patch_url": "https://github.com/psf/requests/pull/2136.patch", "url": "https://api.github.com/repos/psf/requests/pulls/2136" }
true
[ "That's embarrassing. Thanks @dpursehouse !\n" ]
https://api.github.com/repos/psf/requests/issues/2135
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/2135/labels{/name}
https://api.github.com/repos/psf/requests/issues/2135/comments
https://api.github.com/repos/psf/requests/issues/2135/events
https://github.com/psf/requests/pull/2135
37,942,951
MDExOlB1bGxSZXF1ZXN0MTg0NDYwMTc=
2,135
Docs: Fix :class: and :meth: directives
{ "avatar_url": "https://avatars.githubusercontent.com/u/836426?v=4", "events_url": "https://api.github.com/users/dpursehouse/events{/privacy}", "followers_url": "https://api.github.com/users/dpursehouse/followers", "following_url": "https://api.github.com/users/dpursehouse/following{/other_user}", "gists_url": "https://api.github.com/users/dpursehouse/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/dpursehouse", "id": 836426, "login": "dpursehouse", "node_id": "MDQ6VXNlcjgzNjQyNg==", "organizations_url": "https://api.github.com/users/dpursehouse/orgs", "received_events_url": "https://api.github.com/users/dpursehouse/received_events", "repos_url": "https://api.github.com/users/dpursehouse/repos", "site_admin": false, "starred_url": "https://api.github.com/users/dpursehouse/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/dpursehouse/subscriptions", "type": "User", "url": "https://api.github.com/users/dpursehouse", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2014-07-16T01:54:35Z
2021-09-08T23:01:04Z
2014-07-16T05:36:40Z
CONTRIBUTOR
resolved
A few instances of the directives were malformed and did not result in hyperlinks in the generated HTML. Change-Id: I94d93de928ee4ff24a48797baf2ac77598a20704
{ "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/2135/reactions" }
https://api.github.com/repos/psf/requests/issues/2135/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/2135.diff", "html_url": "https://github.com/psf/requests/pull/2135", "merged_at": "2014-07-16T05:36:40Z", "patch_url": "https://github.com/psf/requests/pull/2135.patch", "url": "https://api.github.com/repos/psf/requests/pulls/2135" }
true
[ ":cake:\n" ]
https://api.github.com/repos/psf/requests/issues/2134
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/2134/labels{/name}
https://api.github.com/repos/psf/requests/issues/2134/comments
https://api.github.com/repos/psf/requests/issues/2134/events
https://github.com/psf/requests/pull/2134
37,903,812
MDExOlB1bGxSZXF1ZXN0MTg0MjA1MjE=
2,134
removed unneeded parentheses from if clause
{ "avatar_url": "https://avatars.githubusercontent.com/u/66484?v=4", "events_url": "https://api.github.com/users/nonZero/events{/privacy}", "followers_url": "https://api.github.com/users/nonZero/followers", "following_url": "https://api.github.com/users/nonZero/following{/other_user}", "gists_url": "https://api.github.com/users/nonZero/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/nonZero", "id": 66484, "login": "nonZero", "node_id": "MDQ6VXNlcjY2NDg0", "organizations_url": "https://api.github.com/users/nonZero/orgs", "received_events_url": "https://api.github.com/users/nonZero/received_events", "repos_url": "https://api.github.com/users/nonZero/repos", "site_admin": false, "starred_url": "https://api.github.com/users/nonZero/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/nonZero/subscriptions", "type": "User", "url": "https://api.github.com/users/nonZero", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2014-07-15T16:56:56Z
2021-09-08T23:01:05Z
2014-07-15T17:13:09Z
CONTRIBUTOR
resolved
{ "avatar_url": "https://avatars.githubusercontent.com/u/240830?v=4", "events_url": "https://api.github.com/users/sigmavirus24/events{/privacy}", "followers_url": "https://api.github.com/users/sigmavirus24/followers", "following_url": "https://api.github.com/users/sigmavirus24/following{/other_user}", "gists_url": "https://api.github.com/users/sigmavirus24/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/sigmavirus24", "id": 240830, "login": "sigmavirus24", "node_id": "MDQ6VXNlcjI0MDgzMA==", "organizations_url": "https://api.github.com/users/sigmavirus24/orgs", "received_events_url": "https://api.github.com/users/sigmavirus24/received_events", "repos_url": "https://api.github.com/users/sigmavirus24/repos", "site_admin": false, "starred_url": "https://api.github.com/users/sigmavirus24/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/sigmavirus24/subscriptions", "type": "User", "url": "https://api.github.com/users/sigmavirus24", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/2134/reactions" }
https://api.github.com/repos/psf/requests/issues/2134/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/2134.diff", "html_url": "https://github.com/psf/requests/pull/2134", "merged_at": "2014-07-15T17:13:09Z", "patch_url": "https://github.com/psf/requests/pull/2134.patch", "url": "https://api.github.com/repos/psf/requests/pulls/2134" }
true
[ "Thanks @nonZero !\n" ]
https://api.github.com/repos/psf/requests/issues/2133
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/2133/labels{/name}
https://api.github.com/repos/psf/requests/issues/2133/comments
https://api.github.com/repos/psf/requests/issues/2133/events
https://github.com/psf/requests/pull/2133
37,903,012
MDExOlB1bGxSZXF1ZXN0MTg0MjAwMzM=
2,133
Update link to pip site on docs/user/install.rst
{ "avatar_url": "https://avatars.githubusercontent.com/u/1037088?v=4", "events_url": "https://api.github.com/users/esparta/events{/privacy}", "followers_url": "https://api.github.com/users/esparta/followers", "following_url": "https://api.github.com/users/esparta/following{/other_user}", "gists_url": "https://api.github.com/users/esparta/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/esparta", "id": 1037088, "login": "esparta", "node_id": "MDQ6VXNlcjEwMzcwODg=", "organizations_url": "https://api.github.com/users/esparta/orgs", "received_events_url": "https://api.github.com/users/esparta/received_events", "repos_url": "https://api.github.com/users/esparta/repos", "site_admin": false, "starred_url": "https://api.github.com/users/esparta/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/esparta/subscriptions", "type": "User", "url": "https://api.github.com/users/esparta", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2014-07-15T16:48:30Z
2021-09-08T23:01:06Z
2014-07-15T17:12:49Z
CONTRIBUTOR
resolved
The PIP is in https://pip.pypa.io now.
{ "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/2133/reactions" }
https://api.github.com/repos/psf/requests/issues/2133/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/2133.diff", "html_url": "https://github.com/psf/requests/pull/2133", "merged_at": "2014-07-15T17:12:49Z", "patch_url": "https://github.com/psf/requests/pull/2133.patch", "url": "https://api.github.com/repos/psf/requests/pulls/2133" }
true
[ "Thanks @esparta !\n" ]
https://api.github.com/repos/psf/requests/issues/2132
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/2132/labels{/name}
https://api.github.com/repos/psf/requests/issues/2132/comments
https://api.github.com/repos/psf/requests/issues/2132/events
https://github.com/psf/requests/issues/2132
37,882,516
MDU6SXNzdWUzNzg4MjUxNg==
2,132
Add a CI build for the documentation
{ "avatar_url": "https://avatars.githubusercontent.com/u/836426?v=4", "events_url": "https://api.github.com/users/dpursehouse/events{/privacy}", "followers_url": "https://api.github.com/users/dpursehouse/followers", "following_url": "https://api.github.com/users/dpursehouse/following{/other_user}", "gists_url": "https://api.github.com/users/dpursehouse/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/dpursehouse", "id": 836426, "login": "dpursehouse", "node_id": "MDQ6VXNlcjgzNjQyNg==", "organizations_url": "https://api.github.com/users/dpursehouse/orgs", "received_events_url": "https://api.github.com/users/dpursehouse/received_events", "repos_url": "https://api.github.com/users/dpursehouse/repos", "site_admin": false, "starred_url": "https://api.github.com/users/dpursehouse/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/dpursehouse/subscriptions", "type": "User", "url": "https://api.github.com/users/dpursehouse", "user_view_type": "public" }
[ { "color": "02e10c", "default": false, "description": null, "id": 76800, "name": "Feature Request", "node_id": "MDU6TGFiZWw3NjgwMA==", "url": "https://api.github.com/repos/psf/requests/labels/Feature%20Request" }, { "color": "fbca04", "default": false, "description": null, "id": 44501249, "name": "Needs BDFL Input", "node_id": "MDU6TGFiZWw0NDUwMTI0OQ==", "url": "https://api.github.com/repos/psf/requests/labels/Needs%20BDFL%20Input" }, { "color": "fad8c7", "default": false, "description": null, "id": 136616769, "name": "Documentation", "node_id": "MDU6TGFiZWwxMzY2MTY3Njk=", "url": "https://api.github.com/repos/psf/requests/labels/Documentation" } ]
closed
true
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
[ { "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" } ]
null
0
2014-07-15T13:30:21Z
2021-09-08T01:21:15Z
2018-07-04T18:11:42Z
CONTRIBUTOR
resolved
There are builds for the various python version on ci.kennethreitz.org It would be useful to also have one for the documentation build.
{ "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/2132/reactions" }
https://api.github.com/repos/psf/requests/issues/2132/timeline
null
completed
null
null
false
[]
https://api.github.com/repos/psf/requests/issues/2131
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/2131/labels{/name}
https://api.github.com/repos/psf/requests/issues/2131/comments
https://api.github.com/repos/psf/requests/issues/2131/events
https://github.com/psf/requests/pull/2131
37,865,537
MDExOlB1bGxSZXF1ZXN0MTgzOTcxMjM=
2,131
Quickstart doc updates
{ "avatar_url": "https://avatars.githubusercontent.com/u/836426?v=4", "events_url": "https://api.github.com/users/dpursehouse/events{/privacy}", "followers_url": "https://api.github.com/users/dpursehouse/followers", "following_url": "https://api.github.com/users/dpursehouse/following{/other_user}", "gists_url": "https://api.github.com/users/dpursehouse/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/dpursehouse", "id": 836426, "login": "dpursehouse", "node_id": "MDQ6VXNlcjgzNjQyNg==", "organizations_url": "https://api.github.com/users/dpursehouse/orgs", "received_events_url": "https://api.github.com/users/dpursehouse/received_events", "repos_url": "https://api.github.com/users/dpursehouse/repos", "site_admin": false, "starred_url": "https://api.github.com/users/dpursehouse/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/dpursehouse/subscriptions", "type": "User", "url": "https://api.github.com/users/dpursehouse", "user_view_type": "public" }
[]
closed
true
null
[]
null
9
2014-07-15T09:31:05Z
2021-09-08T23:01:04Z
2014-07-15T10:40:28Z
CONTRIBUTOR
resolved
- Add the Timeout exception in API doc so it gets hyperlinked properly from quickstart - Restructure the redirection and history section so it's a bit easier to read - Couple of other minor tidy-ups Note: the documentation build does not work on my machine, so I have not tested this fully.
{ "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/2131/reactions" }
https://api.github.com/repos/psf/requests/issues/2131/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/2131.diff", "html_url": "https://github.com/psf/requests/pull/2131", "merged_at": "2014-07-15T10:40:28Z", "patch_url": "https://github.com/psf/requests/pull/2131.patch", "url": "https://api.github.com/repos/psf/requests/pulls/2131" }
true
[ "LGTM.\n\nWhile we're here, can we change the `history` section to stop referring to `Response.history` as a method? It's a property. =) Might be ok to leave the `:meth:` reStructuredText directive for it though.\n", "I actually changed it to `:meth:` from `:class:`.\n\nIs there a directive specially for properties?\n", "Not that I'm aware of. What I was getting at is the text below (emphasis mine):\n\n> We can use the `history` **method** of the Response object to track redirection. The `Response.history` list contains the `Request` objects that were created in order to complete the request. The list is sorted from the oldest to the most recent request.\n\nThat text should say 'property', not 'method'.\n", "OK, I see what you mean. I amended the commit to make that change.\n", "I see CI builds are now being done with Jenkins. Nice.\n\nAre the jobs configured in git somewhere? I'd like to have a look and see if I can add a documentation build, which would help to verify changes like this.\n", "No, they're configured on the system. I can add one though, we should add it to the list of issues. Otherwise this is good, I'm happy with it. :cake:\n", "Builds fine, looks like the `:meth:` directive doesn't link though.\n", "OK, I'll look at it again tomorrow and try to get the doc build working on my machine.\n\nWould be good if you could set up a doc build on Jenkins, thanks. Would be even better if the jobs were configured with JJB and kept in git, then I'd just be able to add it myself and submit another PR :)\n", "The `:meth:` and `:class:` directive links are fixed in #2135\n" ]