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/1228
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1228/labels{/name}
https://api.github.com/repos/psf/requests/issues/1228/comments
https://api.github.com/repos/psf/requests/issues/1228/events
https://github.com/psf/requests/issues/1228
11,557,184
MDU6SXNzdWUxMTU1NzE4NA==
1,228
Problem with missing cookies after redirect
{ "avatar_url": "https://avatars.githubusercontent.com/u/3728987?v=4", "events_url": "https://api.github.com/users/JohnCC330/events{/privacy}", "followers_url": "https://api.github.com/users/JohnCC330/followers", "following_url": "https://api.github.com/users/JohnCC330/following{/other_user}", "gists_url": "https://api.github.com/users/JohnCC330/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/JohnCC330", "id": 3728987, "login": "JohnCC330", "node_id": "MDQ6VXNlcjM3Mjg5ODc=", "organizations_url": "https://api.github.com/users/JohnCC330/orgs", "received_events_url": "https://api.github.com/users/JohnCC330/received_events", "repos_url": "https://api.github.com/users/JohnCC330/repos", "site_admin": false, "starred_url": "https://api.github.com/users/JohnCC330/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/JohnCC330/subscriptions", "type": "User", "url": "https://api.github.com/users/JohnCC330", "user_view_type": "public" }
[]
closed
true
null
[]
null
17
2013-03-01T19:01:55Z
2021-09-09T01:22:20Z
2013-09-27T08:45:29Z
NONE
resolved
I sent this by e-mail - no response. I think this might be of interest to others: > I have a problem when connecting to a site. Here's the scenario: > > 1) I enter a login page, which has a form > 2) I send (using Requests) a POST with the username, pw, etc. > (This POST includes the SESSIONID) > 3) The webpage with a 302, > 4) To which requests does automatically a GET to the new address > 5) In Firefox, this works, In Requests, I get redirected to the > login - page (with another 302). > > The only important difference I can detect is that in point 4), > Firefox repeats automatically the SESSION ID, which Requests does > not do. Can I enable this? I solved the problem by disabling automatic redirects, and creating a new request manually, with the sessionid cookie. Now the process runs successfully. This confirms the necessity of the repeating the cookie in the request after the 302, but it defeat the 'neatness' of the auto redirects. Cheers, John
{ "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/1228/reactions" }
https://api.github.com/repos/psf/requests/issues/1228/timeline
null
completed
null
null
false
[ "@JohnCC330 how are you passing the `SESSIONID` cookie? Could you give us a snippet so we can attempt to reproduce it?\n", "On Fri, 01 Mar 2013 15:56:14 -0800\nIan Cordasco [email protected] wrote:\n\n> @JohnCC330 how are you passing the `SESSIONID` cookie? Could you give us a snippet so we can attempt to reproduce it?\n\nHope this helps... Tell me if you need anything else.\n\nJohn\n\n```\n print \"\\tLog in...\"\n params = {\"cmd\": \"login\", \\\n \"username\": dl[\"user\"], \\\n \"pwd\": dl[\"pass\"]}\n\n try:\n r = session.post(dl[\"posturl1\"], \\\n headers = {\"User-Agent\": dl[\"agent\"], \\\n \"Referrer\": \"http://web.xxx.yyy/md.xtp\"}, \\\n data = params, \\\n allow_redirects = False) # Have to disable automatic redirects,\n # because they don't repeat the cookie\n except requests.ConnectionError:\n print \"* Can't log in\" \n exit(1);\n\n redir_url = r.headers[\"Location\"]\n # By doing a manual get, the cookie gets \n # included automatically\n if r.status_code == 302:\n r = session.get(redir_url, \\\n headers = {\"User-Agent\": dl[\"agent\"], \\\n \"Referrer\": \"http://web.xxx.yyy/md.xtp\"})\n```\n", "Wow I'm an idiot. You installed this from PyPI right? I think this has already been fixed in master. We really need to do a new release.\n", "On Fri, 01 Mar 2013 19:30:38 -0800\nIan Cordasco [email protected] wrote:\n\n> Wow I'm an idiot. You installed this from PyPI right? I think this has already been fixed in master. We really need to do a new release.\n> \n> I believe I downloaded the source using this link:\n\nhttps://github.com/kennethreitz/requests/tarball/master\n\nSo that would include the change?\nJohn\n", "Maybe. Especially if you did it within the last week or two.\n\nIn that case, I'm going to assume that the SESSION ID cookie is set when you originally do a GET on the login page (unless you're setting it manually which it doesn't seem as if you are). A POST to it might not set it properly at the start. In other words, you might need that cookie set in the header when making the post, otherwise it will prevent you from logging in. However, if the above code works (not letting us handle the redirects) that would seem to disprove my idea.\n\nMaybe @Lukasa has some insight into this. I'm 99% sure the logic for this is correct in `resolve_redirects`. :/\n", "On Fri, 01 Mar 2013 20:15:04 -0800\nIan Cordasco [email protected] wrote:\n\n> In that case, I'm going to assume that the SESSION ID cookie is set when you originally do a GET on the login page (unless you're setting it manually which it doesn't seem as if you are). A POST to it might not set it properly at the start. In other words, you might need that cookie set in the header when making the post, otherwise it will prevent you from logging in. However, if the above code works (not letting us handle the redirects) that would seem to disprove my idea.\n\nSorry - the cookie _was_ sent correctly in the post - it was only missing from the request after\nthe redirect. I deleted the capture files from Wireshark,\nand the previous versions of the program, so I can't send you the capture or recreate easily. \nI'm swamped with work right now (it's 2 AM here...), next week I could probably reconstruct the \nscenario and test it again.\n\nI can also re-install the latest version and test it again.\n\nJohn\n", "I have same issue with today's github source.\nWhen request redirect base on header['Location'], it does not include cookie. \nfollowing code solve the issue temporarily tough.\n\nf = self.reqSession.get(url, allow_redirects=False)\nif f.headers['Location']:\n f = self.reqSession.get(self.BASE_URL + f.headers['Location'], headers={'Referer' : referer}, cookies=f.cookies)\n", "I tried to reproduce this, but couldn't. I tried both requests 1.1.0 and rev. 13de692 (latest master as of writing) on Python 2.7.2. Here's a Flask server that sets a cookie and returns a 302 redirect:\n\n``` python\nfrom flask import Flask, redirect, request, make_response\napp = Flask(__name__)\n\[email protected](\"/step0\")\ndef step0():\n resp = make_response(\"step0\")\n resp.set_cookie(\"test_cookie\", \"step0\")\n return resp\n\[email protected](\"/step1\", methods=[\"GET\", \"POST\"])\ndef step1():\n return redirect(\"/step2\")\n\[email protected](\"/step2\")\ndef step2():\n return \"cookies: {0}\".format(request.cookies)\n\nif __name__ == \"__main__\":\n app.run(debug=True)\n```\n\nHere's what happens:\n\n``` python\n>>> import requests\n>>> s = requests.Session()\n>>> s.get(\"http://localhost:5000/step0\")\n>>> r = s.post(\"http://localhost:5000/step1\")\n>>> print r.text\ncookies: {'test_cookie': u'step0'}\n```\n", "As you see from following, on first request, requests receive cookie and send the cookie with second request correctly. When redirected by base on header['Location'] on third get, the requests send without the cookie.\n\nTry followings:\n\n> import requests\n> reqSession = requests.Session()\n> response_1 =reqSession.get('http://www.vev.kr/board_YvuS41/33699')\n> response_2 =reqSession.get('http://www.vev.kr/?>module=file&act=procFileDownload&file_srl=33700&sid=9d1a1c7dd7a4f25556bb364b386216fd')\n\nI got followings from wireshark:\n<code>\nGET /board_YvuS41/33699 HTTP/1.1\nHost: www.vev.kr\nAccept-Encoding: gzip, deflate, compress\nAccept: _/_\nUser-Agent: python-requests/1.1.0 CPython/2.7.0 Windows/7\n\nHTTP/1.1 200 OK\nDate: Fri, 08 Mar 2013 19:03:19 GMT\nServer: Apache/2.2.17 (Ubuntu)\nSet-Cookie: PHPSESSID=2hqfaqamumnl5g7bb0pslld351; path=/\nExpires: Mon, 26 Jul 1997 05:00:00 GMT\nCache-Control: no-store, no-cache, must-revalidate\nPragma: no-cache\nSet-Cookie: mobile=false; path=/\nSet-Cookie: user-agent=cb644817ea39140848b0a70d0266418a; path=/\nContent-Encoding: gzip\nLast-Modified: Fri, 08 Mar 2013 19:03:19 GMT\nCache-Control: post-check=0, pre-check=0\nVary: Accept-Encoding\nTransfer-Encoding: chunked\nContent-Type: text/html; charset=UTF-8\n\n273e\n\nGET /?module=file&act=procFileDownload&file_srl=33700&sid=9d1a1c7dd7a4f25556bb364b386216fd HTTP/1.1\nHost: www.vev.kr\nCookie: mobile=false; PHPSESSID=2hqfaqamumnl5g7bb0pslld351; user-agent=cb644817ea39140848b0a70d0266418a\nAccept-Encoding: gzip, deflate, compress\nAccept: _/_\nUser-Agent: python-requests/1.1.0 CPython/2.7.0 Windows/7\n\nHTTP/1.1 302 Found\nDate: Fri, 08 Mar 2013 19:03:20 GMT\nServer: Apache/2.2.17 (Ubuntu)\nX-Powered-By: PHP/5.3.5-1ubuntu7.11\nExpires: Thu, 19 Nov 1981 08:52:00 GMT\nCache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0\nPragma: no-cache\nLocation: http://www.vev.kr/index.php?act=procFileOutput&file_srl=33700&file_key=9f5f2b6cd31883919719567b30583537\nVary: Accept-Encoding\nContent-Encoding: gzip\nContent-Length: 20\nContent-Type: text/html\n\n....................GET /index.php?act=procFileOutput&file_srl=33700&file_key=9f5f2b6cd31883919719567b30583537 HTTP/1.1\nHost: www.vev.kr\nAccept-Encoding: gzip, deflate, compress\nAccept: _/_\nUser-Agent: python-requests/1.1.0 CPython/2.7.0 Windows/7\n\nHTTP/1.1 200 OK\nDate: Fri, 08 Mar 2013 19:03:20 GMT\nServer: Apache/2.2.17 (Ubuntu)\nX-Powered-By: PHP/5.3.5-1ubuntu7.11\nSet-Cookie: PHPSESSID=f224o1ju76d45frnv6fadgtes3; path=/\nExpires: Mon, 26 Jul 1997 05:00:00 GMT\nCache-Control: no-store, no-cache, must-revalidate\nPragma: no-cache\nSet-Cookie: mobile=false; path=/\nSet-Cookie: user-agent=cb644817ea39140848b0a70d0266418a; path=/\nContent-Encoding: gzip\nLast-Modified: Fri, 08 Mar 2013 19:03:20 GMT\nCache-Control: post-check=0, pre-check=0\nVary: Accept-Encoding\nContent-Length: 3391\nContent-Type: text/html; charset=UTF-8\n</code>\n", "On Fri, 08 Mar 2013 10:48:47 -0800\nMiikka Koskinen [email protected] wrote:\n\n> > > > import requests\n> > > > s = requests.Session()\n> > > > s.get(\"http://localhost:5000/step0\")\n> > > > r = s.post(\"http://localhost:5000/step1\")\n> > > > print r.text\n> > > > cookies: {'test_cookie': u'step0'}\n\nYes, r does receive the cookie. But, as neurostar shows, it does not include\nit in the second reply (the one after the 302), if the redirection is automatic.\nSo the _server_ does not get the cookie (there may be some difference in \nservers, but in my case the server requires the cookie in the redirect).\n\nSo, do only\n\n> > > > import requests\n> > > > s = requests.Session()\n> > > > r = s.post(\"http://localhost:5000/step1\")\n\nAnd follow the code with Wireshark. You'll see that s.post sends the post\n_with_ cookie, then gets the 302, then sends a get without the cookie.\n\nJohn\n", "@neurostar, @JohnCC330: Right, sorry for my confusion. I botched my versions yesterday and only tested using the released version, which works. Git version indeed fails.\n", "Any idea when mikka's fix will be merged? At the moment this is the only issue preventing me from migrating to requests 1.x.\n", "It seems that cookies are not preserved after redirect in v2.0.0\n", "@tumb1er That doesn't seem to be true for me:\n\n``` python\n>>> import requests\n>>> requests.__version__\n'2.0.0'\n>>> r = requests.get('http://httpbin.org/cookies/set', params={'hi': 'there'})\n>>> r.history\n(<Response [302]>,)\n>>> r.request.url\nu'http://httpbin.org/cookies'\n>>> r.history[0].url\nu'http://httpbin.org/cookies/set?hi=there'\n>>> r.history[0].headers['Set-Cookie']\n'hi=there; Path=/'\n>>> print r.content\n{\n \"cookies\": {\n \"hi\": \"there\"\n }\n}\n>>> print r.request.headers\nCaseInsensitiveDict({'Cookie': 'hi=there', 'Accept-Encoding': 'gzip, deflate, co\nmpress', 'Accept': '*/*', 'User-Agent': 'python-requests/2.0.0 CPython/2.7.4 Win\ndows/7'})\n```\n\nLooks to me like they were set on the 302 and sent back on the request after the redirect. \n", "Sorry, similar, but not same bug.\n\n``` python\n>>> import requests\n>>> requests.__version__\n'2.0.0'\n>>> r = requests.get(\"http://10.1.23.92/file/036ae155-45a5-443c-967c-ee7f30563c5b\", cookies={'fhauth':'cacb87b4f894bc0525ccd3004d3a6dab580acd07'})\n>>> r.history\n(<Response [301]>,)\n>>> r.request.headers\nCaseInsensitiveDict({'Accept-Encoding': 'gzip, deflate, compress', 'Accept': '*/*', 'User-Agent': 'python-requests/2.0.0 CPython/2.7.5 FreeBSD/9.1-RELEASE-p5'})\n# Added / to prevent 301 redirect\n>>> r = requests.get(\"http://10.1.23.92/file/036ae155-45a5-443c-967c-ee7f30563c5b/\", cookies={'fhauth':'cacb87b4f894bc0525ccd3004d3a6dab580acd07'})\n>>> r.history\n[]\n>>> r.request.headers\nCaseInsensitiveDict({'Cookie': 'fhauth=cacb87b4f894bc0525ccd3004d3a6dab580acd07', 'Accept-Encoding': 'gzip, deflate, compress', 'Accept': '*/*', 'User-Agent': 'python-requests/2.0.0 CPython/2.7.5 FreeBSD/9.1-RELEASE-p5'})\n\n```\n", "Ah, good spot. I see the problem in the code. I'll open a new issue for it.\n", "New issue: #1630.\n" ]
https://api.github.com/repos/psf/requests/issues/1227
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1227/labels{/name}
https://api.github.com/repos/psf/requests/issues/1227/comments
https://api.github.com/repos/psf/requests/issues/1227/events
https://github.com/psf/requests/pull/1227
11,536,342
MDExOlB1bGxSZXF1ZXN0NDM5MDMyMw==
1,227
Add ability to pass `response` to `HTTPError()`
{ "avatar_url": "https://avatars.githubusercontent.com/u/104330?v=4", "events_url": "https://api.github.com/users/dmedvinsky/events{/privacy}", "followers_url": "https://api.github.com/users/dmedvinsky/followers", "following_url": "https://api.github.com/users/dmedvinsky/following{/other_user}", "gists_url": "https://api.github.com/users/dmedvinsky/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/dmedvinsky", "id": 104330, "login": "dmedvinsky", "node_id": "MDQ6VXNlcjEwNDMzMA==", "organizations_url": "https://api.github.com/users/dmedvinsky/orgs", "received_events_url": "https://api.github.com/users/dmedvinsky/received_events", "repos_url": "https://api.github.com/users/dmedvinsky/repos", "site_admin": false, "starred_url": "https://api.github.com/users/dmedvinsky/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/dmedvinsky/subscriptions", "type": "User", "url": "https://api.github.com/users/dmedvinsky", "user_view_type": "public" }
[]
closed
true
null
[]
null
10
2013-03-01T09:01:52Z
2021-09-08T23:06:09Z
2013-03-04T22:54:32Z
CONTRIBUTOR
resolved
Just a little refactoring, but it seems nicer to me to be able to pass the response when constructing the `HTTPError` instance instead of constructing it and then changing the member variable.
{ "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/1227/reactions" }
https://api.github.com/repos/psf/requests/issues/1227/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/1227.diff", "html_url": "https://github.com/psf/requests/pull/1227", "merged_at": "2013-03-04T22:54:32Z", "patch_url": "https://github.com/psf/requests/pull/1227.patch", "url": "https://api.github.com/repos/psf/requests/pulls/1227" }
true
[ "Fixed test failing on Python 3 and force-pushed.\n", "I'm +1 on this. It definitely seems worth adding to allow for extra information and it isn't so much a change in the API although @Lukasa and @kennethreitz may disagree.\n", "Well, it doesn't really add any extra info as `response` was attached to `HTTPError` and before this. It's just that you couldn't've do it with the initialization of the exception, only attaching afterwards like `instance.response = response`.\n", "I'm +0 on this. As you said @dmedvinsky, it's a minor refactor. I have no objection to it being in the library, and it's an internal API really, so not too problematic. I'm happy to go with whatever @kennethreitz feels is right here.\n", "Seems legit. :100: \n", "I'll merge this if you do a rebase so it'll merge :)\n", "There you go. :twisted_rightwards_arrows: \n", "grr, still no luck. I'll do it manually :)\n", "Thanks again!\n", "Well, if pull requests are making it so fast in here that it hard to keep them rebased, I wouldn't say “no luck”. I call it a win. :-)\n" ]
https://api.github.com/repos/psf/requests/issues/1226
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1226/labels{/name}
https://api.github.com/repos/psf/requests/issues/1226/comments
https://api.github.com/repos/psf/requests/issues/1226/events
https://github.com/psf/requests/pull/1226
11,536,296
MDExOlB1bGxSZXF1ZXN0NDM5MDI5Nw==
1,226
Fix couple of typos in HISTORY.rst
{ "avatar_url": "https://avatars.githubusercontent.com/u/104330?v=4", "events_url": "https://api.github.com/users/dmedvinsky/events{/privacy}", "followers_url": "https://api.github.com/users/dmedvinsky/followers", "following_url": "https://api.github.com/users/dmedvinsky/following{/other_user}", "gists_url": "https://api.github.com/users/dmedvinsky/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/dmedvinsky", "id": 104330, "login": "dmedvinsky", "node_id": "MDQ6VXNlcjEwNDMzMA==", "organizations_url": "https://api.github.com/users/dmedvinsky/orgs", "received_events_url": "https://api.github.com/users/dmedvinsky/received_events", "repos_url": "https://api.github.com/users/dmedvinsky/repos", "site_admin": false, "starred_url": "https://api.github.com/users/dmedvinsky/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/dmedvinsky/subscriptions", "type": "User", "url": "https://api.github.com/users/dmedvinsky", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2013-03-01T09:00:24Z
2021-09-08T19:00:53Z
2013-03-02T21:00:48Z
CONTRIBUTOR
resolved
One typo and a couple of auto-completions, I guess.
{ "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/1226/reactions" }
https://api.github.com/repos/psf/requests/issues/1226/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/1226.diff", "html_url": "https://github.com/psf/requests/pull/1226", "merged_at": "2013-03-02T21:00:48Z", "patch_url": "https://github.com/psf/requests/pull/1226.patch", "url": "https://api.github.com/repos/psf/requests/pulls/1226" }
true
[ ":+1: Thanks :)\n" ]
https://api.github.com/repos/psf/requests/issues/1225
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1225/labels{/name}
https://api.github.com/repos/psf/requests/issues/1225/comments
https://api.github.com/repos/psf/requests/issues/1225/events
https://github.com/psf/requests/issues/1225
11,526,135
MDU6SXNzdWUxMTUyNjEzNQ==
1,225
Documentation: response object status/reason
{ "avatar_url": "https://avatars.githubusercontent.com/u/2817308?v=4", "events_url": "https://api.github.com/users/JonathanCooper/events{/privacy}", "followers_url": "https://api.github.com/users/JonathanCooper/followers", "following_url": "https://api.github.com/users/JonathanCooper/following{/other_user}", "gists_url": "https://api.github.com/users/JonathanCooper/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/JonathanCooper", "id": 2817308, "login": "JonathanCooper", "node_id": "MDQ6VXNlcjI4MTczMDg=", "organizations_url": "https://api.github.com/users/JonathanCooper/orgs", "received_events_url": "https://api.github.com/users/JonathanCooper/received_events", "repos_url": "https://api.github.com/users/JonathanCooper/repos", "site_admin": false, "starred_url": "https://api.github.com/users/JonathanCooper/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/JonathanCooper/subscriptions", "type": "User", "url": "https://api.github.com/users/JonathanCooper", "user_view_type": "public" }
[]
closed
true
null
[]
null
6
2013-03-01T00:09:50Z
2021-09-09T00:10:09Z
2013-03-20T09:02:43Z
NONE
resolved
The response header [documentation](http://docs.python-requests.org/en/latest/user/quickstart/#response-headers) claims that the headers dict will contain a 'status' entry, containing both the return status and the reason, for example '200 OK'. In my tests, no such entry exists in the headers dict, although the same data is available with a combination of (assuming a response object called 'r') r.status_code and r.reason.
{ "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/1225/reactions" }
https://api.github.com/repos/psf/requests/issues/1225/timeline
null
completed
null
null
false
[ "Wow. That's not been the case for...a while. Want to submit a docs PR to remove it? I'd do it, but I'm preparing to get on a plane.\n", "Fixed by #1234. Thanks!\n", "Note that now the `response.reason` attribute is _entirely undocumented_.\n", "This change did not cause that situation to arise. You're right though, it should at least be in the API docs (even though `response.reason` isn't hugely useful).\n", "> (even though response.reason isn't hugely useful)\n\n[Someone finds it useful](http://stackoverflow.com/q/21583195/100297); I was looking into creating a pull request, but the API docs are generated from the source. Digging a little further.\n", "Yeah, I can't imagine how it would be useful to them, but whatever they need. =)\n\nThe fix is to put a comment above [this line](https://github.com/kennethreitz/requests/blob/master/requests/models.py#L544) in the format of the other comment blocks in that function, e.g.:\n\n``` python\n #: The reason string returned by the server, e.g.\n #: \"Not Found\" or \"OK\".\n self.reason = None\n```\n" ]
https://api.github.com/repos/psf/requests/issues/1224
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1224/labels{/name}
https://api.github.com/repos/psf/requests/issues/1224/comments
https://api.github.com/repos/psf/requests/issues/1224/events
https://github.com/psf/requests/issues/1224
11,522,911
MDU6SXNzdWUxMTUyMjkxMQ==
1,224
IOError when accessing a Response object after socket closes
{ "avatar_url": "https://avatars.githubusercontent.com/u/3731972?v=4", "events_url": "https://api.github.com/users/j8s0n/events{/privacy}", "followers_url": "https://api.github.com/users/j8s0n/followers", "following_url": "https://api.github.com/users/j8s0n/following{/other_user}", "gists_url": "https://api.github.com/users/j8s0n/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/j8s0n", "id": 3731972, "login": "j8s0n", "node_id": "MDQ6VXNlcjM3MzE5NzI=", "organizations_url": "https://api.github.com/users/j8s0n/orgs", "received_events_url": "https://api.github.com/users/j8s0n/received_events", "repos_url": "https://api.github.com/users/j8s0n/repos", "site_admin": false, "starred_url": "https://api.github.com/users/j8s0n/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/j8s0n/subscriptions", "type": "User", "url": "https://api.github.com/users/j8s0n", "user_view_type": "public" }
[]
closed
true
null
[]
null
4
2013-02-28T22:35:08Z
2021-09-09T05:00:36Z
2013-03-01T00:58:58Z
NONE
resolved
If the server closes the connection immediately after writing the data, an attempt to use the Response object causes an IOError. ``` python r = requests.get(url) # Server closes connection print(r.content) # Throws IOError ```
{ "avatar_url": "https://avatars.githubusercontent.com/u/3731972?v=4", "events_url": "https://api.github.com/users/j8s0n/events{/privacy}", "followers_url": "https://api.github.com/users/j8s0n/followers", "following_url": "https://api.github.com/users/j8s0n/following{/other_user}", "gists_url": "https://api.github.com/users/j8s0n/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/j8s0n", "id": 3731972, "login": "j8s0n", "node_id": "MDQ6VXNlcjM3MzE5NzI=", "organizations_url": "https://api.github.com/users/j8s0n/orgs", "received_events_url": "https://api.github.com/users/j8s0n/received_events", "repos_url": "https://api.github.com/users/j8s0n/repos", "site_admin": false, "starred_url": "https://api.github.com/users/j8s0n/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/j8s0n/subscriptions", "type": "User", "url": "https://api.github.com/users/j8s0n", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/1224/reactions" }
https://api.github.com/repos/psf/requests/issues/1224/timeline
null
completed
null
null
false
[ "Why is this an issue? We can only tell you exactly what happened, which is exactly an error with IO.\n", "My assumption is that the get() call sends a GET request and captures the output, storing it in the Response object.\nIf that is the case, then I should be able to access that Response as long as it stays in scope, regardless of the connection status. But accessing the content of the response raises the IOError. I can access the status_code and headers without any problem.\nThere doesn't appear to be any way to use requests with servers that write their data and close the socket.\n", "There's no chance you would provide a website that does this so we could test/reproduce it, is there?\n", "I finally got a look at the code for the server I'm connecting to. The error was on that side.\n" ]
https://api.github.com/repos/psf/requests/issues/1223
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1223/labels{/name}
https://api.github.com/repos/psf/requests/issues/1223/comments
https://api.github.com/repos/psf/requests/issues/1223/events
https://github.com/psf/requests/pull/1223
11,515,637
MDExOlB1bGxSZXF1ZXN0NDM3OTU5MA==
1,223
Fixes __getstate__ for session pickling
{ "avatar_url": "https://avatars.githubusercontent.com/u/575533?v=4", "events_url": "https://api.github.com/users/andrewjesaitis/events{/privacy}", "followers_url": "https://api.github.com/users/andrewjesaitis/followers", "following_url": "https://api.github.com/users/andrewjesaitis/following{/other_user}", "gists_url": "https://api.github.com/users/andrewjesaitis/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/andrewjesaitis", "id": 575533, "login": "andrewjesaitis", "node_id": "MDQ6VXNlcjU3NTUzMw==", "organizations_url": "https://api.github.com/users/andrewjesaitis/orgs", "received_events_url": "https://api.github.com/users/andrewjesaitis/received_events", "repos_url": "https://api.github.com/users/andrewjesaitis/repos", "site_admin": false, "starred_url": "https://api.github.com/users/andrewjesaitis/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/andrewjesaitis/subscriptions", "type": "User", "url": "https://api.github.com/users/andrewjesaitis", "user_view_type": "public" }
[]
closed
true
null
[]
null
7
2013-02-28T19:36:00Z
2021-09-08T23:01:11Z
2013-03-04T22:52:31Z
CONTRIBUTOR
resolved
As noted in #1088, sessions cannot be pickled currently. I ran into this when implementing some multiprocessing functionality for a project. Here, I'm just checking for `__attrs__` prior to trying to iterate over it. It does occur to me that if `__attrs__` is removed permanently, maybe the `__getstate__` method should just be stubbed out to preserve pickling functionality.
{ "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/1223/reactions" }
https://api.github.com/repos/psf/requests/issues/1223/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/1223.diff", "html_url": "https://github.com/psf/requests/pull/1223", "merged_at": "2013-03-04T22:52:31Z", "patch_url": "https://github.com/psf/requests/pull/1223.patch", "url": "https://api.github.com/repos/psf/requests/pulls/1223" }
true
[ ":-1: Why not just add `__attrs__` back to the Session object? You also have the code you describe in the PR commented out.\n\nFix it up please?\n", "Whoops. I committed while I was testing the later possibility of stubbing out the method. I amended back to the way I originally had it.\n\nI'm fine with adding `__attrs__` back to the session object, but 42b0295 removed it for some reason. \n\nMy personal feeling is to program to the interface and not add an unused attribute.\n\nYour call, since you have a better idea of the ongoing needs of the lib.\n", "Yeah, I'd say just re-add the attribute. It was probably deleted by accident. Otherwise we're just going to consistently return `{}`, which is useless.\n", "Yeah, let's add it back :)\n", "Changed `__getstate__` back to its original form and added back `__attrs__` to the Session object.\n", ":+1:\n", "Thank you sir :)\n" ]
https://api.github.com/repos/psf/requests/issues/1222
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1222/labels{/name}
https://api.github.com/repos/psf/requests/issues/1222/comments
https://api.github.com/repos/psf/requests/issues/1222/events
https://github.com/psf/requests/issues/1222
11,504,896
MDU6SXNzdWUxMTUwNDg5Ng==
1,222
NameError in virtualenv
{ "avatar_url": "https://avatars.githubusercontent.com/u/2916591?v=4", "events_url": "https://api.github.com/users/justbrian/events{/privacy}", "followers_url": "https://api.github.com/users/justbrian/followers", "following_url": "https://api.github.com/users/justbrian/following{/other_user}", "gists_url": "https://api.github.com/users/justbrian/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/justbrian", "id": 2916591, "login": "justbrian", "node_id": "MDQ6VXNlcjI5MTY1OTE=", "organizations_url": "https://api.github.com/users/justbrian/orgs", "received_events_url": "https://api.github.com/users/justbrian/received_events", "repos_url": "https://api.github.com/users/justbrian/repos", "site_admin": false, "starred_url": "https://api.github.com/users/justbrian/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/justbrian/subscriptions", "type": "User", "url": "https://api.github.com/users/justbrian", "user_view_type": "public" }
[]
closed
true
null
[]
null
5
2013-02-28T15:27:17Z
2021-09-09T04:00:50Z
2013-02-28T15:34:32Z
NONE
resolved
Hello, I have just attempted to install requests into a virtualenv environment and am getting the error: NameError: name 'CERT_NONE' is not defined The full stacktrace is below. I tried to install requests with the command pip install -U requests in my virtual environment. An admittedly quick Google search didn't turn up anything, but I am assuming its user error. Am I doing it wrong somehow? This is on Red Hat Enterprise Linux 5 with Python 2.7.3. I have tried virtualenv with and without site packages, same error either way. If there is any more information I can provide, feel free to let me know. Thanks, Brian Full Stack trace from error: 249 File "requests/packages/**init**.py", line 3, in <module> 250 251 from . import urllib3 252 253 File "requests/packages/urllib3/**init**.py", line 16, in <module> 254 255 from .connectionpool import ( 256 257 File "requests/packages/urllib3/connectionpool.py", line 45, in <module> 258 259 from .util import get_host, is_connection_dropped, ssl_wrap_socket 260 261 File "requests/packages/urllib3/util.py", line 293, in <module> 262 263 def ssl_wrap_socket(sock, keyfile=None, certfile=None, cert_reqs=CERT_NONE, 264 265 NameError: name 'CERT_NONE' is not defined 266 267 ---------------------------------------- 268 269 Command python setup.py egg_info failed with error code 1 in /home/bneal/pyv/build/requests 270 271 Exception information: 272 Traceback (most recent call last): 273 File "/home/bneal/pyv/lib/python2.7/site-packages/pip-1.2.1-py2.7.egg/pip/basecommand.py", line 107, in main 274 status = self.run(options, args) 275 File "/home/bneal/pyv/lib/python2.7/site-packages/pip-1.2.1-py2.7.egg/pip/commands/install.py", line 256, in run 276 requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle) 277 File "/home/bneal/pyv/lib/python2.7/site-packages/pip-1.2.1-py2.7.egg/pip/req.py", line 1042, in prepare_files 278 req_to_install.run_egg_info() 279 File "/home/bneal/pyv/lib/python2.7/site-packages/pip-1.2.1-py2.7.egg/pip/req.py", line 236, in run_egg_info 280 command_desc='python setup.py egg_info') 281 File "/home/bneal/pyv/lib/python2.7/site-packages/pip-1.2.1-py2.7.egg/pip/util.py", line 612, in call_subprocess 282 % (command_desc, proc.returncode, cwd)) 283 InstallationError: Command python setup.py egg_info failed with error code 1 in /home/bneal/pyv/build/requests
{ "avatar_url": "https://avatars.githubusercontent.com/u/240830?v=4", "events_url": "https://api.github.com/users/sigmavirus24/events{/privacy}", "followers_url": "https://api.github.com/users/sigmavirus24/followers", "following_url": "https://api.github.com/users/sigmavirus24/following{/other_user}", "gists_url": "https://api.github.com/users/sigmavirus24/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/sigmavirus24", "id": 240830, "login": "sigmavirus24", "node_id": "MDQ6VXNlcjI0MDgzMA==", "organizations_url": "https://api.github.com/users/sigmavirus24/orgs", "received_events_url": "https://api.github.com/users/sigmavirus24/received_events", "repos_url": "https://api.github.com/users/sigmavirus24/repos", "site_admin": false, "starred_url": "https://api.github.com/users/sigmavirus24/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/sigmavirus24/subscriptions", "type": "User", "url": "https://api.github.com/users/sigmavirus24", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/1222/reactions" }
https://api.github.com/repos/psf/requests/issues/1222/timeline
null
completed
null
null
false
[ "Duplicate of #1221. This seems to be related to your not having SSL installed or properly configured/linked in Python. The fix is being worked out in shazow/urllib3 and will be imported as soon as it's ready.\n", "The fix has been on requests master for a long time. (#1128)\n", "Ah @t-8ch sorry for the confusion. I must have misread @Lukasa's response to #1221 last night (or had some rather wild dreams of what it said). Thanks for the correction.\n", "You could have read it just right. This one _is_ a duplicate, but both are fixed on master. :smile:\n", "_shrug_ I'm too tired for life :-P\n" ]
https://api.github.com/repos/psf/requests/issues/1221
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1221/labels{/name}
https://api.github.com/repos/psf/requests/issues/1221/comments
https://api.github.com/repos/psf/requests/issues/1221/events
https://github.com/psf/requests/pull/1221
11,485,378
MDExOlB1bGxSZXF1ZXN0NDM2NDUxMA==
1,221
I do not agree this behavior should be occurring in master branch
{ "avatar_url": "https://avatars.githubusercontent.com/u/52170?v=4", "events_url": "https://api.github.com/users/rpherrera/events{/privacy}", "followers_url": "https://api.github.com/users/rpherrera/followers", "following_url": "https://api.github.com/users/rpherrera/following{/other_user}", "gists_url": "https://api.github.com/users/rpherrera/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/rpherrera", "id": 52170, "login": "rpherrera", "node_id": "MDQ6VXNlcjUyMTcw", "organizations_url": "https://api.github.com/users/rpherrera/orgs", "received_events_url": "https://api.github.com/users/rpherrera/received_events", "repos_url": "https://api.github.com/users/rpherrera/repos", "site_admin": false, "starred_url": "https://api.github.com/users/rpherrera/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/rpherrera/subscriptions", "type": "User", "url": "https://api.github.com/users/rpherrera", "user_view_type": "public" }
[]
closed
true
null
[]
null
8
2013-02-28T02:38:06Z
2021-09-08T19:00:52Z
2013-02-28T02:42:41Z
NONE
resolved
Installing requests from pip gives me the following error: ``` Unpacking ./requests/requests-1.0.4.zip Running setup.py egg_info for package from file:///home/fclbot/requests/requests-1.0.4.zip Traceback (most recent call last): File "<string>", line 14, in <module> File "/tmp/pip-a6e6xF-build/setup.py", line 6, in <module> import requests File "requests/__init__.py", line 52, in <module> from . import utils File "requests/utils.py", line 22, in <module> from .compat import parse_http_list as _parse_list_header File "requests/compat.py", line 7, in <module> from .packages import charade as chardet File "requests/packages/__init__.py", line 3, in <module> from . import urllib3 File "requests/packages/urllib3/__init__.py", line 16, in <module> from .connectionpool import ( File "requests/packages/urllib3/connectionpool.py", line 45, in <module> from .util import get_host, is_connection_dropped, ssl_wrap_socket File "requests/packages/urllib3/util.py", line 293, in <module> def ssl_wrap_socket(sock, keyfile=None, certfile=None, cert_reqs=CERT_NONE, NameError: name 'CERT_NONE' is not defined Complete output from command python setup.py egg_info: Traceback (most recent call last): File "<string>", line 14, in <module> File "/tmp/pip-a6e6xF-build/setup.py", line 6, in <module> import requests File "requests/__init__.py", line 52, in <module> from . import utils File "requests/utils.py", line 22, in <module> from .compat import parse_http_list as _parse_list_header File "requests/compat.py", line 7, in <module> from .packages import charade as chardet File "requests/packages/__init__.py", line 3, in <module> from . import urllib3 File "requests/packages/urllib3/__init__.py", line 16, in <module> from .connectionpool import ( File "requests/packages/urllib3/connectionpool.py", line 45, in <module> from .util import get_host, is_connection_dropped, ssl_wrap_socket File "requests/packages/urllib3/util.py", line 293, in <module> def ssl_wrap_socket(sock, keyfile=None, certfile=None, cert_reqs=CERT_NONE, NameError: name 'CERT_NONE' is not defined ``` --- This fix is a simple comment over buggy code, so this error would not happen again until you fix it in a proper way. It is exactly the same as discussed in: http://stackoverflow.com/questions/14919557/how-to-get-urllib3-and-requests-working-with-jython-2-7-beta-1 Important: It does not applies only to jython users, but python users are being affected by this error too.
{ "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/1221/reactions" }
https://api.github.com/repos/psf/requests/issues/1221/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/1221.diff", "html_url": "https://github.com/psf/requests/pull/1221", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/1221.patch", "url": "https://api.github.com/repos/psf/requests/pulls/1221" }
true
[ "You need to take a better look at your problem. The `NameError` caused in your example is not in the code you just commented out: CERT_NONE is not in any of that code. This bug cannot possibly be fixed by this PR.\n", "Ugh, ignore the above, that was a lousy reason. However, this bug is in urllib3, so we aren't able to make the fix. There is an open bug report: shazow/urllib3#150. Until that is resolved, Requests continues to work correctly on all platforms except for Jython and CPython without SSL. Better to wait for the bug than to break SSL support on _all_ platforms.\n", "Still getting this error when trying to install requests on RHEL\n", "@dalanmiller what version are you trying to install?\n", "I'm also still getting this problem with trying to install requests 1.2.0 in a virtualenv (created with 1.8.4) (Ubuntu 10).\n", "Could you post your exact error? The code in question has been fixed and restructured in general. So it's quite unlikely it's the same error.\n", "Command: `bash pip install requests`\n\n```\nDownloading/unpacking requests\n Running setup.py egg_info for package requests\n Traceback (most recent call last):\n File \"<string>\", line 16, in <module>\n File \"/var/lib/jenkins/jobs/lingware-build-resources/workspace/.env/build/requests/setup.py\", line 6, in <module>\n import requests\n File \"requests/__init__.py\", line 52, in <module>\n from . import utils\n File \"requests/utils.py\", line 23, in <module>\n from .compat import parse_http_list as _parse_list_header\n File \"requests/compat.py\", line 7, in <module>\n from .packages import charade as chardet\n File \"requests/packages/__init__.py\", line 3, in <module>\n from . import urllib3\n File \"requests/packages/urllib3/__init__.py\", line 16, in <module>\n from .connectionpool import (\n File \"requests/packages/urllib3/connectionpool.py\", line 45, in <module>\n from .util import get_host, is_connection_dropped, ssl_wrap_socket\n File \"requests/packages/urllib3/util.py\", line 293, in <module>\n def ssl_wrap_socket(sock, keyfile=None, certfile=None, cert_reqs=CERT_NONE,\n NameError: name 'CERT_NONE' is not defined\n Complete output from command python setup.py egg_info:\n Traceback (most recent call last):\n\n File \"<string>\", line 16, in <module>\n\n File \"/var/lib/jenkins/jobs/lingware-build-resources/workspace/.env/build/requests/setup.py\", line 6, in <module>\n\n import requests\n\n File \"requests/__init__.py\", line 52, in <module>\n\n from . import utils\n\n File \"requests/utils.py\", line 23, in <module>\n\n from .compat import parse_http_list as _parse_list_header\n\n File \"requests/compat.py\", line 7, in <module>\n\n from .packages import charade as chardet\n\n File \"requests/packages/__init__.py\", line 3, in <module>\n\n from . import urllib3\n\n File \"requests/packages/urllib3/__init__.py\", line 16, in <module>\n\n from .connectionpool import (\n\n File \"requests/packages/urllib3/connectionpool.py\", line 45, in <module>\n\n from .util import get_host, is_connection_dropped, ssl_wrap_socket\n\n File \"requests/packages/urllib3/util.py\", line 293, in <module>\n\n def ssl_wrap_socket(sock, keyfile=None, certfile=None, cert_reqs=CERT_NONE,\n\nNameError: name 'CERT_NONE' is not defined\n\n----------------------------------------\nCommand python setup.py egg_info failed with error code 1 in /var/lib/jenkins/jobs/lingware-build-resources/workspace/.env/build/requests\nStoring complete log in /var/lib/jenkins/.pip/pip.log\n```\n", "OK - it looks like an old version was still hanging round, and that it is indeed solved. But thanks for looking at it!\n" ]
https://api.github.com/repos/psf/requests/issues/1220
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1220/labels{/name}
https://api.github.com/repos/psf/requests/issues/1220/comments
https://api.github.com/repos/psf/requests/issues/1220/events
https://github.com/psf/requests/issues/1220
11,484,506
MDU6SXNzdWUxMTQ4NDUwNg==
1,220
raise_for_status does not raise for redirects
{ "avatar_url": "https://avatars.githubusercontent.com/u/252280?v=4", "events_url": "https://api.github.com/users/mjallday/events{/privacy}", "followers_url": "https://api.github.com/users/mjallday/followers", "following_url": "https://api.github.com/users/mjallday/following{/other_user}", "gists_url": "https://api.github.com/users/mjallday/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/mjallday", "id": 252280, "login": "mjallday", "node_id": "MDQ6VXNlcjI1MjI4MA==", "organizations_url": "https://api.github.com/users/mjallday/orgs", "received_events_url": "https://api.github.com/users/mjallday/received_events", "repos_url": "https://api.github.com/users/mjallday/repos", "site_admin": false, "starred_url": "https://api.github.com/users/mjallday/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/mjallday/subscriptions", "type": "User", "url": "https://api.github.com/users/mjallday", "user_view_type": "public" }
[]
closed
true
null
[]
null
15
2013-02-28T01:55:11Z
2021-09-09T04:00:50Z
2013-03-01T23:59:11Z
NONE
resolved
According [to the code](https://github.com/kennethreitz/requests/blob/master/requests/models.py#L648) it no longer raises for redirects, this used to be an option called `allow_redirects`. Now it doesn't raise for 3xx responses but [the docs say](http://docs.python-requests.org/en/latest/user/quickstart/#response-status-codes) : > If we made a bad request (non-200 response), we can raise it with Response.raise_for_status():
{ "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/1220/reactions" }
https://api.github.com/repos/psf/requests/issues/1220/timeline
null
completed
null
null
false
[ "I contend the docs are poorly phrased. Redirects are expected and a natural part of HTTP, and they should not cause exceptions.\n", "The better doc would be:\n\n> If we made a bad request (4xx response), we can raise it with Response.raise_for_status():\n\nWe might want to include 5xx responses there too, though they aren't strictly our fault.\n", "> I contend the docs are poorly phrased. Redirects are expected and a natural part of HTTP, and they should not cause exceptions.\n\nThe old behavior of `allow_redirects` covered this quite nicely I thought.\n", "If you're going to throw exceptions on redirects, why can't you set `allow_redirects` to `False` on the original HTTP request?\n", "Hmm. Actually, I think I'm -0.5 on reintroducing the old behaviour. It doesn't cost much and doesn't clutter the API much. We're in [feature freeze](http://docs.python-requests.org/en/latest/dev/todo/#feature-freeze), but if @kennethreitz decides to we might put this back. I'm leaving this for him. =)\n", "Thanks for pointing out `allow_redirects` on the request. That's probably suitable for us too! I'm happy with there being _one_ way to do this.\n", "@mjallday well there should only be one obvious way to do it. ;)\n", "not 100% obvious. `allow_redirects` doesn't disallow, it only stops you [from _following_ redirects](https://github.com/kennethreitz/requests/blob/master/requests/sessions.py#L426), so the old behavior was to throw an exception, now I need to look for an exception and raise it myself if I have a status code in `REDIRECT_STATI`.\n\nIMO the better suggestion would be to either allow me to override the `raise_for_status` method with the HTTP codes that are un-acceptable to me or make it a class variable e.g. `Response.RAISE_FOR_STATUS_STATI` (tho with less retarded naming)\n", "Ah I see the issue. @Lukasa's comment could be losely misunderstood as meaning setting `allow_redirects` to False would raise an exception when a redirect was found. A pattern that could work for you in it's stead is this:\n\n``` python\nr = session.request(method, url, # etc.\n allow_redirects=False\n )\n\nr.raise_for_status() # Will catch 400...500 error codes\nif r.status_code >= 300:\n raise RedirectFoundError(r)\n\nreturn r\n```\n\nWhere I'm making an assumption that you're returning the response without any evidence of that ;)\n", "@sigmavirus24 you've implemented pretty much exactly what I have on my screen right now!\n\nFeel free to close this ticket if you don't think the variable naming is misleading, my immediate concern is addressed.\n", "@mjallday I'm psychic but don't tell anyone. ;)\n\nYeah, I think I might re-ticket this to see if we should raise exceptions for stati >= 500 too though. That seems like something worth discussing more.\n", "@sigmavirus24: [We already do](https://github.com/kennethreitz/requests/blob/master/requests/models.py#L656).\n", "> We might want to include 5xx responses there too, though they aren't strictly our fault.\n\nMade me think we didn't.\n", "Yeah, I wrote that comment before I actually checked the code.\n", "On Sat, Mar 02, 2013 at 06:28:48AM -0800, Cory Benfield wrote:\n\n> Yeah, I wrote that comment before I actually checked the code.\n\nYeah and I should have checked too ;)\n" ]
https://api.github.com/repos/psf/requests/issues/1219
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1219/labels{/name}
https://api.github.com/repos/psf/requests/issues/1219/comments
https://api.github.com/repos/psf/requests/issues/1219/events
https://github.com/psf/requests/pull/1219
11,461,537
MDExOlB1bGxSZXF1ZXN0NDM1MTg1OA==
1,219
Adding max_retries as an argument
{ "avatar_url": "https://avatars.githubusercontent.com/u/70800?v=4", "events_url": "https://api.github.com/users/Wilfred/events{/privacy}", "followers_url": "https://api.github.com/users/Wilfred/followers", "following_url": "https://api.github.com/users/Wilfred/following{/other_user}", "gists_url": "https://api.github.com/users/Wilfred/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Wilfred", "id": 70800, "login": "Wilfred", "node_id": "MDQ6VXNlcjcwODAw", "organizations_url": "https://api.github.com/users/Wilfred/orgs", "received_events_url": "https://api.github.com/users/Wilfred/received_events", "repos_url": "https://api.github.com/users/Wilfred/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Wilfred/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Wilfred/subscriptions", "type": "User", "url": "https://api.github.com/users/Wilfred", "user_view_type": "public" }
[]
closed
true
null
[]
null
6
2013-02-27T16:04:34Z
2021-09-09T00:01:17Z
2013-03-02T21:02:27Z
CONTRIBUTOR
resolved
Related ticket: #1208 This pull request adds support for `max_retries` as an argument to `requests.request`. I think that since we already support `timeout` as a top-level argument then it makes sense to support `max_retries` too. I've added a unit test, but this is a very difficult thing to test for. I can't see any easy way to simulate an unreliable connection. Please let me know what you 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/1219/reactions" }
https://api.github.com/repos/psf/requests/issues/1219/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/1219.diff", "html_url": "https://github.com/psf/requests/pull/1219", "merged_at": "2013-03-02T21:02:27Z", "patch_url": "https://github.com/psf/requests/pull/1219.patch", "url": "https://api.github.com/repos/psf/requests/pulls/1219" }
true
[ "There is nothing wrong with this PR, but it won't be accepted. Requests is in [feature freeze](http://docs.python-requests.org/en/latest/dev/todo/#feature-freeze), and that goes doubly for changes that affect the API. As @sigmavirus24 pointed out in #1208, there are plenty of ways to specify this value.\n", "Thanks, I'll send a docs PR.\n", "Basically, max_retries is a feature of urllib3, not of requests. Requests has always tried to discourage automatic retries as much as possible.\n\nThanks for the contribution though, it was a good one. Keep 'em coming! \n", "Uh, @kennethreitz, did you intend to merge this? Your comment seems like you weren't going to, but then you kinda did...\n", "oh geeze\n", "Reverted.\n" ]
https://api.github.com/repos/psf/requests/issues/1218
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1218/labels{/name}
https://api.github.com/repos/psf/requests/issues/1218/comments
https://api.github.com/repos/psf/requests/issues/1218/events
https://github.com/psf/requests/issues/1218
11,418,135
MDU6SXNzdWUxMTQxODEzNQ==
1,218
HTTPS proxy not being used - max retries exceeded
{ "avatar_url": "https://avatars.githubusercontent.com/u/2835900?v=4", "events_url": "https://api.github.com/users/gfairchild/events{/privacy}", "followers_url": "https://api.github.com/users/gfairchild/followers", "following_url": "https://api.github.com/users/gfairchild/following{/other_user}", "gists_url": "https://api.github.com/users/gfairchild/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/gfairchild", "id": 2835900, "login": "gfairchild", "node_id": "MDQ6VXNlcjI4MzU5MDA=", "organizations_url": "https://api.github.com/users/gfairchild/orgs", "received_events_url": "https://api.github.com/users/gfairchild/received_events", "repos_url": "https://api.github.com/users/gfairchild/repos", "site_admin": false, "starred_url": "https://api.github.com/users/gfairchild/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/gfairchild/subscriptions", "type": "User", "url": "https://api.github.com/users/gfairchild", "user_view_type": "public" }
[]
closed
true
null
[]
null
8
2013-02-26T17:06:10Z
2021-09-08T04:00:40Z
2013-02-26T17:37:41Z
NONE
resolved
I'm behind a proxy at work, and I'm having issues getting requests to use the proxy. urllib2 is able to use it just fine, but requests fails. I've tried both setting an environment variable (both HTTPS_PROXY and https_proxy) and passing in a dict, but neither work. I'm on OSX 10.7.5 using Python 2.7.3 and requests 1.1.0 installed in a virtualenv via pip. ``` (osx)gfairchild@stueyemac ~> set | grep -i proxy HTTPS_PROXY=https://proxy.com:8080 https_proxy=https://proxy.com:8080 (osx)gfairchild@stueyemac ~> python Python 2.7.3 (v2.7.3:70274d53c1dd, Apr 9 2012, 20:52:43) [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import urllib2 >>> r = urllib2.urlopen('https://google.com') >>> print r.read() <!doctype html><html itemscope="itemscope" itemtype="http://schema.org/WebPage"><head><meta content="Search the world's information, including webpages, images, videos and more. Google has many special features to help you find exactly what you're looking for." name="description"><meta content="noodp" name="robots"><meta itemprop="image" content="/images/google_favicon_128.png"><title>Google</title><script>(function(){ window.google={kEI:"I-gsUdvaLMn-0gHWhIHIAg",getEI:function(a){for(var b;a&&(!a.getAttribute||!(b=a.getAttribute("eid")));)a=a.parentNode;return b||google.kEI},https:function(){return"https:"==window.location.protocol},kEXPI:"17259,18168,39523,4000116,4001569,4001948,4001959,4001975,4002001,4002159,4002562,4002734,4002855,4002858,4003372,4003374,4003387,4003514,4003575,4003638,4003917,4003944,4003982,4004015,4004064,4004074,4004083,4004152,4004181,4004214,4004241,4004276,4004298",kCSI:{e:"17259,18168,39523,4000116,4001569,4001948,4001959,4001975,4002001,4002159,4002562,4002734,4002855,4002858,4003372,4003374,4003387,4003514,4003575,4003638,4003917,4003944,4003982,4004015,4004064,4004074,4004083,4004152,4004181,4004214,4004241,4004276,4004298",ei:"I-gsUdvaLMn-0gHWhIHIAg"},authuser:0,ml:function(){},kHL:"en",time:function(){return(new Date).getTime()},log:function(a, b,c,k){var d=new Image,f=google.lc,e=google.li,g="";d.onerror=d.onload=d.onabort=function(){delete f[e]};f[e]=d;!c&&-1==b.search("&ei=")&&(g="&ei="+google.getEI(k));c=c||"/gen_204?atyp=i&ct="+a+"&cad="+b+g+"&zx="+google.time();a=/^http:/i;a.test(c)&&google.https()?(google.ml(Error("GLMM"),!1,{src:c}),delete f[e]):(d.src=c,google.li=e+1)},lc:[],li:0,Toolbelt:{},y:{},x:function(a,b){google.y[a.id]=[a,b];return!1},load:function(a,b){google.x({id:"l"+a},function(){google.load(a,b)})}}; })(); (function(){var d=!1;google.sn="webhp";google.timers={};google.startTick=function(a,b){google.timers[a]={t:{start:google.time()},bfr:!!b}};google.tick=function(a,b,h){google.timers[a]||google.startTick(a);google.timers[a].t[b]=h||google.time()};google.startTick("load",!0); try{}catch(e){}})(); var _gjwl=location;function _gjuc(){var a=_gjwl.href.indexOf("#");if(0<=a&&(a=_gjwl.href.substring(a),0<a.indexOf("&q=")||0<=a.indexOf("#q=")))if(a=a.substring(1),-1==a.indexOf("#")){for(var d=0;d<a.length;){var b=d;"&"==a.charAt(b)&&++b;var c=a.indexOf("&",b);-1==c&&(c=a.length);b=a.substring(b,c);if(0==b.indexOf("fp="))a=a.substring(0,d)+a.substring(c,a.length),c=d;else if("cad=h"==b)return 0;d=c}_gjwl.href="/search?"+a+"&cad=h";return 1}return 0} function _gjp(){(!window._gjwl.hash||!window._gjuc())&&setTimeout(_gjp,500)}; window._gjp&&_gjp();</script><style>#gbar,#guser{font-size:13px;padding-top:1px !important;}#gbar{height:22px}#guser{padding-bottom:7px !important;text-align:right}.gbh,.gbd{border-top:1px solid #c9d7f1;font-size:1px}.gbh{height:0;position:absolute;top:24px;width:100%}@media all{.gb1{height:22;margin-right:.5em;vertical-align:top}#gbar{float:left}}a.gb1,a.gb4{text-decoration:underline !important}a.gb1,a.gb4{color:#00c !important}.gbi .gb4{color:#dd8e27 !important}.gbf .gb4{color:#900 !important}</style><style>.h{font-family:arial,sans-serif}body{font-family:arial,sans-serif}td{font-family:arial,sans-serif}a{font-family:arial,sans-serif}p{font-family:arial,sans-serif}body{margin:0;overflow-y:scroll}#gog{padding:3px 8px 0}.h{color:#36c}.q{color:#00c}.ts{border-collapse:collapse}td{line-height:.8em}.gac_m td{line-height:17px}form{margin-bottom:20px}.ts td{padding:0}em{font-weight:bold;font-style:normal}.lst{height:25px;width:496px;font:18px arial,sans-serif}.gsfi{font:18px arial,sans-serif}.gsfs{font:17px arial,sans-serif}.ds{display:inline-box;display: inline-block;margin:3px 0 4px;margin-left:4px}input{font-family:inherit}body{background:#fff;color:black}a.gb1{color:#11c !important}a.gb2{color:#11c !important}a.gb3{color:#11c !important}a.gb4{color:#11c !important}.sblc{padding-top:5px}.lsbb{background:#eee;border:solid 1px;border-color:#ccc #999 #999 #ccc;height:30px}a{color:#11c;text-decoration:none}a:hover{text-decoration:underline}a:active{text-decoration:underline}.fl a{color:#36c}a:visited{color:#551a8b}a.gb1{text-decoration:underline}a.gb4{text-decoration:underline}a.gb3:hover{text-decoration:none}.sblc a{display:block;margin:2px 0;margin-left:13px;font-size:11px}#ghead a.gb2:hover{color:#fff !important}.lsbb{display:block}.ftl{display:inline-block;margin:0 12px}.lsb{background:url(/images/srpr/nav_logo80.png) 0 -258px repeat-x;border:none;color:#000;cursor:pointer;height:30px;margin:0;outline:0;font:15px arial,sans-serif;vertical-align:top}#fll a{display:inline-block;margin:0 12px}.lsb:active{background:#ccc}.lst:focus{outline:none}#addlang a{padding:0 3px}</style><script></script> </head><body dir="ltr" bgcolor="#fff"><script>(function(){var src='/images/srpr/nav_logo80.png';var iesg=false;document.body.onload = function(){window.n && window.n();if (document.images){new Image().src=src;} if (!iesg){document.f&&document.f.q.focus();document.gbqf&&document.gbqf.q.focus();} } })();</script><textarea id="csi" style="display:none"></textarea><div id="mngb"><div id=gbar><nobr><b class=gb1>Search</b> <a class=gb1 href="https://www.google.com/imghp?hl=en&tab=wi">Images</a> <a class=gb1 href="https://maps.google.com/maps?hl=en&tab=wl">Maps</a> <a class=gb1 href="https://play.google.com/?hl=en&tab=w8">Play</a> <a class=gb1 href="https://www.youtube.com/?tab=w1">YouTube</a> <a class=gb1 href="https://news.google.com/nwshp?hl=en&tab=wn">News</a> <a class=gb1 href="https://mail.google.com/mail/?tab=wm">Gmail</a> <a class=gb1 href="https://drive.google.com/?tab=wo">Drive</a> <a class=gb1 style="text-decoration:none" href="http://www.google.com/intl/en/options/"><u>More</u> &raquo;</a></nobr></div><div id=guser width=100%><nobr><span id=gbn class=gbi></span><span id=gbf class=gbf></span><span id=gbe></span><a href="http://www.google.com/history/optout?hl=en" class=gb4>Web History</a> | <a href="/preferences?hl=en" class=gb4>Settings</a> | <a target=_top id=gb_70 href="https://accounts.google.com/ServiceLogin?hl=en&continue=https://www.google.com/" class=gb4>Sign in</a></nobr></div><div class=gbh style=left:0></div><div class=gbh style=right:0></div></div><iframe name="wgjf" style="display:none"></iframe><center><br clear="all" id="lgpd"><div id="lga"><img alt="Google" height="95" src="/intl/en_ALL/images/srpr/logo1w.png" width="275" id="hplogo" onload="window.lol&&lol()" style="padding:28px 0 14px"><br><br></div><form action="/search" name="f"><table cellpadding="0" cellspacing="0"><tr valign="top"><td width="25%">&nbsp;</td><td align="center" nowrap="nowrap"><input name="ie" value="ISO-8859-1" type="hidden"><input value="en" name="hl" type="hidden"><input name="source" type="hidden" value="hp"><div class="ds" style="height:32px;margin:4px 0"><input autocomplete="off" class="lst" value="" title="Google Search" maxlength="2048" name="q" size="57" style="color:#000;margin:0;padding:5px 8px 0 6px;vertical-align:top"></div><br style="line-height:0"><span class="ds"><span class="lsbb"><input class="lsb" value="Google Search" name="btnG" type="submit"></span></span><span class="ds"><span class="lsbb"><input class="lsb" value="I'm Feeling Lucky" name="btnI" type="submit" onclick="if(this.form.q.value)this.checked=1; else top.location='/doodles/'"></span></span></td><td class="fl sblc" align="left" nowrap="nowrap" width="25%"><a href="/advanced_search?hl=en&amp;authuser=0">Advanced search</a><a href="/language_tools?hl=en&amp;authuser=0">Language tools</a></td></tr></table><input type="hidden" id="gbv" name="gbv" value="1"></form><div id="gac_scont"></div><div style="font-size:83%;min-height:3.5em"><br></div><span id="footer"><div style="font-size:10pt"><div id="fll" style="margin:19px auto;text-align:center"><a href="/intl/en/ads/">Advertising&nbsp;Programs</a><a href="/services/">Business Solutions</a><a href="https://plus.google.com/116899029375914044550" rel="publisher">+Google</a><a href="/intl/en/about.html">About Google</a></div></div><p style="color:#767676;font-size:8pt">&copy; 2012 - <a href="/intl/en/policies/">Privacy & Terms</a></p></span></center><div id=xjsd></div><div id=xjsi><script>if(google.y)google.y.first=[];(function(){var b;function c(a){window.setTimeout(function(){var d=document.createElement("script");d.src=a;document.getElementById("xjsd").appendChild(d)},0)}google.dljp=function(a){b=a;google.xjsi||(google.xjsu=a,c(b))};google.dlj=c;})(); if(!google.xjs){google.dstr=[];google.rein=[];window._=window._||{};window._._DumpException=function(e){throw e};if(google.timers&&google.timers.load.t){google.timers.load.t.xjsls=new Date().getTime();}google.dljp('/xjs/_/js/hp/sb_he,pcc/rt\x3dj/ver\x3ddUr8sRKOHrQ.en_US./d\x3d1/sv\x3d1/rs\x3dAItRSTMOuVd64TXf59sLZpeyfeaOnqHKgQ');google.xjs=1;}google.pmc={sb:{"agen":false,"cgen":true,"client":"heirloom-hp","dh":true,"ds":"","eqch":true,"fl":true,"host":"google.com","jsonp":true,"msgs":{"lcky":"I\u0026#39;m Feeling Lucky","lml":"Learn more","oskt":"Input tools","psrc":"This search was removed from your \u003Ca href=\"/history\"\u003EWeb History\u003C/a\u003E","psrl":"Remove","sbit":"Search by image","srch":"Google Search"},"ovr":{"l":1,"ms":1},"pq":"","qcpw":false,"scd":10,"sce":5,"stok":"2TLNAUa1t9yVii-aHCy9IeO1J4M"},hp:{},pcc:{}};google.y.first.push(function(){if(google.med){google.med('init');google.initHistory();google.med('history');}google.History&&google.History.initialize('/');google.hs&&google.hs.init&&google.hs.init()});if(google.j&&google.j.en&&google.j.xi){window.setTimeout(google.j.xi,0);}</script></div><script>(function(){var b,c,d,e;function g(a,f){a.removeEventListener?(a.removeEventListener("load",f,!1),a.removeEventListener("error",f,!1)):(a.detachEvent("onload",f),a.detachEvent("onerror",f))}function h(a){e=(new Date).getTime();++c;a=a||window.event;a=a.target||a.srcElement;g(a,h)}var k=document.getElementsByTagName("img");b=k.length; for(var l=c=0,m;l<b;++l)m=k[l],m.complete||"string"!=typeof m.src||!m.src?++c:m.addEventListener?(m.addEventListener("load",h,!1),m.addEventListener("error",h,!1)):(m.attachEvent("onload",h),m.attachEvent("onerror",h));d=b-c; function n(){if(google.timers.load.t){google.timers.load.t.ol=(new Date).getTime();google.timers.load.t.iml=e;google.kCSI.imc=c;google.kCSI.imn=b;google.kCSI.imp=d;void 0!==google.stt&&(google.kCSI.stt=google.stt);google.csiReport&&google.csiReport()}}window.addEventListener?window.addEventListener("load",n,!1):window.attachEvent&&window.attachEvent("onload",n);google.timers.load.t.prt=e=(new Date).getTime();})(); </script></body></html> >>> import requests >>> r = requests.get('https://google.com') Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/Users/gfairchild/Documents/work/compepi/Twitter/lib/osx/lib/python2.7/site-packages/requests/api.py", line 55, in get return request('get', url, **kwargs) File "/Users/gfairchild/Documents/work/compepi/Twitter/lib/osx/lib/python2.7/site-packages/requests/api.py", line 44, in request return session.request(method=method, url=url, **kwargs) File "/Users/gfairchild/Documents/work/compepi/Twitter/lib/osx/lib/python2.7/site-packages/requests/sessions.py", line 279, in request resp = self.send(prep, stream=stream, timeout=timeout, verify=verify, cert=cert, proxies=proxies) File "/Users/gfairchild/Documents/work/compepi/Twitter/lib/osx/lib/python2.7/site-packages/requests/sessions.py", line 374, in send r = adapter.send(request, **kwargs) File "/Users/gfairchild/Documents/work/compepi/Twitter/lib/osx/lib/python2.7/site-packages/requests/adapters.py", line 209, in send raise ConnectionError(e) requests.exceptions.ConnectionError: HTTPSConnectionPool(host='proxy.com', port=8080): Max retries exceeded with url: https://google.com/ (Caused by <class 'socket.error'>: [Errno 54] Connection reset by peer) >>> p = {'https': 'https://proxy.com:8080',} >>> r = requests.get('https://google.com', proxies=p) Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/Users/gfairchild/Documents/work/compepi/Twitter/lib/osx/lib/python2.7/site-packages/requests/api.py", line 55, in get return request('get', url, **kwargs) File "/Users/gfairchild/Documents/work/compepi/Twitter/lib/osx/lib/python2.7/site-packages/requests/api.py", line 44, in request return session.request(method=method, url=url, **kwargs) File "/Users/gfairchild/Documents/work/compepi/Twitter/lib/osx/lib/python2.7/site-packages/requests/sessions.py", line 279, in request resp = self.send(prep, stream=stream, timeout=timeout, verify=verify, cert=cert, proxies=proxies) File "/Users/gfairchild/Documents/work/compepi/Twitter/lib/osx/lib/python2.7/site-packages/requests/sessions.py", line 374, in send r = adapter.send(request, **kwargs) File "/Users/gfairchild/Documents/work/compepi/Twitter/lib/osx/lib/python2.7/site-packages/requests/adapters.py", line 209, in send raise ConnectionError(e) requests.exceptions.ConnectionError: HTTPSConnectionPool(host='proxy.com', port=8080): Max retries exceeded with url: https://google.com/ (Caused by <class 'socket.error'>: [Errno 54] Connection reset by peer) ```
{ "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/1218/reactions" }
https://api.github.com/repos/psf/requests/issues/1218/timeline
null
completed
null
null
false
[ "I believe this is a duplicate and related to shazow/urllib3#139\n\n@Lukasa thoughts?\n", "Ah yes, it looks like you may be right. I just looked at the open issues and didn't think to look at the closed issues.\n", "No worries. We're just waiting for that pull request to land before we can support this. I believe @t-8ch has made the case that you can use `http://` for your proxy and it should work, but I've no practical knowledge of how proxies work in all candor.\n", "Closing as a duplicate (#1182)\n", "I tried using http instead, but what I get is an internal error back:\n\n```\n(osx)gfairchild@stueyemac ~> python\nPython 2.7.3 (v2.7.3:70274d53c1dd, Apr 9 2012, 20:52:43) \n[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\n>>> import requests\n>>> p = {'https': 'http://proxy.com:8080',}\n>>> r = requests.get('https://google.com', proxies=p)\n>>> r.text\nu'<HTML><HEAD>\\n<TITLE>Request Error</TITLE>\\n</HEAD>\\n<BODY>\\n<FONT face=\"Helvetica\">\\n<big><strong></strong></big><BR>\\n</FONT>\\n<blockquote>\\n<TABLE border=0 cellPadding=1 width=\"80%\">\\n<TR><TD>\\n<FONT face=\"Helvetica\">\\n<big>Request Error (invalid_request)</big>\\n<BR>\\n<BR>\\n</FONT>\\n</TD></TR>\\n<TR><TD>\\n<FONT face=\"Helvetica\">\\nYour request could not be processed. Request could not be handled\\n</FONT>\\n</TD></TR>\\n<TR><TD>\\n<FONT face=\"Helvetica\">\\nThis could be caused by a misconfiguration, or possibly a malformed request.\\n</FONT>\\n</TD></TR>\\n<TR><TD>\\n<FONT face=\"Helvetica\" SIZE=2>\\n<BR>\\nFor assistance, contact your network support team.\\n</FONT>\\n</TD></TR>\\n</TABLE>\\n</blockquote>\\n</FONT>\\n</BODY></HTML>\\n'\n```\n\nUnfortunately, it looks like I'll have to either use urllib2 for now or wait for this to be fixed. Anyway, thanks for your help!\n", "I'll recap the issue with the scheme :-)\n\nMost people use one proxy for both http and https.\nThe connection between requests and the proxy is mostly http. (This is what the\nscheme in the proxy url is for)\nThe proxy can handle plain http requests just fine.\nEncrypted connections are just some random tcp stream to the proxy. This is\nwhere the http 'CONNECT' verb is used. Http requests made using CONNECT are sent to the proxy\nwhere the body of the request is the encoded _raw_ data of the tcp connection.\nThe proxies then decodes the body and forwards the raw data, receives the\nresponse, reencodes it and sends the raw, encoded response back to the requester.\n(This is how all those http proxy tunnels work)\nUrllib3 doesn't support CONNECT at the moment (will be supported very soon!).\nProxied https requests are therefore sent in plaintext in the form of\n`GET https://httpbin.org/ HTTP/1.1`\nThis is not how https should be proxied and why you get the error at your\nproxy. (My squid for example doesn't care and does the right, erm.. wrong thing)\n(@gfairchild: this is the reason for your last error)\n\nAgain, the reason one should add the scheme is that you most will likely use the same\nproxy for both http and https. As requests will guess the _proxy_ scheme based\non the _request_ scheme.\nThis is unfortunate as both aren't correlated.\nThis way you may end up connecting to your proxy on the same port/ip one time\nwith plain http and the other time with https.\nYour proxy most likely won't support this.\nThis is the reason for all those \"Unknown SSL version\" bug reports. Request is\ntrying to establish a ssl connection with a _non-ssl_ proxy which sends plain\nhttp responses and therefore the handshake has no chance to succeed.\n", "That makes perfect sense. Thanks for explaining it so succinctly! I look forward to urllib3's support of the CONNECT verb!\n", "same issue here." ]
https://api.github.com/repos/psf/requests/issues/1217
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1217/labels{/name}
https://api.github.com/repos/psf/requests/issues/1217/comments
https://api.github.com/repos/psf/requests/issues/1217/events
https://github.com/psf/requests/issues/1217
11,387,129
MDU6SXNzdWUxMTM4NzEyOQ==
1,217
Make documentation for old versions of requests available
{ "avatar_url": "https://avatars.githubusercontent.com/u/299979?v=4", "events_url": "https://api.github.com/users/melinath/events{/privacy}", "followers_url": "https://api.github.com/users/melinath/followers", "following_url": "https://api.github.com/users/melinath/following{/other_user}", "gists_url": "https://api.github.com/users/melinath/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/melinath", "id": 299979, "login": "melinath", "node_id": "MDQ6VXNlcjI5OTk3OQ==", "organizations_url": "https://api.github.com/users/melinath/orgs", "received_events_url": "https://api.github.com/users/melinath/received_events", "repos_url": "https://api.github.com/users/melinath/repos", "site_admin": false, "starred_url": "https://api.github.com/users/melinath/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/melinath/subscriptions", "type": "User", "url": "https://api.github.com/users/melinath", "user_view_type": "public" }
[]
closed
true
null
[]
null
4
2013-02-26T00:01:28Z
2021-09-09T04:00:41Z
2013-04-01T18:34:10Z
NONE
resolved
I can't keep up with the progress that requests is making in one of my projects. On the one hand, it's great that requests is constantly being developed. On the other hand, I can no longer find the documentation which applies to the version I'm actually developing with (0.14.2), which is inconvenient.
{ "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/1217/reactions" }
https://api.github.com/repos/psf/requests/issues/1217/timeline
null
completed
null
null
false
[ "I know I can view it in the github code viewer; what I'm asking is that old doc versions be included on readthedocs.\n", "They used to be included, but RTD's version picker got absurd after 10+ versions.\n", "Yeah, I've run into that issue with their UI as well. You've inspired me to open a ticket on the subject: rtfd/readthedocs.org#344\n", "0.14.2's docs are now included on RTD.\n" ]
https://api.github.com/repos/psf/requests/issues/1216
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1216/labels{/name}
https://api.github.com/repos/psf/requests/issues/1216/comments
https://api.github.com/repos/psf/requests/issues/1216/events
https://github.com/psf/requests/pull/1216
11,343,410
MDExOlB1bGxSZXF1ZXN0NDI5NjE0Nw==
1,216
Not sure if minor spelling mishap
{ "avatar_url": "https://avatars.githubusercontent.com/u/897351?v=4", "events_url": "https://api.github.com/users/rhyselsmore/events{/privacy}", "followers_url": "https://api.github.com/users/rhyselsmore/followers", "following_url": "https://api.github.com/users/rhyselsmore/following{/other_user}", "gists_url": "https://api.github.com/users/rhyselsmore/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/rhyselsmore", "id": 897351, "login": "rhyselsmore", "node_id": "MDQ6VXNlcjg5NzM1MQ==", "organizations_url": "https://api.github.com/users/rhyselsmore/orgs", "received_events_url": "https://api.github.com/users/rhyselsmore/received_events", "repos_url": "https://api.github.com/users/rhyselsmore/repos", "site_admin": false, "starred_url": "https://api.github.com/users/rhyselsmore/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/rhyselsmore/subscriptions", "type": "User", "url": "https://api.github.com/users/rhyselsmore", "user_view_type": "public" }
[]
closed
true
null
[]
null
3
2013-02-25T00:21:02Z
2021-09-08T19:00:52Z
2013-02-25T09:02:43Z
NONE
resolved
Checked it out, couldn't see pycon as a syntax highlighter (not trying to be a smart ass either :sparkles:)
{ "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/1216/reactions" }
https://api.github.com/repos/psf/requests/issues/1216/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/1216.diff", "html_url": "https://github.com/psf/requests/pull/1216", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/1216.patch", "url": "https://api.github.com/repos/psf/requests/pulls/1216" }
true
[ "pycon works on GitHub, but not sphinx if I remember correctly... then again \nGitHub uses pygments and so does sphinx... I'm honestly not sure now\nOn Sun, Feb 24, 2013 at 04:21:06PM -0800, Rhys Elsmore wrote:\n\n> Checked it out, couldn't see pycon as a syntax highlighter (not trying to be a smart ass either :sparkles:)\n> You can merge this Pull Request by running:\n> \n> git pull https://github.com/rhyselsmore/requests develop\n> \n> Or you can view, comment on it, or merge it online at:\n> \n> https://github.com/kennethreitz/requests/pull/1216\n> \n> -- Commit Summary --\n> - Not sure if minor spelling mishap\n> \n> -- File Changes --\n> \n> ```\n> M README.rst (2)\n> ```\n> \n> -- Patch Links --\n> \n> https://github.com/kennethreitz/requests/pull/1216.patch\n> https://github.com/kennethreitz/requests/pull/1216.diff\n", "pycon = python console :)\n", "The things you learn. Ta\n\nOn 25/02/2013, at 11:23 AM, Kenneth Reitz [email protected] wrote:\n\npycon = python console :)\n\n—\nReply to this email directly or view it on\nGitHubhttps://github.com/kennethreitz/requests/pull/1216#issuecomment-14020693.\n" ]
https://api.github.com/repos/psf/requests/issues/1215
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1215/labels{/name}
https://api.github.com/repos/psf/requests/issues/1215/comments
https://api.github.com/repos/psf/requests/issues/1215/events
https://github.com/psf/requests/issues/1215
11,335,111
MDU6SXNzdWUxMTMzNTExMQ==
1,215
Requests doesn't compute Content-Length correctly when transmitting OAuth params in request body. Change for issue #1159 regressed fix for issue #1096.
{ "avatar_url": "https://avatars.githubusercontent.com/u/470362?v=4", "events_url": "https://api.github.com/users/matthewlmcclure/events{/privacy}", "followers_url": "https://api.github.com/users/matthewlmcclure/followers", "following_url": "https://api.github.com/users/matthewlmcclure/following{/other_user}", "gists_url": "https://api.github.com/users/matthewlmcclure/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/matthewlmcclure", "id": 470362, "login": "matthewlmcclure", "node_id": "MDQ6VXNlcjQ3MDM2Mg==", "organizations_url": "https://api.github.com/users/matthewlmcclure/orgs", "received_events_url": "https://api.github.com/users/matthewlmcclure/received_events", "repos_url": "https://api.github.com/users/matthewlmcclure/repos", "site_admin": false, "starred_url": "https://api.github.com/users/matthewlmcclure/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/matthewlmcclure/subscriptions", "type": "User", "url": "https://api.github.com/users/matthewlmcclure", "user_view_type": "public" }
[]
closed
true
null
[]
null
6
2013-02-24T14:30:55Z
2021-09-09T05:00:38Z
2013-02-25T14:34:06Z
CONTRIBUTOR
resolved
The change for #1159 regressed the fix for #1096. Recomputing Content-Length for requests that transmit OAuth params in the request body is broken again. Here's a test case: ``` [[email protected]:~] $ ipython Python 2.7.3 (default, Sep 15 2012, 19:45:36) Type "copyright", "credits" or "license" for more information. IPython 0.13.1 -- An enhanced Interactive Python. ? -> Introduction and overview of IPython's features. %quickref -> Quick reference. help -> Python's own help system. object? -> Details about 'object', use 'object??' for extra details. In [1]: import requests In [2]: from requests_oauthlib import OAuth1 In [3]: oauth = OAuth1(client_key=u'a-client-id', client_secret=u'a-client-secret', callback_uri=u'http://example.com/oauth_callback', signature_type=u'BODY') In [4]: req = requests.Request(method='POST', url='http://example.com/request_token', headers={ 'Accept': 'application/x-www-form-urlencoded', 'Content-Type': 'application/x-www-form-urlencoded' }, auth=oauth).prepare() In [5]: req.__dict__Out[5]: {'body': u'oauth_nonce=119221505668693451461361716039&oauth_timestamp=1361716039&oauth_version=1.0&oauth_signature_method=HMAC-SHA1&oauth_consumer_key=a-client-id&oauth_callback=http%3A%2F%2Fexample.com%2Foauth_callback&oauth_signature=azH8mCrSMYvEpQ7oonDIoIq38oQ%3D', 'headers': {'Accept': 'application/x-www-form-urlencoded', 'Content-Length': '0', 'Content-Type': u'application/x-www-form-urlencoded'}, 'hooks': {'response': []}, 'method': 'POST', 'url': u'http://example.com/request_token'} In [6]: resp = requests.request(method='POST', url='http://example.com/request_token', headers={ 'Accept': 'application/x-www-form-urlencoded', 'Content-Type': 'application/x-www-form-urlencoded' }, allow_redirects=False, auth=oauth) In [7]: resp.request.__dict__ Out[7]: {'body': u'oauth_nonce=40755579898176978971361716049&oauth_timestamp=1361716049&oauth_version=1.0&oauth_signature_method=HMAC-SHA1&oauth_consumer_key=a-client-id&oauth_callback=http%3A%2F%2Fexample.com%2Foauth_callback&oauth_signature=Ti910zdRt%2BC5UxLG2dJ5eJ%2BkZ90%3D', 'headers': {'Accept': 'application/x-www-form-urlencoded', 'Accept-Encoding': 'gzip, deflate, compress', 'Content-Length': '0', 'Content-Type': u'application/x-www-form-urlencoded', 'User-Agent': 'python-requests/1.1.0 CPython/2.7.3 Darwin/11.4.2'}, 'hooks': {'response': []}, 'method': 'POST', 'url': u'http://example.com/request_token'} In [9]: ```
{ "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/1215/reactions" }
https://api.github.com/repos/psf/requests/issues/1215/timeline
null
completed
null
null
false
[ "I didn't like that pull request anyway. Like we said on that issue, the user should go way out of their way to break things. @kennethreitz do you mind if I revert and push directly to requests? It's really not much of a difficult fix.\n", "@sigmavirus24 sure, this once :)\n", "Or you could revert it yourself ;)\n", "Anyway this can now be closed thanks to be62645dd56580dd7576032b348cf79d880851d8\n", "Thanks!\n", "Thanks for reporting it! I'm sorry it happened in the first place.\n" ]
https://api.github.com/repos/psf/requests/issues/1214
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1214/labels{/name}
https://api.github.com/repos/psf/requests/issues/1214/comments
https://api.github.com/repos/psf/requests/issues/1214/events
https://github.com/psf/requests/pull/1214
11,317,741
MDExOlB1bGxSZXF1ZXN0NDI4ODM3Ng==
1,214
Status object
{ "avatar_url": "https://avatars.githubusercontent.com/u/251281?v=4", "events_url": "https://api.github.com/users/DanielOaks/events{/privacy}", "followers_url": "https://api.github.com/users/DanielOaks/followers", "following_url": "https://api.github.com/users/DanielOaks/following{/other_user}", "gists_url": "https://api.github.com/users/DanielOaks/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/DanielOaks", "id": 251281, "login": "DanielOaks", "node_id": "MDQ6VXNlcjI1MTI4MQ==", "organizations_url": "https://api.github.com/users/DanielOaks/orgs", "received_events_url": "https://api.github.com/users/DanielOaks/received_events", "repos_url": "https://api.github.com/users/DanielOaks/repos", "site_admin": false, "starred_url": "https://api.github.com/users/DanielOaks/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/DanielOaks/subscriptions", "type": "User", "url": "https://api.github.com/users/DanielOaks", "user_view_type": "public" }
[]
closed
true
null
[]
null
0
2013-02-23T09:03:17Z
2021-09-08T23:08:30Z
2013-02-23T09:03:39Z
NONE
resolved
I think this is nicer, in fact
{ "avatar_url": "https://avatars.githubusercontent.com/u/251281?v=4", "events_url": "https://api.github.com/users/DanielOaks/events{/privacy}", "followers_url": "https://api.github.com/users/DanielOaks/followers", "following_url": "https://api.github.com/users/DanielOaks/following{/other_user}", "gists_url": "https://api.github.com/users/DanielOaks/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/DanielOaks", "id": 251281, "login": "DanielOaks", "node_id": "MDQ6VXNlcjI1MTI4MQ==", "organizations_url": "https://api.github.com/users/DanielOaks/orgs", "received_events_url": "https://api.github.com/users/DanielOaks/received_events", "repos_url": "https://api.github.com/users/DanielOaks/repos", "site_admin": false, "starred_url": "https://api.github.com/users/DanielOaks/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/DanielOaks/subscriptions", "type": "User", "url": "https://api.github.com/users/DanielOaks", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/1214/reactions" }
https://api.github.com/repos/psf/requests/issues/1214/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/1214.diff", "html_url": "https://github.com/psf/requests/pull/1214", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/1214.patch", "url": "https://api.github.com/repos/psf/requests/pulls/1214" }
true
[]
https://api.github.com/repos/psf/requests/issues/1213
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1213/labels{/name}
https://api.github.com/repos/psf/requests/issues/1213/comments
https://api.github.com/repos/psf/requests/issues/1213/events
https://github.com/psf/requests/pull/1213
11,315,080
MDExOlB1bGxSZXF1ZXN0NDI4NzQ1Mg==
1,213
Status Code Names/Descriptions
{ "avatar_url": "https://avatars.githubusercontent.com/u/251281?v=4", "events_url": "https://api.github.com/users/DanielOaks/events{/privacy}", "followers_url": "https://api.github.com/users/DanielOaks/followers", "following_url": "https://api.github.com/users/DanielOaks/following{/other_user}", "gists_url": "https://api.github.com/users/DanielOaks/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/DanielOaks", "id": 251281, "login": "DanielOaks", "node_id": "MDQ6VXNlcjI1MTI4MQ==", "organizations_url": "https://api.github.com/users/DanielOaks/orgs", "received_events_url": "https://api.github.com/users/DanielOaks/received_events", "repos_url": "https://api.github.com/users/DanielOaks/repos", "site_admin": false, "starred_url": "https://api.github.com/users/DanielOaks/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/DanielOaks/subscriptions", "type": "User", "url": "https://api.github.com/users/DanielOaks", "user_view_type": "public" }
[]
closed
true
null
[]
null
8
2013-02-23T03:25:32Z
2021-09-08T19:00:52Z
2013-02-25T10:33:06Z
NONE
resolved
This pull request adds printable names for status codes, as both the `requests.status_codes.name` dictionary, and accessible directly from a Response object as `Response.status_name`. I think it's quite a useful thing to have, say for printing out a name to go with a given status code (especially in the event of a failure. And uses cases: ``` python >>> import requests >>> r = requests.get('https://github.com/timeline.json') >>> r.status_code 200 >>> r.status_name 'OK' >>> r = requests.get('https://github.com/timene.js') >>> r.status_code 404 >>> r.status_name 'Not Found' >>> r # I also added the status_name to __repr__'s output, so the below is easier to understand at a glance <Response [404: Not Found]> >>> requests.status_codes.name[200] 'OK' >>> requests.status_codes.name[203] 'Non-Authoritative Info' >>> requests.status_codes.name[405] 'Method Not Allowed' ``` We may even want to add a `requests.status_codes.description` dict later on, having something like a one sentence description of what the code means. Maybe even create a Status class, with the members `code`, `name`, and `description`, accessible as `Response.status`, so you'd do something like this instead: ``` python >>> r = requests.get('https://github.com/timene.js') >>> r.status.code 404 >>> r.status.name 'Not Found' ``` Thanks for the awesome library. I dunno how I ever lived without Requests :smile:
{ "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/1213/reactions" }
https://api.github.com/repos/psf/requests/issues/1213/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/1213.diff", "html_url": "https://github.com/psf/requests/pull/1213", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/1213.patch", "url": "https://api.github.com/repos/psf/requests/pulls/1213" }
true
[ "I'm actually quite interested to see what you guys think about that `Status` object idea, at the end of the description up there.\n\nKeeping a shim so that `Response.status_code` gets/sets the value of Response.status.code would be quite simple, and I think that it's cleaner than adding a `Response.status_name` object now, and then looking into converting this over to a single `Status object later.\n", "Alright, I implemented that idea above, because it's just a bunch nicer. Including adding the `descriptions` dict to `requests.status_codes`. Most of the descriptions are almost directly taken or adapted from the [Mozilla Wiki](https://developer.mozilla.org/en-US/docs/HTTP/HTTP_response_codes) and [Wikipedia](https://en.wikipedia.org/wiki/List_of_HTTP_status_codes), commented out where I will go back and add it later.\n\nSo, the updated use case code:\n\n``` python\n>>> import requests\n\n>>> r = requests.get('https://github.com/timeline.json')\n>>> r.status_code # old method still works\n200\n>>> r.status.code\n200\n>>> r.status.name\n'OK'\n>>> r.status.description\n'Request was successful.'\n\n>>> r = requests.get('https://github.com/timene.js')\n>>> r.status.code\n404\n>>> r.status.name\n'Not Found'\n>>> r # I also added the status_name to __repr__'s output, so the below is easier to understand at a glance\n<Response [404: Not Found]>\n\n>>> requests.status_codes.name[200]\n'OK'\n\n>>> requests.status_codes.name[203]\n'Non-Authoritative Info'\n\n>>> requests.status_codes.name[405]\n'Method Not Allowed'\n\n>>> requests.status_codes.description[401]\n'Authentication is needed to access the given resource.'\n\n>>> requests.status_codes.description[405]\n'Server has disabled this request method and cannot be used.'\n```\n\nI have yet to add descriptions for all the status codes, but if `r.status.description` does not have a description, it simply returns an empty string.\n", "I like it.\n", "Thanks for the pull request! We're always delighted to have new submissions.\n\nUnfortunately, I don't think this PR will be accepted. There are a few reasons for this.\n\nFirst, Requests is in [feature freeze](http://docs.python-requests.org/en/latest/dev/todo/#feature-freeze), which means new features are highly unlikely to be accepted, unless they provide significant value to the library. Sadly, I don't believe this PR does.\n\nSecond, it should be noted that the short descriptions already work without this PR:\n\n``` python\n>>> import requests\n>>> r = requests.get('http://www.google.com/')\n>>> r.status_code\n200\n>>> r.reason\n'OK'\n>>> r = requests.get('http://www.lukasa.co.uk/deliberate_404')\n>>> r.status_code\n404\n>>> r.reason\n'NOT FOUND'.\n```\n\nWith this in mind, the feature added by this PR is the long-form descriptions. I honestly don't think that anyone programming HTTP is going to be overly put out by having to use Wikipedia to look up a status code. I can see some use for these codes in printed errors, but anyone intending to provide nicely-formatted errors on Requests will already have to write custom code, so I don't think this is too much of a burden.\n\n**I will not close this** because Kenneth might disagree with me, but I don't think he will on this one. \n", "Ah, I assumed the feature freeze only applied to API-breaking changes — that's fair enough.\n\nShort descriptions already work, but these are more inclined towards printable names and descriptions, such as with the following code:\n\n``` python\nr = requests.get(url, **kwargs)\n\nif not r.ok:\n return 'HTTP Error: {code} {name} - {description}'.format(code=r.status.code,\n name=r.status.name,\n description=r.status.description)\n```\n\nWhich would show the user something like this, without having to get a description from somewhere else:\n\n```\nHTTP Error: 404 Not Found - Server cannot find requested resource.\n```\n\nBut I totally understand if this wouldn't provide enough value to benefit everyone. Thanks for the prompt response!\n", "I agree that for some users this would provide a great deal of value, and I'd totally support you maintaining a third-party implementation of this. Unfortunately, as I said, it's not suitable for the main library in this feature freeze.\n\nAs I said, it's great that you submitted code, contributors are always great to have, even if we don't end up using their code. =)\n", "I agree with @Lukasa. \n\nHowever, the reverse lookup is something I've wanted to add for a while:\n\n``` pycon\n>>> requests.codes.name[200]\n'OK'\n```\n", "Fair enough. In that case, I'm gonna break this out to a separate package, [http_status](https://pypi.python.org/pypi/http-status)\n\nAnd don't worry, I understand. I actually have one or two really simple fixes to submit after I get this broken out to another package. Thanks again for the quick response. =)\n" ]
https://api.github.com/repos/psf/requests/issues/1212
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1212/labels{/name}
https://api.github.com/repos/psf/requests/issues/1212/comments
https://api.github.com/repos/psf/requests/issues/1212/events
https://github.com/psf/requests/issues/1212
11,314,534
MDU6SXNzdWUxMTMxNDUzNA==
1,212
Status Code Descriptions
{ "avatar_url": "https://avatars.githubusercontent.com/u/251281?v=4", "events_url": "https://api.github.com/users/DanielOaks/events{/privacy}", "followers_url": "https://api.github.com/users/DanielOaks/followers", "following_url": "https://api.github.com/users/DanielOaks/following{/other_user}", "gists_url": "https://api.github.com/users/DanielOaks/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/DanielOaks", "id": 251281, "login": "DanielOaks", "node_id": "MDQ6VXNlcjI1MTI4MQ==", "organizations_url": "https://api.github.com/users/DanielOaks/orgs", "received_events_url": "https://api.github.com/users/DanielOaks/received_events", "repos_url": "https://api.github.com/users/DanielOaks/repos", "site_admin": false, "starred_url": "https://api.github.com/users/DanielOaks/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/DanielOaks/subscriptions", "type": "User", "url": "https://api.github.com/users/DanielOaks", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2013-02-23T02:30:28Z
2021-09-09T05:00:39Z
2013-02-23T03:26:57Z
NONE
resolved
I think being able to return a description for HTTP status codes might be nice. Something you could print out along with the status code, in case you had to. I'm thinking a use case as something along these lines: ``` python r = requests.get(url, timeout=20) if r.status_code != requests.codes.ok: return 'HTTP {code}: {desc}'.format(code=r.status_code, desc=requests.status_codes.description[r.status_code]) ``` With something like this added to request_codes: ``` python description = { # ... 403: 'Access Denied', 404: 'File Not Found', 405: 'Method Not Allowed', 406: 'Not Acceptable' # ... } ``` And other descriptions mostly grabbed from [Wikipedia.](https://en.wikipedia.org/wiki/List_of_HTTP_status_codes) I think it'd be a nice addition, especially if we could roll it into `r`, as `r.status_description` or something similar. I can write up some code and submit a PR, if you think this would go well in Requests. And thanks for the awesome library. I dunno how I ever lived without Requests :smile:
{ "avatar_url": "https://avatars.githubusercontent.com/u/251281?v=4", "events_url": "https://api.github.com/users/DanielOaks/events{/privacy}", "followers_url": "https://api.github.com/users/DanielOaks/followers", "following_url": "https://api.github.com/users/DanielOaks/following{/other_user}", "gists_url": "https://api.github.com/users/DanielOaks/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/DanielOaks", "id": 251281, "login": "DanielOaks", "node_id": "MDQ6VXNlcjI1MTI4MQ==", "organizations_url": "https://api.github.com/users/DanielOaks/orgs", "received_events_url": "https://api.github.com/users/DanielOaks/received_events", "repos_url": "https://api.github.com/users/DanielOaks/repos", "site_admin": false, "starred_url": "https://api.github.com/users/DanielOaks/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/DanielOaks/subscriptions", "type": "User", "url": "https://api.github.com/users/DanielOaks", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/1212/reactions" }
https://api.github.com/repos/psf/requests/issues/1212/timeline
null
completed
null
null
false
[ "Sorry, should've written the code right away, rather than duping the issue with the PR. See #1213 \n" ]
https://api.github.com/repos/psf/requests/issues/1211
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1211/labels{/name}
https://api.github.com/repos/psf/requests/issues/1211/comments
https://api.github.com/repos/psf/requests/issues/1211/events
https://github.com/psf/requests/issues/1211
11,297,618
MDU6SXNzdWUxMTI5NzYxOA==
1,211
Ability to dump request content
{ "avatar_url": "https://avatars.githubusercontent.com/u/3127473?v=4", "events_url": "https://api.github.com/users/jrmoserbaltimore/events{/privacy}", "followers_url": "https://api.github.com/users/jrmoserbaltimore/followers", "following_url": "https://api.github.com/users/jrmoserbaltimore/following{/other_user}", "gists_url": "https://api.github.com/users/jrmoserbaltimore/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/jrmoserbaltimore", "id": 3127473, "login": "jrmoserbaltimore", "node_id": "MDQ6VXNlcjMxMjc0NzM=", "organizations_url": "https://api.github.com/users/jrmoserbaltimore/orgs", "received_events_url": "https://api.github.com/users/jrmoserbaltimore/received_events", "repos_url": "https://api.github.com/users/jrmoserbaltimore/repos", "site_admin": false, "starred_url": "https://api.github.com/users/jrmoserbaltimore/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/jrmoserbaltimore/subscriptions", "type": "User", "url": "https://api.github.com/users/jrmoserbaltimore", "user_view_type": "public" }
[]
closed
true
null
[]
null
7
2013-02-22T18:20:23Z
2021-09-09T05:00:37Z
2013-02-27T18:47:00Z
NONE
resolved
There is no way to dump request content. Currently digging with tcpdump and wireshark shows that the requests should be going through fine; r.history shows 302 and 401 for a digest authorization, and r.status_code gives 200. Running curl with the data I'm giving is making the target Web application (a closed-source Java app) take state-altering actions. Running with Python requests is doing absolutely nothing. The main problem here is I have absolutely no way to debug why this is happening.
{ "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/1211/reactions" }
https://api.github.com/repos/psf/requests/issues/1211/timeline
null
completed
null
null
false
[ "If you're digging with Wireshark, you are seeing exactly what went out on the wire. Requests cannot give you better information than that.\n\nAs it turns out, you can get very close to the information you want by examining the `PreparedRequest` that was created. For instance, the request that triggered the 200 is stored on the response as `response.request`. The others can be found on the response objects in the history.\n\nAs to your actual problem, if Requests is getting a 200 back then the server is totally OK with what Requests is doing. If I were you I would compare the HTTP sent out by Requests and that sent out by curl and see what the differences are.\n", "Ah okay. The documentation for this is VERY poor and doesn't mention this. It seems like the API docs on the Web site are in the form of \"Oh, you can do X, see?\" rather than \"You have this object, it has these methods, they perform these functions.\" I'm finding all kinds of undocumented stuff in the code.\n\nYou would be surprised how poor a tool abstracted 3 steps is from a tool doing actual work. Juggling data out of wireshark tells me what happened, but it doesn't tell me why I got a 200--I get a 200 from python r.status_code, but there is no 200 shown in Wireshark.\n\nI've used things like Web Scarab in the past to get a better view step-by-step of what's going on, which allows for slowing down and examining the time dynamic. Likewise it's nice to see what the program thinks it's doing versus what's actually happening--tcpdump and wireshark are showing me that the program has strange ideas of what's going on.\n", "As to your documentation issue, it looks like you want [this](http://docs.python-requests.org/en/latest/api/). Admittedly some of this is incomplete (and the `Response.request` property is missing), so we'd be happy to accept PRs that improve it.\n\nReturning to the bug, I'm gobsmacked that Requests thinks it's getting a 200 if there isn't one on the wire. Requests is also abstracted: much of the crafting of HTTP is done in urllib3, which is itself built on httplib. In fact, Requests gets the status code from the response object returned by urllib3, which gets it from httplib. There is no logic in Requests to change the status code _except_ to fall back to `None` if no status code is provided.\n\nIs it possible for you to send me a pcap file showing the traffic on the wire? Obviously you can say no if there's any sensitive information or information you don't want me to see in there, but I'm interested to see what HTTP message Requests is misinterpreting.\n", "I should open a different bug for that, but yes I'll send you some stuff, we can talk offline. I don't see anything critical in here (scrubbed, digest auth) but rather not plaster this around the net anyway.\n", "@bluefoxicy @Lukasa is this still an open issue? It looks like its being resolved for the opener offline.\n", "My particular issue was a bug in my code. This still sends GET requests.\nLooks like I missed the documentation for this, so maybe a documentation\nissue but this report is otherwise invalid.\nOn Feb 27, 2013 1:41 PM, \"Philip James\" [email protected] wrote:\n\n> @bluefoxicy https://github.com/bluefoxicy @Lukasahttps://github.com/Lukasais this still an open issue? It looks like its being resolved for the\n> opener offline.\n> \n> —\n> Reply to this email directly or view it on GitHubhttps://github.com/kennethreitz/requests/issues/1211#issuecomment-14191018\n> .\n", "@phildini, @bluefoxicy is simply providing sensitive information to @Lukasa so that he can get a better idea of what is happening in his specific case. The issue of dumping content is a moot one, IMO, but do-able as @Lukasa suggested. This feature has been requested several times before (unsuccessfully obviously) and combining its track record with our feature freeze, it likely won't be added to requests.\n\nIt could be done in the form of a response hook (beyond what @Lukasa mentioned), e.g.,\n\n``` python\ndef dump_request(response):\n logger.debug(response.request.url)\n logger.debug(response.request.body)\n # etc.\n\nr = requests.request(method, url, #etc.\n hooks={'response': dump_request},\n )\n```\n\nAlso since @bluefoxicy has claimed this to be invalid on his own accord, I'm closing this issue.\n" ]
https://api.github.com/repos/psf/requests/issues/1210
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1210/labels{/name}
https://api.github.com/repos/psf/requests/issues/1210/comments
https://api.github.com/repos/psf/requests/issues/1210/events
https://github.com/psf/requests/pull/1210
11,269,160
MDExOlB1bGxSZXF1ZXN0NDI2NjM1Ng==
1,210
Unquote proxy usernames and passwords.
{ "avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4", "events_url": "https://api.github.com/users/Lukasa/events{/privacy}", "followers_url": "https://api.github.com/users/Lukasa/followers", "following_url": "https://api.github.com/users/Lukasa/following{/other_user}", "gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Lukasa", "id": 1382556, "login": "Lukasa", "node_id": "MDQ6VXNlcjEzODI1NTY=", "organizations_url": "https://api.github.com/users/Lukasa/orgs", "received_events_url": "https://api.github.com/users/Lukasa/received_events", "repos_url": "https://api.github.com/users/Lukasa/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions", "type": "User", "url": "https://api.github.com/users/Lukasa", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2013-02-22T00:39:45Z
2021-09-08T23:01:15Z
2013-02-25T10:31:01Z
MEMBER
resolved
Should resolve #1207.
{ "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/1210/reactions" }
https://api.github.com/repos/psf/requests/issues/1210/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/1210.diff", "html_url": "https://github.com/psf/requests/pull/1210", "merged_at": "2013-02-25T10:31:01Z", "patch_url": "https://github.com/psf/requests/pull/1210.patch", "url": "https://api.github.com/repos/psf/requests/pulls/1210" }
true
[ ":cake:\n" ]
https://api.github.com/repos/psf/requests/issues/1209
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1209/labels{/name}
https://api.github.com/repos/psf/requests/issues/1209/comments
https://api.github.com/repos/psf/requests/issues/1209/events
https://github.com/psf/requests/issues/1209
11,255,249
MDU6SXNzdWUxMTI1NTI0OQ==
1,209
SSL verification broken if using a proxy
{ "avatar_url": "https://avatars.githubusercontent.com/u/238652?v=4", "events_url": "https://api.github.com/users/schlamar/events{/privacy}", "followers_url": "https://api.github.com/users/schlamar/followers", "following_url": "https://api.github.com/users/schlamar/following{/other_user}", "gists_url": "https://api.github.com/users/schlamar/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/schlamar", "id": 238652, "login": "schlamar", "node_id": "MDQ6VXNlcjIzODY1Mg==", "organizations_url": "https://api.github.com/users/schlamar/orgs", "received_events_url": "https://api.github.com/users/schlamar/received_events", "repos_url": "https://api.github.com/users/schlamar/repos", "site_admin": false, "starred_url": "https://api.github.com/users/schlamar/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/schlamar/subscriptions", "type": "User", "url": "https://api.github.com/users/schlamar", "user_view_type": "public" }
[]
closed
true
null
[]
null
17
2013-02-21T19:26:56Z
2021-09-09T02:11:53Z
2013-02-22T00:11:46Z
CONTRIBUTOR
resolved
According to #1204 `requests` should fully support HTTP proxies. However, the SSL verification is broken on my system. If requesting without a proxy, I'm getting as expected: ``` >>> requests.get('https://kennethreitz.org') requests.exceptions.SSLError: hostname 'kennethreitz.org' doesn't match either of '*.herokuapp.com', 'herokuapp.com' ``` However, doing the same request via an HTTP proxy: ``` >>> proxies = {'http': 'http://...', 'https': 'http://...'} >>> requests.get('https://kennethreitz.org', proxies=proxies) <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/1209/reactions" }
https://api.github.com/repos/psf/requests/issues/1209/timeline
null
completed
null
null
false
[ "No it isn't. I mean, there are some proxy bugs, but this isn't one, I don't think.\n\nI've not tested this, but I bet that if you run an HTTPS request over an HTTP connection to a proxy, the proxy does the HTTPS termination and then forwards the request to you in plaintext (you should be able to see this in Wireshark). Thus, your proxy is handling the SSL (and ignoring the certificate failure).\n\nUnfortunately, you can't do HTTPS over HTTPS proxies yet because urllib3 doesn't yet support the CONNECT verb. See shazow/urllib3#139.\n", "@Lukasa \nAnd how do you explain this:\n\n```\n$ curl https://stackoverflow.com/\ncurl: (51) SSL peer certificate or SSH remote key was not OK\n\n$ python -c \"import requests; print requests.get('https://stackoverflow.com/')\"\n<Response [200]>\n\n$ export | grep http\ndeclare -x http_proxy=\"http://.../\"\ndeclare -x https_proxy=\"http://.../\"\n```\n", "Ah, I see. This is really an issue of my proxy. Curl is doing `CONNECT ...` over the proxy while requests is doing a `GET ...`. However, with https://github.com/shazow/urllib3/issues/139 applied it does a CONNECT, but I'm still getting the `<Response 200>`.\n", "@Lukasa After reading http://curl.haxx.se/mail/lib-2010-03/0018.html I would say that the current behavior is broken in requests! Doing `GET https` on a proxy is non-standard behavior.\n\nHowever it should be fixed with https://github.com/shazow/urllib3/issues/139 (assuming the cert verification issue will be solved) so I think this issue can be left as closed.\n", "@schlamar: I think you're right too, though I don't have the time right now to really explore it.\n\nAs and when urllib3 gets sorted I'll probably give you a nudge because it sounds like your network is set up to test this. =D\n", "@Lukasa Please also nudge me :)\n\nBeing able to access an HTTPS site through an HTTP(S) proxy is a critical requirement for me, and I have the environment to test it.\n\nFYI, my workaround right now is to read stdout from `curl` in a subprocess. Yuck :p\n", "@maxbane What about urllib2: https://gist.github.com/schlamar/2993700\n", "@schlamar That would be one option. I actually ended up using pycurl, the python bindings for libcurl.\n", "@maxbane consider yourself on a list :-P\n", "I also have an environment to test this action, and actually have successfully used the new https proxy changes in urllib3 to poke through my corporate proxy.\n", "@ciphercast you're on the list now too. (Don't worry the list is as ambiguous as it seems ;))\n", "@Lukasa urllib3 seems to be fixed with https://github.com/shazow/urllib3/pull/139. But requests on top of it is still not doing the certificate verification. See my comment (which includes a fully automated test): https://github.com/shazow/urllib3/pull/139#issuecomment-14367341 Any idea?\n\n@maxbane Mind if you run the test mentioned above on your setup? :)\n", "I'm pretty sure SSL verification in Requests is actually handled by urllib3, so urllib3 should be doing it. I can't guarantee that, and I have to go to work now, but I'll take a look at this when I get back.\n", "@Lukasa Found the issue, see my changes at https://github.com/schlamar/requests/tree/new-urllib3-api.\n", "As soon as https://github.com/shazow/urllib3/issues/139 gets merged I send a clean pull request :)\n", "Awesome, I look forward to it. =)\n", "@maxbane @ciphercast There is a requests HTTPS proxy ready version to test, can you give it a try: https://github.com/shazow/urllib3/pull/170#issuecomment-21234629\n\n@sigmavirus24 Anyone else on your list? :)\n" ]
https://api.github.com/repos/psf/requests/issues/1208
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1208/labels{/name}
https://api.github.com/repos/psf/requests/issues/1208/comments
https://api.github.com/repos/psf/requests/issues/1208/events
https://github.com/psf/requests/issues/1208
11,253,019
MDU6SXNzdWUxMTI1MzAxOQ==
1,208
Not possible to specify max_retries in v1.X?
{ "avatar_url": "https://avatars.githubusercontent.com/u/70800?v=4", "events_url": "https://api.github.com/users/Wilfred/events{/privacy}", "followers_url": "https://api.github.com/users/Wilfred/followers", "following_url": "https://api.github.com/users/Wilfred/following{/other_user}", "gists_url": "https://api.github.com/users/Wilfred/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Wilfred", "id": 70800, "login": "Wilfred", "node_id": "MDQ6VXNlcjcwODAw", "organizations_url": "https://api.github.com/users/Wilfred/orgs", "received_events_url": "https://api.github.com/users/Wilfred/received_events", "repos_url": "https://api.github.com/users/Wilfred/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Wilfred/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Wilfred/subscriptions", "type": "User", "url": "https://api.github.com/users/Wilfred", "user_view_type": "public" }
[]
closed
true
null
[]
null
6
2013-02-21T18:31:16Z
2021-09-09T05:00:37Z
2013-02-27T16:10:29Z
CONTRIBUTOR
resolved
In older versions of requests (pre v1.0), I was able to do: ``` requests.get('http://nonexistentdomainfoobar.com', config={"max_retries":10}) ``` as far as I can tell, this isn't possible in v.1.0+. `HTTPAdapter.max_retries` uses `DEFAULT_RETRIES` and there's no way to change this. Would it be possible to restore this feature? If not, perhaps a note in the FAQ informing users that this isn't possible and they'll have to write a loop themselves?
{ "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/1208/reactions" }
https://api.github.com/repos/psf/requests/issues/1208/timeline
null
completed
null
null
false
[ "Why not do this?\n\n``` pycon\n>>> import requests\n>>> from requests.adapters import HTTPAdapter\n>>> s = requests.session()\n>>> h = HTTPAdapter()\n>>> h.max_retries = 10\n>>> h.max_retries\n10\n>>> s.mount('http://', h)\n>>> s.mount('https://', h)\n>>> s.get('http://nonexistentdomainfoobar.com')\n```\n\nIt isn't an \"easy\" config option, but it certainly is still possible to configure it. That aside, it's definitely worth adding to the docs.\n", "Hmm, i wonder if we can just modify session.adapters directly \n", "Why not:\n\n``` python\nimport requests\ns = requests.Session()\nurl = 'http://testurl.com/'\nh = s.get_adapter(url)\nh.max_retries = 10\n```\n\nThis method uses the recommended method of interacting with Transport Adapters on sessions.\n\nIf you really really wanted to, you could take advantage of the fact that the adapters are a Python dictionary (which I'm pretty sure is just an implementation detail) and do this:\n\n``` python\nimport requests\ns = requests.Session()\n\nfor _, adapter in s.adapters.iteritems():\n adapter.max_retries = 10\n```\n", "@Wilfred, I'm not sure why you submitted a pull request. Also I'm not sure why this issue stayed open when there were two sufficient solutions for fixing this.\n", "@sigmavirus24 The two solutions given are not documented anywhere. It would be nice to at least document how to do this.\n\nThat being said, it's a shame that a simple GET to a URL becomes ~5 lines of code in requests v1.0, when it was just one line before.\n", "Well we also got rid of `pre_request` hooks so that to do something equivalent looks like: https://gist.github.com/sigmavirus24/5049172 but that's the beauty of semantic versioning.\n\nWe've been behind on updating the docs, but I'll add this to the list of things that need to be added.\n" ]
https://api.github.com/repos/psf/requests/issues/1207
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1207/labels{/name}
https://api.github.com/repos/psf/requests/issues/1207/comments
https://api.github.com/repos/psf/requests/issues/1207/events
https://github.com/psf/requests/issues/1207
11,248,312
MDU6SXNzdWUxMTI0ODMxMg==
1,207
URL-encoding not handled for proxy username and password
{ "avatar_url": "https://avatars.githubusercontent.com/u/792504?v=4", "events_url": "https://api.github.com/users/maxbane/events{/privacy}", "followers_url": "https://api.github.com/users/maxbane/followers", "following_url": "https://api.github.com/users/maxbane/following{/other_user}", "gists_url": "https://api.github.com/users/maxbane/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/maxbane", "id": 792504, "login": "maxbane", "node_id": "MDQ6VXNlcjc5MjUwNA==", "organizations_url": "https://api.github.com/users/maxbane/orgs", "received_events_url": "https://api.github.com/users/maxbane/received_events", "repos_url": "https://api.github.com/users/maxbane/repos", "site_admin": false, "starred_url": "https://api.github.com/users/maxbane/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/maxbane/subscriptions", "type": "User", "url": "https://api.github.com/users/maxbane", "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
4
2013-02-21T16:38:09Z
2021-09-09T05:00:38Z
2013-02-25T23:36:17Z
NONE
resolved
Proxy authentication information is specified by the `proxies` dictionary passed to `requests.get()` and other methods, like so: ``` requests.get(..., proxies = {'http': 'http://user:[email protected]'}) ``` Because the username and password are specified as part of a URL, they _must_ be URL-encoded by the caller; otherwise consider what would happen if the user's password or username contained an `@` or a `:`, etc. So, for example, if my proxy password is `p@ssword!!!`, I need to write my call like this: ``` requests.get(..., proxies = {'http': 'http://user:p%40ssword%21%21%[email protected]'}) ``` However, this functionality is currently broken, because `utils.get_auth_from_url` does not _decode_ the URL-encoded username and password. The result is that the raw URL-encoded username and password are sent in the `Proxy-Authorization` header to the proxy, but of course the proxy expects the _actual_, decoded username and password, so authentication fails. It is a one-line fix to perform URL decoding in `utils.get_auth_from_url`. It would also be a good idea to add this to the `test_get_auth_from_url` test case. I would submit a pull request myself, but the fix I developed was written on company time, so I would need like 7 signatures to release it you. Argh.
{ "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/1207/reactions" }
https://api.github.com/repos/psf/requests/issues/1207/timeline
null
completed
null
null
false
[ "That's ok, I'll work on it. =)\n", "See #1210 for the PR.\n", "Fixed. =) Thanks for raising the issue!\n", "Thanks for fixing :+1: \n" ]
https://api.github.com/repos/psf/requests/issues/1206
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1206/labels{/name}
https://api.github.com/repos/psf/requests/issues/1206/comments
https://api.github.com/repos/psf/requests/issues/1206/events
https://github.com/psf/requests/issues/1206
11,202,617
MDU6SXNzdWUxMTIwMjYxNw==
1,206
Pickling of sessions does not work
{ "avatar_url": "https://avatars.githubusercontent.com/u/482701?v=4", "events_url": "https://api.github.com/users/nityaoberoi/events{/privacy}", "followers_url": "https://api.github.com/users/nityaoberoi/followers", "following_url": "https://api.github.com/users/nityaoberoi/following{/other_user}", "gists_url": "https://api.github.com/users/nityaoberoi/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/nityaoberoi", "id": 482701, "login": "nityaoberoi", "node_id": "MDQ6VXNlcjQ4MjcwMQ==", "organizations_url": "https://api.github.com/users/nityaoberoi/orgs", "received_events_url": "https://api.github.com/users/nityaoberoi/received_events", "repos_url": "https://api.github.com/users/nityaoberoi/repos", "site_admin": false, "starred_url": "https://api.github.com/users/nityaoberoi/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/nityaoberoi/subscriptions", "type": "User", "url": "https://api.github.com/users/nityaoberoi", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2013-02-20T15:53:57Z
2021-09-09T05:00:39Z
2013-02-20T15:55:37Z
NONE
resolved
Referring to these lines: https://github.com/kennethreitz/requests/blob/master/requests/sessions.py#L457-L458 **attrs** is not defined and hence pickling of the session fails.
{ "avatar_url": "https://avatars.githubusercontent.com/u/240830?v=4", "events_url": "https://api.github.com/users/sigmavirus24/events{/privacy}", "followers_url": "https://api.github.com/users/sigmavirus24/followers", "following_url": "https://api.github.com/users/sigmavirus24/following{/other_user}", "gists_url": "https://api.github.com/users/sigmavirus24/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/sigmavirus24", "id": 240830, "login": "sigmavirus24", "node_id": "MDQ6VXNlcjI0MDgzMA==", "organizations_url": "https://api.github.com/users/sigmavirus24/orgs", "received_events_url": "https://api.github.com/users/sigmavirus24/received_events", "repos_url": "https://api.github.com/users/sigmavirus24/repos", "site_admin": false, "starred_url": "https://api.github.com/users/sigmavirus24/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/sigmavirus24/subscriptions", "type": "User", "url": "https://api.github.com/users/sigmavirus24", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/1206/reactions" }
https://api.github.com/repos/psf/requests/issues/1206/timeline
null
completed
null
null
false
[ "Duplicate of #1088\n" ]
https://api.github.com/repos/psf/requests/issues/1205
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1205/labels{/name}
https://api.github.com/repos/psf/requests/issues/1205/comments
https://api.github.com/repos/psf/requests/issues/1205/events
https://github.com/psf/requests/pull/1205
11,197,867
MDExOlB1bGxSZXF1ZXN0NDIzMTA1Mg==
1,205
Missing line was allowing redirects with HEAD
{ "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
3
2013-02-20T13:59:50Z
2021-09-08T19:00:51Z
2013-02-25T10:31:21Z
CONTRIBUTOR
resolved
Closes #1203
{ "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/1205/reactions" }
https://api.github.com/repos/psf/requests/issues/1205/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/1205.diff", "html_url": "https://github.com/psf/requests/pull/1205", "merged_at": "2013-02-25T10:31:21Z", "patch_url": "https://github.com/psf/requests/pull/1205.patch", "url": "https://api.github.com/repos/psf/requests/pulls/1205" }
true
[ ":heart:\n", "Thanks -- I'm the one who opened #1203 .\n", "You're welcome! I'm always happy to help.\n" ]
https://api.github.com/repos/psf/requests/issues/1204
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1204/labels{/name}
https://api.github.com/repos/psf/requests/issues/1204/comments
https://api.github.com/repos/psf/requests/issues/1204/events
https://github.com/psf/requests/issues/1204
11,197,038
MDU6SXNzdWUxMTE5NzAzOA==
1,204
SSL error 140770FC with requests behind company proxy
{ "avatar_url": "https://avatars.githubusercontent.com/u/219063?v=4", "events_url": "https://api.github.com/users/eddie-dunn/events{/privacy}", "followers_url": "https://api.github.com/users/eddie-dunn/followers", "following_url": "https://api.github.com/users/eddie-dunn/following{/other_user}", "gists_url": "https://api.github.com/users/eddie-dunn/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/eddie-dunn", "id": 219063, "login": "eddie-dunn", "node_id": "MDQ6VXNlcjIxOTA2Mw==", "organizations_url": "https://api.github.com/users/eddie-dunn/orgs", "received_events_url": "https://api.github.com/users/eddie-dunn/received_events", "repos_url": "https://api.github.com/users/eddie-dunn/repos", "site_admin": false, "starred_url": "https://api.github.com/users/eddie-dunn/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/eddie-dunn/subscriptions", "type": "User", "url": "https://api.github.com/users/eddie-dunn", "user_view_type": "public" }
[]
closed
true
null
[]
null
14
2013-02-20T13:34:52Z
2021-09-09T00:34:22Z
2013-02-21T09:47:48Z
NONE
resolved
I can't use requests for https requests behind my company proxy. I'm not sure whether the problem is due to requests or my company proxy. Example output: ``` >>> import requests >>> requests.get("http://www.google.com") <Response [200]> >>> requests.get("https://www.google.com") Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/edwardd/.local/lib/python2.7/site-packages/requests/api.py", line 55, in get return request('get', url, **kwargs) File "/home/edwardd/.local/lib/python2.7/site-packages/requests/api.py", line 44, in request return session.request(method=method, url=url, **kwargs) File "/home/edwardd/.local/lib/python2.7/site-packages/requests/sessions.py", line 279, in request resp = self.send(prep, stream=stream, timeout=timeout, verify=verify, cert=cert, proxies=proxies) File "/home/edwardd/.local/lib/python2.7/site-packages/requests/sessions.py", line 374, in send r = adapter.send(request, **kwargs) File "/home/edwardd/.local/lib/python2.7/site-packages/requests/adapters.py", line 213, in send raise SSLError(e) requests.exceptions.SSLError: [Errno 1] _ssl.c:504: error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol ```
{ "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/1204/reactions" }
https://api.github.com/repos/psf/requests/issues/1204/timeline
null
completed
null
null
false
[ "This is a known issue. I'm surprised I can't find an already open issue in the tracker for it. We're waiting on one [pull request](https://github.com/shazow/urllib3/pull/139) in shazow/urllib3 and it will then be fixed.\n", "This looks like #1182.\n\nQuoting myself:\n\nDoes your proxy variable have a `https://` or `http://` scheme?\nIt should be `http://` if you want to connect by `http`, regardless if the the proxied connection itself is encrypted.\n", "Yes, t-8ch, the proxy variable for https started with `https://`. Using `http://`, however, returns 501:\n\n```\n>>> requests.get(\"https://www.google.com\")\n<Response [501]>\n```\n", "@t-8ch this is probably just due to not sending 'CONNECT'\n", "@eddie-dunn: To be clear, how are you passing the proxy information to Requests? Keyword argument or environment variable?\n", "Environment variables. I have\n\n```\nedwardd@lnxedwardd> export | grep http\nhttp_proxy=10.0.2.60:3128\nhttps_proxy=10.0.2.60:3128\n```\n\nDon't think it makes a difference, though:\n\n```\n$ unset https_proxy\n$ python\n>>> import requests\n>>> requests.get(\"https://www.google.com\", proxies={\"https\": \"10.0.2.60:3128\"})\nTraceback (most recent call last):\n File \"<stdin>\", line 1, in <module>\n <...>\nrequests.exceptions.SSLError: [Errno 1] _ssl.c:504: error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol\n```\n", "Excellent, that demonstrates the bug.\n\nAs @t-8ch and @sigmavirus24 pointed out, we currently cannot use HTTPS over proxies because we do not support the CONNECT verb. This is a known bug, and we're waiting on urllib3 before we can resolve it.\n", "So... when is urllib3 due? And I guess the solution in the meantime is to not use requests and/or https?\n", "Shazow is swamped so he won't be able to get to it for a while. The honest answer is that we don't know.\n\nUnfortunately, as long as you're required to proxy out there's nothing we can do until that time. I'm sorry. =(\n", "No need to apologize, I understand :) Is there an open issue/ticket somewhere referencing this problem so I can be notified when it does get solved? I have been thinking about using `requests` for applications here at work, but I'd like https with proxy to work first.\n", "Keep an eye on shazow/urllib3#139.\n", "Hello,\n\nLooking at https://github.com/shazow/urllib3/pull/139, it seems it was closed. Do you know if the integration into requests is already in the work?\n\nThanks a lot!\n", "It was already integrated. Requests 2.0.0 and upward contain the functionality.\n", "Ok thanks for the precision. I still get the same error, but this is probably under different conditions.\n\nThanks again.\n" ]
https://api.github.com/repos/psf/requests/issues/1203
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1203/labels{/name}
https://api.github.com/repos/psf/requests/issues/1203/comments
https://api.github.com/repos/psf/requests/issues/1203/events
https://github.com/psf/requests/issues/1203
11,192,965
MDU6SXNzdWUxMTE5Mjk2NQ==
1,203
Default value of allow_redirects in HEAD requests
{ "avatar_url": "https://avatars.githubusercontent.com/u/3646679?v=4", "events_url": "https://api.github.com/users/krawyoti/events{/privacy}", "followers_url": "https://api.github.com/users/krawyoti/followers", "following_url": "https://api.github.com/users/krawyoti/following{/other_user}", "gists_url": "https://api.github.com/users/krawyoti/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/krawyoti", "id": 3646679, "login": "krawyoti", "node_id": "MDQ6VXNlcjM2NDY2Nzk=", "organizations_url": "https://api.github.com/users/krawyoti/orgs", "received_events_url": "https://api.github.com/users/krawyoti/received_events", "repos_url": "https://api.github.com/users/krawyoti/repos", "site_admin": false, "starred_url": "https://api.github.com/users/krawyoti/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/krawyoti/subscriptions", "type": "User", "url": "https://api.github.com/users/krawyoti", "user_view_type": "public" }
[]
closed
true
null
[]
null
3
2013-02-20T11:10:01Z
2021-09-09T05:00:37Z
2013-02-25T10:31:22Z
NONE
resolved
In version 1.1.0 allow_redirects for HEAD defaults to True. According to the docs [1], though, the default should be False. [1] http://docs.python-requests.org/en/latest/user/quickstart/#redirection-and-history
{ "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/1203/reactions" }
https://api.github.com/repos/psf/requests/issues/1203/timeline
null
completed
null
null
false
[ "Here's the test case:\n\n```\n>>> import requests\n>>> requests.__version__\n'1.1.0'\n>>> requests.head('http://httpbin.org/redirect/2')\n<Response [200]>\n>>> _.history\n(<Response [302]>, <Response [302]>)\n```\n", "I know what the issue is. Also if you instantiate a Session first, this doesn't happen. Thanks!\n", "Thanks.\n" ]
https://api.github.com/repos/psf/requests/issues/1202
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1202/labels{/name}
https://api.github.com/repos/psf/requests/issues/1202/comments
https://api.github.com/repos/psf/requests/issues/1202/events
https://github.com/psf/requests/issues/1202
11,163,316
MDU6SXNzdWUxMTE2MzMxNg==
1,202
requests + gevent dns error
{ "avatar_url": "https://avatars.githubusercontent.com/u/1272836?v=4", "events_url": "https://api.github.com/users/oargon/events{/privacy}", "followers_url": "https://api.github.com/users/oargon/followers", "following_url": "https://api.github.com/users/oargon/following{/other_user}", "gists_url": "https://api.github.com/users/oargon/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/oargon", "id": 1272836, "login": "oargon", "node_id": "MDQ6VXNlcjEyNzI4MzY=", "organizations_url": "https://api.github.com/users/oargon/orgs", "received_events_url": "https://api.github.com/users/oargon/received_events", "repos_url": "https://api.github.com/users/oargon/repos", "site_admin": false, "starred_url": "https://api.github.com/users/oargon/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/oargon/subscriptions", "type": "User", "url": "https://api.github.com/users/oargon", "user_view_type": "public" }
[]
closed
true
null
[]
null
12
2013-02-19T17:39:39Z
2021-09-09T00:34:16Z
2013-02-26T04:53:07Z
NONE
resolved
I seem to be getting a strange error using requests and gevent with the below code snippet: running this under gunicorn and hitting this with: ab -n 5 -c 5 http://localhost:8000/ gives this output: ``` 2013-02-19 19:32:24 [40251] [INFO] Starting gunicorn 0.17.2 2013-02-19 19:32:24 [40251] [INFO] Listening at: http://127.0.0.1:8000 (40251) 2013-02-19 19:32:24 [40251] [INFO] Using worker: gevent 2013-02-19 19:32:24 [40256] [INFO] Booting worker with pid: 40256 HTTPConnectionPool(host='httpbin.org', port=80): Max retries exceeded with url: /delay/5 (Caused by <class 'gevent.dns.DNSError'>: [Errno 3] name does not exist) HTTPConnectionPool(host='httpbin.org', port=80): Max retries exceeded with url: /delay/5 (Caused by <class 'gevent.dns.DNSError'>: [Errno 3] name does not exist) HTTPConnectionPool(host='httpbin.org', port=80): Max retries exceeded with url: /delay/5 (Caused by <class 'gevent.dns.DNSError'>: [Errno 3] name does not exist) HTTPConnectionPool(host='httpbin.org', port=80): Max retries exceeded with url: /delay/5 (Caused by <class 'gevent.dns.DNSError'>: [Errno 3] name does not exist) <Response [200]> ``` ``` python from flask import Flask import requests app = Flask(__name__) @app.route('/') def hello(): try: r = requests.get('http://httpbin.org/delay/5') print r except Exception as e: print e.message return 'done' ``` these are the versions I'm using (all from pip install): ``` $ pip freeze Flask==0.9 Jinja2==2.6 Werkzeug==0.8.3 argparse==1.2.1 distribute==0.6.24 gevent==0.13.8 greenlet==0.4.0 gunicorn==0.17.2 requests==1.1.0 wsgiref==0.1.2 ```
{ "avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4", "events_url": "https://api.github.com/users/Lukasa/events{/privacy}", "followers_url": "https://api.github.com/users/Lukasa/followers", "following_url": "https://api.github.com/users/Lukasa/following{/other_user}", "gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Lukasa", "id": 1382556, "login": "Lukasa", "node_id": "MDQ6VXNlcjEzODI1NTY=", "organizations_url": "https://api.github.com/users/Lukasa/orgs", "received_events_url": "https://api.github.com/users/Lukasa/received_events", "repos_url": "https://api.github.com/users/Lukasa/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions", "type": "User", "url": "https://api.github.com/users/Lukasa", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/1202/reactions" }
https://api.github.com/repos/psf/requests/issues/1202/timeline
null
completed
null
null
false
[ "This looks like you're failing to resolve the domain name. Assuming you're running this on a box you have control over, can you try running `nslookup httpbin.org` from the command prompt?\n", "```\nServer: 127.0.0.1\nAddress: 127.0.0.1#53\n\nNon-authoritative answer:\nName: httpbin.org\nAddress: 23.21.109.151\n```\n\nThe call doesn't always fail with the DNS error.\nThe more connections I try to open at the same time the more likely it will fail.\n", "That's bizarre.\n\nThe failure seems to be to do with gevent's DNS stack, however, not Requests: we're simply wrapping the exception. To see if you can isolate it, try just calling `gevent.dns.resolve_ipv4('httpbin.org')` in each of your flask apps, to see if you can trigger the same exceptions.\n", "it appears that calling your suggested line just before calling requests makes the problem go away somehow.\nso this seem to work every call:\n\n``` python\ngevent.dns.resolve_ipv4('httpbin.org')\nr = requests.get('http://httpbin.org/delay/5')\n```\n", "Uh...that was not what I expected to happen.\n\nMy best guess is that gevent caches the DNS lookup from the first call so that the second one definitely succeeds, but that doesn't really explain very much. Hmm. I'll have to think about this.\n", "Not really explaining what you're seeing, but do you still get this error with newer gevents? ie. 1.0rc2 (https://github.com/SiteSupport/gevent/downloads)\n", "I didn't have the time to check this issue with a newer version of gevent on the same computer but I did run the same test on another computer and I didn't observe the same errors on the other computer.\n", "Sounds to me like this is somehow gevent's fault. =D Anyone disagree?\n", "Nope\n", "With no other objections, then, I'm closing this issue. =)\n", "Was your gevent grabed by `pip`?\n@oargon \nThis bug probably was result from the low version of the gevent.\nYou can refer this: http://jesiah.net/post/59711878434/gevent-problems-gevent-dns-dnserror\n", "I think I'm having the same problem with this. Going to try adding that resolve line to see if it makes it go away.\n" ]
https://api.github.com/repos/psf/requests/issues/1201
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1201/labels{/name}
https://api.github.com/repos/psf/requests/issues/1201/comments
https://api.github.com/repos/psf/requests/issues/1201/events
https://github.com/psf/requests/issues/1201
11,071,074
MDU6SXNzdWUxMTA3MTA3NA==
1,201
Should Session.send persist cookies across calls?
{ "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
{ "avatar_url": "https://avatars.githubusercontent.com/u/240830?v=4", "events_url": "https://api.github.com/users/sigmavirus24/events{/privacy}", "followers_url": "https://api.github.com/users/sigmavirus24/followers", "following_url": "https://api.github.com/users/sigmavirus24/following{/other_user}", "gists_url": "https://api.github.com/users/sigmavirus24/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/sigmavirus24", "id": 240830, "login": "sigmavirus24", "node_id": "MDQ6VXNlcjI0MDgzMA==", "organizations_url": "https://api.github.com/users/sigmavirus24/orgs", "received_events_url": "https://api.github.com/users/sigmavirus24/received_events", "repos_url": "https://api.github.com/users/sigmavirus24/repos", "site_admin": false, "starred_url": "https://api.github.com/users/sigmavirus24/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/sigmavirus24/subscriptions", "type": "User", "url": "https://api.github.com/users/sigmavirus24", "user_view_type": "public" }
[ { "avatar_url": "https://avatars.githubusercontent.com/u/240830?v=4", "events_url": "https://api.github.com/users/sigmavirus24/events{/privacy}", "followers_url": "https://api.github.com/users/sigmavirus24/followers", "following_url": "https://api.github.com/users/sigmavirus24/following{/other_user}", "gists_url": "https://api.github.com/users/sigmavirus24/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/sigmavirus24", "id": 240830, "login": "sigmavirus24", "node_id": "MDQ6VXNlcjI0MDgzMA==", "organizations_url": "https://api.github.com/users/sigmavirus24/orgs", "received_events_url": "https://api.github.com/users/sigmavirus24/received_events", "repos_url": "https://api.github.com/users/sigmavirus24/repos", "site_admin": false, "starred_url": "https://api.github.com/users/sigmavirus24/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/sigmavirus24/subscriptions", "type": "User", "url": "https://api.github.com/users/sigmavirus24", "user_view_type": "public" } ]
null
4
2013-02-16T16:53:18Z
2021-09-09T04:00:41Z
2013-04-01T18:31:24Z
CONTRIBUTOR
resolved
I'm noticing that cookies are not preserved across calls to `Session.send` calls as they would be with `Session.request`. Once again I'm left with the desire for the ability to use my own `Request` object subclass in the scope of `Session.request`; e.g. if it were a key worded arg all my problems would be solved. Below I've taken an example from the documentation and modified it to demonstrate that using `Session.send` directly eschews some nice functionality that you'd get "for free" using the `Session.request` method. However because I would like to make sure of my own `Request` subclass, without completely overloading `Session.request` on my own `Session` object or monkey patching Requests, I can't make use of `Session.request`. ``` python >>> req = requests.Request(method='get', url='http://httpbin.org/cookies/set/sessioncookie/123456789') >>> r = s.send(req.prepare()) >>> r.content '{\n "cookies": {\n "sessioncookie": "123456789"\n }\n}' >>> req = requests.Request(method='get', url='http://httpbin.org/cookies') >>> r = s.send(req.prepare()) >>> r.content '{\n "cookies": {}\n}' ```
{ "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/1201/reactions" }
https://api.github.com/repos/psf/requests/issues/1201/timeline
null
completed
null
null
false
[ "@kennethreitz this seems sensible to me. I won't send a Pull Request though until you say so.\n", "+1\n", "I'll work on this tomorrow night or Thursday\n", "Fixed by #1239\n" ]
https://api.github.com/repos/psf/requests/issues/1200
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1200/labels{/name}
https://api.github.com/repos/psf/requests/issues/1200/comments
https://api.github.com/repos/psf/requests/issues/1200/events
https://github.com/psf/requests/pull/1200
11,063,668
MDExOlB1bGxSZXF1ZXN0NDE3NjU2Ng==
1,200
Make sure session cookies do not overwrite explicit request cookies
{ "avatar_url": "https://avatars.githubusercontent.com/u/187133?v=4", "events_url": "https://api.github.com/users/gazpachoking/events{/privacy}", "followers_url": "https://api.github.com/users/gazpachoking/followers", "following_url": "https://api.github.com/users/gazpachoking/following{/other_user}", "gists_url": "https://api.github.com/users/gazpachoking/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/gazpachoking", "id": 187133, "login": "gazpachoking", "node_id": "MDQ6VXNlcjE4NzEzMw==", "organizations_url": "https://api.github.com/users/gazpachoking/orgs", "received_events_url": "https://api.github.com/users/gazpachoking/received_events", "repos_url": "https://api.github.com/users/gazpachoking/repos", "site_admin": false, "starred_url": "https://api.github.com/users/gazpachoking/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/gazpachoking/subscriptions", "type": "User", "url": "https://api.github.com/users/gazpachoking", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2013-02-16T06:00:17Z
2021-09-08T19:00:51Z
2013-02-20T06:50:10Z
CONTRIBUTOR
resolved
Cookies from a session were overwriting cookies explicitly defined in a request with that session. A couple minor changes as well: - Implement RequestsCookieJar.copy - Use RequestsCookieJar.update when merging cookiejars in a couple places
{ "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/1200/reactions" }
https://api.github.com/repos/psf/requests/issues/1200/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/1200.diff", "html_url": "https://github.com/psf/requests/pull/1200", "merged_at": "2013-02-20T06:50:10Z", "patch_url": "https://github.com/psf/requests/pull/1200.patch", "url": "https://api.github.com/repos/psf/requests/pulls/1200" }
true
[ ":cake:\n" ]
https://api.github.com/repos/psf/requests/issues/1199
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1199/labels{/name}
https://api.github.com/repos/psf/requests/issues/1199/comments
https://api.github.com/repos/psf/requests/issues/1199/events
https://github.com/psf/requests/pull/1199
11,042,455
MDExOlB1bGxSZXF1ZXN0NDE2Njg2Mw==
1,199
Use explicit scheme for proxies in the docs
{ "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
3
2013-02-15T16:39:13Z
2021-09-08T19:00:50Z
2013-02-19T13:40:15Z
CONTRIBUTOR
resolved
Issue #1192 tried to force users to provide a scheme for proxy urls. As this would break backwards compability change the docs instead.
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/1199/reactions" }
https://api.github.com/repos/psf/requests/issues/1199/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/1199.diff", "html_url": "https://github.com/psf/requests/pull/1199", "merged_at": "2013-02-19T13:40:15Z", "patch_url": "https://github.com/psf/requests/pull/1199.patch", "url": "https://api.github.com/repos/psf/requests/pulls/1199" }
true
[ ":+1:\n", "This should be accepted regardless of whether #1192 is accepted or not. +1 =)\n", "Thanks!\n" ]
https://api.github.com/repos/psf/requests/issues/1198
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1198/labels{/name}
https://api.github.com/repos/psf/requests/issues/1198/comments
https://api.github.com/repos/psf/requests/issues/1198/events
https://github.com/psf/requests/issues/1198
11,038,373
MDU6SXNzdWUxMTAzODM3Mw==
1,198
max-retries-exceeded exceptions are confusing
{ "avatar_url": "https://avatars.githubusercontent.com/u/51989?v=4", "events_url": "https://api.github.com/users/gabor/events{/privacy}", "followers_url": "https://api.github.com/users/gabor/followers", "following_url": "https://api.github.com/users/gabor/following{/other_user}", "gists_url": "https://api.github.com/users/gabor/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/gabor", "id": 51989, "login": "gabor", "node_id": "MDQ6VXNlcjUxOTg5", "organizations_url": "https://api.github.com/users/gabor/orgs", "received_events_url": "https://api.github.com/users/gabor/received_events", "repos_url": "https://api.github.com/users/gabor/repos", "site_admin": false, "starred_url": "https://api.github.com/users/gabor/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/gabor/subscriptions", "type": "User", "url": "https://api.github.com/users/gabor", "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
{ "avatar_url": "https://avatars.githubusercontent.com/u/240830?v=4", "events_url": "https://api.github.com/users/sigmavirus24/events{/privacy}", "followers_url": "https://api.github.com/users/sigmavirus24/followers", "following_url": "https://api.github.com/users/sigmavirus24/following{/other_user}", "gists_url": "https://api.github.com/users/sigmavirus24/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/sigmavirus24", "id": 240830, "login": "sigmavirus24", "node_id": "MDQ6VXNlcjI0MDgzMA==", "organizations_url": "https://api.github.com/users/sigmavirus24/orgs", "received_events_url": "https://api.github.com/users/sigmavirus24/received_events", "repos_url": "https://api.github.com/users/sigmavirus24/repos", "site_admin": false, "starred_url": "https://api.github.com/users/sigmavirus24/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/sigmavirus24/subscriptions", "type": "User", "url": "https://api.github.com/users/sigmavirus24", "user_view_type": "public" }
[ { "avatar_url": "https://avatars.githubusercontent.com/u/240830?v=4", "events_url": "https://api.github.com/users/sigmavirus24/events{/privacy}", "followers_url": "https://api.github.com/users/sigmavirus24/followers", "following_url": "https://api.github.com/users/sigmavirus24/following{/other_user}", "gists_url": "https://api.github.com/users/sigmavirus24/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/sigmavirus24", "id": 240830, "login": "sigmavirus24", "node_id": "MDQ6VXNlcjI0MDgzMA==", "organizations_url": "https://api.github.com/users/sigmavirus24/orgs", "received_events_url": "https://api.github.com/users/sigmavirus24/received_events", "repos_url": "https://api.github.com/users/sigmavirus24/repos", "site_admin": false, "starred_url": "https://api.github.com/users/sigmavirus24/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/sigmavirus24/subscriptions", "type": "User", "url": "https://api.github.com/users/sigmavirus24", "user_view_type": "public" } ]
null
39
2013-02-15T14:59:41Z
2018-12-27T14:25:44Z
2014-10-11T15:34:25Z
NONE
resolved
hi, for example: ``` >>> requests.get('http://localhost:1111') Traceback (most recent call last): File "<stdin>", line 1, in <module> File "requests/api.py", line 55, in get return request('get', url, **kwargs) File "requests/api.py", line 44, in request return session.request(method=method, url=url, **kwargs) File "requests/sessions.py", line 312, in request resp = self.send(prep, **send_kwargs) File "requests/sessions.py", line 413, in send r = adapter.send(request, **kwargs) File "requests/adapters.py", line 223, in send raise ConnectionError(e) requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=1111): Max retries exceeded with url: / (Caused by <class 'socket.error'>: [Errno 61] Connection refused) ``` (assuming nothing is listening on port 1111) the exception says "Max retries exceeded". i found this confusing because i did not specify any retry-related params. in fact, i am unable to find any documentation about specifying the retry-count. after going through the code, it seems that urllib3 is the underlying transport, and it is called with max_retries=0 (so in fact there are no retries). and requests simply wraps the exception. so it is understandable, but it confuses the end-user (end-developer)? i think something better should be done here, especially considering that it is very easy to get this error.
{ "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": 18, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 18, "url": "https://api.github.com/repos/psf/requests/issues/1198/reactions" }
https://api.github.com/repos/psf/requests/issues/1198/timeline
null
completed
null
null
false
[ "Requests wraps the exception for the users convenience. The original exception is part of the message although the Traceback is misleading. I'll think about how to improve this.\n", "I think need a auto retry to ignore few error\n", "I agree this is quite confusing. Requests never retries (it sets the retries=0 for urllib3's HTTPConnectionPool), so the error would be much more obvious without the HTTPConnectionPool/MaxRetryError stuff. I didn't realize requests used urllib3 till just now, when I had to dive into the source code of both libraries to help me figure out how many retries it was doing:\n\n```\nConnectionError(MaxRetryError(\"HTTPSConnectionPool(host='api.venere.com', port=443): \\\n Max retries exceeded with url: /xhi-1.0/services/XHI_HotelAvail.json (\\\n Caused by <class 'socket.error'>: [Errno 10054] \\\n An existing connection was forcibly closed by the remote host)\",),)\n```\n\nIdeally the exception would just look something like this:\n\n```\nConnectionError(<class 'socket.error'>: [Errno 10054] \\\n An existing connection was forcibly closed by the remote host))\n```\n", "That would be ideal. The issue is with wrapping these exceptions like we do. They make for a great API but a poor debugging experience. I have an idea for how to fix it though and preserve all the information \n", "We'd also need to consider the case where a user _does_ configure retries, in which case this exception is appropriate.\n", "@Lukasa, I'm not sure you do need to consider that -- Kenneth said [here](https://github.com/kennethreitz/requests/pull/1219) that Requests explicitly shouldn't support retries as part of its API.\n", "Right, but there's no way to prevent a user from actually doing so.\n\nMy plan, for the record, is to traverse as far downwards as possible to the lowest level exception and use that instead. The problem with @benhoyt 's example is that it seems the socket error exception is unavailable to us. (Just by looking at what he has pasted. I haven't tried to reproduce it yet and play with it.)\n", "@gabor 's example actually makes this easy to reproduce. Catching the exception that's raised, I did the following:\n\n``` pycon\n>>> e\nConnectionError(MaxRetryError(\"HTTPConnectionPool(host='localhost', port=1111): Max retries exceeded with url: / (Caused by <class 'socket.error'>: [Errno 111] Connection refused)\",),)\n>>> e.args\n(MaxRetryError(\"HTTPConnectionPool(host='localhost', port=1111): Max retries exceeded with url: / (Caused by <class 'socket.error'>: [Errno 111] Connection refused)\",),)\n>>> e.args[0].args\n(\"HTTPConnectionPool(host='localhost', port=1111): Max retries exceeded with url: / (Caused by <class 'socket.error'>: [Errno 111] Connection refused)\",)\n>>> e.args[0].args[0]\n\"HTTPConnectionPool(host='localhost', port=1111): Max retries exceeded with url: / (Caused by <class 'socket.error'>: [Errno 111] Connection refused)\"\n>>> isinstance(e.args[0].args[0], str)\nTrue\n```\n\nSo the best we could do is only use the message stored in `e.args[0].args[0]` which could potentially be confusing as well, but probably less so than what @benhoyt encountered. Either way, we will not parse error messages to try to get more or less details because that would just be utter insanity.\n", "@sigmavirus24, I agree string parsing in exceptions is a terrible idea. However, urllib3's MaxRetryError already exposes a `reason` attribute which contains the underlying exception (see [source code](https://github.com/kennethreitz/requests/blob/master/requests/packages/urllib3/exceptions.py#L38)). So you can get what you want with `e.args[0].reason`.\n\nSo continuing with the example above, `e.args[0].reason` is an instance of `socket.error`:\n\n```\n>>> requests.get('http://localhost:1111')\nTraceback (most recent call last):\n ...\nrequests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=1111): Max retries exceeded with url: / (Caused by <class 'socket.error'>: [Errno 10061] No connection could be made because the target machine actively refused it)\n>>> e = sys.last_value\n>>> e\nConnectionError(MaxRetryError(\"HTTPConnectionPool(host='localhost', port=1111): Max retries exceeded with url: / (Caused by <class 'socket.error'>: [Errno 10061] No connection could be made because the target machine actively refused it)\",),)\n>>> e.args[0]\nMaxRetryError(\"HTTPConnectionPool(host='localhost', port=1111): Max retries exceeded with url: / (Caused by <class 'socket.error'>: [Errno 10061] No connection could be made because the target machine actively refused it)\",)\n>>> e.args[0].reason\nerror(10061, 'No connection could be made because the target machine actively refused it')\n```\n", "Nice catch @benhoyt. I'm not as familiar with urllib3 as I would like to be. \n", "If it really looks as you showed ie.\n`requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=1111): Max retries exceeded with url: / (Caused by <class 'socket.error'>: [Errno 61] Connection refused)`\n\nthen I couldn't dream of better exception, really.\n", "@piotr-dobrogost, the main problem (for me) was the fact that it talks about \"max retries exceeded\", when there's no retrying involved at all. At first I thought it was the web service I was using saying that, so I contacted them. Then, digging further, I discovered this was a urllib3 quirk. So you can see the confusion.\n", "Have you missed `(Caused by <class 'socket.error'>: [Errno 61] Connection refused)` part of the exception?\n", "Yeah, you're right -- it's all there. But as I mentioned, I missed that at first, because the MaxRetryError is a red herring.\n", "This max retries thing always drives me mad. Does anybody mind if I dive in and see if I can't put a PR together to squash the retries message?\n\nI don't mean to appear out of nowhere, but I use requests tons in the Python work we do at Cloudant. We get pages that include the retries thing, and it can be a red herring.\n", "The answer is _maybe_.\n\nThe problem is that, while by default we don't perform any retries, you can configure Requests to automatically retry failed requests. In those situations, the `MaxRetryError` we've wrapped is totally reasonable. If you can come up with a solution that leaves the `MaxRetryError` in place when it ought to be, but removes it when you can guarantee no retry attempts have been made, we'll consider it. =)\n", "@Lukasa thanks, I'm refreshing myself on the backlog here. If I get a chance to dive in I will definitely reach out.\n", "It almost seems to me as if the right place for the change is in urllib3? MaxRetryError makes sense to raise in the context of automatic retries, but in the case of zero retries (perhaps the naive requests experience) it can be confusing.\n\nIn urllib3 it seems the confusing errors can be triggered [here](https://github.com/shazow/urllib3/blob/951ea12ba18103e5434e751246c0895e54fef211/urllib3/connectionpool.py#L530) via requests. It'd almost be nice to only raise a MaxRetryError when `retries==0 and max_retries!=0`. If `max_retries==0` instead raise a plain [RequestError](https://github.com/shazow/urllib3/blob/951ea12ba18103e5434e751246c0895e54fef211/urllib3/exceptions.py#L26) was raised instead.\n\nI see the urllib3 as used by requests exists in an included [package](https://github.com/kennethreitz/requests/tree/master/requests/packages/urllib3) -- just curious, why is that? Anyways, these were just a few ideas I wanted to toss out there. I'm still catching up on the codebases.\n", "Whether or not the fix belongs in urllib3 is totally down to @shazow. Given that urllib3 by default _does_ retry (3 times IIRC), it may be that he wants to keep urllib3's behaviour as is. Pinging him to get his input.\n\nWe vendor urllib3 to avoid some dependency issues. Essentially, it means we're always operating against a known version of urllib3. This has been discussed at excruciating length in #1384 and #1812 if you want the gritty details.\n", "Phew gritty but informative. @shazow these are just a few thoughts I had -- raising a RequestError rather than MaxRetryError as above. Really I think I better understand the MaxRetryError after checking out [urlopen](https://github.com/shazow/urllib3/blob/951ea12ba18103e5434e751246c0895e54fef211/urllib3/connectionpool.py#L382).\n\nDouble edit: Really even just a kwarg so one can `raise MaxRetryError(retries=0)` and alter the message on `retries==0`.\n", "How about a `retries=False` which would disable retries altogether and always raise the original exception instead of `MaxRetryError`?\n", "Being able to distinguish between asking urlopen for no retries and having it count down to 0 on the number of retries would be useful. It is jarring seeing the MaxRetryError when you did not ask for retries. \n", "If anyone would like to do a patch+test for this, it would be appreciated. :)\n", "@shazow great, I'd be game to if I can find the cycles. I'll ping if I have anything.\n", "\\o/\n", "^I was wondering whether there was any patch released ? This issue seems to be an year old.\n", "Not as far as I'm aware. =)\n", "`retries=False` should raise the original exception as of v1.9, no wrapping.\n", "@kevinburke thoughts?\n", "Need a little more time\n\n## \n\nKevin Burke\nphone: 925.271.7005 | twentymilliseconds.com\n\nOn Sun, Oct 5, 2014 at 10:37 AM, Ian Cordasco [email protected]\nwrote:\n\n> @kevinburke https://github.com/kevinburke thoughts?\n> \n> —\n> Reply to this email directly or view it on GitHub\n> https://github.com/kennethreitz/requests/issues/1198#issuecomment-57945403\n> .\n" ]
https://api.github.com/repos/psf/requests/issues/1197
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1197/labels{/name}
https://api.github.com/repos/psf/requests/issues/1197/comments
https://api.github.com/repos/psf/requests/issues/1197/events
https://github.com/psf/requests/pull/1197
11,020,701
MDExOlB1bGxSZXF1ZXN0NDE1NjgyNw==
1,197
add pypy to .travis.yml & setup.py
{ "avatar_url": "https://avatars.githubusercontent.com/u/642195?v=4", "events_url": "https://api.github.com/users/oczkers/events{/privacy}", "followers_url": "https://api.github.com/users/oczkers/followers", "following_url": "https://api.github.com/users/oczkers/following{/other_user}", "gists_url": "https://api.github.com/users/oczkers/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/oczkers", "id": 642195, "login": "oczkers", "node_id": "MDQ6VXNlcjY0MjE5NQ==", "organizations_url": "https://api.github.com/users/oczkers/orgs", "received_events_url": "https://api.github.com/users/oczkers/received_events", "repos_url": "https://api.github.com/users/oczkers/repos", "site_admin": false, "starred_url": "https://api.github.com/users/oczkers/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/oczkers/subscriptions", "type": "User", "url": "https://api.github.com/users/oczkers", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2013-02-15T00:47:49Z
2021-09-08T19:00:50Z
2013-02-15T04:52:04Z
CONTRIBUTOR
resolved
How about this?
{ "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/1197/reactions" }
https://api.github.com/repos/psf/requests/issues/1197/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/1197.diff", "html_url": "https://github.com/psf/requests/pull/1197", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/1197.patch", "url": "https://api.github.com/repos/psf/requests/pulls/1197" }
true
[ "pypy has never been an issue :)\n" ]
https://api.github.com/repos/psf/requests/issues/1196
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1196/labels{/name}
https://api.github.com/repos/psf/requests/issues/1196/comments
https://api.github.com/repos/psf/requests/issues/1196/events
https://github.com/psf/requests/issues/1196
11,002,242
MDU6SXNzdWUxMTAwMjI0Mg==
1,196
Ease painful migration to 1.x
{ "avatar_url": "https://avatars.githubusercontent.com/u/464726?v=4", "events_url": "https://api.github.com/users/millerdev/events{/privacy}", "followers_url": "https://api.github.com/users/millerdev/followers", "following_url": "https://api.github.com/users/millerdev/following{/other_user}", "gists_url": "https://api.github.com/users/millerdev/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/millerdev", "id": 464726, "login": "millerdev", "node_id": "MDQ6VXNlcjQ2NDcyNg==", "organizations_url": "https://api.github.com/users/millerdev/orgs", "received_events_url": "https://api.github.com/users/millerdev/received_events", "repos_url": "https://api.github.com/users/millerdev/repos", "site_admin": false, "starred_url": "https://api.github.com/users/millerdev/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/millerdev/subscriptions", "type": "User", "url": "https://api.github.com/users/millerdev", "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
4
2013-02-14T16:06:52Z
2021-09-09T04:00:44Z
2013-03-30T00:17:43Z
NONE
resolved
At my company we have recently migrated to 1.1.0, and I have to say it's been much more painful than I expected. Finding what has changed since 0.x has been a nightmare. I have not been able to find good documentation on exactly what has changed, and the commit messages are atrocious. I don't see a clear way to move forward short of reviewing the diff of every single commit, and that's too time consuming. Please add a CHANGES.txt file to the project and religiously document every single API change, especially the backward-incompatible ones. I love requests, it's much better than the alternatives. But the instability of the API and lack of documentation is making it hard to upgrade. Providing a path forward for existing users is a critical feature.
{ "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/1196/reactions" }
https://api.github.com/repos/psf/requests/issues/1196/timeline
null
completed
null
null
false
[ "I'm sorry you found upgrading to v1.0.0 painful. You'll be pleased to know that as of v1.0.0 we have entered a [feature freeze](http://docs.python-requests.org/en/latest/dev/todo/#feature-freeze), which should cause the API to remain unchanged from now on.\n\nAs to having a CHANGES.txt file, I agree that we could better document the changes made in v1.0.0. At some point over the next couple of days I'll sit down and enumerate the whole set of changes. We may not add a CHANGES.txt file, but I'll document it somewhere, even if it's only on my blog.\n", "Thank you! Sorry for coming across so harshly this morning. I was annoyed because I had spent quite a bit of time researching what had changed before upgrading (and came away feeling like I did not really know what had changed). Today I ran into what I thought was an API change that I had missed. When the smoke cleared I realized that I was getting confused between the Request/Response object APIs of Requests and WebOb.\n", "It's not a problem at all, everyone's entitled to a bad mood now and then. =)\n", "With #1231 merged, I'm closing this without prejudice (i.e., if we have to re-open it, I'm okay with that)\n" ]
https://api.github.com/repos/psf/requests/issues/1195
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1195/labels{/name}
https://api.github.com/repos/psf/requests/issues/1195/comments
https://api.github.com/repos/psf/requests/issues/1195/events
https://github.com/psf/requests/issues/1195
10,992,760
MDU6SXNzdWUxMDk5Mjc2MA==
1,195
Please, do not hold development of requests with feature freeze.
{ "avatar_url": "https://avatars.githubusercontent.com/u/92239?v=4", "events_url": "https://api.github.com/users/piotr-dobrogost/events{/privacy}", "followers_url": "https://api.github.com/users/piotr-dobrogost/followers", "following_url": "https://api.github.com/users/piotr-dobrogost/following{/other_user}", "gists_url": "https://api.github.com/users/piotr-dobrogost/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/piotr-dobrogost", "id": 92239, "login": "piotr-dobrogost", "node_id": "MDQ6VXNlcjkyMjM5", "organizations_url": "https://api.github.com/users/piotr-dobrogost/orgs", "received_events_url": "https://api.github.com/users/piotr-dobrogost/received_events", "repos_url": "https://api.github.com/users/piotr-dobrogost/repos", "site_admin": false, "starred_url": "https://api.github.com/users/piotr-dobrogost/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/piotr-dobrogost/subscriptions", "type": "User", "url": "https://api.github.com/users/piotr-dobrogost", "user_view_type": "public" }
[]
closed
true
null
[]
null
4
2013-02-14T11:59:49Z
2021-09-09T05:00:40Z
2013-02-14T12:07:32Z
NONE
resolved
I propose to make special branch `freeze` which would only get bug fixes and continue to develop requests in the master branch as always.
{ "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/1195/reactions" }
https://api.github.com/repos/psf/requests/issues/1195/timeline
null
completed
null
null
false
[ "The intention is to bring development of new features in Requests to a halt and aim for inclusion in the standard library. This is fundamentally in opposition to the addition of new features, so it simply won't happen. Sorry.\n", "@Lukasa \n\nWhat's wrong with designating one branch, where development of new features could be halted without hindering development in other branches?\n", "HTTP is a nice and concise scope. The most important thing is to learn to say no.\n", "+1.\n\nWe don't need to be libcURL for Python, and to be able to do everything. We need to be good at doing HTTP for 80% of the use cases. Anyone who needs the remaining 20% knows enough about HTML to be able to either extend the transport adapters/sessions or should use urllib2. In this sense Requests is a subscriber to the philosophy 'worse is better'.\n" ]
https://api.github.com/repos/psf/requests/issues/1194
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1194/labels{/name}
https://api.github.com/repos/psf/requests/issues/1194/comments
https://api.github.com/repos/psf/requests/issues/1194/events
https://github.com/psf/requests/pull/1194
10,984,979
MDExOlB1bGxSZXF1ZXN0NDEzODk5OQ==
1,194
Allow RequestsCookieJar to be updated with cookies from a CookieJar
{ "avatar_url": "https://avatars.githubusercontent.com/u/187133?v=4", "events_url": "https://api.github.com/users/gazpachoking/events{/privacy}", "followers_url": "https://api.github.com/users/gazpachoking/followers", "following_url": "https://api.github.com/users/gazpachoking/following{/other_user}", "gists_url": "https://api.github.com/users/gazpachoking/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/gazpachoking", "id": 187133, "login": "gazpachoking", "node_id": "MDQ6VXNlcjE4NzEzMw==", "organizations_url": "https://api.github.com/users/gazpachoking/orgs", "received_events_url": "https://api.github.com/users/gazpachoking/received_events", "repos_url": "https://api.github.com/users/gazpachoking/repos", "site_admin": false, "starred_url": "https://api.github.com/users/gazpachoking/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/gazpachoking/subscriptions", "type": "User", "url": "https://api.github.com/users/gazpachoking", "user_view_type": "public" }
[]
closed
true
null
[]
null
4
2013-02-14T06:07:44Z
2021-09-08T19:00:50Z
2013-02-15T06:42:50Z
CONTRIBUTOR
resolved
This would allow cookies from external CookieJars, or other RequestsCookieJars to be merged in with a RequestsCookieJar while preserving all domain and other cookie info.
{ "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/1194/reactions" }
https://api.github.com/repos/psf/requests/issues/1194/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/1194.diff", "html_url": "https://github.com/psf/requests/pull/1194", "merged_at": "2013-02-15T06:42:50Z", "patch_url": "https://github.com/psf/requests/pull/1194.patch", "url": "https://api.github.com/repos/psf/requests/pulls/1194" }
true
[ "This would prevent calls like https://github.com/kennethreitz/requests/blob/master/requests/sessions.py#L158 (and the one on line 163) from losing domain information on the cookies, as well as let external CookieJars be merged into a requests session's cookies cleanly.\n", "This is definitely a must have. +10\n", "I also just removed ability to do `requestscookiejar[somecookie]` this will not be needed if update supports CookieJars directly.\n\nOn another note, there may also be an issue with sessions merging cookies into requests: https://github.com/kennethreitz/requests/blob/master/requests/sessions.py#L254-L256 It appears that session cookies will overwrite cookies specified for the request right now (that have the same domain/path/key.)\n", "thanks!\n" ]
https://api.github.com/repos/psf/requests/issues/1193
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1193/labels{/name}
https://api.github.com/repos/psf/requests/issues/1193/comments
https://api.github.com/repos/psf/requests/issues/1193/events
https://github.com/psf/requests/pull/1193
10,983,622
MDExOlB1bGxSZXF1ZXN0NDEzODM0OA==
1,193
Throw more informative exceptions.
{ "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
10
2013-02-14T04:23:44Z
2021-09-08T19:00:49Z
2013-02-20T07:10:45Z
MEMBER
resolved
In #1188 @brandon-rhodes pointed out that we throw some uninformative exceptions when problems arise in urllib3. This would catch the exception and wrap it in a Requests exception, then rethrow it with its original traceback. I'm on the fence about whether we should do one of the following: 1. Create a new Requests exception for this case (`requests.exceptions.TransportError`?) 2. Import urllib3's exceptions into `requests.exceptions` and export them as our own? (Not great) Opinions welcome (@sigmavirus24?)
{ "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/1193/reactions" }
https://api.github.com/repos/psf/requests/issues/1193/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/1193.diff", "html_url": "https://github.com/psf/requests/pull/1193", "merged_at": "2013-02-20T07:10:45Z", "patch_url": "https://github.com/psf/requests/pull/1193.patch", "url": "https://api.github.com/repos/psf/requests/pulls/1193" }
true
[ "+10\n", "So I just went ahead and did number 1.\n", "Ugh, got some compatibility issues here. This will be problematic, give me some time to work on it.\n", "So it turns out that there is no simple way to get around this Syntax Error. `six` has a good solution, but we currently don't vendor it in. The way I see it, we have three options:\n1. Use the version of `six.py` in urllib3. This is bad: `six.py` is an implementation detail in urllib3, which is itself an implementation detail of Requests. -1\n2. Add the bit of `six.py` that we need to our `compat.py`. This has a minimal effect on our code, but is a bit weird. +0\n3. Vendor in a copy of `six.py`. This is the cleanest, but adds a whole new Python file from which we only need one line. Probably a small perf hit too. +0\n\n@kennethreitz, @sigmavirus24: I don't know which is best from options 2 and 3. Thoughts?\n", "I think we should leave things as-is for now.\n", "In that case, we can't really do anything to improve these exceptions. =) Closing this.\n", "I think being as transparent as possible is a good strategy — having the underlaying SSL errors bubble up, for example, is a great pattern to follow.\n", "Oh, ok. Lemme rewrite this PR to do that instead. =)\n", "Raise e :)\n", "Pretty sure the blank `raise` simply rethrows the last caught exception, so should be fine. =)\n" ]
https://api.github.com/repos/psf/requests/issues/1192
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1192/labels{/name}
https://api.github.com/repos/psf/requests/issues/1192/comments
https://api.github.com/repos/psf/requests/issues/1192/events
https://github.com/psf/requests/pull/1192
10,983,138
MDExOlB1bGxSZXF1ZXN0NDEzODEyNA==
1,192
Proxies without schemes might want to except.
{ "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
{ "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
9
2013-02-14T03:49:45Z
2021-09-08T23:06:11Z
2013-02-25T10:31:40Z
MEMBER
resolved
:warning: **CAUTION**: Breaking change. We may not want to take this. :warning: This is in relation to #1182. Currently we guess what scheme to use on proxies if that scheme is not provided. This _usually_ works, but sometimes fails in unexpected ways. This would require users to be explicit about what scheme they want to use to contact the proxy. This **will** break some users' code, without question. I am open to leaving the current behaviour in place, as it's not wrong, just a bit odd.
{ "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/1192/reactions" }
https://api.github.com/repos/psf/requests/issues/1192/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/1192.diff", "html_url": "https://github.com/psf/requests/pull/1192", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/1192.patch", "url": "https://api.github.com/repos/psf/requests/pulls/1192" }
true
[ "+0.5 I'm never for breaking user's old code in a minor version, but I am most certainly for providing better exceptions.\n", "Exactly my view. =) I thought I'd open this PR so we can see what it entails, but I think we'll probably not fix what isn't broken. Just want to see what @kennethreitz thinks.\n", "Considering my proxy code was already broken in one of the past few updates, I believe this exception would be very helpful in eliminating cryptic errors and letting the user know how to fix it. Any changes that users would need to make would be simple, anyways.\n", "The following is a proposal for future releases:\n\nReplace the parameter `proxies` of type dict with another one `proxy` which takes a string.\nPeople in need of different proxies can use transportadapters after all.\n\nI don't know (but assume) that deprecating the old parameter and introducing the new one isn't possible at this point.\nThis way old code won't break but new code would be cleaner. (When does one need different proxies after all)\nThis new api could then get rid of the guesswork.\n", "@t-8ch: Unfortunately, changes to the API are not allowed in minor version bumps, and we're not going to go to v2.0.0 for quite a while. Additionally, I would argue that the [feature freeze](http://docs.python-requests.org/en/latest/dev/todo/#feature-freeze) means that the API is essentially frozen as well.\n", "This was meant as a proposal for a future version, after the feature freeze.\nI think the dict argument was a leftover from before transportadapters and is not needed anymore.\nI also thinks it's very uncommon to use two different proxies (given the fact, that https proxies don't work at all at the moment, see shazow/urllib3#139)\n", "@t-8ch: Requests' feature freeze is perpetual, there is no plan to exit the freeze. =) Your arguments are totally understandable, but the API is unlikely to be changed in any way from now on, and certainly not as major a change as that one.\n", "FWIW, I believe that HTTPS proxies will work once fine once https://github.com/shazow/urllib3/pull/139 is merged. cc @t-8ch \n", "@wolever I don't doubt this! I only doubt the commonness of the need for two distinct proxies. Anyways I'll shut up now as I totally understand the decision.\n" ]
https://api.github.com/repos/psf/requests/issues/1191
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1191/labels{/name}
https://api.github.com/repos/psf/requests/issues/1191/comments
https://api.github.com/repos/psf/requests/issues/1191/events
https://github.com/psf/requests/pull/1191
10,982,903
MDExOlB1bGxSZXF1ZXN0NDEzNzk5OA==
1,191
Remove the line that likely causes the issue
{ "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
8
2013-02-14T03:34:10Z
2021-09-08T19:00:49Z
2013-02-17T22:56:41Z
CONTRIBUTOR
resolved
Fixes #1189 as confirmed by @Lukasa
{ "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/1191/reactions" }
https://api.github.com/repos/psf/requests/issues/1191/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/1191.diff", "html_url": "https://github.com/psf/requests/pull/1191", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/1191.patch", "url": "https://api.github.com/repos/psf/requests/pulls/1191" }
true
[ "+1\n", "+1\n", "Actually, seems like this breaks persisting cookies across sessions:\n\nUsing the first example in [Session Objects Doc](http://docs.python-requests.org/en/latest/user/advanced/#session-objects):\n\n``` python\nimport requests\n\ns = requests.Session()\n\ns.get('http://httpbin.org/cookies/set?sessioncookie=123456789')\nr = s.get(\"http://httpbin.org/cookies\")\n\nprint r.text\n```\n\n@ `77804d7`\n\n```\n{\n \"cookies\": {}\n}\n```\n", "Yeah. I should have seen that on the test failure.\n", "@nathankot thanks for catching this. Could you try with the latest commit added to this PR?\n", "@sigmavirus24 looks good :)\n", ":metal:\n", "#1189 has been fixed in another way, so this pull should no longer be needed.\n" ]
https://api.github.com/repos/psf/requests/issues/1190
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1190/labels{/name}
https://api.github.com/repos/psf/requests/issues/1190/comments
https://api.github.com/repos/psf/requests/issues/1190/events
https://github.com/psf/requests/pull/1190
10,979,394
MDExOlB1bGxSZXF1ZXN0NDEzNjEzNw==
1,190
Pass user options to hooks
{ "avatar_url": "https://avatars.githubusercontent.com/u/826?v=4", "events_url": "https://api.github.com/users/mkomitee/events{/privacy}", "followers_url": "https://api.github.com/users/mkomitee/followers", "following_url": "https://api.github.com/users/mkomitee/following{/other_user}", "gists_url": "https://api.github.com/users/mkomitee/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/mkomitee", "id": 826, "login": "mkomitee", "node_id": "MDQ6VXNlcjgyNg==", "organizations_url": "https://api.github.com/users/mkomitee/orgs", "received_events_url": "https://api.github.com/users/mkomitee/received_events", "repos_url": "https://api.github.com/users/mkomitee/repos", "site_admin": false, "starred_url": "https://api.github.com/users/mkomitee/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/mkomitee/subscriptions", "type": "User", "url": "https://api.github.com/users/mkomitee", "user_view_type": "public" }
[]
closed
true
null
[]
null
20
2013-02-14T00:26:08Z
2021-09-08T19:00:48Z
2013-03-02T21:04:01Z
CONTRIBUTOR
resolved
Hooks sometimes have to send requests (e.g. when responding to a 401 during authentication). All keyword arguments should be passed along when hooks are dispatched so that if a user wanted to use a timeout, stream, specify a cert location with the verify flag, etc, their specification can be followed.
{ "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/1190/reactions" }
https://api.github.com/repos/psf/requests/issues/1190/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/1190.diff", "html_url": "https://github.com/psf/requests/pull/1190", "merged_at": "2013-03-02T21:04:01Z", "patch_url": "https://github.com/psf/requests/pull/1190.patch", "url": "https://api.github.com/repos/psf/requests/pulls/1190" }
true
[ "The second commit adds a test which tests the previously broken behavior where flags like timeout, stream, verify, etc were lost when we used authentication. It fails without the patch.\n\nif it's not clear, this tests by calling read() with stream turned on and off. If stream is off, then the content is read ahead of time by the adapter so further reads will return an empty string. If stream is on then the content will not be read ahead of time by the adapter, so the read in the test will receive the actual content. Without the patch the content is consumed by the adapter ahead of time regardless of the state of the stream flag.\n", "This is going to break even the built-in authentication methods which I'm guessing are what's causing the tests to fail.\n", "I already patched the built-in authentication methods. The tests are failing because in my new test response.raw.read() returns a str for me (python 2.7 and 2.6) and a bytes object on 3.x. This is a problem with my test, not the patch itself. I'll see if I can figure out a way to make the test py3k compatible.\n", "FYI, If it would help get this accepted (it's fixing what I'd consider a serious bug) I'd be more than happy to contribute the necessary changes to requests-oauthlib, requests-ntlm, and requests-kerberos.\n", "I'm installing python 3 because I haven't had to deal with byte arrays before.\n", "That should do it, and it still works in 2.7.\n", "come on travis, ...\n", "BTW, I tested it under python-2.7, python-3.3, and pypy. If it doesn't pass this time I'll be surprised.\n", "Did Travis completely miss that last commit?\n", "Just trying to trigger Travis\n", "Huzzah!\n", "Does anyone have any suggestions as to how we can jump-start a conversation here? I know it changes the hook api, but it's necessary to actually do what the user requests.\n", "Sorry this has been quiet, but Kenneth is the only person who merges PRs around here, so until he gets some time this won't move forward. He's crazy-busy (and unwell at the moment, I think), so we'll just have to wait. =)\n\nFor what it's worth, I'm +1 on this, hooks should have access to the full range of information.\n", "Aha, I didn't expect a quick merge. I was just surprised there were no comments at all. Thanks for the info. I hope all is well.\n", "I need to think about this. :)\n", "I completely agree that this ensures what the user wants is done, it just makes me wonder if there's a better way of implementing it. We're passing all of that information around a couple times now.\n", "Stick it on the session & pass that?\n\nOn Mon, Feb 25, 2013 at 9:35 AM, Ian Cordasco [email protected]\nwrote:\n\n> ## I completely agree that this ensures what the user wants is done, it just makes me wonder if there's a better way of implementing it. We're passing all of that information around a couple times now.\n> \n> Reply to this email directly or view it on GitHub:\n> https://github.com/kennethreitz/requests/pull/1190#issuecomment-14044761\n", "They don't quite belong on the session. I would think they belong on the Request, but the request object describes the data we send, not the connection. What these do is describe the connection and response. I'll think about it some more\n", "I'm liking this a lot.\n", ":sparkles: :cake: :sparkles:\n" ]
https://api.github.com/repos/psf/requests/issues/1189
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1189/labels{/name}
https://api.github.com/repos/psf/requests/issues/1189/comments
https://api.github.com/repos/psf/requests/issues/1189/events
https://github.com/psf/requests/issues/1189
10,977,015
MDU6SXNzdWUxMDk3NzAxNQ==
1,189
Multiple Cookies on Redirect
{ "avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4", "events_url": "https://api.github.com/users/Lukasa/events{/privacy}", "followers_url": "https://api.github.com/users/Lukasa/followers", "following_url": "https://api.github.com/users/Lukasa/following{/other_user}", "gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Lukasa", "id": 1382556, "login": "Lukasa", "node_id": "MDQ6VXNlcjEzODI1NTY=", "organizations_url": "https://api.github.com/users/Lukasa/orgs", "received_events_url": "https://api.github.com/users/Lukasa/received_events", "repos_url": "https://api.github.com/users/Lukasa/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions", "type": "User", "url": "https://api.github.com/users/Lukasa", "user_view_type": "public" }
[ { "color": "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
8
2013-02-13T23:09:02Z
2021-09-09T05:00:39Z
2013-02-17T01:17:07Z
MEMBER
resolved
After updating `master` to f73bda06e9, I find that some requests raise a `CookieConflictError`. Specifically, any page that sets a cookie on a 302 and then redirects to a page that sets the same cookie raises a `CookieConflictError`. Steps To Reproduce: 1. Update Requests to the version shown above. 2. Make a request to http://www.google.com/ from anywhere outside the US. Expected Behaviour: Requests should return a 200 OK with the 302 in the history. Actual Behaviour: ``` python >>> import requests >>> r = requests.get('http://www.google.com/') Traceback (most recent call last): File "<stdin>", line 1, in <module> File "requests/api.py", line 55, in get return request('get', url, **kwargs) File "requests/api.py", line 44, in request return session.request(method=method, url=url, **kwargs) File "requests/sessions.py", line 312, in request resp = self.send(prep, **send_kwargs) File "requests/sessions.py", line 426, in send history = [resp for resp in gen] if allow_redirects else [] File "requests/sessions.py", line 163, in resolve_redirects resp.cookies.update(cookiejar) File "venv/lib/python2.7/_abcoll.py", line 494, in update self[key] = other[key] File "requests/cookies.py", line 246, in __getitem__ return self._find_no_duplicates(name) File "requests/cookies.py", line 285, in _find_no_duplicates raise CookieConflictError('There are multiple cookies with name, %r' % (name)) requests.cookies.CookieConflictError: There are multiple cookies with name, 'NID' ``` This is very clearly related to the changes made in #1180.
{ "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/1189/reactions" }
https://api.github.com/repos/psf/requests/issues/1189/timeline
null
completed
null
null
false
[ "/cc @sigmavirus24 \n", "Damn. I was worried the last line might cause troubles but I couldn't find websites like this other than GitHub and didn't think to test it. (I thought GitHub may have been an abnormality.)\n\nCan you try removing the last line of the `SessionRedirectMixin.resolve_redirect` method? I can't get Google to produce that error.\n", "@Lukasa you can also try sigmavirus24/requests @fix1189\n", "That works like a charm. =) PR time!\n", "I should have turned back my paranoia ;).\n", "I'm wondering if #1194 fixed this. I couldn't replicate the original issue though, so I'm not sure.\nEDIT: Actually I'm fairly confident `_find_no_duplicates` should't be running anymore, so the cookie should just be overwritten now, which seems to be the proper course of action, and #1191 should no longer be needed.\n", "I'll test this at some point soon.\n", "@gazpachoking, you're quite right, this has been resolved. Thanks guys! \n" ]
https://api.github.com/repos/psf/requests/issues/1188
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1188/labels{/name}
https://api.github.com/repos/psf/requests/issues/1188/comments
https://api.github.com/repos/psf/requests/issues/1188/events
https://github.com/psf/requests/issues/1188
10,974,150
MDU6SXNzdWUxMDk3NDE1MA==
1,188
ClosedPoolError gets shadowed by a false Timeout error
{ "avatar_url": "https://avatars.githubusercontent.com/u/166162?v=4", "events_url": "https://api.github.com/users/brandon-rhodes/events{/privacy}", "followers_url": "https://api.github.com/users/brandon-rhodes/followers", "following_url": "https://api.github.com/users/brandon-rhodes/following{/other_user}", "gists_url": "https://api.github.com/users/brandon-rhodes/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/brandon-rhodes", "id": 166162, "login": "brandon-rhodes", "node_id": "MDQ6VXNlcjE2NjE2Mg==", "organizations_url": "https://api.github.com/users/brandon-rhodes/orgs", "received_events_url": "https://api.github.com/users/brandon-rhodes/received_events", "repos_url": "https://api.github.com/users/brandon-rhodes/repos", "site_admin": false, "starred_url": "https://api.github.com/users/brandon-rhodes/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/brandon-rhodes/subscriptions", "type": "User", "url": "https://api.github.com/users/brandon-rhodes", "user_view_type": "public" }
[]
closed
true
null
[]
null
15
2013-02-13T21:58:40Z
2021-09-08T23:07:57Z
2013-08-15T07:57:12Z
NONE
resolved
A customer in whose product I used Requests complained that, on Windows, my program would immediately die with a series of `Timeout` exceptions printed to the logs: ``` ... r = session.get(url, headers=headers, stream=True) File "...\venv\lib\site-packages\requests\sessions.py", line 310, in get return self.request('GET', url, **kwargs) File "...\venv\lib\site-packages\requests\sessions.py", line 279, in request resp = self.send(prep, stream=stream, timeout=timeout, verify=verify, cert=cert, proxies=proxies) File "...\venv\lib\site-packages\requests\sessions.py", line 374, in send r = adapter.send(request, **kwargs) File "...\venv\lib\site-packages\requests\adapters.py", line 217, in send raise Timeout('Request timed out.') Timeout: Request timed out. ``` This seemed odd, since timeouts usually take — well — _time_ to occur, instead of happening immediately when a program starts! So I looked at the code that was raising the `Timeout`, which is in `adapters.py`: ``` except (_SSLError, _HTTPError) as e: if isinstance(e, _SSLError): raise SSLError(e) elif isinstance(e, TimeoutError): raise Timeout(e) else: raise Timeout('Request timed out.') ``` The last line of this stanza struck me as suspicious: is it _really_ the case that all SSL and HTTP errors can be explained as timeouts? So I had my customer change the last line to simply the statement `raise`, so that I could see the exception that was being hidden by the `Timeout` and this is what we saw: ``` r = session.get(url, headers=headers, stream=True) File "...\venv\lib\site-packages\requests\sessions.py", line 310, in get return self.request('GET', url, **kwargs) File "...\venv\lib\site-packages\requests\sessions.py", line 279, in request resp = self.send(prep, stream=stream, timeout=timeout, verify=verify, cert=cert, proxies=proxies) File "...\venv\lib\site-packages\requests\sessions.py", line 374, in send r = adapter.send(request, **kwargs) File "...\venv\lib\site-packages\requests\adapters.py", line 174, in send timeout=timeout File "...\venv\lib\site-packages\requests\packages\urllib3\connectionpool.py", line 417, in urlopen conn = self._get_conn(timeout=pool_timeout) File "...\venv\lib\site-packages\requests\packages\urllib3\connectionpool.py", line 218, in _get_conn raise ClosedPoolError(self, "Pool is closed.") ``` I have no idea what this error means, but it went away when instead of having several threads share the same `Session` we instead had each thread create its own `Session` for its use alone — I suppose that I should open another ticket about that, reporting that session objects are not, in fact, thread-safe in Python under Windows, but give this pool-is-closed exception instead?
{ "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/1188/reactions" }
https://api.github.com/repos/psf/requests/issues/1188/timeline
null
completed
null
null
false
[ "I don't think the Session is thread-safe under any OS.\n\nI do think the blanket 'Timeout' exception is pretty unwise, we can probably handle the urllib3 exceptions better. Let me take a look and see.\n", "@Lukasa In that case an update to the documentation is warranted—the front page of the project says “thread-safe” which I assumed meant, you know, the whole project. :)\n", "@brandon-rhodes has a point. I also have to wonder why we mask those exceptions.\n", "Session should absolutely be thread-safe.\n", "I agree it should be, but is it? For instance, Sessions have the `close()` method, which is clearly not thread safe.\n", "Well, close should almost never be used. :)\n", "I agree, but unfortunately both the `HTTPAdapter` and the `HTTPConnectionPool` underlying the Sessions also have close methods.\n\nThis key problem, I suspect, is actually in the way `HTTPConnectionPool` objects work. I can take a look into it if you like. =)\n", "@shazow, we need your help!\n", "Actually, looking at this, the only way this could happen is if `PoolManager.clear()` gets called. We only do that from the `HTTPAdapter.close()` method, and we only hit _that_ if you call `Session.close()`. @brandon-rhodes, do you ever call `Session.close()` or use the Session as a context manager?\n", "Sorry I'm off the grid until Tuesday.\n- Sent from rogue wilderness wifi\n On Feb 13, 2013 8:34 PM, \"Kenneth Reitz\" [email protected] wrote:\n\n> @shazow https://github.com/shazow, we need your help!\n> \n> —\n> Reply to this email directly or view it on GitHubhttps://github.com/kennethreitz/requests/issues/1188#issuecomment-13532802.\n", "@brandon-rhodes any updates? Changes made to address this (in part) were included in 1.2.0\n", "This issue is many many months old, so I'm closing unless Brandon comes back and indicates that this is still a problem.\n", "No, I do not have any more information to offer; because Requests could not be used safely in a threaded program on Windows, and because we needed to control pooling ourselves when doing NTLM (since once NTLM authentication has taken place, connections have to be removed from the \"host X\" pool and added to a \"user Y on host X\" pool), Requests was not a good fit for our project. Thanks for addressing this issue, though, and I'll certainly comment here if I ever encounter this issue again either way!\n", "FWIW, the root cause of this was most likely the race condition fixed in shazow/urllib3/pull/204. Those changes were included in requests as of 9f119ee420318c113094e15bc5e6d7dbda5c98b0 (v2.0.0).\nHow do I know? I have still been using v1.2.3 and encountered the same problem.\n", "Many thanks @ddoskind!\n" ]
https://api.github.com/repos/psf/requests/issues/1187
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1187/labels{/name}
https://api.github.com/repos/psf/requests/issues/1187/comments
https://api.github.com/repos/psf/requests/issues/1187/events
https://github.com/psf/requests/pull/1187
10,970,636
MDExOlB1bGxSZXF1ZXN0NDEzMTcwNQ==
1,187
Fixed names of exceptions pertaining to url scheme.
{ "avatar_url": "https://avatars.githubusercontent.com/u/92239?v=4", "events_url": "https://api.github.com/users/piotr-dobrogost/events{/privacy}", "followers_url": "https://api.github.com/users/piotr-dobrogost/followers", "following_url": "https://api.github.com/users/piotr-dobrogost/following{/other_user}", "gists_url": "https://api.github.com/users/piotr-dobrogost/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/piotr-dobrogost", "id": 92239, "login": "piotr-dobrogost", "node_id": "MDQ6VXNlcjkyMjM5", "organizations_url": "https://api.github.com/users/piotr-dobrogost/orgs", "received_events_url": "https://api.github.com/users/piotr-dobrogost/received_events", "repos_url": "https://api.github.com/users/piotr-dobrogost/repos", "site_admin": false, "starred_url": "https://api.github.com/users/piotr-dobrogost/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/piotr-dobrogost/subscriptions", "type": "User", "url": "https://api.github.com/users/piotr-dobrogost", "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
5
2013-02-13T20:28:24Z
2021-09-08T23:06:10Z
2013-02-14T01:13:13Z
NONE
resolved
MissingSchema -> MissingScheme, InvalidSchema -> InvalidScheme see t-8ch's comment in issue #1182
{ "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/1187/reactions" }
https://api.github.com/repos/psf/requests/issues/1187/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/1187.diff", "html_url": "https://github.com/psf/requests/pull/1187", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/1187.patch", "url": "https://api.github.com/repos/psf/requests/pulls/1187" }
true
[ "This is a backwards incompatible change.\n", "@kennethreitz we could maintain backwards compatibility by keeping the old exceptions and sub-classing them for the new ones. It's ugly and I don't like it, but we would be able to raise \"properly\" named exceptions whilst maintaining backwards compatibility.\n", "It looks like it's not only feature freeze but bug freeze as well :)\n", "Werkzeug does the following to keep backwards compatibility when renaming:\n\n```\nclass NewName(object):\n pass\n\nOldName = NewName\n```\n", "@untitaker the only catch is that the error strings for these errors use \"Schema\" and should be changed to \"Scheme\" to be consistent, which is why I suggested sub-classing the originals.\n" ]
https://api.github.com/repos/psf/requests/issues/1186
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1186/labels{/name}
https://api.github.com/repos/psf/requests/issues/1186/comments
https://api.github.com/repos/psf/requests/issues/1186/events
https://github.com/psf/requests/issues/1186
10,961,299
MDU6SXNzdWUxMDk2MTI5OQ==
1,186
requests.get doesn't allow for repeated URL parameters
{ "avatar_url": "https://avatars.githubusercontent.com/u/1254555?v=4", "events_url": "https://api.github.com/users/mattboehm/events{/privacy}", "followers_url": "https://api.github.com/users/mattboehm/followers", "following_url": "https://api.github.com/users/mattboehm/following{/other_user}", "gists_url": "https://api.github.com/users/mattboehm/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/mattboehm", "id": 1254555, "login": "mattboehm", "node_id": "MDQ6VXNlcjEyNTQ1NTU=", "organizations_url": "https://api.github.com/users/mattboehm/orgs", "received_events_url": "https://api.github.com/users/mattboehm/received_events", "repos_url": "https://api.github.com/users/mattboehm/repos", "site_admin": false, "starred_url": "https://api.github.com/users/mattboehm/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/mattboehm/subscriptions", "type": "User", "url": "https://api.github.com/users/mattboehm", "user_view_type": "public" }
[]
closed
true
null
[]
null
5
2013-02-13T16:48:30Z
2021-09-09T05:00:40Z
2013-02-13T20:26:12Z
NONE
resolved
If I prepare a request as follows: ``` req = requests.Request('get', url="http://localhost/", params=[("param1", "value1"), ("param1", "value2")]) prep = req.prepare() ``` prep.url is "http://localhost/?param1=value1&param1=value2" as expected. However if I call: ``` resp = requests.get(url="http://localhost/", params=[("param1", "value1"), ("param1", "value2")]) ``` then resp.url is "http://localhost/?param1=value2" I would expect requests.get to allow for repeated parameters. (tested in version 1.1.0 and the revision f73bda0)
{ "avatar_url": "https://avatars.githubusercontent.com/u/1254555?v=4", "events_url": "https://api.github.com/users/mattboehm/events{/privacy}", "followers_url": "https://api.github.com/users/mattboehm/followers", "following_url": "https://api.github.com/users/mattboehm/following{/other_user}", "gists_url": "https://api.github.com/users/mattboehm/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/mattboehm", "id": 1254555, "login": "mattboehm", "node_id": "MDQ6VXNlcjEyNTQ1NTU=", "organizations_url": "https://api.github.com/users/mattboehm/orgs", "received_events_url": "https://api.github.com/users/mattboehm/received_events", "repos_url": "https://api.github.com/users/mattboehm/repos", "site_admin": false, "starred_url": "https://api.github.com/users/mattboehm/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/mattboehm/subscriptions", "type": "User", "url": "https://api.github.com/users/mattboehm", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/1186/reactions" }
https://api.github.com/repos/psf/requests/issues/1186/timeline
null
completed
null
null
false
[ "Hm, this is an issue with calling `merge_kwargs` in `Session.request`. This seems like yet another job for a MultiDict (#1155), i.e., returning a MultiDict in `from_key_val_list`.\n", "Guess I'll be working on MultiDict support this weekend. I'm going to close this in deference to #1155 though, if that's ok with you @mattboehm \n\n**Note** The issue is not yet fixed.\n", "Sounds great; I'll close this ticket. I was actually going to suggest using a MultiDict internally so I'm glad we're on the same page =).\n", ":metal:\n", "This issue is fixed.\n\n```\n>>> requests.Request('get', url=\"http://localhost/\", params={'param1': ['value1', 'value2']})\n\n```\n" ]
https://api.github.com/repos/psf/requests/issues/1185
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1185/labels{/name}
https://api.github.com/repos/psf/requests/issues/1185/comments
https://api.github.com/repos/psf/requests/issues/1185/events
https://github.com/psf/requests/pull/1185
10,940,062
MDExOlB1bGxSZXF1ZXN0NDExNzc1Ng==
1,185
Dispatch hooks before following redirects
{ "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
4
2013-02-13T04:05:15Z
2021-09-08T19:00:48Z
2013-02-13T10:13:31Z
CONTRIBUTOR
resolved
Fixes #1183 /cc @mkomitee
{ "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/1185/reactions" }
https://api.github.com/repos/psf/requests/issues/1185/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/1185.diff", "html_url": "https://github.com/psf/requests/pull/1185", "merged_at": "2013-02-13T10:13:31Z", "patch_url": "https://github.com/psf/requests/pull/1185.patch", "url": "https://api.github.com/repos/psf/requests/pulls/1185" }
true
[ "+1.\n", "looks good ;)\n", ":cake:\n", "Thanks for this. I haven't been able to verify it solves my problem but I should be able to verify in a few days.\n" ]
https://api.github.com/repos/psf/requests/issues/1184
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1184/labels{/name}
https://api.github.com/repos/psf/requests/issues/1184/comments
https://api.github.com/repos/psf/requests/issues/1184/events
https://github.com/psf/requests/pull/1184
10,885,980
MDExOlB1bGxSZXF1ZXN0NDA5MjUxNg==
1,184
small cleanup of redirect codes
{ "avatar_url": "https://avatars.githubusercontent.com/u/92239?v=4", "events_url": "https://api.github.com/users/piotr-dobrogost/events{/privacy}", "followers_url": "https://api.github.com/users/piotr-dobrogost/followers", "following_url": "https://api.github.com/users/piotr-dobrogost/following{/other_user}", "gists_url": "https://api.github.com/users/piotr-dobrogost/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/piotr-dobrogost", "id": 92239, "login": "piotr-dobrogost", "node_id": "MDQ6VXNlcjkyMjM5", "organizations_url": "https://api.github.com/users/piotr-dobrogost/orgs", "received_events_url": "https://api.github.com/users/piotr-dobrogost/received_events", "repos_url": "https://api.github.com/users/piotr-dobrogost/repos", "site_admin": false, "starred_url": "https://api.github.com/users/piotr-dobrogost/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/piotr-dobrogost/subscriptions", "type": "User", "url": "https://api.github.com/users/piotr-dobrogost", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2013-02-11T22:14:45Z
2021-09-08T19:00:48Z
2013-02-12T08:27:05Z
NONE
resolved
removed no longer used redirect codes from models added numeric values of redirect codes in comments
{ "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/1184/reactions" }
https://api.github.com/repos/psf/requests/issues/1184/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/1184.diff", "html_url": "https://github.com/psf/requests/pull/1184", "merged_at": "2013-02-12T08:27:05Z", "patch_url": "https://github.com/psf/requests/pull/1184.patch", "url": "https://api.github.com/repos/psf/requests/pulls/1184" }
true
[ "seems okay :)\n" ]
https://api.github.com/repos/psf/requests/issues/1183
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1183/labels{/name}
https://api.github.com/repos/psf/requests/issues/1183/comments
https://api.github.com/repos/psf/requests/issues/1183/events
https://github.com/psf/requests/issues/1183
10,882,525
MDU6SXNzdWUxMDg4MjUyNQ==
1,183
No means of authenticating redirects
{ "avatar_url": "https://avatars.githubusercontent.com/u/826?v=4", "events_url": "https://api.github.com/users/mkomitee/events{/privacy}", "followers_url": "https://api.github.com/users/mkomitee/followers", "following_url": "https://api.github.com/users/mkomitee/following{/other_user}", "gists_url": "https://api.github.com/users/mkomitee/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/mkomitee", "id": 826, "login": "mkomitee", "node_id": "MDQ6VXNlcjgyNg==", "organizations_url": "https://api.github.com/users/mkomitee/orgs", "received_events_url": "https://api.github.com/users/mkomitee/received_events", "repos_url": "https://api.github.com/users/mkomitee/repos", "site_admin": false, "starred_url": "https://api.github.com/users/mkomitee/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/mkomitee/subscriptions", "type": "User", "url": "https://api.github.com/users/mkomitee", "user_view_type": "public" }
[]
closed
true
null
[]
null
15
2013-02-11T20:50:17Z
2021-09-09T05:00:40Z
2013-02-13T10:13:32Z
CONTRIBUTOR
resolved
In `requests/requests-kerberos` we use GSSAPI to not only authenticate to the server, but also authenticate the server as well. It's called mutual authentication. The way that `Session.send` resolves redirects doesn't allow us to authenticate the redirects. This is a problem because if a user sends a request to `host_a` which redirects us to `host_b` and we authenticate `host_b` successfully, that really doesn't mean anything to the user if he can't actually trust that the process which issued the redirect was actually `host_a`. This means that if we want to require mutual authentication, we cannot follow redirects at all, even if the servers are capable of authenticating their redirects. Would it be possible to either: 1. Dispatch the `response` hook on redirects 2. Create a new kind of hook which authentication mechanisms can install specifically for handling redirects? I see problems with option 1. If we'd be amenable to option 2, I'll work on a pull request for it. Unless someone says otherwise I'd call the hook `redirect`.
{ "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/1183/reactions" }
https://api.github.com/repos/psf/requests/issues/1183/timeline
null
completed
null
null
false
[ "Some more details are in the commit message at https://github.com/mkomitee/requests-kerberos/commit/954ae437d7748a61748503bb77ff77a2d662c731\n", "Have you seen issue #1160? It's kind of similar to this one, isn't it?\n", "@piotr-dobrogost, this is about not allowing redirects in certain cases. That is about modifying things passed via the `params` parameter because they only get `PreparedRequest`s.\n\nI'm inclined to say that the `response` hook should be called on redirects. The initial response should be assuming that there isn't a redirect in that first request. I think we expect a 401 upon which we authenticate. With that we get a response with a request attribute. That request attribute has the original hooks. I'll take a look at how we re-send the request with the proper authentication.\n", "Oh, I forgot to mention that the latter suggestion is not going to be accepted due to the feature freeze in requests.\n", "So you're forced to use the Adapter's `send` method because you don't have access to the session. The best we can do is import `dispatch_hook` from `requests.hooks` and use that do dispatch the hook on the request since the request already has its hooks. But I'm not sure if that would help you.\n", "That doesn't help. We need to get called with the redirect so that we can determine whether or not it's to be trusted and followed because we may not want to follow it.\n", "I think it would probably be reasonable to call the response hook on redirects.\n\nQuite aside from that, I don't think it's unreasonable to say that if you're concerned about unauthenticated redirects, you should turn redirects off and manage them yourself.\n", "I'm okay with handling redirects myself. \n\nI just don't want to spoil the API to do so:\n\nHTTP for humans -- I'd really rather not have to instruct people that they have to turn redirects off in their request and then configure a duplicate flag on their request object. That kind of spoils the 'one obvious way to do it' concept and the entire philosophy behind requests. \n\nThis is also similar to the reasoning behind why `verify=True` by default, so forcing people to read a bunch of documentation and flip a bunch of switches to get secure behavior -- which but for this could be the default -- is also against the philosophy.\n", "So @mkomitee, I've thought about this some more. Where are you concerned about redirects? In the initial request? If so, I understand your concern. If you're instead concerned about redirects after the 401 has been handled, you can prevent those yourself. You have access over the response at that point I believe.\n", "I'm concerned about it in the initial request.\n\nOn Tue, Feb 12, 2013 at 12:36 PM, Ian Cordasco [email protected]\nwrote:\n\n> ## So @mkomitee, I've thought about this some more. Where are you concerned about redirects? In the initial request? If so, I understand your concern. If you're instead concerned about redirects after the 401 has been handled, you can prevent those yourself. You have access over the response at that point I believe.\n> \n> Reply to this email directly or view it on GitHub:\n> https://github.com/kennethreitz/requests/issues/1183#issuecomment-13444844\n", "Ah, I see what you mean. We resolve redirects before dispatching hooks. If that came before the redirect resolution, that would mean you could catch the redirect, correct?\n\nSemantically I think it should be there anyway. If a redirect is resolved, every request except the first has the hook called on it (because each subsequent request calls `send` with `allow_redirects=False`). It should before the resolution unless @kennethreitz or @Lukasa disagree.\n", "Yes.\n\nThat said (and I've been keeping it out of scope for this specific discussion -- once this is resolved I'll be opening another Issue/Feature Request) it would be very helpful if I had access to the kwargs originally passed to `requests.get` so that I could actually use the user requested options which don't get added to the request when I send future requests during authentication (e.g. verify, proxies, cert, allow_redirects etc). It would also be nice to have access to the `requests.Session` itself so that I can use the already well known, understood, and tested `resolve_redirects` code.\n", "@mkomitee I have no real opinion about forcing Auth providers to accept all of those parameters, but I doubt it will be accepted. On that topic though, `allow_redirects` should be handled by the Session without a doubt. The Auth providers should have no reason to worry about that. I can understand needing the `proxies`, `timeout`, `stream` and `cert` parameters, but I thoroughly disagree that it is the responsibility of the auth provider to handle redirects. With that said (twice), there shouldn't be a need to send the `Session` object itself.\n", "If authentication is required for the redirect, the 401 goes to the auth provider and there's no way back to the redirect handling code. That's all out of scope for this issue though.\n\nOn Tue, Feb 12, 2013 at 6:22 PM, Ian Cordasco [email protected]\nwrote:\n\n> ## @mkomitee I have no real opinion about forcing Auth providers to accept all of those parameters, but I doubt it will be accepted. On that topic though, `allow_redirects` should be handled by the Session without a doubt. The Auth providers should have no reason to worry about that. I can understand needing the `proxies`, `timeout`, `stream` and `cert` parameters, but I thoroughly disagree that it is the responsibility of the auth provider to handle redirects. With that said (twice), there shouldn't be a need to send the `Session` object itself.\n> \n> Reply to this email directly or view it on GitHub:\n> https://github.com/kennethreitz/requests/issues/1183#issuecomment-13465713\n", "@mkomittee. Assuming that we move the call to `dispatch_hook` it would occur before being redirected. So what would happen is the following:\n\n```\nSession.send(prepared_request, **kwargs):\n-> Initial Request\n<- Response 401\n dispatch_hook\n -> handled authenticated request\n <- Response which gets returned to Session.send\n(i.e.,\nr = adapter.send(...)\nr = dispatch_hook('response', request, r)\nresolve_redirects\n```\n\nSo after this change, if there is a 302 returned, (assuming the auth handler doesn't call `dispatch_hooks` itself) then Session's send method will handle it.\n" ]
https://api.github.com/repos/psf/requests/issues/1182
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1182/labels{/name}
https://api.github.com/repos/psf/requests/issues/1182/comments
https://api.github.com/repos/psf/requests/issues/1182/events
https://github.com/psf/requests/issues/1182
10,871,975
MDU6SXNzdWUxMDg3MTk3NQ==
1,182
SSL exception when using any HTTPS proxy
{ "avatar_url": "https://avatars.githubusercontent.com/u/153571?v=4", "events_url": "https://api.github.com/users/Miarevo/events{/privacy}", "followers_url": "https://api.github.com/users/Miarevo/followers", "following_url": "https://api.github.com/users/Miarevo/following{/other_user}", "gists_url": "https://api.github.com/users/Miarevo/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Miarevo", "id": 153571, "login": "Miarevo", "node_id": "MDQ6VXNlcjE1MzU3MQ==", "organizations_url": "https://api.github.com/users/Miarevo/orgs", "received_events_url": "https://api.github.com/users/Miarevo/received_events", "repos_url": "https://api.github.com/users/Miarevo/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Miarevo/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Miarevo/subscriptions", "type": "User", "url": "https://api.github.com/users/Miarevo", "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
12
2013-02-11T16:22:10Z
2021-09-09T00:34:26Z
2013-02-12T04:12:34Z
NONE
resolved
When I attempt to load a page using an HTTPS proxy, I get an odd SSL exception that I never got before (with the same code). This happens with any valid HTTPS proxy. Unfortunately, I don't know when this began to occur. If I were to guess, I'd say version 1.1 introduced the issue. Here's an example: ``` Python 3.3.0 (default, Dec 22 2012, 21:02:07) [GCC 4.7.2] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import requests >>> sess = requests.Session() >>> r = sess.get('https://google.com/', proxies={'https': proxy}) Traceback (most recent call last): File "/usr/lib/python3.3/site-packages/requests/packages/urllib3/connectionpool.py", line 422, in urlopen body=body, headers=headers) File "/usr/lib/python3.3/site-packages/requests/packages/urllib3/connectionpool.py", line 274, in _make_request conn.request(method, url, **httplib_request_kw) File "/usr/lib/python3.3/http/client.py", line 1049, in request self._send_request(method, url, body, headers) File "/usr/lib/python3.3/http/client.py", line 1087, in _send_request self.endheaders(body) File "/usr/lib/python3.3/http/client.py", line 1045, in endheaders self._send_output(message_body) File "/usr/lib/python3.3/http/client.py", line 890, in _send_output self.send(msg) File "/usr/lib/python3.3/http/client.py", line 828, in send self.connect() File "/usr/lib/python3.3/site-packages/requests/packages/urllib3/connectionpool.py", line 105, in connect ssl_version=self.ssl_version) File "/usr/lib/python3.3/site-packages/requests/packages/urllib3/util.py", line 289, in ssl_wrap_socket return context.wrap_socket(sock, server_hostname=server_hostname) File "/usr/lib/python3.3/ssl.py", line 210, in wrap_socket _context=self) File "/usr/lib/python3.3/ssl.py", line 310, in __init__ raise x File "/usr/lib/python3.3/ssl.py", line 306, in __init__ self.do_handshake() File "/usr/lib/python3.3/ssl.py", line 513, in do_handshake self._sslobj.do_handshake() ssl.SSLError: [SSL: UNKNOWN_PROTOCOL] unknown protocol (_ssl.c:547) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/lib/python3.3/site-packages/requests/adapters.py", line 174, in send timeout=timeout File "/usr/lib/python3.3/site-packages/requests/packages/urllib3/poolmanager.py", line 158, in urlopen return self.proxy_pool.urlopen(method, url, **kw) File "/usr/lib/python3.3/site-packages/requests/packages/urllib3/connectionpool.py", line 453, in urlopen raise SSLError(e) requests.packages.urllib3.exceptions.SSLError: [SSL: UNKNOWN_PROTOCOL] unknown protocol (_ssl.c:547) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/lib/python3.3/site-packages/requests/sessions.py", line 310, in get return self.request('GET', url, **kwargs) File "/usr/lib/python3.3/site-packages/requests/sessions.py", line 279, in request resp = self.send(prep, stream=stream, timeout=timeout, verify=verify, cert=cert, proxies=proxies) File "/usr/lib/python3.3/site-packages/requests/sessions.py", line 374, in send r = adapter.send(request, **kwargs) File "/usr/lib/python3.3/site-packages/requests/adapters.py", line 213, in send raise SSLError(e) requests.exceptions.SSLError: [SSL: UNKNOWN_PROTOCOL] unknown protocol (_ssl.c:547) ```
{ "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/1182/reactions" }
https://api.github.com/repos/psf/requests/issues/1182/timeline
null
completed
null
null
false
[ "Which version of requests are you using? Also, can you test out the current HEAD of the master branch in this repository to see if the problem persists?\n", "Does your proxy variable have a `https://` or `http://` scheme?\nIt should be `http://` if you want to connect by http, regardless if the the proxied connection itself is encrypted.\n", "My proxy variable was of the format '1.1.1.1:80', and after prepending 'http://', it seems to be working fine. Thanks t-8ch! :+1: How come I never had to do that before?\n", "@Miarevo I'm guessing it was either a change in our proxy handling or a change in urllib3's. Nice and specific eh? :-P Frankly though, @Lukasa has been more engaged in the proxy work lately so he might have an idea.\n", "@Miarevo: You did, you just didn't notice. =) If you don't provide a scheme, Requests guesses at what it should be. For HTTP proxies, it guesses it should be 'http', and for HTTPS proxies it guesses it should be 'https'.\n", "It should be noted that this behaviour is forward-looking in a way that it might not want to be. There is an open PR on urllib3 (shazow/urllib3#139) which will add support for the CONNECT verb to urllib3. Unfortunately, until that PR is accepted, HTTPS proxies don't work.\n", "@Lukasa thanks for reminding me about that issue. I would love that. I could get stuff working on PythonAnywhere then. :)\n", "Wouldn't it be better to force user to specify a scheme?\nAs one can use http over a https proxy and vice versa.\nOne does not imply the other.\nTo quote the zen of python:\n\n```\nExplicit is better than implicit.\n```\n\nThis doesn't work after all:\n\n``` python\nrequests.get(\"httpbin.org\")\n```\n\nSidenote:\nRequests raises a `MissingSchema`-exception, while RFC2616 always uses about \"scheme*\"\n", "@t-8ch we do very little work with proxies. If I remember our code correctly, we just pass it to urllib3 and they handle all of that for us. I guess we _could_ validate it before passing it to urllib3 though. I'll defer to @kennethreitz and @Lukasa about whether we should be doing that or not though.\n", "`adapters.py:HTTPAdapter.get_connection()`:\n\n``` python\nif proxy:\n proxy = prepend_scheme_if_needed(proxy, urlparse(url).scheme)\n conn = ProxyManager(self.poolmanager.connection_from_url(proxy))\n```\n", "I think @t-8ch is probably right. It's a quick fix, I'll open a PR and see what Kenneth thinks.\n", "Ugh, need to wait until #1187 is accepted. =P\n" ]
https://api.github.com/repos/psf/requests/issues/1181
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1181/labels{/name}
https://api.github.com/repos/psf/requests/issues/1181/comments
https://api.github.com/repos/psf/requests/issues/1181/events
https://github.com/psf/requests/pull/1181
10,864,715
MDExOlB1bGxSZXF1ZXN0NDA4MTc2MA==
1,181
Fix of UnicodeDecodeError on unicode header name that can be converted to ascii.
{ "avatar_url": "https://avatars.githubusercontent.com/u/855988?v=4", "events_url": "https://api.github.com/users/denis-ryzhkov/events{/privacy}", "followers_url": "https://api.github.com/users/denis-ryzhkov/followers", "following_url": "https://api.github.com/users/denis-ryzhkov/following{/other_user}", "gists_url": "https://api.github.com/users/denis-ryzhkov/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/denis-ryzhkov", "id": 855988, "login": "denis-ryzhkov", "node_id": "MDQ6VXNlcjg1NTk4OA==", "organizations_url": "https://api.github.com/users/denis-ryzhkov/orgs", "received_events_url": "https://api.github.com/users/denis-ryzhkov/received_events", "repos_url": "https://api.github.com/users/denis-ryzhkov/repos", "site_admin": false, "starred_url": "https://api.github.com/users/denis-ryzhkov/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/denis-ryzhkov/subscriptions", "type": "User", "url": "https://api.github.com/users/denis-ryzhkov", "user_view_type": "public" }
[]
closed
true
null
[]
null
8
2013-02-11T12:44:21Z
2021-09-08T23:05:19Z
2013-02-12T16:43:02Z
CONTRIBUTOR
resolved
## Problem Please see issue #1082. ## Solution Let's fix at least Python-2 unicode issues with **header name**, because its representation as bytes is well defined in HTTP/1.1 spec: http://tools.ietf.org/html/rfc2616#section-4.2 ``` message-header = field-name ":" [ field-value ] field-name = token token = 1*<any CHAR except CTLs or separators> CHAR = <any US-ASCII character (octets 0 - 127)> ``` So header name should always be sent as ascii. If user provides header name that can be converted to ascii without errors, then it should be converted, e.g. `u'Content-Type' --> 'Content-Type'`. Otherwise a helpful error should be raised, indicating that the header name is the reason. - Created: `test_unicode_header_name`. - Updated: `prepare_headers`.
{ "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/1181/reactions" }
https://api.github.com/repos/psf/requests/issues/1181/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/1181.diff", "html_url": "https://github.com/psf/requests/pull/1181", "merged_at": "2013-02-12T16:43:02Z", "patch_url": "https://github.com/psf/requests/pull/1181.patch", "url": "https://api.github.com/repos/psf/requests/pulls/1181" }
true
[ "Why use a side-effect of the `str` function to do this, when you can easily do: `name.encode('ascii')`? Additionally, if you do that you can remove the 'if py2' tests.\n", "@Lukasa\nThanks! Please check the fix.\n", "I'm going to close and reopen to get Travis to re-run the tests.\n", "This fix looks broadly right. My only concern is that this is a subset of the problem, but this is a perfectly good start to the problem. =)\n", "One step at a time )\n", "I don't recall off the top of my head where I've seen this, but I believe latin1 (or something similar) is recommended for header encodings. @mitsuhiko do you know?\n", "@kennethreitz\n\n`latin1` (aka ISO-8859-1) is recommended for header **values** by the very HTTP/1.1 spec\nhttp://tools.ietf.org/html/rfc2616#section-4.2\n- Header **name** is always `ascii`:\n\n```\n message-header = field-name \":\" [ field-value ]\n field-name = token\n token = 1*<any CHAR except CTLs or separators>\n CHAR = <any US-ASCII character (octets 0 - 127)>\n```\n- Header **value** is `latin1` by default, but may be any other charset too:\n\n```\n message-header = field-name \":\" [ field-value ]\n field-value = *( field-content | LWS )\n field-content = <the OCTETs making up the field-value\n and consisting of either *TEXT or combinations\n of token, separators, and quoted-string>\n TEXT = <any OCTET except CTLs, but including LWS>\n OCTET = <any 8-bit sequence of data>\n\n Words of *TEXT MAY contain characters from character sets\n other than ISO-8859-1 (aka latin1)\n only when encoded according to the rules of RFC 2047.\n```\n\nThis RFC is MIME for headers: http://tools.ietf.org/html/rfc2047\n\nExample of encoded value:\n\n```\n =?UTF-8?Q?=E2=98=91?=\n```\n\nIt can be decoded with:\nhttp://docs.python.org/2/library/email.header.html#email.header.decode_header\n\nSo it's a bit more complex than just `latin1`.\n\nI guess it is a good idea to merge the fix for header **name** first,\nand then return to header **value** issues.\n", "beautiful, thanks :)\n" ]
https://api.github.com/repos/psf/requests/issues/1180
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1180/labels{/name}
https://api.github.com/repos/psf/requests/issues/1180/comments
https://api.github.com/repos/psf/requests/issues/1180/events
https://github.com/psf/requests/pull/1180
10,834,065
MDExOlB1bGxSZXF1ZXN0NDA3Njc2NA==
1,180
Fix Session level Cookie Handling
{ "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
0
2013-02-11T00:40:52Z
2021-09-08T19:00:47Z
2013-02-11T00:43:21Z
CONTRIBUTOR
resolved
Reported by Filefly on IRC and written with help from @gazpachoking.
{ "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/1180/reactions" }
https://api.github.com/repos/psf/requests/issues/1180/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/1180.diff", "html_url": "https://github.com/psf/requests/pull/1180", "merged_at": "2013-02-11T00:43:21Z", "patch_url": "https://github.com/psf/requests/pull/1180.patch", "url": "https://api.github.com/repos/psf/requests/pulls/1180" }
true
[]
https://api.github.com/repos/psf/requests/issues/1179
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1179/labels{/name}
https://api.github.com/repos/psf/requests/issues/1179/comments
https://api.github.com/repos/psf/requests/issues/1179/events
https://github.com/psf/requests/issues/1179
10,828,391
MDU6SXNzdWUxMDgyODM5MQ==
1,179
Attach a Certificate for SSL authentication and access.
{ "avatar_url": "https://avatars.githubusercontent.com/u/3526843?v=4", "events_url": "https://api.github.com/users/tigeryell99/events{/privacy}", "followers_url": "https://api.github.com/users/tigeryell99/followers", "following_url": "https://api.github.com/users/tigeryell99/following{/other_user}", "gists_url": "https://api.github.com/users/tigeryell99/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/tigeryell99", "id": 3526843, "login": "tigeryell99", "node_id": "MDQ6VXNlcjM1MjY4NDM=", "organizations_url": "https://api.github.com/users/tigeryell99/orgs", "received_events_url": "https://api.github.com/users/tigeryell99/received_events", "repos_url": "https://api.github.com/users/tigeryell99/repos", "site_admin": false, "starred_url": "https://api.github.com/users/tigeryell99/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/tigeryell99/subscriptions", "type": "User", "url": "https://api.github.com/users/tigeryell99", "user_view_type": "public" }
[]
closed
true
null
[]
null
3
2013-02-10T19:52:39Z
2021-09-09T04:00:45Z
2013-02-10T22:51:43Z
NONE
resolved
Please add the ability to attach a Certificate for SSL authentication to the request, not to verify the cert, but to gain access to an https SSL secured site. I am submitting this per Kenneth's request. Thanks, Brian
{ "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/1179/reactions" }
https://api.github.com/repos/psf/requests/issues/1179/timeline
null
completed
null
null
false
[ "Isn't this, what the `cert` parameter is for?\nFrom the [docs](http://docs.python-requests.org/en/latest/user/advanced/#ssl-cert-verification):\n\n```\nYou can also specify a local cert to use as client side certificate, as a single file\n(containing the private key and the certificate) or as a tuple of both file’s path:\n```\n\n``` python\n>>> requests.get('https://kennethreitz.com', cert=('/path/server.crt', '/path/key'))\n<Response [200]>\n```\n", "I finally figured out what was happening. Apparently the server I was trying to connect to only accepts TLS connections (not SSLv2 or SSLv3). I don't see anywhere in \"requests\" that allows you to change the ssl protocol used, or am I missing it? \n\nThanks,\nBrian\n\n---\n\n From: Thomas Weißschuh [email protected]\nTo: kennethreitz/requests [email protected] \nCc: tigeryell99 [email protected] \nSent: Sunday, February 10, 2013 1:20 PM\nSubject: Re: [requests] Attach a Certificate for SSL authentication and access. (#1179)\n\nIsn't this, what the cert parameter is for?\nFrom the docs:\nYou can also specify a local cert to use as client side certificate, as a single file\n(containing the private key and the certificate) or as a tuple of both file’s path: \n\n> > > requests.get('https://kennethreitz.com', cert=('/path/server.crt', '/path/key')) <Response [200]> \n> > > —\n> > > Reply to this email directly or view it on GitHub..\n", "Enjoy: http://lukasa.co.uk/2013/01/Choosing_SSL_Version_In_Requests/\n" ]
https://api.github.com/repos/psf/requests/issues/1178
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1178/labels{/name}
https://api.github.com/repos/psf/requests/issues/1178/comments
https://api.github.com/repos/psf/requests/issues/1178/events
https://github.com/psf/requests/pull/1178
10,820,840
MDExOlB1bGxSZXF1ZXN0NDA3MzcwNA==
1,178
improving `super_len`
{ "avatar_url": "https://avatars.githubusercontent.com/u/690171?v=4", "events_url": "https://api.github.com/users/shezi/events{/privacy}", "followers_url": "https://api.github.com/users/shezi/followers", "following_url": "https://api.github.com/users/shezi/following{/other_user}", "gists_url": "https://api.github.com/users/shezi/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/shezi", "id": 690171, "login": "shezi", "node_id": "MDQ6VXNlcjY5MDE3MQ==", "organizations_url": "https://api.github.com/users/shezi/orgs", "received_events_url": "https://api.github.com/users/shezi/received_events", "repos_url": "https://api.github.com/users/shezi/repos", "site_admin": false, "starred_url": "https://api.github.com/users/shezi/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/shezi/subscriptions", "type": "User", "url": "https://api.github.com/users/shezi", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2013-02-10T10:26:22Z
2021-09-08T19:00:47Z
2013-02-10T22:19:27Z
NONE
resolved
when using `StringIO` in Python 3 oder using `cStringIO` in Python 2, you will have an object that does not have a `len` AND does not have a `.fileno()` In that case, the best method for finding the length of the backing object is to seek to the end. This assumes that the object is seekable, though. Since we're going to load the whole object into memory anyway, memory consumption should not be increased by the seeking.
{ "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/1178/reactions" }
https://api.github.com/repos/psf/requests/issues/1178/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/1178.diff", "html_url": "https://github.com/psf/requests/pull/1178", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/1178.patch", "url": "https://api.github.com/repos/psf/requests/pulls/1178" }
true
[ "I'd prefer us to do a little magic if possible. What's the use case here?\n", "Use case:\n\n```\n# python 3.3.0\nimport requests\nimport io\n\nrequests.get('http://example.com/', data=io.StringIO('my data'))\n```\n\nGives me:\n\n```\nTraceback (most recent call last):\n File \"usecase.py\", line 4, in <module>\n requests.get('http://example.com/', data=io.StringIO('my data'))\n File \"/Users/spielmann/prog/tmp/requests/env/lib/python3.3/site-packages/requests/api.py\", line 55, in get\n return request('get', url, **kwargs)\n File \"/Users/spielmann/prog/tmp/requests/env/lib/python3.3/site-packages/requests/api.py\", line 44, in request\n return session.request(method=method, url=url, **kwargs)\n File \"/Users/spielmann/prog/tmp/requests/env/lib/python3.3/site-packages/requests/sessions.py\", line 276, in request\n prep = req.prepare()\n File \"/Users/spielmann/prog/tmp/requests/env/lib/python3.3/site-packages/requests/models.py\", line 224, in prepare\n p.prepare_body(self.data, self.files)\n File \"/Users/spielmann/prog/tmp/requests/env/lib/python3.3/site-packages/requests/models.py\", line 349, in prepare_body\n length = super_len(data)\n File \"/Users/spielmann/prog/tmp/requests/env/lib/python3.3/site-packages/requests/utils.py\", line 49, in super_len\n return os.fstat(o.fileno()).st_size\nio.UnsupportedOperation: fileno\n```\n\nIn my use case, I am mirroring requests from one source to another using `io.StringIO`. Yes, I _could_ read the body and put it into a string. You could argue that it is never necessary to use `StringIO` as data, but you could argue the same for files, and `super_len` will actually go to the file system to read the length of a file.\n\nI also think that the fileno call will fail when the file was deleted in the meantime but is still open in Python. I have not checked that, though. In any case, the argument is that it's not advisable to assume that we can read the file size from `len` _or_ from the filesystem.\n" ]
https://api.github.com/repos/psf/requests/issues/1177
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1177/labels{/name}
https://api.github.com/repos/psf/requests/issues/1177/comments
https://api.github.com/repos/psf/requests/issues/1177/events
https://github.com/psf/requests/pull/1177
10,811,856
MDExOlB1bGxSZXF1ZXN0NDA3MDg4NA==
1,177
Forcing path_url to be of type str in Python2
{ "avatar_url": "https://avatars.githubusercontent.com/u/690171?v=4", "events_url": "https://api.github.com/users/shezi/events{/privacy}", "followers_url": "https://api.github.com/users/shezi/followers", "following_url": "https://api.github.com/users/shezi/following{/other_user}", "gists_url": "https://api.github.com/users/shezi/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/shezi", "id": 690171, "login": "shezi", "node_id": "MDQ6VXNlcjY5MDE3MQ==", "organizations_url": "https://api.github.com/users/shezi/orgs", "received_events_url": "https://api.github.com/users/shezi/received_events", "repos_url": "https://api.github.com/users/shezi/repos", "site_admin": false, "starred_url": "https://api.github.com/users/shezi/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/shezi/subscriptions", "type": "User", "url": "https://api.github.com/users/shezi", "user_view_type": "public" }
[]
closed
true
null
[]
null
14
2013-02-09T17:45:04Z
2021-09-08T19:00:46Z
2013-02-10T22:26:18Z
NONE
resolved
This is important when posting files/binary data in Python2. Since urlsplit will produce unicode parts, the path_url will also be unicode, and thus the sent body will be converted to unicode during concatenation by urllib, producing a UnicodeDecodeError when sending binary data. Forcing the path_url to be a native string in Python2 resolves this. No test cases yet.
{ "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/1177/reactions" }
https://api.github.com/repos/psf/requests/issues/1177/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/1177.diff", "html_url": "https://github.com/psf/requests/pull/1177", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/1177.patch", "url": "https://api.github.com/repos/psf/requests/pulls/1177" }
true
[ "Additionally, in lines 392 and 396, the `str` primitive is used to convert the _content_ of the 'Content-Length' header to unicode (in Python2). This does not seem to matter for concatenation, though, it just looks interesting when you inspect your headers and get\n\n```\n'Content-Length': u'2246'\n```\n", "> Additionally, in lines 392 and 396, (...)\n\nGood catch. Issue #1113 is related. There's also `self.headers['Content-Length'] = '0'` which is wrong as in Python 3 this will be unicode string too.\n", "@shezi would you like to make the changes you and @piotr-dobrogost mentioned and push to the same branch? This sounds like a good pull IMO.\n", "I have added the requested changes, but I'm not sure I understand you, @piotr-dogrobost. Using `builtin_str` will still be of type `str` in Python 3, so will be a unicode object. Do you think we should convert to `bytes` here (causing `str` in Python 2 and `bytes` in Python 3)?\n", "@shezi\nYou raise a valid point. If we use `builtin_str` then we could left the `0` string literal as is, indeed. As to using `bytes` in Python 3 I believe we should set a boundary after which all headers are bytes - see my comment at https://github.com/kennethreitz/requests/pull/1116#issuecomment-12621940 However this hasn't been decided, yet.\n", "@piotr-dobrogost That's what I had thought. However, I turned the string literal into a conversion to mark it for future edits: if at one point the decision is made to convert to `bytes` here, it should be more clear that all three calls must be converted.\n\n(sorry for using the wrong name above!)\n", "We need to be very careful about changing these things. \n\nWhat's broken about the current implementation?\n", "This actually codes around a peculiarity in `requests-oauthlib`, where the URL is converted to unicode. I'll write a patch for that as well, so you can decide if that one sounds better.\n\nThe full test case is this:\n\n```\n# python 2.7.3\nimport requests # 1.1.0\nfrom requests_oauthlib import OAuth1 # >= 0.3.4\nfiles = {'file': 'byte string with lots of non-ascii-characters in it: ' + ''.join(chr(x) for x in xrange(256))}\noauth = OAuth1('key')\nr = requests.put('http://example.com/', auth=oauth, files=files)\n```\n\nGives me this:\n\n```\nTraceback (most recent call last):\n File \"try.py\", line 8, in <module>\n r = requests.put('http://example.com/', auth=oauth, files=files)\n File \"/Users/spielmann/prog/tmp/requests/env/lib/python2.7/site-packages/requests/api.py\", line 98, in put\n return request('put', url, data=data, **kwargs)\n File \"/Users/spielmann/prog/tmp/requests/env/lib/python2.7/site-packages/requests/api.py\", line 44, in request\n return session.request(method=method, url=url, **kwargs)\n File \"/Users/spielmann/prog/tmp/requests/env/lib/python2.7/site-packages/requests/sessions.py\", line 279, in request\n resp = self.send(prep, stream=stream, timeout=timeout, verify=verify, cert=cert, proxies=proxies)\n File \"/Users/spielmann/prog/tmp/requests/env/lib/python2.7/site-packages/requests/sessions.py\", line 374, in send\n r = adapter.send(request, **kwargs)\n File \"/Users/spielmann/prog/tmp/requests/env/lib/python2.7/site-packages/requests/adapters.py\", line 174, in send\n timeout=timeout\n File \"/Users/spielmann/prog/tmp/requests/env/lib/python2.7/site-packages/requests/packages/urllib3/connectionpool.py\", line 422, in urlopen\n body=body, headers=headers)\n File \"/Users/spielmann/prog/tmp/requests/env/lib/python2.7/site-packages/requests/packages/urllib3/connectionpool.py\", line 274, in _make_request\n conn.request(method, url, **httplib_request_kw)\n File \"/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py\", line 955, in request\n self._send_request(method, url, body, headers)\n File \"/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py\", line 989, in _send_request\n self.endheaders(body)\n File \"/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py\", line 951, in endheaders\n self._send_output(message_body)\n File \"/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py\", line 809, in _send_output\n msg += message_body\nUnicodeDecodeError: 'ascii' codec can't decode byte 0x80 in position 321: ordinal not in range(128)\n```\n\nI've tracked the reason to this back to the `urlsplit` that produces a unicode URL, even though IMHO URLs should not be unicode.\n", "> thus the sent body will be converted to unicode during concatenation by urllib, producing a UnicodeDecodeError when sending binary data\n\n@shezi\nHow come is path concatenated with the body? Can you point us to the exact place where it happens?\n", "The path is concatenated with the body because a HTTP request contains the path in its data. At some stage your request has to end up looking like:\n\nPOST /index.html\nHeaders\nBody\n\nor similar.\n", "I know but there are headers there between the path and a body :) That's why I'm asking.\n", "You can see that here:\n\n```\nFile \"/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py\", line 809, in _send_output\nmsg += message_body\n```\n\nThat's the last line of the error stack from above. As @Lukasa pointed out, in the end the whole request has to be serialized as a string. It doesn't matter that there are headers in between, because if you do `unicode + str` the result will be `unicode`. So as long as there is at least one `unicode` element before the message body, the message body will have to be converted to `unicode` too. Basically, a single `unicode` element in URL, fragment, query string, headers or body \"infects\" all other elements.\n\nIn any case, the specific problem I had can be solved in a client library, so that's what I did and submitted a pull request there.\n", "@shezi\nThanks for explanation and sorry I didn't notice this myself in the stacktrace.\nWhat about Python 3?\n", "@piotr-dobrogost No worries, it took me some time, too, to figure it out. =) I haven't tried it in Python3.\n" ]
https://api.github.com/repos/psf/requests/issues/1176
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1176/labels{/name}
https://api.github.com/repos/psf/requests/issues/1176/comments
https://api.github.com/repos/psf/requests/issues/1176/events
https://github.com/psf/requests/issues/1176
10,811,267
MDU6SXNzdWUxMDgxMTI2Nw==
1,176
Requests is not Working on Enigma2
{ "avatar_url": "https://avatars.githubusercontent.com/u/2682247?v=4", "events_url": "https://api.github.com/users/athoik/events{/privacy}", "followers_url": "https://api.github.com/users/athoik/followers", "following_url": "https://api.github.com/users/athoik/following{/other_user}", "gists_url": "https://api.github.com/users/athoik/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/athoik", "id": 2682247, "login": "athoik", "node_id": "MDQ6VXNlcjI2ODIyNDc=", "organizations_url": "https://api.github.com/users/athoik/orgs", "received_events_url": "https://api.github.com/users/athoik/received_events", "repos_url": "https://api.github.com/users/athoik/repos", "site_admin": false, "starred_url": "https://api.github.com/users/athoik/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/athoik/subscriptions", "type": "User", "url": "https://api.github.com/users/athoik", "user_view_type": "public" }
[]
closed
true
null
[]
null
3
2013-02-09T16:53:47Z
2021-09-09T05:00:44Z
2013-02-09T23:52:11Z
NONE
resolved
Hello everybody, I am trying to use requests on Enigma2 STB (using OpenPLi 3.0), but i am getting the following error: ``` python # python2.7 Python 2.7.2 (default, Dec 14 2012, 09:28:54) [GCC 4.6.4 20120303 (prerelease)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import requests >>> requests.__version__ '1.1.0' >>> requests.certs.where() 'requests/cacert.pem' >>> requests.get('https://www.google.com') Traceback (most recent call last): File "<stdin>", line 1, in <module> File "requests/api.py", line 55, in get return request('get', url, **kwargs) File "requests/api.py", line 44, in request return session.request(method=method, url=url, **kwargs) File "requests/sessions.py", line 289, in request resp = self.send(prep, **send_kwargs) File "requests/sessions.py", line 385, in send r = adapter.send(request, **kwargs) File "requests/adapters.py", line 227, in send raise SSLError(e) requests.exceptions.SSLError: [Errno 1] _ssl.c:503: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed >>> requests.get('https://www.google.com', verify=False) <Response [200]> ``` Any idea why verify is not working? The above steps on my computer working without a problem. ``` python # python2.7 Python 2.7.3 (default, Aug 1 2012, 05:16:07) [GCC 4.6.3] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import requests >>> requests.__version__ '1.1.0' >>> requests.certs.where() 'requests/cacert.pem' >>> requests.get('https://www.google.com') <Response [200]> ``` Thanks.
{ "avatar_url": "https://avatars.githubusercontent.com/u/2682247?v=4", "events_url": "https://api.github.com/users/athoik/events{/privacy}", "followers_url": "https://api.github.com/users/athoik/followers", "following_url": "https://api.github.com/users/athoik/following{/other_user}", "gists_url": "https://api.github.com/users/athoik/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/athoik", "id": 2682247, "login": "athoik", "node_id": "MDQ6VXNlcjI2ODIyNDc=", "organizations_url": "https://api.github.com/users/athoik/orgs", "received_events_url": "https://api.github.com/users/athoik/received_events", "repos_url": "https://api.github.com/users/athoik/repos", "site_admin": false, "starred_url": "https://api.github.com/users/athoik/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/athoik/subscriptions", "type": "User", "url": "https://api.github.com/users/athoik", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/1176/reactions" }
https://api.github.com/repos/psf/requests/issues/1176/timeline
null
completed
null
null
false
[ "Could you try the commandline version of OpenSSL?\n\n``` sh\n$ openssl s_client -connect google.com:443 -CAfile requests/cacert.pem\n# [..] Some output\nStart Time: 1360430734\nTimeout : 300 (sec)\nVerify return code: 0 (ok)\n```\n", "```\n# openssl s_client -connect google.com:443 -CAfile requests/cacert.pem\nCONNECTED(00000003)\ndepth=2 /C=US/O=Equifax/OU=Equifax Secure Certificate Authority\nverify error:num=9:certificate is not yet valid\nnotBefore=Aug 22 16:41:51 1998 GMT\nverify return:0\n---\nCertificate chain\n 0 s:/C=US/ST=California/L=Mountain View/O=Google Inc/CN=*.google.com\n i:/C=US/O=Google Inc/CN=Google Internet Authority\n 1 s:/C=US/O=Google Inc/CN=Google Internet Authority\n i:/C=US/O=Equifax/OU=Equifax Secure Certificate Authority\n---\nServer certificate\n-----BEGIN CERTIFICATE-----\nMIIF/DCCBWWgAwIBAgIKGIvRAgAAAAB3jzANBgkqhkiG9w0BAQUFADBGMQswCQYD\nVQQGEwJVUzETMBEGA1UEChMKR29vZ2xlIEluYzEiMCAGA1UEAxMZR29vZ2xlIElu\ndGVybmV0IEF1dGhvcml0eTAeFw0xMzAxMDMxMjEzMzFaFw0xMzA2MDcxOTQzMjda\nMGYxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9ybmlhMRYwFAYDVQQHEw1N\nb3VudGFpbiBWaWV3MRMwEQYDVQQKEwpHb29nbGUgSW5jMRUwEwYDVQQDFAwqLmdv\nb2dsZS5jb20wgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAKdLhbKA5ZQDb8pK\n5WypcYChZ/e5Rugmtem9WU973RpQaMc633MVzqhpANQnCanN4dFuLcaj6TvWqpRj\ngxpkJ7/+h5DU5rjkiah2IxUT4CdrOAr6H7HscQrsNP8NnByn1kcP7HBsKmuJkPXe\nWOlOrk1v8PHKfXLAenmUKP6FAVjJAgMBAAGjggPPMIIDyzAdBgNVHSUEFjAUBggr\nBgEFBQcDAQYIKwYBBQUHAwIwHQYDVR0OBBYEFJ5FvWMPpHBCSLtVaEiEPHcH2+iU\nMB8GA1UdIwQYMBaAFL/AMOv1QxE+Z7qekfv8atrjaxIkMFsGA1UdHwRUMFIwUKBO\noEyGSmh0dHA6Ly93d3cuZ3N0YXRpYy5jb20vR29vZ2xlSW50ZXJuZXRBdXRob3Jp\ndHkvR29vZ2xlSW50ZXJuZXRBdXRob3JpdHkuY3JsMGYGCCsGAQUFBwEBBFowWDBW\nBggrBgEFBQcwAoZKaHR0cDovL3d3dy5nc3RhdGljLmNvbS9Hb29nbGVJbnRlcm5l\ndEF1dGhvcml0eS9Hb29nbGVJbnRlcm5ldEF1dGhvcml0eS5jcnQwDAYDVR0TAQH/\nBAIwADCCApUGA1UdEQSCAowwggKIggwqLmdvb2dsZS5jb22CDSouYW5kcm9pZC5j\nb22CFiouYXBwZW5naW5lLmdvb2dsZS5jb22CEiouY2xvdWQuZ29vZ2xlLmNvbYIW\nKi5nb29nbGUtYW5hbHl0aWNzLmNvbYILKi5nb29nbGUuY2GCCyouZ29vZ2xlLmNs\ngg4qLmdvb2dsZS5jby5pboIOKi5nb29nbGUuY28uanCCDiouZ29vZ2xlLmNvLnVr\ngg8qLmdvb2dsZS5jb20uYXKCDyouZ29vZ2xlLmNvbS5hdYIPKi5nb29nbGUuY29t\nLmJygg8qLmdvb2dsZS5jb20uY2+CDyouZ29vZ2xlLmNvbS5teIIPKi5nb29nbGUu\nY29tLnRygg8qLmdvb2dsZS5jb20udm6CCyouZ29vZ2xlLmRlggsqLmdvb2dsZS5l\nc4ILKi5nb29nbGUuZnKCCyouZ29vZ2xlLmh1ggsqLmdvb2dsZS5pdIILKi5nb29n\nbGUubmyCCyouZ29vZ2xlLnBsggsqLmdvb2dsZS5wdIIPKi5nb29nbGVhcGlzLmNu\nghQqLmdvb2dsZWNvbW1lcmNlLmNvbYINKi5nc3RhdGljLmNvbYIMKi51cmNoaW4u\nY29tghAqLnVybC5nb29nbGUuY29tghYqLnlvdXR1YmUtbm9jb29raWUuY29tgg0q\nLnlvdXR1YmUuY29tggsqLnl0aW1nLmNvbYILYW5kcm9pZC5jb22CBGcuY2+CBmdv\nby5nbIIUZ29vZ2xlLWFuYWx5dGljcy5jb22CCmdvb2dsZS5jb22CEmdvb2dsZWNv\nbW1lcmNlLmNvbYIKdXJjaGluLmNvbYIIeW91dHUuYmWCC3lvdXR1YmUuY29tMA0G\nCSqGSIb3DQEBBQUAA4GBAFZEhDWxbA1YuvoOzaqe0SlP16HuqRIcRA4R6l2l4S44\nuepgAFFGMHADUwZijhvBfuLkhep8dzz+g8Z7lzoU0qfggaQlcpPtLEYhJbvpU3xs\nsi+tAo/VJDvoI61TzsqgyrJJtOq0gzyQ6GXWl3dX6qai9sOfB/p4HnQrcgWXaDf6\n-----END CERTIFICATE-----\nsubject=/C=US/ST=California/L=Mountain View/O=Google Inc/CN=*.google.com\nissuer=/C=US/O=Google Inc/CN=Google Internet Authority\n---\nNo client certificate CA names sent\n---\nSSL handshake has read 2388 bytes and written 307 bytes\n---\nNew, TLSv1/SSLv3, Cipher is RC4-SHA\nServer public key is 1024 bit\nSecure Renegotiation IS supported\nCompression: NONE\nExpansion: NONE\nSSL-Session:\n Protocol : TLSv1\n Cipher : RC4-SHA\n Session-ID: DA49B5C8BF8EF63435AA01F7F9610579BF9AD7F5E805C787C00A2CDB34796F2B\n Session-ID-ctx:\n Master-Key: 67EE0744C5F462632AB404B0BE3ECE7668158D83085BA4AA8A0654D3CD92A5270E75D32929A158D2402ABD24C4CB6FEF\n Key-Arg : None\n Start Time: 26420\n Timeout : 300 (sec)\n Verify return code: 9 (certificate is not yet valid)\n---\n```\n\n**Verify return code: 9 (certificate is not yet valid)**\n\nThanks @t-8ch! \n\nThe time was wrong, after setting up ntp everything works.\n", "Thanks @t-8ch for helping @athoik clear this up.\n" ]
https://api.github.com/repos/psf/requests/issues/1175
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1175/labels{/name}
https://api.github.com/repos/psf/requests/issues/1175/comments
https://api.github.com/repos/psf/requests/issues/1175/events
https://github.com/psf/requests/issues/1175
10,794,620
MDU6SXNzdWUxMDc5NDYyMA==
1,175
Cannot send multiple headers with the same name
{ "avatar_url": "https://avatars.githubusercontent.com/u/189873?v=4", "events_url": "https://api.github.com/users/xealot/events{/privacy}", "followers_url": "https://api.github.com/users/xealot/followers", "following_url": "https://api.github.com/users/xealot/following{/other_user}", "gists_url": "https://api.github.com/users/xealot/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/xealot", "id": 189873, "login": "xealot", "node_id": "MDQ6VXNlcjE4OTg3Mw==", "organizations_url": "https://api.github.com/users/xealot/orgs", "received_events_url": "https://api.github.com/users/xealot/received_events", "repos_url": "https://api.github.com/users/xealot/repos", "site_admin": false, "starred_url": "https://api.github.com/users/xealot/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/xealot/subscriptions", "type": "User", "url": "https://api.github.com/users/xealot", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2013-02-08T20:37:26Z
2021-09-09T05:00:44Z
2013-02-10T22:27:41Z
NONE
resolved
Internally a dictionary is used, but that doesn't adhere to the http specification. Headers can be specified more than once with the same name. Checkout werkzeug's Headers() data structure. http://werkzeug.pocoo.org/docs/datastructures/#http-related
{ "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/1175/reactions" }
https://api.github.com/repos/psf/requests/issues/1175/timeline
null
completed
null
null
false
[ "Related: #1155\n", "Correct! Closing for #1155\n" ]
https://api.github.com/repos/psf/requests/issues/1174
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1174/labels{/name}
https://api.github.com/repos/psf/requests/issues/1174/comments
https://api.github.com/repos/psf/requests/issues/1174/events
https://github.com/psf/requests/pull/1174
10,790,356
MDExOlB1bGxSZXF1ZXN0NDA2MTQ1Nw==
1,174
Added the ability to track the referer between requests and cleaned up some docstrings
{ "avatar_url": "https://avatars.githubusercontent.com/u/2882?v=4", "events_url": "https://api.github.com/users/nikolay/events{/privacy}", "followers_url": "https://api.github.com/users/nikolay/followers", "following_url": "https://api.github.com/users/nikolay/following{/other_user}", "gists_url": "https://api.github.com/users/nikolay/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/nikolay", "id": 2882, "login": "nikolay", "node_id": "MDQ6VXNlcjI4ODI=", "organizations_url": "https://api.github.com/users/nikolay/orgs", "received_events_url": "https://api.github.com/users/nikolay/received_events", "repos_url": "https://api.github.com/users/nikolay/repos", "site_admin": false, "starred_url": "https://api.github.com/users/nikolay/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/nikolay/subscriptions", "type": "User", "url": "https://api.github.com/users/nikolay", "user_view_type": "public" }
[]
closed
true
null
[]
null
8
2013-02-08T18:36:22Z
2021-09-08T19:00:46Z
2013-02-10T22:01:39Z
NONE
resolved
Added "track_referer" attribute and "last_page" to Session so that the last response's URL can be used as the referer on the next request. The header can still be overwritten globally via Session.headers or on per-request basis.
{ "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/1174/reactions" }
https://api.github.com/repos/psf/requests/issues/1174/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/1174.diff", "html_url": "https://github.com/psf/requests/pull/1174", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/1174.patch", "url": "https://api.github.com/repos/psf/requests/pulls/1174" }
true
[ "we aren't really interested in adding new features at this time.\n\nthe other changes looked pretty nice though, could you remove `track_referer` and `last_page` so I can merge?\n", "I really need this to simulate the browser's behavior and makes my code pretty ugly to get the URL from the previous request and pass it to the next. How about if I generalize this to a hook that can modify headers and more right before the request is sent? This way, a lot more than just user agent tracking can be done. In general, hooks need to be expanded to all events (pre and post), but I'm sure you're well-aware of it. :)\n", "@nikolay pre-request hooks were removed in the refactor. An (albeit ugly) way of doing this would be to use `allow_redirects=False` and manage it yourself, but as we're not accepting new [features](https://github.com/kennethreitz/requests/issues/1165), it is unlikely either hooks will come back or sending a referrer header will be accepted. The rest of your changes look great though. Thank you for them! :+1:\n", "Okay then. I guess, my only option then is to create a separate module that wraps around Requests to simulate a browser's behavior more closely. I will then remove my changes and do more cleanups. :)\n", "@nikolay would you rather I remove the referrer tracking or would you be willing to do it? Kenneth mentioned liking the rest of the changes and his desire to merge the pull for those changes. If not, just let me know.\n", "I'm gonna do it later tonight - I just got busy with other things. There are a few more polishing I've done here and there.\n", "Sounds good. I'm just checking up.\n", "Closing for now — comment when we can reopen :)\n" ]
https://api.github.com/repos/psf/requests/issues/1173
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1173/labels{/name}
https://api.github.com/repos/psf/requests/issues/1173/comments
https://api.github.com/repos/psf/requests/issues/1173/events
https://github.com/psf/requests/pull/1173
10,767,562
MDExOlB1bGxSZXF1ZXN0NDA1MDM5NA==
1,173
Use send in resolve redirects
{ "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
7
2013-02-08T04:11:02Z
2021-09-08T23:06:06Z
2013-02-10T22:21:13Z
CONTRIBUTOR
resolved
These three (which I'll happily squash if you'd like) should prevent the problem I mentioned [here](https://github.com/kennethreitz/requests/pull/1151#issuecomment-12905796).
{ "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/1173/reactions" }
https://api.github.com/repos/psf/requests/issues/1173/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/1173.diff", "html_url": "https://github.com/psf/requests/pull/1173", "merged_at": "2013-02-10T22:21:13Z", "patch_url": "https://github.com/psf/requests/pull/1173.patch", "url": "https://api.github.com/repos/psf/requests/pulls/1173" }
true
[ "+1\nGenerally speaking I've been thinking about raising issue with architecture for some time now :) The problem I see with current architecture is that redirect logic doesn't reuse standard path of sending requests and this causes all sorts of problems; I'm sure we've had more than few bugs because of this in the past. I'm glad you made the above changes.\n", "I'm glad to have made you glad Piotr. It isn't something I seem to do too often. :-P\n", "Hmm, looking at it more closely now... I think I might have missed the true nature of your changes. You propose to use `.send()` instead of `.request()` which actually is going in the opposite direction. Could you elaborate on your changes? Why do you say _we shouldn't be sending the data on redirect_?\n", "Using `Session.send` is required. When we are managing everything (i.e., constructing, preparing and sending the request) we will ALWAYS have the original unprepared `Request` object. If instead, a user does the following (as mentioned in the comment linked above).\n\n``` python\nimport requests\n\np = requests.Request('GET', 'https://httpbin.org/redirect/2').prepare()\ns = requests.Session()\nresp = s.send(p, allow_redirects=True)\n```\n\nThen `Session.resolve_redirects` will be relying on a non-existent `Request` object. The only way to make the API work for users is to either require (via a non-keyword argument) the unprepared `Request` or to more simply use the `PreparedRequest`.\n\nAs for not sending the data on redirect, if you look at the original call to `Session.request` upon redirect, the data was never sent. That's because it shouldn't since requests [behaves like a browser](https://github.com/kennethreitz/requests/pull/1044#issuecomment-11539872). I was simply making sure it behaved exactly as it was expected to prior to this change.\n", "Ah, I remember why you're [concerned](https://github.com/kennethreitz/requests/issues/1084#issuecomment-12742129). I'll factor that in. Thanks.\n", "Why is it necessary to have construct a `PreparedRequest` from scratch?\n", "Rebased. And @kennethreitz I reconstruct a `PreparedRequest` because previously the original was what we made the `request` attribute on the `Response` object. This is just to keep backwards compatibility and not surprise anyone relying on that.\n" ]
https://api.github.com/repos/psf/requests/issues/1172
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1172/labels{/name}
https://api.github.com/repos/psf/requests/issues/1172/comments
https://api.github.com/repos/psf/requests/issues/1172/events
https://github.com/psf/requests/pull/1172
10,754,729
MDExOlB1bGxSZXF1ZXN0NDA0NDExNQ==
1,172
#1170 suggestion for the requested refactoring
{ "avatar_url": "https://avatars.githubusercontent.com/u/175126?v=4", "events_url": "https://api.github.com/users/grzn/events{/privacy}", "followers_url": "https://api.github.com/users/grzn/followers", "following_url": "https://api.github.com/users/grzn/following{/other_user}", "gists_url": "https://api.github.com/users/grzn/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/grzn", "id": 175126, "login": "grzn", "node_id": "MDQ6VXNlcjE3NTEyNg==", "organizations_url": "https://api.github.com/users/grzn/orgs", "received_events_url": "https://api.github.com/users/grzn/received_events", "repos_url": "https://api.github.com/users/grzn/repos", "site_admin": false, "starred_url": "https://api.github.com/users/grzn/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/grzn/subscriptions", "type": "User", "url": "https://api.github.com/users/grzn", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2013-02-07T20:43:38Z
2021-09-08T19:00:46Z
2013-02-07T22:09:55Z
NONE
resolved
okay i was too lazy to clone the repository and do this, but with the in-browser its really quick :)
{ "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/1172/reactions" }
https://api.github.com/repos/psf/requests/issues/1172/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/1172.diff", "html_url": "https://github.com/psf/requests/pull/1172", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/1172.patch", "url": "https://api.github.com/repos/psf/requests/pulls/1172" }
true
[ "I'm entirely +0 on this.\n", "This seems entirely pointless.\n\n@grzn sorry if that seems blunt, but I already made my intentions clear in the other conversation we had :)\n" ]
https://api.github.com/repos/psf/requests/issues/1171
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1171/labels{/name}
https://api.github.com/repos/psf/requests/issues/1171/comments
https://api.github.com/repos/psf/requests/issues/1171/events
https://github.com/psf/requests/issues/1171
10,753,198
MDU6SXNzdWUxMDc1MzE5OA==
1,171
ConnectionResetError on Windows 7/Python 3.3
{ "avatar_url": "https://avatars.githubusercontent.com/u/3504959?v=4", "events_url": "https://api.github.com/users/norey/events{/privacy}", "followers_url": "https://api.github.com/users/norey/followers", "following_url": "https://api.github.com/users/norey/following{/other_user}", "gists_url": "https://api.github.com/users/norey/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/norey", "id": 3504959, "login": "norey", "node_id": "MDQ6VXNlcjM1MDQ5NTk=", "organizations_url": "https://api.github.com/users/norey/orgs", "received_events_url": "https://api.github.com/users/norey/received_events", "repos_url": "https://api.github.com/users/norey/repos", "site_admin": false, "starred_url": "https://api.github.com/users/norey/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/norey/subscriptions", "type": "User", "url": "https://api.github.com/users/norey", "user_view_type": "public" }
[]
closed
true
null
[]
null
30
2013-02-07T20:02:41Z
2021-09-09T05:00:45Z
2013-02-08T23:47:33Z
NONE
resolved
I get this error whenever I use any URL with .get() on Windows 7 x64 and Python3.3 http://bpaste.net/show/cavZW7pfXISmFdNMga4n/ Edit: I forgot to mention that I get the error after waiting a while.. around 5 mins.. just waiting for the command to respond Stacktrace: ``` python Traceback (most recent call last): File "<pyshell#1>", line 1, in <module> r = requests.get('http://www.wwenews.us/1334995', allow_redirects=True) File "C:\Python33\lib\site-packages\requests\api.py", line 55, in get return request('get', url, **kwargs) File "C:\Python33\lib\site-packages\requests\api.py", line 44, in request return session.request(method=method, url=url, **kwargs) File "C:\Python33\lib\site-packages\requests\sessions.py", line 279, in request resp = self.send(prep, stream=stream, timeout=timeout, verify=verify, cert=cert, proxies=proxies) File "C:\Python33\lib\site-packages\requests\sessions.py", line 374, in send r = adapter.send(request, **kwargs) File "C:\Python33\lib\site-packages\requests\adapters.py", line 222, in send r.content File "C:\Python33\lib\site-packages\requests\models.py", line 550, in content self._content = bytes().join(self.iter_content(CONTENT_CHUNK_SIZE)) or bytes() File "C:\Python33\lib\site-packages\requests\models.py", line 496, in generate chunk = self.raw.read(chunk_size) File "C:\Python33\lib\site-packages\requests\packages\urllib3\response.py", line 148, in read return self._fp.read(amt) File "C:\Python33\lib\http\client.py", line 499, in read return super(HTTPResponse, self).read(amt) File "C:\Python33\lib\http\client.py", line 534, in readinto n = self.fp.readinto(b) File "C:\Python33\lib\socket.py", line 297, in readinto return self._sock.recv_into(b) ConnectionResetError: [WinError 10054] An existing connection was forcibly closed by the remote host ```
{ "avatar_url": "https://avatars.githubusercontent.com/u/3504959?v=4", "events_url": "https://api.github.com/users/norey/events{/privacy}", "followers_url": "https://api.github.com/users/norey/followers", "following_url": "https://api.github.com/users/norey/following{/other_user}", "gists_url": "https://api.github.com/users/norey/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/norey", "id": 3504959, "login": "norey", "node_id": "MDQ6VXNlcjM1MDQ5NTk=", "organizations_url": "https://api.github.com/users/norey/orgs", "received_events_url": "https://api.github.com/users/norey/received_events", "repos_url": "https://api.github.com/users/norey/repos", "site_admin": false, "starred_url": "https://api.github.com/users/norey/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/norey/subscriptions", "type": "User", "url": "https://api.github.com/users/norey", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/1171/reactions" }
https://api.github.com/repos/psf/requests/issues/1171/timeline
null
completed
null
null
false
[ "@shazow any clues?\n", "On linux, requests fails to parse the response (It does parse the status code). The first header sent by the server is this one:\n(If I read the RFC correctly spaces in header names aren't allowed)\n\n```\nSecured by Excellent Serv: \n```\n\nIt seems this one breaks the response parsing. Raw httplib (which is used by urllib3) can't handle it either.\n\nThis is the whole response:\n\n``` http\nHTTP/1.1 301 Moved Permanently\nSecured by Excellent Serv : \nDate: Thu, 07 Feb 2013 20:48:01 GMT\nContent-Type: text/html; charset=iso-8859-1\nConnection: close\nLocation: http://wn.arabseed.com/1334995\nCache-Control: private\n```\n", "This isn't giving me any issues oddly enough. Perhaps this is another issue based on your physical location as well?\n", "Uh, hang on. Two different users have posted in this issue. The traceback in the original post does not indicate what the URL was, so I can't tell whether this is one issue or two. @norey @t-8ch, are you two talking about the same problem, and if so, how on earth do you know? :confused: \n", "In fact, rereading this, there's simply no way these are the same issue. @norey claims that **any** URL fails, which is clearly not a header related problem. @t-8ch, can you please open a new issue instead of hijacking this one? =)\n", "Following up on @norey's problem:\n\nI can't reproduce this. I'm running Windows 7 x64, Python 3.3 (64-bit version), and can quite happily send get requests to Google.\n", "I just tried requesting Google and some other URLs, and it worked fine. But that URL still gives me the same error... I don't get the reason especially when @sigmavirus24 didn't have any issues.\n", "@norey: Just to be totally clear, what exact URL is causing you problems?\n", "@Lukasa the one shown in the paste I posted.\n\nI just tried it on Python2.7.3 and it works !! but not on Python3.3 !! \nLooks like something FUBARed at my end but can't seem to locate it.\n", "Aha, no, I don't think it is. I ran the same code, once in Python3.3 and once in 2.7.\n\nIn Python 2.7:\n\n``` python\n>>> import requests\n>>> r = requests.get('http://www.wwenews.us/1334995')\n>>> r.status_code\n200\n>>> r.headers\n{'content-encoding': 'gzip', 'secured by excellent serv ': '', 'x-powered-by': 'PHP/5.2.17', 'vary': 'Accept-Encoding', 'transfer-encoding': 'chunked', 'connection': 'close', 'cache-control': 'private', 'date': 'Fri, 08 Feb 2013 09:55:43 GMT', 'content-type': 'text/html'}\n>>> r.url\nu'http://wn.arabseed.com/1334995'\n```\n\nWhereas, in Python 3.3:\n\n``` python\n>>> import requests\n>>> r = requests.get('http://www.wwenews.us/1334995')\n>>> r.status_code\n301\n>>> r.headers\n{}\n```\n\nSo I actually think this is the same, and that header is choking on Python 3.3. Not sure why yet.\n", "I get the same output ( @Lukasa's output of 3.3) on my Linux box running Python 3.2.3\n\nSo seems that it's an issue in Python 3, right ?\n", "Wireshark chokes on that input too, and fails to parse the rest of the body into headers. Frankly, I think the server is doing something stupid here.\n", "no doubt, but why can't I use requests on Py3.3/Windows with that URL.. whereas Py2.7 handles it normally.. very strange... I think I should format the PC :P\n", "I don't think its your PCs problem, as I can repro it.\n", "You can reproduce the error I get in my paste?\n", "Yeah just checked. I get the 301 as well. I was just checking for an exception last night.\n", "Right, so @norey, your exception seems to be specific to you. @sigmavirus24 and I are getting the \"can't parse headers\" issue.\n", "With python 3 responses are parsed by `email.parser.Parser`.\nPython 2 used `mimetools.Message`, a subclass of `rfc822.Message`, both now\ndeprecated.\n\nThe differences begin in `HTTPResponse.begin()`.\n\nPut this in `headers.txt`:\n\n```\nSecured by Excellent Serv : \nDate: Fri, 08 Feb 2013 16:12:22 GMT\nContent-Type: text/html; charset=iso-8859-1\nConnection: close\nLocation: http://wn.arabseed.com/1334995\nCache-Control: private\n```\n\nAnd run this (python3):\n\n``` python\nfrom email.parser import Parser\nf = open('headers.txt')\nprint(Parser().parse(f).items())\n```\n\nNow remove the broken header and repeat.\n\nEdit: new testcode\n", "The root of the problem lies in `email.feedparser.FeedParser._feedgen()` where it aborts on the first non-header line.\nIf a line is a header is determined by matching a regex (`email.feedparser.headerRE`), which by default doesn't allow spaces.\n\nIf you change this regex from\n\n```\nheaderRE = re.compile(r'^(From |[\\041-\\071\\073-\\176]{1,}:|[\\t ])')\n```\n\nto something like the following it should work.\n\n``` python\n# space here v\nheaderRE = re.compile(r'^(From |[\\041-\\071\\073-\\176 ]{1,}:|[\\t ])')\n```\n\nThis snippet would allow spaces in headers:\n\n``` python\nimport re\nimport email\nimport requests\n\nemail.feedparser.headerRE = re.compile(r'^(From |[\\041-\\071\\073-\\176 ]{1,}:|[\\t])')\nr = requests.get('http://www.wwenews.us/1334995')\nprint(r.status_code)\nprint(r.content)\n```\n\n@norey\nThis is a workaround, not a bugfix.\nThe whole problem is caused by the server not sending conformant HTTP responses.\nRequests and python do the right thing.\nAnyway, I hope this helps you.\n", "@t-8ch if this isn't standards compliant report it upstream at bugs.python.org please. You seem to have a good understanding of what is happening.\n\nOn a separate topic, @norey, you said this happens with any URL you use. Were you exaggerating or were you being serious? The reason I ask is because using requests on python 3.3 works perfectly fine for me.\n", "Ah I wasn't clear.\nThis is a workaround for the horrible brokenness of this server side 'security' feature (ha, maybe this is scrape protection).\n\nI am fairly sure, that python is compliant.\n\n[RFC 2616 Section 4.2](https://tools.ietf.org/html/rfc2616#page-31) defines the header names as a single `token`.\n[Section 2.2](https://tools.ietf.org/html/rfc2616#section-2.2) about tokens:\n\n```\n[..]\nSP = <US-ASCII SP, space (32)>\n[..]\ntoken = 1*<any CHAR except CTLs or separators>\nseparators = \"(\" | \")\" | \"<\" | \">\" | \"@\"\n | \",\" | \";\" | \":\" | \"\\\" | <\">\n | \"/\" | \"[\" | \"]\" | \"?\" | \"=\"\n | \"{\" | \"}\" | SP | HT\n```\n\n[RFC822 Section 3.2](https://tools.ietf.org/html/rfc822#section-3.2), also\ncitet in RFC 2625 Section 4.2, defines headers in this way:\n\n```\nfield = field-name \":\" [ field-body ] CRLF\nfield-name = 1*<any CHAR, excluding CTLs, SPACE, and \":\">\nfield-body = [....]\n```\n\nSo no space in header names (looks horrible anyways, imho).\n", "@sigmavirus24 I actually tried with a couple of URLs not everything, so I just assumed. But I tried again on Google and it works fine the other URL that gives the exception is ( it is the same server I guess, giving that crap)\n\n``` python\nrequests.get('http://forum.arabseed.com/showthread.php?p=1202597#post1202597')\n```\n\nOk now, let's disregard its behavior and concentrate on the exception I am getting, what is its reason? (it is in my first post). \n", "Could you run the snippet I posted in my previous comment (https://github.com/kennethreitz/requests/issues/1171#issuecomment-13300401)\nDoes this fix the exception?\n", "I ran it, and no more exception! great!\n\nThe question is why didn't you guy get that exception while I did...\n", "Maybe it is some broken proxy which tries to parse the headers before it forwards the status code.\nIf you really want to know it, take _working_ website and examine the headers (or post them here).\n\n``` python\nimport requests\nr = requests.get(\"http://test.t-8ch.de/\")\nprint(r.headers)\n```\n\nCould you also paste the stack trace directly into your first post for future reference?\n", "sure, done!\n\nheaders:\n\n``` python\n{'connection': 'Keep-Alive', 'content-type': 'text/html; charset=utf-8', 'server': 'nginx', 'expires': 'Fri, 08 Feb 2013 21:16:04 GMT', 'content-encoding': 'gzip', 'transfer-encoding': 'chunked', 'cache-control': 'no-cache', 'last-modified': 'Sun, 15 Apr 2012 16:53:58 GMT', 'date': 'Fri, 08 Feb 2013 21:16:05 GMT'}\n```\n", "Looks fine. I'd still blame a misbehaving proxy. You can try it over a different connection (tethered from you mobile phone) or from a different machine. As nobody can reproduce this there aren't many possibilies left.\nI don't know if the bugtracker is the right place for this back and forth. If you want you can contact me via mail or xmpp (same address as mail) and we can post the final result here again.\n", "@norey\n\n``` pycon\n~/sandbox/requests (master) python3.3\nPython 3.3.0 (default, Dec 15 2012, 17:19:46) \n[GCC 4.5.2] on linux\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\n>>> import requests\n>>> r = requests.get('http://forum.arabseed.com/showthread.php?p=1202597#post1202597')\n>>> r\n<Response [200]>\n>>> r.headers\n{}\n```\n\nWhat I did notice is that for that website, the headers dictionary was completely empty. That is horribly uncharacteristic.\n\nIt seems like every website you're looking at does something wacky with their headers. I'm +1 on closing this issue right now, but if you can find a different URL that also causes this error for you, I don't mind keeping it open.\n", "Thank you all for helping me out with this.. but what can I do if my luck went with bad websites =)\n\nI will close it now, and thanks again\n", "@norey I didn't mean you should close this, just that the evidence so far is that some people don't know how to run servers. If you can find other sites that do this, feel free to contact @t-8ch or myself via email, or just post it back here.\n" ]
https://api.github.com/repos/psf/requests/issues/1170
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1170/labels{/name}
https://api.github.com/repos/psf/requests/issues/1170/comments
https://api.github.com/repos/psf/requests/issues/1170/events
https://github.com/psf/requests/issues/1170
10,753,141
MDU6SXNzdWUxMDc1MzE0MQ==
1,170
Bring back the hooks from 0.x to 1.x
{ "avatar_url": "https://avatars.githubusercontent.com/u/175126?v=4", "events_url": "https://api.github.com/users/grzn/events{/privacy}", "followers_url": "https://api.github.com/users/grzn/followers", "following_url": "https://api.github.com/users/grzn/following{/other_user}", "gists_url": "https://api.github.com/users/grzn/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/grzn", "id": 175126, "login": "grzn", "node_id": "MDQ6VXNlcjE3NTEyNg==", "organizations_url": "https://api.github.com/users/grzn/orgs", "received_events_url": "https://api.github.com/users/grzn/received_events", "repos_url": "https://api.github.com/users/grzn/repos", "site_admin": false, "starred_url": "https://api.github.com/users/grzn/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/grzn/subscriptions", "type": "User", "url": "https://api.github.com/users/grzn", "user_view_type": "public" }
[]
closed
true
null
[]
null
8
2013-02-07T20:01:11Z
2021-09-09T05:00:45Z
2013-02-08T03:19:25Z
NONE
resolved
In the 0.x versions were 5 hooks: ('args', 'pre_request', 'pre_send', 'post_request', 'response') In 1.x there's only one: response I've seen quite a few packages that used these hooks to manipulate the requests objects before sending them, and now in v1.x there's not even a single hook that allows them to do so. This functionality is very much needed, and without it quite a few packages simple cannot adapt to v1.x, and their alternative is to the [sort-of-a-fork requests-transition](https://github.com/LuminosoInsight/python-requests-transition)
{ "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/1170/reactions" }
https://api.github.com/repos/psf/requests/issues/1170/timeline
null
completed
null
null
false
[ "We ased for package maintainers and authors that used the hooks extensively to comment on the change and received little feedback. I made use of one as well (args), but adapted with a small bit of work. I find it hard to believe that people can simply not make due without them.\n", "We should throw together some better documentation perhaps\n", "I agree that you can work around the missing 'args' hook by overloading, but there's not a clean way to work around the missing 'pre_request' hook, which allowed you to modify the request object before it is being sent.\n\nfrom sessions.py:\n\n```\n # Create the Request.\n req = Request()\n req.method = method.upper()\n req.url = url\n req.headers = headers\n req.files = files\n req.data = data\n req.params = params\n req.auth = auth\n req.cookies = cookies\n req.hooks = hooks\n\n # Prepare the Request.\n prep = req.prepare()\n\n # Send the request.\n send_kwargs = {\n 'stream': stream,\n 'timeout': timeout,\n 'verify': verify,\n 'cert': cert,\n 'proxies': proxies,\n 'allow_redirects': allow_redirects,\n 'req': req,\n }\n resp = self.send(prep, **send_kwargs)\n```\n\nI don't see another way to mess with the request before it is being prepared, except for patching/replacing requests.sessions.Request, which obviously is not a good solution.\n", "although the hooks mechanism was cleaner, if you could just extract the code that creates the request into another method, whoever that wants to manipulate would simply overload/decorate it, and that would work just fine\n", "That's exactly what we did Request() returns a PreparedRequest, which is fully mutable :)\n", "@grzn, You can do that yourself.\n\n``` python\nrequest = Request(\n 'GET',\n 'http://example.com',\n #...\n)\n\np = request.prepare()\n\ns = requests.Session()\ns.send(p, stream=True, verify=False,\n# etc\n)\n```\n", "@kennethreitz but some things are much harder/tricky to change after you've prepared the requests, and even so the way to modify is to overload the send method and modify the argument it receives. that's ugly\n\n@sigmavirus24 yes you can do that yourself by inheriting the Session class and replacing the request method with a similar functionality, but thats also ugly -- this method is quite long and does a number of things and I don't duplicate the whole damn thing.\n\nall i'm asking it to take the 10 lines that create the requests before 'preparing it' and extract it to a separate method. overloading such method would be the equivalent for the old pre_request hook\n\nand also, some documentation on this in the hooks page would help :)\n", "In light of #1170, I think it is fair to close this.\n" ]
https://api.github.com/repos/psf/requests/issues/1169
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1169/labels{/name}
https://api.github.com/repos/psf/requests/issues/1169/comments
https://api.github.com/repos/psf/requests/issues/1169/events
https://github.com/psf/requests/pull/1169
10,713,352
MDExOlB1bGxSZXF1ZXN0NDAyNDMxNw==
1,169
Fixed get_unicode_from_response() to do what it says in the docstring.
{ "avatar_url": "https://avatars.githubusercontent.com/u/1270393?v=4", "events_url": "https://api.github.com/users/Mimino666/events{/privacy}", "followers_url": "https://api.github.com/users/Mimino666/followers", "following_url": "https://api.github.com/users/Mimino666/following{/other_user}", "gists_url": "https://api.github.com/users/Mimino666/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Mimino666", "id": 1270393, "login": "Mimino666", "node_id": "MDQ6VXNlcjEyNzAzOTM=", "organizations_url": "https://api.github.com/users/Mimino666/orgs", "received_events_url": "https://api.github.com/users/Mimino666/received_events", "repos_url": "https://api.github.com/users/Mimino666/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Mimino666/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Mimino666/subscriptions", "type": "User", "url": "https://api.github.com/users/Mimino666", "user_view_type": "public" }
[]
closed
true
null
[]
null
10
2013-02-06T21:53:53Z
2021-09-08T19:00:45Z
2013-02-06T22:25:29Z
NONE
resolved
Also added a reasonable encoding in the fall-back case.
{ "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/1169/reactions" }
https://api.github.com/repos/psf/requests/issues/1169/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/1169.diff", "html_url": "https://github.com/psf/requests/pull/1169", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/1169.patch", "url": "https://api.github.com/repos/psf/requests/pulls/1169" }
true
[ "The docstring is incorrect then\n", "Hm, why is that? To me it sounded like a reasonable heuristic.\nAlso, how come this function is nowhere used?\n", "Because Requests is not an HTML library. =) We used to parse HTML, but now we don't. The function is left over from when we did.\n", "Oh, I thought you were modifying the `get_encoding_from_headers` :)\n\nThis isn't used because requests is an http client, not an html client.\n", "honestly we should likely remove this\n", "but people might be using it\n", "It's a good utility function. =)\n", "I understand, but anyway, why isn't it simply called from response.text. Now there are 2 html functions.\n", "Because it's incorrect to assume that data returned over HTTP is necessarily HTML, and even if it is, Requests shouldn't parse it.\n", "Got it =)\n" ]
https://api.github.com/repos/psf/requests/issues/1168
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1168/labels{/name}
https://api.github.com/repos/psf/requests/issues/1168/comments
https://api.github.com/repos/psf/requests/issues/1168/events
https://github.com/psf/requests/pull/1168
10,706,648
MDExOlB1bGxSZXF1ZXN0NDAyMDYzNw==
1,168
Feature freeze.
{ "avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4", "events_url": "https://api.github.com/users/Lukasa/events{/privacy}", "followers_url": "https://api.github.com/users/Lukasa/followers", "following_url": "https://api.github.com/users/Lukasa/following{/other_user}", "gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Lukasa", "id": 1382556, "login": "Lukasa", "node_id": "MDQ6VXNlcjEzODI1NTY=", "organizations_url": "https://api.github.com/users/Lukasa/orgs", "received_events_url": "https://api.github.com/users/Lukasa/received_events", "repos_url": "https://api.github.com/users/Lukasa/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions", "type": "User", "url": "https://api.github.com/users/Lukasa", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2013-02-06T19:04:29Z
2021-09-08T23:06:21Z
2013-02-06T19:53:55Z
MEMBER
resolved
See issue #1165. Not finished yet, gotta do the contributing.md thing.
{ "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/1168/reactions" }
https://api.github.com/repos/psf/requests/issues/1168/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/1168.diff", "html_url": "https://github.com/psf/requests/pull/1168", "merged_at": "2013-02-06T19:53:55Z", "patch_url": "https://github.com/psf/requests/pull/1168.patch", "url": "https://api.github.com/repos/psf/requests/pulls/1168" }
true
[ "<3\n" ]
https://api.github.com/repos/psf/requests/issues/1167
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1167/labels{/name}
https://api.github.com/repos/psf/requests/issues/1167/comments
https://api.github.com/repos/psf/requests/issues/1167/events
https://github.com/psf/requests/issues/1167
10,664,386
MDU6SXNzdWUxMDY2NDM4Ng==
1,167
push users to stack overflow first
{ "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": "e102d8", "default": false, "description": null, "id": 117745, "name": "Planned", "node_id": "MDU6TGFiZWwxMTc3NDU=", "url": "https://api.github.com/repos/psf/requests/labels/Planned" } ]
closed
true
null
[]
null
2
2013-02-05T19:46:58Z
2021-09-08T23:04:51Z
2015-05-03T15:09:22Z
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/1167/reactions" }
https://api.github.com/repos/psf/requests/issues/1167/timeline
null
completed
null
null
false
[ "I already occasionally answer questions tagged with `python-requests` so it wouldn't be a bad place for people to start.\n", "+1\n" ]
https://api.github.com/repos/psf/requests/issues/1166
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1166/labels{/name}
https://api.github.com/repos/psf/requests/issues/1166/comments
https://api.github.com/repos/psf/requests/issues/1166/events
https://github.com/psf/requests/issues/1166
10,664,298
MDU6SXNzdWUxMDY2NDI5OA==
1,166
Make test suite totally offline
{ "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": "e102d8", "default": false, "description": null, "id": 117745, "name": "Planned", "node_id": "MDU6TGFiZWwxMTc3NDU=", "url": "https://api.github.com/repos/psf/requests/labels/Planned" } ]
closed
true
null
[]
null
10
2013-02-05T19:44:33Z
2021-09-08T23:10:37Z
2014-09-01T14:38:30Z
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/1166/reactions" }
https://api.github.com/repos/psf/requests/issues/1166/timeline
null
completed
null
null
false
[ "We could use @kanzure's project which relies on HTTPretty or we could use mock like I do in github3.py. If you chose the latter, I'll be happy to work on the tests.\n", "In particular, I think he is referring to [kanzure/python-requestions](https://github.com/kanzure/python-requestions). The httpetrified decorator is a simple way to use HTTPretty with a serialized Request or Response. However, it presently does not work with multiple requests or multiple responses.\n", "Btw, my comment was not meant as a way of saying \"Pick me because I'll do the work!\", more of a, there are a couple different ways of doing it. I've helped @kanzure by just reading over kanzure/python-requestions a couple times and I like it, but I'm also quite familiar using mock directly. Testing redirects would be fairly ugly. If we were to do something like github3.py does it, we could have a method to craft the Response objects as the `return_value` on the mock and if we patched on the Adapter level, we would have to use mock's ability to have multiple return_values in succession. I have to re-read the docs to see how that's done though. Just an example of one of the slightly more challenging tests we might have to consider.\n", "What about spawning a local HTTP(S) server like `urllib3`?\n", "@schlamar if I remember correctly, this has been brought up before. Look up CherryPy or Twisted on the issue tracker. We could easily mock responses and test the like. It isn't that difficult. @kanzure and I do the same for our projects.\n", "FYI, I'm working on [requests-vcr](/sigmavirus24/requests-vcr) which I think might make this a lot easier. Also it should make the tests a lot faster.\n", "@sigmavirus24, well, while you're at it, please deprecate my requestions library. I made some poor decisions in its implementation that I think you can just copy. I know you're probably just copying the vcr gem from ruby, but maybe you can add in those decorators for mocking out tests etc.\n", "It's going to take extra work to mimic the VCR gem from Ruby, but I'll look at how difficult it would be to add a decorator.\n\nCurrently, the usage I have in my head is this:\n\n```\ndef setUp(self):\n self.session = requests.Session()\n self.session.headers.update(...)\n\ndef test_user_endpoint(self):\n with VCR(self.session).use_cassette('user') as vcr:\n resp = self.session.get('https://api.github.com/user', auth=('foo', 'bar'))\n assert resp.json().get('login') is not None\n```\n\nWith perhaps some exposition of some mock methods, e.g., `assert_called_with`, etc.\n\nThe call to VCR will be necessary so that we do not have to monkey-patch any libraries (yay transport adapters!).\n", "Now that Betamax exists and seems to cover the majority of use cases (including gzip-encoded response bodies) should we start using that for integration style tests and some combination of unit and acceptance tests?\n", "Closing in deference to https://github.com/kennethreitz/requests/issues/2184\n" ]
https://api.github.com/repos/psf/requests/issues/1165
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1165/labels{/name}
https://api.github.com/repos/psf/requests/issues/1165/comments
https://api.github.com/repos/psf/requests/issues/1165/events
https://github.com/psf/requests/issues/1165
10,664,127
MDU6SXNzdWUxMDY2NDEyNw==
1,165
Document Intentions/Status
{ "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": "e102d8", "default": false, "description": null, "id": 117745, "name": "Planned", "node_id": "MDU6TGFiZWwxMTc3NDU=", "url": "https://api.github.com/repos/psf/requests/labels/Planned" } ]
closed
true
null
[]
null
1
2013-02-05T19:39:38Z
2021-09-09T03:00:33Z
2013-05-29T07:59:44Z
CONTRIBUTOR
resolved
Document our perpetual "feature freeze". Add contibuting.md so people see it when submitting a pull 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/1165/reactions" }
https://api.github.com/repos/psf/requests/issues/1165/timeline
null
completed
null
null
false
[ "@kennethreitz Can you elaborate on what you want contributing.md to be, and how it should relate to the current dev docs?\n" ]
https://api.github.com/repos/psf/requests/issues/1164
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1164/labels{/name}
https://api.github.com/repos/psf/requests/issues/1164/comments
https://api.github.com/repos/psf/requests/issues/1164/events
https://github.com/psf/requests/issues/1164
10,651,363
MDU6SXNzdWUxMDY1MTM2Mw==
1,164
Problem when using PUT in v1.1
{ "avatar_url": "https://avatars.githubusercontent.com/u/429923?v=4", "events_url": "https://api.github.com/users/jaimebuelta/events{/privacy}", "followers_url": "https://api.github.com/users/jaimebuelta/followers", "following_url": "https://api.github.com/users/jaimebuelta/following{/other_user}", "gists_url": "https://api.github.com/users/jaimebuelta/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/jaimebuelta", "id": 429923, "login": "jaimebuelta", "node_id": "MDQ6VXNlcjQyOTkyMw==", "organizations_url": "https://api.github.com/users/jaimebuelta/orgs", "received_events_url": "https://api.github.com/users/jaimebuelta/received_events", "repos_url": "https://api.github.com/users/jaimebuelta/repos", "site_admin": false, "starred_url": "https://api.github.com/users/jaimebuelta/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/jaimebuelta/subscriptions", "type": "User", "url": "https://api.github.com/users/jaimebuelta", "user_view_type": "public" }
[]
closed
true
null
[]
null
3
2013-02-05T14:18:48Z
2021-09-09T05:00:46Z
2013-02-07T14:40:45Z
NONE
resolved
Hi: I'm having a problem when making PUT requests. This problem is not present on version 0.14.2, but it has arisen when I updated the module. It seems that the content of the PUT (data), which should be encoded as a POST, is not being properly encoded. At least, I am not able to receive it when checking on the server. It appears as empty. If I try the 'params' parameter, then it is properly encoded as a QueryParam. The curious thing is that using a POST seems to work fine. I assume that the interface is still the same.
{ "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/1164/reactions" }
https://api.github.com/repos/psf/requests/issues/1164/timeline
null
completed
null
null
false
[ "HTTPBin works fine for me with 'PUTs', can you provide some of the code you're using so I can try to reproduce the issue?\n", "Ups, my mistake. I've been looking at that more carefully, and it turns out to be a problem on redirections...\n\nThe call was being redirected, so the body wasn't being sent again (which is what it should happen). Our framework was doing other stuff, that was raising a different error when finding an empty body...\n\nMy mistake, not Requests ;-)\n", "No worries, thanks for coming back and updating us. =)\n" ]
https://api.github.com/repos/psf/requests/issues/1163
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1163/labels{/name}
https://api.github.com/repos/psf/requests/issues/1163/comments
https://api.github.com/repos/psf/requests/issues/1163/events
https://github.com/psf/requests/issues/1163
10,637,355
MDU6SXNzdWUxMDYzNzM1NQ==
1,163
What happened to danger_mode?
{ "avatar_url": "https://avatars.githubusercontent.com/u/575602?v=4", "events_url": "https://api.github.com/users/zwass/events{/privacy}", "followers_url": "https://api.github.com/users/zwass/followers", "following_url": "https://api.github.com/users/zwass/following{/other_user}", "gists_url": "https://api.github.com/users/zwass/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/zwass", "id": 575602, "login": "zwass", "node_id": "MDQ6VXNlcjU3NTYwMg==", "organizations_url": "https://api.github.com/users/zwass/orgs", "received_events_url": "https://api.github.com/users/zwass/received_events", "repos_url": "https://api.github.com/users/zwass/repos", "site_admin": false, "starred_url": "https://api.github.com/users/zwass/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/zwass/subscriptions", "type": "User", "url": "https://api.github.com/users/zwass", "user_view_type": "public" }
[]
closed
true
null
[]
null
15
2013-02-05T04:29:15Z
2021-09-08T23:10:48Z
2013-02-05T17:29:09Z
NONE
resolved
I was just going to suggest this feature when I noticed pull request https://github.com/kennethreitz/requests/pull/333. Looking in the current code, I can't find any indication of `danger_mode`, or a similar setting. Was there a reason this was removed? I'd be happy to contribute to bringing it back.
{ "avatar_url": "https://avatars.githubusercontent.com/u/575602?v=4", "events_url": "https://api.github.com/users/zwass/events{/privacy}", "followers_url": "https://api.github.com/users/zwass/followers", "following_url": "https://api.github.com/users/zwass/following{/other_user}", "gists_url": "https://api.github.com/users/zwass/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/zwass", "id": 575602, "login": "zwass", "node_id": "MDQ6VXNlcjU3NTYwMg==", "organizations_url": "https://api.github.com/users/zwass/orgs", "received_events_url": "https://api.github.com/users/zwass/received_events", "repos_url": "https://api.github.com/users/zwass/repos", "site_admin": false, "starred_url": "https://api.github.com/users/zwass/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/zwass/subscriptions", "type": "User", "url": "https://api.github.com/users/zwass", "user_view_type": "public" }
{ "+1": 1, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 1, "url": "https://api.github.com/repos/psf/requests/issues/1163/reactions" }
https://api.github.com/repos/psf/requests/issues/1163/timeline
null
completed
null
null
false
[ "I suspect it got pulled out during the big refactor. I'm not opposed to having it back, depends what @kennethreitz thinks.\n", "Danger mode is now the default and the only mode. Safe mode was regarded as useless. Now, that's good news for you! :)\n", "I'm pretty sure it was removed because it was deemed an unnecessary configuration option. And yes, it was deliberately removed during the refactor.\n", "@piotr-dobrogost is correct, it is the default. @zwass, are you okay with closing this issue?\n", "In which version? I'm using 1.1.0 and I get this:\n\n``` python\n>>> import requests\n>>> requests.__version__\n'1.1.0'\n>>> requests.get(\"http://www.google.com/fdsljfd\")\n<Response [404]>\n>>> \n```\n", "@zwass you want to use `raise_for_status`. That was never the purpose of `danger_mode`. `danger_mode` simply suppressed underlying exceptions during the connection or cert validation, basically anything that sub-classed `requests.exceptions.RequestException`. If you look at the end of the page [here](http://docs.python-requests.org/en/v0.14.2/user/quickstart/?highlight=safe_mode) then you might understand it better.\n", "@sigmavirus24 according to that documentation (and the pull request), `danger_mode` caused `raise_for_status` to be called at the end of any request. If this were the default behavior in 1.1.0, my example above would have thrown an `HTTPError: 404 Client Error: Not Found`.\n\nIt seems that the default behavior in 1.1.0 is `safe_mode`, but there is no ability to use the equivalent of `danger_mode`.\n", "Hm, the docs didn't indicate that. The problem is that the entire Configuration API was deliberately removed in the refactor. As such, there isn't really a `safe_mode` either, just the in-between that always existed. A request is a request and any exception that occurs during that is raised. I doubt @kennethreitz would like to re-add this (given there is likely not a very elegant way of doing so without adding the Configuration API back), but I'll re-open it to be fair.\n", "I won't re-add it, however, we need to document this changes better and the intentions behind these decisions\n\nAlso, roadmap.\n\nIn general, we aren't interested in adding new features anymore. This needs to be clear.\n", "Understood about the configuration API. Perhaps we can add a `fail_fast` keyword argument to `requests.request` that would cause `raise_for_status` to be called after the request is executed.\n", "That's equivalent to re-adding part of the configuration API. It's also a new \nfeature and as @kennethreitz mentioned, we aren't adding new features.\n", "Does that mean that requests might merge into the Python standard library soon?\n", "Once things settle down, yes :)\n", "Sweet :+1: \n\nWell, I guess I'll resign myself to calling `raise_for_status` after every request.\n", "#1165\n" ]
https://api.github.com/repos/psf/requests/issues/1162
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1162/labels{/name}
https://api.github.com/repos/psf/requests/issues/1162/comments
https://api.github.com/repos/psf/requests/issues/1162/events
https://github.com/psf/requests/pull/1162
10,557,230
MDExOlB1bGxSZXF1ZXN0Mzk1MzU2NA==
1,162
Proxy Authorization Headers
{ "avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4", "events_url": "https://api.github.com/users/Lukasa/events{/privacy}", "followers_url": "https://api.github.com/users/Lukasa/followers", "following_url": "https://api.github.com/users/Lukasa/following{/other_user}", "gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Lukasa", "id": 1382556, "login": "Lukasa", "node_id": "MDQ6VXNlcjEzODI1NTY=", "organizations_url": "https://api.github.com/users/Lukasa/orgs", "received_events_url": "https://api.github.com/users/Lukasa/received_events", "repos_url": "https://api.github.com/users/Lukasa/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions", "type": "User", "url": "https://api.github.com/users/Lukasa", "user_view_type": "public" }
[]
closed
true
null
[]
null
8
2013-02-01T20:10:31Z
2021-09-09T00:01:20Z
2013-02-06T21:05:04Z
MEMBER
resolved
This is one half of the pair of open problems from #1053. Please code review this before pulling it. I concluded that, as this is fundamentally an authentication issue, this belongs in our code, not in urllib3. For the moment, I have it set up so that if the authentication is provided in the URL, we simply grab it out. It might be worth turning this into a separate part of the API though. Let me know what you 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/1162/reactions" }
https://api.github.com/repos/psf/requests/issues/1162/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/1162.diff", "html_url": "https://github.com/psf/requests/pull/1162", "merged_at": "2013-02-06T21:05:04Z", "patch_url": "https://github.com/psf/requests/pull/1162.patch", "url": "https://api.github.com/repos/psf/requests/pulls/1162" }
true
[ "Goddamn it Travis! =D\n", "Travis is the child we love when it does what we want and hate when it \ndoesn't... except it isn't our child.\n", "currently, proxies are only supported in the connection adapter layer, so this shouldn't be surfaced higher up\n\nas always, correct me if i'm wrong :)\n", "Not sure. I'll sleep on it and see how I feel.\n", "in general, i want us to support proxies in a very very light manner. I hate them.\n", "Mm, you're probably right =). I'll take another look at it tomorrow evening and see if I can implement it at that layer in a nice way.\n", "Shiny new commit with all the logic in the transport adapter.\n\nI added an `add_headers` function to the `HTTPAdapter` because I suspect most future transport adapters will heavily rely on this one. Adding specific headers is useful logic, and this allows the adapter to be easily subclassed and have new headers added: only one function override is needed.\n", "<3\n" ]
https://api.github.com/repos/psf/requests/issues/1161
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1161/labels{/name}
https://api.github.com/repos/psf/requests/issues/1161/comments
https://api.github.com/repos/psf/requests/issues/1161/events
https://github.com/psf/requests/pull/1161
10,547,156
MDExOlB1bGxSZXF1ZXN0Mzk1MDE5NA==
1,161
If Content-Length is already set, don't override
{ "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
8
2013-02-01T17:01:29Z
2021-09-08T19:00:45Z
2013-02-10T22:07:08Z
CONTRIBUTOR
resolved
Re: #1159
{ "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/1161/reactions" }
https://api.github.com/repos/psf/requests/issues/1161/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/1161.diff", "html_url": "https://github.com/psf/requests/pull/1161", "merged_at": "2013-02-10T22:07:08Z", "patch_url": "https://github.com/psf/requests/pull/1161.patch", "url": "https://api.github.com/repos/psf/requests/pulls/1161" }
true
[ "Nice. =)\n\nIt should be noted that this will not resolve the issue raised in #1159, as if I set Content Length to anything falsy this will fail (this includes zero). I don't know if we want to allow the forcing of Content-Length to weird values this way, but if we do you'll need to take another look at this.\n", "Well all headers should be strings. Any non-empty string will work. One could \nset: `{'Content-Length': 'fail'}` and it should work as far as we're \nconcerned. Setting `{'Content-Length': ''}` is valid as well, but do we want \nto support it?\n", "Depends if we want to use this method to prevent the header appearing entirely or not.\n", "Typically if the user didn't want a header to appear, they would use \n`{'Header-key': None}`, but you're right, I'm not sure how we'd swing that. On \nthe other hand, we wouldn't be following spec if we didn't include it when \nthere is a body (assuming that is an instance where the user doesn't want to \nsend it).\n", "I'm generally in favour of requiring that users go out of their way to do stuff that will almost certainly break servers.\n", "So we're in agreement ;)\n\nI guess the one change we should make is to ensure that Content-Length's value \nis a string, but really if the user is mucking with it, then they should have \nthe decency to look up how it's supposed to work. I swear, if we get any \nissues due to this (e.g., why won't the Content-Length header accept ints?), \nI'm going to click close so hard :-P.\n", "Does this use the case-insensitive dict?\n", "@kennethreitz, PreparedRequests don't use the CaseInsensitiveDict currently. If you would like it to, let me know.\n" ]
https://api.github.com/repos/psf/requests/issues/1160
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1160/labels{/name}
https://api.github.com/repos/psf/requests/issues/1160/comments
https://api.github.com/repos/psf/requests/issues/1160/events
https://github.com/psf/requests/issues/1160
10,531,354
MDU6SXNzdWUxMDUzMTM1NA==
1,160
Auth handlers are unable to modify query strings/form data sanely
{ "avatar_url": "https://avatars.githubusercontent.com/u/92943?v=4", "events_url": "https://api.github.com/users/gholms/events{/privacy}", "followers_url": "https://api.github.com/users/gholms/followers", "following_url": "https://api.github.com/users/gholms/following{/other_user}", "gists_url": "https://api.github.com/users/gholms/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/gholms", "id": 92943, "login": "gholms", "node_id": "MDQ6VXNlcjkyOTQz", "organizations_url": "https://api.github.com/users/gholms/orgs", "received_events_url": "https://api.github.com/users/gholms/received_events", "repos_url": "https://api.github.com/users/gholms/repos", "site_admin": false, "starred_url": "https://api.github.com/users/gholms/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/gholms/subscriptions", "type": "User", "url": "https://api.github.com/users/gholms", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2013-02-01T07:41:21Z
2021-09-09T05:00:43Z
2013-02-10T22:27:51Z
NONE
resolved
I'm trying to port the parameter-based authentication scheme that AWS uses to requests 1 from an older version. It uses a request's parameters to generate signature parameters of its own and then augments the request with them. The resulting parameters then go into the request as either a query string or form data. As a result, this handler needs to be able to modify those, but since requests 1 just hands auth handlers PreparedRequests and no references at all to the original Requests, query strings and form data (and in fact everything other than headers) become incredibly inconvenient to modify. I'm handing the auth handler to a Session and then calling that Session's request method a bunch of times. Is there a way to make that (also?) give the auth handler the original Request whenever it gives it a PreparedRequest without breaking an interface somewhere? Should I be unpacking everything with urlparse and cgi and then re-calling prepare_url and prepare_body? Or is there another fix/workaround that might be better?
{ "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/1160/reactions" }
https://api.github.com/repos/psf/requests/issues/1160/timeline
null
completed
null
null
false
[ "Basically, you should just parse those things out of the body. Fairly simple.\n", "Yeah, it's just more obnoxious than modifying the dict that produced them since it involves unpacking and repacking the body. :-\\ Do I have any hope of getting the info from the original Request to the auth handler as well?\n" ]
https://api.github.com/repos/psf/requests/issues/1159
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1159/labels{/name}
https://api.github.com/repos/psf/requests/issues/1159/comments
https://api.github.com/repos/psf/requests/issues/1159/events
https://github.com/psf/requests/issues/1159
10,524,929
MDU6SXNzdWUxMDUyNDkyOQ==
1,159
Feature: ability to force / remove any header to a request
{ "avatar_url": "https://avatars.githubusercontent.com/u/214840?v=4", "events_url": "https://api.github.com/users/mtourne/events{/privacy}", "followers_url": "https://api.github.com/users/mtourne/followers", "following_url": "https://api.github.com/users/mtourne/following{/other_user}", "gists_url": "https://api.github.com/users/mtourne/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/mtourne", "id": 214840, "login": "mtourne", "node_id": "MDQ6VXNlcjIxNDg0MA==", "organizations_url": "https://api.github.com/users/mtourne/orgs", "received_events_url": "https://api.github.com/users/mtourne/received_events", "repos_url": "https://api.github.com/users/mtourne/repos", "site_admin": false, "starred_url": "https://api.github.com/users/mtourne/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/mtourne/subscriptions", "type": "User", "url": "https://api.github.com/users/mtourne", "user_view_type": "public" }
[]
closed
true
null
[]
null
7
2013-02-01T01:02:45Z
2021-09-09T05:00:38Z
2013-02-10T22:36:58Z
NONE
resolved
Hi, I use requests more and more to test the behavior of my app that runs on Nginx. I was also planning into using requests to test the behavior when using incorrect HTTP headers, to assert that Nginx does the right thing. Unfortunately it's impossible to specify Content-Length: '' (I would expect Content-Length: \r\n), or Content-Length: None (or False) (the header shouldn't be in the request at all) When using the POST interface. Maybe there is a non obvious way to do that with requests, which I haven't found in the doc ? For now I will probably end up using a raw socket connection, but it's too bad it's not possible to use requests for those "expected failure" tests.
{ "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/1159/reactions" }
https://api.github.com/repos/psf/requests/issues/1159/timeline
null
completed
null
null
false
[ "Couldn't you just modify the headers dictionary when creating a request object?\nhttp://docs.python-requests.org/en/latest/user/advanced/#request-and-response-objects\nhttp://docs.python-requests.org/en/latest/api/#lower-level-classes\n\nNote: For Content-Length, it might be set when you prepare the request (actually I'm pretty sure this is true), but it should be sent if you're posting data and you can determine the length beforehand. Could you elaborate more on your usecase?\n", "@theaeolianmachine is right, Content-Length is set when you prepare the request based on the body. This is reasonable, Requests shouldn't let you set this incorrectly unless you _really_ want to.\n\nHowever, it sounds like you do. With that in mind, you can interfere with this process in a few ways. The easiest way is likely to be to subclass the `HTTPConnectionAdapter` like so:\n\n``` python\nfrom requests import adapters.HTTPConnectionAdapter\n\nclass BrokenAdapter(HTTPConnectionAdapter):\n def send(self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None):\n request.headers['Content-Length'] = ''\n super(BrokenAdapter, self).send(request, stream, timeout, verify, cert, proxies)\n```\n\nThen attach your new adapter as follows:\n\n``` python\nimport requests\n\ns = requests.Session()\ns.mount('http://your/nginx/hostname/here', BrokenAdapter())\n```\n\nAny requests through that session to your nginx host should now have their Content-Length forcibly set to the empty string. If you want more intelligent behaviour, note that the `send` method takes a `PreparedRequest`, so any data available on a `PreparedRequest` is available to you to modify your behaviour.\n\nNB: I have not tested the above code, I just wrote it in the browser. There may be typos or some minor syntax errors. In general, however, it should work.\n", "If someone provides their own Content-Length, we shouldn't be setting it.\n", "also @mtourne, you should look into PreparedRequest. It's built for exactly this.\n", "@kennethreitz I'll check why we set it if they set it themselves.\n", "@mtourne I for one really think the PreparedRequest is what you should be using in this instance the more I think about it.\n\n``` python\nimport requests\n\nsession = requests.Session()\nrequest = requests.Request('GET', 'http://localhost:8080/foo').prepare()\nrequest.headers['Content-Length'] = '100'\nresponse = session.send(request)\n```\n\nIt's a bit of extra code, but it isn't too bad and it gives you far more control over the request to mess with as you please.\n", "This regressed the fix for #1096. I opened a new issue for the regression: #1215.\n" ]
https://api.github.com/repos/psf/requests/issues/1158
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1158/labels{/name}
https://api.github.com/repos/psf/requests/issues/1158/comments
https://api.github.com/repos/psf/requests/issues/1158/events
https://github.com/psf/requests/pull/1158
10,513,723
MDExOlB1bGxSZXF1ZXN0MzkzMzIxOA==
1,158
Fix check that breaks handling of 303 response in some cases (v2)
{ "avatar_url": "https://avatars.githubusercontent.com/u/1036377?v=4", "events_url": "https://api.github.com/users/yehudasa/events{/privacy}", "followers_url": "https://api.github.com/users/yehudasa/followers", "following_url": "https://api.github.com/users/yehudasa/following{/other_user}", "gists_url": "https://api.github.com/users/yehudasa/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/yehudasa", "id": 1036377, "login": "yehudasa", "node_id": "MDQ6VXNlcjEwMzYzNzc=", "organizations_url": "https://api.github.com/users/yehudasa/orgs", "received_events_url": "https://api.github.com/users/yehudasa/received_events", "repos_url": "https://api.github.com/users/yehudasa/repos", "site_admin": false, "starred_url": "https://api.github.com/users/yehudasa/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/yehudasa/subscriptions", "type": "User", "url": "https://api.github.com/users/yehudasa", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2013-01-31T19:25:33Z
2021-09-08T19:00:45Z
2013-02-01T15:30:47Z
CONTRIBUTOR
resolved
This fixes issue #1156. Signed-off-by: Yehuda Sadeh [email protected]
{ "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/1158/reactions" }
https://api.github.com/repos/psf/requests/issues/1158/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/1158.diff", "html_url": "https://github.com/psf/requests/pull/1158", "merged_at": "2013-02-01T15:30:47Z", "patch_url": "https://github.com/psf/requests/pull/1158.patch", "url": "https://api.github.com/repos/psf/requests/pulls/1158" }
true
[ "The test failure here is not related to the pull request.\n", "thank you, this is much more proper.\n" ]
https://api.github.com/repos/psf/requests/issues/1157
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1157/labels{/name}
https://api.github.com/repos/psf/requests/issues/1157/comments
https://api.github.com/repos/psf/requests/issues/1157/events
https://github.com/psf/requests/pull/1157
10,511,901
MDExOlB1bGxSZXF1ZXN0MzkzMjI4MQ==
1,157
Fix check that breaks handling of 303 response in some cases
{ "avatar_url": "https://avatars.githubusercontent.com/u/1036377?v=4", "events_url": "https://api.github.com/users/yehudasa/events{/privacy}", "followers_url": "https://api.github.com/users/yehudasa/followers", "following_url": "https://api.github.com/users/yehudasa/following{/other_user}", "gists_url": "https://api.github.com/users/yehudasa/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/yehudasa", "id": 1036377, "login": "yehudasa", "node_id": "MDQ6VXNlcjEwMzYzNzc=", "organizations_url": "https://api.github.com/users/yehudasa/orgs", "received_events_url": "https://api.github.com/users/yehudasa/received_events", "repos_url": "https://api.github.com/users/yehudasa/repos", "site_admin": false, "starred_url": "https://api.github.com/users/yehudasa/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/yehudasa/subscriptions", "type": "User", "url": "https://api.github.com/users/yehudasa", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2013-01-31T18:37:45Z
2021-09-08T19:00:44Z
2013-01-31T19:24:33Z
CONTRIBUTOR
resolved
This fixes issue #1156. Signed-off-by: Yehuda Sadeh [email protected]
{ "avatar_url": "https://avatars.githubusercontent.com/u/1036377?v=4", "events_url": "https://api.github.com/users/yehudasa/events{/privacy}", "followers_url": "https://api.github.com/users/yehudasa/followers", "following_url": "https://api.github.com/users/yehudasa/following{/other_user}", "gists_url": "https://api.github.com/users/yehudasa/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/yehudasa", "id": 1036377, "login": "yehudasa", "node_id": "MDQ6VXNlcjEwMzYzNzc=", "organizations_url": "https://api.github.com/users/yehudasa/orgs", "received_events_url": "https://api.github.com/users/yehudasa/received_events", "repos_url": "https://api.github.com/users/yehudasa/repos", "site_admin": false, "starred_url": "https://api.github.com/users/yehudasa/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/yehudasa/subscriptions", "type": "User", "url": "https://api.github.com/users/yehudasa", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/1157/reactions" }
https://api.github.com/repos/psf/requests/issues/1157/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/1157.diff", "html_url": "https://github.com/psf/requests/pull/1157", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/1157.patch", "url": "https://api.github.com/repos/psf/requests/pulls/1157" }
true
[ "Thanks for the fix! From a personal perspective, I'd rather you changed the line to:\n\n``` python\nif resp.status_code == codes.see_other and req.method != 'HEAD':\n```\n\nBoth versions (yours and mine) will fail if `codes.see_other` ever returns more than one code, but I'm not keen on creating a single-element tuple just to walk it and do the comparison. We may as well just do it.\n" ]
https://api.github.com/repos/psf/requests/issues/1156
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1156/labels{/name}
https://api.github.com/repos/psf/requests/issues/1156/comments
https://api.github.com/repos/psf/requests/issues/1156/events
https://github.com/psf/requests/issues/1156
10,511,057
MDU6SXNzdWUxMDUxMTA1Nw==
1,156
POST 303 redirect response mishandling
{ "avatar_url": "https://avatars.githubusercontent.com/u/1036377?v=4", "events_url": "https://api.github.com/users/yehudasa/events{/privacy}", "followers_url": "https://api.github.com/users/yehudasa/followers", "following_url": "https://api.github.com/users/yehudasa/following{/other_user}", "gists_url": "https://api.github.com/users/yehudasa/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/yehudasa", "id": 1036377, "login": "yehudasa", "node_id": "MDQ6VXNlcjEwMzYzNzc=", "organizations_url": "https://api.github.com/users/yehudasa/orgs", "received_events_url": "https://api.github.com/users/yehudasa/received_events", "repos_url": "https://api.github.com/users/yehudasa/repos", "site_admin": false, "starred_url": "https://api.github.com/users/yehudasa/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/yehudasa/subscriptions", "type": "User", "url": "https://api.github.com/users/yehudasa", "user_view_type": "public" }
[]
closed
true
null
[]
null
0
2013-01-31T18:20:53Z
2021-09-09T05:00:43Z
2013-02-10T22:32:30Z
CONTRIBUTOR
resolved
In 1.1.0 when getting 303 on POST, instead of sending a GET request, it sends POST.
{ "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/1156/reactions" }
https://api.github.com/repos/psf/requests/issues/1156/timeline
null
completed
null
null
false
[]
https://api.github.com/repos/psf/requests/issues/1155
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1155/labels{/name}
https://api.github.com/repos/psf/requests/issues/1155/comments
https://api.github.com/repos/psf/requests/issues/1155/events
https://github.com/psf/requests/issues/1155
10,510,213
MDU6SXNzdWUxMDUxMDIxMw==
1,155
Add MultiDict Support
{ "avatar_url": "https://avatars.githubusercontent.com/u/614430?v=4", "events_url": "https://api.github.com/users/dmckeone/events{/privacy}", "followers_url": "https://api.github.com/users/dmckeone/followers", "following_url": "https://api.github.com/users/dmckeone/following{/other_user}", "gists_url": "https://api.github.com/users/dmckeone/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/dmckeone", "id": 614430, "login": "dmckeone", "node_id": "MDQ6VXNlcjYxNDQzMA==", "organizations_url": "https://api.github.com/users/dmckeone/orgs", "received_events_url": "https://api.github.com/users/dmckeone/received_events", "repos_url": "https://api.github.com/users/dmckeone/repos", "site_admin": false, "starred_url": "https://api.github.com/users/dmckeone/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/dmckeone/subscriptions", "type": "User", "url": "https://api.github.com/users/dmckeone", "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": "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
{ "avatar_url": "https://avatars.githubusercontent.com/u/240830?v=4", "events_url": "https://api.github.com/users/sigmavirus24/events{/privacy}", "followers_url": "https://api.github.com/users/sigmavirus24/followers", "following_url": "https://api.github.com/users/sigmavirus24/following{/other_user}", "gists_url": "https://api.github.com/users/sigmavirus24/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/sigmavirus24", "id": 240830, "login": "sigmavirus24", "node_id": "MDQ6VXNlcjI0MDgzMA==", "organizations_url": "https://api.github.com/users/sigmavirus24/orgs", "received_events_url": "https://api.github.com/users/sigmavirus24/received_events", "repos_url": "https://api.github.com/users/sigmavirus24/repos", "site_admin": false, "starred_url": "https://api.github.com/users/sigmavirus24/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/sigmavirus24/subscriptions", "type": "User", "url": "https://api.github.com/users/sigmavirus24", "user_view_type": "public" }
[ { "avatar_url": "https://avatars.githubusercontent.com/u/240830?v=4", "events_url": "https://api.github.com/users/sigmavirus24/events{/privacy}", "followers_url": "https://api.github.com/users/sigmavirus24/followers", "following_url": "https://api.github.com/users/sigmavirus24/following{/other_user}", "gists_url": "https://api.github.com/users/sigmavirus24/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/sigmavirus24", "id": 240830, "login": "sigmavirus24", "node_id": "MDQ6VXNlcjI0MDgzMA==", "organizations_url": "https://api.github.com/users/sigmavirus24/orgs", "received_events_url": "https://api.github.com/users/sigmavirus24/received_events", "repos_url": "https://api.github.com/users/sigmavirus24/repos", "site_admin": false, "starred_url": "https://api.github.com/users/sigmavirus24/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/sigmavirus24/subscriptions", "type": "User", "url": "https://api.github.com/users/sigmavirus24", "user_view_type": "public" } ]
null
79
2013-01-31T18:02:52Z
2021-09-08T17:05:21Z
2015-03-05T11:19:50Z
NONE
resolved
[Comment by Kenneth Reitz](https://github.com/kennethreitz/requests/pull/1103#issuecomment-12370830): > We need to support MultiDict. This is long overdue.
{ "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/1155/reactions" }
https://api.github.com/repos/psf/requests/issues/1155/timeline
null
completed
null
null
false
[ "+1\n", "Should the values be ordered or not? I have no preference, I'm just wondering if others do.\n", "For what? Headers? Query string?\n\nTypically I would say yes either way. Preserving order does not occlude the un-ordered use case whereas the opposite does.\n", "@xealot yeah, that was my opinion. I have something working currently, but it so minimal that I'm not sure it is covers all the corner cases. .... I'll be pushing it to a branch in my repo tonight.\n", "+1 for ordered support. The impetus for this feature was discovered when using `werkzeug.datastructures.OrderedMultiDict` with GET/POST parameters, so if ordered support wasn't there it wouldn't hit the use case.\n\nI'm not very familiar with what other MultiDicts are in the Python community, but I think the only thing that is really needed (at least for werkzeug MultiDict) is to pass `items(multi=True)` or `iteritems(multi=True)` when iterating instead of just `items()` or `iteritems()`. Because Requests used to work with lists of 2-tuples, it seems to support this behaviour almost everywhere, it just needs to iterate slightly differently when breaking up the dictionary into key-value pairs. If all MultiDicts behaved this way (with the same parameter) then perhaps a solution like:\n\n```\n# requests.utils \n\ndef to_key_val_list(value):\n\n ...\n\n if isinstance(value, dict):\n try:\n value = value.items(multi=True)\n except TypeError:\n value = value.items()\n```\n\ncould work to take any dict that behaves like a MultiDict without having to require a separate Requests-only dictionary.\n\nThe problem is that this solution would be specific to Werkzeug, so perhaps sigmavirus24's in-progress solution is better; force it into a known type that is specific to Requests, and then know that it's always that type. \n\nI'm not familiar enough with what is out there in the Python community, or what is in Requests, to make that judgement call. However, I do know that the 'behave-as-if' solution mentioned above would be a little more user-friendly because the user would not be required to create a new object instance prior to calling Requests.\n", "https://github.com/sigmavirus24/requests/tree/multidict has the first version of the MultiDict. (I forgot to update this issue a couple days ago). I haven't switched any of the internal logic over to using it, but it observes order. @dmckeone perhaps you could explain the importance of `multi=True`. Maybe it's because I haven't had my coffee yet, but this doesn't look at all obvious as to the reasoning to me. Then again, I haven't used Werkzeug's MultiDict and should probably go read those docs.\n", "As a thought, would just using the werkzeug toolkit be too much of a requirement to add to requests? All of their data structures are incredibly useful and it would be sad to have to rewrite them.\n\nOr perhaps with permission some of it could be included.\n", "permission has already been granted, and we've been stealing a number of werkzeug data structures for a while :)\n", "I didn't know we could borrow from them. :) Although this takes all the fun out of it for me :-P\n", "Werkzeug's necessary structures are in `requests/structures.py` on the branch I linked above. They're not used anywhere yet, but I also want to clear up how attribution should be done. I have a note in the doc-strings for both classes, but I'm not entirely certain that is enough.\n", "it's enough, I've discussed it with armin on multiple occassions\n", "@sigmavirus24: The `multi=True` argument allows not just ordered items in the dictionary, but also multiple keys in the dictionary. If the `multi=True` argument is not passed, then all duplicate keys are removed when iterating over the the keys/items/values. It's required for me because I'm working with a legacy system that requires ordered, duplicate GET parmeters. Something like: http://www.example.com/item?a=1&b=steve&a=2&b=mary&a=3&b=bob\n", "Thanks for the concrete example @dmckeone \n", "as I mentioned in the ticket jkbr linked, I think this needs to be case insensitive too for header use ( or a case insensitive version).. HTTP allows for multiple headers with the same name.\n", "Hm, that sounds appropriate. I have some other stuff to do this weekend, but I'll try and knock some if out tonight.\n", "Is this still an issue? I'll work on it if so, but I'd like to make sure this isn't being fixed/worked on elsewhere.\n", "@ihodes I started working on it [here](https://github.com/sigmavirus24/requests/tree/multidict) but I've been too busy to do much. It needs to be updated with upstream master and more work needs to be done with it. The tricky part is that deciding how best to utilize the multidict in the parameters to the different methods, specifically to things like `params`, `headers`, etc. The former needs to preserve order which is why we use the OrderedDict, the later isn't so much trouble but may require a different method than what we already have for accepting and merging lists of `(key, value)` tuples. Also, don't take the above as discouragement from doing this. You'll probably be able to come up with a much better solution than me and if you want code review on what you do, I'll be happy to help! :)\n", "Reading over this thread, it seems as though we should be using werkzeug's OrderedMultiDict in lieu of MultiDict (though apparently there is something like an order of magnitude slowdown from using this, that probably—and this is testable—wouldn't really affect the user experience much) for both headers and params? \n", "How did I miss werkzeug's `OrderedMultiDict`? You sound right, but I'm wary of that slowdown.\n", "@ihodes `OrderedMultiDict` is slower, but in practice I'm not sure that it will matter. I may be confused about where this is needed throughout all of Requests, but for input the user will make the performance decision. If I (the user) wish to take the performance hit because I need ordered support, then I will pass requests an `OrderedMultiDict`. If I don't, then I'll use regular `MultiDict`. All Requests should have to do is iterate through what the user gives it, and put it into the format it needs internally (which I think is an ordered list of 2-tuples for most things). Since both `OrderedMultiDict` and `MultiDict` can be iterated through with something like `[(key, value) for key, value in headers.iteritems(multi=True)]` (where `headers` is an instance of `OrderedMultiDict` or `MultiDict`), Requests should be able to be indifferent about the performance implications.\n", "@dmckeone that'd be (sort of) ideally how it would work were we to go with this additional datastructures. One issue is that there isn't a consistent API to these structures—we'd need to explicitly dispatch on the type (because we have to pass `multi=True` if the dict is a MultiDict). That's unideal. Also, for the user, constructing these dictionaries is a PITA (in my opinion) and requires importing another datastructure in order to use. \n\nWhat if we allowed the user to input a list of (key, val) tuples instead (which works right now, but order/multiples are lost)? That way it's lightweight, and much easier to understand & use than importing and building up an OrderedMultiDict.\n\nE.g. \n\n```\nrequests.get(\"http://example.com\", params={\"yep\": \"old way works\"})\nrequests.get(\"http://example.com\",\n params=[(\"yep\", \"old way works\"), (\"yep_addn\", \"123\"),(\"yep\", \"new way is awesome\")])\n```\n\nNote that the second GET request is NOT equivalent to the currently possible request: \n\n```\nrequests.get(\"http://example.com\",\n params=[(\"yep\", [\"old way works\", \"new way is awesome\"]), (\"yep_addn\", \"123\")])\n```\n\n…because the \"yep_addn\" key/val won't be interleaved between the two \"yep\" params.\n\nI can see in #1103 that this was requested before, but I don't know if it was agreed to be a good/bad idea? Right now, it makes the most sense to me. This almost works now, it just doesn't allow for _ordered AND repeated_ params (c.f. @dmckeone's example in #1103). \n", "So the reason we want the `MultiDict`s underneath everything is so that the users don't have to concern themselves with it. They can always pass it in and conversion _should_ would just fine. We currently accept both dicts and ordered pairs as @ihodes demonstrated and both are (as far as we're concerned under the hood) converted to `OrderedDict`s. The issue is that this doesn't allow for multiple items (again as @ihodes demonstrated).\n\nWhat I wonder is if we could subclass our existing `OrderedDict`s, and force them to allow multiple entries. Then with that in mind, we could probably also subclass that for the `CaseInsensitiveDict` so to return as the headers attribute on `PreparedRequest`s and `Response`s. Headers can occur several times so this is really the most crucial case where we need the implementation. It would certainly take more thought and work than simply copying flask/werkzeug's implementations, but it would also likely involve less copying (which is bothersome to me even with permission).\n\nTo be clear:\n- We cannot drop the condition that they are ordered (even if sent in as a dict) because that would be a regression\n- We cannot drop the ability to accept anything like above\n", "> To be clear:\n> • We cannot drop the condition that they are ordered (even if sent in as a dict) because that would be a regression\n> • We cannot drop the ability to accept anything like above\n\nAbsolutely agree. I'm not sure what you mean when you say that the params remain ordered if sent in a dict, as they don't currently/can't (I'm sure I'm just not understanding you correctly. e.g. `requests.get(\"http://localhost:8000\", params={2: 1, \"a\": 2, 1: 3}) # => \"GET /?a=2&1=3&2=1/ HTTP/1.1\"`).\n\nI guess I'm just not sure the advantage we get over supporting and/or offering thee alternative datastructures if we properly support ordered & repeated params in an iterable of (key, val) tuples. It seems to be the cleanest and simplest API. If a user wishes to use some subclass of dict, as long as it has a method to an iterable of tuples, it would work. (e.g. `requests.get(\"http://localhost:8000\", params=someinstanceofadict.iteritems(multi=True, whatever=True))`. \n\nMy proposal is then to just properly support ordered tuples (with repeated keys). Here are a couple examples and expected outcomes with GET requests and query strings, but assume an isomorphic outcomes with headers (WLOG). \n\n``` python\nrequests.get(\"http://localhost:8000\", params={9: [1,2,3], \"param_a\": \"hmm\"}) \n # => ?9=1&9=2&9=3&param_a=hmmm\nrequests.get(\"http://localhost:8000\", params=[(9, [1,2,3], (\"param_a\", \"hmm\"))]) \n # => ?9=1&9=2&9=3&param_a=hmmm\nrequests.get(\"http://localhost:8000\", params=[(9, [1,2], (\"param_a\", \"hmm\")), (9, 3)]) \n # => ?9=1&9=2&param_a=hmmm&9=3\n```\n\nAnd, if someone wanted to use their own class for params or headers, it would be done like so: \n\n``` python\nrequests.get(\"http://localhost:8000\", params=custom_class.to_list_of_tuple_aka_iteritems(flag=True)) \n # => ?9=1&9=2&param_a=hmmm&9=3 (or whatever the list of tuples comes out as)\n```\n\nDoes this solve all the issues (ordered, repeated and possibly interleaved params, [understandability, succinctness]) we need it to? \n", "> I'm not sure what you mean when you say that the params remain ordered if sent in a dict\n\nYes I mis-spoke. I mean as soon as we receive the dict, we convert it and the order is preserved. Presumably if someone's sending a dict they're either aware it won't hold order and that doesn't matter to them, or they don't know and will find out.\n\n> If a user wishes to use some subclass of dict, as long as it has a method to an iterable of tuples, it would work.\n\nReally, when using a `MultiDict` or any variant of it, I don't quite get why one has to call the `items` or `iteritems` method with `multi=True`. That should be the default. But I digress. The API should be they can use that so long as `.items()` (which is what we rely on) will return the data as they expect it to and in the order they expect it.\n\n> My proposal is then to just properly support ordered tuples (with repeated keys)\n\nThis will not work in all cases. People expect various items to be dicts, most commonly the `headers` attributes on both `PreparedRequest` and `Response` objects. Changing that would be a severe (breaking) change to the API. I may be misunderstanding your proposal though (which I think I am), in which case, I think we already technically support the example usages you provide except for the fact that they don't actually work that way because of how the `OrderedDict`'s `__init__` works.\n\n> Does this solve all the issues (ordered, repeated and possibly interleaved params, [understandability, succinctness]) we need it to?\n\nStoring them behind the scenes as a list of tuples does not. The MultiDict will though. I think just trying to subclass `OrderedDict` may be enough. Given how it already works we should only really need to concern ourselves with `__init__`, `__setitem__` and `__getitem__`. I'm going to sketch some of this out on the train this afternoon to see how feasible it should be.\n", "Ah, yeah. Behind the scenes we should use a OrderedMultiDict (but not Wekzeug's, because due to the multi=True issue its API isn't compatible with Requests'). As for how the user can use this feature, either passing params=/headers= an OrderedMultiDict (or dict, or MultiDict, or anything implementing `items :: obj -> [(key, val), .. ]` [don't hate]) or array of tuples should work, yes? (Currently it doesn't work as expected; repeated keys are squashed, and only the last tuple with a repeated key in the list is used).\n", "I'll just throw out a couple crazy ideas here...\n\n### Storage Class\n\nIn Flask Armin handled this scenario by making an assumption that seemed to be something like this (I don't know if this is what he thought, but the design seems to indicate this): \n\n> Ordered parameters are less likely, and less performant, than order independent parameters. Therefore, default all parameters to the more performant solution, and allow the user to override the behaviour if they really need it.\n\nThis meant that in order to get ordered parameters you had to do:\n`app_instance.request_class.parameter_storage_class = ImmutableOrderedMultiDict # Default is ImmutableMultiDict`\n\nNow requests has a different API, so overriding the storage class is not always practical or desirable for something simple like `requests.get(\"http://localhost:8000\", params={'a': 'b', 'c': 'd'})`, but if the response had a flexible storage class then then it could be dictated on the request by additional kwargs: `requests.get(\"http://localhost:8000\", params=[('a', 'b'), ('c', 'd')], ordered=True)`\n\nSomething like that could allow using MultiDict internally, and making ordered a user-specified option. Alternatively, you could just infer ordered if an actual OrderedMultiDict was passed as the parameters, or something else that somehow infers order.\n\nThis would then give you request/response pairs where, if you asked for order, you can assume OrderedMultiDict in the parameters/data. And if you didn't ask for order, well you'll get back a regular MultiDict.\n\n### OrderedMultiDict.items(multi=True)\n\nAs far as this note goes. If multi=True not being the default is the only hang-up, then why not just create an adapter that make multi=True be the default?\n\n```\nclass OrderedMultiDictAdapter(OrderedMultiDict):\n ....\n def items(multi=True):\n super(OrderedMultiDictAdapter, self).items(multi=multi)\n```\n\nSeems a lot simpler than re-writing, no?\n", "> Currently it doesn't work as expected; repeated keys are squashed, and only the last tuple with a repeated key in the list is used\n\nRight, that's why I said it was \"technically\" supported, i.e., we don't complain it just doesn't work.\n\n> Now requests has a different API, so overriding the storage class is not always practical or desirable for something simple like `requests.get(\"http://localhost:8000\", params={'a': 'b', 'c': 'd'})`, but if the response had a flexible storage class then then it could be dictated on the request by additional kwargs: `requests.get(\"http://localhost:8000\", params=[('a', 'b'), ('c', 'd')], ordered=True)`\n\nExactly right. Requests has a much different API, specifically since we promise (since 0.13.x or 0.14.x, and carried over to 1.x) that we'll retain the order of the items received through `params`, `data`, `files`, if we're given them in an manner that already preserves order. Adding that extra keyword is a breaking change of the API and not acceptable as far as I'm concerned.\n\n> If multi=True not being the default is the only hang-up\n\nIt isn't preventing any of this. Other concerns are. This is just a pet peeve of mine because if your user is passing or expecting a `MultiDict`, making them do extra just to get **all** of the values out just seems like very poor API design to me. If it had been a serious issue, I wouldn't have started the work towards this by just copying Armin's approach to the `MultiDict`.\n", "@sigmavirus24 Agree about the MultiDict.items(); it is odd, and I don't know why it's like that. Not changing the API makes sense too.\n\nSo, currently Requests does this (Please feel free to correct me if some of this is wrong): \n- `OrderedDict` for everything, instantiated by `from_key_val_list()`\n- Multi-value is supported by passing an iterable value\n- `merge_kwargs` in `sessions.py` seems to rely on unique, case-independent keys (It wouldn't concat multi-keys)\n\n@sigmavirus24 Could you do a quick explanation why `OrderedDict` is used in place of dict? Everything I've seen seems to not care all that much about order in the parameters. Is this a relic of when requests used to accept a list of 2-tuples (as the docstring in `from_key_val_list()` seems to indicate)?\n\nTo me, the ideal would be to use `MultiDict` internally in `from_key_val_list()`, with some kind of session/response based switch that could use `OrderedMultiDict` in it's stead. This would mean:\n- Changing `from_key_val_list()` to interpret any non-`MultiDict` dictionaries as `MultiDict` (e.g. change `OrderedDict` to `Dict`\n- Multi-value would still work, because we aren't affecting the way values are stored by using `MultiDict` (just enabling multi-key) \n- `merge_kwargs` in sessions.py would need some kind of concatenation behaviour if order mattered, and `MutliDict` would need to be case insensitive.\n", "> Could you do a quick explanation why `OrderedDict` is used in place of dict?\n\nThe quickest explanation is Amazon.\n\nThe next quickest explanation is that when doing `multipart/form-data` requests in some cases (like when interacting with Amazon) the server absolutely requires order be preserved. You could do that (ostensibly) by passing an `OrderedDict` but the old implementation would convert it to a dict and magically all hell would break loose. I see no way in which removing that built-in niceness is acceptable to anyone whether on the session level or on the request level.\n\n> To me, the ideal would be to use `MultiDict` internally in `from_key_val_list()`\n\nThat's exactly what I had in mind with the one reservation about ordering.\n\nReturned and prepared `headers` should both use straight `MultiDict`s. Those don't care about order in either case. This is why I'm starting to think we should ship that first, then work towards a resolution on how to convert params and other items to a `MultiDict` (or variant thereof).\n\nI still don't think (with the current `OrderedDict` implementations) that subclassing and forcing it to accept multiple values would be too terrible, but we'd have to see what the performance hit is comparing that to Armin's `OrderedMultiDict`.\n\nI don't quite remember what `merge_kwargs` does right now but I'll take a closer look in an hour or seven.\n", "Just realized something. I would imagine that `OrderedMultiDict` and `OrderedDict` pay the same performance penalty. Perhaps it's a non-issue and the first implementation should just go straight to `OrderedMultiDict`?\n" ]
https://api.github.com/repos/psf/requests/issues/1154
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1154/labels{/name}
https://api.github.com/repos/psf/requests/issues/1154/comments
https://api.github.com/repos/psf/requests/issues/1154/events
https://github.com/psf/requests/pull/1154
10,490,869
MDExOlB1bGxSZXF1ZXN0MzkyMjExMA==
1,154
Added r.ppjson() functionality.
{ "avatar_url": "https://avatars.githubusercontent.com/u/545666?v=4", "events_url": "https://api.github.com/users/joaquincasares/events{/privacy}", "followers_url": "https://api.github.com/users/joaquincasares/followers", "following_url": "https://api.github.com/users/joaquincasares/following{/other_user}", "gists_url": "https://api.github.com/users/joaquincasares/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/joaquincasares", "id": 545666, "login": "joaquincasares", "node_id": "MDQ6VXNlcjU0NTY2Ng==", "organizations_url": "https://api.github.com/users/joaquincasares/orgs", "received_events_url": "https://api.github.com/users/joaquincasares/received_events", "repos_url": "https://api.github.com/users/joaquincasares/repos", "site_admin": false, "starred_url": "https://api.github.com/users/joaquincasares/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/joaquincasares/subscriptions", "type": "User", "url": "https://api.github.com/users/joaquincasares", "user_view_type": "public" }
[]
closed
true
null
[]
null
4
2013-01-31T07:18:46Z
2021-09-08T19:00:44Z
2013-01-31T14:32:58Z
NONE
resolved
I find myself continuously making a pretty_print type method when dealing with r.json() commands. Figured it may better placed back inside requests.
{ "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/1154/reactions" }
https://api.github.com/repos/psf/requests/issues/1154/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/1154.diff", "html_url": "https://github.com/psf/requests/pull/1154", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/1154.patch", "url": "https://api.github.com/repos/psf/requests/pulls/1154" }
true
[ "I don't really see the need for this to be in Requests. Requests is an HTTP library. We only have a `json()` method because it's a insanely common use-case and it's convenient. Printing the JSON string in a nice way is a less common case and nothing to do with HTTP. =)\n\nI just don't think this is worth cluttering the API for.\n", "I whole-heartedly agree with @Lukasa\n", "Correct. Basically, we're not really interested in new features anymore. We should communicate this in the documentation.\n\nThanks for the contribution, though! :cake:\n", "Good points. Thanks for all the awesomeness that still is \"requests\"! :)\n" ]
https://api.github.com/repos/psf/requests/issues/1153
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1153/labels{/name}
https://api.github.com/repos/psf/requests/issues/1153/comments
https://api.github.com/repos/psf/requests/issues/1153/events
https://github.com/psf/requests/pull/1153
10,482,018
MDExOlB1bGxSZXF1ZXN0MzkxODA0Nw==
1,153
use only base filename in multipart file upload
{ "avatar_url": "https://avatars.githubusercontent.com/u/170360?v=4", "events_url": "https://api.github.com/users/cbare/events{/privacy}", "followers_url": "https://api.github.com/users/cbare/followers", "following_url": "https://api.github.com/users/cbare/following{/other_user}", "gists_url": "https://api.github.com/users/cbare/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/cbare", "id": 170360, "login": "cbare", "node_id": "MDQ6VXNlcjE3MDM2MA==", "organizations_url": "https://api.github.com/users/cbare/orgs", "received_events_url": "https://api.github.com/users/cbare/received_events", "repos_url": "https://api.github.com/users/cbare/repos", "site_admin": false, "starred_url": "https://api.github.com/users/cbare/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/cbare/subscriptions", "type": "User", "url": "https://api.github.com/users/cbare", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2013-01-30T23:50:32Z
2021-09-08T19:00:43Z
2013-01-30T23:56:21Z
NONE
resolved
I have a tiny patch, which enforces the correct behavior in multipart/form-data file uploads. The function guess_filename in requests/utils.py extracts the filename from the file-like-object from which we stream the file's contents. In the case of a file, this gives the full path on the local filesystem to the given file, which is then propagated to the request headers like this (in urllib3/filepost.py): 'Content-Disposition: form-data; name="%s"; filename="%s"\r\n' % (fieldname, filename) RFC 2388 says this: > The original local file name may be supplied as well, either as a > "filename" parameter either of the "content-disposition: form-data" > header or, in the case of multiple files, in a "content-disposition: > file" header of the subpart. It's my understanding that the correct behavior, implemented in web browsers, is to include the file's _name_ and not its full _path_ on the local filesystem. I added a call to _os.path.basename_ to shorted any paths to the base filename.
{ "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/1153/reactions" }
https://api.github.com/repos/psf/requests/issues/1153/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/1153.diff", "html_url": "https://github.com/psf/requests/pull/1153", "merged_at": "2013-01-30T23:56:21Z", "patch_url": "https://github.com/psf/requests/pull/1153.patch", "url": "https://api.github.com/repos/psf/requests/pulls/1153" }
true
[ "seems good to me!\n" ]
https://api.github.com/repos/psf/requests/issues/1152
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1152/labels{/name}
https://api.github.com/repos/psf/requests/issues/1152/comments
https://api.github.com/repos/psf/requests/issues/1152/events
https://github.com/psf/requests/pull/1152
10,474,310
MDExOlB1bGxSZXF1ZXN0MzkxNDA0OA==
1,152
Update docs/user/advanced.rst
{ "avatar_url": "https://avatars.githubusercontent.com/u/1141204?v=4", "events_url": "https://api.github.com/users/ekatsah/events{/privacy}", "followers_url": "https://api.github.com/users/ekatsah/followers", "following_url": "https://api.github.com/users/ekatsah/following{/other_user}", "gists_url": "https://api.github.com/users/ekatsah/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/ekatsah", "id": 1141204, "login": "ekatsah", "node_id": "MDQ6VXNlcjExNDEyMDQ=", "organizations_url": "https://api.github.com/users/ekatsah/orgs", "received_events_url": "https://api.github.com/users/ekatsah/received_events", "repos_url": "https://api.github.com/users/ekatsah/repos", "site_admin": false, "starred_url": "https://api.github.com/users/ekatsah/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/ekatsah/subscriptions", "type": "User", "url": "https://api.github.com/users/ekatsah", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2013-01-30T20:22:50Z
2021-09-08T19:00:44Z
2013-01-30T23:54:20Z
CONTRIBUTOR
resolved
Rephrasing a line in the docs, add explicite mention of "client side certificate" (for indexing and clarity)
{ "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/1152/reactions" }
https://api.github.com/repos/psf/requests/issues/1152/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/1152.diff", "html_url": "https://github.com/psf/requests/pull/1152", "merged_at": "2013-01-30T23:54:20Z", "patch_url": "https://github.com/psf/requests/pull/1152.patch", "url": "https://api.github.com/repos/psf/requests/pulls/1152" }
true
[ ":cake:\n" ]
https://api.github.com/repos/psf/requests/issues/1151
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1151/labels{/name}
https://api.github.com/repos/psf/requests/issues/1151/comments
https://api.github.com/repos/psf/requests/issues/1151/events
https://github.com/psf/requests/pull/1151
10,469,342
MDExOlB1bGxSZXF1ZXN0MzkxMTQ0OQ==
1,151
Move redirect handling from Session.request to Session.send
{ "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/240830?v=4", "events_url": "https://api.github.com/users/sigmavirus24/events{/privacy}", "followers_url": "https://api.github.com/users/sigmavirus24/followers", "following_url": "https://api.github.com/users/sigmavirus24/following{/other_user}", "gists_url": "https://api.github.com/users/sigmavirus24/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/sigmavirus24", "id": 240830, "login": "sigmavirus24", "node_id": "MDQ6VXNlcjI0MDgzMA==", "organizations_url": "https://api.github.com/users/sigmavirus24/orgs", "received_events_url": "https://api.github.com/users/sigmavirus24/received_events", "repos_url": "https://api.github.com/users/sigmavirus24/repos", "site_admin": false, "starred_url": "https://api.github.com/users/sigmavirus24/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/sigmavirus24/subscriptions", "type": "User", "url": "https://api.github.com/users/sigmavirus24", "user_view_type": "public" }
[ { "avatar_url": "https://avatars.githubusercontent.com/u/240830?v=4", "events_url": "https://api.github.com/users/sigmavirus24/events{/privacy}", "followers_url": "https://api.github.com/users/sigmavirus24/followers", "following_url": "https://api.github.com/users/sigmavirus24/following{/other_user}", "gists_url": "https://api.github.com/users/sigmavirus24/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/sigmavirus24", "id": 240830, "login": "sigmavirus24", "node_id": "MDQ6VXNlcjI0MDgzMA==", "organizations_url": "https://api.github.com/users/sigmavirus24/orgs", "received_events_url": "https://api.github.com/users/sigmavirus24/received_events", "repos_url": "https://api.github.com/users/sigmavirus24/repos", "site_admin": false, "starred_url": "https://api.github.com/users/sigmavirus24/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/sigmavirus24/subscriptions", "type": "User", "url": "https://api.github.com/users/sigmavirus24", "user_view_type": "public" } ]
null
6
2013-01-30T18:17:08Z
2021-09-08T23:01:05Z
2013-02-05T19:42:51Z
CONTRIBUTOR
resolved
This closes #1133 and allows users to use Session.send with a prepared request. The tests pass, but I just thought of a separate instance where this may not work properly, so don't merge right away.
{ "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/1151/reactions" }
https://api.github.com/repos/psf/requests/issues/1151/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/1151.diff", "html_url": "https://github.com/psf/requests/pull/1151", "merged_at": "2013-02-05T19:42:51Z", "patch_url": "https://github.com/psf/requests/pull/1151.patch", "url": "https://api.github.com/repos/psf/requests/pulls/1151" }
true
[ "Yeah, my intuition was correct:\n\n``` pycon\n>>> import requests\n>>> r = requests.Request('GET', 'https://httpbin.org/redirect/2')\n>>> p = r.prepare()\n>>> s = requests.Session()\n>>> resp = s.send(p) \nTraceback (most recent call last):\n File \"<stdin>\", line 1, in <module>\n File \"requests/sessions.py\", line 394, in send\n history = [resp for resp in gen] if allow_redirects else []\n File \"requests/sessions.py\", line 96, in resolve_redirects\n method = req.method\nAttributeError: 'NoneType' object has no attribute 'method'\n```\n\n@kennethreitz are you okay with req (or the Request object) being mandatory as a parameter, e.g., `Session.send`'s signature becomes: `def send(prepared_request, request, **kwargs):`?\n", "ping @kennethreitz, thoughts on changing `Session.send`'s signature?\n", "I'll review as soon as I get a chance :)\n", "Ah carp. I included a different patch in with this. (The fix for the `elapsed` attribute's test on 2.6)\n", ":+1:\n", ":sparkles: :cake: :sparkles:\n" ]
https://api.github.com/repos/psf/requests/issues/1150
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1150/labels{/name}
https://api.github.com/repos/psf/requests/issues/1150/comments
https://api.github.com/repos/psf/requests/issues/1150/events
https://github.com/psf/requests/issues/1150
10,429,834
MDU6SXNzdWUxMDQyOTgzNA==
1,150
On some pages requests detect encoding incorrectly
{ "avatar_url": "https://avatars.githubusercontent.com/u/976661?v=4", "events_url": "https://api.github.com/users/Euphorbium/events{/privacy}", "followers_url": "https://api.github.com/users/Euphorbium/followers", "following_url": "https://api.github.com/users/Euphorbium/following{/other_user}", "gists_url": "https://api.github.com/users/Euphorbium/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Euphorbium", "id": 976661, "login": "Euphorbium", "node_id": "MDQ6VXNlcjk3NjY2MQ==", "organizations_url": "https://api.github.com/users/Euphorbium/orgs", "received_events_url": "https://api.github.com/users/Euphorbium/received_events", "repos_url": "https://api.github.com/users/Euphorbium/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Euphorbium/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Euphorbium/subscriptions", "type": "User", "url": "https://api.github.com/users/Euphorbium", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2013-01-29T19:18:27Z
2021-09-09T00:34:21Z
2013-01-29T19:24:02Z
NONE
resolved
For example it detects http://www.15min.lt encoding as ISO-8859-1, but the encoding is set as utf8 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
{ "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/1150/reactions" }
https://api.github.com/repos/psf/requests/issues/1150/timeline
null
completed
null
null
false
[ "This is a duplicate of #1087. You can see there that we don't read the content to determine the encoding. If you want you can use `apparent_encoding()` to get an encoding from [charade](/sigmavirus24/charade). You can also use `from requests.utils import get_encodings_from_content`, but we don't parse the HTML anymore. We simply report encoding from the Headers and if there is none, we default to ISO-8859-1.\n", "To clarify @sigmavirus24's point, we only default to ISO-8859-1 in [some cases](http://docs.python-requests.org/en/latest/user/advanced/#encodings).\n" ]
https://api.github.com/repos/psf/requests/issues/1149
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1149/labels{/name}
https://api.github.com/repos/psf/requests/issues/1149/comments
https://api.github.com/repos/psf/requests/issues/1149/events
https://github.com/psf/requests/pull/1149
10,428,655
MDExOlB1bGxSZXF1ZXN0Mzg5MTQ4Mw==
1,149
Update cacert.pem
{ "avatar_url": "https://avatars.githubusercontent.com/u/7321?v=4", "events_url": "https://api.github.com/users/nacht/events{/privacy}", "followers_url": "https://api.github.com/users/nacht/followers", "following_url": "https://api.github.com/users/nacht/following{/other_user}", "gists_url": "https://api.github.com/users/nacht/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/nacht", "id": 7321, "login": "nacht", "node_id": "MDQ6VXNlcjczMjE=", "organizations_url": "https://api.github.com/users/nacht/orgs", "received_events_url": "https://api.github.com/users/nacht/received_events", "repos_url": "https://api.github.com/users/nacht/repos", "site_admin": false, "starred_url": "https://api.github.com/users/nacht/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/nacht/subscriptions", "type": "User", "url": "https://api.github.com/users/nacht", "user_view_type": "public" }
[]
closed
true
null
[]
null
10
2013-01-29T18:47:07Z
2021-09-08T23:11:10Z
2013-02-10T22:10:16Z
NONE
resolved
Updated cacert.pem with latest from http://curl.haxx.se/ca/cacert.pem
{ "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/1149/reactions" }
https://api.github.com/repos/psf/requests/issues/1149/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/1149.diff", "html_url": "https://github.com/psf/requests/pull/1149", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/1149.patch", "url": "https://api.github.com/repos/psf/requests/pulls/1149" }
true
[ "so, this cert list is great, however it contains a bunch of blacklisted certs as well.\n\nI've been manually removing them. They need to be removed again. We should maintain a list perhaps.\n", "Nod nod. Perhaps on the wiki?\n", "why remove them? to keep the size down?\n", "@ansel1, why remove blacklisted certs? Because otherwise, urllib3/ssl will assume we want to trust those certs when we shouldn't.\n", "python's ssl doesn't support blacklisted certs.\n", "i see. where do you get the list of blacklisted certs? Or how do you distinguish them in cacerts.pem? I'm trying to prune my own copy to get something working today. \n", "unfortunately, we have to remove them by hand at the moment. We should automate this. I'm not sure what is involved exactly at this point.\n", "I would like to remove them by hand from my own copy, but I don't know how\nto identify them. How do you know which ones to remove manually?\n\nOn Tue, Feb 5, 2013 at 12:30 PM, Kenneth Reitz [email protected]:\n\n> unfortunately, we have to remove them by hand at the moment. We should\n> automate this. I'm not sure what is involved exactly at this point.\n> \n> —\n> Reply to this email directly or view it on GitHubhttps://github.com/kennethreitz/requests/pull/1149#issuecomment-13141114.\n", "a contributor did it before, i think there's a seperate blacklist in the mozilla repo. \n", "closing for now. \n" ]
https://api.github.com/repos/psf/requests/issues/1148
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1148/labels{/name}
https://api.github.com/repos/psf/requests/issues/1148/comments
https://api.github.com/repos/psf/requests/issues/1148/events
https://github.com/psf/requests/pull/1148
10,383,632
MDExOlB1bGxSZXF1ZXN0Mzg2OTI4OA==
1,148
Move the timing work to Session.send
{ "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
0
2013-01-28T17:16:44Z
2021-09-08T22:01:19Z
2013-01-28T17:40:11Z
CONTRIBUTOR
resolved
per @kennethreitz's request
{ "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/1148/reactions" }
https://api.github.com/repos/psf/requests/issues/1148/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/1148.diff", "html_url": "https://github.com/psf/requests/pull/1148", "merged_at": "2013-01-28T17:40:10Z", "patch_url": "https://github.com/psf/requests/pull/1148.patch", "url": "https://api.github.com/repos/psf/requests/pulls/1148" }
true
[]
https://api.github.com/repos/psf/requests/issues/1147
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1147/labels{/name}
https://api.github.com/repos/psf/requests/issues/1147/comments
https://api.github.com/repos/psf/requests/issues/1147/events
https://github.com/psf/requests/issues/1147
10,354,426
MDU6SXNzdWUxMDM1NDQyNg==
1,147
Throws errors with socks module
{ "avatar_url": "https://avatars.githubusercontent.com/u/1643864?v=4", "events_url": "https://api.github.com/users/infodox/events{/privacy}", "followers_url": "https://api.github.com/users/infodox/followers", "following_url": "https://api.github.com/users/infodox/following{/other_user}", "gists_url": "https://api.github.com/users/infodox/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/infodox", "id": 1643864, "login": "infodox", "node_id": "MDQ6VXNlcjE2NDM4NjQ=", "organizations_url": "https://api.github.com/users/infodox/orgs", "received_events_url": "https://api.github.com/users/infodox/received_events", "repos_url": "https://api.github.com/users/infodox/repos", "site_admin": false, "starred_url": "https://api.github.com/users/infodox/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/infodox/subscriptions", "type": "User", "url": "https://api.github.com/users/infodox", "user_view_type": "public" }
[]
closed
true
null
[]
null
10
2013-01-27T14:37:49Z
2021-09-09T05:00:43Z
2013-02-10T22:30:25Z
NONE
resolved
Hey, I have been trying to get requests to play nice with the "Socks" module (from http://code.google.com/p/socksipy-branch/). urllib3 and httplib work fine with it, but the requests wrapper does not. Here is an example. ``` Python 2.7.3 (default, Sep 26 2012, 21:51:14) [GCC 4.7.2] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import socks >>> import requests >>> socks.setdefaultproxy(socks.PROXY_TYPE_SOCKS5, 'localhost', 9050) >>> socks.wrapmodule(requests) Traceback (most recent call last): File "<stdin>", line 1, in <module> File "socks.py", line 107, in wrapmodule module.socket.socket = socksocket AttributeError: 'module' object has no attribute 'socket' >>> ``` Hopefully there is a workaround for this :) Socks works with almost every other module, so it makes no sense for it to not work with requests.
{ "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/1147/reactions" }
https://api.github.com/repos/psf/requests/issues/1147/timeline
null
completed
null
null
false
[ "Very interesting. \n\nI wonder if this is a bug with socks or not.\n", "It looks like wrapmodule (from the trace back) is trying to monkey patch the socket stdlib. We don't use it directly, so if it isn't expecting our use of urllib3 then it makes sense it would fail.\n", "Yep. `wrapmodule` is expecting that requests have the socket library in the top-level namespace: https://code.google.com/p/socksipy-branch/source/browse/trunk/socks.py#109\n\nThe author should probably use inspect to see where (if anywhere) a package or module is using the socket library. I'm of the opinion that this is an issue with `socksipy` module rather than with requests.\n", "+1. I'd be happy to reasonably accomidate, but we can't do so easily in this case.\n", "I wonder if there is a way to import it from urllib3 so it would properly work.\n", "considering the popularity of requests, I think adding special support for it in socks would be a good idea :)\n", "Hm, are you sure this works with urllib3? I can understand why it would work for httplib. The import is right there, but I see no import of socket that would be reachable from simply import urllib3.\n\nAnd yeah @kennethreitz I think it would be great too, that's why I'm exploring it.\n", "I mean for him to do the work instead of us :)\n", "Yeah @kennethreitz that would always be the ideal case. :)\n\n@infodox, in a clean virtualenv I just installed urllib3 (1.5 from pypi) and downloaded the socks.py file.\n\nThis is my interactive session:\n\n``` python\n>>> import socks\n>>> import urllib3\n>>> socks.wrapmodule(urllib3)\nTraceback (most recent call last):\n File \"<stdin>\", line 1, in <module>\n File \"socks.py\", line 111, in wrapmodule\n raise GeneralProxyError((4, \"no proxy specified\"))\nsocks.GeneralProxyError: (4, 'no proxy specified')\n>>> socks._defaultproxy = True\n>>> socks.wrapmodule(urllib3)\nTraceback (most recent call last):\n File \"<stdin>\", line 1, in <module>\n File \"socks.py\", line 109, in wrapmodule\n module.socket.socket = socksocket\nAttributeError: 'module' object has no attribute 'socket'\n```\n\nAre you sure it works fine on urllib3?\n\nIt might work if you did: `socks.wrapmodule(urllib3.connectionpool)` and `socks.wrapmodule(urllib3.util)` but it definitely doesn't work using only urllib3.\n\nAs for us, I think we could import socket from `urllib3.connectionpool` and it would work since that is the first import in `__init__.py`, I'm just not sure if this would pollute the `requests` namespace.\n", "@infodox, having given it some thought, I honestly think that `socks.py` could be written better. In short, if they want to patch the socket module, they're probably going to want to do so for the entire process, not just for one module. They should be replacing the `socket` entry in `sys.modules`, not trying to rely on a module having `socket` in their namespace. As such, I'm +1 on closing this unless @kennethreitz wants to add a reference to the `socket` stdlib to `requests`, i.e., in `requests/__init__.py` putting `import socket`.\n" ]
https://api.github.com/repos/psf/requests/issues/1146
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1146/labels{/name}
https://api.github.com/repos/psf/requests/issues/1146/comments
https://api.github.com/repos/psf/requests/issues/1146/events
https://github.com/psf/requests/pull/1146
10,345,840
MDExOlB1bGxSZXF1ZXN0Mzg1NTE3MA==
1,146
It`s more pep8 now
{ "avatar_url": "https://avatars.githubusercontent.com/u/642195?v=4", "events_url": "https://api.github.com/users/oczkers/events{/privacy}", "followers_url": "https://api.github.com/users/oczkers/followers", "following_url": "https://api.github.com/users/oczkers/following{/other_user}", "gists_url": "https://api.github.com/users/oczkers/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/oczkers", "id": 642195, "login": "oczkers", "node_id": "MDQ6VXNlcjY0MjE5NQ==", "organizations_url": "https://api.github.com/users/oczkers/orgs", "received_events_url": "https://api.github.com/users/oczkers/received_events", "repos_url": "https://api.github.com/users/oczkers/repos", "site_admin": false, "starred_url": "https://api.github.com/users/oczkers/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/oczkers/subscriptions", "type": "User", "url": "https://api.github.com/users/oczkers", "user_view_type": "public" }
[]
closed
true
null
[]
null
7
2013-01-27T01:07:11Z
2021-09-08T19:00:43Z
2013-01-28T03:11:15Z
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/1146/reactions" }
https://api.github.com/repos/psf/requests/issues/1146/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/1146.diff", "html_url": "https://github.com/psf/requests/pull/1146", "merged_at": "2013-01-28T03:11:15Z", "patch_url": "https://github.com/psf/requests/pull/1146.patch", "url": "https://api.github.com/repos/psf/requests/pulls/1146" }
true
[ "I disagree with one of these changes.\n\nWe'll see how long I can stand it :)\n", "Demanding one blank line (instead of the two) between function definitions is a very bad idea. We should try to create some coding standard for Requests.\n", "@piotr-dobrogost why is it a bad idea?\n", "@sigmavirus24 \n\nBecause one blank line is a good way of separating blocks of code inside a function. In light of this separating functions with only one blank line doesn't separate them enough.\n", "I've always felt like the nice yellow word 'def' and the change in indentation made it pretty clear. =)\n", "@piotr-dobrogost I guess it is merely a matter of preference. I use PEP8 for all my projects. I've never had a problem determining between two methods. And two functions (not methods) are always separated by 2 blank lines as per pep8.\n", "@piotr-dobrogost calm down\n" ]
https://api.github.com/repos/psf/requests/issues/1145
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1145/labels{/name}
https://api.github.com/repos/psf/requests/issues/1145/comments
https://api.github.com/repos/psf/requests/issues/1145/events
https://github.com/psf/requests/pull/1145
10,340,238
MDExOlB1bGxSZXF1ZXN0Mzg1MzMxNQ==
1,145
Mock the links test
{ "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
2
2013-01-26T17:04:05Z
2021-09-08T19:00:42Z
2013-01-26T17:05:19Z
CONTRIBUTOR
resolved
Since Travis hits the GitHub API so frequently, you will sometimes run into issues where GitHub's ratelimit has been exceeded by the IP address being used. This mocks the headers from a good response from the API, and performs the test. It also shaves off about 10s on the test run on my local (horrible) internet.
{ "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/1145/reactions" }
https://api.github.com/repos/psf/requests/issues/1145/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/1145.diff", "html_url": "https://github.com/psf/requests/pull/1145", "merged_at": "2013-01-26T17:05:19Z", "patch_url": "https://github.com/psf/requests/pull/1145.patch", "url": "https://api.github.com/repos/psf/requests/pulls/1145" }
true
[ ":cake:\n", "love it!\n" ]
https://api.github.com/repos/psf/requests/issues/1144
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1144/labels{/name}
https://api.github.com/repos/psf/requests/issues/1144/comments
https://api.github.com/repos/psf/requests/issues/1144/events
https://github.com/psf/requests/issues/1144
10,336,188
MDU6SXNzdWUxMDMzNjE4OA==
1,144
Bad Request on some sites
{ "avatar_url": "https://avatars.githubusercontent.com/u/478194?v=4", "events_url": "https://api.github.com/users/observerss/events{/privacy}", "followers_url": "https://api.github.com/users/observerss/followers", "following_url": "https://api.github.com/users/observerss/following{/other_user}", "gists_url": "https://api.github.com/users/observerss/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/observerss", "id": 478194, "login": "observerss", "node_id": "MDQ6VXNlcjQ3ODE5NA==", "organizations_url": "https://api.github.com/users/observerss/orgs", "received_events_url": "https://api.github.com/users/observerss/received_events", "repos_url": "https://api.github.com/users/observerss/repos", "site_admin": false, "starred_url": "https://api.github.com/users/observerss/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/observerss/subscriptions", "type": "User", "url": "https://api.github.com/users/observerss", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2013-01-26T08:52:47Z
2021-09-09T05:00:48Z
2013-01-26T15:13:29Z
NONE
resolved
``` python print requests.get('http://thepiratebay.se/recent').content ``` the code above runs normally in requests 0.14.2 but, tpb returns bad request in requests 1.1.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/1144/reactions" }
https://api.github.com/repos/psf/requests/issues/1144/timeline
null
completed
null
null
false
[ "This is hard for me to test [in the UK](http://www.guardian.co.uk/technology/2012/apr/30/british-isps-block-pirate-bay), but my magic mind powers suggest that this might be related to #1051, which was fixed by #1142. I don't think that fix is in PyPI yet, but can you try installing the current repository version in a virtualenv and see if it works?\n", "This is what I see pre #1142\n\n``` python\n>>> import requests\n>>> r = requests.get('http://thepiratebay.se/recent')\n>>> r\n<Response [400]>\n>>> dir(r)\n['__bool__', '__class__', '__delattr__', '__dict__', '__doc__', '__format__', '__getattribute__', '__hash__', '__init__', '__module__', '__new__', '__nonzero__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', '_content', '_content_consumed', 'apparent_encoding', 'close', 'connection', 'content', 'cookies', 'encoding', 'headers', 'history', 'iter_content', 'iter_lines', 'json', 'links', 'ok', 'raise_for_status', 'raw', 'reason', 'request', 'status_code', 'text', 'url']\n>>> r.content\n'<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>\\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\"\\n \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\\n <head>\\n <title>400 - Bad Request</title>\\n </head>\\n <body>\\n <h1>400 - Bad Request</h1>\\n </body>\\n</html>\\n'\n>>> r.history\n[]\n```\n\nAnd after #1142 \n\n``` python\n>>> import requests\n>>> r = requests.get('http://thepiratebay.se/recent')\n>>> r\n<Response [200]>\n```\n\nSo @Lukasa is correct, and this is a duplicate.\n" ]
https://api.github.com/repos/psf/requests/issues/1143
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1143/labels{/name}
https://api.github.com/repos/psf/requests/issues/1143/comments
https://api.github.com/repos/psf/requests/issues/1143/events
https://github.com/psf/requests/pull/1143
10,305,884
MDExOlB1bGxSZXF1ZXN0Mzg1Mjk3Nw==
1,143
Response as iterator
{ "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
16
2013-01-25T10:11:20Z
2021-09-08T19:00:42Z
2013-01-29T04:52:18Z
MEMBER
resolved
Either: ``` python r = requests.get('http://bigsite.com/') for line in r: # Do stuff. ``` or: ``` python r = requests.get('http://bigsite.com/') for chunk in r: # Do stuff. ``` See #1141.
{ "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/1143/reactions" }
https://api.github.com/repos/psf/requests/issues/1143/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/1143.diff", "html_url": "https://github.com/psf/requests/pull/1143", "merged_at": "2013-01-29T04:52:18Z", "patch_url": "https://github.com/psf/requests/pull/1143.patch", "url": "https://api.github.com/repos/psf/requests/pulls/1143" }
true
[ "This breeds ambiguity I think. On the one hand iterating over the lines would work in the above example, but how should the user expect the following to behave?\n\n``` python\nr = requests.get('https://s3.amazon.com/big_download.tar.gz', stream=True)\n\nfor data in r:\n # Do stuff.\n```\n\nFor this reason alone I'm partial to using `iter_content`, with a reasonable chunk size if this is implemented at all. (And this would be extraordinarily easy to do.)\n", "I'm happy to use `iter_content` instead of `iter_lines`. =)\n", "``` python\nimport requests\n\nr = requests.get('http://www.google.com/', stream=True)\n\nfor chunk in r:\n print chunk\n```\n\nAll done, and we even have a test. =)\n", "Ugh, Python 3 changed the behaviour of generators. Need to have a think about this.\n", "Ah yeah, that's what I was thinking of. `next(iter(r))`\n", "Already on it. =D\n", "Ugh, same test failures as in #1119. Totally convinced this isn't my fault.\n", "I'm almost tempted to just mock it with a fake response so that it always passes. I'm going to see if I can reproduce it here though.\n", "OH DUH! I know why that test is failing. The API hits it's limit from the Travis IP addresses so quickly and bizarrely that you're getting a 411 (or I forget which they use to signify you're over the rate-limit). It's why the errors don't reproduce locally. I'll send a patch with the mocked response.\n\nOtherwise :+1: on this PR\n\n_Edit_ And by \"DUH\" I meant, \"I should have realized this sooner\". I have seen this far too many times and I never realize it as quickly as I should.\n", "I don't need the patch, the test is already in the repo. May as well just open a PR with the fix. =)\n", "Yeah, I pushed to master instead of to this pull request branch. \n", "I give up trying to push to here. I'll just open the PR from my fork.\n", "Thanks @sigmavirus24!\n", "let me know when i was ready to merge\n", "@kennethreitz: Rebased. =)\n", ":cake:\n" ]
https://api.github.com/repos/psf/requests/issues/1142
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1142/labels{/name}
https://api.github.com/repos/psf/requests/issues/1142/comments
https://api.github.com/repos/psf/requests/issues/1142/events
https://github.com/psf/requests/pull/1142
10,300,677
MDExOlB1bGxSZXF1ZXN0MzgzNDUyNQ==
1,142
Remove default Content-Length from GET requests.
{ "avatar_url": "https://avatars.githubusercontent.com/u/440353?v=4", "events_url": "https://api.github.com/users/theaeolianmachine/events{/privacy}", "followers_url": "https://api.github.com/users/theaeolianmachine/followers", "following_url": "https://api.github.com/users/theaeolianmachine/following{/other_user}", "gists_url": "https://api.github.com/users/theaeolianmachine/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/theaeolianmachine", "id": 440353, "login": "theaeolianmachine", "node_id": "MDQ6VXNlcjQ0MDM1Mw==", "organizations_url": "https://api.github.com/users/theaeolianmachine/orgs", "received_events_url": "https://api.github.com/users/theaeolianmachine/received_events", "repos_url": "https://api.github.com/users/theaeolianmachine/repos", "site_admin": false, "starred_url": "https://api.github.com/users/theaeolianmachine/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/theaeolianmachine/subscriptions", "type": "User", "url": "https://api.github.com/users/theaeolianmachine", "user_view_type": "public" }
[]
closed
true
null
[]
null
10
2013-01-25T05:19:16Z
2021-09-08T19:00:41Z
2013-01-26T04:58:20Z
NONE
resolved
Fix #1051.
{ "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/1142/reactions" }
https://api.github.com/repos/psf/requests/issues/1142/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/1142.diff", "html_url": "https://github.com/psf/requests/pull/1142", "merged_at": "2013-01-26T04:58:20Z", "patch_url": "https://github.com/psf/requests/pull/1142.patch", "url": "https://api.github.com/repos/psf/requests/pulls/1142" }
true
[ "Great will fix\n", "We need PATCH in that tuple as well.\n", "Let's do the opposite:\n\nif not self.method in ('GET', 'HEAD')\n", "Yeah, I should have done that from the start :).\n", "Does anyone know if I merge these locally and force push, will the pull request on Github figure it out? Most of these commits I feel like I should have just put in a single commit. Normally this is a terrible idea, but the Push Request model seems to work well for this. Otherwise, I'll just push up another commit.\n", "nah it doesn't matter, just add a new commit :)\n", "Cool :)\n", "> If I merge these locally and force push, will the pull request still work \n> out. Most of these commits I feel like I should have just put in a single \n> commit. Otherwise, I'll just push up another one.\n\nSquashing should work just fine. :)\n", "Ah, @kennethreitz beat you to it. MOAR COMMITS!\n", ":sparkles: :cake: :sparkles:\n" ]
https://api.github.com/repos/psf/requests/issues/1141
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1141/labels{/name}
https://api.github.com/repos/psf/requests/issues/1141/comments
https://api.github.com/repos/psf/requests/issues/1141/events
https://github.com/psf/requests/issues/1141
10,282,937
MDU6SXNzdWUxMDI4MjkzNw==
1,141
[RFC] Response as a string
{ "avatar_url": "https://avatars.githubusercontent.com/u/259697?v=4", "events_url": "https://api.github.com/users/nfx/events{/privacy}", "followers_url": "https://api.github.com/users/nfx/followers", "following_url": "https://api.github.com/users/nfx/following{/other_user}", "gists_url": "https://api.github.com/users/nfx/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/nfx", "id": 259697, "login": "nfx", "node_id": "MDQ6VXNlcjI1OTY5Nw==", "organizations_url": "https://api.github.com/users/nfx/orgs", "received_events_url": "https://api.github.com/users/nfx/received_events", "repos_url": "https://api.github.com/users/nfx/repos", "site_admin": false, "starred_url": "https://api.github.com/users/nfx/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/nfx/subscriptions", "type": "User", "url": "https://api.github.com/users/nfx", "user_view_type": "public" }
[]
closed
true
null
[]
null
7
2013-01-24T18:18:28Z
2021-09-09T05:00:49Z
2013-01-25T10:09:56Z
NONE
resolved
In some cases it could be useful, that response would act as a string: ``` >>> response = requests.get('https://api.thing.somewhere/size/blah', auth=('user', 'pass')) >>> response.status_code 200 >>> "Blah is %d big" % response Blah is 3242 big >>> response.headers['content-type'] 'text/plain' ``` is it contrary to pythonic ideas?
{ "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/1141/reactions" }
https://api.github.com/repos/psf/requests/issues/1141/timeline
null
completed
null
null
false
[ "It's not un-pythonic, but I would argue it violates the principle of least surprise. I would not say that a Response's string representation is its Content Length.\n", "yeah, i don't think we want to go this route.\n\nA better question is should responses be iterable?\n", "I will say yes if you can tell me what word goes in place of 'X' in the following code:\n\n``` python\nfor X in response:\n # Do stuff\n```\n", "There are plenty of times where we can not pre-determine the length of a \nresponse so your example only works half the time. (The issue of getting the \nlength of a response has been discussed ad nauseum as well.)\n", "@Lukasa line or chunk\n", "Ooh, I like that. I'm +1 on it.\n", "So let's close this issue (or rename it) and open one for using the response object as an iterator?\n" ]
https://api.github.com/repos/psf/requests/issues/1140
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1140/labels{/name}
https://api.github.com/repos/psf/requests/issues/1140/comments
https://api.github.com/repos/psf/requests/issues/1140/events
https://github.com/psf/requests/pull/1140
10,281,884
MDExOlB1bGxSZXF1ZXN0MzgyNDcyMQ==
1,140
Test for cookie parameters.
{ "avatar_url": "https://avatars.githubusercontent.com/u/331338?v=4", "events_url": "https://api.github.com/users/ralphbean/events{/privacy}", "followers_url": "https://api.github.com/users/ralphbean/followers", "following_url": "https://api.github.com/users/ralphbean/following{/other_user}", "gists_url": "https://api.github.com/users/ralphbean/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/ralphbean", "id": 331338, "login": "ralphbean", "node_id": "MDQ6VXNlcjMzMTMzOA==", "organizations_url": "https://api.github.com/users/ralphbean/orgs", "received_events_url": "https://api.github.com/users/ralphbean/received_events", "repos_url": "https://api.github.com/users/ralphbean/repos", "site_admin": false, "starred_url": "https://api.github.com/users/ralphbean/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/ralphbean/subscriptions", "type": "User", "url": "https://api.github.com/users/ralphbean", "user_view_type": "public" }
[]
closed
true
null
[]
null
6
2013-01-24T17:49:38Z
2021-09-08T18:01:27Z
2013-01-26T04:58:35Z
CONTRIBUTOR
resolved
I wasn't sure if setting some parameters on cookies was working or not, so I wrote a unit test for it. The test passes; turns out I was just using it wrong in my other module.
{ "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/1140/reactions" }
https://api.github.com/repos/psf/requests/issues/1140/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/1140.diff", "html_url": "https://github.com/psf/requests/pull/1140", "merged_at": "2013-01-26T04:58:35Z", "patch_url": "https://github.com/psf/requests/pull/1140.patch", "url": "https://api.github.com/repos/psf/requests/pulls/1140" }
true
[ ":+1:\n", "The test failure lies in unittest in python 2.6 not having the `assertIn` method. I'll work from @ralphbean's pr and add a work around tomorrow.\n", "Oh.. I can push a fix commit. One moment.\n", "There. :)\n", ":+1:\n\nLooks good to me.\n", "yay!\n" ]
https://api.github.com/repos/psf/requests/issues/1139
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1139/labels{/name}
https://api.github.com/repos/psf/requests/issues/1139/comments
https://api.github.com/repos/psf/requests/issues/1139/events
https://github.com/psf/requests/pull/1139
10,274,540
MDExOlB1bGxSZXF1ZXN0MzgyMjAwNA==
1,139
HTTPDigestAuth et al don't preserve stream, proxies etc.
{ "avatar_url": "https://avatars.githubusercontent.com/u/238690?v=4", "events_url": "https://api.github.com/users/alexdutton/events{/privacy}", "followers_url": "https://api.github.com/users/alexdutton/followers", "following_url": "https://api.github.com/users/alexdutton/following{/other_user}", "gists_url": "https://api.github.com/users/alexdutton/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/alexdutton", "id": 238690, "login": "alexdutton", "node_id": "MDQ6VXNlcjIzODY5MA==", "organizations_url": "https://api.github.com/users/alexdutton/orgs", "received_events_url": "https://api.github.com/users/alexdutton/received_events", "repos_url": "https://api.github.com/users/alexdutton/repos", "site_admin": false, "starred_url": "https://api.github.com/users/alexdutton/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/alexdutton/subscriptions", "type": "User", "url": "https://api.github.com/users/alexdutton", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2013-01-24T14:39:32Z
2021-09-08T23:01:00Z
2013-01-26T05:03:10Z
NONE
resolved
`HTTPDigestAuth.handle_401()` replaces the original response with another by doing `r.connection.send(r.request)`. This ignores the arguments originally passed to `Session.request()` such as `stream`, `proxies`, `timeout`, `verify` and `cert`. `HTTPDigestAuth` (and other hooks that behave similarly) need a way to perform additional requests in the same context as the original. This could be done by having `request.Session` set the relevant instance attributes in `__init__()` and then doing `resp.session = self` after `self.send()`. It's possible that `requests.request()` et al should also pass those arguments to the `Session.__init__()`, not `Session.request()`.
{ "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/1139/reactions" }
https://api.github.com/repos/psf/requests/issues/1139/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/1139.diff", "html_url": "https://github.com/psf/requests/pull/1139", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/1139.patch", "url": "https://api.github.com/repos/psf/requests/pulls/1139" }
true
[ "Hmm, I don't think this is the right approach currently. We'll have to reevaluate soon.\n" ]
https://api.github.com/repos/psf/requests/issues/1138
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1138/labels{/name}
https://api.github.com/repos/psf/requests/issues/1138/comments
https://api.github.com/repos/psf/requests/issues/1138/events
https://github.com/psf/requests/pull/1138
10,259,344
MDExOlB1bGxSZXF1ZXN0MzgxMzYwMw==
1,138
Time each request
{ "avatar_url": "https://avatars.githubusercontent.com/u/2089?v=4", "events_url": "https://api.github.com/users/clee/events{/privacy}", "followers_url": "https://api.github.com/users/clee/followers", "following_url": "https://api.github.com/users/clee/following{/other_user}", "gists_url": "https://api.github.com/users/clee/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/clee", "id": 2089, "login": "clee", "node_id": "MDQ6VXNlcjIwODk=", "organizations_url": "https://api.github.com/users/clee/orgs", "received_events_url": "https://api.github.com/users/clee/received_events", "repos_url": "https://api.github.com/users/clee/repos", "site_admin": false, "starred_url": "https://api.github.com/users/clee/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/clee/subscriptions", "type": "User", "url": "https://api.github.com/users/clee", "user_view_type": "public" }
[]
closed
true
null
[]
null
11
2013-01-24T02:17:33Z
2021-09-08T18:01:26Z
2013-01-28T03:10:16Z
CONTRIBUTOR
resolved
Pretty simple - adds calls to time.time() around send() and a new attribute, Response.time_taken, to tell how long the last request took.
{ "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/1138/reactions" }
https://api.github.com/repos/psf/requests/issues/1138/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/1138.diff", "html_url": "https://github.com/psf/requests/pull/1138", "merged_at": "2013-01-28T03:10:16Z", "patch_url": "https://github.com/psf/requests/pull/1138.patch", "url": "https://api.github.com/repos/psf/requests/pulls/1138" }
true
[ "I like this, it's cool for simple metrics (needed something like this sometime ago). But wouldn't be better to put the result in the returned `Response` object?\n\nThat way we can use it like the code below and keep track of the request time for every request made.\n\n``` python\nimport requests\nresponse = requests.get('https://google.com')\nprint response.elapsed()\n```\n\nAlso, `elapsed` is the best name for this? Property vs method? (I'm not familiar with requests internal code standards).\n\n:+1: \n", "This has been requested/proposed a few times before and shot down each time. As it is, a method would not be the preferable way of doing this. You would simply time it either on the adapter or session level, and set an attribute named `elapsed` as the value. There's no need to store two separate attributes and recalculate it each time. It isn't going to change since the request has been completed. (Remember: methods have overhead, attributes don't.)\n\nAlso, this is inaccurate because streaming requests don't technically complete when the response object is returned, so there is no accurate way of timing those responses since you're ostensibly doing something with each chunk you read which would affect the timing.\n", "@sigmavirus24 Your point about streaming responses is correct; I'm not sure that a simple 'end - start' timer is useful for streaming responses _anyway_, but it IS useful for everything else (which is what I need).\n\nAs far as whether it's better as a method or a property - I honestly don't care. It's such a small change that if it gets rewritten to be a single property instead of a method, hooray! All I want is the ability to _get_ this information, from requests, without having to patch it myself every time I use it. @kennethreitz didn't seem to be convinced that this functionality even _belongs_ in requests, so I'm hoping that even if this particular commit doesn't get accepted, the general idea is considered to be worthwhile and some kind of implementation makes its way in.\n", "Btw, @kennethreitz, as we discussed on IRC, :+1:. :shipit: \n", "I hope this gets added in\n", "+1, this would be super useful\n", "+1 for utility\n", "get rid of start and finish and i'll merge :)\n", "Eh, I'll update it.\n", "gah, need to rebase\n", "@kennethreitz which start and finish are you talking about? The locals in the adapters file?\n" ]
https://api.github.com/repos/psf/requests/issues/1137
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1137/labels{/name}
https://api.github.com/repos/psf/requests/issues/1137/comments
https://api.github.com/repos/psf/requests/issues/1137/events
https://github.com/psf/requests/pull/1137
10,258,588
MDExOlB1bGxSZXF1ZXN0MzgxMzE5NQ==
1,137
Remove a test per @kennethreitz in IRC
{ "avatar_url": "https://avatars.githubusercontent.com/u/134455?v=4", "events_url": "https://api.github.com/users/chadwhitacre/events{/privacy}", "followers_url": "https://api.github.com/users/chadwhitacre/followers", "following_url": "https://api.github.com/users/chadwhitacre/following{/other_user}", "gists_url": "https://api.github.com/users/chadwhitacre/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/chadwhitacre", "id": 134455, "login": "chadwhitacre", "node_id": "MDQ6VXNlcjEzNDQ1NQ==", "organizations_url": "https://api.github.com/users/chadwhitacre/orgs", "received_events_url": "https://api.github.com/users/chadwhitacre/received_events", "repos_url": "https://api.github.com/users/chadwhitacre/repos", "site_admin": false, "starred_url": "https://api.github.com/users/chadwhitacre/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/chadwhitacre/subscriptions", "type": "User", "url": "https://api.github.com/users/chadwhitacre", "user_view_type": "public" }
[]
closed
true
null
[]
null
0
2013-01-24T01:36:17Z
2021-09-08T18:01:26Z
2013-01-24T01:37:13Z
CONTRIBUTOR
resolved
The test suite is moving from the httpbin pattern (which hits the network) to depending on the request.prepare method (which doesn't). Here's a start ... :rocket:
{ "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/1137/reactions" }
https://api.github.com/repos/psf/requests/issues/1137/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/1137.diff", "html_url": "https://github.com/psf/requests/pull/1137", "merged_at": "2013-01-24T01:37:13Z", "patch_url": "https://github.com/psf/requests/pull/1137.patch", "url": "https://api.github.com/repos/psf/requests/pulls/1137" }
true
[]
https://api.github.com/repos/psf/requests/issues/1136
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1136/labels{/name}
https://api.github.com/repos/psf/requests/issues/1136/comments
https://api.github.com/repos/psf/requests/issues/1136/events
https://github.com/psf/requests/pull/1136
10,258,515
MDExOlB1bGxSZXF1ZXN0MzgxMzE1Ng==
1,136
introduce a test for link headers.
{ "avatar_url": "https://avatars.githubusercontent.com/u/27786?v=4", "events_url": "https://api.github.com/users/steveklabnik/events{/privacy}", "followers_url": "https://api.github.com/users/steveklabnik/followers", "following_url": "https://api.github.com/users/steveklabnik/following{/other_user}", "gists_url": "https://api.github.com/users/steveklabnik/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/steveklabnik", "id": 27786, "login": "steveklabnik", "node_id": "MDQ6VXNlcjI3Nzg2", "organizations_url": "https://api.github.com/users/steveklabnik/orgs", "received_events_url": "https://api.github.com/users/steveklabnik/received_events", "repos_url": "https://api.github.com/users/steveklabnik/repos", "site_admin": false, "starred_url": "https://api.github.com/users/steveklabnik/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/steveklabnik/subscriptions", "type": "User", "url": "https://api.github.com/users/steveklabnik", "user_view_type": "public" }
[]
closed
true
null
[]
null
4
2013-01-24T01:32:54Z
2021-09-08T18:01:25Z
2013-01-24T01:34:55Z
CONTRIBUTOR
resolved
This test is kinda bad, submitting for feedback, fixup, and eventual inclusion. There's currently no test to to check that the `Link` header parsing actually works, so I wrote one. It pings GitHub, so that's bad, obviously. You mentioned on IRC that you could use `PreparedRequest`; should that be what I'm doing here? :heart: :sparkling_heart: :heart:
{ "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/1136/reactions" }
https://api.github.com/repos/psf/requests/issues/1136/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/1136.diff", "html_url": "https://github.com/psf/requests/pull/1136", "merged_at": "2013-01-24T01:34:55Z", "patch_url": "https://github.com/psf/requests/pull/1136.patch", "url": "https://api.github.com/repos/psf/requests/pulls/1136" }
true
[ "Hmm, we need a mocked Response connection adapter.\n\nI'm on it!\n", "Also, I wanted to use httpbin, but it doesn't have a way to return them. Would that be useful to add to it?\n", "Well, we're going to remove it completely. Give me a few, I'll give you a mock response which will be awesome.\n", ":metal:\n" ]
https://api.github.com/repos/psf/requests/issues/1135
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1135/labels{/name}
https://api.github.com/repos/psf/requests/issues/1135/comments
https://api.github.com/repos/psf/requests/issues/1135/events
https://github.com/psf/requests/pull/1135
10,258,129
MDExOlB1bGxSZXF1ZXN0MzgxMjk0NQ==
1,135
Add OAuth to features
{ "avatar_url": "https://avatars.githubusercontent.com/u/619795?v=4", "events_url": "https://api.github.com/users/mahmoudhossam/events{/privacy}", "followers_url": "https://api.github.com/users/mahmoudhossam/followers", "following_url": "https://api.github.com/users/mahmoudhossam/following{/other_user}", "gists_url": "https://api.github.com/users/mahmoudhossam/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/mahmoudhossam", "id": 619795, "login": "mahmoudhossam", "node_id": "MDQ6VXNlcjYxOTc5NQ==", "organizations_url": "https://api.github.com/users/mahmoudhossam/orgs", "received_events_url": "https://api.github.com/users/mahmoudhossam/received_events", "repos_url": "https://api.github.com/users/mahmoudhossam/repos", "site_admin": false, "starred_url": "https://api.github.com/users/mahmoudhossam/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/mahmoudhossam/subscriptions", "type": "User", "url": "https://api.github.com/users/mahmoudhossam", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2013-01-24T01:15:27Z
2021-09-08T18:01:24Z
2013-01-24T01:16:30Z
CONTRIBUTOR
resolved
We have OAuth now, right?
{ "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/1135/reactions" }
https://api.github.com/repos/psf/requests/issues/1135/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/1135.diff", "html_url": "https://github.com/psf/requests/pull/1135", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/1135.patch", "url": "https://api.github.com/repos/psf/requests/pulls/1135" }
true
[ "Removed from Requests proper actually :)\n" ]
https://api.github.com/repos/psf/requests/issues/1134
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1134/labels{/name}
https://api.github.com/repos/psf/requests/issues/1134/comments
https://api.github.com/repos/psf/requests/issues/1134/events
https://github.com/psf/requests/pull/1134
10,257,930
MDExOlB1bGxSZXF1ZXN0MzgxMjgzOA==
1,134
remove silly assert
{ "avatar_url": "https://avatars.githubusercontent.com/u/27786?v=4", "events_url": "https://api.github.com/users/steveklabnik/events{/privacy}", "followers_url": "https://api.github.com/users/steveklabnik/followers", "following_url": "https://api.github.com/users/steveklabnik/following{/other_user}", "gists_url": "https://api.github.com/users/steveklabnik/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/steveklabnik", "id": 27786, "login": "steveklabnik", "node_id": "MDQ6VXNlcjI3Nzg2", "organizations_url": "https://api.github.com/users/steveklabnik/orgs", "received_events_url": "https://api.github.com/users/steveklabnik/received_events", "repos_url": "https://api.github.com/users/steveklabnik/repos", "site_admin": false, "starred_url": "https://api.github.com/users/steveklabnik/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/steveklabnik/subscriptions", "type": "User", "url": "https://api.github.com/users/steveklabnik", "user_view_type": "public" }
[]
closed
true
null
[]
null
6
2013-01-24T01:05:10Z
2021-09-08T23:01:06Z
2013-01-24T01:06:40Z
CONTRIBUTOR
resolved
C'mon bro. :wink:
{ "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/1134/reactions" }
https://api.github.com/repos/psf/requests/issues/1134/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/1134.diff", "html_url": "https://github.com/psf/requests/pull/1134", "merged_at": "2013-01-24T01:06:40Z", "patch_url": "https://github.com/psf/requests/pull/1134.patch", "url": "https://api.github.com/repos/psf/requests/pulls/1134" }
true
[ "one must question everything\n", ":metal:\n\nIt's true, you never know, someone may have monkey-patched `assert` to always return true!\n\nOh wait, this isn't Ruby. :wink: \n\nHopefully actually meaningful commits coming soon.\n", "DON'T DO IT :-1: \n", "```\n>>> True = False\n```\n", "```\n File \"<stdin>\", line 1\nSyntaxError: assignment to keyword\n```\n", "Python 3?\n" ]
https://api.github.com/repos/psf/requests/issues/1133
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1133/labels{/name}
https://api.github.com/repos/psf/requests/issues/1133/comments
https://api.github.com/repos/psf/requests/issues/1133/events
https://github.com/psf/requests/issues/1133
10,254,642
MDU6SXNzdWUxMDI1NDY0Mg==
1,133
Pluggable Request objects?
{ "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
35
2013-01-23T23:04:09Z
2021-09-09T05:00:46Z
2013-02-05T19:44:05Z
CONTRIBUTOR
resolved
It would be super cool if it were possible to plug a custom Request object over a Session object. However it looks as though the Request object is hardcoded into the request method, e.g. https://github.com/kennethreitz/requests/blob/1a87f15e6f8d22be6855424b46b80f66d178fe40/requests/sessions.py#L264 Any thoughts on this?
{ "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" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/1133/reactions" }
https://api.github.com/repos/psf/requests/issues/1133/timeline
null
completed
null
null
false
[ "Like changing the Session class's `__init__(self)` to `__init__(self, req=None)` then in the request method only create a new Request() if self.req is None?\n", "What would your custom request object do?\n", "@alanhamlett I think he means customizing the the Request class itself and using that instead of the one that comes with requests.\n", "@sigmavirus24 exactly what I was saying.\n\nThe primary issue I see today is that if I want to either manipulate a Request instance or subclass the Request object and do my own thing I lose the functionality of the `Session.request` method. It would seem pretty terrible to have to reimplement that method in an ad hoc way just for things like timeouts on the request.\n\nThe broader point I'm driving at is `Session.request` explicitly instantiates `Request` which means a caller can't control the behavior of that object. It would really be a shame to have to implement a custom `Session.request` with what would effectively be almost an entire repetition of the request method's logic save for one line's difference.\n\nUnless I'm missing something, this seems to be encouraging some non-idiomatic solutions so perhaps it would be nice to allow a caller to tell Session which Request object to use?\n", "Apologies, I meant \"allow_redirects\" where I said \"timeout\" in my previous comment. Needed some :coffee:!\n", "All right let me follow up here and say that I think I was misunderstanding the design intent of Request, PreparedRequest, Session, and the adaptor design:\n\nI think the blog post announcement for v1.0.0 is fairly confusing given that it leads with an example of the Request object being dispatched via send with a note stating that such an object is fully mutable. This led me to believe that the \"normal\" codepath for a standard requests' call looked exactly like this. However in reality there is a bunch of logic happening in the request method. If you call `Session.send` directly, you lose that functionality. That's a big ouch if your intent is to preserve the standard `requests.request` API.\n\nLater on in that post custom adaptors are mentioned, e.g. `HTTPAdapter`. After going about it in the opposite way, e.g. creating my own `Request` object and doing some fancy manipulation over this object with the expectation of dispatching the `PreparedRequest` it would generate via `Session.send` I found that, oops, I lost the `Session.request` method in the process, e.g. things like `allow_redirects` are explicitly handled in the scope of `Session.reqiest`. So it seems the actual design intent is that I would instead create an adaptor and then overload the `send` method wherein I could do manipulation over the `PreparedRequest` object.\n\nSo correct me if I'm wrong, but the fact of mutability over the `Request` object is probably best exploited by creating a custom `HTTPAdapter` if my intent is to preserve cool methods such as `Session.request`? However showing me a simple example as is done in the blog post caused me to assume I could use it directly by subclassing or some such. Maybe this bears a little extra explanation so as to avoid confusion?\n", "Basically, the manual creation of Request objects is a new feature that wasn't present before. When you use a normal request method, as before, like `requests.get`, all it is going is:\n- Creating a Request object with the parameters you passed in.\n- Creating a new session\n- Preparing that Request and sending it through the session\n\nNow, if you are unhappy with some aspect of the generated PreparedRequest, you can change it to behave _exactly_ as you like. \n", "@kennethreitz yes but there's a caveat to that, unless I'm misunderstanding: if you want the wrapper around `send`, i.e. `request` and its helpers, then you have to write your own `Session.send` in order to manipulate the `Request`/`PreparedRequest`, yes?\n", "No, you simply send the modified request through the normal session.send\n\n```\ns = requests.Session()\nr = requests.Request('POST', 'http://httpbin.org/post', data={'bad': 'data'}).prepare()\nr.body = 'good-data'\n\n>>> s.send(r)\n<Response [200]>\n>>> _.json()['body']\nu'good-data'\n\n```\n", "@kennethreitz where do you have access to `Session.request` then? The request has to be sent via `s.send` which eschews all the cool logic happening in `s.request`, right? I can't bootstrap the `Session` with my `Request` instance so I don't see how I can ever use `s.request`.\n", "@maxcountryman, that's the cool part. All s.request does is create a Request object, which you already did :)\n", "All of the logic is now contained in `Request` and `session.send`\n", "Everything else is sugar\n", "@kennethreitz that \"sugar\" is really handy to have around and it's also expected by anyone who uses the requests standard API, e.g. via `requests.request`. So for instance, say you want to pass `allow_redirects`, unfortunately if I have to invoke `s.send` directly this means I need to write my own wrapper around `s.send` which would basically only change one line of code in `s.request`, i.e. the `req = Request()` line. Am I totally off the mark here?\n", "I don't think I follow at all. Did you see the code example above?\n", "@kennethreitz how can you pass `allow_redirects` to `s.send`? Unless I'm totally missing something, the answer is you can't, because `s.request` does more than just construct a `Request` object. It does neat things like extrapolate on that object to follow redirects, it handles cookies, etc. If I want all that, i.e. if I want to write a custom interface around a Request object that allows the caller to pass in the exact same params they could to `requests.request` then I have to reimplement `s.request` because there's just one line of code there that is fixed and I can't touch, namely `req = Request()`. If all `s.request` did was construct a `Request` object then that would be fine, but from what I can see there's a bunch of stuff happening in its scope which I am in need of. :)\n", "@kennethreitz: He wants to use what is essentially a subclass of the `Request` class, which presumably implements different logic for either `Request.prepare` or one of the data fields.\n\nWe can solve this, however, by using MAGIC!\n\n``` python\nimport requests\n\nclass MagicRequest(requests.Request):\n def prepare(self):\n self.headers['Awesome'] = 'Hell Yeah'\n return super(MagicRequest, self).prepare()\n\nrequests.Request = MagicRequest\n```\n\nDone. Hell yeah. :sunglasses:\n", "@maxcountryman It's a parameter of send.\n\n```\ns.send(r, allow_redirects=False)\n```\n", "@kennethreitz I get a keyword error on that...\n\n``` python\n>>> s.send(r.prepare(), allow_redirects=True)\nTraceback (most recent call last):\n File \"<stdin>\", line 1, in <module>\n File \"/Library/Python/2.7/site-packages/requests/sessions.py\", line 374, in send\n r = adapter.send(request, **kwargs)\nTypeError: send() got an unexpected keyword argument 'allow_redirects'\n```\n", "The handling of `allow_redirects` seems to happen in `s.request` as far as I can tell...\n", "hmm, that shouldn't be happening\n", "@kennethreitz heh, yeah it's quite unfortunate. :p\n", "@kennethreitz: Nope.\n\n``` python\nclass Session(SessionRedirectMixin):\n# ...snip...\n def send(self, request, **kwargs):\n adapter = self.get_adapter(url=request.url)\n r = adapter.send(request, **kwargs)\n return r\n\n# ...snip...\nclass HTTPAdapter(BaseAdapter):\n def send(self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None):\n# ...snip...\n```\n", "FYI:\n\n``` python\n>>> requests.__version__\n'1.1.0'\n```\n", "Yeah I think `s.request` does more than you think...and I really wish it didn't. :(\n", "Because otherwise the description of the design changes in the API are absolutely awesome!\n", "Well let's fix this :)\n", "Awesome! Thanks for bearing with me @kennethreitz. :) I may have a chance to make a pull request later on if someone doesn't beat me to it.\n", "So I guess a question worth asking is: is the preferred solution to modify the `HTTPAdapter` object so that it handles things like `allow_redirects` or to \"plug-in\" a custom `Request` object? (I'm assuming the latter, based on the discussion here.)\n", "@maxcountryman, @kennethreitz and I discussed this on IRC (https://botbot.me/freenode/python-requests/1756572/ from the highlighted line, down) and there are some changes that need to be made (which should have taken place during the refactor) which are going to be made now. So you might want to hold off on working on adapters and custom Request objects just yet.\n" ]
https://api.github.com/repos/psf/requests/issues/1132
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1132/labels{/name}
https://api.github.com/repos/psf/requests/issues/1132/comments
https://api.github.com/repos/psf/requests/issues/1132/events
https://github.com/psf/requests/pull/1132
10,251,155
MDExOlB1bGxSZXF1ZXN0MzgwOTEzOQ==
1,132
Pass kwargs to json.loads
{ "avatar_url": "https://avatars.githubusercontent.com/u/440820?v=4", "events_url": "https://api.github.com/users/sburns/events{/privacy}", "followers_url": "https://api.github.com/users/sburns/followers", "following_url": "https://api.github.com/users/sburns/following{/other_user}", "gists_url": "https://api.github.com/users/sburns/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/sburns", "id": 440820, "login": "sburns", "node_id": "MDQ6VXNlcjQ0MDgyMA==", "organizations_url": "https://api.github.com/users/sburns/orgs", "received_events_url": "https://api.github.com/users/sburns/received_events", "repos_url": "https://api.github.com/users/sburns/repos", "site_admin": false, "starred_url": "https://api.github.com/users/sburns/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/sburns/subscriptions", "type": "User", "url": "https://api.github.com/users/sburns", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2013-01-23T21:28:27Z
2021-09-08T18:01:25Z
2013-01-23T22:02:38Z
CONTRIBUTOR
resolved
Not all JSON is created equally. This commit addresses when users want to take control of the json decode process.
{ "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/1132/reactions" }
https://api.github.com/repos/psf/requests/issues/1132/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/1132.diff", "html_url": "https://github.com/psf/requests/pull/1132", "merged_at": "2013-01-23T22:02:38Z", "patch_url": "https://github.com/psf/requests/pull/1132.patch", "url": "https://api.github.com/repos/psf/requests/pulls/1132" }
true
[ "Thanks!\n" ]
https://api.github.com/repos/psf/requests/issues/1131
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1131/labels{/name}
https://api.github.com/repos/psf/requests/issues/1131/comments
https://api.github.com/repos/psf/requests/issues/1131/events
https://github.com/psf/requests/issues/1131
10,250,230
MDU6SXNzdWUxMDI1MDIzMA==
1,131
New Session API feels awkward
{ "avatar_url": "https://avatars.githubusercontent.com/u/120601?v=4", "events_url": "https://api.github.com/users/stevvooe/events{/privacy}", "followers_url": "https://api.github.com/users/stevvooe/followers", "following_url": "https://api.github.com/users/stevvooe/following{/other_user}", "gists_url": "https://api.github.com/users/stevvooe/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/stevvooe", "id": 120601, "login": "stevvooe", "node_id": "MDQ6VXNlcjEyMDYwMQ==", "organizations_url": "https://api.github.com/users/stevvooe/orgs", "received_events_url": "https://api.github.com/users/stevvooe/received_events", "repos_url": "https://api.github.com/users/stevvooe/repos", "site_admin": false, "starred_url": "https://api.github.com/users/stevvooe/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/stevvooe/subscriptions", "type": "User", "url": "https://api.github.com/users/stevvooe", "user_view_type": "public" }
[]
closed
true
null
[]
null
8
2013-01-23T21:07:58Z
2021-09-09T04:00:32Z
2013-01-23T22:06:32Z
NONE
resolved
With the old session api, one could set defaults with kwargs on session instantiation. For example, usage was similar to the following: ``` with requests.session(cookies=mycookiejar, timeout=0.5): ... do some work ``` This allowed one to rollup session parameters for subclasses quite nicely: ``` class MySession(object): def __init__(self, myparam, *args, **kwargs): kwargs.setdefault('auth', self) super(MySession, self).__init__(self, *args, **kwargs) self.myparam = myparam def __call__(self, request): ... perform some auth with myparam ``` However, the new api is rather awkward in that it requires these params to be painstakingly broken out: ``` with requests.session() as s: s.auth = myauth s.cookies = mycookiejar ... do something with session ``` Now, I wouldn't say this new API type is a bug, but its definitely less flexible in a situation where one wants to consolidate functionality in the session object, which is common for use with APIs. It's also unclear as to why this particular change was made when moving version 1.
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
{ "+1": 1, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 1, "url": "https://api.github.com/repos/psf/requests/issues/1131/reactions" }
https://api.github.com/repos/psf/requests/issues/1131/timeline
null
completed
null
null
false
[ ":+1: I agree that the new API has left something to be desired...\n", "I don't see 'less flexible'. I could see 'more verbose' as a complaint, but 'less flexible' doesn't seem right.\n\nThe rationale (as best I understand it) for the new Session API is that it places all aspects of the Session on equal footing. There is no longer any magic in the session class upon creation, a Session can be freely modified at any stage without problem. This new API reinforces (and encourages) that behaviour.\n\nIf you don't like that API, it is simple to subclass the Session and provide a `kwarg` constructor, and I encourage you to do that. =)\n", "I see. The `session` is treated as a mutable representation of the request context and you've locked down the avenue of mutating this state to setters. This makes the decision more clear.\n\n> If you don't like that API, it is simple to subclass the Session and provide a kwarg constructor, and I encourage you to do that. =)\n\nThis is currently what I have done, but it does require that anything that needs to be set to be called out. It also makes subclasses less future proof because code written now to be updated to take new passthrough parameters into account.\n\nThat said, would you consider the `Session` object the right place to manage state across a set of requests?\n", "Yes, that is the only reason it exists :)\n", "Indeed. Conversely, should we manage \"configuration\" across that set of requests elsewhere?\n\nI guess I am confused about the role of session in light of your comments on #1130. Perhaps, this discussion is better suited to the mailing list.\n", "Basically, the session is for prescience and configuration of the requests being sent. The actual act of sending a request has different configuration though: certs, timeout, allow_redirects, etc. \n\nThese things have nothing to do with the session. \n", "Excellent, so something like this would be fairly idiomatic:\n\n```\nclass MyTimeoutAdapter(HTTPAdapter):\n def __init__(self, timeout=None, **kwargs):\n super(MyTimeoutAdapter, self).__init__(self, **kwargs)\n self.timeout = timeout\n\n def send(self, *args, **kwargs):\n kwargs.setdefault('timeout', self.timeout)\n return super(MyTimeoutAdapter, self).send(*args, **kwargs)\n\nwith requests.session() as s:\n s.mount('http://', MyTimeoutAdapter(timeout=1.0))\n ... do work\n```\n", "It's definitely how I would do it. =)\n" ]
https://api.github.com/repos/psf/requests/issues/1130
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1130/labels{/name}
https://api.github.com/repos/psf/requests/issues/1130/comments
https://api.github.com/repos/psf/requests/issues/1130/events
https://github.com/psf/requests/issues/1130
10,249,817
MDU6SXNzdWUxMDI0OTgxNw==
1,130
`timeout` should be settable on session
{ "avatar_url": "https://avatars.githubusercontent.com/u/120601?v=4", "events_url": "https://api.github.com/users/stevvooe/events{/privacy}", "followers_url": "https://api.github.com/users/stevvooe/followers", "following_url": "https://api.github.com/users/stevvooe/following{/other_user}", "gists_url": "https://api.github.com/users/stevvooe/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/stevvooe", "id": 120601, "login": "stevvooe", "node_id": "MDQ6VXNlcjEyMDYwMQ==", "organizations_url": "https://api.github.com/users/stevvooe/orgs", "received_events_url": "https://api.github.com/users/stevvooe/received_events", "repos_url": "https://api.github.com/users/stevvooe/repos", "site_admin": false, "starred_url": "https://api.github.com/users/stevvooe/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/stevvooe/subscriptions", "type": "User", "url": "https://api.github.com/users/stevvooe", "user_view_type": "public" }
[]
closed
true
null
[]
null
5
2013-01-23T20:56:20Z
2021-09-09T00:01:06Z
2013-01-23T21:01:01Z
NONE
resolved
It would be nice to have a default timeout for all requests within a session. Currently, this isn't possible because timeout is only taken as an argument to `Session.request`. As a workaround, I am using something similar to the following: ``` class TimeoutSession(requests.Session): def __init__(self, timeout=None): self.timeout = timeout def request(self, *args, **kwargs): kwargs.setdefault('timeout', self.timeout) return super(TimeoutSession, self).request(*args, **kwargs) ``` This allows the timeout to be overridden on individual requests, but uses the session timeout if its not specified.
{ "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/1130/reactions" }
https://api.github.com/repos/psf/requests/issues/1130/timeline
null
completed
null
null
false
[ "Timeout is a parameter of the act of sending a request now.\n\nBasically, session-level timeouts down't make sense when we have connection adapters.\n", "What is the suggested method for setting the same timeout for a set of requests? Do you suggest we override the Adapter?\n", "Also, do you mind letting this issue breath a little before immediately closing it?\n", "Correct.\n\nNormally, I'd let it breathe for a while, but this was an explicit decision I made recently. Timeouts used to to be configurable.\n", "Thanks, Kenneth.\n\nKeep up the awesome work!\n" ]
https://api.github.com/repos/psf/requests/issues/1129
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1129/labels{/name}
https://api.github.com/repos/psf/requests/issues/1129/comments
https://api.github.com/repos/psf/requests/issues/1129/events
https://github.com/psf/requests/pull/1129
10,227,910
MDExOlB1bGxSZXF1ZXN0Mzc5NzY0MA==
1,129
New download() method on Response model for saving response content to local file...
{ "avatar_url": "https://avatars.githubusercontent.com/u/522344?v=4", "events_url": "https://api.github.com/users/alanhamlett/events{/privacy}", "followers_url": "https://api.github.com/users/alanhamlett/followers", "following_url": "https://api.github.com/users/alanhamlett/following{/other_user}", "gists_url": "https://api.github.com/users/alanhamlett/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/alanhamlett", "id": 522344, "login": "alanhamlett", "node_id": "MDQ6VXNlcjUyMjM0NA==", "organizations_url": "https://api.github.com/users/alanhamlett/orgs", "received_events_url": "https://api.github.com/users/alanhamlett/received_events", "repos_url": "https://api.github.com/users/alanhamlett/repos", "site_admin": false, "starred_url": "https://api.github.com/users/alanhamlett/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/alanhamlett/subscriptions", "type": "User", "url": "https://api.github.com/users/alanhamlett", "user_view_type": "public" }
[]
closed
true
null
[]
null
4
2013-01-23T10:52:23Z
2021-09-08T18:01:23Z
2013-01-23T13:23:14Z
CONTRIBUTOR
resolved
...without reading whole response content into machine memory. Includes 1 new test case.
{ "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/1129/reactions" }
https://api.github.com/repos/psf/requests/issues/1129/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/1129.diff", "html_url": "https://github.com/psf/requests/pull/1129", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/1129.patch", "url": "https://api.github.com/repos/psf/requests/pulls/1129" }
true
[ "Firstly, thanks for the pull request! It's always great to have contributions. =)\n\nSecondly, and being up-front, I don't think this is likely to get accepted into the library. _Do not close this PR based on that comment_ (some people have done in the past), that decision isn't mine, but I suspect this PR won't get accepted. I think this for two reasons:\n1. It adds to the API, which is generally not what we're looking to do.\n2. It isn't hard for the end user to do themselves.\n\nTo show an example of point 2:\n\n``` python\nimport requests\nr = requests.get('http://google.com', stream=True)\n\nwith open('/tmp/data.html') as f:\n for chunk in r.iter_content(chunk_size=4096):\n f.write(chunk)\n```\n\nPoint 2 doesn't matter much if it's a very common use case (see the `Response.json()` method), but I don't particularly think this is. If it only takes 3 lines of code for the user to do it themselves, it's rare that we'll add to the complexity of the library to do it. =)\n", "Well said, @Lukasa. \n\nThanks for the pull request, but I won't be accepting this at this time. You're not the first person to send this, actually :)\n", "OK, I'm gonna try fixing some open bugs instead.\n", ":+1: go get 'em @alanhamlett\n" ]