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/1428
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1428/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1428/comments
|
https://api.github.com/repos/psf/requests/issues/1428/events
|
https://github.com/psf/requests/pull/1428
| 15,827,396
|
MDExOlB1bGxSZXF1ZXN0NjQ1ODU2OQ==
| 1,428
|
Note regarding embedding requests and cacerts.pem
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/370118?v=4",
"events_url": "https://api.github.com/users/andrewgross/events{/privacy}",
"followers_url": "https://api.github.com/users/andrewgross/followers",
"following_url": "https://api.github.com/users/andrewgross/following{/other_user}",
"gists_url": "https://api.github.com/users/andrewgross/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/andrewgross",
"id": 370118,
"login": "andrewgross",
"node_id": "MDQ6VXNlcjM3MDExOA==",
"organizations_url": "https://api.github.com/users/andrewgross/orgs",
"received_events_url": "https://api.github.com/users/andrewgross/received_events",
"repos_url": "https://api.github.com/users/andrewgross/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/andrewgross/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/andrewgross/subscriptions",
"type": "User",
"url": "https://api.github.com/users/andrewgross",
"user_view_type": "public"
}
|
[
{
"color": "e11d21",
"default": false,
"description": null,
"id": 44501305,
"name": "Not Ready To Merge",
"node_id": "MDU6TGFiZWw0NDUwMTMwNQ==",
"url": "https://api.github.com/repos/psf/requests/labels/Not%20Ready%20To%20Merge"
}
] |
closed
| true
|
{
"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 | 2
|
2013-06-20T22:49:01Z
|
2021-09-08T20:01:28Z
|
2013-06-24T07:49:08Z
|
NONE
|
resolved
|
Adding a note about modifying setup.py for a package that embeds requests so that SSL will still work. Hopefully this avoid several hours of pain for someone else in the future.
|
{
"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/1428/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1428/timeline
| null | null | false
|
{
"diff_url": "https://github.com/psf/requests/pull/1428.diff",
"html_url": "https://github.com/psf/requests/pull/1428",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/1428.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/1428"
}
| true
|
[
"HI @andrewgross, thanks for this Pull Request! I like the idea, I'm just wondering if there's a better place in the docs for this. I'm going to have a think about it, but I didn't want you to think no-one had seen your PR, so I thought I'd let you know. =)\n",
"Fair enough, just hoping to get the information visible. Not particular about the wording or the placement.\n"
] |
https://api.github.com/repos/psf/requests/issues/1427
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1427/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1427/comments
|
https://api.github.com/repos/psf/requests/issues/1427/events
|
https://github.com/psf/requests/issues/1427
| 15,824,093
|
MDU6SXNzdWUxNTgyNDA5Mw==
| 1,427
|
Adding Cookie to Cookiejar problems.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/3344008?v=4",
"events_url": "https://api.github.com/users/mrfatboy/events{/privacy}",
"followers_url": "https://api.github.com/users/mrfatboy/followers",
"following_url": "https://api.github.com/users/mrfatboy/following{/other_user}",
"gists_url": "https://api.github.com/users/mrfatboy/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/mrfatboy",
"id": 3344008,
"login": "mrfatboy",
"node_id": "MDQ6VXNlcjMzNDQwMDg=",
"organizations_url": "https://api.github.com/users/mrfatboy/orgs",
"received_events_url": "https://api.github.com/users/mrfatboy/received_events",
"repos_url": "https://api.github.com/users/mrfatboy/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/mrfatboy/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/mrfatboy/subscriptions",
"type": "User",
"url": "https://api.github.com/users/mrfatboy",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 3
|
2013-06-20T21:27:12Z
|
2021-09-09T03:00:22Z
|
2013-06-21T17:16:42Z
|
NONE
|
resolved
|
I am trying to add a cookie to an existing cookiejar using the python requests 1.2.3 library. Every time I add the new cookie, the data in the jar is munged for the new cookie. Keys missing, Values missing or matched to incorrect Keys. I'm not sure if it's a Request library bug or I'm not sending the cookie correctly. I'm using the following code that is resulting in a bad cookie in cookiejar. Am I formatting the cookie correctly? Any ideas?
```
my_cookie = {
'domain':'www.mydomain.com',
'expires':None,
'name':'COOKIE_NAME',
'path':'/',
'value':'the cookie works',
'version':0
}
s = requests.Session()
requests.utils.add_dict_to_cookiejar(s.cookies, my_cookie)
```
|
{
"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/1427/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1427/timeline
| null |
completed
| null | null | false
|
[
"Sorry @mrfatboy for not spotting this last night, but `add_dict_to_cookiejar()` doesn't allow for cookies specified in that manner. `add_dict_to_cookiejar()` creates a set of cookies whose names are equal to the keys of your dict, and whose values are their values. You can't set their properties using that method.\n\nInstead, try the following:\n\n``` python\nmy_cookie = {\n 'domain':'www.mydomain.com',\n 'expires':None,\n 'name':'COOKIE_NAME',\n 'path':'/',\n 'value':'the cookie works',\n 'version':0\n}\ns = requests.Session()\ns.cookies.set(**my_cookie)\n```\n",
"Thanks @Lukasa. I found out a way to do by importing CookieJar, Cookie, and cookies. I like your way better :) However, with your way I was not able to specify the \"port_specified\", \"domain_specified\", \"domain_initial_dot\" or \"path_specified\" attributes. The \"set\" method does it automatically with default values. I'm trying to scrape a website and their cookie has different values in those attributes. As I am new to all of this I'm not sure if that really matters yet. I was able to make this work with your help. :)\n\n my_cookie = {\n \"version\":0,\n \"name\":'COOKIE_NAME',\n \"value\":'true',\n \"port\":None,\n// \"port_specified\":False,\n \"domain\":'www.mydomain.com',\n// \"domain_specified\":False,\n// \"domain_initial_dot\":False,\n \"path\":'/',\n// \"path_specified\":True,\n \"secure\":False,\n \"expires\":None,\n \"discard\":True,\n \"comment\":None,\n \"comment_url\":None,\n \"rest\":{}, \n \"rfc2109\":False\n }\n\ns = requests.Session()\ns.cookies.set(**my_cookie)\n\nnote: the '//' were replacements for the '#' (comment out) because they were causing funky formatting in this post.\n",
"Awesome. Glad to know you got to somewhere useful. =) Let me know if you have any further problems!\n"
] |
https://api.github.com/repos/psf/requests/issues/1426
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1426/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1426/comments
|
https://api.github.com/repos/psf/requests/issues/1426/events
|
https://github.com/psf/requests/issues/1426
| 15,706,840
|
MDU6SXNzdWUxNTcwNjg0MA==
| 1,426
|
latest requests version breaks with ipv6 URL
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/690120?v=4",
"events_url": "https://api.github.com/users/1player/events{/privacy}",
"followers_url": "https://api.github.com/users/1player/followers",
"following_url": "https://api.github.com/users/1player/following{/other_user}",
"gists_url": "https://api.github.com/users/1player/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/1player",
"id": 690120,
"login": "1player",
"node_id": "MDQ6VXNlcjY5MDEyMA==",
"organizations_url": "https://api.github.com/users/1player/orgs",
"received_events_url": "https://api.github.com/users/1player/received_events",
"repos_url": "https://api.github.com/users/1player/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/1player/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/1player/subscriptions",
"type": "User",
"url": "https://api.github.com/users/1player",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 4
|
2013-06-18T19:27:32Z
|
2021-09-09T01:22:29Z
|
2013-08-27T08:03:42Z
|
NONE
|
resolved
|
```
>>> requests.get('http://[2002:1234::213:1002:37:ed36]/xxxy')
[...]
LocationParseError: Failed to parse: Failed to parse: 2001:1234::213:5002:37:ed36
```
This works fine with requests 0.14.2, looks like a urllib3 regression (I can't find their closed bug report about it anymore..) and I don't know much about that library to open a bug report there.
|
{
"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/1426/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1426/timeline
| null |
completed
| null | null | false
|
[
"Problem is with `requests.models.PreparedRequest.prepare_url()` where the url is reconstructed and the braces are lost.\nWhile doing the request `requests.packages.urllib3.util.parse_url` is called _two_ times. The first time (called from `prepare_url` itself) everything is fine. The second time it blows up. The question here is, if a) `prepare_url` has to add back the braces which it doesn't get from `parse_url` b) `parse_url` should return the braces as part of the host.\n",
"`urlparse` from the stdlib keeps the braces.\n\ncc @shazow \n",
"I'm +1 for keeping the braces. Anyone want to do a urllib3 PR with a test + fix?\n",
"This should be fixed with the next Requests release.\n"
] |
https://api.github.com/repos/psf/requests/issues/1425
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1425/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1425/comments
|
https://api.github.com/repos/psf/requests/issues/1425/events
|
https://github.com/psf/requests/pull/1425
| 15,700,462
|
MDExOlB1bGxSZXF1ZXN0NjM5MzM5Mw==
| 1,425
|
Use new urllib3 'stream' parameter.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4",
"events_url": "https://api.github.com/users/Lukasa/events{/privacy}",
"followers_url": "https://api.github.com/users/Lukasa/followers",
"following_url": "https://api.github.com/users/Lukasa/following{/other_user}",
"gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Lukasa",
"id": 1382556,
"login": "Lukasa",
"node_id": "MDQ6VXNlcjEzODI1NTY=",
"organizations_url": "https://api.github.com/users/Lukasa/orgs",
"received_events_url": "https://api.github.com/users/Lukasa/received_events",
"repos_url": "https://api.github.com/users/Lukasa/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Lukasa",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 3
|
2013-06-18T17:26:37Z
|
2021-09-09T00:01:14Z
|
2013-06-21T09:23:11Z
|
MEMBER
|
resolved
|
In shazow/urllib3#186 I proposed to add a `.stream()` generator to the urllib3 response object. This avoids some of the nasty problems with the `.read()` method on that object (apparent zero-sized reads when there's still data, all sorts of stuff). It's also a much more natural way to stream data.
This PR would update urllib3 to include that PR, and updates our streaming methods to use it where possible.
@michaelhelmick: Do you want to try this branch with your twitter issue? Use one-byte chunk sizes.
|
{
"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/1425/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1425/timeline
| null | null | false
|
{
"diff_url": "https://github.com/psf/requests/pull/1425.diff",
"html_url": "https://github.com/psf/requests/pull/1425",
"merged_at": "2013-06-21T09:23:11Z",
"patch_url": "https://github.com/psf/requests/pull/1425.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/1425"
}
| true
|
[
"I'll give it a shot in a half hour! Thanks!\n\nSent from my iPhone\n\n> On Jun 18, 2013, at 1:26 PM, Cory Benfield notifications@github.com wrote:\n> \n> In shazow/urllib3#186 I proposed to add a .stream() generator to the urllib3 response object. This avoids some of the nasty problems with the .read() method on that object (apparent zero-sized reads when there's still data, all sorts of stuff). It's also a much more natural way to stream data.\n> \n> This PR would update urllib3 to include that PR, and updates our streaming methods to use it where possible.\n> \n> @michaelhelmick: Do you want to try this branch with your twitter issue? Use one-byte chunk sizes.\n> \n> You can merge this Pull Request by running\n> \n> git pull https://github.com/Lukasa/requests stream\n> Or view, comment on, or merge it at:\n> \n> https://github.com/kennethreitz/requests/pull/1425\n> \n> Commit Summary\n> \n> Update urllib3 to cffbd6b317\n> Use the new urllib3 stream generator.\n> File Changes\n> \n> M requests/models.py (17)\n> M requests/packages/urllib3/response.py (24)\n> M requests/packages/urllib3/util.py (15)\n> Patch Links:\n> \n> https://github.com/kennethreitz/requests/pull/1425.patch\n> https://github.com/kennethreitz/requests/pull/1425.diff\n",
":+1: \n",
":cake: :cake: :cake: :cake: :cake: :cake: :cake: :cake: \n"
] |
https://api.github.com/repos/psf/requests/issues/1424
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1424/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1424/comments
|
https://api.github.com/repos/psf/requests/issues/1424/events
|
https://github.com/psf/requests/issues/1424
| 15,649,272
|
MDU6SXNzdWUxNTY0OTI3Mg==
| 1,424
|
event hooks require kwargs now?
|
{
"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 | 3
|
2013-06-17T18:54:13Z
|
2021-09-09T02:11:47Z
|
2013-07-20T15:42:58Z
|
CONTRIBUTOR
|
resolved
|
The balanced-python library uses a response event hook. [The hook](https://github.com/balanced/balanced-python/blob/82670e5c5f6052c19cd062df11095c576dfc9b14/balanced/http_client.py#L63) does not take kwargs, and under requests 1.1.0 this works fine, but under 1.2.3 this results in TypeError, `wrapper() got an unexpected keyword argument 'timeout'`.
This change in behavior doesn't appear to be reflected in the [event hook documentation](http://docs.python-requests.org/en/latest/user/advanced/#event-hooks).
Should hooks not require kwargs, or should the docs be updated?
|
{
"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/1424/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1424/timeline
| null |
completed
| null | null | false
|
[
"Yeah, I need to update the docs. Was hoping to do it last weekend but I have been far too busy. I thought I had ticketed it, but perhaps not.\n",
"Cool, no worries. :)\n\n!m @sigmavirus24 \n",
"I just ran into this problem where the hook needs to take kwargs. Thanks.\n"
] |
https://api.github.com/repos/psf/requests/issues/1423
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1423/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1423/comments
|
https://api.github.com/repos/psf/requests/issues/1423/events
|
https://github.com/psf/requests/issues/1423
| 15,643,060
|
MDU6SXNzdWUxNTY0MzA2MA==
| 1,423
|
need to send request in multipart/form-data without files and specify mine boundary
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1780614?v=4",
"events_url": "https://api.github.com/users/gangli13/events{/privacy}",
"followers_url": "https://api.github.com/users/gangli13/followers",
"following_url": "https://api.github.com/users/gangli13/following{/other_user}",
"gists_url": "https://api.github.com/users/gangli13/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/gangli13",
"id": 1780614,
"login": "gangli13",
"node_id": "MDQ6VXNlcjE3ODA2MTQ=",
"organizations_url": "https://api.github.com/users/gangli13/orgs",
"received_events_url": "https://api.github.com/users/gangli13/received_events",
"repos_url": "https://api.github.com/users/gangli13/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/gangli13/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/gangli13/subscriptions",
"type": "User",
"url": "https://api.github.com/users/gangli13",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 1
|
2013-06-17T16:43:53Z
|
2021-09-09T03:00:23Z
|
2013-06-18T16:20:40Z
|
NONE
|
resolved
|
In developing a program using Phase II CORE protocol. I need to send HTML request in
multipart/form-data but without file object. e.g. the file data should be sent without
a filename. The boundary must be 'XbCY':
--XbCY
Content-Disposition: form-data; name=“CORERuleVersion" 2.2.0
--XbCY
Content-Disposition: form-data; name=“Payload"
<contents of file go here -- 1674 bytes long as specified above>
--XbCY--
I patched models.py for my project like this(help it can fixed in Requests)
```
87c87
< def _encode_files(files, data, boundary=None):
---
> def _encode_files(files, data):
95c95
< if (not files and boundary is None) or isinstance(data, str):
---
> if (not files) or isinstance(data, str):
131,133c131
< if not boundary:
< boundary = None
< body, content_type = encode_multipart_formdata(new_fields, boundary)
---
> body, content_type = encode_multipart_formdata(new_fields)
174,177d171
< # patched by IIC
< :param boundary:
< used for mime type encoding. it sever a flag to forced mime encoding even without files.
< set to '' to force mime encoding and use auto-generated boundary
195,198c189
< hooks=None,
<
< # patched by IIC
< boundary=None):
---
> hooks=None):
221,223d211
<
< # patched by IIC
< self.boundary = boundary
236c224
< p.prepare_body(self.data, self.files, self.boundary)
---
> p.prepare_body(self.data, self.files)
342c330
< def prepare_body(self, data, files, boundary=None):
---
> def prepare_body(self, data, files):
380,381c368,369
< if files or boundary is not None:
< (body, content_type) = self._encode_files(files, data, boundary)
---
> if files:
> (body, content_type) = self._encode_files(files, data)
```
|
{
"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/1423/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1423/timeline
| null |
completed
| null | null | false
|
[
"Hi @gangli, thanks for opening this issue and thanks for providing a patch!\n\nThis is a fairly specialised use-case. Requests primarily attempts to solve the 90% use-case, which this does not come under. Additionally, we are currently in feature-freeze, which means we aren't accepting new features at this time.\n\nUnfortunately, this means it's unlikely we are going to implement these changes in the main library itself.\n\nI'm sorry that I can't be of more help. Please keep contributing to the library, and let me know if you need anything else! Thanks again. =) :cake:\n"
] |
https://api.github.com/repos/psf/requests/issues/1422
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1422/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1422/comments
|
https://api.github.com/repos/psf/requests/issues/1422/events
|
https://github.com/psf/requests/issues/1422
| 15,529,171
|
MDU6SXNzdWUxNTUyOTE3MQ==
| 1,422
|
Connection timeout doesn't work for chunked-encoded request
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/4692132?v=4",
"events_url": "https://api.github.com/users/psushin/events{/privacy}",
"followers_url": "https://api.github.com/users/psushin/followers",
"following_url": "https://api.github.com/users/psushin/following{/other_user}",
"gists_url": "https://api.github.com/users/psushin/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/psushin",
"id": 4692132,
"login": "psushin",
"node_id": "MDQ6VXNlcjQ2OTIxMzI=",
"organizations_url": "https://api.github.com/users/psushin/orgs",
"received_events_url": "https://api.github.com/users/psushin/received_events",
"repos_url": "https://api.github.com/users/psushin/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/psushin/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/psushin/subscriptions",
"type": "User",
"url": "https://api.github.com/users/psushin",
"user_view_type": "public"
}
|
[
{
"color": "f7c6c7",
"default": false,
"description": null,
"id": 167537670,
"name": "Propose Close",
"node_id": "MDU6TGFiZWwxNjc1Mzc2NzA=",
"url": "https://api.github.com/repos/psf/requests/labels/Propose%20Close"
}
] |
closed
| true
| null |
[] | null | 4
|
2013-06-13T20:45:36Z
|
2021-09-08T05:00:52Z
|
2015-01-19T09:26:06Z
|
NONE
|
resolved
|
Sample code:
```
def gen():
for i in xrange(1, 1000):
yield 'x'
import requests, datetime
print datetime.datetime.now()
try: requests.post(url='http://1.1.1.1', timeout=5, data=gen())
except Exception as e: print e
print datetime.datetime.now()
try: requests.post(url='http://1.1.1.1', timeout=5, data='a')
except Exception as e: print e
print datetime.datetime.now()
```
gives the following output
```
2013-06-14 00:33:03.079389
[Errno 110] Connection timed out
2013-06-14 00:34:06.236742
HTTPConnectionPool(host='1.1.1.1', port=80): Request timed out. (timeout=5)
2013-06-14 00:34:11.242869
```
The first request blocked for more than a minute, before a timeout has been thrown, while the second one is ok.
Requests 1.2.3
Python 2.7.3
|
{
"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/1422/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1422/timeline
| null |
completed
| null | null | false
|
[
"Thanks for opening this issue!\n\nLooking at the Requests code, I suspect you might be right. I'm at work at the moment and won't have internet at home until the 18th, but when I can get time I'll investigate this.\n\nTo begin with, I think the problem is around [here](https://github.com/kennethreitz/requests/blob/master/requests/adapters.py#L300). For chunked uploads, we do this:\n\n``` python\nlow_conn = conn._get_conn(timeout=timeout)\nlow_conn.putrequest(request.method, url, skip_accept_encoding=True)\n\nfor header, value in request.headers.items():\n low_conn.putheader(header, value)\n\nlow_conn.endheaders()\n\nfor i in request.body:\n low_conn.send(hex(len(i))[2:].encode('utf-8'))\n low_conn.send(b'\\r\\n')\n low_conn.send(i)\n low_conn.send(b'\\r\\n')\n\nlow_conn.send(b'0\\r\\n\\r\\n')\n\nr = low_conn.getresponse()\nresp = HTTPResponse.from_httplib(r,\n pool=conn,\n connection=low_conn,\n preload_content=False,\n decode_content=False\n )\n```\n\nThe only place we set the timeout is in the call to `urllib3.HTTPConnectionPool._get_conn()`, which passes down into its `LifoQueue`. This timeout affects how long we wait to obtain a connection object, but does not set the timeout on that connection.\n\nI need to think about what's best to do here, but I think the answer is to set `low_conn.timeout = timeout` before the initial call to `putrequest()`. Feel free to try that out if I don't get around to testing it first.\n",
"I wonder if our new Timeout system will fix this.\n",
"Seems this is still happening with 2.18.4. I was able to fix it using `low_conn.timeout = timeout.connect_timeout`, like @Lukasa mentioned. Should I write a test and submit a pull request or just create a new issue?",
"Raise a new issue, link this one, and include your test case that can reproduce the problem consistently. Then you can submit a PR and link to your new issue if you have time :) Thanks @isobit!"
] |
https://api.github.com/repos/psf/requests/issues/1421
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1421/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1421/comments
|
https://api.github.com/repos/psf/requests/issues/1421/events
|
https://github.com/psf/requests/issues/1421
| 15,510,041
|
MDU6SXNzdWUxNTUxMDA0MQ==
| 1,421
|
Delete/ignore this, i'm a moron
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/621323?v=4",
"events_url": "https://api.github.com/users/oliverwoodings/events{/privacy}",
"followers_url": "https://api.github.com/users/oliverwoodings/followers",
"following_url": "https://api.github.com/users/oliverwoodings/following{/other_user}",
"gists_url": "https://api.github.com/users/oliverwoodings/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/oliverwoodings",
"id": 621323,
"login": "oliverwoodings",
"node_id": "MDQ6VXNlcjYyMTMyMw==",
"organizations_url": "https://api.github.com/users/oliverwoodings/orgs",
"received_events_url": "https://api.github.com/users/oliverwoodings/received_events",
"repos_url": "https://api.github.com/users/oliverwoodings/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/oliverwoodings/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/oliverwoodings/subscriptions",
"type": "User",
"url": "https://api.github.com/users/oliverwoodings",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 2
|
2013-06-13T15:02:39Z
|
2021-09-09T03:00:24Z
|
2013-06-13T15:36:41Z
|
NONE
|
resolved
|
I posted this on the wrong repo. Please laugh at me.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4",
"events_url": "https://api.github.com/users/Lukasa/events{/privacy}",
"followers_url": "https://api.github.com/users/Lukasa/followers",
"following_url": "https://api.github.com/users/Lukasa/following{/other_user}",
"gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Lukasa",
"id": 1382556,
"login": "Lukasa",
"node_id": "MDQ6VXNlcjEzODI1NTY=",
"organizations_url": "https://api.github.com/users/Lukasa/orgs",
"received_events_url": "https://api.github.com/users/Lukasa/received_events",
"repos_url": "https://api.github.com/users/Lukasa/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Lukasa",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/1421/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1421/timeline
| null |
completed
| null | null | false
|
[
"Could you respond with what version of requests you have installed please?\n",
"No need to be so harsh on yourself. No one will laugh at you. And it wasn't entirely wrong to post it here. It might end up ovee here anyway \n"
] |
https://api.github.com/repos/psf/requests/issues/1420
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1420/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1420/comments
|
https://api.github.com/repos/psf/requests/issues/1420/events
|
https://github.com/psf/requests/pull/1420
| 15,489,183
|
MDExOlB1bGxSZXF1ZXN0NjI5MTM5NA==
| 1,420
|
Added the ability to pass matrix parameters for rest requests.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/4685521?v=4",
"events_url": "https://api.github.com/users/jase1987/events{/privacy}",
"followers_url": "https://api.github.com/users/jase1987/followers",
"following_url": "https://api.github.com/users/jase1987/following{/other_user}",
"gists_url": "https://api.github.com/users/jase1987/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/jase1987",
"id": 4685521,
"login": "jase1987",
"node_id": "MDQ6VXNlcjQ2ODU1MjE=",
"organizations_url": "https://api.github.com/users/jase1987/orgs",
"received_events_url": "https://api.github.com/users/jase1987/received_events",
"repos_url": "https://api.github.com/users/jase1987/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/jase1987/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jase1987/subscriptions",
"type": "User",
"url": "https://api.github.com/users/jase1987",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 3
|
2013-06-13T05:27:34Z
|
2021-09-08T08:00:57Z
|
2013-06-15T05:50:05Z
|
NONE
|
resolved
|
Unfortunately according to wc3 (http://www.w3.org/DesignIssues/Axioms.html#matrix) matrix parameters to http requests has been unsupported since 2001. The company I work for recently tried integrating a REST interface with third party software and their REST request required HTTP matrix parameters. Which up until this morning I had never heard of. I have added a quick patch into requests to support this.
Information on how matrix parameters are used and created is found at this link:
http://www.w3.org/DesignIssues/MatrixURIs.html
|
{
"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/1420/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1420/timeline
| null | null | false
|
{
"diff_url": "https://github.com/psf/requests/pull/1420.diff",
"html_url": "https://github.com/psf/requests/pull/1420",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/1420.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/1420"
}
| true
|
[
"Hi @jase1987! Thanks so much for this pull request. :cake:\n\nUnfortunately, I think it's really very unlikely that we'll accept this. This has nothing to do with the PR itself: the code is in great shape. However, I don't think we want the feature.\n\nMatrix parameters are really very, very infrequently used. The [URI RFC](http://pretty-rfc.herokuapp.com/RFC3986) does not include them, On top of that, the article you linked to doesn't just say they stopped being supported in '01: they hadn't been supported up until then _either_. I haven't done exhaustive research here, but it's quite possible they were never part of the URI (or URL) standards.\n\nYou've also only tackled a subset of the problem. Insanely, matrix parameters can apply to any (and all) portions of the path element, e.g. `http://example.com/res/categories;name=foo/objects;name=green/?page=1`. This is very difficult to cleanly represent in Requests' standard functional API.\n\nGiven that they're not part of the standard, are very infrequently used, and are difficult to do 'properly', I think we won't want to put this in mainline Requests. With that said, I encourage you to maintain a downstream fork of Requests that includes them if that would be useful to you.\n\nAlso, I'm very sorry that you have to interact with such an unhelpful REST API. =)\n\nI'm going to leave this open until @kennethreitz takes a look, but I'd be surprised if he wanted to add support for matrix parameters.\n\nAgain, thanks so much for the work!\n",
"The example you give @Lukasa looks like this is part of RFC 6570 and is supported in [uritemplate.py](/sigmavirus24/uritemplate).\n\nIf they can come up with templates for the URIs they're handling, they can pass the construction off to my library and then pass the string returned directly into requests. Unfortunately the library isn't well-documented at the moment, but it is well-tested and it follows the RFC to the 't'. @jase1987 you should look into \"Level 3\" expansions for semi-colon prefixed paths. It should fit your needs well. An example can be found in my tests [here](https://github.com/sigmavirus24/uritemplate/blob/master/test_uritemplate.py#L131). The template which is the key for the dictionary and the expected values are what should be of interest to you.\n",
"In other news, I'm very +1 on **closing** this.\n"
] |
https://api.github.com/repos/psf/requests/issues/1419
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1419/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1419/comments
|
https://api.github.com/repos/psf/requests/issues/1419/events
|
https://github.com/psf/requests/pull/1419
| 15,478,746
|
MDExOlB1bGxSZXF1ZXN0NjI4Njg5OA==
| 1,419
|
Exception links
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/234019?v=4",
"events_url": "https://api.github.com/users/kevinburke/events{/privacy}",
"followers_url": "https://api.github.com/users/kevinburke/followers",
"following_url": "https://api.github.com/users/kevinburke/following{/other_user}",
"gists_url": "https://api.github.com/users/kevinburke/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/kevinburke",
"id": 234019,
"login": "kevinburke",
"node_id": "MDQ6VXNlcjIzNDAxOQ==",
"organizations_url": "https://api.github.com/users/kevinburke/orgs",
"received_events_url": "https://api.github.com/users/kevinburke/received_events",
"repos_url": "https://api.github.com/users/kevinburke/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/kevinburke/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/kevinburke/subscriptions",
"type": "User",
"url": "https://api.github.com/users/kevinburke",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 3
|
2013-06-12T22:58:10Z
|
2021-09-08T11:00:51Z
|
2013-06-15T05:50:45Z
|
CONTRIBUTOR
|
resolved
|
Sphinx has a neat cross-referencing feature where if you include the tilde
character in front of a :py: class, it'll link to the full object but provide
only the last part of class name in the text. For more info see
http://sphinx-doc.org/domains.html#cross-referencing-syntax
|
{
"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/1419/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1419/timeline
| null | null | false
|
{
"diff_url": "https://github.com/psf/requests/pull/1419.diff",
"html_url": "https://github.com/psf/requests/pull/1419",
"merged_at": "2013-06-15T05:50:45Z",
"patch_url": "https://github.com/psf/requests/pull/1419.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/1419"
}
| true
|
[
"I'm +0 on this, actually. I like having clearer class names, but having the full class name makes it way more obvious how to import the class. If it were me, I'd probably leave it as is, but @kennethreitz will probably disagree with me. =)\n",
"Whatever you want to do is fine\n",
"@Lukasa is correct :)\n\nThanks @kevinburke!\n"
] |
https://api.github.com/repos/psf/requests/issues/1418
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1418/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1418/comments
|
https://api.github.com/repos/psf/requests/issues/1418/events
|
https://github.com/psf/requests/issues/1418
| 15,414,857
|
MDU6SXNzdWUxNTQxNDg1Nw==
| 1,418
|
Python 3 Windows SSL issue
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/3253989?v=4",
"events_url": "https://api.github.com/users/echohack/events{/privacy}",
"followers_url": "https://api.github.com/users/echohack/followers",
"following_url": "https://api.github.com/users/echohack/following{/other_user}",
"gists_url": "https://api.github.com/users/echohack/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/echohack",
"id": 3253989,
"login": "echohack",
"node_id": "MDQ6VXNlcjMyNTM5ODk=",
"organizations_url": "https://api.github.com/users/echohack/orgs",
"received_events_url": "https://api.github.com/users/echohack/received_events",
"repos_url": "https://api.github.com/users/echohack/repos",
"site_admin": true,
"starred_url": "https://api.github.com/users/echohack/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/echohack/subscriptions",
"type": "User",
"url": "https://api.github.com/users/echohack",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 6
|
2013-06-11T18:33:26Z
|
2021-09-09T02:11:50Z
|
2013-06-11T21:23:39Z
|
NONE
|
resolved
|
I'm not super awesome at Python, so I'd appreciate any help you can provide to help nail down this issue.
Newer versions of Python 3 on Windows appear to have an issue when doing an ssl handshake. This appears to be a problem with urllib3 on Windows python packages only. I was able to successfully use Python 3.3.2 and 3.2.4 on Ubuntu without this issue.
Effected Versions: Windows Python 3.3.x, 3.2.x
Works in: Non-Windows Python 3.3.x, 3.2.x, Windows 3.1.x
While I'm almost certain here the bug is actually in Python's urllib3 and not Requests, I'm not super experienced, so I feel a little over my head. Of course, this bug effects anyone who uses Requests too. It appears related to this bug: http://bugs.python.org/issue16361
In order to communicate with the server, I am using Lantern: https://github.com/dechols/lantern
```
v = lantern.AbstractAPI(username, password)
v.get_app_list()
```
Which causes the failure.
But even using a very simple GET with requests directly, causes the same issue:
```
r = requests.get(url="https://analysiscenter.veracode.com/api/4.0/getapplist.do", auth=(username, password))
```
Please help! I'd love to get this fixed, where-ever it might need fixing.
```
Traceback (most recent call last):
File "C:\Python33\lib\site-packages\requests\packages\urllib3\connectionpool.py", line 428, in urlopen
body=body, headers=headers)
File "C:\Python33\lib\site-packages\requests\packages\urllib3\connectionpool.py", line 280, in _make_request
conn.request(method, url, **httplib_request_kw)
File "C:\Python33\lib\http\client.py", line 1061, in request
self._send_request(method, url, body, headers)
File "C:\Python33\lib\http\client.py", line 1099, in _send_request
self.endheaders(body)
File "C:\Python33\lib\http\client.py", line 1057, in endheaders
self._send_output(message_body)
File "C:\Python33\lib\http\client.py", line 902, in _send_output
self.send(msg)
File "C:\Python33\lib\http\client.py", line 840, in send
self.connect()
File "C:\Python33\lib\site-packages\requests\packages\urllib3\connectionpool.py", line 107, in connect
ssl_version=resolved_ssl_version)
File "C:\Python33\lib\site-packages\requests\packages\urllib3\util.py", line 369, in ssl_wrap_socket
return context.wrap_socket(sock, server_hostname=server_hostname)
File "C:\Python33\lib\ssl.py", line 210, in wrap_socket
_context=self)
File "C:\Python33\lib\ssl.py", line 310, in __init__
raise x
File "C:\Python33\lib\ssl.py", line 306, in __init__
self.do_handshake()
File "C:\Python33\lib\ssl.py", line 513, in do_handshake
self._sslobj.do_handshake()
ConnectionResetError: [WinError 10054] An existing connection was forcibly closed by the remote host
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Python33\lib\site-packages\requests\adapters.py", line 292, in send
timeout=timeout
File "C:\Python33\lib\site-packages\requests\packages\urllib3\connectionpool.py", line 474, in urlopen
raise MaxRetryError(self, url, e)
[Finished in 61.3s with exit code 1]requests.packages.urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='analysiscenter.veracode.com', port=443): Max retries exceeded with url: /api/4.0/getapplist.do (Caused by <class 'ConnectionResetError'>: [WinError 10054] An existing connection was forcibly closed by the remote host)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\tfs\Vertafore_TFSDev\CQ\veracode\pythontestscriptonation.py", line 11, in <module>
r = requests.get(url="https://analysiscenter.veracode.com/api/4.0/getapplist.do", auth=(username, password))
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 335, in request
resp = self.send(prep, **send_kwargs)
File "C:\Python33\lib\site-packages\requests\sessions.py", line 438, in send
r = adapter.send(request, **kwargs)
File "C:\Python33\lib\site-packages\requests\adapters.py", line 327, in send
raise ConnectionError(e)
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='analysiscenter.veracode.com', port=443): Max retries exceeded with url: /api/4.0/getapplist.do (Caused by <class 'ConnectionResetError'>: [WinError 10054] An existing connection was forcibly closed by the remote host)
```
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/3253989?v=4",
"events_url": "https://api.github.com/users/echohack/events{/privacy}",
"followers_url": "https://api.github.com/users/echohack/followers",
"following_url": "https://api.github.com/users/echohack/following{/other_user}",
"gists_url": "https://api.github.com/users/echohack/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/echohack",
"id": 3253989,
"login": "echohack",
"node_id": "MDQ6VXNlcjMyNTM5ODk=",
"organizations_url": "https://api.github.com/users/echohack/orgs",
"received_events_url": "https://api.github.com/users/echohack/received_events",
"repos_url": "https://api.github.com/users/echohack/repos",
"site_admin": true,
"starred_url": "https://api.github.com/users/echohack/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/echohack/subscriptions",
"type": "User",
"url": "https://api.github.com/users/echohack",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/1418/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1418/timeline
| null |
completed
| null | null | false
|
[
"This is a duplicate of #1289. Right?\nAccording to the bugreport you linked it's an issue with the SSL/TLS version requests is using to connect to the server.\n@Lukasa wrote a blogpost about customizing the version, requests uses: http://lukasa.co.uk/2013/01/Choosing_SSL_Version_In_Requests/\n\nI modified the code from the blog a bit, so that it works with the current version of requests:\n(Try to remove `s.mount()` to break it again)\n\n``` python\nfrom requests.adapters import HTTPAdapter\nfrom requests.packages.urllib3.poolmanager import PoolManager\nimport ssl\n\n\nclass MyAdapter(HTTPAdapter):\n def init_poolmanager(self, connections, maxsize, block):\n self.poolmanager = PoolManager(num_pools=connections,\n maxsize=maxsize,\n block=block,\n ssl_version=ssl.PROTOCOL_TLSv1)\n\nimport requests\ns = requests.Session()\ns.mount('https://', MyAdapter())\n\nprint(s.get('https://analysiscenter.veracode.com'))\n```\n\nBtw, I also couldn't connect from my arch box.\nAnd also congratulations for open sourcing your project!\n",
"> This is a duplicate of #1289. Right?\n\nYes. I think I have a better grasp on what's actually going on now, so I opened a new one because maybe there's a chance I can fix this now.\n\nI'll take a look at the code and see if I can get it to work. :) THANK YOU!\n\nEdit: IT WORKED! Now I have even more questions than when I started...\n",
"So I understand _how_ the code above works and how patching the HTTPS session variable works.\n\nBut I still don't understand _why_ this only fails to work on versions of Python (3.2/3.3) on Windows only. Do versions of Python on Windows include buggy versions of ssl? or do they not include new versions of ssl?\n\nI just think that's pretty weird, that only windows distros of python would have this issue.\n",
"I suspect (I'm not sure) the server is buggy. It sees a TLS version it doesn't recognize and then stops responding, while the client is waiting for a respones, even an error would be better.\nI have the same problem on archlinux with openssl 1.0.1.e. Rereading your last bugreport it seems It worked for me back then, with an older version of openssl.\nThis older version presumably used a lower TLS version, which didn't freak out the server.\nSo the version is rather too new :smile:\n\n@Lukasa You may want to update your blogpost to include the `block` argument, which is needed nowadays.\n",
"Thank you t-8ch. I will bring this up with Veracode and see if we can investigate. THANK YOU SO MUCH.\n",
"@t-8ch Thanks for pointing it out, when I get my internet connection back I'll do just that. =)\n"
] |
https://api.github.com/repos/psf/requests/issues/1417
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1417/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1417/comments
|
https://api.github.com/repos/psf/requests/issues/1417/events
|
https://github.com/psf/requests/issues/1417
| 15,396,758
|
MDU6SXNzdWUxNTM5Njc1OA==
| 1,417
|
Easier way to disable cookie persistence
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/294177?v=4",
"events_url": "https://api.github.com/users/esaurito/events{/privacy}",
"followers_url": "https://api.github.com/users/esaurito/followers",
"following_url": "https://api.github.com/users/esaurito/following{/other_user}",
"gists_url": "https://api.github.com/users/esaurito/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/esaurito",
"id": 294177,
"login": "esaurito",
"node_id": "MDQ6VXNlcjI5NDE3Nw==",
"organizations_url": "https://api.github.com/users/esaurito/orgs",
"received_events_url": "https://api.github.com/users/esaurito/received_events",
"repos_url": "https://api.github.com/users/esaurito/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/esaurito/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/esaurito/subscriptions",
"type": "User",
"url": "https://api.github.com/users/esaurito",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 2
|
2013-06-11T12:47:39Z
|
2021-09-09T03:00:25Z
|
2013-06-11T13:24:29Z
|
NONE
|
resolved
|
I was looking for a way to temporary disable cookie persistence.
When I use requests to access an URL **cookies are automatically sent back to the server** (in the following example the requested URL set some cookie values and then redirect to another URL that display the stored cookie)
```
>>> import requests
>>> response = requests.get("http://httpbin.org/cookies/set?k1=v1&k2=v2")
>>> response.content
'{\n "cookies": {\n "k2": "v2",\n "k1": "v1"\n }\n}'
```
Is it possible to temporary disable cookie handling in the same way you set Chrome or Firefox to not accept cookies?
[I made this question on SO](http://stackoverflow.com/questions/17037668/how-to-disable-cookie-handling-with-the-python-requests-library?answertab=votes#tab-top) and it seems that the only way to go is patching the `requests.cookies.RequestsCookieJar.update`. I think that should be an easier way to do this in requests, Maybe passing parameter to the `get` method?
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/294177?v=4",
"events_url": "https://api.github.com/users/esaurito/events{/privacy}",
"followers_url": "https://api.github.com/users/esaurito/followers",
"following_url": "https://api.github.com/users/esaurito/following{/other_user}",
"gists_url": "https://api.github.com/users/esaurito/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/esaurito",
"id": 294177,
"login": "esaurito",
"node_id": "MDQ6VXNlcjI5NDE3Nw==",
"organizations_url": "https://api.github.com/users/esaurito/orgs",
"received_events_url": "https://api.github.com/users/esaurito/received_events",
"repos_url": "https://api.github.com/users/esaurito/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/esaurito/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/esaurito/subscriptions",
"type": "User",
"url": "https://api.github.com/users/esaurito",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/1417/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1417/timeline
| null |
completed
| null | null | false
|
[
"Hi @esaurito, thanks for raising this issue!\n\nBy design Requests' primary API supports the 90% use-case, which involves persisting cookies. We are very unlikely to add a parameter to the main methods to allow you not to persist cookies.\n\nIf you absolutely don't want to, my recommendation is that you use a session along with a subclass of the `RequestsCookieJar`. I haven't tried the following, but it ought to work:\n\n``` python\nimport requests\nfrom requests.cookies import RequestsCookieJar\n\nclass BlackHoleCookieJar(RequestsCookieJar):\n \"\"\"\n This class's attitude to cookies can be described in three words: nom nom nom.\n \"\"\"\n def set(self, name, value, **kwargs):\n pass\n\n def update(self, other):\n pass\n\ns = requests.Session()\ns.cookies = BlackHoleCookieJar()\n```\n\nSubsequent requests through that session should throw cookies away. Bear in mind that the `BlackHoleCookieJar` above is for example purposes only: in real code there are a few other methods you'd want to override, like `.copy()`.\n\nIs this helpful?\n",
"Thank you very much for the explanation and the sample code. At first I thought that cookie persistence were available only for sessions. I'll go with the BlackHoleCookieJar.\n"
] |
https://api.github.com/repos/psf/requests/issues/1416
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1416/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1416/comments
|
https://api.github.com/repos/psf/requests/issues/1416/events
|
https://github.com/psf/requests/issues/1416
| 15,371,182
|
MDU6SXNzdWUxNTM3MTE4Mg==
| 1,416
|
Syntax error when installing 1.2.3 on Python 3.3.2
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/352270?v=4",
"events_url": "https://api.github.com/users/michaelhelmick/events{/privacy}",
"followers_url": "https://api.github.com/users/michaelhelmick/followers",
"following_url": "https://api.github.com/users/michaelhelmick/following{/other_user}",
"gists_url": "https://api.github.com/users/michaelhelmick/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/michaelhelmick",
"id": 352270,
"login": "michaelhelmick",
"node_id": "MDQ6VXNlcjM1MjI3MA==",
"organizations_url": "https://api.github.com/users/michaelhelmick/orgs",
"received_events_url": "https://api.github.com/users/michaelhelmick/received_events",
"repos_url": "https://api.github.com/users/michaelhelmick/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/michaelhelmick/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/michaelhelmick/subscriptions",
"type": "User",
"url": "https://api.github.com/users/michaelhelmick",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 13
|
2013-06-10T22:01:26Z
|
2021-09-08T23:08:04Z
|
2014-09-21T14:56:06Z
|
NONE
|
resolved
|
Looked through all the recent issues and couldn't find anything on it:
```
(twython3)Mikes-MacBook-Air:~ mikehelmick$ pip install requests
Downloading/unpacking requests
Downloading requests-1.2.3.tar.gz (348kB): 348kB downloaded
Running setup.py egg_info for package requests
Installing collected packages: requests
Running setup.py install for requests
File "/Users/mikehelmick/.virtualenv/twython3/lib/python3.3/site-packages/requests/packages/urllib3/contrib/ntlmpool.py", line 38
"""
^
SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 130-131: truncated \uXXXX escape
Successfully installed requests
Cleaning up...
```
`requests` still installed find, but just looks a little ugly when installing ;)
|
{
"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/1416/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1416/timeline
| null |
completed
| null | null | false
|
[
"Ugh. I thought we fixed this. :(\n",
"We did. =) This is fixed by 2ed976ea7147a9d0c18998e02b16d691b6798a3e, which hasn't yet made it into PyPI.\n\nThanks for pointing it out @michaelhelmick! The fix should be out fairly soon.\n",
"still broken\n\nC:\\Python33\\Scripts>pip-3.3.exe install requests\nDownloading/unpacking requests\n Downloading requests-1.2.3.tar.gz (348kB): 348kB downloaded\n Running setup.py egg_info for package requests\n\nInstalling collected packages: requests\n Running setup.py install for requests\n\n```\n File \"C:\\Python33\\Lib\\site-packages\\requests\\packages\\urllib3\\contrib\\ntlm\n```\n\npool.py\", line 38\n \"\"\"\n ^\n SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in pos\nition 130-131: truncated \\uXXXX escape\n\nSuccessfully installed requests\nCleaning up...\n",
"@tz18 The commit mentioned above has still not made it into PyPI. =)\n",
"same here. We need a pypi that uses git!\n",
"You can get around this using pip\n\n``` bash\n$ pip install git+git://github.com/kennethreitz/requests.git\n```\n",
"Wow, 4 months and still not in PyPi!? What needs to happen to speed this up?\n",
"@mayfield We need to get to a state where we're happy releasing the 2.0 release. =) For what it's worth we're not aware of any real problems caused by this, it just looks nasty.\n",
"Could you please let us whether this bug has been fixed? I am trying to stall v2.4.1 both from git and pip and on ubuntu 12.04 and I am getting the following traceback\n\nException:\nTraceback (most recent call last):\n File \"/home/jmrosal/.virtualenvs/DataApp3.3/lib/python3.3/site-packages/pip-1.3.1-py3.3.egg/pip/basecommand.py\", line 139, in main\n status = self.run(options, args)\n File \"/home/jmrosal/.virtualenvs/DataApp3.3/lib/python3.3/site-packages/pip-1.3.1-py3.3.egg/pip/commands/install.py\", line 266, in run\n requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)\n File \"/home/jmrosal/.virtualenvs/DataApp3.3/lib/python3.3/site-packages/pip-1.3.1-py3.3.egg/pip/req.py\", line 1062, in prepare_files\n req_to_install.assert_source_matches_version()\n File \"/home/jmrosal/.virtualenvs/DataApp3.3/lib/python3.3/site-packages/pip-1.3.1-py3.3.egg/pip/req.py\", line 371, in assert_source_matches_version\n version = self.installed_version\n File \"/home/jmrosal/.virtualenvs/DataApp3.3/lib/python3.3/site-packages/pip-1.3.1-py3.3.egg/pip/req.py\", line 367, in installed_version\n return self.pkg_info()['version']\n File \"/home/jmrosal/.virtualenvs/DataApp3.3/lib/python3.3/site-packages/pip-1.3.1-py3.3.egg/pip/req.py\", line 334, in pkg_info\n data = self.egg_info_data('PKG-INFO')\n File \"/home/jmrosal/.virtualenvs/DataApp3.3/lib/python3.3/site-packages/pip-1.3.1-py3.3.egg/pip/req.py\", line 274, in egg_info_data\n data = fp.read()\n File \"/home/jmrosal/.virtualenvs/DataApp3.3/lib/python3.3/encodings/ascii.py\", line 26, in decode\n return codecs.ascii_decode(input, self.errors)[0]\nUnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 4820: ordinal not in range(128)\n",
"@jmrosal This bug was fixed a long time ago. You can tell, because it prevented _anyone_ from installing the library on Python 3, and affected version 1.2.3. We are now on version 2.4.1. Presumably we did not get through that many versions without noticing that no-one could install the package.\n\nMore importantly, your traceback doesn't seem to point to any requests code at all. I just did a test install of requests on Python 3 and found no problems. =)\n",
"@jmrosal you're using an abysmally old version of pip (1.3.1). It would seem (since you're inside a virtualenv) that you're also using an extremely old version of virtualenv. I would:\n1. deactivate your virtualenv\n2. upgrade virtualenv\n3. recreate the virtualenv you're trying to work in\n4. install requests\n",
"You are right. Once pip is updated, everything gets sorted. Apologies for the noise and thanks for the feedback.\n",
"@jmrosal no worries. In the future you might try hopping onto IRC first or emailing one of us.\n"
] |
https://api.github.com/repos/psf/requests/issues/1415
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1415/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1415/comments
|
https://api.github.com/repos/psf/requests/issues/1415/events
|
https://github.com/psf/requests/issues/1415
| 15,352,004
|
MDU6SXNzdWUxNTM1MjAwNA==
| 1,415
|
Duplicate Response headers become merged in Response objects
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1763697?v=4",
"events_url": "https://api.github.com/users/olemoudi/events{/privacy}",
"followers_url": "https://api.github.com/users/olemoudi/followers",
"following_url": "https://api.github.com/users/olemoudi/following{/other_user}",
"gists_url": "https://api.github.com/users/olemoudi/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/olemoudi",
"id": 1763697,
"login": "olemoudi",
"node_id": "MDQ6VXNlcjE3NjM2OTc=",
"organizations_url": "https://api.github.com/users/olemoudi/orgs",
"received_events_url": "https://api.github.com/users/olemoudi/received_events",
"repos_url": "https://api.github.com/users/olemoudi/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/olemoudi/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/olemoudi/subscriptions",
"type": "User",
"url": "https://api.github.com/users/olemoudi",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 4
|
2013-06-10T15:06:44Z
|
2021-09-08T11:00:43Z
|
2013-06-11T12:07:25Z
|
NONE
|
resolved
|
Currently any duplicate header on responses gets merged on the response.headers dict, using a comma to delimit de two different header values. For example
HTTP/1.1 200 OK
HeaderX: Value1
HeaderX: Value2
> print response.headers
> { 'headerx' : ' Value1, Value2' }
This makes impossible to detect responses with duplicate headers, particularly when header values already include commas by themselves (e.g., 'last-modified')
Potential alternative repr:
> print response.headers
> { 'headerx' : ['Value1', 'Value2'] }
Problem: breaks backward compatibility as scripts expecting a string would get a list
> print response.headers
> { 'headerx' : 'Value1 <SEP> 'Value2'}
Where SEP would be a separator that can't be found on values (newline?)
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4",
"events_url": "https://api.github.com/users/Lukasa/events{/privacy}",
"followers_url": "https://api.github.com/users/Lukasa/followers",
"following_url": "https://api.github.com/users/Lukasa/following{/other_user}",
"gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Lukasa",
"id": 1382556,
"login": "Lukasa",
"node_id": "MDQ6VXNlcjEzODI1NTY=",
"organizations_url": "https://api.github.com/users/Lukasa/orgs",
"received_events_url": "https://api.github.com/users/Lukasa/received_events",
"repos_url": "https://api.github.com/users/Lukasa/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Lukasa",
"user_view_type": "public"
}
|
{
"+1": 1,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 1,
"url": "https://api.github.com/repos/psf/requests/issues/1415/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1415/timeline
| null |
completed
| null | null | false
|
[
"Hi @olemoudi, thanks for raising this issue!\n\nThis is actually being done in urllib3, the library that manages our HTTP connections. Specifically, [here](https://github.com/shazow/urllib3/blob/master/urllib3/response.py#L221).\n\nOrdinarily I'd say that you should raise this issue on the urllib3 repository (and you are obviously free to do so), but in this case I don't consider this to be a bug. [RFC 2616 has the following to say](http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.2):\n\n> \"Multiple message-header fields with the same field-name MAY be present in a message if and only if the entire field-value for that header field is defined as a comma-separated list. It MUST be possible to combine the multiple header fields into one \"field-name: field-value\" pair, without changing the semantics of the message, by appending each subsequent field-value to the first, each separated by a comma.\n\nGiven that there is a defined behaviour for multiple header values, we would need a very good argument for complicating the general (RFC specified and correct) case for the sake of making easier the unusual (contrary to RFC and incorrect) case.\n",
"Makes perfect sense!\n\nThanks for the reply. Keep up the great work.\n\nMartin\n\nOn Tue, Jun 11, 2013 at 10:26 AM, Cory Benfield notifications@github.comwrote:\n\n> Hi @olemoudi https://github.com/olemoudi, thanks for raising this issue!\n> \n> This is actually being done in urllib3, the library that manages our HTTP\n> connections. Specifically, herehttps://github.com/shazow/urllib3/blob/master/urllib3/response.py#L221\n> .\n> \n> Ordinarily I'd say that you should raise this issue on the urllib3\n> repository (and you are obviously free to do so), but in this case I don't\n> consider this to be a bug. RFC 2616 has the following to sayhttp://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.2\n> :\n> \n> \"Multiple message-header fields with the same field-name MAY be present in\n> a message if and only if the entire field-value for that header field is\n> defined as a comma-separated list. It MUST be possible to combine the\n> multiple header fields into one \"field-name: field-value\" pair, without\n> changing the semantics of the message, by appending each subsequent\n> field-value to the first, each separated by a comma.\n> \n> Given that there is a defined behaviour for multiple header values, we\n> would need a very good argument for complicating the general (RFC specified\n> and correct) case for the sake of making easier the unusual (contrary to\n> RFC and incorrect) case.\n> \n> —\n> Reply to this email directly or view it on GitHubhttps://github.com/kennethreitz/requests/issues/1415#issuecomment-19248592\n> .\n",
"@Lukasa \nYou linked to the master branch which is a moving target which made your link obsolete by now... Please remember to always link to specific revision/tag :)\n\n@olemoudi \nMerging headers often is asking for trouble. See http://bugs.python.org/issue1660009 for details. This is fixed in Python 3 - headers are not being merged. See http://lists.w3.org/Archives/Public/ietf-http-wg/2013JanMar/0016.html for an example of problems with merged headers.\n",
"AFAIK, a case which deviates from RFC 2616 but it's still useful \"in practice\" is if you have a download that contains unicode characters. Based on my research (ie links from http://stackoverflow.com/questions/93551/how-to-encode-the-filename-parameter-of-content-disposition-header-in-http :smile:) you should do the following:\r\n\r\n- Add a `Content-Disposition` with the classic `attachment; filename=\"%s\"` value (but make sure to only include ascii characters. This is for legacy browsers\r\n- Add a second `Content-Disposition` header with the `attachment; filename*=UTF-8''%s` format where the filename is UTF-8 encoded and then percent encoded for browser"
] |
https://api.github.com/repos/psf/requests/issues/1414
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1414/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1414/comments
|
https://api.github.com/repos/psf/requests/issues/1414/events
|
https://github.com/psf/requests/pull/1414
| 15,321,267
|
MDExOlB1bGxSZXF1ZXN0NjIwOTEwOA==
| 1,414
|
fixed typo in docs
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/2245080?v=4",
"events_url": "https://api.github.com/users/jschneier/events{/privacy}",
"followers_url": "https://api.github.com/users/jschneier/followers",
"following_url": "https://api.github.com/users/jschneier/following{/other_user}",
"gists_url": "https://api.github.com/users/jschneier/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/jschneier",
"id": 2245080,
"login": "jschneier",
"node_id": "MDQ6VXNlcjIyNDUwODA=",
"organizations_url": "https://api.github.com/users/jschneier/orgs",
"received_events_url": "https://api.github.com/users/jschneier/received_events",
"repos_url": "https://api.github.com/users/jschneier/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/jschneier/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jschneier/subscriptions",
"type": "User",
"url": "https://api.github.com/users/jschneier",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 2
|
2013-06-09T15:16:37Z
|
2021-09-08T20:01:27Z
|
2013-06-12T18:12:18Z
|
CONTRIBUTOR
|
resolved
|
I was reading the "advanced" section of the docs and noticed a typo, so I sent you a pull 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/1414/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1414/timeline
| null | null | false
|
{
"diff_url": "https://github.com/psf/requests/pull/1414.diff",
"html_url": "https://github.com/psf/requests/pull/1414",
"merged_at": "2013-06-12T18:12:18Z",
"patch_url": "https://github.com/psf/requests/pull/1414.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/1414"
}
| true
|
[
"Awesome, thank you so much! =)\n",
"@Lukasa feel free to merge something like this next time :)\n"
] |
https://api.github.com/repos/psf/requests/issues/1413
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1413/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1413/comments
|
https://api.github.com/repos/psf/requests/issues/1413/events
|
https://github.com/psf/requests/pull/1413
| 15,303,124
|
MDExOlB1bGxSZXF1ZXN0NjIwMzM1Mg==
| 1,413
|
Assorted docs updates
|
{
"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-06-08T10:12:16Z
|
2021-09-08T20:01:26Z
|
2013-06-08T10:13:14Z
|
MEMBER
|
resolved
|
This should resolve #1390, #1399 and #1383.
```
DOCUMENT
,,
';;
''
____ ||
; \ ||
\,---'-,-, ||
/ ( o) ||
(o )__,--'-' \ ||
,,,, ;'uuuuu'' ) ;;
\ \ \ ) ) /\//
'--' \'nnnnn' / \
\\ //'------' \
\\ // \ \
\\ // ) )
\\// | |
\\ / |
ALL THE THINGS!!!!
```
|
{
"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/1413/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1413/timeline
| null | null | false
|
{
"diff_url": "https://github.com/psf/requests/pull/1413.diff",
"html_url": "https://github.com/psf/requests/pull/1413",
"merged_at": "2013-06-08T10:13:14Z",
"patch_url": "https://github.com/psf/requests/pull/1413.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/1413"
}
| true
|
[
":sparkles: :cake: :sparkles: :cake: :sparkles: :cake: :sparkles:\n"
] |
https://api.github.com/repos/psf/requests/issues/1412
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1412/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1412/comments
|
https://api.github.com/repos/psf/requests/issues/1412/events
|
https://github.com/psf/requests/pull/1412
| 15,302,170
|
MDExOlB1bGxSZXF1ZXN0NjIwMjkzNg==
| 1,412
|
update urllib3 to 60ba176f5d
|
{
"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-06-08T08:24:17Z
|
2021-09-08T23:11:10Z
|
2013-06-08T10:13:34Z
|
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/1412/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1412/timeline
| null | null | false
|
{
"diff_url": "https://github.com/psf/requests/pull/1412.diff",
"html_url": "https://github.com/psf/requests/pull/1412",
"merged_at": "2013-06-08T10:13:34Z",
"patch_url": "https://github.com/psf/requests/pull/1412.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/1412"
}
| true
|
[
"Always good to get more urllib3. =)\n",
"Indeed :+1: \n",
"thanks!!\n"
] |
|
https://api.github.com/repos/psf/requests/issues/1411
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1411/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1411/comments
|
https://api.github.com/repos/psf/requests/issues/1411/events
|
https://github.com/psf/requests/issues/1411
| 15,272,524
|
MDU6SXNzdWUxNTI3MjUyNA==
| 1,411
|
Integration of Github with Window Azure.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/4444221?v=4",
"events_url": "https://api.github.com/users/Softedge-Administrator/events{/privacy}",
"followers_url": "https://api.github.com/users/Softedge-Administrator/followers",
"following_url": "https://api.github.com/users/Softedge-Administrator/following{/other_user}",
"gists_url": "https://api.github.com/users/Softedge-Administrator/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Softedge-Administrator",
"id": 4444221,
"login": "Softedge-Administrator",
"node_id": "MDQ6VXNlcjQ0NDQyMjE=",
"organizations_url": "https://api.github.com/users/Softedge-Administrator/orgs",
"received_events_url": "https://api.github.com/users/Softedge-Administrator/received_events",
"repos_url": "https://api.github.com/users/Softedge-Administrator/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Softedge-Administrator/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Softedge-Administrator/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Softedge-Administrator",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 1
|
2013-06-07T13:42:06Z
|
2021-09-09T03:00:30Z
|
2013-06-07T13:44:13Z
|
NONE
|
resolved
|
Please suggest me to how we integrate a Github(Source code) with window azure .
|
{
"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/1411/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1411/timeline
| null |
completed
| null | null | false
|
[
"Hi there!\n\nSorry, but Requests' issue pages are not really the place for this kind of discussion. If you need help, I suggest trying an IRC channel or asking Stack Overflow. In the meantime, [this article](http://www.windowsazure.com/en-us/develop/net/common-tasks/publishing-with-git/) seems like a good place to start.\n"
] |
https://api.github.com/repos/psf/requests/issues/1410
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1410/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1410/comments
|
https://api.github.com/repos/psf/requests/issues/1410/events
|
https://github.com/psf/requests/issues/1410
| 15,256,308
|
MDU6SXNzdWUxNTI1NjMwOA==
| 1,410
|
All cookies set during redirects are no longer stored on the Response object
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/882438?v=4",
"events_url": "https://api.github.com/users/matheusgr/events{/privacy}",
"followers_url": "https://api.github.com/users/matheusgr/followers",
"following_url": "https://api.github.com/users/matheusgr/following{/other_user}",
"gists_url": "https://api.github.com/users/matheusgr/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/matheusgr",
"id": 882438,
"login": "matheusgr",
"node_id": "MDQ6VXNlcjg4MjQzOA==",
"organizations_url": "https://api.github.com/users/matheusgr/orgs",
"received_events_url": "https://api.github.com/users/matheusgr/received_events",
"repos_url": "https://api.github.com/users/matheusgr/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/matheusgr/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/matheusgr/subscriptions",
"type": "User",
"url": "https://api.github.com/users/matheusgr",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 8
|
2013-06-07T03:46:00Z
|
2021-09-09T03:00:26Z
|
2013-06-08T18:18:33Z
|
NONE
|
resolved
|
Until version 1.2.0 a Response object would keep all cookies set during a redirection chain. This behavior was changed in version 1.2.1 (commit 1e465fd25554e4da84909fe1bd054c30c79ef05e).
cURL and, I believe, all major used browsers ( http://blog.dubbelboer.com/2012/11/25/302-cookie.html ) will keep cookies set during redirections for futher requests. This is not the current behavior for python-requests.
I propose to revert 1e465fd25554e4da84909fe1bd054c30c79ef05e to keep python-requests in consistency with other implementations.
This was an issue that I found when dealing with Google Client Login and Google App Engine authentication. Current version forces me to look at each request from request.history to retrieve each cookie set during redirects. The default behavior should be the opposite, since there are few cases where someone would not keep cookies defined from previous redirects.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/882438?v=4",
"events_url": "https://api.github.com/users/matheusgr/events{/privacy}",
"followers_url": "https://api.github.com/users/matheusgr/followers",
"following_url": "https://api.github.com/users/matheusgr/following{/other_user}",
"gists_url": "https://api.github.com/users/matheusgr/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/matheusgr",
"id": 882438,
"login": "matheusgr",
"node_id": "MDQ6VXNlcjg4MjQzOA==",
"organizations_url": "https://api.github.com/users/matheusgr/orgs",
"received_events_url": "https://api.github.com/users/matheusgr/received_events",
"repos_url": "https://api.github.com/users/matheusgr/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/matheusgr/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/matheusgr/subscriptions",
"type": "User",
"url": "https://api.github.com/users/matheusgr",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/1410/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1410/timeline
| null |
completed
| null | null | false
|
[
"Hi @matheusgr, thanks for opening this issue!\n\nTo be clear, are you experiencing that we're not sending cookies that we should be sending, or are you simply frustrated about being unable to easily see the full set of cookies? If it's the second, have you tried looking at `Session.cookies`?\n",
"The second case. I now need to look at each response at response.history to see all cookies set at redirects.\n\nI also tried to use a Session object, but it also only stores the last cookie recieved during redirects.\n",
"@matheusgr That shouldn't be true unless the remote server is unsetting them. If the remote server _is_ unsetting them then the previous behaviour was actually a bug. Are you finding that we're definitely losing the other cookies?\n",
"I put an webapp that sets three cookies -- one at each redirect (/r1, /r2) and one on the final location (/r3).\n\nI can have access those cookies if I look at the response/session history. But those cookies are not accessible from the response/session cookies attribute. I can confirm that the server is not unsetting them.\n\nV1.2.0:\n\n```\n>>> [cookie.name for cookie in requests.get('http://requestredirect.appspot.com/r1').cookies]\n['r1', 'r2', 'r3']\n```\n\nV1.2.3:\n\n```\n>>> [cookie.name for cookie in requests.get('http://requestredirect.appspot.com/r1').cookies]\n['r3']\n>>> [[c.name for c in r.cookies] for r in requests.get('http://requestredirect.appspot.com/r1').history]\n[['r1'], ['r2']]\n\n>>> s = requests.Session()\n>>> [cookie.name for cookie in s.get('http://requestredirect.appspot.com/r1').cookies]\n['r3']\n>>> [[c.name for c in r.cookies] for r in s.get('http://requestredirect.appspot.com/r1').history]\n[['r1'], ['r2']]\n```\n",
"Oh, that's a problem. Give me a little while, I'll see if I can easily reproduce it.\n",
"I'm sorry, I should have read your code more carefuly. Your v1.2.3 session code is incorrect. You should be doing:\n\n``` python\n>>> s = requests.Session()\n>>> s.get('http://requestredirect.appspot.com/r1')\n>>> [cookie.name for cookie in s.cookies]\n['r1', 'r2', 'r3']\n```\n",
"Oh, ok, my mistake... the `s.get()` will only return the last response\ncookies, not the full session cookies. I will close this issue. Thank you\nfor all your answers!\n\nOn Sat, Jun 8, 2013 at 3:12 PM, Cory Benfield notifications@github.comwrote:\n\n> I'm sorry, I should have read your code more carefuly. Your v1.2.3 session\n> code is incorrect. You should be doing:\n> \n> > > > s = requests.Session()>>> s.get('http://requestredirect.appspot.com/r1')>>> [cookie.name for cookie in s.cookies]['r1', 'r2', 'r3']\n> \n> —\n> Reply to this email directly or view it on GitHubhttps://github.com/kennethreitz/requests/issues/1410#issuecomment-19152915\n> .\n\n## \n\nhttp://sites.google.com/site/matheusgr/\nmatheusgr@gmail.com\n",
"`s.get()` returns the final `Response` object, and then the `.cookies` acts on that. =)\n\nIt's not a problem, please let me know if you have any more problems! Glad I could help. :cake:\n"
] |
https://api.github.com/repos/psf/requests/issues/1409
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1409/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1409/comments
|
https://api.github.com/repos/psf/requests/issues/1409/events
|
https://github.com/psf/requests/issues/1409
| 15,254,153
|
MDU6SXNzdWUxNTI1NDE1Mw==
| 1,409
|
Request('POST',url,data,files).prepare() munging data when it contains a nested dict
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/4367945?v=4",
"events_url": "https://api.github.com/users/rsalmond/events{/privacy}",
"followers_url": "https://api.github.com/users/rsalmond/followers",
"following_url": "https://api.github.com/users/rsalmond/following{/other_user}",
"gists_url": "https://api.github.com/users/rsalmond/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/rsalmond",
"id": 4367945,
"login": "rsalmond",
"node_id": "MDQ6VXNlcjQzNjc5NDU=",
"organizations_url": "https://api.github.com/users/rsalmond/orgs",
"received_events_url": "https://api.github.com/users/rsalmond/received_events",
"repos_url": "https://api.github.com/users/rsalmond/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/rsalmond/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/rsalmond/subscriptions",
"type": "User",
"url": "https://api.github.com/users/rsalmond",
"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 | 9
|
2013-06-07T01:51:27Z
|
2021-09-09T03:00:25Z
|
2013-06-13T08:01:35Z
|
NONE
|
resolved
|
Not sure what's happening but nested dicts seem to be broken when POSTing along side a file upload. One layered dicts arrive unaltered, two layers and bits go missing.
https://gist.github.com/rsalmond/5726554
|
{
"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/1409/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1409/timeline
| null |
completed
| null | null | false
|
[
"Hi @rsalmond, thanks for opening this issue! I just wanted to let you know that I've seen this and will circle back to it at some point this weekend when I have actual time to address it. =)\n",
"Hey awesome, I tried to unwind that code myself but got a bit lost. This lib is mighty handy, your work is much appreciated!\n",
"Can I just clarify, @rsalmond: are you trying to POST json-encoded data, or are you expecting to POST a normal HTML form?\n",
"The reason I ask is that by default our `data` parameter assumes you're posting an HTML form. If you are, then nested dictionaries doesn't make any sense, because you can't nest HTML forms.\n\nIf you aren't, then you want to be posting JSON. Doing that along with a file is awkward, and I'd have to see what your API expects you to do.\n",
"I _think_ I need to post JSON encoded data along with a file to the freshdesk API. Their docs are not great but I was given [some example ruby code](https://gist.github.com/rsalmond/5736708) that I'm trying to emulate. When I point that at httpbin.org/post I get this back for the JSON encoded data.\n\n```\n\"form\": {\n\"helpdesk_ticket[email]\": \"test@abc.com\",\n\"helpdesk_ticket[custom_field][department_category_16699]\": \"Information Technology\",\n\"helpdesk_ticket[description]\": \"Test ticket creation with attachments\",\n\"helpdesk_ticket[subject]\": \"new ticket sample\"\n},\n```\n\nAnd this for the file upload:\n\n```\n \"files\": {\n \"helpdesk_ticket[attachments][][resource]\": \"data:image/jpeg;base64,(lots of base64)\"\n}\n```\n\nBut the dict structure in the first gist creates a ticket successfully when I do not attach a file which is what makes me think the nested dict is the way to go.\n",
"I think they're relying on something that rest_client does for you. I think it will traverse the hash looking for File objects and read them into memory.\n\nTo do something similar with requests (please excuse my generalities, I'm on my phone) you create a dictionary similar to their hash. Wherever you see `:word` replace it with `'word'`. And with your files opened ahead of time - named fd1 and fd2 -, replace their File.open calls with fd1.read() and fd2.read().\n\nThen import the json module and call `json.dumps(data)` before giving your data to requests. You can also set the content type via the headers parameter.\n\nI don't have the luxury to look the gists or fork them and help you. I hope the above is helpful enough. \n",
"Sorry @rsalmond, I lost track of this briefly.\n\nI think @sigmavirus24 has basically got the right idea here. JSON has to be the way to go, and your two options there are either to send multipart data with JSON in one part and the file in another, or to JSONify the whole thing. I'd go with his idea for now.\n\nBtw, on the topic of nested dictionaries working without files, I don't see that behaviour:\n\n``` python\n>>> import requests\n>>> data = {'outer': {'key1': 'val1', 'key2': 'val2'}}\n>>> r = requests.post('http://httpbin.org/post', data=data)\n>>> print r.text\n#...snip...\n \"form\": {\n \"form\": [\n \"key2\",\n \"key1\"\n ]\n }\n#...snip...\n```\n",
"Hey there, sigmavirus24 I think I can pull that off. I was assuming requests did some sort of similar magic as rest_client but I'll give that a go.\n\nLukasa my mistake, you are correct. I in my tests I was passing the dict through json.dumps() before handing it to requests. Removing that I see the same behaviour you pasted above. \n\nThanks for the suggestions!\n",
"Awesome. =)\n\nFor the moment I'm going to close this. If you're still having trouble, reopen it again and Ian and I will come running. =)\n"
] |
https://api.github.com/repos/psf/requests/issues/1408
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1408/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1408/comments
|
https://api.github.com/repos/psf/requests/issues/1408/events
|
https://github.com/psf/requests/pull/1408
| 15,232,934
|
MDExOlB1bGxSZXF1ZXN0NjE2NTM1Ng==
| 1,408
|
cookies.morsel_to_cookie morsel['expires'] can't be strtime, and morsel['max-age'] convert to expires problem repair
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/2045368?v=4",
"events_url": "https://api.github.com/users/wasw100/events{/privacy}",
"followers_url": "https://api.github.com/users/wasw100/followers",
"following_url": "https://api.github.com/users/wasw100/following{/other_user}",
"gists_url": "https://api.github.com/users/wasw100/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/wasw100",
"id": 2045368,
"login": "wasw100",
"node_id": "MDQ6VXNlcjIwNDUzNjg=",
"organizations_url": "https://api.github.com/users/wasw100/orgs",
"received_events_url": "https://api.github.com/users/wasw100/received_events",
"repos_url": "https://api.github.com/users/wasw100/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/wasw100/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/wasw100/subscriptions",
"type": "User",
"url": "https://api.github.com/users/wasw100",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 6
|
2013-06-06T16:47:13Z
|
2021-09-08T20:01:25Z
|
2013-06-08T10:14:32Z
|
CONTRIBUTOR
|
resolved
|
eg. view yahoo.com will return:
```
Set-Cookie B=9a3jpi98r1dd8&b=3&s=fb; expires=Sun, 07-Jun-2015 16:15:36 GMT; path=/; domain=.yahoo.com
```
expires is str time, but cookielib.Cookie.expires only int
py code:
```
str_cookie = "B=9a3jpi98r1dd8&b=3&s=fb; expires=Sun, 07-Jun-2015 16:15:36 GMT; path=/; domain=.yahoo.com"
C = Cookie.SimpleCookie(str_cookie)
for morsel in C.values():
cookie = requests.cookies.morsel_to_cookie(morsel)
print cookie
```
1.raise TypeError:
TypeError: create_cookie() got unexpected keyword arguments: ['path_specified', 'domain_specified', 'port_specified', 'domain_initial_dot']
so we should remove these param from morsel_to_cookie(morsel):create_cookie(....)
2.where repair 1 after, will raise:
File "/usr/lib/python2.7/cookielib.py", line 739, in **init**
if expires is not None: expires = int(expires)
ValueError: invalid literal for int() with base 10: 'Sun, 07-Jun-2015 16:15:36 GMT'
|
{
"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/1408/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1408/timeline
| null | null | false
|
{
"diff_url": "https://github.com/psf/requests/pull/1408.diff",
"html_url": "https://github.com/psf/requests/pull/1408",
"merged_at": "2013-06-08T10:14:32Z",
"patch_url": "https://github.com/psf/requests/pull/1408.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/1408"
}
| true
|
[
"Hi @wasw100, thanks for raising this pull request!\n\nUnfortunately, it's not clear to me whether we want to continue supporting adding Morsels to `RequestsCookieJars`. Can I get a call on this @kennethreitz?\n",
"Hi @Lukasa , thanks for your reply.\n\nIf we handler response cookie by ourself, Morsels to RequestCookieJar is usefull.\nI use these methods in other projectes.\n",
"I agree that it's useful, I just wonder how useful it is. Requests does not include plenty of useful code on the grounds that it complicates the API and increases the amount of code we need to maintain. I'm on the fence about this: I don't mind keeping it and I don't mind throwing it away. In situations like that, I'd usually throw it away.\n\nThat's why I'm interested to see what @kennethreitz thinks.\n",
"This seems like a great addition. Many thanks!\n",
":cookie: get it? :)\n",
"This few days I can not surf the Internet. Thanks.\n"
] |
https://api.github.com/repos/psf/requests/issues/1407
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1407/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1407/comments
|
https://api.github.com/repos/psf/requests/issues/1407/events
|
https://github.com/psf/requests/pull/1407
| 15,217,439
|
MDExOlB1bGxSZXF1ZXN0NjE1Njc1Ng==
| 1,407
|
cookies.morsel_to_cookie(morsel) raise TypeError repaired.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/2045368?v=4",
"events_url": "https://api.github.com/users/wasw100/events{/privacy}",
"followers_url": "https://api.github.com/users/wasw100/followers",
"following_url": "https://api.github.com/users/wasw100/following{/other_user}",
"gists_url": "https://api.github.com/users/wasw100/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/wasw100",
"id": 2045368,
"login": "wasw100",
"node_id": "MDQ6VXNlcjIwNDUzNjg=",
"organizations_url": "https://api.github.com/users/wasw100/orgs",
"received_events_url": "https://api.github.com/users/wasw100/received_events",
"repos_url": "https://api.github.com/users/wasw100/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/wasw100/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/wasw100/subscriptions",
"type": "User",
"url": "https://api.github.com/users/wasw100",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 0
|
2013-06-06T11:16:03Z
|
2021-09-08T20:01:26Z
|
2013-06-06T16:50:03Z
|
CONTRIBUTOR
|
resolved
|
morsel_to_cookie(mosel) method raise TypeError: create_cookie() got unexpected keyword arguments: ['path_specified', 'domain_specified', 'port_specified', 'domain_initial_dot'].
so we should remove these param from create_cookie(...)
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/2045368?v=4",
"events_url": "https://api.github.com/users/wasw100/events{/privacy}",
"followers_url": "https://api.github.com/users/wasw100/followers",
"following_url": "https://api.github.com/users/wasw100/following{/other_user}",
"gists_url": "https://api.github.com/users/wasw100/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/wasw100",
"id": 2045368,
"login": "wasw100",
"node_id": "MDQ6VXNlcjIwNDUzNjg=",
"organizations_url": "https://api.github.com/users/wasw100/orgs",
"received_events_url": "https://api.github.com/users/wasw100/received_events",
"repos_url": "https://api.github.com/users/wasw100/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/wasw100/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/wasw100/subscriptions",
"type": "User",
"url": "https://api.github.com/users/wasw100",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/1407/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1407/timeline
| null | null | false
|
{
"diff_url": "https://github.com/psf/requests/pull/1407.diff",
"html_url": "https://github.com/psf/requests/pull/1407",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/1407.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/1407"
}
| true
|
[] |
https://api.github.com/repos/psf/requests/issues/1406
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1406/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1406/comments
|
https://api.github.com/repos/psf/requests/issues/1406/events
|
https://github.com/psf/requests/issues/1406
| 15,210,836
|
MDU6SXNzdWUxNTIxMDgzNg==
| 1,406
|
Can no longer override response.raw with a file-like object
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/682175?v=4",
"events_url": "https://api.github.com/users/carlio/events{/privacy}",
"followers_url": "https://api.github.com/users/carlio/followers",
"following_url": "https://api.github.com/users/carlio/following{/other_user}",
"gists_url": "https://api.github.com/users/carlio/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/carlio",
"id": 682175,
"login": "carlio",
"node_id": "MDQ6VXNlcjY4MjE3NQ==",
"organizations_url": "https://api.github.com/users/carlio/orgs",
"received_events_url": "https://api.github.com/users/carlio/received_events",
"repos_url": "https://api.github.com/users/carlio/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/carlio/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/carlio/subscriptions",
"type": "User",
"url": "https://api.github.com/users/carlio",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 2
|
2013-06-06T08:27:35Z
|
2021-09-09T02:11:57Z
|
2013-07-02T02:00:20Z
|
NONE
|
resolved
|
`Response.raw` is stated to be a 'file-like' object ([comment here](https://github.com/kennethreitz/requests/blob/v1.2.1/requests/models.py#L474)) however a change between 1.2.0 and 1.2.1 means that a new parameter (`decode_content`) was added.
The change was made in the following commit: https://github.com/kennethreitz/requests/commit/59f916ca4a6a8e55528988cfc1bee445e71c4602
This is no longer compatible with 'file-like' objects, as it relies on the `urllib3.response` [method signature](https://github.com/kennethreitz/requests/blob/master/requests/packages/urllib3/response.py#L129).
This breaks libraries which override `response.raw`, such as the tests in `github3.py` (see this issue on github3.py: https://github.com/sigmavirus24/github3.py/issues/112)
|
{
"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/1406/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1406/timeline
| null |
completed
| null | null | false
|
[
"Hi @carlio, thanks for raising this issue!\n\nThis has been raised before. I'm increasingly bothered by it, but the keyword argument is really useful. For the moment, downstream libraries like github3.py can wrap their file-like objects in classes that accept-and-drop this keyword argument. That's unsatisfying, but in the interim is probably the way to go.\n",
"Ah, I didn't think to look through the closed issues, oops. \n\nIf this will be the decision, it'd be good to change the comment on `raw` just to avoid confusion!\n\nI'll go create a pull request for `github3.py`'s tests to use your suggestion.\n"
] |
https://api.github.com/repos/psf/requests/issues/1405
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1405/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1405/comments
|
https://api.github.com/repos/psf/requests/issues/1405/events
|
https://github.com/psf/requests/pull/1405
| 15,064,904
|
MDExOlB1bGxSZXF1ZXN0NjA3NjEzMw==
| 1,405
|
Add support for disabling SSL host name verification
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/2726112?v=4",
"events_url": "https://api.github.com/users/borfig/events{/privacy}",
"followers_url": "https://api.github.com/users/borfig/followers",
"following_url": "https://api.github.com/users/borfig/following{/other_user}",
"gists_url": "https://api.github.com/users/borfig/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/borfig",
"id": 2726112,
"login": "borfig",
"node_id": "MDQ6VXNlcjI3MjYxMTI=",
"organizations_url": "https://api.github.com/users/borfig/orgs",
"received_events_url": "https://api.github.com/users/borfig/received_events",
"repos_url": "https://api.github.com/users/borfig/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/borfig/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/borfig/subscriptions",
"type": "User",
"url": "https://api.github.com/users/borfig",
"user_view_type": "public"
}
|
[] |
closed
| false
| null |
[] | null | 9
|
2013-06-03T12:43:15Z
|
2014-07-08T22:32:41Z
|
2013-06-08T08:04:20Z
|
NONE
| null |
There are some use-cases where SSL certificate verification is required, but without validating the CN (it is the host name of the server in HTTPS).
This patch introduces the dont_verify_host flag, which disables host verification, only if it is set to True. A value of None (the default) or False will keep the enabled host verification.
|
{
"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/1405/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1405/timeline
| null | null | false
|
{
"diff_url": "https://github.com/psf/requests/pull/1405.diff",
"html_url": "https://github.com/psf/requests/pull/1405",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/1405.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/1405"
}
| true
|
[
"I don't think this will be accepted as is, as half of the changes are in shazow/urllib3, which is a different project.\n\nIf you know the CN announced by the server you can do something like this:\n(Note the `assert_hostname` parameter)\n\n``` py\nimport requests\n\n\nclass MyAdapter(requests.adapters.HTTPAdapter):\n def init_poolmanager(self, connections, maxsize, block):\n self._pool_connections = connections\n self._pool_maxsize = maxsize\n self._pool_block = block\n self.poolmanager = requests.packages.urllib3.PoolManager(num_pools=connections,\n maxsize=maxsize,\n assert_hostname='t-8ch.de')\n\ns = requests.Session()\ns.mount('https://', MyAdapter())\n\ns.get('https://test.t-8ch.de')\n```\n\nWithout mounting the adapter you will get an exception.\nIt should go away when mouting the adapter.\n\n(Note to future visitors: I'll fix my certificate when this issue is resolved, so you may not experience the described behaviour :smile: )\n",
"This patch introduces an existing feature in any SSL library - letting the library user decide whether to verify the CN. For example in openssl, the default is _not_ to verify the CN.\n\nIn the regular usage, where a known public server is requested, it is mandatory to verify the CN, and this patch does not touch this behavior.\n\nOn the other hand, when a custom small chain of trust is used, such as in our use-case, verifying the CN, even if it is a constant one, is completely useless.\n\nBy the way, why did you copy shazow/urllib3, instead of git submodule'ing it?\n",
"Hi @borfig, thanks for this pull request!\n\nAs @t-8ch said, in its current form we can't accept this Pull Request. We do not make local changes to urllib3, so the urllib3 portions of this work would have to be contributed separately upstream. You should feel free to do that if you'd like to. As for why we have vendored urllib3 instead of using a git submodule, I'll point you at the discussion in #1384 which went over the decision in great detail. (Short answer: the standard Python repository structure does not lend itself to being a git submodule.)\n\nApproaching this more generally, Requests has very strong opinions about SSL. Even if this feature was added to urllib3, I don't think we'd add it to the functional Requests API. Instead, I think we'd expect people to use Transport Adapters (as @t-8ch has demonstrated) to get that functionality.\n",
"There have been talks in urllib3#140 about a new class `Verification` where users can embed their own verification logic, as urllib3's ssl api is becoming a but unwieldy.\nUntil this gets implemented it may be possible to change the `assert_hostname` of `urllib3` to disable hostname verification if it's value is the empty string `''`.\n\ncc @shazow\n",
"Setting `assert_hostname` of packaged `urllib3` to `''` will trigger the validation as if it was `None`. The same also happens in standalone shazow/urllib3.\n\nMy goal is to disable the CN validation, and the current code, both in `requests` and `urllib3`, does not allow this. I could also replace `match_hostname` function dynamically in the code that imports `requests`, but this is way too ugly.\n",
"Indeed, the current implementation doesn't allow this. I wanted to propose a _change_ which would introduce the behaviour I proposed. Sorry if this wasn't clear.\n",
"I think that for the moment this discussion should be moved over to urllib3. Feel free to open a new Pull Request if and when urllib3 includes the necessary changes.\n\nThanks for opening this Pull Request, keep them coming! =)\n",
"This has been implemented by @borfig in shazow/urllib3#194. It has already been merged into master.\n",
"Oh excellent! I still need a new PR with only the new changes though. =)\n"
] |
https://api.github.com/repos/psf/requests/issues/1404
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1404/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1404/comments
|
https://api.github.com/repos/psf/requests/issues/1404/events
|
https://github.com/psf/requests/issues/1404
| 15,041,753
|
MDU6SXNzdWUxNTA0MTc1Mw==
| 1,404
|
Is this a bug?
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1297754?v=4",
"events_url": "https://api.github.com/users/pythonmobile/events{/privacy}",
"followers_url": "https://api.github.com/users/pythonmobile/followers",
"following_url": "https://api.github.com/users/pythonmobile/following{/other_user}",
"gists_url": "https://api.github.com/users/pythonmobile/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/pythonmobile",
"id": 1297754,
"login": "pythonmobile",
"node_id": "MDQ6VXNlcjEyOTc3NTQ=",
"organizations_url": "https://api.github.com/users/pythonmobile/orgs",
"received_events_url": "https://api.github.com/users/pythonmobile/received_events",
"repos_url": "https://api.github.com/users/pythonmobile/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/pythonmobile/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/pythonmobile/subscriptions",
"type": "User",
"url": "https://api.github.com/users/pythonmobile",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 1
|
2013-06-02T16:22:36Z
|
2021-09-09T03:00:31Z
|
2013-06-03T02:18:20Z
|
NONE
|
resolved
|
MacOSX + Python 2.7.5 + latest requests Traceback :
```
r = session_var.post(url, data=payload, verify=False)
File "/usr/local/lib/python2.7/site-packages/requests/sessions.py", line 377, in post
return self.request('POST', url, data=data, **kwargs)
File "/usr/local/lib/python2.7/site-packages/requests/sessions.py", line 335, in request
resp = self.send(prep, **send_kwargs)
File "/usr/local/lib/python2.7/site-packages/requests/sessions.py", line 438, in send
r = adapter.send(request, **kwargs)
File "/usr/local/lib/python2.7/site-packages/requests/adapters.py", line 292, in send
timeout=timeout
File "/usr/local/lib/python2.7/site-packages/requests/packages/urllib3/connectionpool.py", line 423, in urlopen
conn = self._get_conn(timeout=pool_timeout)
File "/usr/local/lib/python2.7/site-packages/requests/packages/urllib3/connectionpool.py", line 234, in _get_conn
if conn and is_connection_dropped(conn):
File "/usr/local/lib/python2.7/site-packages/requests/packages/urllib3/util.py", line 256, in is_connection_dropped
return select([sock], [], [], 0.0)[0]
TypeError: argument must be an int, or have a fileno() method.
```
Perhaps the exception raised should be a bit more easy to read? Or am I missing something obvious.
|
{
"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/1404/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1404/timeline
| null |
completed
| null | null | false
|
[
"If it is a bug, it should be raised against urllib3. The last line is in urllib3, not requests. Thanks!\n"
] |
https://api.github.com/repos/psf/requests/issues/1403
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1403/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1403/comments
|
https://api.github.com/repos/psf/requests/issues/1403/events
|
https://github.com/psf/requests/pull/1403
| 15,033,236
|
MDExOlB1bGxSZXF1ZXN0NjA2MjY5NQ==
| 1,403
|
fix - AttributeError: 'CaseInsensitiveDict' object has no attribute 'has_key'
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/651797?v=4",
"events_url": "https://api.github.com/users/foxx/events{/privacy}",
"followers_url": "https://api.github.com/users/foxx/followers",
"following_url": "https://api.github.com/users/foxx/following{/other_user}",
"gists_url": "https://api.github.com/users/foxx/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/foxx",
"id": 651797,
"login": "foxx",
"node_id": "MDQ6VXNlcjY1MTc5Nw==",
"organizations_url": "https://api.github.com/users/foxx/orgs",
"received_events_url": "https://api.github.com/users/foxx/received_events",
"repos_url": "https://api.github.com/users/foxx/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/foxx/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/foxx/subscriptions",
"type": "User",
"url": "https://api.github.com/users/foxx",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 4
|
2013-06-01T22:01:00Z
|
2021-09-08T20:01:24Z
|
2013-06-02T05:43:16Z
|
NONE
|
resolved
|
fixes https://github.com/kennethreitz/requests/issues/1402
|
{
"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/1403/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1403/timeline
| null | null | false
|
{
"diff_url": "https://github.com/psf/requests/pull/1403.diff",
"html_url": "https://github.com/psf/requests/pull/1403",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/1403.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/1403"
}
| true
|
[
"I'm -0. I don't think it should be \"fixed\" because we should be promoting future-proof behaviour anyway but that as it is, I'm not one for breaking what is effectively part of the API.\n",
"`has_key` should be used by no one :)\n",
"Haha, the BDFL has spoken :) :+1: \n",
"Keep the PRs coming! :cake:\n\n## \n\nKenneth Reitz\n\nOn Jun 2, 2013, at 2:01 AM, Cal Leeming notifications@github.com wrote:\n\nHaha, the BDFL has spoken :) [image: :+1:]\n\n—\nReply to this email directly or view it on\nGitHubhttps://github.com/kennethreitz/requests/pull/1403#issuecomment-18802730\n.\n"
] |
https://api.github.com/repos/psf/requests/issues/1402
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1402/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1402/comments
|
https://api.github.com/repos/psf/requests/issues/1402/events
|
https://github.com/psf/requests/issues/1402
| 15,033,226
|
MDU6SXNzdWUxNTAzMzIyNg==
| 1,402
|
AttributeError: 'CaseInsensitiveDict' object has no attribute 'has_key'
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/651797?v=4",
"events_url": "https://api.github.com/users/foxx/events{/privacy}",
"followers_url": "https://api.github.com/users/foxx/followers",
"following_url": "https://api.github.com/users/foxx/following{/other_user}",
"gists_url": "https://api.github.com/users/foxx/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/foxx",
"id": 651797,
"login": "foxx",
"node_id": "MDQ6VXNlcjY1MTc5Nw==",
"organizations_url": "https://api.github.com/users/foxx/orgs",
"received_events_url": "https://api.github.com/users/foxx/received_events",
"repos_url": "https://api.github.com/users/foxx/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/foxx/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/foxx/subscriptions",
"type": "User",
"url": "https://api.github.com/users/foxx",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 4
|
2013-06-01T22:00:07Z
|
2021-09-09T03:00:31Z
|
2013-06-03T09:03:46Z
|
NONE
|
resolved
|
In requests <= 1.0, you could do;
```
r.headers.has_key('content-type')
```
Now this results in:
```
File "adapters.py", line 260, in _download_url
if r.headers.has_key('content-length'):
AttributeError: 'CaseInsensitiveDict' object has no attribute 'has_key'
```
You could do;
```
r.headers.keys().count('content-length')
```
Or
```
headers = dict(**r.headers)
```
But it would be nice to just be able to do .has_key().
|
{
"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/1402/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1402/timeline
| null |
completed
| null | null | false
|
[
"Why not just `key in r.headers`?\n",
"Hmm, I didn't know you could use that syntax on dict, and it appears to be the standard now.\nhttp://stackoverflow.com/questions/1323410/has-key-or-in\n\nAlso seems it was removed in python 3;\nhttp://docs.python.org/3.1/whatsnew/3.0.html#builtins\n\nIn future I will be using the 'in' statement, however, this would break a lot of backwards compatibility for users upgrading to the next version of requests, and there was no deprecation warning on this.\n\nThoughts?\n",
"Yeah it's a pain for some people relying on it, but anyone writing future (python 3) proof code, should have been using it. Clearly I'm a bit unsympathetic but I'm not against reintroducing it because it is sort of part of the API.\n",
"No problem, either way thank you for the heads up on the 'in' statement :)\n"
] |
https://api.github.com/repos/psf/requests/issues/1401
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1401/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1401/comments
|
https://api.github.com/repos/psf/requests/issues/1401/events
|
https://github.com/psf/requests/issues/1401
| 15,032,649
|
MDU6SXNzdWUxNTAzMjY0OQ==
| 1,401
|
iter_content() memory leak + raw read problems
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/651797?v=4",
"events_url": "https://api.github.com/users/foxx/events{/privacy}",
"followers_url": "https://api.github.com/users/foxx/followers",
"following_url": "https://api.github.com/users/foxx/following{/other_user}",
"gists_url": "https://api.github.com/users/foxx/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/foxx",
"id": 651797,
"login": "foxx",
"node_id": "MDQ6VXNlcjY1MTc5Nw==",
"organizations_url": "https://api.github.com/users/foxx/orgs",
"received_events_url": "https://api.github.com/users/foxx/received_events",
"repos_url": "https://api.github.com/users/foxx/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/foxx/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/foxx/subscriptions",
"type": "User",
"url": "https://api.github.com/users/foxx",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 4
|
2013-06-01T21:10:38Z
|
2021-09-09T03:00:30Z
|
2013-06-03T09:41:43Z
|
NONE
|
resolved
|
The following code will cause a memory leak;
```
r = requests.get('http://cachefly.cachefly.net/100mb.test', stream=True)
for chunk in r.iter_content(128):
file.write(chunk)
```
To fix this, I had to use raw() instead;
```
r = requests.get('http://cachefly.cachefly.net/100mb.test', stream=True)
while True:
print r.raw
d = r.raw.read(512, decode_content=True)
if not d:
break
```
Cal
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/651797?v=4",
"events_url": "https://api.github.com/users/foxx/events{/privacy}",
"followers_url": "https://api.github.com/users/foxx/followers",
"following_url": "https://api.github.com/users/foxx/following{/other_user}",
"gists_url": "https://api.github.com/users/foxx/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/foxx",
"id": 651797,
"login": "foxx",
"node_id": "MDQ6VXNlcjY1MTc5Nw==",
"organizations_url": "https://api.github.com/users/foxx/orgs",
"received_events_url": "https://api.github.com/users/foxx/received_events",
"repos_url": "https://api.github.com/users/foxx/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/foxx/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/foxx/subscriptions",
"type": "User",
"url": "https://api.github.com/users/foxx",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/1401/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1401/timeline
| null |
completed
| null | null | false
|
[
"Also, if the remote side is using gzip and you specify an iter_content size of 1, then the result is blank because it cannot decode anything. This is a bit misleading given that the default size is 1.\n\nIf you use .raw.read() it returns a bunch of unicode because of the gzip compression. By default, I think it should use 'decode_content=True', as this is again a bit confusing. But as it is referencing a urllib3 model, this is difficult. Perhaps we should expose a read() object instead?\n\nI had to go trawling through the code to understand this, so I think these warrant a fix, or at the very least a docs patch.\n\nPersonally my suggestion would be;\n- Implement read() instead of calling raw.read() so we can forcibly enable decode_content OR patch the docs to explain this\n- Change the default read size to enforce a minimum of X bytes if gzip/encoding is being used.\n\nThoughts?\n",
"Hi @foxx, thanks for opening this issue! Let me address these in no particular order.\n1. Implementing .read(). Requests explicitly provides the underlying transport library's notion of a response in the `Response.raw` property. If you believe that `decode_content=True` should be the default behaviour (and I agree that it should), I recommend you open a pull request to that effect on [urllib3](https://github.com/shazow/urllib3). I'm sure @shazow will be happy to take a look at it. =)\n2. Changing the default read size is a bit of an odder one. Given the point I made in **1**, we probably can't do it in Requests itself. I would also argue that any method named `read()` should behave like a file-like object, which doesn't have a minimum read value. When I get internet in my new house, I'm going to take a look at implementing the idea in shazow/urllib3#186, which should be able to paper over this issue.\n3. Default `iter_content()` size is a sore topic around here: see #844, which has still not been completely resolved. Your input is welcome there. =)\n4. Where is the memory leak in `iter_content()`?\n",
"Thanks for the quick reply!\n1. Ticket raised - https://github.com/shazow/urllib3/issues/189\n2. Ticket raised - https://github.com/shazow/urllib3/issues/190\n3. Added some comments onto #844 \n\nIn ref to #4, that's an excellent question.. I wrote a small test outside of my project code base and the problem disappeared.. I even tried wrapping it with eventlet and still couldn't reproduce the problem. So it would seem that the memory leak is specific to something else I'm doing.. Until I can figure this out, I guess the ticket can be marked as closed for now.\n\nFor future ref, the code used to disprove the memory leak was;\n\n```\nimport eventlet\neventlet.monkey_patch(all=True)\nimport requests\n\n\ndef lol():\n f = open('/tmp/test.txt', 'wb')\n print \"sending request\"\n r = requests.get('http://cachefly.cachefly.net/100mb.test', stream=True)\n print \"reading..\"\n for chunk in r.iter_content(128):\n f.write(chunk)\n f.close()\n\ne = eventlet.spawn(lol)\ne.wait()\n```\n\nApologies for this, I should have really done this before hand.\n\nCal\n",
"No need to apologise, that's why I followed up. =) Thanks for raising this!\n"
] |
https://api.github.com/repos/psf/requests/issues/1400
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1400/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1400/comments
|
https://api.github.com/repos/psf/requests/issues/1400/events
|
https://github.com/psf/requests/pull/1400
| 15,021,244
|
MDExOlB1bGxSZXF1ZXN0NjA1ODI2OA==
| 1,400
|
Retrieve environment proxies using standard library functions
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/24194?v=4",
"events_url": "https://api.github.com/users/jam/events{/privacy}",
"followers_url": "https://api.github.com/users/jam/followers",
"following_url": "https://api.github.com/users/jam/following{/other_user}",
"gists_url": "https://api.github.com/users/jam/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/jam",
"id": 24194,
"login": "jam",
"node_id": "MDQ6VXNlcjI0MTk0",
"organizations_url": "https://api.github.com/users/jam/orgs",
"received_events_url": "https://api.github.com/users/jam/received_events",
"repos_url": "https://api.github.com/users/jam/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/jam/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jam/subscriptions",
"type": "User",
"url": "https://api.github.com/users/jam",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 5
|
2013-06-01T01:32:02Z
|
2021-09-08T20:01:25Z
|
2013-06-08T10:20:19Z
|
CONTRIBUTOR
|
resolved
|
I ran into a problem earlier today when trying to debug an issue with migrating some code from urllib2 to requests. To compare the requests being made, I fired up my trusty web debugging proxy (Charles), but the requests from requests (ahem) weren't being sent through the proxy.
After digging around in the code, I noticed that requests was only checking the OS environment variables for proxy settings, not the extra OS-specific locations handled by urllib2's ProxyHandler (the System Configuration framework on OS X and the Windows registry). Since the requests code appeared to be duplicating some functionality already in urllib, I made a quick patch to use the standard library functions instead.
It works as expected on Python 2 and 3 using OS X; since it's using urllib under the hood I assume it's safe, but I'll test on Windows/Linux when I'm having less of a nightmare day. However, I'm unsure how to write a test that covers this, since it depends on the current environment's configuration. Any advice would be appreciated!
|
{
"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/1400/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1400/timeline
| null | null | false
|
{
"diff_url": "https://github.com/psf/requests/pull/1400.diff",
"html_url": "https://github.com/psf/requests/pull/1400",
"merged_at": "2013-06-08T10:20:19Z",
"patch_url": "https://github.com/psf/requests/pull/1400.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/1400"
}
| true
|
[
"Hi James, thanks for opening this pull request!\n\nI'm in favour of the idea., My current worry is that `urllib.proxy_bypass()` appears to be totally undocumented. Am I going mad, or is that right?\n",
"@jam _bump_. :smile:\n",
"honestly, i'm afraid to change this behavior. it could break lots of people's stuff\n",
"I lied.\n",
":100: \n"
] |
https://api.github.com/repos/psf/requests/issues/1399
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1399/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1399/comments
|
https://api.github.com/repos/psf/requests/issues/1399/events
|
https://github.com/psf/requests/issues/1399
| 14,988,648
|
MDU6SXNzdWUxNDk4ODY0OA==
| 1,399
|
Add documentation about "non-blocking"
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/414336?v=4",
"events_url": "https://api.github.com/users/guettli/events{/privacy}",
"followers_url": "https://api.github.com/users/guettli/followers",
"following_url": "https://api.github.com/users/guettli/following{/other_user}",
"gists_url": "https://api.github.com/users/guettli/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/guettli",
"id": 414336,
"login": "guettli",
"node_id": "MDQ6VXNlcjQxNDMzNg==",
"organizations_url": "https://api.github.com/users/guettli/orgs",
"received_events_url": "https://api.github.com/users/guettli/received_events",
"repos_url": "https://api.github.com/users/guettli/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/guettli/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/guettli/subscriptions",
"type": "User",
"url": "https://api.github.com/users/guettli",
"user_view_type": "public"
}
|
[] |
closed
| true
|
{
"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 | 2
|
2013-05-31T11:07:51Z
|
2021-09-09T03:00:28Z
|
2013-06-08T10:12:36Z
|
NONE
|
resolved
|
Please explain in the documentation how you can use the library in non-blocking mode.
If this is not supported, please state this in the documentation.
I think this search should succeed:
http://docs.python-requests.org/en/latest/search/?q=non-blocking
Thank you very much
|
{
"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/1399/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1399/timeline
| null |
completed
| null | null | false
|
[
"Hi there, and thanks for the suggestion!\n\nI think that's a good idea. The short answer is that Requests does not support non-blocking IO with its default transport adapter. You can get very close by using `Response.iter_content()` with a small chunk size, but if your network glitches that will still block. I'll add this information to the docs.\n",
"This should be resolved by #1413: let me know if it isn't. =)\n"
] |
https://api.github.com/repos/psf/requests/issues/1398
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1398/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1398/comments
|
https://api.github.com/repos/psf/requests/issues/1398/events
|
https://github.com/psf/requests/issues/1398
| 14,987,560
|
MDU6SXNzdWUxNDk4NzU2MA==
| 1,398
|
POP request to https via proxy
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/2196038?v=4",
"events_url": "https://api.github.com/users/loukash/events{/privacy}",
"followers_url": "https://api.github.com/users/loukash/followers",
"following_url": "https://api.github.com/users/loukash/following{/other_user}",
"gists_url": "https://api.github.com/users/loukash/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/loukash",
"id": 2196038,
"login": "loukash",
"node_id": "MDQ6VXNlcjIxOTYwMzg=",
"organizations_url": "https://api.github.com/users/loukash/orgs",
"received_events_url": "https://api.github.com/users/loukash/received_events",
"repos_url": "https://api.github.com/users/loukash/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/loukash/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/loukash/subscriptions",
"type": "User",
"url": "https://api.github.com/users/loukash",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 2
|
2013-05-31T10:31:32Z
|
2021-09-09T03:00:32Z
|
2013-05-31T10:55:03Z
|
NONE
|
resolved
|
Hi,
Can I send pop request to https url via proxy?
|
{
"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/1398/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1398/timeline
| null |
completed
| null | null | false
|
[
"Hi there, thanks for raising this issue!\n\nThe answer is 'probably not'. Right now we don't support transparent HTTPS proxying. The only way this could work is if your proxy can terminate HTTPS: that is, if you can establish an HTTP connection to it, and have it establish an HTTPS connection to the far end.\n",
"Thanks.\n"
] |
https://api.github.com/repos/psf/requests/issues/1397
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1397/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1397/comments
|
https://api.github.com/repos/psf/requests/issues/1397/events
|
https://github.com/psf/requests/issues/1397
| 14,955,351
|
MDU6SXNzdWUxNDk1NTM1MQ==
| 1,397
|
bug report
|
{
"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": "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 | 10
|
2013-05-30T18:41:17Z
|
2021-09-09T02:11:37Z
|
2013-08-17T06:35:52Z
|
CONTRIBUTOR
|
resolved
|
Dear Kenneth Reitz,
I use your Requests library which is quite cool. I ran into some issues like httplib uncaught exceptions
which (i think) should be handled by Requests.
## Consider the following code:
import requests
## r = requests.get('http://www.bilhetos.com')
It raises 'httplib.IncompleteRead' exception which is not handled properly in Requests.
Please consider urls below for testing:
http://www.tusseymountaintitans.com
http://www.abbottpanthers.com
http://www.spanishmoms.com
http://www.long-island-storage.com
http://www.cupertinohelpwanted.com
http://www.hoffmanestateshawks.com
http://www.brothermartincrusaders.com
http://www.1-800-printer.com
http://www.impiretickets.com
http://www.gdickinson.com
http://www.forensicsline.com
http://www.gardeningtime.com
http://www.ecollegetennis.com
http://www.milacasaints.com
http://www.bartoninsuranceagency.com
http://www.djnatural.com
http://www.containers2000.com
http://www.indiancreektimberwolves.com
http://www.athenswarriors.com
http://www.logansportcats.com
http://www.osani.com
http://www.xn--sammler-brse-djb.com
http://www.800usahealth.com
http://www.wealth-wise.com
http://www.foothillmustangs.com
http://www.manasquanbigblue.com
http://www.bilhetos.com
http://www.atlantahomesteam.com
http://www.foxcitiessatellite.com
http://www.chargersmail.com
http://www.fighterplace.com
Best regards,
Vladimir Goncharov
|
{
"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/1397/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1397/timeline
| null |
completed
| null | null | false
|
[
"We've seen this before, [here](https://github.com/kennethreitz/requests/issues/844#issuecomment-16488708). The short of it is that the remote server is claiming that the data is chunked, but it isn't.\n",
"@Lukasa Perhaps requests could wrap the exception and display that? `The server specified a chunked Transfer-Encoding response but did not send chunked data.` or something along those lines.\n",
"It's possible. I'd need to reread the httplib code and confirm that we can't raise IncompleteRead for any other reason though.\n",
"We should be able to work around this, I think.\n",
"This is causing issues and is being masked by an SSL error. I'm 90% certain it is the cause of this: https://twitter.com/bkmontgomery/status/351090132004257792\n",
"I don't think I have a good picture in my head of how we can get httplib to do the correct read here, when the server is sending incorrect headers.\n",
"```\n#! /usr/bin/env python\nimport requests\n\n\nsites = [\n \"http://www.tusseymountaintitans.com\",\n \"http://www.abbottpanthers.com\",\n \"http://www.spanishmoms.com\",\n \"http://www.long-island-storage.com\",\n \"http://www.cupertinohelpwanted.com\",\n \"http://www.hoffmanestateshawks.com\",\n \"http://www.brothermartincrusaders.com\",\n \"http://www.1-800-printer.com\",\n \"http://www.impiretickets.com\",\n \"http://www.gdickinson.com\",\n \"http://www.forensicsline.com\",\n \"http://www.gardeningtime.com\",\n \"http://www.ecollegetennis.com\",\n \"http://www.milacasaints.com\",\n \"http://www.bartoninsuranceagency.com\",\n \"http://www.djnatural.com\",\n \"http://www.containers2000.com\",\n \"http://www.indiancreektimberwolves.com\",\n \"http://www.athenswarriors.com\",\n \"http://www.logansportcats.com\",\n \"http://www.osani.com\",\n \"http://www.xn--sammler-brse-djb.com\",\n \"http://www.800usahealth.com\",\n \"http://www.wealth-wise.com\",\n \"http://www.foothillmustangs.com\",\n \"http://www.manasquanbigblue.com\",\n \"http://www.bilhetos.com\",\n \"http://www.atlantahomesteam.com\",\n \"http://www.foxcitiessatellite.com\",\n #\"http://www.chargersmail.com\", commenting because interpreter hangs in here\n \"http://www.fighterplace.com\"\n]\n\n\nif __name__ == \"__main__\":\n print(\"Total sites: %d \" % (len(sites)))\n for index, site in enumerate(sites):\n r = requests.get(site, stream=True)\n print(index, site)\n if 'transfer-encoding' in r.headers:\n print(r.headers['transfer-encoding'], r.headers['Server'], r.headers['X-AspNet-Version'], r.headers[\"x-server\"])\n```\n\n## output\n\n```\n➜ snippets python requests_bug_1397.py\nTotal sites: 30\n(0, 'http://www.tusseymountaintitans.com')\n('chunked', 'Microsoft-IIS/6.0', '2.0.50727', 'sjl06')\n(1, 'http://www.abbottpanthers.com')\n('chunked', 'Microsoft-IIS/6.0', '2.0.50727', 'sjl04')\n(2, 'http://www.spanishmoms.com')\n('chunked', 'Microsoft-IIS/6.0', '2.0.50727', 'sjl04')\n(3, 'http://www.long-island-storage.com')\n('chunked', 'Microsoft-IIS/6.0', '2.0.50727', 'sjl05')\n(4, 'http://www.cupertinohelpwanted.com')\n('chunked', 'Microsoft-IIS/6.0', '2.0.50727', 'sjl05')\n(5, 'http://www.hoffmanestateshawks.com')\n('chunked', 'Microsoft-IIS/6.0', '2.0.50727', 'ash02')\n(6, 'http://www.brothermartincrusaders.com')\n('chunked', 'Microsoft-IIS/6.0', '2.0.50727', 'sjl06')\n(7, 'http://www.1-800-printer.com')\n('chunked', 'Microsoft-IIS/6.0', '2.0.50727', 'ash01')\n(8, 'http://www.impiretickets.com')\n('chunked', 'Microsoft-IIS/6.0', '2.0.50727', 'ash02')\n(9, 'http://www.gdickinson.com')\n('chunked', 'Microsoft-IIS/6.0', '2.0.50727', 'sjl03')\n(10, 'http://www.forensicsline.com')\n('chunked', 'Microsoft-IIS/6.0', '2.0.50727', 'sjl05')\n(11, 'http://www.gardeningtime.com')\n('chunked', 'Microsoft-IIS/6.0', '2.0.50727', 'sjl01')\n(12, 'http://www.ecollegetennis.com')\n('chunked', 'Microsoft-IIS/6.0', '2.0.50727', 'sjl05')\n(13, 'http://www.milacasaints.com')\n('chunked', 'Microsoft-IIS/6.0', '2.0.50727', 'sjl02')\n(14, 'http://www.bartoninsuranceagency.com')\n('chunked', 'Microsoft-IIS/6.0', '2.0.50727', 'ash02')\n(15, 'http://www.djnatural.com')\n('chunked', 'Microsoft-IIS/6.0', '2.0.50727', 'ash05')\n(16, 'http://www.containers2000.com')\n('chunked', 'Microsoft-IIS/6.0', '2.0.50727', 'sjl08')\n(17, 'http://www.indiancreektimberwolves.com')\n('chunked', 'Microsoft-IIS/6.0', '2.0.50727', 'ash05')\n(18, 'http://www.athenswarriors.com')\n('chunked', 'Microsoft-IIS/6.0', '2.0.50727', 'sjl05')\n(19, 'http://www.logansportcats.com')\n('chunked', 'Microsoft-IIS/6.0', '2.0.50727', 'sjl05')\n(20, 'http://www.osani.com')\n('chunked', 'Microsoft-IIS/6.0', '2.0.50727', 'sjl04')\n(21, 'http://www.xn--sammler-brse-djb.com')\n('chunked', 'Microsoft-IIS/6.0', '2.0.50727', 'ash02')\n(22, 'http://www.800usahealth.com')\n('chunked', 'Microsoft-IIS/6.0', '2.0.50727', 'sjl05')\n(23, 'http://www.wealth-wise.com')\n('chunked', 'Microsoft-IIS/6.0', '2.0.50727', 'sjl02')\n(24, 'http://www.foothillmustangs.com')\n('chunked', 'Microsoft-IIS/6.0', '2.0.50727', 'sjl02')\n(25, 'http://www.manasquanbigblue.com')\n('chunked', 'Microsoft-IIS/6.0', '2.0.50727', 'ash05')\n(26, 'http://www.bilhetos.com')\n('chunked', 'Microsoft-IIS/6.0', '2.0.50727', 'sjl05')\n(27, 'http://www.atlantahomesteam.com')\n('chunked', 'Microsoft-IIS/6.0', '2.0.50727', 'sjl03')\n(28, 'http://www.foxcitiessatellite.com')\n('chunked', 'Microsoft-IIS/6.0', '2.0.50727', 'sjl03')\n(29, 'http://www.fighterplace.com')\n```\n\nAll the servers are running `Microsoft-IIS/6.0` & `ASP Version 2.0.5.0727`. Latest version of ASP is 4.0 ([Ref](https://en.wikipedia.org/wiki/ASP.NET)). Similar issue can be found [here](http://forums.iis.net/t/1151766.aspx/1).\n\nI suspect this problem is related to specific ASP.Net version. If we can find a site with same issue with different `ASP` version and `IIS` version worth investigating.\n",
"Interesting! This is some awesome detective work @kracekumar! Does look like a very specific bug here, but I'm still not convinced we can neatly work our way around it.\n",
"So, we can't work around this, at least not on all platforms. Here's the relevant code from httplib in our supported versions of Python 2.X:\n\n``` python\ntry:\n chunk_left = int(line, 16)\nexcept ValueError:\n # close the connection as protocol synchronisation is\n # probably lost\n self.close()\n raise IncompleteRead(''.join(value))\n```\n\nAt the point the exception is raised the connection has been closed. Additionally, the read data is thrown away, so we can't pull it out. Working around this would require patching the standard library or using a forked version of httplib in urllib3.\n\nIt looks like our best shot is actually just to wrap this exception: maybe a `requests.ChunkedEncodingError`?\n",
"Mitigated by #1498.\n"
] |
https://api.github.com/repos/psf/requests/issues/1396
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1396/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1396/comments
|
https://api.github.com/repos/psf/requests/issues/1396/events
|
https://github.com/psf/requests/issues/1396
| 14,944,153
|
MDU6SXNzdWUxNDk0NDE1Mw==
| 1,396
|
`pip install requests` results in installing v0.14.2
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/260553?v=4",
"events_url": "https://api.github.com/users/jeffbyrnes/events{/privacy}",
"followers_url": "https://api.github.com/users/jeffbyrnes/followers",
"following_url": "https://api.github.com/users/jeffbyrnes/following{/other_user}",
"gists_url": "https://api.github.com/users/jeffbyrnes/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/jeffbyrnes",
"id": 260553,
"login": "jeffbyrnes",
"node_id": "MDQ6VXNlcjI2MDU1Mw==",
"organizations_url": "https://api.github.com/users/jeffbyrnes/orgs",
"received_events_url": "https://api.github.com/users/jeffbyrnes/received_events",
"repos_url": "https://api.github.com/users/jeffbyrnes/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/jeffbyrnes/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jeffbyrnes/subscriptions",
"type": "User",
"url": "https://api.github.com/users/jeffbyrnes",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 9
|
2013-05-30T14:49:43Z
|
2021-09-09T03:00:26Z
|
2013-06-10T13:33:14Z
|
NONE
|
resolved
|
While installing [httpie](httpie.org), pip grabs requests as a dependency, and it should be grabbing the most recent version, but instead, I end up with v0.14.2, which is incompatible with httpie. Attempting to install from a mirror has the same result. Installing from source code works without issue, however.
Have Python 2.7.5 installed via Homebrew on OS X 10.8.3
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/260553?v=4",
"events_url": "https://api.github.com/users/jeffbyrnes/events{/privacy}",
"followers_url": "https://api.github.com/users/jeffbyrnes/followers",
"following_url": "https://api.github.com/users/jeffbyrnes/following{/other_user}",
"gists_url": "https://api.github.com/users/jeffbyrnes/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/jeffbyrnes",
"id": 260553,
"login": "jeffbyrnes",
"node_id": "MDQ6VXNlcjI2MDU1Mw==",
"organizations_url": "https://api.github.com/users/jeffbyrnes/orgs",
"received_events_url": "https://api.github.com/users/jeffbyrnes/received_events",
"repos_url": "https://api.github.com/users/jeffbyrnes/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/jeffbyrnes/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jeffbyrnes/subscriptions",
"type": "User",
"url": "https://api.github.com/users/jeffbyrnes",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/1396/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1396/timeline
| null |
completed
| null | null | false
|
[
"Which version of pip?\n",
"pip 1.3.1 from /usr/local/lib/python2.7/site-packages/pip-1.3.1-py2.7.egg (python 2.7)\n",
"I cannot reproduce. Anyone else?\n",
"Nope, not me.\n",
"Are you maybe using a mirror of PyPI instead of pypi.python.org? If so, they could have fallen out of sync with PyPI and be installing the wrong thing. Also are you sure that you're installing a recent version of httpie?\n",
"As far as I know, I'm not using any mirrors. Unless I'm mistaken, you need to explicitly set `pip` to use mirrors, yes? When I opened this, I had installed httpie 0.5.1, just ran `pip install --upgrade httpie` and ended up with 0.6.0, which is current accoring to [PyPI's page for httpie](https://pypi.python.org/pypi/httpie/0.6.0).\n\nIf no one can reproduce, it's likely some kind of config error on my box; I'll poke at it some more on my own.\n",
"You could have the mirror option set in your pip rc file. With that and the fact that b.pypi.python.org is grossly broken, I still think it's possible your using a mirror without realizing it. Can you try specifying with -r where you'd like to install from? If you specify pypi.python.org or crate.io and it still doesn't work, this will be one of the first things I attack after I get internet or find a suitable place to hack. \n",
"Not sure what path I'd use for httpie's requirements file; there doesn't seem to be one I can spot on the PyPI page for the package. However, on a whim, I went ahead & just tried `pip install --upgrade httpie` again, and now it's working like a charm.\n\n@sigmavirus24, I suspect you're right, that I was ending up at a mirror that was out-of-date, and now I'm either pulling from PyPI directly, or that mirror or mirrors have caught up.\n\nGonna close this out, as it appears to have resolved itself independently. Thanks all for your suggestions/help!\n",
"The b mirror I mentioned above was shutdown and redirected to PyPI proper. My best guess is that you were hitting that.\n"
] |
https://api.github.com/repos/psf/requests/issues/1395
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1395/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1395/comments
|
https://api.github.com/repos/psf/requests/issues/1395/events
|
https://github.com/psf/requests/issues/1395
| 14,939,016
|
MDU6SXNzdWUxNDkzOTAxNg==
| 1,395
|
read() takes no keyword arguments
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/418882?v=4",
"events_url": "https://api.github.com/users/doodoori2/events{/privacy}",
"followers_url": "https://api.github.com/users/doodoori2/followers",
"following_url": "https://api.github.com/users/doodoori2/following{/other_user}",
"gists_url": "https://api.github.com/users/doodoori2/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/doodoori2",
"id": 418882,
"login": "doodoori2",
"node_id": "MDQ6VXNlcjQxODg4Mg==",
"organizations_url": "https://api.github.com/users/doodoori2/orgs",
"received_events_url": "https://api.github.com/users/doodoori2/received_events",
"repos_url": "https://api.github.com/users/doodoori2/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/doodoori2/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/doodoori2/subscriptions",
"type": "User",
"url": "https://api.github.com/users/doodoori2",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 5
|
2013-05-30T12:59:27Z
|
2021-09-09T02:11:51Z
|
2013-07-20T15:44:01Z
|
NONE
|
resolved
|
This code works well version 1.2.0
import json
from requests import Response
from cStringIO import StringIO
response = Response()
response.status_code = 400
data = {'error':'some_err'}
response.raw = StringIO(json.dumps(data))
print response.json()
but, doesn't works last version (1.2.3) since version 1.2.1
with this error
Traceback (most recent call last):
File "run.py", line 16, in <module>
print response.json()
File "D:\Python27\Env\requests\lib\site-packages\requests\models.py", line 649, in json
if not self.encoding and len(self.content) > 3:
File "D:\Python27\Env\requests\lib\site-packages\requests\models.py", line 600, in content
self._content = bytes().join(self.iter_content(CONTENT_CHUNK_SIZE)) or bytes()
File "D:\Python27\Env\requests\lib\site-packages\requests\models.py", line 547, in generate
chunk = self.raw.read(chunk_size, decode_content=True)
TypeError: read() takes no keyword arguments
|
{
"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/1395/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1395/timeline
| null |
completed
| null | null | false
|
[
"Hi there! Thanks for raising this issue. =)\n\nThis behaviour was changed by #1299. The change was made to address #1249. Unfortunately, replacing `Response.raw` in this way is not considered part of the public API, so could get broken by minor version updates. We have no plans to avoid passing keyword arguments to `read()`, as we expect to receive urllib3-compatible HTTP response objects.\n\nIf you want to make this work, I recommend using a custom subclass of the StringIO class that quietly drops the keyword arguments, like this:\n\n``` python\nfrom cStringIO import StringIO\n\nclass MyStringIO(StringIO):\n def read(self, amt=None, **kwargs):\n return super(MyStringIO, self).read(amt)\n```\n\n(I haven't tested this code so there may be some small bugs, but the general approach is right).\n",
"I do this in the tests on github3.py. Check tests/utils.py for the fix.\n",
"Thanks for reply =) \n",
"> We have no plans to avoid passing keyword arguments to read(), as we expect to receive urllib3-compatible HTTP response objects.\n\nThe comments [in the code itself](https://github.com/kennethreitz/requests/blob/master/requests/models.py#L540-L550) tell a different story:\n\n``` python\ntry:\n # Special case for urllib3.\n for chunk in self.raw.stream(chunk_size, decode_content=True):\n yield chunk\nexcept AttributeError:\n # Standard file-like object.\n while 1:\n chunk = self.raw.read(chunk_size, decode_content=True)\n if not chunk:\n break\n yield chunk\n```\n\nWhy have code to support a \"standard file-like object\" if they're not supported?\n",
"Hi @lukesneeringer!\n\nIf you bring up the blame on that section of code, you'll notice that I added that comment on the 18th of June, when I proposed pull request #1425, which added urllib3 code that I contributed to that library as part of shazow/urllib3#198 (merged on the 17th of June). The comment you're quoting was made on the 30th of May, more than two weeks before the code in question made it into the library. Previously there was no urllib3 special-case.\n\nHowever, as you rightly point out, now there is. I think we can safely remove the arguments to the `.read()` call now, as we shouldn't be using it with urllib3.\n"
] |
https://api.github.com/repos/psf/requests/issues/1394
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1394/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1394/comments
|
https://api.github.com/repos/psf/requests/issues/1394/events
|
https://github.com/psf/requests/issues/1394
| 14,931,186
|
MDU6SXNzdWUxNDkzMTE4Ng==
| 1,394
|
Support HTTP pipelining
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/284103?v=4",
"events_url": "https://api.github.com/users/Suor/events{/privacy}",
"followers_url": "https://api.github.com/users/Suor/followers",
"following_url": "https://api.github.com/users/Suor/following{/other_user}",
"gists_url": "https://api.github.com/users/Suor/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Suor",
"id": 284103,
"login": "Suor",
"node_id": "MDQ6VXNlcjI4NDEwMw==",
"organizations_url": "https://api.github.com/users/Suor/orgs",
"received_events_url": "https://api.github.com/users/Suor/received_events",
"repos_url": "https://api.github.com/users/Suor/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Suor/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Suor/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Suor",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 3
|
2013-05-30T09:01:51Z
|
2021-09-01T00:11:23Z
|
2013-05-31T08:01:34Z
|
NONE
|
resolved
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4",
"events_url": "https://api.github.com/users/Lukasa/events{/privacy}",
"followers_url": "https://api.github.com/users/Lukasa/followers",
"following_url": "https://api.github.com/users/Lukasa/following{/other_user}",
"gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Lukasa",
"id": 1382556,
"login": "Lukasa",
"node_id": "MDQ6VXNlcjEzODI1NTY=",
"organizations_url": "https://api.github.com/users/Lukasa/orgs",
"received_events_url": "https://api.github.com/users/Lukasa/received_events",
"repos_url": "https://api.github.com/users/Lukasa/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Lukasa",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/1394/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1394/timeline
| null |
completed
| null | null | false
|
[
"Hi there! Thanks for opening this issue.\n\nUnfortunately, Requests is a long way from supporting HTTP pipelining. Our connections are handled by [urllib3](https://github.com/shazow/urllib3), which currently does not support HTTP pipelining. There is an open issue for it (shazow/urllib3#52), but it has not been under active development for some time.\n\nIn the event that shazow/urllib3#52 gets resolved, we might be able to go ahead and support pipelining in Requests. On balance, though, I'd have to say that we're a long way from that unless you're prepared to do the pipelining work in urllib3 yourself. It's not highly likely that someone else will do it in the near future: we've had very little demand for it, and the core devs don't miss it either. =)\n",
"@shazow and I have explored adding this several times. Every time, our conclusion is that it's simply too much work with little performance benefit.\n\nWaiting for SPDY now :)\n",
"what about this? https://gist.github.com/coady/f9e1be438ba8551dabad"
] |
|
https://api.github.com/repos/psf/requests/issues/1393
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1393/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1393/comments
|
https://api.github.com/repos/psf/requests/issues/1393/events
|
https://github.com/psf/requests/issues/1393
| 14,910,796
|
MDU6SXNzdWUxNDkxMDc5Ng==
| 1,393
|
Default timeout with retries
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/651797?v=4",
"events_url": "https://api.github.com/users/foxx/events{/privacy}",
"followers_url": "https://api.github.com/users/foxx/followers",
"following_url": "https://api.github.com/users/foxx/following{/other_user}",
"gists_url": "https://api.github.com/users/foxx/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/foxx",
"id": 651797,
"login": "foxx",
"node_id": "MDQ6VXNlcjY1MTc5Nw==",
"organizations_url": "https://api.github.com/users/foxx/orgs",
"received_events_url": "https://api.github.com/users/foxx/received_events",
"repos_url": "https://api.github.com/users/foxx/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/foxx/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/foxx/subscriptions",
"type": "User",
"url": "https://api.github.com/users/foxx",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 3
|
2013-05-29T20:32:22Z
|
2021-09-09T03:00:32Z
|
2013-05-29T20:46:15Z
|
NONE
|
resolved
|
At the moment if I specify a timeout on a request, it does not attempt to retry.
It would be nice to be able to specify a default timeout that adhered to the default retry.
Here is the workaround I used for now;
```
requests.adapters.DEFAULT_RETRIES = 3
def fetch_page(url, timeout=3):
c = 0
last_exc = None
while True:
if c >= requests.adapters.DEFAULT_RETRIES:
raise last_exc[0], last_exc[1], last_exc[2]
try:
return requests.get(url, timeout=timeout)
except requests.Timeout, e:
c+=1
last_exc = sys.exc_info()
logging.info("request timeout, retrying.. (%s/%s)" % ( c,
requests.adapters.DEFAULT_RETRIES))
except Exception, e:
raise
```
|
{
"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/1393/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1393/timeline
| null |
completed
| null | null | false
|
[
"The intended API for retries is to use a different transport adapter:\n\n``` python\nimport requests\nfrom requests.adapters import HTTPAdapter\n\ns = requests.Session()\ns.mount('http://', HTTPAdapter(max_retries=3))\ns.mount('https://', HTTPAdapter(max_retries=3))\n```\n\nYou can then set the timeout on each request and this should work.\n\nDoes this look like what you want?\n",
"Ah that makes sense.. I couldn't figure this out from the docs, so perhaps the docs could be improved.. Although I'm not too sure how it would be explained\n\nThanks for the quick reply!\n",
"I'll have a think about how best to document this, but I might just end up writing a blog post about it and calling it a day.\n\nThanks for opening the issue, let me know if you need anything else! =)\n"
] |
https://api.github.com/repos/psf/requests/issues/1392
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1392/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1392/comments
|
https://api.github.com/repos/psf/requests/issues/1392/events
|
https://github.com/psf/requests/pull/1392
| 14,882,103
|
MDExOlB1bGxSZXF1ZXN0NTk4NjI4NA==
| 1,392
|
Update quickstart.rst
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/124937?v=4",
"events_url": "https://api.github.com/users/revolunet/events{/privacy}",
"followers_url": "https://api.github.com/users/revolunet/followers",
"following_url": "https://api.github.com/users/revolunet/following{/other_user}",
"gists_url": "https://api.github.com/users/revolunet/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/revolunet",
"id": 124937,
"login": "revolunet",
"node_id": "MDQ6VXNlcjEyNDkzNw==",
"organizations_url": "https://api.github.com/users/revolunet/orgs",
"received_events_url": "https://api.github.com/users/revolunet/received_events",
"repos_url": "https://api.github.com/users/revolunet/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/revolunet/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/revolunet/subscriptions",
"type": "User",
"url": "https://api.github.com/users/revolunet",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 1
|
2013-05-29T09:58:00Z
|
2021-09-08T23:08:24Z
|
2013-06-08T10:16:21Z
|
CONTRIBUTOR
|
resolved
|
rephrase misleading info about `raise_for_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"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/1392/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1392/timeline
| null | null | false
|
{
"diff_url": "https://github.com/psf/requests/pull/1392.diff",
"html_url": "https://github.com/psf/requests/pull/1392",
"merged_at": "2013-06-08T10:16:21Z",
"patch_url": "https://github.com/psf/requests/pull/1392.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/1392"
}
| true
|
[
"These build failures have nothing to do with you. This PR looks good, I'm :+1:.\n"
] |
https://api.github.com/repos/psf/requests/issues/1391
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1391/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1391/comments
|
https://api.github.com/repos/psf/requests/issues/1391/events
|
https://github.com/psf/requests/pull/1391
| 14,879,940
|
MDExOlB1bGxSZXF1ZXN0NTk4NTE0MQ==
| 1,391
|
Update quickstart.rst
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/124937?v=4",
"events_url": "https://api.github.com/users/revolunet/events{/privacy}",
"followers_url": "https://api.github.com/users/revolunet/followers",
"following_url": "https://api.github.com/users/revolunet/following{/other_user}",
"gists_url": "https://api.github.com/users/revolunet/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/revolunet",
"id": 124937,
"login": "revolunet",
"node_id": "MDQ6VXNlcjEyNDkzNw==",
"organizations_url": "https://api.github.com/users/revolunet/orgs",
"received_events_url": "https://api.github.com/users/revolunet/received_events",
"repos_url": "https://api.github.com/users/revolunet/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/revolunet/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/revolunet/subscriptions",
"type": "User",
"url": "https://api.github.com/users/revolunet",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 2
|
2013-05-29T09:01:32Z
|
2021-09-08T20:01:24Z
|
2013-05-29T09:56:47Z
|
CONTRIBUTOR
|
resolved
|
fix misleading info about raise_for_status method
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/124937?v=4",
"events_url": "https://api.github.com/users/revolunet/events{/privacy}",
"followers_url": "https://api.github.com/users/revolunet/followers",
"following_url": "https://api.github.com/users/revolunet/following{/other_user}",
"gists_url": "https://api.github.com/users/revolunet/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/revolunet",
"id": 124937,
"login": "revolunet",
"node_id": "MDQ6VXNlcjEyNDkzNw==",
"organizations_url": "https://api.github.com/users/revolunet/orgs",
"received_events_url": "https://api.github.com/users/revolunet/received_events",
"repos_url": "https://api.github.com/users/revolunet/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/revolunet/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/revolunet/subscriptions",
"type": "User",
"url": "https://api.github.com/users/revolunet",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/1391/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1391/timeline
| null | null | false
|
{
"diff_url": "https://github.com/psf/requests/pull/1391.diff",
"html_url": "https://github.com/psf/requests/pull/1391",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/1391.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/1391"
}
| true
|
[
"Hi @revolunet, thanks for the fix!\n\nCan I suggest that, instead of using the phrase \"status between 400 and 600\", you use the phrase \"a 4XX client error or 5XX server error response\"? It makes it clearer that these errors are categories, not a continuum of numbers.\n",
"thanks @Lukasa you're perfectly right. i'll close this one and issue another PR\n"
] |
https://api.github.com/repos/psf/requests/issues/1390
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1390/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1390/comments
|
https://api.github.com/repos/psf/requests/issues/1390/events
|
https://github.com/psf/requests/issues/1390
| 14,775,294
|
MDU6SXNzdWUxNDc3NTI5NA==
| 1,390
|
Async mode seems to have disappeared
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/234019?v=4",
"events_url": "https://api.github.com/users/kevinburke/events{/privacy}",
"followers_url": "https://api.github.com/users/kevinburke/followers",
"following_url": "https://api.github.com/users/kevinburke/following{/other_user}",
"gists_url": "https://api.github.com/users/kevinburke/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/kevinburke",
"id": 234019,
"login": "kevinburke",
"node_id": "MDQ6VXNlcjIzNDAxOQ==",
"organizations_url": "https://api.github.com/users/kevinburke/orgs",
"received_events_url": "https://api.github.com/users/kevinburke/received_events",
"repos_url": "https://api.github.com/users/kevinburke/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/kevinburke/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/kevinburke/subscriptions",
"type": "User",
"url": "https://api.github.com/users/kevinburke",
"user_view_type": "public"
}
|
[
{
"color": "e102d8",
"default": false,
"description": null,
"id": 117745,
"name": "Planned",
"node_id": "MDU6TGFiZWwxMTc3NDU=",
"url": "https://api.github.com/repos/psf/requests/labels/Planned"
}
] |
closed
| false
| null |
[] |
{
"closed_at": null,
"closed_issues": 29,
"created_at": "2024-05-19T18:29:04Z",
"creator": {
"avatar_url": "https://avatars.githubusercontent.com/u/18519037?v=4",
"events_url": "https://api.github.com/users/sethmlarson/events{/privacy}",
"followers_url": "https://api.github.com/users/sethmlarson/followers",
"following_url": "https://api.github.com/users/sethmlarson/following{/other_user}",
"gists_url": "https://api.github.com/users/sethmlarson/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/sethmlarson",
"id": 18519037,
"login": "sethmlarson",
"node_id": "MDQ6VXNlcjE4NTE5MDM3",
"organizations_url": "https://api.github.com/users/sethmlarson/orgs",
"received_events_url": "https://api.github.com/users/sethmlarson/received_events",
"repos_url": "https://api.github.com/users/sethmlarson/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/sethmlarson/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/sethmlarson/subscriptions",
"type": "User",
"url": "https://api.github.com/users/sethmlarson",
"user_view_type": "public"
},
"description": "",
"due_on": null,
"html_url": "https://github.com/psf/requests/milestone/34",
"id": 11073254,
"labels_url": "https://api.github.com/repos/psf/requests/milestones/34/labels",
"node_id": "MI_kwDOABTKOs4AqPbm",
"number": 34,
"open_issues": 0,
"state": "open",
"title": "Bankruptcy",
"updated_at": "2024-05-20T14:37:16Z",
"url": "https://api.github.com/repos/psf/requests/milestones/34"
}
| 46
|
2013-05-26T21:10:52Z
|
2024-05-20T14:36:04Z
|
2024-05-20T14:36:04Z
|
CONTRIBUTOR
| null |
Hey,
I'm trying to find some kind of documentation about how to issue multiple concurrent HTTP requests using this library, but all the Googling and searching I'm doing points to outdated versions of this library. Is there a chance you can add back the docs? Even if they just mention the features are deprecated and point users in the correct location, it's probably useful.
Best,
Kevin
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/18519037?v=4",
"events_url": "https://api.github.com/users/sethmlarson/events{/privacy}",
"followers_url": "https://api.github.com/users/sethmlarson/followers",
"following_url": "https://api.github.com/users/sethmlarson/following{/other_user}",
"gists_url": "https://api.github.com/users/sethmlarson/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/sethmlarson",
"id": 18519037,
"login": "sethmlarson",
"node_id": "MDQ6VXNlcjE4NTE5MDM3",
"organizations_url": "https://api.github.com/users/sethmlarson/orgs",
"received_events_url": "https://api.github.com/users/sethmlarson/received_events",
"repos_url": "https://api.github.com/users/sethmlarson/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/sethmlarson/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/sethmlarson/subscriptions",
"type": "User",
"url": "https://api.github.com/users/sethmlarson",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/1390/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1390/timeline
| null |
completed
| null | null | false
|
[
"Hi Kevin, thanks for raising this issue!\n\nI'd have to say that [grequests](https://github.com/kennethreitz/grequests) is likely to be the right way to go about this. It might be worth grequests to the documentation, in fact. I'll have a think about it. =)\n",
"There is also https://pypi.python.org/pypi/requests-futures/. I haven't used it, so no promises.\n",
"Sure... the grequests documentation is fairly lacking though, https://github.com/kennethreitz/grequests\n\nI keep getting an error using grequests with requests version 1.2.2, I'll raise an issue on the other repo.\n",
"I'm adding this to my list of documentation changes I'd like to make.\n",
"I've added mentions of grequests and requests-futures to the documentation in #1413. Let me know if this is not sufficient. =)\n",
"Is there any desire from the community to have async support added to requests? It's something I am looking for an would be willing to contribute back\n",
"We have some unofficial plans to unveil something around async within the next year, @Lukasa and I were discussing this at PyCon.\n\nIt's something that will take some time and a lot of energy to introduce, and would no longer be a \"tacked on\" bit of functionality like the original \"requests.async\" (now known as \"grequests\") was. \n",
"I added some comments here, which I will re-iterate: https://github.com/kennethreitz/requests/issues/1390#issuecomment-224797206\n\n---\n\nWe have some unofficial plans to unveil something around async within the next year, @Lukasa and I were discussing this at PyCon.\n\nIt's something that will take some time and a lot of energy to introduce, and would no longer be a \"tacked on\" bit of functionality like the original \"requests.async\" (now known as \"grequests\") was.\n",
"@kennethreitz @Lukasa It's something that I seriously need so am happy to contribute. Would you be willing to take help contributing to it? I am CTO of my company and have been using python for years.\n",
"Also depends on the type of help you want, don't mind taking a back seat on the design if that's a concern\n",
"So, the problem with having an async mode is that we need to decide _how_ to have the async mode. _In principle_ the way to do that is coroutine based, but _in practice_ asyncio coroutines are not quite compatible with non-asyncio event loops at this time (specifically, Twisted).\n\nHowever, they are very, very close. There's some work going on to achieve the remaining bit of standardisation we need. If we can pull that off upstream then we can look very hard at having a requests that is async-first.\n",
"@Lukasa I seem to recall it sounding like defereds (perhaps with a slight (upcoming) alteration) would be the best implementation approach for us?\n",
"@kennethreitz The answer to that is _maybe_. The problem with using Deferreds is that Deferreds don't make things magically async: they're literally just fancy callback containers. We can almost certainly _use_ Deferreds to build an abstraction layer on top of multiple concurrency models if that's a route we want to go.\n\nThis is a problem that really needs to be approached _very_ carefully, because as long as Python 2.7 is around we cannot unconditionally expect that the standard library will have an event loop inside it that we can use. That represents a concern: we need a way to execute _without_ an event loop. This is why Deferreds are attractive: they can execute in just such a manner because they're _literally_ just callback holders.\n\nSo one approach here would be to write an entirely callback-based HTTP/1.1 + HTTP/2 client library that uses Deferreds (probably on top of @njsmith's [h11](https://github.com/njsmith/h11) and @python-hyper's [h2](https://github.com/python-hyper/h2)).\n\nWe could then try to think about how we can integrate that into the various different event loops, though again, I'm not 100% certain of how we'd do that best. _Probably_ we'd have to write (sigh) an event-loop abstraction layer that basically defines certain functions as returning deferreds (\"data_from_network\"), and that then plugs into the relevant event loops. In practice, though I've said \"event loops\", we really only need two implementations to get started: one that implements the Twisted/asyncio \"protocol\" notion, and one that is synchronous and blocking (so that we continue to work in the absence of an event loop). In fact, we could even just start with the second one.\n\nThis is one of those things that it'd be really interesting to get someone like @glyph to weigh in on, in part because @glyph is strongly incentivised to help us get this right (no more treq!) and in part because he's a lot smarter than me. Certainly, however, I'd love to have a version of requests that you can either use synchronously in its current form without noticing the difference _or_ that you can use on top of ${EVENT_LOOP}. Requests provides enough goodness that we should really reimplement as little of it as possible on different platforms.\n",
"Oh, and @shazow, this is something you might care about too, in part because we might be able to make urllib3 do most of the heavy lifting here.\n",
"One of urllib3 v2.0 wishlist items is async by default (without py2 support).\n",
"@Lukasa @kennethreitz Guess the question is exactly what to support. In a ideal world it would be a universal design that's elegant to support both, in practice if you wanted to support both a event loop model and a twisted model, then maybe it would be better to support two models one for each. Alternatively I think a lot of people are using (Gevent/Asyncio/Trollius) so maybe work on a implementation that supports that then see how the model can be altered to include twisted?\n\nAbove you mention \"In practice, though I've said \"event loops\", we really only need two implementations to get started: one that implements the Twisted/asyncio \"protocol\" notion, and one that is synchronous and blocking (so that we continue to work in the absence of an event loop)\"\n\nMy initial thoughts are is there a reason to majorly reimplement or alter the existing requests library aka (\"one that is synchronous and blocking\") and just maybe cleanly refactor things under the hood so the can be shared between the \"synchronous\" implementation and the \"async\" implementation? Or is there a motivating factor beyond that I am not aware of?\n\n@smorin \n",
"Async without py2 support might be a good option for Requests too — would help push the community forward, a bit. We shouldn't do it purely for political reasons, but if it would make the implementation a lot cleaner, I think that could be a feature, not a bug. \n",
"@smorin the idea is that async is going to be a lot more important in the future than it is now (as is most likely should be, especially for io-bound tasks), and Requests both wants to stay ahead for the long-term future and help people build better software.\n\nNothing would change about the current API, except it may be secretly powered by the new asynchronous methods under the hood, just in a blocking fashion. \n",
"> My initial thoughts are is there a reason to majorly reimplement or alter the existing requests library aka (\"one that is synchronous and blocking\") and just maybe cleanly refactor things under the hood so the can be shared between the \"synchronous\" implementation and the \"async\" implementation\n\nWell, we don't _have_ to: we can do async without it by just always deferring to threads, but that's kinda gross and sad for various different reasons and is also rarely what people _actually_ want.\n\nIf we want to do _actual_ async then at a certain point the code _has_ to diverge. Right now the baseline code YOLOs bytes into and out of sockets like nobody's business: that's fine, but it doesn't work _at all_ if you throw it into an asyncio codebase, and the only way to make it work is source level changes. The net result is that you can't support _both_ an event loop _and_ a non-blocking model in the same source code: while you can retrofit a synchronous API on top of an event loop, it still _requires_ the event loop, which Python 2.7 doesn't give us, and requests' \"no external dependencies\" model makes tricky for us to provide.\n\n> Async without py2 support might be a good option for Requests too — would help push the community forward, a bit. We shouldn't do it purely for political reasons, but if it would make the implementation a lot cleaner, I think that could be a feature, not a bug.\n\nThat is _substantially_ easier. At that point, we can say that the asyncio event loop is the standard event loop to which we need to program. We can assert that it will always be possible to `import asyncio`, which means we can rely on having the event loop and relevant primitives in place. At that point Deferreds aren't necessary either: the synchronous APIs basically just look like this (with namespacing, obviously):\n\n``` python\ndef get(*args, **kwargs):\n return asyncio.run_until_complete(async_get(*args, **kwargs))\n```\n",
"It's quite possible that we shouldn't/won't do this at all, given the other priorities of the project. This is definitely evaluation phase :)\n",
"One use-case I have actually is requests-async to be used in AWS Lambda under Python 2.7, but would be okay using Trollius for that which is basically equivalent to Asyncio anyway. So the underlying async implementation can be py3 primary with a py2 solution being a `import trollius as asyncio` but would simplify the implementation.\n",
"> One use-case I have actually is requests-async to be used in AWS Lambda under Python 2.7, but would be okay using Trollius for that which is basically equivalent to Asyncio anyway.\n\nWell........not quite.\n\nYou see, a Python 3-only codebase will feel free to use `yield from`, which you cannot use with Trollius in Python 2 because it's literally a syntax error. So if that's a use-case we were going for we'd need to be somewhat careful.\n",
"Good call\n",
"Just wanted to let y'all know that I saw the mention, and I am digesting the thread; it may be a couple of days before I'm caught up enough on PyCon to reply, but I am definitely interested in this :).\n",
"It's at least an interesting exercise to try and imagine what the core of requests would look like if written in the style of h2/h11. Even if in the end it turns out to not be the best approach -- it's certainly more complex than any of the existing examples, so I guess we'd at least learn something :-). (And hey @Lukasa, what's this backsliding to concrete I/O APIs as soon as the problem gets more complicated? ;-))\n\nWildly sketching, since I have no idea how the internals of requests actually look in any kind of detail: I guess the basic I/O operations that requests needs to do are to request a connection (possibly with TLS and possibly with its own hacks to the TLS handshake logic), to do reads and writes on a connection, maybe to set socket options, and to close a connection. And while in h2/h11 the basic state object is a Connection that manages a single socket, for requests it would be a Session that manages a socket pool.\n\nAnd we'd want to make it possible to wrap this in different APIs like:\n- `blocking_session.get(...)` -> returns a `BlockingResponse`\n- `await coroutine_session.get(...)` -> returns a `CoroutineResponse`\n- `twisted_session.get(...)` -> returns a `Deferred` that when fired returns a `TwistedResponse`\n\n(the different response classes would differ in the API they exposed for streaming reads of the response body)\n\nSince the user is going to be calling methods on individual response wrapper objects, probably we want to let each of these wrappers handle the I/O coupling for each connection. So maybe the API would look something like this:\n\n```\nclass BlockingSession:\n def __init__(self, ...):\n self._byoio_session = BYOIOSession(...)\n\n def get(self, ...):\n byoio_response = self._byoio_session.get(...)\n return BlockingResponse(byoio_response)\n\n def close(self):\n self._byoio_session.close()\n for todo_item in self._byoio_session.io_to_do():\n _do_io(todo_item)\n\nclass BlockingResponse:\n def __init__(self, byoio_response):\n self._byoio_response = byoio_response\n # Handle whatever I/O is needed to initiate the request\n self._do_io()\n\n @property\n def status_code(self):\n while not self._byoio_response.got_headers:\n self._do_io()\n return self._byoio_response.status_code\n\n def _do_io(self):\n for todo_item in self._byoio_response.io_to_do():\n _do_io(todo_item)\n\n # ...\n\ndef _do_io(todo_item):\n if type(todo) is MakeConnection:\n try:\n sock = socket.create_connection(todo.address, timeout=todo.timeout)\n except TimeoutError:\n todo.connect_timed_out()\n else:\n # Argument passed here is an opaque (to the BYOI/O layer) object\n # that acts as a handle to the socket. Life cycle: passed in to connect_succeeded,\n # passed back out with SendData or RecvData todo items and eventually will get\n # passed back out in a CloseConnection todo item. (But that might happen in a\n # different response object entirely or at session close.)\n todo.connect_succeeded(sock)\n elif type(todo) is SendData:\n sock = todo.socket_handle\n sock.sendall(todo.data, timeout=timeout)\n # ...\n\n```\n\nI dunno, maybe this is only interesting to me :-). Certainly it would be a lot of work, but the result might be rather nice...\n",
"Heh @njsmith, this is a problem because you don't know what Requests looks like internally. =)\n\nThe internals of Requests itself already _are_ very, very close to the design of h2/h11: that is, they almost entirely twiddle data around in in-memory objects. Unlike in aiohttp where it seems like every single function/class in the library touches or handles I/O in some way, the vast majority of requests is function calls.\n\nThe functions that either directly or transitively do I/O or that would need to be adjusted in some way are the following:\n- `requests.api.*`: all of these transitively wrap `Session.request`.\n- `requests.sessions.Session.request`: this transitively calls `Session.send`, which actually does do I/O\n- `requests.sessions.SessionRedirectMixin.resolve_redirects`: this both reads and writes (using `Session.send`), and so is clearly an I/O based function, but mostly just uses the primitives we'd have to work out at the lower level.\n- `requests.sessions.Session.send`: This is the _only_ top-level requests function that actually does I/O (excepting file reads/writes which don't count because Unix).\n `requests.adapters.HTTPAdapter.send`: This does the bulk of the low-level I/O, though it calls one helper function it defines on itself that is I/O-adjacent, namely...\n- `requests.adapters.HTTPAdapter.get_connection`: This obtains a connection object from urllib3's connection pool. This is going to be different in concurrent and synchronous modes because the way we wait for connections to show up will be different.\n\nIn this case, for requests, I'd ideally like to touch _only_ those functions. That ensures that the rest of Requests goes on functioning exactly as it does today. This reduces the churn in Requests and reduces the odds of us introducing bugs in terrible places.\n\nFrom my perspective, the easiest way to do this is to just write `@asyncio.coroutine` on top of all of them and throw some `yield from`s in there, then wrap it all in `asyncio.run_until_complete` if people want to use the blocking APIs.\n\nHowever, if we decide we need a separate blocking backend this _all_ gets way harder. In that kind of model, your approach may work slightly better, because it may be quite painful (and indeed impossible?) to use `Deferred`s in such a way that the top-level user of requests doesn't have to think about them in synchronous code. In that kind of model, we actually do need to write things quite differently, and at _that_ point I'm willing to discuss tearing the whole library apart to rebuild it.\n\nOtherwise, I'm extremely reluctant to do a big rewrite: there's just no way that we'll persist all the useful functionality that the library provides in its current form. =(\n",
"I don't think I understand what you have in mind when you talk about only touching those functions. Even if we narrow the scope strictly to asyncio, then that still intrinsically requires touching almost every public API function (for asyncio users `Session.get` becomes a coroutine, `Response.iter_chunked` becomes an async iterator, ...), so somehow one has to thread that change down from the API level to the low level functions you mention, right? Or do you mean that just sprinkling `yield from` everywhere doesn't really count as \"touching\" them?\n\nAnother thought: if you're able to use `yield from` (which would require dropping 2.6 unfortunately, but since you mentioned it...), then that doesn't necessarily have to be tied to asyncio. It shouldn't be too hard to write your own coroutine runner that exposes an h2 style API to the outside. (Very roughly it could look like the API thing I sketched, where the leaf coroutines yield those \"io to-do objects\" and then someone on the outside either services them synchronously or hands them off to some event loop.)\n",
"If we drop Python 2 support then being tied to asyncio isn't any more of a problem than being tied to httplib is today; its there, it's the de facto event loop abstraction, and it covers the primary use case. \n\nAs far as I can tell the biggest advantage of moving to the model you proposed is that it's relatively extensible to systems that don't maintain the semantics of asyncio (e.g. curio). That's somewhat valuable, but I'm not sure it's worth it to drastically tear up the code. \n\nWith that said, we should consider both options. We're so early on right now that there is literally no reason to decide on one over the other: I remain open to doing whatever provides the best API to all Requests users. \n",
"Ah, right, I'm assuming that requests dropping support for python 2 is still like... 3-5 years away (is that wrong?), so the primary advantage of the model I was talking about is that it would allow a single codebase to simultaneously support a non-blocking api and a py2 with blocking io and no external dependencies api. (Plus it would be easier to test ;-))\n\nCertainly it would be nice to have non-blocking support in the \"real\" requests codebase in less than 3-5 years (and also a pony).\n",
"> Ah, right, I'm assuming that requests dropping support for python 2 is still like... 3-5 years away (is that wrong?)\n\nHeh, that's part of what this issue is about. =D\n\nI think this whole issue is going to be part of my list of \"things I want to deal with in the next year\". It's my genuine belief that Requests needs its own async story. Right now I'm mostly interested in soliciting opinions about how we could do it (which is why I also tagged @glyph and @shazow).\n\nHowever, from my perspective, all options @kennethreitz will entertain are on the table. If @kennethreitz is willing to consider dropping Python 2 support at some time soon, I'm willing to consider that approach, even if we don't end up doing it. \n"
] |
https://api.github.com/repos/psf/requests/issues/1389
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1389/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1389/comments
|
https://api.github.com/repos/psf/requests/issues/1389/events
|
https://github.com/psf/requests/issues/1389
| 14,764,174
|
MDU6SXNzdWUxNDc2NDE3NA==
| 1,389
|
SSL certificate error with python requests module while sending GCM messages
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/3115401?v=4",
"events_url": "https://api.github.com/users/lovesh/events{/privacy}",
"followers_url": "https://api.github.com/users/lovesh/followers",
"following_url": "https://api.github.com/users/lovesh/following{/other_user}",
"gists_url": "https://api.github.com/users/lovesh/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/lovesh",
"id": 3115401,
"login": "lovesh",
"node_id": "MDQ6VXNlcjMxMTU0MDE=",
"organizations_url": "https://api.github.com/users/lovesh/orgs",
"received_events_url": "https://api.github.com/users/lovesh/received_events",
"repos_url": "https://api.github.com/users/lovesh/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/lovesh/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/lovesh/subscriptions",
"type": "User",
"url": "https://api.github.com/users/lovesh",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 9
|
2013-05-25T23:24:02Z
|
2021-09-09T03:00:28Z
|
2013-06-08T08:22:50Z
|
NONE
|
resolved
|
I am using python requests module to send GCM(Google Cloud Messages) messages. I am sending millions of messages in a day. But sometimes this weird error pops up
The GCM url is https://android.googleapis.com/gcm/send
`[Errno 185090050] _ssl.c:340: error:0B084002:x509 certificate routines:X509_load_cert_crl_file:system lib`
This generally happens when i am sending a lot of messages.
Have a look at this post too http://stackoverflow.com/questions/16699736/ssl-certificate-error-with-python-requests-module-while-sending-gcm-messages
|
{
"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/1389/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1389/timeline
| null |
completed
| null | null | false
|
[
"As there are a lot of moving parts, we need some additional information:\n- Could you give a complete stacktrace?\n- Which version of Python?\n- Which version of requests?\n- Which operating system?\n",
"I am unable to generate the stacktrace right now but the rest of the details are here \n\nPython version 2.7.3\nRequests version 1.2.0\nOS Ubuntu 12.04\nMachine AWS EC2\n",
"This is the stacktrace\n\nError in sys.excepthook:\nTraceback (most recent call last):\n File \"/usr/lib/python2.7/dist-packages/apport_python_hook.py\", line 66, in apport_excepthook\n from apport.fileutils import likely_packaged, get_recent_crashes\n File \"/usr/lib/python2.7/dist-packages/apport/**init**.py\", line 1, in <module>\n from apport.report import Report\n File \"/usr/lib/python2.7/dist-packages/apport/report.py\", line 12, in <module>\n import subprocess, tempfile, os.path, urllib, re, pwd, grp, os\nImportError: No module named subprocess\n\nOriginal exception was:\nTraceback (most recent call last):\n File \"<stdin>\", line 1, in <module>\n File \"send_message.py\", line 522, in mongo_send_new\n resp = gcm_multi.send()\n File \"gcm.py\", line 20, in send\n response = requests.post(self.gcm_url, headers=self.headers, data=self.data)\n File \"/usr/local/lib/python2.7/dist-packages/requests/api.py\", line 88, in post\n return request('post', url, data=data, *_kwargs)\n File \"/usr/local/lib/python2.7/dist-packages/requests/api.py\", line 44, in request\n return session.request(method=method, url=url, *_kwargs)\n File \"/usr/local/lib/python2.7/dist-packages/requests/sessions.py\", line 354, in request\n resp = self.send(prep, *_send_kwargs)\n File \"/usr/local/lib/python2.7/dist-packages/requests/sessions.py\", line 460, in send\n r = adapter.send(request, *_kwargs)\n File \"/usr/local/lib/python2.7/dist-packages/requests/adapters.py\", line 250, in send\n raise SSLError(e)\nrequests.exceptions.SSLError: [Errno 185090050] _ssl.c:340: error:0B084002:x509 certificate routines:X509_load_cert_crl_file:system lib\n",
"This error normally means that certificates haven't been loaded properly. I find that a bit odd, though, because it's being thrown out of urllib3, not from our internal certificate verifying code.\n",
"I would like to tell you the behavior of this error. Say i am making 10000 HTTPS requests and i am able to make 5000 successfully now when this exception comes i catch this and proceed with the next request but even the subsequent requests also throw this exception. Then i have to stop the process and start it again and after some time this exception starts coming back.\nIs there some way i can get around this?\n",
"Looking at `response = requests.post(self.gcm_url, headers=self.headers, data=self.data)` you are not using a persistent session. Regarding the fact, that you are sending 10000s of messages to the same host you should use a session.\nThis may not solve the problem itself but you shouldn't run into it anymore as the cert is only loaded a few time (as often as a new connection is added to the underlying connectionpool).\n",
"@lovesh Does using a `Session` resolve your problem?\n",
"Yes it does.\nThanks\n\nOn Sat, Jun 8, 2013 at 1:35 PM, Cory Benfield notifications@github.comwrote:\n\n> @lovesh https://github.com/lovesh Does using a Session resolve your\n> problem?\n> \n> —\n> Reply to this email directly or view it on GitHubhttps://github.com/kennethreitz/requests/issues/1389#issuecomment-19145022\n> .\n\n## \n\nThanks for your time\n",
"Brilliant! Let us know if you have any further problems. =)\n"
] |
https://api.github.com/repos/psf/requests/issues/1388
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1388/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1388/comments
|
https://api.github.com/repos/psf/requests/issues/1388/events
|
https://github.com/psf/requests/issues/1388
| 14,753,470
|
MDU6SXNzdWUxNDc1MzQ3MA==
| 1,388
|
Broken tarballs of requests-1.2.1 and requests-1.2.2 on PyPI
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/656294?v=4",
"events_url": "https://api.github.com/users/Arfrever/events{/privacy}",
"followers_url": "https://api.github.com/users/Arfrever/followers",
"following_url": "https://api.github.com/users/Arfrever/following{/other_user}",
"gists_url": "https://api.github.com/users/Arfrever/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Arfrever",
"id": 656294,
"login": "Arfrever",
"node_id": "MDQ6VXNlcjY1NjI5NA==",
"organizations_url": "https://api.github.com/users/Arfrever/orgs",
"received_events_url": "https://api.github.com/users/Arfrever/received_events",
"repos_url": "https://api.github.com/users/Arfrever/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Arfrever/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Arfrever/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Arfrever",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 6
|
2013-05-25T06:59:41Z
|
2021-09-09T03:00:34Z
|
2013-05-25T16:48:44Z
|
NONE
|
resolved
|
Tarballs of last 2 releases of requests on PyPI are broken:
https://pypi.python.org/packages/source/r/requests/requests-1.2.1.tar.gz
https://pypi.python.org/packages/source/r/requests/requests-1.2.2.tar.gz
They contain test_requests.py incompatible with Python 3 (in test_content_length_override function).
This function is absent in test_requests.py in tags in repository:
https://github.com/kennethreitz/requests/blob/v1.2.1/test_requests.py
https://github.com/kennethreitz/requests/blob/v1.2.2/test_requests.py
Difference between 1.2.2 tag and 1.2.2 tarball:
```
--- 1.2.2-tag/requests/models.py
+++ 1.2.2-tarball/requests/models.py
@@ -399,7 +399,13 @@
self.body = body
- def prepare_content_length(self, body):
+ def prepare_content_length(self, body, force=False):
+
+ # Skip this if it's already set, you crazy crazy person.
+ if 'Content-Length' in self.headers:
+ if not force:
+ return
+
if hasattr(body, 'seek') and hasattr(body, 'tell'):
body.seek(0, 2)
self.headers['Content-Length'] = str(body.tell())
@@ -431,7 +437,7 @@
self.__dict__.update(r.__dict__)
# Recompute Content-Length
- self.prepare_content_length(self.body)
+ self.prepare_content_length(self.body, force=True)
def prepare_cookies(self, cookies):
"""Prepares the given HTTP cookie data."""
--- 1.2.2-tag/test_requests.py
+++ 1.2.2-tarball/test_requests.py
@@ -702,5 +702,10 @@
self.assertEqual(frozenset(cid), keyset)
+ def test_content_length_override(self):
+ r = requests.Request('POST', httpbin('post'), data='ohai', headers={'f-length': 1})
+ print r.prepare().headers
+
+
if __name__ == '__main__':
unittest.main()
```
I suggest to create correct tarballs and re-upload them to PyPI
|
{
"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/1388/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1388/timeline
| null |
completed
| null | null | false
|
[
"@Arfrever Unfortunately we rushed the last two releases out due to a pair of nasty bugs, one affecting everyone on 3.3.2 and one affecting anyone using OAuth (both bad). Presumably @kennethreitz was midway through working on something when he published the last two releases, and my badgering him to release fast caused him to lose track of it.\n\nHowever, the library itself functions fine, only the tests fail to run. Is it sufficient for you to simply change the tests locally?\n",
"Looks passing to me?\n\nhttps://travis-ci.org/kennethreitz/requests\n",
"The Github repository is fine: these changes are in your local repository. =)\n",
"oh damn it\n",
"this is why i want a git-based pypi :)\n",
"v1.2.3 released, which fixes this.\n"
] |
https://api.github.com/repos/psf/requests/issues/1387
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1387/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1387/comments
|
https://api.github.com/repos/psf/requests/issues/1387/events
|
https://github.com/psf/requests/issues/1387
| 14,739,038
|
MDU6SXNzdWUxNDczOTAzOA==
| 1,387
|
Unicode error when installing with PowerShell on Windows
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1351003?v=4",
"events_url": "https://api.github.com/users/amckinlay/events{/privacy}",
"followers_url": "https://api.github.com/users/amckinlay/followers",
"following_url": "https://api.github.com/users/amckinlay/following{/other_user}",
"gists_url": "https://api.github.com/users/amckinlay/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/amckinlay",
"id": 1351003,
"login": "amckinlay",
"node_id": "MDQ6VXNlcjEzNTEwMDM=",
"organizations_url": "https://api.github.com/users/amckinlay/orgs",
"received_events_url": "https://api.github.com/users/amckinlay/received_events",
"repos_url": "https://api.github.com/users/amckinlay/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/amckinlay/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/amckinlay/subscriptions",
"type": "User",
"url": "https://api.github.com/users/amckinlay",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 2
|
2013-05-24T18:50:01Z
|
2021-09-09T03:00:34Z
|
2013-05-24T20:00:17Z
|
NONE
|
resolved
|
With Python 3.3 on Windows 8 I get the follow error when installing Requests:
```
Downloading/unpacking requests
Running setup.py egg_info for package requests
Installing collected packages: requests
Running setup.py install for requests
File "C:\Users\***\Documents\***\Lib\site-packages\requests\packages\urllib3\contrib\ntlmpool.py", line 38
"""
^
SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 130-132: truncated \uXXXX escape
Successfully installed requests
Cleaning up...
```
|
{
"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/1387/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1387/timeline
| null |
completed
| null | null | false
|
[
"Thanks for raising this issue!\n\nHappily, this doesn't actually immediately affect your install of Requests. You won't be able to use anything that involves NTLM authentication, but hopefully that won't immediately be a problem for you.\n\nAs for the actual issue, the bug is in shazow/urllib3, so I have to ask you to open an issue over there. The exactly issue is that `urllib3/contrib/ntlmpool.py`, there's a docstring that includes the string \"DOMAIN\\username\". Python3 thinks that's a unicode code point literal, but it isn't one it recognises. You can probably just open a Pull Request that changes it and be fine.\n",
"It's actually fixed over there. We just need to pull it in.\n"
] |
https://api.github.com/repos/psf/requests/issues/1386
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1386/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1386/comments
|
https://api.github.com/repos/psf/requests/issues/1386/events
|
https://github.com/psf/requests/issues/1386
| 14,730,444
|
MDU6SXNzdWUxNDczMDQ0NA==
| 1,386
|
default adapters insist on exact matching against lower-case 'http' and 'https'
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/10137?v=4",
"events_url": "https://api.github.com/users/ghost/events{/privacy}",
"followers_url": "https://api.github.com/users/ghost/followers",
"following_url": "https://api.github.com/users/ghost/following{/other_user}",
"gists_url": "https://api.github.com/users/ghost/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/ghost",
"id": 10137,
"login": "ghost",
"node_id": "MDQ6VXNlcjEwMTM3",
"organizations_url": "https://api.github.com/users/ghost/orgs",
"received_events_url": "https://api.github.com/users/ghost/received_events",
"repos_url": "https://api.github.com/users/ghost/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/ghost/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/ghost/subscriptions",
"type": "User",
"url": "https://api.github.com/users/ghost",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 1
|
2013-05-24T15:28:45Z
|
2021-09-09T03:00:35Z
|
2013-05-24T16:07:47Z
|
NONE
|
resolved
|
The URL specification (RFC 2396) recommends that resilient platforms support upper-case letters in scheme specifiers.
At the moment `requests.sessions.Session.get_adapter(self,url)` and `requests.adapters.HTTPAdapter.cert_verify(self,conn,url,verify,cert)` do a `url.startswith()` that match against 'http' and/or 'https' (lower case only), not admitting for the possibility of an upper-case or mixed-case scheme in the url being examined.
In these cases, can we do a url.lower.startswith() instead of simply url.startswith() to allow for mixed case schemes and still be able to effectively match against 'http' and 'https'?
Created pull request #1385 for this 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"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/1386/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1386/timeline
| null |
completed
| null | null | false
|
[
"Closing this to centralize the discussion on #1385.\n"
] |
https://api.github.com/repos/psf/requests/issues/1385
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1385/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1385/comments
|
https://api.github.com/repos/psf/requests/issues/1385/events
|
https://github.com/psf/requests/pull/1385
| 14,730,415
|
MDExOlB1bGxSZXF1ZXN0NTkxNzQ3MA==
| 1,385
|
Cope with mixed-case URL schemes (like 'HTTP') by lower-ifying 'url' string before calling startswith() on it
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/10137?v=4",
"events_url": "https://api.github.com/users/ghost/events{/privacy}",
"followers_url": "https://api.github.com/users/ghost/followers",
"following_url": "https://api.github.com/users/ghost/following{/other_user}",
"gists_url": "https://api.github.com/users/ghost/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/ghost",
"id": 10137,
"login": "ghost",
"node_id": "MDQ6VXNlcjEwMTM3",
"organizations_url": "https://api.github.com/users/ghost/orgs",
"received_events_url": "https://api.github.com/users/ghost/received_events",
"repos_url": "https://api.github.com/users/ghost/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/ghost/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/ghost/subscriptions",
"type": "User",
"url": "https://api.github.com/users/ghost",
"user_view_type": "public"
}
|
[] |
closed
| false
| null |
[] | null | 7
|
2013-05-24T15:27:59Z
|
2014-07-07T06:38:18Z
|
2013-06-08T10:17:38Z
|
NONE
| null |
The URL specification (RFC 2396) recommends that resilient platforms support upper-case letters in scheme specifiers.
At the moment `requests.sessions.Session.get_adapter(self,url)` and `requests.adapters.HTTPAdapter.cert_verify(self,conn,url,verify,cert)` do a `url.startswith()` that match against 'http' and/or 'https' (lower case only), not admitting for the possibility of an upper-case or mixed-case scheme in the url being examined.
In these cases, can we do a url.lower.startswith() instead of simply url.startswith() to allow for mixed case schemes and still be able to effectively match against 'http' and 'https'?
|
{
"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/1385/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1385/timeline
| null | null | false
|
{
"diff_url": "https://github.com/psf/requests/pull/1385.diff",
"html_url": "https://github.com/psf/requests/pull/1385",
"merged_at": "2013-06-08T10:17:38Z",
"patch_url": "https://github.com/psf/requests/pull/1385.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/1385"
}
| true
|
[
"You might be more familiar with ruby, but your line should read: `url.lower().startswith(...)` for it to be valid Python. :-P\n\nOn a separate note, please add a test to make sure this doesn't regress.\n\nOnce you've fixed this and added a test, :+1:.\n",
"You're right -- apologies for requesting a pull of broken code.\n",
"@ViktorHaag You don't need to close this. =) You can push more commits to the same branch and they all get added to the same Pull Request.\n",
"Ah; again, apologies; I did not know this.\n",
"@ViktorHaag I like that you're being polite, but you don't need to apologise for not knowing things. =) We were all new to this at some point.\n",
"OK -- I've added a test to attempt verification of these changes, and also added another change to adapters.py that lower-ifies urls passed down into urllib3 so that its poolmanager can handle using the scheme as a dict key without hiccuping over mixed-case schemes.\n",
"Cool, looks good to me. =) :+1: \n"
] |
https://api.github.com/repos/psf/requests/issues/1384
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1384/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1384/comments
|
https://api.github.com/repos/psf/requests/issues/1384/events
|
https://github.com/psf/requests/issues/1384
| 14,709,929
|
MDU6SXNzdWUxNDcwOTkyOQ==
| 1,384
|
Third party libraries committed verbatim
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/334490?v=4",
"events_url": "https://api.github.com/users/tasuki/events{/privacy}",
"followers_url": "https://api.github.com/users/tasuki/followers",
"following_url": "https://api.github.com/users/tasuki/following{/other_user}",
"gists_url": "https://api.github.com/users/tasuki/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/tasuki",
"id": 334490,
"login": "tasuki",
"node_id": "MDQ6VXNlcjMzNDQ5MA==",
"organizations_url": "https://api.github.com/users/tasuki/orgs",
"received_events_url": "https://api.github.com/users/tasuki/received_events",
"repos_url": "https://api.github.com/users/tasuki/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/tasuki/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/tasuki/subscriptions",
"type": "User",
"url": "https://api.github.com/users/tasuki",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 20
|
2013-05-24T07:22:17Z
|
2021-09-09T00:10:09Z
|
2013-05-24T13:13:21Z
|
NONE
|
resolved
|
Hi, I'm quite new to the world of Python, so might be missing something. When I submitted [this pull request](https://github.com/kennethreitz/requests/pull/1382) the other day, @sigmavirus24's response was surprising. Surely, putting a checkout of a third party library in your repository is not the right way to manage dependencies?
Can't you use [requirements.txt](https://github.com/kennethreitz/requests/blob/master/requirements.txt) to include urllib3 or at least make it a git submodule?
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/334490?v=4",
"events_url": "https://api.github.com/users/tasuki/events{/privacy}",
"followers_url": "https://api.github.com/users/tasuki/followers",
"following_url": "https://api.github.com/users/tasuki/following{/other_user}",
"gists_url": "https://api.github.com/users/tasuki/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/tasuki",
"id": 334490,
"login": "tasuki",
"node_id": "MDQ6VXNlcjMzNDQ5MA==",
"organizations_url": "https://api.github.com/users/tasuki/orgs",
"received_events_url": "https://api.github.com/users/tasuki/received_events",
"repos_url": "https://api.github.com/users/tasuki/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/tasuki/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/tasuki/subscriptions",
"type": "User",
"url": "https://api.github.com/users/tasuki",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/1384/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1384/timeline
| null |
completed
| null | null | false
|
[
"Hi @tasuk, thanks for providing that pull request and for opening this issue!\n\nYou are right, there are a few good ways to manage dependencies. What Requests does is to 'vendor' its dependencies: that is, to provide them as part of the library itself. The main reason we do this is because it has the effect of pinning us to a single version of our dependencies, without limiting what other users or libraries install.\n\nLet me provide an example. If we moved urllib3 to `requirements.txt`, we would need to pin a specific version (to avoid being broken when/if urllib3 does a major version update that changes the API). So we'd add something like `urllib==1.5`. This all works great until you install another library that also uses urllib3, and also pins a version, e.g. `urllib==1.6`. At this stage, one of your libraries is going to be using a version of urllib3 that it wasn't expecting, and runs the risk of breaking. \n\nYou see that Requests breaks and, being the good user that you are, you open an issue saying 'Requests broke over upgrade'. We run around like headless chickens for a while, and then say 'uh, none of us can reproduce this'. Eventually, after some amount of wasted time we discover that you're using a version of urllib3 that we don't support. Then we say \"there's nothing we can do about this, you'll have to change all the source code of Requests yourself or wait until we update the version of urllib3 we test against\".\n\nAs you can see, this is _crap_. So we can't be doing that.\n\nAs for git submodules, yes, we could in principle use that. Unfortunately, the general consensus is that git submodules are [a bit crap](http://codingkilledthecat.wordpress.com/2012/04/28/why-your-company-shouldnt-use-git-submodules/). Even if they were good, we'd gain very little from that: once again, we're pinned to a specific version of urllib3, so the ability to bring in its updates is not helpful. It's easier just to grab tagged versions of urllib3 and call it a day. =)\n\nDoes that answer your question?\n",
"To follow on, we had a case of exactly this problem at the start of the week. Python 3.3.2 changed the cookies API from Python 3.3.1, and broke Requests: we got two issues raised almost immediately and had to rush out a point release to fix it. Upgrading something that seems to be unrelated to Requests shouldn't break it. =)\n",
"Git submodules aren't even just a bad idea for the reason you posted @Lukasa, they include the entire repository not just the library we're looking for. In other words, let's say we vendored urllib3 as a submodule, the structure would be as follows\n\n```\nrequests/\n | + .git/\n | - setup.py\n | + requests/\n | + packages/\n | - __init__.py\n | + urllib3/\n | + .git/\n | - setup.py\n | + urllib3/\n | + charade\n | + .git/\n | - setup.py\n | + charade/\n```\n\nSo then we wouldn't be able to do: `from .packages import urllib3` or `from .packages import charade`. We couldn't even do `from .packages.urllib3 import urllib3` because the repository itself is not a package.\n",
"Oh man, I hadn't even noticed that. Yeah, that's really the kicker, isn't it: submodules aren't just crap, they aren't a solution to this problem at all. =D\n",
"This really isn't up for discussion.\n",
"@kennethreitz: Of course not. =) I was explaining why we do it, rather than suggesting that we'd ever change. Given @tasuk is relatively new to this, though, it seemed like explaining why lots of libraries do this.\n",
"Yeah, you're doing an amazing job :)\n",
"@Lukasa it could be fixed by structuring the project like logilab structures theirs (example: [astng](https://bitbucket.org/logilab/astng/src)) but I really really hate that structure.\n\nAnd @kennethreitz, we're just trying to teach our new friend. (At least I hope he'll be our friend.)\n",
"Maybe if we give him a :cookie: \n",
"We have cookies?! :open_mouth: Why wasn't I told about this? \n",
":tada:\n",
"@Lukasa, thank you for a very comprehensive answer!\n\nSo, basically, dependency management is also broken in Python :)\n\nComing from an inferior language where we're facing similar problems, I was hoping someone solved dependencies in Python. Maybe it's one of those problems that can never really be solved. I guess you'd have to be able to have several versions of one package installed in parallel and choose which one you're importing. Polluting imports with version numbers doesn't seem like the right thing to do though.\n\nAs for submodules, I know they're problematic (been there seen that), but I don't see why the package root shouldn't be the project root (though Python people don't seem to do that). That looks like lesser evil than including whole 3rd party libs in your repo. I'm a bit surprised that's standard practice in Python-world.\n\nIt's an interesting situation, each of the solutions sucks in its own specific way. In PHP world, we use Composer (our version of \"pip -r\"). Sometimes we get impossible-to-resolve conflicts and sometimes dependency updates break stuff (though there should be no api changes for minor releases), but we learned to live with it.\n\nOne more question – what is the reason to use requirements.txt for `pytest` and `invoke`, but not for `urllib3`?\n\n@sigmavirus24 yes I'll be your github-friend, @kennethreitz thanks for the cookie!\n",
"Actually, the right solution is to have requirements.txt install the dependencies locally in a recursive way, so that each of the packages using requirements.txt can have their own specific version of each dependency.\n",
"Actually @tasuk it isn't necessarily common practice to vendor dependencies. @kennethreitz uses it here because of how incredibly popular requests is and what a headache it would be to have different versions of dependencies floating around.\n\nOn the other hand, most of my libraries (the ones that have dependencies) use pip to install the dependencies since (for the most part) the libraries I use I actively help develop, so I can anticipate changes that my cause issues.\n\nAs for requirements.txt, we use that for [Travis CI](travis-ci.org) to install dependencies for testing requests. Those aren't installation dependencies at all. Since that's only used for testing, and we only tests requests, we have no need to use our vendored libraries' requirements.txt files simply because we aren't running their test suites.\n\nSome people us requirements.txt to also determine what needs to be installed for their package in general, but that isn't it's only use, just like not all projects vendor dependencies. :)\n",
"@sigmavirus24 ah cool, that explains everything!\n",
"@sigmavirus24 has covered most of the points I was going to. =)\n\nLike him, my projects overwhelmingly use Pip to manage dependencies, for the exact same reason. I have written a few requests plugins, and because I am a requests contributor I can predict problems that might come up. Though even then, I pin to a minimum Requests version, so I'm not totally immune. =P\n\nYou raised making the package root be the project root. There is a very good reason we don't do that in Python, and that reason is because in Python, folders define your namespaces. If you look at the Requests project root, you'll see it looks like this:\n\n```\nrequests/\n|- docs/\n|- ext/\n|- requests/ (the package root)\n|- .gitignore\n|- .travis.yml\n|- AUTHORS.rst\n|- HISTORY.rst\n|- LICENSE\n|- MANIFEST.in\n|- NOTICE\n|- README.rst\n|- invokefile.py\n|- requirements.txt\n|- setup.py\n|- tasks.py\n|- test_requests.py\n```\n\nIf we put an `__init__.py` here, turning this into the package root, the following lines of code would become possible:\n\n``` python\nfrom requests import setup\nfrom requests import tasks\nfrom requests import test_requests\nfrom requests import docs\nfrom requests import invokefile\nfrom requests import ext\n```\n\nWe don't want people to be able to import any of these things: they aren't part of the library itself. But we need to be able to keep them under version control as well, because they are still very important. For this reason, we use a subfolder as the root of our package, which allows us to easily manage the other package metadata.\n\n(A note: the fact that we have our testing dependencies in `requirements.txt` annoys me: I don't do it in my own projects. However, it's really minor so I just let it go. =) )\n",
"In fact, I'd go further: the standard python distribution tools (Distutils and Setuptools) essentially _mandate_ that you don't ship the root of your project as the root of your package. You need that `setup.py` script, and it can't be in your package.\n",
"On Fri, May 24, 2013 at 06:28:18AM -0700, Cory Benfield wrote:\n\n> We don't want people to be able to import any of these things: they aren't \n> part of the library itself. But we need to be able to keep them under \n> version control as well, because they are still very important. For this \n> reason, we use a subfolder as the root of our package, which allows us to \n> easily manage the other package metadata.\n\nAlso note that Ruby does the same thing, a typical ruby structure is:\n\n```\nrequests.rb/\n| - lib/\n | - requests/\n | - requests.rb\n| - spec/\n| - Gemfile\n| - README.md\n| - requests.gemspec\n```\n\nSo it isn't just a python thing :)\n\nAlso, you could look at C projects which typically break stuff up into:\n\n```\nproject/\n| - src/\n | - library_1/\n | - Makefile\n | - library_2/\n | - Makefile\n| - lib/\n| - Makefile\n| - configure\n| - README.txt\n| - LICENSE.txt\n```\n\nBut this is far less \"standardized\" than Ruby or Python. Also note that \ndependency management in Ruby is just as bad as it is in python (I think). And \ndependency management in Ubuntu (Debian, Arch, etc.) suffers the same issues.\n\n> (A note: the fact that we have our testing dependencies in \n> `requirements.txt` annoys me: I don't do it in my own projects. However, \n> it's really minor so I just let it go. =) )\n\nNow I have to look more closely at your projects to see what you do. I use it \nfor github3.py but should stop since I've started packaging the tests with the \ntarball and put the test dependencies in the `setup.py` file. Anyway, this \nisn't useful for this issue anyway, especially since it's closed. :)\n",
"@Lukasa, that all makes perfect sense.\n\nEven in PHP-land it's usual to separate things in a similar way (see e.g. [guzzle](https://github.com/guzzle/guzzle)). But we have funky class-loading mechanisms instead of adhering to the directory structure for namespacing, allowing us to be a bit more lenient about which files go where.\n\nTo reiterate my previous point - wouldn't it be wonderful if pip was able to manage packages locally in a recursive way? (\"I need tag 3.1 of package 'x' and commit 45fe8a2 of package 'y', can you put them in requests/packages for me?\")\n",
"@Lukasa \n\n> A note: the fact that we have our testing dependencies in `requirements.txt` annoys me (...)\n\nI'm glad it annoys you as it annoys me, too :) If these are testing only dependencies I think the file should be named `requirements-testing.txt` or something similar to make it clear what kind of dependencies it enumerates.\n"
] |
https://api.github.com/repos/psf/requests/issues/1383
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1383/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1383/comments
|
https://api.github.com/repos/psf/requests/issues/1383/events
|
https://github.com/psf/requests/issues/1383
| 14,709,453
|
MDU6SXNzdWUxNDcwOTQ1Mw==
| 1,383
|
sphinx template issue
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/35171?v=4",
"events_url": "https://api.github.com/users/lorien/events{/privacy}",
"followers_url": "https://api.github.com/users/lorien/followers",
"following_url": "https://api.github.com/users/lorien/following{/other_user}",
"gists_url": "https://api.github.com/users/lorien/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/lorien",
"id": 35171,
"login": "lorien",
"node_id": "MDQ6VXNlcjM1MTcx",
"organizations_url": "https://api.github.com/users/lorien/orgs",
"received_events_url": "https://api.github.com/users/lorien/received_events",
"repos_url": "https://api.github.com/users/lorien/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/lorien/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/lorien/subscriptions",
"type": "User",
"url": "https://api.github.com/users/lorien",
"user_view_type": "public"
}
|
[
{
"color": "0b02e1",
"default": false,
"description": null,
"id": 191274,
"name": "Contributor Friendly",
"node_id": "MDU6TGFiZWwxOTEyNzQ=",
"url": "https://api.github.com/repos/psf/requests/labels/Contributor%20Friendly"
}
] |
closed
| true
| null |
[] | null | 2
|
2013-05-24T07:03:45Z
|
2021-09-09T03:00:27Z
|
2013-06-08T10:13:29Z
|
NONE
|
resolved
|
There is message in documentation's sidebar: "You are currently looking at the documentation of the development release." It is the same for all documentation versions.
For example, version 1.0.3 (http://docs.python-requests.org/en/v1.0.3/) displays the same message about development release.
|
{
"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/1383/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1383/timeline
| null |
completed
| null | null | false
|
[
"Thanks for raising this issue!\n\nThe text is hardcoded into the template in `docs/_templates/sidebarintro.html`. Feel free to open a Pull Request that removes it. (If you don't want to, I'll do it at some stage, just not right now. =) )\n",
"This should be resolved by #1413. Thanks so much for pointing it out! \n"
] |
https://api.github.com/repos/psf/requests/issues/1382
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1382/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1382/comments
|
https://api.github.com/repos/psf/requests/issues/1382/events
|
https://github.com/psf/requests/pull/1382
| 14,697,271
|
MDExOlB1bGxSZXF1ZXN0NTkwMTM5MA==
| 1,382
|
HTTPConnection strict deprecated since 3.2
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/334490?v=4",
"events_url": "https://api.github.com/users/tasuki/events{/privacy}",
"followers_url": "https://api.github.com/users/tasuki/followers",
"following_url": "https://api.github.com/users/tasuki/following{/other_user}",
"gists_url": "https://api.github.com/users/tasuki/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/tasuki",
"id": 334490,
"login": "tasuki",
"node_id": "MDQ6VXNlcjMzNDQ5MA==",
"organizations_url": "https://api.github.com/users/tasuki/orgs",
"received_events_url": "https://api.github.com/users/tasuki/received_events",
"repos_url": "https://api.github.com/users/tasuki/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/tasuki/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/tasuki/subscriptions",
"type": "User",
"url": "https://api.github.com/users/tasuki",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 4
|
2013-05-23T21:44:29Z
|
2021-09-08T23:08:19Z
|
2013-05-23T22:38:37Z
|
NONE
|
resolved
|
When using requests [as shown here](https://gist.github.com/tasuk/5639256), I get _"DeprecationWarning: the 'strict' argument isn't supported anymore"_ because of [this bit of code](https://github.com/kennethreitz/requests/blob/v1.2.2/requests/packages/urllib3/connectionpool.py#L203-L205).
Please also see:
http://docs.python.org/3.2/library/http.client.html#http.client.HTTPConnection
http://docs.python.org/3.3/library/http.client.html#http.client.HTTPConnection
http://docs.python.org/3.4/library/http.client.html#http.client.HTTPConnection
|
{
"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/1382/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1382/timeline
| null | null | false
|
{
"diff_url": "https://github.com/psf/requests/pull/1382.diff",
"html_url": "https://github.com/psf/requests/pull/1382",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/1382.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/1382"
}
| true
|
[
"This is the wrong place to send this pull request. Please raise it over at shazow/urllib3.\n",
":open_mouth: \n",
"This has been fixed yet on [shazow/urllib3 - issue #342](https://github.com/shazow/urllib3/issues/342) three weeks ago, but the warning is visible.\n\nPlease upgrade your copy of urllib3 to the latest version 1.8\n",
"@hynekcer we do not upgrade urllib3 until we are about to cut a release.\n"
] |
https://api.github.com/repos/psf/requests/issues/1381
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1381/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1381/comments
|
https://api.github.com/repos/psf/requests/issues/1381/events
|
https://github.com/psf/requests/pull/1381
| 14,679,849
|
MDExOlB1bGxSZXF1ZXN0NTg5MTI5MQ==
| 1,381
|
Don't force chunked transfer on 0-length file-like object.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/8853?v=4",
"events_url": "https://api.github.com/users/expandrive/events{/privacy}",
"followers_url": "https://api.github.com/users/expandrive/followers",
"following_url": "https://api.github.com/users/expandrive/following{/other_user}",
"gists_url": "https://api.github.com/users/expandrive/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/expandrive",
"id": 8853,
"login": "expandrive",
"node_id": "MDEyOk9yZ2FuaXphdGlvbjg4NTM=",
"organizations_url": "https://api.github.com/users/expandrive/orgs",
"received_events_url": "https://api.github.com/users/expandrive/received_events",
"repos_url": "https://api.github.com/users/expandrive/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/expandrive/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/expandrive/subscriptions",
"type": "Organization",
"url": "https://api.github.com/users/expandrive",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 3
|
2013-05-23T15:23:12Z
|
2021-09-08T23:07:27Z
|
2013-06-08T10:16:33Z
|
NONE
|
resolved
|
Only switch to chunked if we don't know the length of a file like object. This fixes the case of trying to transfer a 0-length file - chunked upload was being forced. Services like S3 that disallow chunked upload will fail.
|
{
"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/1381/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1381/timeline
| null | null | false
|
{
"diff_url": "https://github.com/psf/requests/pull/1381.diff",
"html_url": "https://github.com/psf/requests/pull/1381",
"merged_at": "2013-06-08T10:16:33Z",
"patch_url": "https://github.com/psf/requests/pull/1381.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/1381"
}
| true
|
[
"This looks good to me. +1\n",
"This looks fine. But for future reference you could also have done `if length is not False` because `True`, `False` and `None` are all alike in that you should compare them using is if you're not just looking for a truthy value.\n\n:+1: though\n",
":cake:\n"
] |
https://api.github.com/repos/psf/requests/issues/1380
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1380/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1380/comments
|
https://api.github.com/repos/psf/requests/issues/1380/events
|
https://github.com/psf/requests/issues/1380
| 14,644,110
|
MDU6SXNzdWUxNDY0NDExMA==
| 1,380
|
TypeError: CaseInsensitiveDict is not JSON serializable
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/2837532?v=4",
"events_url": "https://api.github.com/users/woozyking/events{/privacy}",
"followers_url": "https://api.github.com/users/woozyking/followers",
"following_url": "https://api.github.com/users/woozyking/following{/other_user}",
"gists_url": "https://api.github.com/users/woozyking/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/woozyking",
"id": 2837532,
"login": "woozyking",
"node_id": "MDQ6VXNlcjI4Mzc1MzI=",
"organizations_url": "https://api.github.com/users/woozyking/orgs",
"received_events_url": "https://api.github.com/users/woozyking/received_events",
"repos_url": "https://api.github.com/users/woozyking/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/woozyking/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/woozyking/subscriptions",
"type": "User",
"url": "https://api.github.com/users/woozyking",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 7
|
2013-05-22T20:37:39Z
|
2021-09-09T00:34:19Z
|
2013-05-22T21:18:14Z
|
NONE
|
resolved
|
The recent change that makes header case insensitive dict makes it impossible to dump request headers into a JSON object.
To reproduce this issue:
``` python
>>> import requests
>>> r = requests.get("http://google.com")
>>> r.headers
CaseInsensitiveDict({'x-xss-protection': '1; mode=block', 'transfer-encoding': 'chunked', 'set-cookie': 'PREF=ID=12d7ece5ef3bf530:FF=0:TM=1369254983:LM=1369254983:S=c6aSx8zzedxojmb5; expires=Fri, 22-May-2015 20:36:23 GMT; path=/; domain=.google.ca, NID=67=pu4Hj0vWxZzqQ1L48tpF50mv0AI3igxPOMqq4AkfeLSORhKgdxMC8Eyv2iSm84UflzVXSTSaaddKx6KPM4NAWGd2JYIm95YPC3BWiJMZsSkj652Mvs4i5hk94weAz6Xz; expires=Thu, 21-Nov-2013 20:36:23 GMT; path=/; domain=.google.ca; HttpOnly', 'expires': '-1', 'server': 'gws', 'cache-control': 'private, max-age=0', 'date': 'Wed, 22 May 2013 20:36:23 GMT', 'p3p': 'CP="This is not a P3P policy! See http://www.google.com/support/accounts/bin/answer.py?hl=en&answer=151657 for more info."', 'content-type': 'text/html; charset=ISO-8859-1', 'x-frame-options': 'SAMEORIGIN'})
>>> import json
>>> json.dumps(r.headers)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.7/json/__init__.py", line 243, in dumps
return _default_encoder.encode(obj)
File "/usr/lib/python2.7/json/encoder.py", line 207, in encode
chunks = self.iterencode(o, _one_shot=True)
File "/usr/lib/python2.7/json/encoder.py", line 270, in iterencode
return _iterencode(o, 0)
File "/usr/lib/python2.7/json/encoder.py", line 184, in default
raise TypeError(repr(o) + " is not JSON serializable")
TypeError: CaseInsensitiveDict({'x-xss-protection': '1; mode=block', 'transfer-encoding': 'chunked', 'set-cookie': 'PREF=ID=12d7ece5ef3bf530:FF=0:TM=1369254983:LM=1369254983:S=c6aSx8zzedxojmb5; expires=Fri, 22-May-2015 20:36:23 GMT; path=/; domain=.google.ca, NID=67=pu4Hj0vWxZzqQ1L48tpF50mv0AI3igxPOMqq4AkfeLSORhKgdxMC8Eyv2iSm84UflzVXSTSaaddKx6KPM4NAWGd2JYIm95YPC3BWiJMZsSkj652Mvs4i5hk94weAz6Xz; expires=Thu, 21-Nov-2013 20:36:23 GMT; path=/; domain=.google.ca; HttpOnly', 'expires': '-1', 'server': 'gws', 'cache-control': 'private, max-age=0', 'date': 'Wed, 22 May 2013 20:36:23 GMT', 'p3p': 'CP="This is not a P3P policy! See http://www.google.com/support/accounts/bin/answer.py?hl=en&answer=151657 for more info."', 'content-type': 'text/html; charset=ISO-8859-1', 'x-frame-options': 'SAMEORIGIN'}) is not JSON serializable
```
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4",
"events_url": "https://api.github.com/users/Lukasa/events{/privacy}",
"followers_url": "https://api.github.com/users/Lukasa/followers",
"following_url": "https://api.github.com/users/Lukasa/following{/other_user}",
"gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Lukasa",
"id": 1382556,
"login": "Lukasa",
"node_id": "MDQ6VXNlcjEzODI1NTY=",
"organizations_url": "https://api.github.com/users/Lukasa/orgs",
"received_events_url": "https://api.github.com/users/Lukasa/received_events",
"repos_url": "https://api.github.com/users/Lukasa/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Lukasa",
"user_view_type": "public"
}
|
{
"+1": 1,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 1,
"url": "https://api.github.com/repos/psf/requests/issues/1380/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1380/timeline
| null |
completed
| null | null | false
|
[
"While this is not actually requests bug, it does break some use cases prior to the introduction of CaseInsensitiveDict usage.\n",
"This is easily worked around by doing:\n\n``` python\nimport requests\nimport json\n\nr = requests.get(url)\nheaders_json = json.dumps(dict(r.headers))\n```\n\nTechnically we could return any object that behaves like a dict without it being a dict, so I don't see this as much of a problem. What would be fantastic is if there were a `__serialize__` method we could declare on objects so that modules like `json` could just reference that as the author of the object intends.\n\nI'll defer to @Lukasa on this one though. I personally don't find this so offensive frankly but I'm not against changing it either.\n",
"Thank you @sigmavirus24. I'm aware of this workaround, I brought this up only because it broke existing code of mine (so possibly others' who haven't updated to 1.2.x).\n\nI'm :+1: for a `__serialize__`. Magic methods are sometimes nice.\n",
"Magic methods are so often nice. That's more of a pipe-dream than anything else. The stdlib `json` module is pretty much frozen except for bug fixes I think. I have to wonder if simplejson or itsdangerous would consider (or even already have) that kind of support.\n",
"I'm with @sigmavirus24 here. This is a pain, but the Case-Insensitive Dict is awesome.\n\nAs for magic methods, I think JSON will never add one. JSON should be round-trippable, e.g: `json.loads(json.dumps(obj)) == obj`. Allowing arbitrary serialisation breaks that functionality.\n\n@woozyking, for what it's worth, if you find yourself doing this a lot, you can use a [custom JSON encoder with the `default` method defined`](http://docs.python.org/2/library/json.html#json.JSONEncoder.default). Define the `default` method such that it turns the Case-Insensitive Dict into a dict. Slightly less code repetition if you want it.\n\nSorry that we caused you this inconvenience, but I think things are going to stay as they are. Thanks so much for raising the issue though! :cake:\n",
"@sigmavirus24 a quick test with the latest simplejson indicates that they don't have built-in resolution for this case.\n\n@Lukasa fully understand.\n",
"@Lukasa that's true. But it would still be convenient. :-P\n"
] |
https://api.github.com/repos/psf/requests/issues/1379
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1379/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1379/comments
|
https://api.github.com/repos/psf/requests/issues/1379/events
|
https://github.com/psf/requests/issues/1379
| 14,639,670
|
MDU6SXNzdWUxNDYzOTY3MA==
| 1,379
|
Python 3.3.2: 'MockRequest' object has no attribute 'origin_req_host'
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/327323?v=4",
"events_url": "https://api.github.com/users/Kwpolska/events{/privacy}",
"followers_url": "https://api.github.com/users/Kwpolska/followers",
"following_url": "https://api.github.com/users/Kwpolska/following{/other_user}",
"gists_url": "https://api.github.com/users/Kwpolska/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Kwpolska",
"id": 327323,
"login": "Kwpolska",
"node_id": "MDQ6VXNlcjMyNzMyMw==",
"organizations_url": "https://api.github.com/users/Kwpolska/orgs",
"received_events_url": "https://api.github.com/users/Kwpolska/received_events",
"repos_url": "https://api.github.com/users/Kwpolska/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Kwpolska/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Kwpolska/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Kwpolska",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 1
|
2013-05-22T19:04:41Z
|
2021-09-09T00:34:28Z
|
2013-05-22T19:07:10Z
|
CONTRIBUTOR
|
resolved
|
I recently upgraded to Python 3.3.2 (from Arch Linux packages). With it, a script of mine broke. The script worked fine with 3.3.1 and still works fine with 2.7.5. Full traceback (`s = requests.Session(); starturl = 'http://example.com'` (okay, not exactly that, but you don’t need nor want to know the actual URL))
``` pytb
File "req.py", line 43, in <module>
orig = s.get(starturl).text
File "/usr/lib/python3.3/site-packages/requests/sessions.py", line 369, in get
return self.request('GET', url, **kwargs)
File "/usr/lib/python3.3/site-packages/requests/sessions.py", line 354, in request
resp = self.send(prep, **send_kwargs)
File "/usr/lib/python3.3/site-packages/requests/sessions.py", line 460, in send
r = adapter.send(request, **kwargs)
File "/usr/lib/python3.3/site-packages/requests/adapters.py", line 256, in send
r = self.build_response(request, resp)
File "/usr/lib/python3.3/site-packages/requests/adapters.py", line 125, in build_response
extract_cookies_to_jar(response.cookies, req, resp)
File "/usr/lib/python3.3/site-packages/requests/cookies.py", line 105, in extract_cookies_to_jar
jar.extract_cookies(res, req)
File "/usr/lib/python3.3/http/cookiejar.py", line 1647, in extract_cookies
if self._policy.set_ok(cookie, request):
File "/usr/lib/python3.3/http/cookiejar.py", line 931, in set_ok
if not fn(cookie, request):
File "/usr/lib/python3.3/http/cookiejar.py", line 952, in set_ok_verifiability
if request.unverifiable and is_third_party(request):
File "/usr/lib/python3.3/http/cookiejar.py", line 707, in is_third_party
if not domain_match(req_host, reach(request.origin_req_host)):
AttributeError: 'MockRequest' object has no attribute 'origin_req_host'
```
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4",
"events_url": "https://api.github.com/users/Lukasa/events{/privacy}",
"followers_url": "https://api.github.com/users/Lukasa/followers",
"following_url": "https://api.github.com/users/Lukasa/following{/other_user}",
"gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Lukasa",
"id": 1382556,
"login": "Lukasa",
"node_id": "MDQ6VXNlcjEzODI1NTY=",
"organizations_url": "https://api.github.com/users/Lukasa/orgs",
"received_events_url": "https://api.github.com/users/Lukasa/received_events",
"repos_url": "https://api.github.com/users/Lukasa/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Lukasa",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/1379/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1379/timeline
| null |
completed
| null | null | false
|
[
"Yes, we spotted this and rushed out a Requests point release to fix it. Please upgrade Requests to 1.2.1 or later. Thanks for reporting this! :smile_cat: \n"
] |
https://api.github.com/repos/psf/requests/issues/1378
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1378/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1378/comments
|
https://api.github.com/repos/psf/requests/issues/1378/events
|
https://github.com/psf/requests/pull/1378
| 14,590,639
|
MDExOlB1bGxSZXF1ZXN0NTg0NTUzOQ==
| 1,378
|
Avoid two requests on a TypeError
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/25968?v=4",
"events_url": "https://api.github.com/users/whitmo/events{/privacy}",
"followers_url": "https://api.github.com/users/whitmo/followers",
"following_url": "https://api.github.com/users/whitmo/following{/other_user}",
"gists_url": "https://api.github.com/users/whitmo/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/whitmo",
"id": 25968,
"login": "whitmo",
"node_id": "MDQ6VXNlcjI1OTY4",
"organizations_url": "https://api.github.com/users/whitmo/orgs",
"received_events_url": "https://api.github.com/users/whitmo/received_events",
"repos_url": "https://api.github.com/users/whitmo/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/whitmo/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/whitmo/subscriptions",
"type": "User",
"url": "https://api.github.com/users/whitmo",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 3
|
2013-05-21T20:54:52Z
|
2021-09-08T20:01:23Z
|
2013-05-21T21:25:12Z
|
NONE
|
resolved
|
Rather than test behavior via try: except, inspect python version
number.
NOTE: This may not be a huge issue in real life.
I noticed it using wsgi-intercept where an intercepted app raised a
TypeError (which got bubbled up the stack to this catch). If the purpose of this code is as the comments say, checking sys.version_info is probably a more efficient and predictable. But maybe more is happening here than I've investigated?
anyway, this is a friendly testless PR, feel free to disregard ;)
|
{
"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/1378/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1378/timeline
| null | null | false
|
{
"diff_url": "https://github.com/psf/requests/pull/1378.diff",
"html_url": "https://github.com/psf/requests/pull/1378",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/1378.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/1378"
}
| true
|
[
"I prefer the old method, but thanks!\n",
"Just a side-note, two requests are not made in this code at all. The request has been placed already, this tries to read the response one way and if that throws an exception, reads it the default way. It really isn't necessary to make this change. :)\n",
"that's not the behavior I was seeing on the server side. will put together\na test.\n\nOn Wed, May 22, 2013 at 4:05 PM, Ian Cordasco notifications@github.comwrote:\n\n> Just a side-note, two requests are not made in this code at all. The\n> request has been placed already, this tries to read the response one way\n> and if that throws an exception, reads it the default way. It really isn't\n> necessary to make this change. :)\n> \n> —\n> Reply to this email directly or view it on GitHubhttps://github.com/kennethreitz/requests/pull/1378#issuecomment-18307870\n> .\n\n## \n\n<=>\ndavid \"whit\" morriss\n\n \"If you don't know where you are,\n you don't know anything at all\"\n\n Dr. Edgar Spencer, Ph.D., 1995\n"
] |
https://api.github.com/repos/psf/requests/issues/1377
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1377/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1377/comments
|
https://api.github.com/repos/psf/requests/issues/1377/events
|
https://github.com/psf/requests/pull/1377
| 14,584,363
|
MDExOlB1bGxSZXF1ZXN0NTg0MjE4MQ==
| 1,377
|
Don't upload a file that contains the exact string we're worried about
|
{
"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-05-21T18:47:01Z
|
2021-09-08T20:01:24Z
|
2013-05-21T19:12:57Z
|
MEMBER
|
resolved
|
Should resolve #1374.
|
{
"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/1377/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1377/timeline
| null | null | false
|
{
"diff_url": "https://github.com/psf/requests/pull/1377.diff",
"html_url": "https://github.com/psf/requests/pull/1377",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/1377.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/1377"
}
| true
|
[
"This totally doesn't work, ignore it.\n"
] |
https://api.github.com/repos/psf/requests/issues/1376
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1376/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1376/comments
|
https://api.github.com/repos/psf/requests/issues/1376/events
|
https://github.com/psf/requests/pull/1376
| 14,581,219
|
MDExOlB1bGxSZXF1ZXN0NTg0MDc4Ng==
| 1,376
|
Fix typo, %t -> %r
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1442496?v=4",
"events_url": "https://api.github.com/users/papaeye/events{/privacy}",
"followers_url": "https://api.github.com/users/papaeye/followers",
"following_url": "https://api.github.com/users/papaeye/following{/other_user}",
"gists_url": "https://api.github.com/users/papaeye/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/papaeye",
"id": 1442496,
"login": "papaeye",
"node_id": "MDQ6VXNlcjE0NDI0OTY=",
"organizations_url": "https://api.github.com/users/papaeye/orgs",
"received_events_url": "https://api.github.com/users/papaeye/received_events",
"repos_url": "https://api.github.com/users/papaeye/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/papaeye/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/papaeye/subscriptions",
"type": "User",
"url": "https://api.github.com/users/papaeye",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 3
|
2013-05-21T17:51:54Z
|
2021-09-08T22:01:17Z
|
2013-05-21T21:25:50Z
|
CONTRIBUTOR
|
resolved
|
`invoke test` fails sometimes due to #1374
|
{
"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/1376/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1376/timeline
| null | null | false
|
{
"diff_url": "https://github.com/psf/requests/pull/1376.diff",
"html_url": "https://github.com/psf/requests/pull/1376",
"merged_at": "2013-05-21T21:25:49Z",
"patch_url": "https://github.com/psf/requests/pull/1376.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/1376"
}
| true
|
[
"In what way does this relate to #1374?\n",
"Sorry, this was not related to #1374!\n",
"I think this looks fine then. =)\n"
] |
https://api.github.com/repos/psf/requests/issues/1375
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1375/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1375/comments
|
https://api.github.com/repos/psf/requests/issues/1375/events
|
https://github.com/psf/requests/pull/1375
| 14,581,144
|
MDExOlB1bGxSZXF1ZXN0NTg0MDc0OQ==
| 1,375
|
don't replace 'Digest' in digest header value
|
{
"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 | 1
|
2013-05-21T17:50:14Z
|
2021-09-08T23:05:03Z
|
2013-05-21T21:33:26Z
|
CONTRIBUTOR
|
resolved
|
See https://github.com/kennethreitz/requests/issues/1358
|
{
"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/1375/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1375/timeline
| null | null | false
|
{
"diff_url": "https://github.com/psf/requests/pull/1375.diff",
"html_url": "https://github.com/psf/requests/pull/1375",
"merged_at": "2013-05-21T21:33:26Z",
"patch_url": "https://github.com/psf/requests/pull/1375.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/1375"
}
| true
|
[
"Looks good to me. If you can write a test without bending over backwards that would be nice, but if it's a huge ton of work we can probably pass on it. =P\n"
] |
https://api.github.com/repos/psf/requests/issues/1374
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1374/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1374/comments
|
https://api.github.com/repos/psf/requests/issues/1374/events
|
https://github.com/psf/requests/issues/1374
| 14,581,000
|
MDU6SXNzdWUxNDU4MTAwMA==
| 1,374
|
test_unicode_multipart_post_fieldnames() fails sometimes
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1442496?v=4",
"events_url": "https://api.github.com/users/papaeye/events{/privacy}",
"followers_url": "https://api.github.com/users/papaeye/followers",
"following_url": "https://api.github.com/users/papaeye/following{/other_user}",
"gists_url": "https://api.github.com/users/papaeye/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/papaeye",
"id": 1442496,
"login": "papaeye",
"node_id": "MDQ6VXNlcjE0NDI0OTY=",
"organizations_url": "https://api.github.com/users/papaeye/orgs",
"received_events_url": "https://api.github.com/users/papaeye/received_events",
"repos_url": "https://api.github.com/users/papaeye/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/papaeye/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/papaeye/subscriptions",
"type": "User",
"url": "https://api.github.com/users/papaeye",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 5
|
2013-05-21T17:46:56Z
|
2021-09-09T03:00:36Z
|
2013-05-21T21:25:51Z
|
CONTRIBUTOR
|
resolved
|
```
self = <test_requests.RequestsTestCase testMethod=test_unicode_multipart_post_fieldnames>
def test_unicode_multipart_post_fieldnames(self):
r = requests.Request(method='POST',
url=httpbin('post'),
data={'stuff'.encode('utf-8'): 'elixr'},
files={'file': ('test_requests.py',
open(__file__, 'rb'))})
prep = r.prepare()
self.assertTrue(b'name="stuff"' in prep.body)
> self.assertFalse(b'name="b\'stuff\'"' in prep.body)
E AssertionError: True is not false
test_requests.py:356: AssertionError
```
|
{
"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/1374/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1374/timeline
| null |
completed
| null | null | false
|
[
"Yeah, that does look wrong.\n",
"In my environment, this is reproducible when `__file__` is test_requests.pyc.\nReplacing `__file__` with `os.path.splitext(__file__)[0] + '.py'` works for me.\n",
"@papeye: Oh yeah, my fix is totally wrong. Do you want to open a Pull Request with your fix in it? =)\n",
"@Lukasa OK, I will. Sorry for misleading you by my comment.\n",
"@papaeye: Not at all! I mislead myself by being stupid. =D\n"
] |
https://api.github.com/repos/psf/requests/issues/1373
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1373/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1373/comments
|
https://api.github.com/repos/psf/requests/issues/1373/events
|
https://github.com/psf/requests/pull/1373
| 14,557,456
|
MDExOlB1bGxSZXF1ZXN0NTgyODUxMg==
| 1,373
|
Only pass unicode multipart fieldnames to urllib3.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1165819?v=4",
"events_url": "https://api.github.com/users/ib-lundgren/events{/privacy}",
"followers_url": "https://api.github.com/users/ib-lundgren/followers",
"following_url": "https://api.github.com/users/ib-lundgren/following{/other_user}",
"gists_url": "https://api.github.com/users/ib-lundgren/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/ib-lundgren",
"id": 1165819,
"login": "ib-lundgren",
"node_id": "MDQ6VXNlcjExNjU4MTk=",
"organizations_url": "https://api.github.com/users/ib-lundgren/orgs",
"received_events_url": "https://api.github.com/users/ib-lundgren/received_events",
"repos_url": "https://api.github.com/users/ib-lundgren/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/ib-lundgren/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/ib-lundgren/subscriptions",
"type": "User",
"url": "https://api.github.com/users/ib-lundgren",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 1
|
2013-05-21T08:52:21Z
|
2021-09-08T10:01:16Z
|
2013-05-21T13:19:48Z
|
CONTRIBUTOR
|
resolved
|
`filepost.encode_multipart_formdata` says all fieldnames should be unicode and currently that is not the case - https://github.com/shazow/urllib3/blob/master/urllib3/filepost.py#L55 - since requests encodes to bytes here - https://github.com/kennethreitz/requests/blob/master/requests/models.py#L108.
Discovered after plenty of fun in https://github.com/requests/requests-oauthlib/pull/43. This should fix https://github.com/kennethreitz/requests/issues/1371.
Tested in 2.6, 2.7 and 3.3.
cc @Lukasa, @michaelhelmick, @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/1373/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1373/timeline
| null | null | false
|
{
"diff_url": "https://github.com/psf/requests/pull/1373.diff",
"html_url": "https://github.com/psf/requests/pull/1373",
"merged_at": "2013-05-21T13:19:48Z",
"patch_url": "https://github.com/psf/requests/pull/1373.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/1373"
}
| true
|
[
"Excellent. :+1:\n"
] |
https://api.github.com/repos/psf/requests/issues/1372
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1372/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1372/comments
|
https://api.github.com/repos/psf/requests/issues/1372/events
|
https://github.com/psf/requests/issues/1372
| 14,556,766
|
MDU6SXNzdWUxNDU1Njc2Ng==
| 1,372
|
`pip install requests` insists to download Sphinx, Jinja2, ...
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/142113?v=4",
"events_url": "https://api.github.com/users/florentx/events{/privacy}",
"followers_url": "https://api.github.com/users/florentx/followers",
"following_url": "https://api.github.com/users/florentx/following{/other_user}",
"gists_url": "https://api.github.com/users/florentx/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/florentx",
"id": 142113,
"login": "florentx",
"node_id": "MDQ6VXNlcjE0MjExMw==",
"organizations_url": "https://api.github.com/users/florentx/orgs",
"received_events_url": "https://api.github.com/users/florentx/received_events",
"repos_url": "https://api.github.com/users/florentx/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/florentx/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/florentx/subscriptions",
"type": "User",
"url": "https://api.github.com/users/florentx",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 8
|
2013-05-21T08:33:03Z
|
2021-09-09T03:00:36Z
|
2013-05-21T21:26:43Z
|
NONE
|
resolved
|
I've just created an empty virtualenv and installed requests 1.2.1.
I'm surprised it downloads Sphinx ...
```
$ pip install requests
Downloading/unpacking requests
Downloading requests-1.2.1.tar.gz (348kB): 348kB downloaded
Running setup.py egg_info for package requests
Installed /home/user/.virtualenvs/trequests/build/requests/Sphinx-1.2b1-py2.7.egg
Searching for docutils>=0.7
Reading http://pypi.python.org/simple/docutils/
Reading http://docutils.sourceforge.net/
Reading http://sourceforge.net/projects/docutils/files/docutils/0.8.1/docutils-0.8.1.tar.gz/download
Reading http://sourceforge.net/projects/docutils/files/docutils/0.9.1/docutils-0.9.1.tar.gz/download
Reading http://sourceforge.net/projects/docutils/files/docutils/0.10/docutils-0.10.tar.gz/download
Reading http://sourceforge.net/projects/docutils/files/docutils/0.9/docutils-0.9.tar.gz/download
Best match: docutils 0.10
Downloading http://pypi.python.org/packages/source/d/docutils/docutils-0.10.tar.gz#md5=d8d4660c08302c791b2d71a155a2f4bc
Processing docutils-0.10.tar.gz
Writing /var/folders/-+/-+ZKNykxGl44h0qzWweTRE+++TI/-Tmp-/easy_install-5j0vnc/docutils-0.10/setup.cfg
Running docutils-0.10/setup.py -q bdist_egg --dist-dir /var/folders/-+/-+ZKNykxGl44h0qzWweTRE+++TI/-Tmp-/easy_install-5j0vnc/docutils-0.10/egg-dist-tmp-rQhjkj
warning: no files found matching 'MANIFEST'
warning: no files found matching '*' under directory 'extras'
warning: no previously-included files matching '.cvsignore' found under directory '*'
warning: no previously-included files matching '*.pyc' found under directory '*'
warning: no previously-included files matching '*~' found under directory '*'
warning: no previously-included files matching '.DS_Store' found under directory '*'
zip_safe flag not set; analyzing archive contents...
docutils.parsers.rst.directives.misc: module references __file__
docutils.writers.docutils_xml: module references __path__
docutils.writers.html4css1.__init__: module references __file__
docutils.writers.latex2e.__init__: module references __file__
docutils.writers.odf_odt.__init__: module references __file__
docutils.writers.pep_html.__init__: module references __file__
docutils.writers.s5_html.__init__: module references __file__
Installed /home/user/.virtualenvs/trequests/build/requests/docutils-0.10-py2.7.egg
Searching for Jinja2>=2.3
Reading http://pypi.python.org/simple/Jinja2/
Best match: Jinja2 2.7
Downloading http://pypi.python.org/packages/source/J/Jinja2/Jinja2-2.7.tar.gz#md5=c2fb12cbbb523c57d3d15bfe4dc0e8fe
Processing Jinja2-2.7.tar.gz
Writing /var/folders/-+/-+ZKNykxGl44h0qzWweTRE+++TI/-Tmp-/easy_install-jPS1EB/Jinja2-2.7/setup.cfg
Running Jinja2-2.7/setup.py -q bdist_egg --dist-dir /var/folders/-+/-+ZKNykxGl44h0qzWweTRE+++TI/-Tmp-/easy_install-jPS1EB/Jinja2-2.7/egg-dist-tmp-cPLRtT
warning: no files found matching '*' under directory 'custom_fixers'
warning: no previously-included files matching '*' found under directory 'docs/_build'
warning: no previously-included files matching '*.pyc' found under directory 'jinja2'
warning: no previously-included files matching '*.pyc' found under directory 'docs'
warning: no previously-included files matching '*.pyo' found under directory 'jinja2'
warning: no previously-included files matching '*.pyo' found under directory 'docs'
Installed /home/user/.virtualenvs/trequests/build/requests/Jinja2-2.7-py2.7.egg
Searching for Pygments>=1.2
Reading http://pypi.python.org/simple/Pygments/
Best match: Pygments 1.6
Downloading http://pypi.python.org/packages/2.7/P/Pygments/Pygments-1.6-py2.7.egg#md5=1e1e52b1e434502682aab08938163034
Processing Pygments-1.6-py2.7.egg
Extracting Pygments-1.6-py2.7.egg to /home/user/.virtualenvs/trequests/build/requests
Installed /home/user/.virtualenvs/trequests/build/requests/Pygments-1.6-py2.7.egg
Searching for markupsafe
Reading http://pypi.python.org/simple/markupsafe/
Best match: MarkupSafe 0.16
Downloading http://pypi.python.org/packages/source/M/MarkupSafe/MarkupSafe-0.16.tar.gz#md5=fe88012f7fe75252efd26cd25a100851
Processing MarkupSafe-0.16.tar.gz
Writing /var/folders/-+/-+ZKNykxGl44h0qzWweTRE+++TI/-Tmp-/easy_install-YPMyiT/MarkupSafe-0.16/setup.cfg
Running MarkupSafe-0.16/setup.py -q bdist_egg --dist-dir /var/folders/-+/-+ZKNykxGl44h0qzWweTRE+++TI/-Tmp-/easy_install-YPMyiT/MarkupSafe-0.16/egg-dist-tmp-taMAUR
Installed /home/user/.virtualenvs/trequests/build/requests/MarkupSafe-0.16-py2.7-macosx-10.6-x86_64.egg
Installing collected packages: requests
Running setup.py install for requests
Successfully installed requests
Cleaning up...
$
```
|
{
"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/1372/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1372/timeline
| null |
completed
| null | null | false
|
[
"Sphinx was added to `setup_requires` by #1302. This seemed reasonable to me at the time, because I naively assumed it would only download Sphix for building the documentation. It does not. \n\nI think we should remove Sphinx from `setup_requires`: if someone really needs to build the documentation they can download it themselves.\n",
"It was a big surprise to me that suddenly requests-1.2.1 pulls in four more packages (or so). I think a quick requests-1.2.2 which just fixes this packaging bug would be warranted before too many people experience the issue. Thanks!\n",
"Curious, what version of pip are you guys using? Doesn't happen on latest.\n\nCould be a setuptools vs distribute thing.\n",
"pip-1.3.1, tried with both distribute and setuptools. Even if it doesn't happen in some configurations, it's bad enough to avoid the issue altogether. FWIW, i am building docs with a tox environment similar to this: http://testrun.org/tox/latest//example/general.html?highlight=sphinx#integrating-sphinx-documentation-checks . It's one way to keep things out of setup.py. \n",
"Of course it's worth fixing, i'm still curious as to why it's not happening on my machine :)\n\nKeeping things out of setup.py is not an issue, but thanks for the input.\n",
"@kennethreitz are you using a clean virtual environment to test it? Using both old and new versions of virtualenv I found the same results: https://gist.github.com/sigmavirus24/5623374\n",
"I must just be lucky :)\n",
"It's fixed with 1.2.2. Thank you.\n"
] |
https://api.github.com/repos/psf/requests/issues/1371
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1371/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1371/comments
|
https://api.github.com/repos/psf/requests/issues/1371/events
|
https://github.com/psf/requests/issues/1371
| 14,550,475
|
MDU6SXNzdWUxNDU1MDQ3NQ==
| 1,371
|
Python 3 encoded form parameters in post request with files
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/3885495?v=4",
"events_url": "https://api.github.com/users/trblae/events{/privacy}",
"followers_url": "https://api.github.com/users/trblae/followers",
"following_url": "https://api.github.com/users/trblae/following{/other_user}",
"gists_url": "https://api.github.com/users/trblae/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/trblae",
"id": 3885495,
"login": "trblae",
"node_id": "MDQ6VXNlcjM4ODU0OTU=",
"organizations_url": "https://api.github.com/users/trblae/orgs",
"received_events_url": "https://api.github.com/users/trblae/received_events",
"repos_url": "https://api.github.com/users/trblae/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/trblae/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/trblae/subscriptions",
"type": "User",
"url": "https://api.github.com/users/trblae",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 2
|
2013-05-21T04:38:08Z
|
2021-09-09T03:00:36Z
|
2013-05-22T01:46:21Z
|
NONE
|
resolved
|
I believe due to pull request #1279 the field parameters (along with values) are encoded to bytes in python3 which makes parameters in post requests that have use encode_multipart_formdata from urllib3/filepost.py show up as <code>"b'stuff'"</code> instead of <code>"stuff"</code> as reported by httpbin.org/post. I've written a quick gist which shows what I'm talking about. It's a modified version of one of the tests in test_requests.py, https://gist.github.com/trblae/5617488.
I've traced the cause of this issue to the dependent package in urllib3/filepost.py. As you can see at line 80 form-data is built via a string format with the field name. It seems in python 3 this produces the bytes representation of the fields. This only happens in specific cases with files or more generally when encode_multipart_formdata is used.
I'm not exactly familiar enough with the differences between python2 and python3 strings to really know how to tackle this issue in order to solve it for both python2 and python3. This is kind of my first rodeo so please let me know if I'm doing something wrong or how I can help.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/3885495?v=4",
"events_url": "https://api.github.com/users/trblae/events{/privacy}",
"followers_url": "https://api.github.com/users/trblae/followers",
"following_url": "https://api.github.com/users/trblae/following{/other_user}",
"gists_url": "https://api.github.com/users/trblae/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/trblae",
"id": 3885495,
"login": "trblae",
"node_id": "MDQ6VXNlcjM4ODU0OTU=",
"organizations_url": "https://api.github.com/users/trblae/orgs",
"received_events_url": "https://api.github.com/users/trblae/received_events",
"repos_url": "https://api.github.com/users/trblae/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/trblae/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/trblae/subscriptions",
"type": "User",
"url": "https://api.github.com/users/trblae",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/1371/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1371/timeline
| null |
completed
| null | null | false
|
[
"Firstly, thanks for opening this issue! This exact bug was found about 8 hours before you opened this, in requests/requests-oauthlib#43. The problem is that all field and file names passed to `encode_multipart_formdata` should be Unicode. As you identified, #1279 caused all of these field and file names to be bytes, not unicode.\n\n@ib-lundgren has proposed a fix across in requests-oauthlib, which involves changing L108 as follows:\n\n```\n- (field.encode('utf-8') if isinstance(field, str) else field,\n+ (field.decode('utf-8') if isinstance(field, bytes) else field,\n```\n\nIf you would like to fix this yourself, you can write a test and apply the fix, then send a Pull Request. Alternatively,@ib-lundgren will probably do that at some point soon. =)\n",
"Looks like pull request #1373 makes it work. Thanks.\n"
] |
https://api.github.com/repos/psf/requests/issues/1370
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1370/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1370/comments
|
https://api.github.com/repos/psf/requests/issues/1370/events
|
https://github.com/psf/requests/pull/1370
| 14,534,567
|
MDExOlB1bGxSZXF1ZXN0NTgxNzIwNA==
| 1,370
|
Add an extra property for Python 3.3
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/240830?v=4",
"events_url": "https://api.github.com/users/sigmavirus24/events{/privacy}",
"followers_url": "https://api.github.com/users/sigmavirus24/followers",
"following_url": "https://api.github.com/users/sigmavirus24/following{/other_user}",
"gists_url": "https://api.github.com/users/sigmavirus24/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/sigmavirus24",
"id": 240830,
"login": "sigmavirus24",
"node_id": "MDQ6VXNlcjI0MDgzMA==",
"organizations_url": "https://api.github.com/users/sigmavirus24/orgs",
"received_events_url": "https://api.github.com/users/sigmavirus24/received_events",
"repos_url": "https://api.github.com/users/sigmavirus24/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/sigmavirus24/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/sigmavirus24/subscriptions",
"type": "User",
"url": "https://api.github.com/users/sigmavirus24",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 1
|
2013-05-20T19:23:02Z
|
2021-09-08T20:01:22Z
|
2013-05-20T19:57:39Z
|
CONTRIBUTOR
|
resolved
|
Fixes #1369
|
{
"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/1370/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1370/timeline
| null | null | false
|
{
"diff_url": "https://github.com/psf/requests/pull/1370.diff",
"html_url": "https://github.com/psf/requests/pull/1370",
"merged_at": "2013-05-20T19:57:39Z",
"patch_url": "https://github.com/psf/requests/pull/1370.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/1370"
}
| true
|
[
"Major +1 on this. Requests doesn't work on Python 3.3.2 without this, so it might be worth rushing out a point release.\n"
] |
https://api.github.com/repos/psf/requests/issues/1369
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1369/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1369/comments
|
https://api.github.com/repos/psf/requests/issues/1369/events
|
https://github.com/psf/requests/issues/1369
| 14,534,424
|
MDU6SXNzdWUxNDUzNDQyNA==
| 1,369
|
Cannot fetch "http://www.google.com/"?
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/2019915?v=4",
"events_url": "https://api.github.com/users/jellyflower/events{/privacy}",
"followers_url": "https://api.github.com/users/jellyflower/followers",
"following_url": "https://api.github.com/users/jellyflower/following{/other_user}",
"gists_url": "https://api.github.com/users/jellyflower/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/jellyflower",
"id": 2019915,
"login": "jellyflower",
"node_id": "MDQ6VXNlcjIwMTk5MTU=",
"organizations_url": "https://api.github.com/users/jellyflower/orgs",
"received_events_url": "https://api.github.com/users/jellyflower/received_events",
"repos_url": "https://api.github.com/users/jellyflower/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/jellyflower/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jellyflower/subscriptions",
"type": "User",
"url": "https://api.github.com/users/jellyflower",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 3
|
2013-05-20T19:19:44Z
|
2021-09-09T02:11:47Z
|
2013-05-20T19:57:39Z
|
NONE
|
resolved
|
```
import requests
r = requests.get('http://www.google.com/')
Traceback (most recent call last):
File "<pyshell#6>", line 1, in <module>
r = requests.get('http://www.google.com/')
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 354, in request
resp = self.send(prep, **send_kwargs)
File "C:\Python33\lib\site-packages\requests\sessions.py", line 460, in send
r = adapter.send(request, **kwargs)
File "C:\Python33\lib\site-packages\requests\adapters.py", line 256, in send
r = self.build_response(request, resp)
File "C:\Python33\lib\site-packages\requests\adapters.py", line 125, in build_response
extract_cookies_to_jar(response.cookies, req, resp)
File "C:\Python33\lib\site-packages\requests\cookies.py", line 105, in extract_cookies_to_jar
jar.extract_cookies(res, req)
File "C:\Python33\lib\http\cookiejar.py", line 1647, in extract_cookies
if self._policy.set_ok(cookie, request):
File "C:\Python33\lib\http\cookiejar.py", line 931, in set_ok
if not fn(cookie, request):
File "C:\Python33\lib\http\cookiejar.py", line 952, in set_ok_verifiability
if request.unverifiable and is_third_party(request):
File "C:\Python33\lib\http\cookiejar.py", line 707, in is_third_party
if not domain_match(req_host, reach(request.origin_req_host)):
AttributeError: 'MockRequest' object has no attribute 'origin_req_host'
```
Using official CPython 3.3.2 binary on Windows 7 x64.
|
{
"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/1369/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1369/timeline
| null |
completed
| null | null | false
|
[
"@jellyflower Thanks for reporting this bug. It's actually one we already knew about: see requests/requests-oauthlib#43.\n\nI wonder if 3.3.2 has introduced a bug in Requests. @sigmavirus24, I'm leaving this for you. =)\n",
"Yeah was just sending the pr\n",
"Yup, I can repro this in OS X on 3.3.2 as well.\n"
] |
https://api.github.com/repos/psf/requests/issues/1368
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1368/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1368/comments
|
https://api.github.com/repos/psf/requests/issues/1368/events
|
https://github.com/psf/requests/issues/1368
| 14,499,679
|
MDU6SXNzdWUxNDQ5OTY3OQ==
| 1,368
|
Content-Type header in requests is duplicated when POSTing bytes
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/4435171?v=4",
"events_url": "https://api.github.com/users/staffanm/events{/privacy}",
"followers_url": "https://api.github.com/users/staffanm/followers",
"following_url": "https://api.github.com/users/staffanm/following{/other_user}",
"gists_url": "https://api.github.com/users/staffanm/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/staffanm",
"id": 4435171,
"login": "staffanm",
"node_id": "MDQ6VXNlcjQ0MzUxNzE=",
"organizations_url": "https://api.github.com/users/staffanm/orgs",
"received_events_url": "https://api.github.com/users/staffanm/received_events",
"repos_url": "https://api.github.com/users/staffanm/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/staffanm/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/staffanm/subscriptions",
"type": "User",
"url": "https://api.github.com/users/staffanm",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 2
|
2013-05-19T18:14:01Z
|
2021-09-09T03:00:37Z
|
2013-05-19T18:51:25Z
|
NONE
|
resolved
|
Using python 3.3 on Mac OS:
```
import requests
requests.post("http://localhost:8080/nonexistent",
headers = {'Content-Type': 'text/plain;charset=UTF-8'},
data=b'foo')
```
results in the following request (captured with tcpdump):
```
POST /nonexistent HTTP/1.1
Host: localhost:8080
Accept-Encoding: identity
Accept-Encoding: gzip, deflate, compress
Content-Type: application/x-www-form-urlencoded
Content-Type: text/plain;charset=UTF-8
Accept: */*
Content-Length: 3
User-Agent: python-requests/1.2.0 CPython/3.3.1 Darwin/12.3.0
foo
```
Note that the specified content-type header is present, but another "Content-Type: application/x-www-form-urlencoded" is added. As far as I can tell, the extra Content-Type header is added at the end of prepare_body in models.py due to `'content-type' in self.headers` not recognizing the existing content-type header in the `self.headers` dict (the key is, at that time, `b'Content-type`, and it seems it's this str <-> bytes comparison that fails).
It is possible to work around this by wrapping the bytes in a BytesIO object (and setting it's len property), but it still seems like a bug?
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/4435171?v=4",
"events_url": "https://api.github.com/users/staffanm/events{/privacy}",
"followers_url": "https://api.github.com/users/staffanm/followers",
"following_url": "https://api.github.com/users/staffanm/following{/other_user}",
"gists_url": "https://api.github.com/users/staffanm/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/staffanm",
"id": 4435171,
"login": "staffanm",
"node_id": "MDQ6VXNlcjQ0MzUxNzE=",
"organizations_url": "https://api.github.com/users/staffanm/orgs",
"received_events_url": "https://api.github.com/users/staffanm/received_events",
"repos_url": "https://api.github.com/users/staffanm/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/staffanm/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/staffanm/subscriptions",
"type": "User",
"url": "https://api.github.com/users/staffanm",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/1368/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1368/timeline
| null |
completed
| null | null | false
|
[
"It is definitely a bug, and we have a PR open that will fix it: #1338. In the meantime, the easiest way to fix it is to make the key of your user-specified Content Type a bytestring: e.g. `b'Content-Type'`.\n",
"Thank you for the quick response! (I guess it's ok to close this issue? )\n"
] |
https://api.github.com/repos/psf/requests/issues/1367
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1367/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1367/comments
|
https://api.github.com/repos/psf/requests/issues/1367/events
|
https://github.com/psf/requests/issues/1367
| 14,493,711
|
MDU6SXNzdWUxNDQ5MzcxMQ==
| 1,367
|
allow Response class to be pickled
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/146392?v=4",
"events_url": "https://api.github.com/users/git2samus/events{/privacy}",
"followers_url": "https://api.github.com/users/git2samus/followers",
"following_url": "https://api.github.com/users/git2samus/following{/other_user}",
"gists_url": "https://api.github.com/users/git2samus/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/git2samus",
"id": 146392,
"login": "git2samus",
"node_id": "MDQ6VXNlcjE0NjM5Mg==",
"organizations_url": "https://api.github.com/users/git2samus/orgs",
"received_events_url": "https://api.github.com/users/git2samus/received_events",
"repos_url": "https://api.github.com/users/git2samus/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/git2samus/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/git2samus/subscriptions",
"type": "User",
"url": "https://api.github.com/users/git2samus",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 18
|
2013-05-19T08:31:34Z
|
2021-09-09T00:34:19Z
|
2013-11-20T09:01:26Z
|
NONE
|
resolved
|
```
Python 2.7.4 (default, Apr 19 2013, 18:32:33)
[GCC 4.7.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import pickle, requests
>>> pickle.dumps(requests.get('http://example.org'))
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.7/pickle.py", line 1374, in dumps
Pickler(file, protocol).dump(obj)
File "/usr/lib/python2.7/pickle.py", line 224, in dump
self.save(obj)
File "/usr/lib/python2.7/pickle.py", line 331, in save
self.save_reduce(obj=obj, *rv)
File "/usr/lib/python2.7/pickle.py", line 419, in save_reduce
save(state)
File "/usr/lib/python2.7/pickle.py", line 286, in save
f(self, obj) # Call unbound method with explicit self
File "/usr/lib/python2.7/pickle.py", line 649, in save_dict
self._batch_setitems(obj.iteritems())
File "/usr/lib/python2.7/pickle.py", line 663, in _batch_setitems
save(v)
File "/usr/lib/python2.7/pickle.py", line 331, in save
self.save_reduce(obj=obj, *rv)
File "/usr/lib/python2.7/pickle.py", line 419, in save_reduce
save(state)
File "/usr/lib/python2.7/pickle.py", line 286, in save
f(self, obj) # Call unbound method with explicit self
File "/usr/lib/python2.7/pickle.py", line 649, in save_dict
self._batch_setitems(obj.iteritems())
File "/usr/lib/python2.7/pickle.py", line 663, in _batch_setitems
save(v)
File "/usr/lib/python2.7/pickle.py", line 331, in save
self.save_reduce(obj=obj, *rv)
File "/usr/lib/python2.7/pickle.py", line 419, in save_reduce
save(state)
File "/usr/lib/python2.7/pickle.py", line 286, in save
f(self, obj) # Call unbound method with explicit self
File "/usr/lib/python2.7/pickle.py", line 649, in save_dict
self._batch_setitems(obj.iteritems())
File "/usr/lib/python2.7/pickle.py", line 663, in _batch_setitems
save(v)
File "/usr/lib/python2.7/pickle.py", line 286, in save
f(self, obj) # Call unbound method with explicit self
File "/usr/lib/python2.7/pickle.py", line 725, in save_inst
save(stuff)
File "/usr/lib/python2.7/pickle.py", line 286, in save
f(self, obj) # Call unbound method with explicit self
File "/usr/lib/python2.7/pickle.py", line 649, in save_dict
self._batch_setitems(obj.iteritems())
File "/usr/lib/python2.7/pickle.py", line 663, in _batch_setitems
save(v)
File "/usr/lib/python2.7/pickle.py", line 286, in save
f(self, obj) # Call unbound method with explicit self
File "/usr/lib/python2.7/pickle.py", line 600, in save_list
self._batch_appends(iter(obj))
File "/usr/lib/python2.7/pickle.py", line 615, in _batch_appends
save(x)
File "/usr/lib/python2.7/pickle.py", line 286, in save
f(self, obj) # Call unbound method with explicit self
File "/usr/lib/python2.7/pickle.py", line 725, in save_inst
save(stuff)
File "/usr/lib/python2.7/pickle.py", line 286, in save
f(self, obj) # Call unbound method with explicit self
File "/usr/lib/python2.7/pickle.py", line 649, in save_dict
self._batch_setitems(obj.iteritems())
File "/usr/lib/python2.7/pickle.py", line 663, in _batch_setitems
save(v)
File "/usr/lib/python2.7/pickle.py", line 306, in save
rv = reduce(self.proto)
File "/usr/lib/python2.7/copy_reg.py", line 77, in _reduce_ex
raise TypeError("a class that defines __slots__ without "
TypeError: a class that defines __slots__ without defining __getstate__ cannot be pickled
```
|
{
"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/1367/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1367/timeline
| null |
completed
| null | null | false
|
[
"Out of interest, what's the use case for this?\n",
"I want to use requests with the multiprocessing module and it uses pickle as the serialization method.\n",
"I may be able to produce a patch if you give me some directions.\n",
"If you want to take a crack at a patch @git2samus, take a look at the Session class. That's picklable and has all the info there. If you would rather one of us do it, I can start to tackle it in half an hour.\n",
"You can't pickle the Response as it contains a link to the connection pool. If you aren't reusing connections you might consider the following:\n\n```\nr = requests.get('http://example.org')\nr.connection.close()\npickle.dumps(r)\n```\n",
"https://github.com/tanelikaivola/requests/commit/229cca8ef0f8a6703cbdce901c0731cacef2b27e is how I solved it.. Just remove the raw-attribute from the __getstate__.\n\nhttps://github.com/tanelikaivola/requests/commit/a5360defdc3f91f4178e2aa1d7136a39a06b2a54 is an alternate way of doing it (which mimics the code style of https://github.com/kennethreitz/requests/commit/590ce29743d6c8d68f3885a949a93fdb68f4d142).\n",
"Any update on this? I just ran into the same issue trying to cache Responses for testing purposes.\n\nI ended up with something like this:\n\n``` python\nr = requests.get('http://example.org')\nr.raw = None\npickle.dumps(r)\n```\n",
"This would be a big help for caching via [Cache Control](https://github.com/ionrock/cachecontrol). At the moment, it is very difficult to cache a response outside of memory because it is difficult to rebuild the object hierarchy.\n\nI did look into caching the raw response and using it to rebuild the response from scratch when a cache is hit, but that would have taken some pretty serious monkey patching of httplib and urllib3.\n\nThe patches by @tanelikaivola seem like they would world without too much trouble.\n",
"@ionrock why not do something like [Betamax](https://github.com/sigmavirus24/betamax) instead of trying to use pickle?\n",
"@sigmavirus24 Thanks for pointing out [Betamax](https://github.com/sigmavirus24/betamax)! I'd argue the serialize/deserialize_response functions would be a great addition to the Response object. If the goal is to avoid pickle, this seems like a great option. Sometimes pickle is a good option though, so I still believe it is worthwhile to add the functionality. I've tested the patch @tanelikaivola and they work well. What else would need to be done to potentially get them merged? Obviously some tests would be helpful. I'd also be happy to see about adding the serialize/deserialize code from Betamax if that would be alright with @sigmavirus24. \n\nLet me know if there is a good way to proceed. I'd be happy to put the code together. \n\n@sigmavirus24 thanks again for the Betamax suggestion. I will be switching [Cache Control](https://github.com/ionrock/cachecontrol) to use that methodology.\n",
"I'm :-1: for adding the serialize/deserialize code from Betamax to requests. For one, I don't believe it takes care of all of the information that could be serialized. As it is Betamax only serializes what it needs to so that it can maintain compatibility with VCR's cassette format. If other people want it in requests proper, we could do that, but I'm not sure it works very well without the rest of betamax.\n",
"@sigmavirus24 Fair enough. I'm most definitely not the expert on everything that a Response object, so I'm happy to take your word for it. When I looked at what a response object contained it was semi-complex as it was a wrapper around a urllib3 HTTPResponse, which is in turn a wrapper around a httplib response, which assumes the content comes directly from a socket (not a file like object). \n\nWith that being the case, it seems to make sense to support pickling of Response object. Again, I'm happy to write some tests for @tanelikaivola's patches if there is a consensus. Otherwise, I'd like to understand where it falls short. At the very least I'd like to try and fix it for myself. \n\nThanks for the discussion!\n",
"Personally I prefer https://github.com/tanelikaivola/requests/commit/a5360defdc3f91f4178e2aa1d7136a39a06b2a54 so if you want to add tests around that, that would be a great start.\n",
"I added a test and made sure there is some assurance that response and the request are in tact before and after pickling. Feel free to take a look 512beb8795f49ed474e3d679dda9524853853378. \n",
"@ionrock :shipit: \n",
"@sigmavirus24 I have no clue what a detective squirrel means (that is a detective squirrel right?), but I'll assume there will be comments later ;)\n\nThe tests are pretty thin, so I'm happy to add more tests. That patch is just my baseline.\n",
"The detective squirrel is the emoji produced by `:shipit:`. God knows why.\n",
"Ah ok. I'll make a pull request then and see how it goes. \n"
] |
https://api.github.com/repos/psf/requests/issues/1366
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1366/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1366/comments
|
https://api.github.com/repos/psf/requests/issues/1366/events
|
https://github.com/psf/requests/issues/1366
| 14,487,489
|
MDU6SXNzdWUxNDQ4NzQ4OQ==
| 1,366
|
TypeError: startswith first arg must be bytes or a tuple of bytes, not str. Python 3.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/352270?v=4",
"events_url": "https://api.github.com/users/michaelhelmick/events{/privacy}",
"followers_url": "https://api.github.com/users/michaelhelmick/followers",
"following_url": "https://api.github.com/users/michaelhelmick/following{/other_user}",
"gists_url": "https://api.github.com/users/michaelhelmick/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/michaelhelmick",
"id": 352270,
"login": "michaelhelmick",
"node_id": "MDQ6VXNlcjM1MjI3MA==",
"organizations_url": "https://api.github.com/users/michaelhelmick/orgs",
"received_events_url": "https://api.github.com/users/michaelhelmick/received_events",
"repos_url": "https://api.github.com/users/michaelhelmick/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/michaelhelmick/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/michaelhelmick/subscriptions",
"type": "User",
"url": "https://api.github.com/users/michaelhelmick",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 6
|
2013-05-18T19:07:07Z
|
2021-09-09T03:00:33Z
|
2013-05-29T08:20:37Z
|
NONE
|
resolved
|
Python 3
_requirements.txt_
```
requests==1.2.0
requests_oauthlib==0.3.1
```
Stacktrace:
```
Traceback (most recent call last):
File "/home/travis/build/ryanmcgrath/twython/test_twython.py", line 293, in test_create_and_destroy_favorite
self.api.create_favorite(id=test_tweet_id)
File "/home/travis/build/ryanmcgrath/twython/twython/twython.py", line 87, in <lambda>
return lambda **kwargs: self._constructFunc(key, deprecated_key, **kwargs)
File "/home/travis/build/ryanmcgrath/twython/twython/twython.py", line 126, in _constructFunc
content = self._request(url, method=fn['method'], params=kwargs)
File "/home/travis/build/ryanmcgrath/twython/twython/twython.py", line 142, in _request
response = func(url, data=params, files=files)
File "/home/travis/virtualenv/python3.3/lib/python3.3/site-packages/requests/sessions.py", line 399, in post
return self.request('POST', url, data=data, **kwargs)
File "/home/travis/virtualenv/python3.3/lib/python3.3/site-packages/requests/sessions.py", line 354, in request
resp = self.send(prep, **send_kwargs)
File "/home/travis/virtualenv/python3.3/lib/python3.3/site-packages/requests/sessions.py", line 455, in send
adapter = self.get_adapter(url=request.url)
File "/home/travis/virtualenv/python3.3/lib/python3.3/site-packages/requests/sessions.py", line 489, in get_adapter
if url.startswith(prefix):
TypeError: startswith first arg must be bytes or a tuple of bytes, not str
```
Alright, so basically, my tests are failing.
It ends up being that when using `oauthlib` (from `requests-oauthlib`) in conjunction with `requests`.. `oauthlib` actually converts the url being passed to `bytes` and when `requests/sessions.py` tries to get the adapter on line 455 (`requests` 1.2.0) in the `get_adapter` function, it goes through a forloop and at that point (line 489):
``` python
if url.startswith(prefix):
```
`url` is `bytes` from `oauthlib.oauth1.Client.sign` every point before that it's a `str` (trust me, I did extensive filtering to see where the hell it was getting converted from `str` to `bytes` haha)
Where should this be fixed though?
- `oauthlib`.. it should be returning `str` for the url in the sign function
- `requests_oauthlib`.. after it calls `self.client.sign` from `oauthlib.oauth1.Client.sign` we should convert `r.url` back to a `str` before sending it to `requests`
OR
- `requests`.. always convert `url` to a `str` in `get_adapter`
|
{
"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/1366/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1366/timeline
| null |
completed
| null | null | false
|
[
"/cc @idan\n",
"Specifically, in `oauthlib` it happens here: https://github.com/idan/oauthlib/blob/master/oauthlib/oauth1/rfc5849/__init__.py#L288-L290\nBefore the URI is encoded, it's a `str` and after.. `bytes`\n\nAlso, via `requests_oauthlib` passing `None` for the `decoding` kwarg, this error is raised:\n\n```\nTraceback (most recent call last):\n File \"<stdin>\", line 1, in <module>\n File \"./twython/twython.py\", line 87, in <lambda>\n return lambda **kwargs: self._constructFunc(key, deprecated_key, **kwargs)\n File \"./twython/twython.py\", line 127, in _constructFunc\n content = self._request(url, method=fn['method'], params=kwargs)\n File \"./twython/twython.py\", line 144, in _request\n response = func(url, params=params)\n File \"/Users/mikehelmick/.virtualenv/twython3k/lib/python3.3/site-packages/requests/sessions.py\", line 372, in get\n return self.request('GET', url, **kwargs)\n File \"/Users/mikehelmick/.virtualenv/twython3k/lib/python3.3/site-packages/requests/sessions.py\", line 357, in request\n resp = self.send(prep, **send_kwargs)\n File \"/Users/mikehelmick/.virtualenv/twython3k/lib/python3.3/site-packages/requests/sessions.py\", line 464, in send\n r = adapter.send(request, **kwargs)\n File \"/Users/mikehelmick/.virtualenv/twython3k/lib/python3.3/site-packages/requests/adapters.py\", line 256, in send\n r = self.build_response(request, resp)\n File \"/Users/mikehelmick/.virtualenv/twython3k/lib/python3.3/site-packages/requests/adapters.py\", line 125, in build_response\n extract_cookies_to_jar(response.cookies, req, resp)\n File \"/Users/mikehelmick/.virtualenv/twython3k/lib/python3.3/site-packages/requests/cookies.py\", line 105, in extract_cookies_to_jar\n jar.extract_cookies(res, req)\n File \"/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/http/cookiejar.py\", line 1647, in extract_cookies\n if self._policy.set_ok(cookie, request):\n File \"/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/http/cookiejar.py\", line 931, in set_ok\n if not fn(cookie, request):\n File \"/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/http/cookiejar.py\", line 952, in set_ok_verifiability\n if request.unverifiable and is_third_party(request):\n File \"/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/http/cookiejar.py\", line 707, in is_third_party\n if not domain_match(req_host, reach(request.origin_req_host)):\nAttributeError: 'MockRequest' object has no attribute 'origin_req_host'\n```\n",
"`oauthlib` isn't liable here: `requests-oauthlib` explicitly asks for bytestrings back. I think `requests-oauthlib` needs to sort this out. I'll take a look.\n",
"To explain, we ask for bytes back from `oauthlib` in `requests-oauthlib` because of the various UnicodeDecodeErrors we got in #1252.\n",
"See requests/requests-oauthlib#43 for the fix.\n",
"Resolved by requests/requests-oauthlib#43. As always Mike, thanks for the bug report and the investigation. =)\n"
] |
https://api.github.com/repos/psf/requests/issues/1365
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1365/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1365/comments
|
https://api.github.com/repos/psf/requests/issues/1365/events
|
https://github.com/psf/requests/issues/1365
| 14,485,884
|
MDU6SXNzdWUxNDQ4NTg4NA==
| 1,365
|
Uploading Files
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1909519?v=4",
"events_url": "https://api.github.com/users/pyed/events{/privacy}",
"followers_url": "https://api.github.com/users/pyed/followers",
"following_url": "https://api.github.com/users/pyed/following{/other_user}",
"gists_url": "https://api.github.com/users/pyed/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/pyed",
"id": 1909519,
"login": "pyed",
"node_id": "MDQ6VXNlcjE5MDk1MTk=",
"organizations_url": "https://api.github.com/users/pyed/orgs",
"received_events_url": "https://api.github.com/users/pyed/received_events",
"repos_url": "https://api.github.com/users/pyed/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/pyed/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/pyed/subscriptions",
"type": "User",
"url": "https://api.github.com/users/pyed",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 10
|
2013-05-18T16:53:39Z
|
2021-09-09T03:00:38Z
|
2013-05-18T21:59:24Z
|
NONE
|
resolved
|
I'm trying to upload files to server, let's take this simple page as example:
http://fiberdk.horus.feralhosting.com/
this page will get .torrent file and it will fix it if it's broke, I would do something like this:
url = 'http://fiberdk.horus.feralhosting.com/'
files = {'torrent': open('torrent.torrent', 'rb')}
r = requests.post(url, files=files)
but this didn't work for me, and all i can get from googling is the same results.
|
{
"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/1365/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1365/timeline
| null |
completed
| null | null | false
|
[
"In that sense did it not work for you? It seems to work just fine for me. Can you tell me how it failed to work?\n",
"well if I do \"r.content\" it would be the same as [ r = requests.get(url) ] 's content, so nothing is happening\n- I tested it on other pages without any luck, i'm giving this page as example, the other pages i'm working with should return some text if you upload something, and if i check \" r.text \" I won't get that text like \"You Uploaded something\" or \"Your upload didn't work\", so basically i'm not posting anything :(\n",
"Can you provide requests.**version** for me?\n",
"'0.14.2'\n",
"Hmm. Are you bound to 0.14.2, or are you able to upgrade? We haven't really supported 0.14.2 for a while...\n",
"W00t! I just realised that i'm using this too old version, i'll upgrade and test again. \n",
"well, i'm now using version 1.2.0 and still facing the same problem here's my test:\n\nIn [1]: import requests\n\nIn [2]: files = {'torrent': open('torrent.torrent', 'rb')}\n\nIn [3]: url = 'http://fiberdk.horus.feralhosting.com'\n\nIn [4]: post = requests.post(url, files)\n\nIn [5]: get = requests.get(url)\n\nIn [6]: post.content == get.content\nOut[6]: True\n",
"In line 4, can you change it to read:\n\n``` python\npost = requests.post(url, files=files)\n```\n\nand try again?\n",
"YESSS, I was missing (files=files), my bad :-1: \n\nI really appreciate your help Lukasa :+1: \n",
"Always happy to help. Thanks for raising the issue, let me know if you encounter any more problems!\n"
] |
https://api.github.com/repos/psf/requests/issues/1364
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1364/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1364/comments
|
https://api.github.com/repos/psf/requests/issues/1364/events
|
https://github.com/psf/requests/issues/1364
| 14,432,225
|
MDU6SXNzdWUxNDQzMjIyNQ==
| 1,364
|
Make HTTPResponse support `io`
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/346587?v=4",
"events_url": "https://api.github.com/users/eteq/events{/privacy}",
"followers_url": "https://api.github.com/users/eteq/followers",
"following_url": "https://api.github.com/users/eteq/following{/other_user}",
"gists_url": "https://api.github.com/users/eteq/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/eteq",
"id": 346587,
"login": "eteq",
"node_id": "MDQ6VXNlcjM0NjU4Nw==",
"organizations_url": "https://api.github.com/users/eteq/orgs",
"received_events_url": "https://api.github.com/users/eteq/received_events",
"repos_url": "https://api.github.com/users/eteq/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/eteq/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/eteq/subscriptions",
"type": "User",
"url": "https://api.github.com/users/eteq",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 6
|
2013-05-16T23:45:58Z
|
2021-09-09T03:00:29Z
|
2013-05-16T23:55:51Z
|
NONE
|
resolved
|
Right now, the following does not work:
```
>>> r = requests.get('http://www.google.com',stream=True)
>>> io.BufferedReader(r.raw).read()
AttributeError: 'HTTPResponse' object has no attribute 'readable'
```
That is, the `requests.packages.urllib3.response.HTTPResponse` object does not respect the `io` API. The following _does_ work, however:
```
>>> r = requests.get('http://www.google.com',stream=True)
>>> r.raw.readable=lambda:True
>>> r.raw.closed=False
>>> io.BufferedReader(r.raw).read()
```
Suggesting that the main thing that is neeeded is a `readable` method and a `closed` attribute. (I think `flush` and `close` are probably also necessary, and maybe also `writable` and `seekable`).
Is there a reason this is not possible, or would it be fine to just add the relevant methods to `HTTPResponse`?
|
{
"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/1364/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1364/timeline
| null |
completed
| null | null | false
|
[
"I suggest you open this on shazow/urllib3. We do not make any changes to urllib3, we simply vendor the excellent package to prevent users having to download additional dependencies.\n",
"Ahh, my mistake - sorry for the noise!\n",
"No worries!\n",
"@sigmavirus24 - this has now been added in shazow/urllib3#187. Is there a regular \"timetable\" for when you pull in a new `urllib3`? Or is it just whenever they have a release?\n",
"@eteq: It's mostly 'whenever'. I'll bear in mind that this is a high priority for you though, and try to bug Kenneth to include an update in our next release. =)\n",
"Ok, great, thanks!\n"
] |
https://api.github.com/repos/psf/requests/issues/1363
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1363/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1363/comments
|
https://api.github.com/repos/psf/requests/issues/1363/events
|
https://github.com/psf/requests/pull/1363
| 14,413,040
|
MDExOlB1bGxSZXF1ZXN0NTc1NjQ2Ng==
| 1,363
|
Fix for #1362
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/350812?v=4",
"events_url": "https://api.github.com/users/dave-shawley/events{/privacy}",
"followers_url": "https://api.github.com/users/dave-shawley/followers",
"following_url": "https://api.github.com/users/dave-shawley/following{/other_user}",
"gists_url": "https://api.github.com/users/dave-shawley/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/dave-shawley",
"id": 350812,
"login": "dave-shawley",
"node_id": "MDQ6VXNlcjM1MDgxMg==",
"organizations_url": "https://api.github.com/users/dave-shawley/orgs",
"received_events_url": "https://api.github.com/users/dave-shawley/received_events",
"repos_url": "https://api.github.com/users/dave-shawley/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/dave-shawley/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/dave-shawley/subscriptions",
"type": "User",
"url": "https://api.github.com/users/dave-shawley",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 6
|
2013-05-16T15:56:53Z
|
2021-09-08T20:01:23Z
|
2013-05-17T06:23:04Z
|
CONTRIBUTOR
|
resolved
|
- Replaced usage of `urlparse` in `PreparedRequest.prepare_url` with `urllib3` equivalent.
- Modified IDNA encoding section so that it only encodes the host portion of the URL
|
{
"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/1363/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1363/timeline
| null | null | false
|
{
"diff_url": "https://github.com/psf/requests/pull/1363.diff",
"html_url": "https://github.com/psf/requests/pull/1363",
"merged_at": "2013-05-17T06:23:04Z",
"patch_url": "https://github.com/psf/requests/pull/1363.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/1363"
}
| true
|
[
"Can you squash these commits? The first (dd41e22) is unnecessary and a bit misleading. The only relevant commits here are 38d4ad6 and 25c1f75. Otherwise :+1:.\n\nIf you need help with squashing, let me know.\n",
"@sigmavirus24 does 6e76ab7 do the job? I'm relatively new to git so it wouldn't surprise me if I mucked something up.\n",
"@dave-shawley it most certainly does! Thank you kind sir!\n\n:+1: for @kennethreitz when he comes around these parts again\n",
"Very nice! :+1:\n",
":cake:\n",
"Congrats @dave-shawley :cake:\n"
] |
https://api.github.com/repos/psf/requests/issues/1362
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1362/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1362/comments
|
https://api.github.com/repos/psf/requests/issues/1362/events
|
https://github.com/psf/requests/issues/1362
| 14,409,270
|
MDU6SXNzdWUxNDQwOTI3MA==
| 1,362
|
prepare_url fails for long username and passwords
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/350812?v=4",
"events_url": "https://api.github.com/users/dave-shawley/events{/privacy}",
"followers_url": "https://api.github.com/users/dave-shawley/followers",
"following_url": "https://api.github.com/users/dave-shawley/following{/other_user}",
"gists_url": "https://api.github.com/users/dave-shawley/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/dave-shawley",
"id": 350812,
"login": "dave-shawley",
"node_id": "MDQ6VXNlcjM1MDgxMg==",
"organizations_url": "https://api.github.com/users/dave-shawley/orgs",
"received_events_url": "https://api.github.com/users/dave-shawley/received_events",
"repos_url": "https://api.github.com/users/dave-shawley/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/dave-shawley/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/dave-shawley/subscriptions",
"type": "User",
"url": "https://api.github.com/users/dave-shawley",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 1
|
2013-05-16T14:44:50Z
|
2021-09-09T03:00:38Z
|
2013-05-16T17:25:42Z
|
CONTRIBUTOR
|
resolved
|
`PreparedRequest.prepare_url` incorrectly applies IDNA encoding to the URL's `netloc`. It should only be encoding the hostname portion of the URL. The `netloc` is described in [RFC2396](http://tools.ietf.org/html/rfc2396#section-3.2.2) as:
```
<userinfo>@<host>:<port>
```
IDNA should only be applied to the `host` portion of the URL.
I encountered this when integrating with an API that uses UUIDs as the username and password. This results in a `netloc` that is far larger than a 64 character DNS label. The result is the following stack trace:
``` python
Traceback (most recent call last):
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/unittest.py", line 279, in run
testMethod()
File "/Users/daves/Source/requests/test_requests.py", line 528, in test_uuid_user_and_password_components
prepped = r.prepare()
File "/Users/daves/Source/requests/requests/models.py", line 221, in prepare
p.prepare_url(self.url, self.params)
File "/Users/daves/Source/requests/requests/models.py", line 298, in prepare_url
raise InvalidURL('URL has an invalid label.')
InvalidURL: URL has an invalid label.
```
The fix is pretty simple - split the `netloc` into its components, IDNA encode the `host` portion, and recombine.
|
{
"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/1362/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1362/timeline
| null |
completed
| null | null | false
|
[
"Because you're awesome you've already opened a Pull Request for this (#1363). =D I'm going to close the issue to centralise the discussion there.\n\nThanks so much for pointing this out! =D\n"
] |
https://api.github.com/repos/psf/requests/issues/1361
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1361/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1361/comments
|
https://api.github.com/repos/psf/requests/issues/1361/events
|
https://github.com/psf/requests/pull/1361
| 14,400,646
|
MDExOlB1bGxSZXF1ZXN0NTc0OTYzNA==
| 1,361
|
Always percent-encode location 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 | 1
|
2013-05-16T11:05:45Z
|
2021-09-08T20:01:22Z
|
2013-05-20T20:04:08Z
|
MEMBER
|
resolved
|
If we don't, stupid servers that don't do it themselves can hurt us badly.
Resolves #1360.
|
{
"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/1361/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1361/timeline
| null | null | false
|
{
"diff_url": "https://github.com/psf/requests/pull/1361.diff",
"html_url": "https://github.com/psf/requests/pull/1361",
"merged_at": "2013-05-20T20:04:08Z",
"patch_url": "https://github.com/psf/requests/pull/1361.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/1361"
}
| true
|
[
":cake:\n"
] |
https://api.github.com/repos/psf/requests/issues/1360
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1360/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1360/comments
|
https://api.github.com/repos/psf/requests/issues/1360/events
|
https://github.com/psf/requests/issues/1360
| 14,396,969
|
MDU6SXNzdWUxNDM5Njk2OQ==
| 1,360
|
Problem with 301-redirect
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/966525?v=4",
"events_url": "https://api.github.com/users/Cosmologist/events{/privacy}",
"followers_url": "https://api.github.com/users/Cosmologist/followers",
"following_url": "https://api.github.com/users/Cosmologist/following{/other_user}",
"gists_url": "https://api.github.com/users/Cosmologist/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Cosmologist",
"id": 966525,
"login": "Cosmologist",
"node_id": "MDQ6VXNlcjk2NjUyNQ==",
"organizations_url": "https://api.github.com/users/Cosmologist/orgs",
"received_events_url": "https://api.github.com/users/Cosmologist/received_events",
"repos_url": "https://api.github.com/users/Cosmologist/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Cosmologist/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Cosmologist/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Cosmologist",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 4
|
2013-05-16T09:16:48Z
|
2021-09-09T03:00:37Z
|
2013-05-20T20:04:08Z
|
NONE
|
resolved
|
I have a problem with downloading a file, when the server returns the 301 code:
``` python
r = requests.get('http://servag.rupsy.ru/track.php?url=2013-04-11/Haatzumaniak_-_Dark_Sadhu_[2013]/03.%20Haatzumaniak_-_777_Dark%20Sadhu%202013.mp3&arj=Haatzumaniak_-_Dark_Sadhu_[2013].ZIP')
print(r)
```
If you do redirect manually - it works fine:
``` python
r = requests.get('http://servag.rupsy.ru/track.php?url=2013-04-11/Haatzumaniak_-_Dark_Sadhu_[2013]/03.%20Haatzumaniak_-_777_Dark%20Sadhu%202013.mp3&arj=Haatzumaniak_-_Dark_Sadhu_[2013].ZIP', allow_redirects=False)
r = requests.get(r.headers['Location'])
print(r)
```
The problem appears to Python 3.3 and python-requests-1.2.0/python-requests-dev
```
Traceback (most recent call last):
File "C:\Dropbox\projects\Helpers\ph\.envwin32\lib\site-packages\requests\packages\urllib3\connectionpool.py", line 428, in urlopen
body=body, headers=headers)
File "C:\Dropbox\projects\Helpers\ph\.envwin32\lib\site-packages\requests\packages\urllib3\connectionpool.py", line 290, in _make_request
httplib_response = conn.getresponse()
File "c:\Python33\lib\http\client.py", line 1143, in getresponse
response.begin()
File "c:\Python33\lib\http\client.py", line 354, in begin
version, status, reason = self._read_status()
File "c:\Python33\lib\http\client.py", line 324, in _read_status
raise BadStatusLine(line)
http.client.BadStatusLine: ''
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Dropbox\projects\Helpers\ph\.envwin32\lib\site-packages\requests\adapters.py", line 283, in send
timeout=timeout
File "C:\Dropbox\projects\Helpers\ph\.envwin32\lib\site-packages\requests\packages\urllib3\connectionpool.py", line 474, in urlopen
raise MaxRetryError(self, url, e)
requests.packages.urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='servag.rupsy.ru', port=80): Max retries exceeded with url: /media/2/Haatzumaniak_-_Dark_Sadhu_[2013]/03. Haatzumaniak_-_777_Dark Sadhu 2013.mp3 (Caused by <class 'http.client.BadStatusLine'>: '')
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:/Dropbox/projects/InfoStreams/test.py", line 25, in <module>
allow_redirects=True)
File "C:\Dropbox\projects\Helpers\ph\.envwin32\lib\site-packages\requests\api.py", line 55, in get
return request('get', url, **kwargs)
File "C:\Dropbox\projects\Helpers\ph\.envwin32\lib\site-packages\requests\api.py", line 44, in request
return session.request(method=method, url=url, **kwargs)
File "C:\Dropbox\projects\Helpers\ph\.envwin32\lib\site-packages\requests\sessions.py", line 345, in request
resp = self.send(prep, **send_kwargs)
File "C:\Dropbox\projects\Helpers\ph\.envwin32\lib\site-packages\requests\sessions.py", line 464, in send
history = [resp for resp in gen] if allow_redirects else []
File "C:\Dropbox\projects\Helpers\ph\.envwin32\lib\site-packages\requests\sessions.py", line 464, in <listcomp>
history = [resp for resp in gen] if allow_redirects else []
File "C:\Dropbox\projects\Helpers\ph\.envwin32\lib\site-packages\requests\sessions.py", line 154, in resolve_redirects
allow_redirects=False,
File "C:\Dropbox\projects\Helpers\ph\.envwin32\lib\site-packages\requests\sessions.py", line 448, in send
r = adapter.send(request, **kwargs)
File "C:\Dropbox\projects\Helpers\ph\.envwin32\lib\site-packages\requests\adapters.py", line 318, in send
raise ConnectionError(e)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='servag.rupsy.ru', port=80): Max retries exceeded with url: /media/2/Haatzumaniak_-_Dark_Sadhu_[2013]/03. Haatzumaniak_-_777_Dark Sadhu 2013.mp3 (Caused by <class 'http.client.BadStatusLine'>: '')
```
|
{
"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/1360/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1360/timeline
| null |
completed
| null | null | false
|
[
"Uh...can I ask you to uninstall and reinstall Requests? The TypeError that got thrown should have been impossible to hit, because it's inside a Try/Catch block that catches TypeErrors.\n",
"Ignore the first trace (I'll delete it), the key of the problem is:\n\n```\nFile \"c:\\Python33\\lib\\http\\client.py\", line 324, in _read_status\n raise BadStatusLine(line)\n```\n",
"Ah, ok, got it.\n\nThe issue is that the remote server is not following RFC 2616. The Location header should be percent-encoded, and hasn't been. This doesn't matter if you pass the URL through Requests from the top, because it gets percent-encoded by prepare_url.\n\n**EDIT**: To be clear, we should handle this: I'll have a fix ready shortly.\n",
"Lucasa, thank you very much - now works fine\n"
] |
https://api.github.com/repos/psf/requests/issues/1359
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1359/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1359/comments
|
https://api.github.com/repos/psf/requests/issues/1359/events
|
https://github.com/psf/requests/issues/1359
| 14,351,109
|
MDU6SXNzdWUxNDM1MTEwOQ==
| 1,359
|
Wrong results using proxies and HTTPS
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/207754?v=4",
"events_url": "https://api.github.com/users/astratto/events{/privacy}",
"followers_url": "https://api.github.com/users/astratto/followers",
"following_url": "https://api.github.com/users/astratto/following{/other_user}",
"gists_url": "https://api.github.com/users/astratto/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/astratto",
"id": 207754,
"login": "astratto",
"node_id": "MDQ6VXNlcjIwNzc1NA==",
"organizations_url": "https://api.github.com/users/astratto/orgs",
"received_events_url": "https://api.github.com/users/astratto/received_events",
"repos_url": "https://api.github.com/users/astratto/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/astratto/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/astratto/subscriptions",
"type": "User",
"url": "https://api.github.com/users/astratto",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 6
|
2013-05-15T09:56:52Z
|
2021-09-09T02:11:39Z
|
2013-05-15T10:24:22Z
|
NONE
|
resolved
|
Hi!
I've found that requests behaves quite weirdly when using a proxy with HTTPS endpoints.
It doesn't change if the proxy is specified using environment variables or using the _proxies_ attribute.
### Without proxy
```
import requests
rs = requests.session()
res = rs.request("get",
"https://api.bitbucket.org/1.0/repositories/tutorials/tutorials.bitbucket.org")
print res.text
>> u'{\n "scm": "hg",
...
"/1.0/repositories/tutorials/tutorials.bitbucket.org"\n}'
```
### Using a proxy
```
import requests
rs = requests.session()
proxies = { 'https': "http://localhost:3128" }
res = rs.request("get",
"https://api.bitbucket.org/1.0/repositories/tutorials/tutorials.bitbucket.org",
proxies=proxies)
print res.text
>> u'<HTML></HTML>\r\n'
```
Note 1: that proxy uses a CNTML authentication
Note 2: it works with HTTP endpoints
|
{
"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/1359/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1359/timeline
| null |
completed
| null | null | false
|
[
"Requests' current implementation of proxying is lacking when it comes to HTTPS, and right now there isn't a lot we can do about it. We're waiting on shazow/urllib3#170 (which was shazow/urllib3#139, which was intended to resolve shazow/urllib3#50, just in case you wanted to know how long this has been going on) to implement the HTTP CONNECT verb in urllib3.\n\nAt the moment, if you try to proxy an HTTPS connection through an HTTP proxy, everything is just...weird. I've seen a wide variety of behaviour. In the best case, the proxy will see that you requested an HTTPS connection and will create such a connection between itself and the endpoint, then strip the SSL and send the data to you over HTTP, but realistically that rarely happens.\n\nThanks for reporting this bug, and I'm sorry there isn't more we can do right now. You're one of a fairly long list of people who is waiting on this, and I promise that it is very, very high up our list of priorities.\n",
"@astratto Can you try: https://github.com/shazow/urllib3/pull/170#issuecomment-21234629\n",
"@schlamar I've just tried and it works! Great!\n\n``` python\nimport sys\nsys.path.insert(0, 'requests-new-urllib3-api/requests/packages/')\nsys.path.insert(0, 'requests-new-urllib3-api')\n\nimport requests\nrs = requests.session()\n\nproxies = { 'https': \"http://localhost:3128\" }\nres = rs.request(\"get\",\n... \"https://api.bitbucket.org/1.0/repositories/tutorials/tutorials.bitbucket.org\",\n... proxies=proxies)\n\nprint res.text\n{\"scm\": \"hg\", \"has_wiki\": true, \"last_updated\": \"2013-07-19 08:30:48\", \"creator\": null, \"forks_count\": 3036, \"created_on\": \"2011-12-20 17:35:06\", \"owner\": \"tutorials\", \"logo\": \"https://bitbucket-assetroot.s3.amazonaws.com/c/photos/2012/Nov/28/tutorials.bitbucket.org-logo-1456883302-9_avatar.png\", \"email_mailinglist\": \"\\ndocs@bitbucket.org\", \"is_mq\": false, \"size\": 50212734, \"read_only\": false, \"fork_of\": null, \"mq_of\": null, \"followers_count\": 14, \"state\": \"available\", \"utc_created_on\": \"2011-12-20 16:35:06+00:00\", \"website\": \"\", \"description\": \"Site for tutorial101 files\", \"has_issues\": true, \"is_fork\": false, \"slug\": \"tutorials.bitbucket.org\", \"is_private\": false, \"name\": \"tutorials.bitbucket.org\", \"language\": \"html/css\", \"utc_last_updated\": \"2013-07-19 06:30:48+00:00\", \"email_writers\": true, \"no_public_forks\": false, \"resource_uri\": \"/1.0/repositories/tutorials/tutorials.bitbucket.org\"}\n```\n",
"The above seems to get rid of the following error:\n`requests.exceptions.HTTPError: 501 Server Error: Not Implemented`\n\nhowever it seems as though auth still doesn't work when requesting a https page. I'm now getting:\n`requests.packages.urllib3.exceptions.ProxyError: Cannot connect to proxy. Socket error: Tunnel connection failed: 407 Proxy Authentication Required.`\n\nAny insight?\n",
"How are you authorising?\n",
"Ignore that, I've spotted the problem. Yeah, with that set of code you won't get the Proxy-Authorization header. I'll mention it over at our PR.\n"
] |
https://api.github.com/repos/psf/requests/issues/1358
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1358/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1358/comments
|
https://api.github.com/repos/psf/requests/issues/1358/events
|
https://github.com/psf/requests/issues/1358
| 14,292,575
|
MDU6SXNzdWUxNDI5MjU3NQ==
| 1,358
|
HTTPDigest working with CURL but not Requests?
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/10137?v=4",
"events_url": "https://api.github.com/users/ghost/events{/privacy}",
"followers_url": "https://api.github.com/users/ghost/followers",
"following_url": "https://api.github.com/users/ghost/following{/other_user}",
"gists_url": "https://api.github.com/users/ghost/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/ghost",
"id": 10137,
"login": "ghost",
"node_id": "MDQ6VXNlcjEwMTM3",
"organizations_url": "https://api.github.com/users/ghost/orgs",
"received_events_url": "https://api.github.com/users/ghost/received_events",
"repos_url": "https://api.github.com/users/ghost/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/ghost/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/ghost/subscriptions",
"type": "User",
"url": "https://api.github.com/users/ghost",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 11
|
2013-05-14T03:38:53Z
|
2021-09-09T03:00:35Z
|
2013-05-23T02:18:29Z
|
NONE
|
resolved
|
I am making a request using:
``` python
r = requests.get(url, auth=HTTPDigestAuth(username, password))
```
but this shoots back a 401. However, when I use the cURL command:
```
curl --digest -u username:password url
```
it works and I receive the correct response.
Is there a difference between cURL's "--digest" tag and the HTTPDigestAuth class?
| null |
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/1358/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1358/timeline
| null |
completed
| null | null | false
|
[
"Could you provide the version of requests you're using?\n",
"Additionally, can you provide `r.history` for your failed request?\n",
"Using pip freeze | grep requests shows that I am on 1.2.0.\n\nMy r.history returns \"[<Response [401]>]\".\n",
"Ok, can you get cURL to print out the headers it has sent, and also print out `r.request.headers`?\n",
"cUrl:\n\n```\nHTTP/1.1 401 Unauthorized\nPath=/; HttpOnly\nWWW-Authenticate: Digest realm=\"Contacts Realm via Digest Authentication\"\nqop=\"auth\"\nContent-Type= text/html; charset=utf-8\n\nHTTP/1.1 200 OK\nPath=/; HttpOnly\nVary: Accept-Encoding\n```\n\nr.request.headers:\n\n```\nAuthorization :\n realm=\"Contacts Realm via Authentication\"\n uri=\"/\"\n qop=auth\n nc=00000001\nAccept-Encoding : gzip, deflate, compress\nAccept: \"*/*\"\nUser-Age : python-requests/1.2.0 CPython/2.7.3 CYGWIN_NT-6.1-WOW64/1.7.17(0.262/5/3)\n```\n\nSince the URL is third party I tried to remove anything incriminating in the headers. Let me know if you need something I may have omitted. I'm new to this but it appears that I get two responses using cURL?\n",
"You get two responses using Requests too: the difference is that they're a 401 followed by a 401. This is why I'm wondering if you're using an incorrect username/password combination: you seem not to be being logged in.\n",
"I apologize for not mentioning this sooner but part of the response HTML states:\n\n```\n<h1>HTTP Status 401 - Response realm name {0} does not match system realm name of {1}</h1>\n```\n\nMaybe that is telling of something?\n\nI've triple checked the username and password with the one I use for the cURL request and it's the same one.\n",
"/me suspects it's this one: https://github.com/kennethreitz/requests/pull/1242/files (`Digest` is missing in request.headers).\nMaybe the call to `pat.sub()` should specify `count=1` (Only guessing, not familiar with the code)\n",
"You're absolutely correct, thanks! It seems that one of my headers in the first response is:\n\n```\n'Digest realm=\"Contacts Realm via Digest Authentication\"\n```\n\nand that pattern actually eats both Digests, when it should really look like:\n\n```\n'realm=\"Contacts Realm via Digest Authentication\"\n```\n\nWhen I manually replace the 'realm' header and send the second response I receive a 200 reply.\n",
"Just confirmed it locally using apache. PR is submitted, should I also write a test? FYI httpbin doesn't verify the realm (its realm is hardcoded in fact)\n",
"I will close this tonight if everything checks out on the original example. Thanks for all of your help!\n"
] |
https://api.github.com/repos/psf/requests/issues/1357
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1357/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1357/comments
|
https://api.github.com/repos/psf/requests/issues/1357/events
|
https://github.com/psf/requests/pull/1357
| 14,229,089
|
MDExOlB1bGxSZXF1ZXN0NTY2MDkzNw==
| 1,357
|
Fixing the adapter matching to be most-specific first.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/107076?v=4",
"events_url": "https://api.github.com/users/Zoramite/events{/privacy}",
"followers_url": "https://api.github.com/users/Zoramite/followers",
"following_url": "https://api.github.com/users/Zoramite/following{/other_user}",
"gists_url": "https://api.github.com/users/Zoramite/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Zoramite",
"id": 107076,
"login": "Zoramite",
"node_id": "MDQ6VXNlcjEwNzA3Ng==",
"organizations_url": "https://api.github.com/users/Zoramite/orgs",
"received_events_url": "https://api.github.com/users/Zoramite/received_events",
"repos_url": "https://api.github.com/users/Zoramite/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Zoramite/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Zoramite/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Zoramite",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 4
|
2013-05-12T00:40:41Z
|
2021-09-08T20:01:21Z
|
2013-05-12T01:00:30Z
|
CONTRIBUTOR
|
resolved
|
While trying to create a custom adapter I noticed that it wasn't actually using my custom adapter, instead it was using the default adapter.
When the `get_adapter` is called there is no order for the matching so it was matching the default `https://` adapter even though I called `mount` with a `https://www.example.com`.
This change should make it always match the most specific path that matches a URL.
For example, the following mounted adapters should always match in this order:
https://www.example.com/sub/dir
https://www.example.com
https://
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/107076?v=4",
"events_url": "https://api.github.com/users/Zoramite/events{/privacy}",
"followers_url": "https://api.github.com/users/Zoramite/followers",
"following_url": "https://api.github.com/users/Zoramite/following{/other_user}",
"gists_url": "https://api.github.com/users/Zoramite/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Zoramite",
"id": 107076,
"login": "Zoramite",
"node_id": "MDQ6VXNlcjEwNzA3Ng==",
"organizations_url": "https://api.github.com/users/Zoramite/orgs",
"received_events_url": "https://api.github.com/users/Zoramite/received_events",
"repos_url": "https://api.github.com/users/Zoramite/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Zoramite/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Zoramite/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Zoramite",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/1357/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1357/timeline
| null | null | false
|
{
"diff_url": "https://github.com/psf/requests/pull/1357.diff",
"html_url": "https://github.com/psf/requests/pull/1357",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/1357.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/1357"
}
| true
|
[
"Looks like this might be a duplicate of #1327. Not sure method is better, I'll leave it up to you to decide :)\n",
"I'm personally in favor of #1327 because it doesn't require re-sorting and reversing the list of adapter prefixes every-time we make a request (we use `get_adapter` every time we call `request` which is every time we make a request). Sorry @Zoramite \n",
"@sigmavirus24 no worries :) That is a better approach, I should have done a search for it before just blindly fixing it :)\n",
"Thanks for the request anyway @Zoramite ! Your other one looks good though. :cake:\n"
] |
https://api.github.com/repos/psf/requests/issues/1356
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1356/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1356/comments
|
https://api.github.com/repos/psf/requests/issues/1356/events
|
https://github.com/psf/requests/pull/1356
| 14,227,900
|
MDExOlB1bGxSZXF1ZXN0NTY2MDUyMg==
| 1,356
|
Adding an argument to the adapter for passing a block argument
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/107076?v=4",
"events_url": "https://api.github.com/users/Zoramite/events{/privacy}",
"followers_url": "https://api.github.com/users/Zoramite/followers",
"following_url": "https://api.github.com/users/Zoramite/following{/other_user}",
"gists_url": "https://api.github.com/users/Zoramite/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Zoramite",
"id": 107076,
"login": "Zoramite",
"node_id": "MDQ6VXNlcjEwNzA3Ng==",
"organizations_url": "https://api.github.com/users/Zoramite/orgs",
"received_events_url": "https://api.github.com/users/Zoramite/received_events",
"repos_url": "https://api.github.com/users/Zoramite/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Zoramite/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Zoramite/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Zoramite",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 7
|
2013-05-11T22:24:27Z
|
2021-09-08T23:01:03Z
|
2013-05-20T20:05:02Z
|
CONTRIBUTOR
|
resolved
|
Adding an argument to the adapter for passing a block argument to the connection pool.
This allows for blocking when using threading to prevent the pool from creating more connections that the max-size allows.
Specifically was seeing the following warnings were shown when using threads to download files without the block=True:
```
WARNING:requests.packages.urllib3.connectionpool:HttpConnectionPool is full, discarding connection: www.example.com
```
|
{
"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/1356/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1356/timeline
| null | null | false
|
{
"diff_url": "https://github.com/psf/requests/pull/1356.diff",
"html_url": "https://github.com/psf/requests/pull/1356",
"merged_at": "2013-05-20T20:05:02Z",
"patch_url": "https://github.com/psf/requests/pull/1356.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/1356"
}
| true
|
[
"Thanks @sigmavirus24 for the help!\n\nThis was causing problems when I was doing threaded gets to a single host. I can get around it by subclassing the adapter and overriding the creation of the connection pool (where I ran into the problem from #1357), but this seems like it should be something you can do without needing to sub class the adapter.\n",
"Yeah I agree you shouldn't need to sub-class the adapter. So that definitely pushes me over to :+1:... once we decide how to fix the tests. :)\n",
"Oh that's my bad, I should have warned you to add `'_pool_block'` to the list of `__attrs__` on L66. That'll fix this.\n",
"Thanks, I have updated with the correct list of attrs.\n",
":cake: Awesome! Sorry it took so long, but this pull request now looks perfect IMO. Hopefully @Lukasa will agree.\n",
"I think this PR is in great shape, but for reasons that are nothing to do with the code I'm slightly more lukewarm to it than @sigmavirus24 is. I consider subclassing the Transport Adapter to be a legitimate part of Requests' API: the documentation talks about it, some interfaces require it, etc. etc.\n\nWith that said, I'm +0.5 on this. I think it'd be a good addition to the library and it doesn't look like it'll break anything, but I don't think there is anything wrong with subclassing the adapter either. On balance I'd rather take it than leave it. That said, I don't want adding arguments to the constructor of the adapter to become a trend. =P\n",
"@Lukasa but sub-classing the adapter just to rewrite one (or two methods) to include an extra parameter seems a bit like over-kill to me. There are times when subclassing is appropriate and times when it isn't.\n\nWe may be better off doing something else though:\n\nWhat if we rewrite `HTTPAdapter` to be more intelligent. We'll modify the `__init__` method to take `**kwargs` that are meant only for the `poolmanager` initialization, so something like:\n\n``` python\nclass HTTPAdapter(BaseAdapter):\n __attrs__ = ['max_retries', 'config', '_pool_connections', '_pool_maxsize', '_pool_kwargs']\n def __init__(self, pool_connections=DEFAULT_POOLSIZE,\n pool_maxsize=DEFAULT_POOLSIZE, max_retries=DEFAULT_RETRIES,\n **kwargs):\n self.max_retries = max_retries\n self._pool_kwargs = kwargs\n self._pool_connections = pool_connections\n self._pool_maxsize = pool_maxsize\n\n self.init_poolmanager()\n\n # ...\n\n def init_poolmanager(self):\n self.poolmanager = PoolManager(\n num_pools=self._pool_connections, maxsize=self._pool_maxsize,\n **self._pool_kwargs\n )\n```\n\nBecause really we have never used `self.config` on the `HTTPAdapter`, nor have we ever really needed to set `_pool_connections` or `_pool_maxsize` twice (which we do both in `__init__` and `__setstate__`). `init_poolmanager` really doesn't need parameters to work well.\n"
] |
https://api.github.com/repos/psf/requests/issues/1355
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1355/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1355/comments
|
https://api.github.com/repos/psf/requests/issues/1355/events
|
https://github.com/psf/requests/pull/1355
| 14,132,614
|
MDExOlB1bGxSZXF1ZXN0NTYxMjM4Nw==
| 1,355
|
Prevent a KeyError when there's no link headers
|
{
"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-05-09T03:31:01Z
|
2021-09-08T20:01:21Z
|
2013-05-09T08:03:49Z
|
CONTRIBUTOR
|
resolved
|
This nipped me in the bud with github3.py+github-cli. Previously, the `CaseInsensitiveDict` behaved like a `defaultdict` that returned None when the key wasn't there. Now the CID behaves like a regular dict and raises a `KeyError`. To dodge this on our attribute, we should use `.get` to avoid a `KeyError`.
|
{
"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/1355/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1355/timeline
| null | null | false
|
{
"diff_url": "https://github.com/psf/requests/pull/1355.diff",
"html_url": "https://github.com/psf/requests/pull/1355",
"merged_at": "2013-05-09T08:03:49Z",
"patch_url": "https://github.com/psf/requests/pull/1355.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/1355"
}
| true
|
[
"This is an obvious :+1:. =D\n",
":trollface: \n"
] |
https://api.github.com/repos/psf/requests/issues/1354
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1354/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1354/comments
|
https://api.github.com/repos/psf/requests/issues/1354/events
|
https://github.com/psf/requests/issues/1354
| 14,107,016
|
MDU6SXNzdWUxNDEwNzAxNg==
| 1,354
|
Reverse HTTP?
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1812261?v=4",
"events_url": "https://api.github.com/users/harenbrs/events{/privacy}",
"followers_url": "https://api.github.com/users/harenbrs/followers",
"following_url": "https://api.github.com/users/harenbrs/following{/other_user}",
"gists_url": "https://api.github.com/users/harenbrs/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/harenbrs",
"id": 1812261,
"login": "harenbrs",
"node_id": "MDQ6VXNlcjE4MTIyNjE=",
"organizations_url": "https://api.github.com/users/harenbrs/orgs",
"received_events_url": "https://api.github.com/users/harenbrs/received_events",
"repos_url": "https://api.github.com/users/harenbrs/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/harenbrs/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/harenbrs/subscriptions",
"type": "User",
"url": "https://api.github.com/users/harenbrs",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 1
|
2013-05-08T15:36:24Z
|
2021-09-09T03:00:40Z
|
2013-05-08T19:36:46Z
|
NONE
|
resolved
|
I'm working with an HTTP-like server application that is able to upgrade a TCP connection (after client request) to send back event updates to the client according to: http://tools.ietf.org/id/draft-lentczner-rhttp-00.txt.
Is there a way to do this with Requests?
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4",
"events_url": "https://api.github.com/users/Lukasa/events{/privacy}",
"followers_url": "https://api.github.com/users/Lukasa/followers",
"following_url": "https://api.github.com/users/Lukasa/following{/other_user}",
"gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Lukasa",
"id": 1382556,
"login": "Lukasa",
"node_id": "MDQ6VXNlcjEzODI1NTY=",
"organizations_url": "https://api.github.com/users/Lukasa/orgs",
"received_events_url": "https://api.github.com/users/Lukasa/received_events",
"repos_url": "https://api.github.com/users/Lukasa/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Lukasa",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/1354/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1354/timeline
| null |
completed
| null | null | false
|
[
"The short answer is no.\n\nThe long answer is still basically no. The core limitation is that Requests' default transport adapter is based on urllib3, and urllib3 doesn't support reverse HTTP.\n\nUnfortunately, simply adding that support would not help. Requests is very closely tied to the client-server architecture, and serious refactoring would be needed to make this use-case behave sensibly. If you decided you wanted to implement this yourself in a Requests-y manner, a fork of Requests would be the way to go.\n\nThanks for opening the issue!\n"
] |
https://api.github.com/repos/psf/requests/issues/1353
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1353/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1353/comments
|
https://api.github.com/repos/psf/requests/issues/1353/events
|
https://github.com/psf/requests/issues/1353
| 14,036,429
|
MDU6SXNzdWUxNDAzNjQyOQ==
| 1,353
|
Closing a connection from another thread
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/66489?v=4",
"events_url": "https://api.github.com/users/mua/events{/privacy}",
"followers_url": "https://api.github.com/users/mua/followers",
"following_url": "https://api.github.com/users/mua/following{/other_user}",
"gists_url": "https://api.github.com/users/mua/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/mua",
"id": 66489,
"login": "mua",
"node_id": "MDQ6VXNlcjY2NDg5",
"organizations_url": "https://api.github.com/users/mua/orgs",
"received_events_url": "https://api.github.com/users/mua/received_events",
"repos_url": "https://api.github.com/users/mua/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/mua/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/mua/subscriptions",
"type": "User",
"url": "https://api.github.com/users/mua",
"user_view_type": "public"
}
|
[
{
"color": "02e10c",
"default": false,
"description": null,
"id": 76800,
"name": "Feature Request",
"node_id": "MDU6TGFiZWw3NjgwMA==",
"url": "https://api.github.com/repos/psf/requests/labels/Feature%20Request"
}
] |
closed
| true
| null |
[] | null | 13
|
2013-05-07T07:22:25Z
|
2021-09-05T00:06:52Z
|
2013-05-29T08:19:46Z
|
NONE
|
resolved
|
Hello,
Is there any way to close an ongoing connection, for instance I want application to quit while a download of a big file is going on, or an upload.
I managed to close it this way, but hoping to find a better one
```
def close():
time.sleep(5)
r.raw._fp.close()
t = threading.Thread(target=close).start()
print "getting"
s = requests.Session()
r = s.get("http://download.thinkbroadband.com/1GB.zip", stream = True)
for line in r.iter_content(1024):
log.debug("got it: %s", len(line))
print "done"
```
|
{
"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/1353/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1353/timeline
| null |
completed
| null | null | false
|
[
"For everyone else interested, this stems from [this discussion](http://stackoverflow.com/questions/16390243/closing-python-requests-connection-from-another-thread/16400574?noredirect=1#comment23529567_16400574). I'm personally :-1: on the idea, but I'd like to hear @kennethreitz and @Lukasa chime in.\n",
"I think the right way to do this is a combination of message passing and streaming downloads. The main thread should be able to send a message to the download thread that can say 'when you can, stop downloading'. Alongside that, the downloading thread should use `iter_content` in a loop to download the data. This loop should abort when the 'stop downloading' message is received, and then call `Response.close()`. **I haven't tried this**, but that ought to work.\n",
"Yeah, that works fine. Here is an example script that will do what you want.\n\nPlease please please don't just use this as-is. It's suitable for running on your own box if you want to be sure that it works, but it's not really thread-safe in any meaningful sense. The GIL mostly protects us here, but still, _caveat emptor_. Even though you aren't paying.\n\n``` python\n#!/usr/bin/env python\n# A test script to verify that you can abort streaming downloads of large\n# files.\nimport threading\nimport time\nimport requests\n\nstop_download = False\n\ndef download(url):\n r = requests.get(url, stream=True)\n data = ''\n content_gen = r.iter_content()\n\n while (stop_download == False):\n try:\n data = r.iter_content(1024)\n except StopIteration:\n break\n\n if (stop_download == True):\n print 'Killed from other thread!'\n r.close()\n\nif __name__ == '__main__':\n t = threading.Thread(target=download, args=('http://ftp.freebsd.org/pub/FreeBSD/ISO-IMAGES-amd64/9.1/FreeBSD-9.1-RELEASE-amd64-dvd1.iso',)).start()\n time.sleep(5)\n stop_download = True\n time.sleep(5) # Just so you believe the above line caused the stoppage.\n```\n",
"@Lukasa why you no protect the critical variable?\n",
"Just a demo script, doesn't need to be super-protected. Also I'm pretty sure that the GIL covers any kind of problems in this case. Anything more complicated and it wouldn't, but for simple comparison and one-off assignment, probably fine. =)\n",
"Of course, what I meant to say is: \"I, too, like to live dangerously.\"\n",
"I was mostly kidding hence the meme-speak\n",
"And hence my meme-speak reply. =D\n",
"@Lukasa You are still reading in chunks and you have no control while that is going on, and timing of your socket close request depends on state of communication, not good. Imagine a long polling, push message use case, or connection about to timeout in 10 seconds, still you cannot drop it.\n\nFor sockets, simply calling close from another thread is a common practice, method should be thread safe of course.\n",
"If you really need fine-grained control you can use `1` as the chunk size, which will enable you to stop reading after any given byte: it's just super slow. =D\n\nI can guarantee to you that calling close() from another thread can only happen in one of two ways: either a message is passed into the thread that is handled on the next go around the event loop (which is basically what I just wrote), or the socket is protected by a mutex and the downloading thread checks for whether the socket is open each time it attempts to read from it.\n\nYou _have_ to do this using either shared state or message-passing.\n\n(Note: I don't know what you mean by \"timing of your socket close request depends on state of communication\". Can you elaborate?)\n",
"I mean your loop in thread only can check whenever r.iter_content returns, imagine you are waiting a stream, just like twitter api, do you really want to wait until soneone tweets ? \n\nI can go async using twisted etc, but then again I want to use blocking sockets to lessen complexity, I am running sequential RPC, so I can run reactor loop and wait it to complete. But this seems overkill, \n\"Things shouldn’t be this way. Not in Python.\"\n",
"Yeah, I think this use-case is a bit specialised for Requests. Your requirement is that you want to use blocking IO combined with threading, but to be able to kill the network request at any time from outside of the controlling thread, _and_ to have that thread cancel its blocking IO without delay.\n\nTo do that we'd have to expose an API to close the underlying socket layer, which is a thing we work very hard to abstract away. (I also don't know how it would interact with the connection pooling used by urllib3.) I think Requests will probably not support this fairly unusual use case, especially while we're in [feature freeze](https://github.com/kennethreitz/requests/issues/1165).\n",
"Long-polling is a pretty common use-case in my work. I have multiple long-polls running, and I want to cancel all others when one (or N) return. Currently, I've manually extended the connection pool to keep track of its released connections, so I can close them when requested.\r\n\r\nAbove, the argument is that you don't want to expose low-level functionality; however, \"cancelling long-polls\" seems pretty high-level to me. Is cancelling requests via force-closing of sockets a feature that requests want to implement?\r\n\r\nPinging this issue for consideration into inclusion into [`requests` v3](https://3.python-requests.org/): let me know if this should be a new issue.\r\n\r\nEdit: I realise that the connection pool is a `urllib3` feature, so I should make a feature-request there"
] |
https://api.github.com/repos/psf/requests/issues/1352
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1352/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1352/comments
|
https://api.github.com/repos/psf/requests/issues/1352/events
|
https://github.com/psf/requests/pull/1352
| 14,031,149
|
MDExOlB1bGxSZXF1ZXN0NTU2MDUwNQ==
| 1,352
|
Adding link to documentation in README.rst
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1085180?v=4",
"events_url": "https://api.github.com/users/nicoddemus/events{/privacy}",
"followers_url": "https://api.github.com/users/nicoddemus/followers",
"following_url": "https://api.github.com/users/nicoddemus/following{/other_user}",
"gists_url": "https://api.github.com/users/nicoddemus/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/nicoddemus",
"id": 1085180,
"login": "nicoddemus",
"node_id": "MDQ6VXNlcjEwODUxODA=",
"organizations_url": "https://api.github.com/users/nicoddemus/orgs",
"received_events_url": "https://api.github.com/users/nicoddemus/received_events",
"repos_url": "https://api.github.com/users/nicoddemus/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/nicoddemus/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/nicoddemus/subscriptions",
"type": "User",
"url": "https://api.github.com/users/nicoddemus",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 1
|
2013-05-07T02:49:27Z
|
2021-09-08T20:01:21Z
|
2013-05-07T17:01:33Z
|
CONTRIBUTOR
|
resolved
|
Just adding a link to the documentation at python-requests.org
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4",
"events_url": "https://api.github.com/users/kennethreitz/events{/privacy}",
"followers_url": "https://api.github.com/users/kennethreitz/followers",
"following_url": "https://api.github.com/users/kennethreitz/following{/other_user}",
"gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/kennethreitz",
"id": 119893,
"login": "kennethreitz",
"node_id": "MDQ6VXNlcjExOTg5Mw==",
"organizations_url": "https://api.github.com/users/kennethreitz/orgs",
"received_events_url": "https://api.github.com/users/kennethreitz/received_events",
"repos_url": "https://api.github.com/users/kennethreitz/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions",
"type": "User",
"url": "https://api.github.com/users/kennethreitz",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/1352/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1352/timeline
| null | null | false
|
{
"diff_url": "https://github.com/psf/requests/pull/1352.diff",
"html_url": "https://github.com/psf/requests/pull/1352",
"merged_at": "2013-05-07T17:01:33Z",
"patch_url": "https://github.com/psf/requests/pull/1352.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/1352"
}
| true
|
[
":cake:\n"
] |
https://api.github.com/repos/psf/requests/issues/1351
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1351/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1351/comments
|
https://api.github.com/repos/psf/requests/issues/1351/events
|
https://github.com/psf/requests/pull/1351
| 14,028,232
|
MDExOlB1bGxSZXF1ZXN0NTU1OTE5MQ==
| 1,351
|
Adding link to documentation in README.rst
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1085180?v=4",
"events_url": "https://api.github.com/users/nicoddemus/events{/privacy}",
"followers_url": "https://api.github.com/users/nicoddemus/followers",
"following_url": "https://api.github.com/users/nicoddemus/following{/other_user}",
"gists_url": "https://api.github.com/users/nicoddemus/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/nicoddemus",
"id": 1085180,
"login": "nicoddemus",
"node_id": "MDQ6VXNlcjEwODUxODA=",
"organizations_url": "https://api.github.com/users/nicoddemus/orgs",
"received_events_url": "https://api.github.com/users/nicoddemus/received_events",
"repos_url": "https://api.github.com/users/nicoddemus/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/nicoddemus/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/nicoddemus/subscriptions",
"type": "User",
"url": "https://api.github.com/users/nicoddemus",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 4
|
2013-05-07T00:40:33Z
|
2021-09-08T20:01:20Z
|
2013-05-07T02:41:48Z
|
CONTRIBUTOR
|
resolved
|
Just adding a link to the documentation at readthedocs.org
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1085180?v=4",
"events_url": "https://api.github.com/users/nicoddemus/events{/privacy}",
"followers_url": "https://api.github.com/users/nicoddemus/followers",
"following_url": "https://api.github.com/users/nicoddemus/following{/other_user}",
"gists_url": "https://api.github.com/users/nicoddemus/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/nicoddemus",
"id": 1085180,
"login": "nicoddemus",
"node_id": "MDQ6VXNlcjEwODUxODA=",
"organizations_url": "https://api.github.com/users/nicoddemus/orgs",
"received_events_url": "https://api.github.com/users/nicoddemus/received_events",
"repos_url": "https://api.github.com/users/nicoddemus/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/nicoddemus/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/nicoddemus/subscriptions",
"type": "User",
"url": "https://api.github.com/users/nicoddemus",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/1351/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1351/timeline
| null | null | false
|
{
"diff_url": "https://github.com/psf/requests/pull/1351.diff",
"html_url": "https://github.com/psf/requests/pull/1351",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/1351.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/1351"
}
| true
|
[
"Btw, sorry about the terrible branch name... used github's autofork/edit online feature. :)\n",
"Closing this to rebase the branch. Will send a new pull request shortly.\n",
"No worries. Thanks for the pull request!\n",
"My pleasure. :)\n"
] |
https://api.github.com/repos/psf/requests/issues/1350
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1350/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1350/comments
|
https://api.github.com/repos/psf/requests/issues/1350/events
|
https://github.com/psf/requests/pull/1350
| 13,987,648
|
MDExOlB1bGxSZXF1ZXN0NTUzOTA2NQ==
| 1,350
|
threaded_requests.GetThread, threaded_requests.DownloadThread
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/10137?v=4",
"events_url": "https://api.github.com/users/ghost/events{/privacy}",
"followers_url": "https://api.github.com/users/ghost/followers",
"following_url": "https://api.github.com/users/ghost/following{/other_user}",
"gists_url": "https://api.github.com/users/ghost/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/ghost",
"id": 10137,
"login": "ghost",
"node_id": "MDQ6VXNlcjEwMTM3",
"organizations_url": "https://api.github.com/users/ghost/orgs",
"received_events_url": "https://api.github.com/users/ghost/received_events",
"repos_url": "https://api.github.com/users/ghost/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/ghost/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/ghost/subscriptions",
"type": "User",
"url": "https://api.github.com/users/ghost",
"user_view_type": "public"
}
|
[] |
closed
| false
| null |
[] | null | 2
|
2013-05-06T03:46:05Z
|
2014-06-19T16:46:53Z
|
2013-05-07T17:01:01Z
|
NONE
| null |
I've added classes that I've made to have requests on their own thread with variables and methods that allow the main thread to monitor their status.
This is my first attempt at contributing to anything like this.
I tried to keep it simple. I hope you like it.
|
{
"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/1350/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1350/timeline
| null | null | false
|
{
"diff_url": "https://github.com/psf/requests/pull/1350.diff",
"html_url": "https://github.com/psf/requests/pull/1350",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/1350.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/1350"
}
| true
|
[
"This would definitely do much better as it's own separate package that requires requests. I can almost assure you that this will not be included in requests itself. Thanks for the idea though!\n",
"Thanks Sigmavirus24. I'll figure out how to do that on git hub. I'll make a threaded_requests package with a sub-package wx_requests for wxPython ProgressDialog classes that monitor the request threads.\n\nCheers.\n"
] |
https://api.github.com/repos/psf/requests/issues/1349
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1349/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1349/comments
|
https://api.github.com/repos/psf/requests/issues/1349/events
|
https://github.com/psf/requests/pull/1349
| 13,973,308
|
MDExOlB1bGxSZXF1ZXN0NTUzNDAwOA==
| 1,349
|
I use requests so often, I forget all of the hard work that went into it.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/39159?v=4",
"events_url": "https://api.github.com/users/jcarbaugh/events{/privacy}",
"followers_url": "https://api.github.com/users/jcarbaugh/followers",
"following_url": "https://api.github.com/users/jcarbaugh/following{/other_user}",
"gists_url": "https://api.github.com/users/jcarbaugh/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/jcarbaugh",
"id": 39159,
"login": "jcarbaugh",
"node_id": "MDQ6VXNlcjM5MTU5",
"organizations_url": "https://api.github.com/users/jcarbaugh/orgs",
"received_events_url": "https://api.github.com/users/jcarbaugh/received_events",
"repos_url": "https://api.github.com/users/jcarbaugh/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/jcarbaugh/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jcarbaugh/subscriptions",
"type": "User",
"url": "https://api.github.com/users/jcarbaugh",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 7
|
2013-05-05T02:59:22Z
|
2021-09-08T20:01:19Z
|
2013-05-06T17:50:22Z
|
NONE
|
resolved
|
A reminder...
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/39159?v=4",
"events_url": "https://api.github.com/users/jcarbaugh/events{/privacy}",
"followers_url": "https://api.github.com/users/jcarbaugh/followers",
"following_url": "https://api.github.com/users/jcarbaugh/following{/other_user}",
"gists_url": "https://api.github.com/users/jcarbaugh/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/jcarbaugh",
"id": 39159,
"login": "jcarbaugh",
"node_id": "MDQ6VXNlcjM5MTU5",
"organizations_url": "https://api.github.com/users/jcarbaugh/orgs",
"received_events_url": "https://api.github.com/users/jcarbaugh/received_events",
"repos_url": "https://api.github.com/users/jcarbaugh/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/jcarbaugh/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jcarbaugh/subscriptions",
"type": "User",
"url": "https://api.github.com/users/jcarbaugh",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/1349/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1349/timeline
| null | null | false
|
{
"diff_url": "https://github.com/psf/requests/pull/1349.diff",
"html_url": "https://github.com/psf/requests/pull/1349",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/1349.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/1349"
}
| true
|
[
":+1:\n",
"@Lukasa concerns?\n",
"Heh, this is awesome. Not sure I appreciate printing this unconditionally, but otherwise nice.\n\nOh, and btw, `zlib.decompress` returns bytes on Python 3, so this throws an exception on Python 3. You might want to add a call to `.decode('ascii')`.\n",
":+1: \n",
"@jcarbaugh :cake:\n",
"I was just notified that this pull request violates a number of patents held by a very litigious company. Closing now. Thank you for your consideration.\n",
"Well done pull request\n"
] |
https://api.github.com/repos/psf/requests/issues/1348
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1348/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1348/comments
|
https://api.github.com/repos/psf/requests/issues/1348/events
|
https://github.com/psf/requests/issues/1348
| 13,970,071
|
MDU6SXNzdWUxMzk3MDA3MQ==
| 1,348
|
params and data are easily confused
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/234019?v=4",
"events_url": "https://api.github.com/users/kevinburke/events{/privacy}",
"followers_url": "https://api.github.com/users/kevinburke/followers",
"following_url": "https://api.github.com/users/kevinburke/following{/other_user}",
"gists_url": "https://api.github.com/users/kevinburke/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/kevinburke",
"id": 234019,
"login": "kevinburke",
"node_id": "MDQ6VXNlcjIzNDAxOQ==",
"organizations_url": "https://api.github.com/users/kevinburke/orgs",
"received_events_url": "https://api.github.com/users/kevinburke/received_events",
"repos_url": "https://api.github.com/users/kevinburke/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/kevinburke/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/kevinburke/subscriptions",
"type": "User",
"url": "https://api.github.com/users/kevinburke",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 1
|
2013-05-04T20:21:02Z
|
2021-09-09T03:00:41Z
|
2013-05-04T20:49:45Z
|
CONTRIBUTOR
|
resolved
|
The `params` argument refers to GET query string parameters and the `data` argument refers to POST parameters. However it's my experience that these two are easily mixed up.
See for example:
http://forum.twilio.com/twilio/topics/python_requests_lib_from_phone_number_is_required - The user believes he's sending the data in the post body, but instead he's attaching it to the URL as query parameters.
Or here:
https://github.com/kevinburke/twilio-jsonapi/commit/db30eea4513be30e40c9187a9d3d73b8df165e2d
where I assumed incorrectly that `data=data` would add query params to a GET but form values to a POST.
It's certainly legitimate to make a POST request with query parameters. It's unlikely though.
The reverse case seems like it's always a problem - attaching form values to a GET request, and it may be nice to warn in this 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/1348/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1348/timeline
| null |
completed
| null | null | false
|
[
"Thanks for raising this issue!\n\nRespectfully, I disagree to both of your later points. Firstly, I use query parameters along with POST data in my Mozilla Persona implementation. Second, RFC 2616 does not prevent sending body data along with GET requests: it is perfectly valid, if highly unusual.\n\nRequests absolutely should not prevent you doing either. =) Furthermore, Requests _definitely_ should not change the meaning of a function parameter based on the value of a different one.\n\nI'm pretty sure that we're happy with the way the API is now. Thanks for raising the issue though! =)\n"
] |
https://api.github.com/repos/psf/requests/issues/1347
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1347/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1347/comments
|
https://api.github.com/repos/psf/requests/issues/1347/events
|
https://github.com/psf/requests/pull/1347
| 13,957,511
|
MDExOlB1bGxSZXF1ZXN0NTUyODM4Mw==
| 1,347
|
Issue #749: Add optional SNI support for python2.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/730811?v=4",
"events_url": "https://api.github.com/users/WhyNotHugo/events{/privacy}",
"followers_url": "https://api.github.com/users/WhyNotHugo/followers",
"following_url": "https://api.github.com/users/WhyNotHugo/following{/other_user}",
"gists_url": "https://api.github.com/users/WhyNotHugo/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/WhyNotHugo",
"id": 730811,
"login": "WhyNotHugo",
"node_id": "MDQ6VXNlcjczMDgxMQ==",
"organizations_url": "https://api.github.com/users/WhyNotHugo/orgs",
"received_events_url": "https://api.github.com/users/WhyNotHugo/received_events",
"repos_url": "https://api.github.com/users/WhyNotHugo/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/WhyNotHugo/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/WhyNotHugo/subscriptions",
"type": "User",
"url": "https://api.github.com/users/WhyNotHugo",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 5
|
2013-05-04T00:06:36Z
|
2021-09-08T10:01:11Z
|
2013-05-04T20:11:46Z
|
CONTRIBUTOR
|
resolved
|
SNI support will be enabled for python2 if ndg-httpsclient and pyopenssl are available.
|
{
"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/1347/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1347/timeline
| null | null | false
|
{
"diff_url": "https://github.com/psf/requests/pull/1347.diff",
"html_url": "https://github.com/psf/requests/pull/1347",
"merged_at": "2013-05-04T20:11:46Z",
"patch_url": "https://github.com/psf/requests/pull/1347.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/1347"
}
| true
|
[
"Is that seriously all that's needed to set up SNI support in it's totality?\n",
"@sigmavirus24: If it is that's awesome.\n",
"Yes. It's merely disabled in urllib3 by default due to the additional requirements and due to the fact that ssl is way more tested than pyopenssl. That's why they've kept it in the `contrib` package, and needs to be manually enabled, but all the hard work is already done.\nSee [urllib#153](https://github.com/shazow/urllib3/pull/156) for more information.\n",
"Then I'm :+1: on this.\n",
":cake:\n"
] |
https://api.github.com/repos/psf/requests/issues/1346
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1346/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1346/comments
|
https://api.github.com/repos/psf/requests/issues/1346/events
|
https://github.com/psf/requests/issues/1346
| 13,922,285
|
MDU6SXNzdWUxMzkyMjI4NQ==
| 1,346
|
Could not find a suitable SSL CA certificate bundle.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/3453299?v=4",
"events_url": "https://api.github.com/users/NotChrisPlease/events{/privacy}",
"followers_url": "https://api.github.com/users/NotChrisPlease/followers",
"following_url": "https://api.github.com/users/NotChrisPlease/following{/other_user}",
"gists_url": "https://api.github.com/users/NotChrisPlease/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/NotChrisPlease",
"id": 3453299,
"login": "NotChrisPlease",
"node_id": "MDQ6VXNlcjM0NTMyOTk=",
"organizations_url": "https://api.github.com/users/NotChrisPlease/orgs",
"received_events_url": "https://api.github.com/users/NotChrisPlease/received_events",
"repos_url": "https://api.github.com/users/NotChrisPlease/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/NotChrisPlease/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/NotChrisPlease/subscriptions",
"type": "User",
"url": "https://api.github.com/users/NotChrisPlease",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 5
|
2013-05-03T05:37:42Z
|
2021-09-09T03:00:41Z
|
2013-05-03T16:45:10Z
|
NONE
|
resolved
|
I get this error when I try to use requests
File "C:\Program Files (x86)\Python\lib\site-packages\requests\models.py", line 562, in send
raise Exception("Could not find a suitable SSL CA certificate bundle.")
Exception: Could not find a suitable SSL CA certificate bundle.
I'm running windows 7 and Python 2.7.3
|
{
"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/1346/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1346/timeline
| null |
completed
| null | null | false
|
[
"What version of requests are you using? Because that stack seems to be weird.\n",
"I'm using version 0.13.0\n",
"Right, that's several versions older than we're currently developing on. The last stable version with the same API was v0.14.2, so if you don't want to change API I recommend upgrading to that. If you are able to work around some changes, I recommend upgrading to the latest version, v1.2.0. \n",
"To be clear, I closed this issue because this is not a bug in a current version of Requests, so it doesn't belong on the GitHub issue tracker. However, if you want support, feel free to continue commenting here (I'll get emails) or to join us in the IRC channel and ask for support there.\n",
"Thanks for the help, I'll grab 1.2.0 then.\n"
] |
https://api.github.com/repos/psf/requests/issues/1345
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1345/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1345/comments
|
https://api.github.com/repos/psf/requests/issues/1345/events
|
https://github.com/psf/requests/pull/1345
| 13,913,412
|
MDExOlB1bGxSZXF1ZXN0NTUwNTE2NA==
| 1,345
|
Add support for HTTP TRACE method
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1296842?v=4",
"events_url": "https://api.github.com/users/maurycyp/events{/privacy}",
"followers_url": "https://api.github.com/users/maurycyp/followers",
"following_url": "https://api.github.com/users/maurycyp/following{/other_user}",
"gists_url": "https://api.github.com/users/maurycyp/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/maurycyp",
"id": 1296842,
"login": "maurycyp",
"node_id": "MDQ6VXNlcjEyOTY4NDI=",
"organizations_url": "https://api.github.com/users/maurycyp/orgs",
"received_events_url": "https://api.github.com/users/maurycyp/received_events",
"repos_url": "https://api.github.com/users/maurycyp/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/maurycyp/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/maurycyp/subscriptions",
"type": "User",
"url": "https://api.github.com/users/maurycyp",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 3
|
2013-05-02T22:09:10Z
|
2021-09-08T20:01:20Z
|
2013-05-04T20:12:18Z
|
NONE
|
resolved
|
Adding support for this underappreciated method.
Reference: http://tools.ietf.org/html/rfc2616#section-9.8
|
{
"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/1345/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1345/timeline
| null | null | false
|
{
"diff_url": "https://github.com/psf/requests/pull/1345.diff",
"html_url": "https://github.com/psf/requests/pull/1345",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/1345.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/1345"
}
| true
|
[
"95% sure this will be rejected. We're currently in a feature freeze (#1165) so no changes to the API are allowed to be accepted unless they were previously planned. Sorry @maurycyp \n",
"I see. I wasn't aware of the feature freeze, I was just missing TRACE support when using requests in my projects. Maybe this can be added to a future release?\n",
"I'm -1 on this as well, but for different reasons.\n\nBasically, I've considered adding TRACE on multiple occassions before. The interface always felt weird, basically.\n"
] |
https://api.github.com/repos/psf/requests/issues/1344
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1344/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1344/comments
|
https://api.github.com/repos/psf/requests/issues/1344/events
|
https://github.com/psf/requests/issues/1344
| 13,904,873
|
MDU6SXNzdWUxMzkwNDg3Mw==
| 1,344
|
Streaming support
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/75427?v=4",
"events_url": "https://api.github.com/users/proycon/events{/privacy}",
"followers_url": "https://api.github.com/users/proycon/followers",
"following_url": "https://api.github.com/users/proycon/following{/other_user}",
"gists_url": "https://api.github.com/users/proycon/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/proycon",
"id": 75427,
"login": "proycon",
"node_id": "MDQ6VXNlcjc1NDI3",
"organizations_url": "https://api.github.com/users/proycon/orgs",
"received_events_url": "https://api.github.com/users/proycon/received_events",
"repos_url": "https://api.github.com/users/proycon/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/proycon/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/proycon/subscriptions",
"type": "User",
"url": "https://api.github.com/users/proycon",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 1
|
2013-05-02T18:44:56Z
|
2021-09-09T03:00:41Z
|
2013-05-02T18:49:34Z
|
NONE
|
resolved
|
This library looks great, but there is one feature missing that stops me from adopting it: streaming support. For uploading files (POST) as well as for GET. Keeping all data in memory is problematic when huge amounts of data are transferred. Are there any plans to implement this?
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/75427?v=4",
"events_url": "https://api.github.com/users/proycon/events{/privacy}",
"followers_url": "https://api.github.com/users/proycon/followers",
"following_url": "https://api.github.com/users/proycon/following{/other_user}",
"gists_url": "https://api.github.com/users/proycon/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/proycon",
"id": 75427,
"login": "proycon",
"node_id": "MDQ6VXNlcjc1NDI3",
"organizations_url": "https://api.github.com/users/proycon/orgs",
"received_events_url": "https://api.github.com/users/proycon/received_events",
"repos_url": "https://api.github.com/users/proycon/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/proycon/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/proycon/subscriptions",
"type": "User",
"url": "https://api.github.com/users/proycon",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/1344/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1344/timeline
| null |
completed
| null | null | false
|
[
"Sorry, I just now see this has already been implemented! Great!\n"
] |
https://api.github.com/repos/psf/requests/issues/1343
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1343/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1343/comments
|
https://api.github.com/repos/psf/requests/issues/1343/events
|
https://github.com/psf/requests/pull/1343
| 13,900,543
|
MDExOlB1bGxSZXF1ZXN0NTQ5NzY2MQ==
| 1,343
|
Refactor merge_kwargs
|
{
"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-05-02T17:03:42Z
|
2021-09-08T23:06:08Z
|
2013-05-21T02:14:55Z
|
CONTRIBUTOR
|
resolved
|
This refactors the `merge_kwargs` function for sessions to (hopefully) be clearer, and fix some bugs with it. It fixes #1321, as well as fixing an issue where arguments other than headers were being improperly merged case insensitively.
|
{
"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/1343/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1343/timeline
| null | null | false
|
{
"diff_url": "https://github.com/psf/requests/pull/1343.diff",
"html_url": "https://github.com/psf/requests/pull/1343",
"merged_at": "2013-05-21T02:14:55Z",
"patch_url": "https://github.com/psf/requests/pull/1343.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/1343"
}
| true
|
[
":+1: this makes the function easier to understand for future contributors and adds the flexibility we need for headers.\n",
"Can you do a rebase?\n",
"Sure thing, done.\n",
":cake:\n"
] |
https://api.github.com/repos/psf/requests/issues/1342
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1342/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1342/comments
|
https://api.github.com/repos/psf/requests/issues/1342/events
|
https://github.com/psf/requests/pull/1342
| 13,895,728
|
MDExOlB1bGxSZXF1ZXN0NTQ5NTA5Mg==
| 1,342
|
Fixed example in authentication docs
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/699380?v=4",
"events_url": "https://api.github.com/users/mexicat/events{/privacy}",
"followers_url": "https://api.github.com/users/mexicat/followers",
"following_url": "https://api.github.com/users/mexicat/following{/other_user}",
"gists_url": "https://api.github.com/users/mexicat/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/mexicat",
"id": 699380,
"login": "mexicat",
"node_id": "MDQ6VXNlcjY5OTM4MA==",
"organizations_url": "https://api.github.com/users/mexicat/orgs",
"received_events_url": "https://api.github.com/users/mexicat/received_events",
"repos_url": "https://api.github.com/users/mexicat/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/mexicat/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/mexicat/subscriptions",
"type": "User",
"url": "https://api.github.com/users/mexicat",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 1
|
2013-05-02T15:17:06Z
|
2021-09-08T20:01:18Z
|
2013-05-07T17:01:18Z
|
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/1342/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1342/timeline
| null | null | false
|
{
"diff_url": "https://github.com/psf/requests/pull/1342.diff",
"html_url": "https://github.com/psf/requests/pull/1342",
"merged_at": "2013-05-07T17:01:18Z",
"patch_url": "https://github.com/psf/requests/pull/1342.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/1342"
}
| true
|
[
":+1: Typos like this are the bane of any learning person's existence.\n"
] |
|
https://api.github.com/repos/psf/requests/issues/1341
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1341/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1341/comments
|
https://api.github.com/repos/psf/requests/issues/1341/events
|
https://github.com/psf/requests/pull/1341
| 13,860,103
|
MDExOlB1bGxSZXF1ZXN0NTQ3NjI3OA==
| 1,341
|
Minor update to tests, added docstrings
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/882547?v=4",
"events_url": "https://api.github.com/users/cdunklau/events{/privacy}",
"followers_url": "https://api.github.com/users/cdunklau/followers",
"following_url": "https://api.github.com/users/cdunklau/following{/other_user}",
"gists_url": "https://api.github.com/users/cdunklau/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/cdunklau",
"id": 882547,
"login": "cdunklau",
"node_id": "MDQ6VXNlcjg4MjU0Nw==",
"organizations_url": "https://api.github.com/users/cdunklau/orgs",
"received_events_url": "https://api.github.com/users/cdunklau/received_events",
"repos_url": "https://api.github.com/users/cdunklau/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/cdunklau/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/cdunklau/subscriptions",
"type": "User",
"url": "https://api.github.com/users/cdunklau",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 1
|
2013-05-01T18:37:33Z
|
2021-09-08T20:01:19Z
|
2013-05-01T18:40:02Z
|
CONTRIBUTOR
|
resolved
|
Requested by @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/1341/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1341/timeline
| null | null | false
|
{
"diff_url": "https://github.com/psf/requests/pull/1341.diff",
"html_url": "https://github.com/psf/requests/pull/1341",
"merged_at": "2013-05-01T18:40:02Z",
"patch_url": "https://github.com/psf/requests/pull/1341.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/1341"
}
| true
|
[
"thanks!\n"
] |
https://api.github.com/repos/psf/requests/issues/1340
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1340/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1340/comments
|
https://api.github.com/repos/psf/requests/issues/1340/events
|
https://github.com/psf/requests/pull/1340
| 13,855,523
|
MDExOlB1bGxSZXF1ZXN0NTQ3Mzk2NQ==
| 1,340
|
Remove 3.1 and 3.2 from setup.py, add tox.ini to simplify testing on multiple versions
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/55281?v=4",
"events_url": "https://api.github.com/users/ambv/events{/privacy}",
"followers_url": "https://api.github.com/users/ambv/followers",
"following_url": "https://api.github.com/users/ambv/following{/other_user}",
"gists_url": "https://api.github.com/users/ambv/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/ambv",
"id": 55281,
"login": "ambv",
"node_id": "MDQ6VXNlcjU1Mjgx",
"organizations_url": "https://api.github.com/users/ambv/orgs",
"received_events_url": "https://api.github.com/users/ambv/received_events",
"repos_url": "https://api.github.com/users/ambv/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/ambv/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/ambv/subscriptions",
"type": "User",
"url": "https://api.github.com/users/ambv",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 3
|
2013-05-01T16:46:51Z
|
2021-09-08T20:01:18Z
|
2013-05-01T17:27:02Z
|
CONTRIBUTOR
|
resolved
|
This PR removes Python 3.1 and 3.2 from the trove classifiers in `setup.py` since @kennethreitz decided to drop support for those versions in the rejected PR #1326.
It also introduces a rudimentary "tox.ini" which makes local tests with multiple Python versions trivial:
```
$ pip install tox
$ cd requests-sources/
$ tox
GLOB sdist-make: setup.py
py26 inst-nodeps: .tox/dist/requests-1.2.0.zip
py26 runtests: commands[0]
.........................................
Ran 41 tests in 24.071s
OK
py27 inst-nodeps: .tox/dist/requests-1.2.0.zip
py27 runtests: commands[0]
.........................................
Ran 41 tests in 23.269s
OK
py33 inst-nodeps: .tox/dist/requests-1.2.0.zip
py33 runtests: commands[0]
.........................................
Ran 41 tests in 22.674s
OK
________________ summary ________________
py26: commands succeeded
py27: commands succeeded
py33: commands succeeded
congratulations :)
```
|
{
"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/1340/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1340/timeline
| null | null | false
|
{
"diff_url": "https://github.com/psf/requests/pull/1340.diff",
"html_url": "https://github.com/psf/requests/pull/1340",
"merged_at": "2013-05-01T17:27:02Z",
"patch_url": "https://github.com/psf/requests/pull/1340.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/1340"
}
| true
|
[
"I'll merge this once you remove tox :)\n\nTox used to be included in the repository a few years ago. It was removed for various reasons.\n",
"No problem, tox.ini removed. Can you point me at the reasons? It's worth knowing why it might be unwanted.\n",
"I love tox, I just found it to always need configuration modifications. \n\nThe root directory of the project also already has too many files — tying to minimize that :)\n"
] |
https://api.github.com/repos/psf/requests/issues/1339
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1339/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1339/comments
|
https://api.github.com/repos/psf/requests/issues/1339/events
|
https://github.com/psf/requests/pull/1339
| 13,824,572
|
MDExOlB1bGxSZXF1ZXN0NTQ1ODEwNw==
| 1,339
|
Rewrite CaseInsensitiveDict to work correctly/sanely
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/882547?v=4",
"events_url": "https://api.github.com/users/cdunklau/events{/privacy}",
"followers_url": "https://api.github.com/users/cdunklau/followers",
"following_url": "https://api.github.com/users/cdunklau/following{/other_user}",
"gists_url": "https://api.github.com/users/cdunklau/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/cdunklau",
"id": 882547,
"login": "cdunklau",
"node_id": "MDQ6VXNlcjg4MjU0Nw==",
"organizations_url": "https://api.github.com/users/cdunklau/orgs",
"received_events_url": "https://api.github.com/users/cdunklau/received_events",
"repos_url": "https://api.github.com/users/cdunklau/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/cdunklau/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/cdunklau/subscriptions",
"type": "User",
"url": "https://api.github.com/users/cdunklau",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 3
|
2013-04-30T20:05:30Z
|
2021-09-08T23:06:21Z
|
2013-05-01T17:27:58Z
|
CONTRIBUTOR
|
resolved
|
Fixes #649 and #1329 by making Session.headers a CaseInsensitiveDict,
and fixing the implementation of CID. Credit for the brilliant idea
to map `lowercased_key -> (cased_key, mapped_value)` goes to
@gazpachoking, thanks a bunch.
Changes from original implementation of CaseInsensitiveDict:
1. CID is rewritten as a subclass of `collections.MutableMapping`.
2. CID remembers the case of the last-set key, but `__setitem__`
and `__delitem__` will handle keys without respect to case.
3. CID returns the key case as remembered for the `keys`, `items`,
and `__iter__` methods.
4. Query operations (`__getitem__` and `__contains__`) are done in
a case-insensitive manner: `cid['foo']` and `cid['FOO']` will
return the same value.
5. The constructor as well as `update` and `__eq__` have undefined
behavior when given multiple keys that have the same `lower()`.
6. The new method `lower_items` is like `iteritems`, but keys are
all lowercased.
7. CID raises `KeyError` for `__getitem__` as normal dicts do. The
old implementation returned `None`
8. The `__repr__` now makes it obvious that it's not a normal dict.
See PR #1333 for the discussions that lead up to this implementation
|
{
"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/1339/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1339/timeline
| null | null | false
|
{
"diff_url": "https://github.com/psf/requests/pull/1339.diff",
"html_url": "https://github.com/psf/requests/pull/1339",
"merged_at": "2013-05-01T17:27:58Z",
"patch_url": "https://github.com/psf/requests/pull/1339.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/1339"
}
| true
|
[
"I am a big, big fan of this Pull Request. :smile: Absolutely +1.\n",
"All I ask is that a doc-string be added to the new test in `TestRequests`, but otherwise :+1: x10. This is great work.\n\n(Also brought this up on [IRC](https://botbot.me/freenode/python-requests/msg/2961988/))\n",
":sparkles: :cake: :sparkles:\n"
] |
https://api.github.com/repos/psf/requests/issues/1338
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1338/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1338/comments
|
https://api.github.com/repos/psf/requests/issues/1338/events
|
https://github.com/psf/requests/pull/1338
| 13,824,171
|
MDExOlB1bGxSZXF1ZXN0NTQ1Nzg5Mg==
| 1,338
|
[WIP] [2.0] Header keys should be native strings.
|
{
"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": "009800",
"default": false,
"description": null,
"id": 44501218,
"name": "Ready To Merge",
"node_id": "MDU6TGFiZWw0NDUwMTIxOA==",
"url": "https://api.github.com/repos/psf/requests/labels/Ready%20To%20Merge"
},
{
"color": "eb6420",
"default": false,
"description": null,
"id": 44501256,
"name": "Breaking API Change",
"node_id": "MDU6TGFiZWw0NDUwMTI1Ng==",
"url": "https://api.github.com/repos/psf/requests/labels/Breaking%20API%20Change"
}
] |
closed
| true
| null |
[] | null | 27
|
2013-04-30T19:56:33Z
|
2021-09-08T23:11:08Z
|
2013-08-01T01:28:54Z
|
MEMBER
|
resolved
|
_Note_: This PR follows a discussion on IRC. The logs can be found [here](https://botbot.me/freenode/python-requests/msg/2942059/).
### Summary
This fixes a problem that @https://github.com/va1en0k _would_ have had in #1335 if the current Case-Insensitive Dict didn't behave so weirdly (see #1333 for progress on that).
Right now, Requests unconditionally encodes all header values as bytes on all Python versions. Kenneth and I are (tentatively) in agreement that header values should actually be native strings on all platforms. This pull request introduces code that explicitly encodes or decodes string objects to satisfy that requirement.
### Notes
Firstly, **this is a breaking API change on Python 3**. On Python 2 the behaviour will be the same unless the user has changed `sys.defaultencoding`, and if they have they deserve what's coming to them. On Python 3, all header keys on `PreparedRequest`s will go from being bytes to unicode objects, and so anyone who has correctly programmed to this interface will have to change their code.
Secondly, this code currently uses ASCII as the codec in both directions. I think this is OK for now. I'm pretty sure that header values should actually be Latin-1, but I can understand if we want to keep the current behaviour in place. I'm open to feedback here.
|
{
"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/1338/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1338/timeline
| null | null | false
|
{
"diff_url": "https://github.com/psf/requests/pull/1338.diff",
"html_url": "https://github.com/psf/requests/pull/1338",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/1338.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/1338"
}
| true
|
[
"Ref #1339, completed CaseInsensitiveDict rewrite.\n",
"CID merged in e6e9b55.\n",
"@Lukasa rebase ;)\n",
"Done. =)\n",
"@Lukasa the tests fail on python3 where you have `'accept'.encode('ascii')` because of the new CaseInsensitiveDict (#1339)\n",
"That should resolve it. =D I wish Travis still emailed me when I'd broken the build.\n",
"Yeah that fixes it. Travis just has your 2.6 build queued so @kennethreitz might be wary until it completes (not that he need be).\n",
"@cdunklau That was a great idea, and is now done.\n",
"What's the status here?\n",
"I believe the status is :cake: but I'm not 100% sure.\n",
"The status is :cake:, unless there's something more you want here. In which case, I am your humble servant. =)\n",
"Merge please.\n",
"@oliverjanik: The reason this wasn't merged straight away is that it is a significant, backward-incompatible change. It is generally unwise to merge such a change immediately. It's important to add it in a release which gets a minor version bump (e.g. 1.2.x to 1.3.x), and with good documentation (which reminds me, I should document this change somewhere).\n\nThis, or something similar, will get merged in good time. =)\n",
"Rebased again, I'll close and reopen to get GitHub to realise it.\n",
"Let's pretend I didn't push up a merge conflict. =P\n",
"What's the status here?\n",
"The answer is that this _should_ be fine. It's a breaking API change, so if you want to sit on it for a while that would be totally reasonable.\n",
"I vote for merging, because this bug makes requests behave differently on Python2 and Python3 and there is no reasonable work-around. \n\nWhile it's true that it breaks public API it breaks undocumented behaviour, which nobody should rely on.\n",
"@oliverjanik If only it were that simple. =) This will affect the behaviour of the headers dictionary. People will have spotted that Requests sets its headers to bytes on Python3 and have written code that takes that into account. That code will break.\n\nWe simply can't rush this into a Requests release. With that said, this (or something like it) will definitely end up in Requests eventually. =)\n",
"Under Python3 with requests 1.2.3, header overrides are currently broken. That is, if I specify a header that requests would normally specify itself (such as Accept-Encoding or Content-Type), then it simply adds my header instead of replacing it. \n\nApproximate script I used to test:\n\napproximate script:\n\n```\nhost = 'localhost'\nport = 443\nprotocol = 'https'\ndata = 'mystring'\n\nsession = requests.Session()\n\nmethod = 'POST'\npath = '/my/web/service'\nheaders = {'x-custom-header1': 'x',\n 'x-custom-header2': data,\n 'x-custom-header3': 'x',\n 'User-Agent': 'myagent',\n 'Content-Type': 'text/xml',\n 'x-custom-header4': '12345'}\nurl = \"%s://%s:%d%s\" % (protocol,host,port,path)\nbody = (b'<myxml></myxml>\\n')\n\nreturn session.request(method, url, headers=headers, data=body,\n cert=('cert.pem', 'key.pem'),\n verify=False)\n```\n\nHTTP request generated:\n\n POST /my/web/service HTTP/1.1\n Host: localhost\n Accept-Encoding: identity\n Content-Type: application/x-www-form-urlencoded\n Content-Length: 64\n Accept-Encoding: gzip, deflate, compress\n x-custom-header1: x\n x-custom-header2: mystring\n x-custom-header3: x\n Accept: _/_\n User-Agent: myagent\n Content-Type: text/xml\n x-custom-header4: 12345\n\n <myxml></myxml>\n\nNote the two content types. This same script in python 2 behaved correctly.\n",
"@adian0: Indeed. Try replacing the `'User-Agent'` and `'Content-Type'` header keys with `b'User-Agent'` and `b'Content-Type'`. If that works, then the problem is one that will be fixed by this pull request.\n",
"No, already I tried using bytes for those. It threw this exception:\n...\n File \"/usr/local/lib/python3.2/dist-packages/requests/models.py\", line 340, in <genexpr>\n headers = dict((name.encode('ascii'), value) for name, value in headers.items())\nAttributeError: 'bytes' object has no attribute 'encode'\n",
"The cause of the behavior reported by @adian0 seems to be the same I described in #1250.\n",
"@pmcnr Agreed, and this PR should resolve it. =)\n",
"@Lukasa It's a shame this PR is a breaking API change in Python 3. I've really been looking forward to the next major release of requests when you can finally include it. A big thank you for the excellent work!\n",
"#1459 \n",
"Closing since this is merged into #1509\n"
] |
https://api.github.com/repos/psf/requests/issues/1337
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1337/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1337/comments
|
https://api.github.com/repos/psf/requests/issues/1337/events
|
https://github.com/psf/requests/pull/1337
| 13,808,468
|
MDExOlB1bGxSZXF1ZXN0NTQ0OTY1NA==
| 1,337
|
Fix minor issues on the API docs
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/200230?v=4",
"events_url": "https://api.github.com/users/amercader/events{/privacy}",
"followers_url": "https://api.github.com/users/amercader/followers",
"following_url": "https://api.github.com/users/amercader/following{/other_user}",
"gists_url": "https://api.github.com/users/amercader/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/amercader",
"id": 200230,
"login": "amercader",
"node_id": "MDQ6VXNlcjIwMDIzMA==",
"organizations_url": "https://api.github.com/users/amercader/orgs",
"received_events_url": "https://api.github.com/users/amercader/received_events",
"repos_url": "https://api.github.com/users/amercader/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/amercader/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/amercader/subscriptions",
"type": "User",
"url": "https://api.github.com/users/amercader",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 3
|
2013-04-30T14:17:58Z
|
2021-09-08T20:01:18Z
|
2013-05-01T17:28:18Z
|
CONTRIBUTOR
|
resolved
|
- 'Cookies' and 'Encodings' sections were not built because the
reference to the functions was wrong.
- 'Exceptions' section had a wrong anchor link ('module-requests', same
one as the main heading).
- Remove 'decode_gzip' function, which is no longer present.
|
{
"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/1337/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1337/timeline
| null | null | false
|
{
"diff_url": "https://github.com/psf/requests/pull/1337.diff",
"html_url": "https://github.com/psf/requests/pull/1337",
"merged_at": "2013-05-01T17:28:18Z",
"patch_url": "https://github.com/psf/requests/pull/1337.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/1337"
}
| true
|
[
"Sweet! +1. =D\n",
":+1: \n",
"Thanks!\n"
] |
https://api.github.com/repos/psf/requests/issues/1336
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1336/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1336/comments
|
https://api.github.com/repos/psf/requests/issues/1336/events
|
https://github.com/psf/requests/issues/1336
| 13,790,863
|
MDU6SXNzdWUxMzc5MDg2Mw==
| 1,336
|
Set cookie on 401
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/350213?v=4",
"events_url": "https://api.github.com/users/kervinpierre/events{/privacy}",
"followers_url": "https://api.github.com/users/kervinpierre/followers",
"following_url": "https://api.github.com/users/kervinpierre/following{/other_user}",
"gists_url": "https://api.github.com/users/kervinpierre/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/kervinpierre",
"id": 350213,
"login": "kervinpierre",
"node_id": "MDQ6VXNlcjM1MDIxMw==",
"organizations_url": "https://api.github.com/users/kervinpierre/orgs",
"received_events_url": "https://api.github.com/users/kervinpierre/received_events",
"repos_url": "https://api.github.com/users/kervinpierre/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/kervinpierre/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/kervinpierre/subscriptions",
"type": "User",
"url": "https://api.github.com/users/kervinpierre",
"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 | 47
|
2013-04-30T03:19:58Z
|
2021-09-08T23:10:56Z
|
2013-08-15T07:59:47Z
|
NONE
|
resolved
|
If a 401 response contains a Set-Cookie header, that header is not returned on the subsequent AUTH.
An application requiring that cookie ( e.g. session id ) on the AUTH fails.
|
{
"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/1336/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1336/timeline
| null |
completed
| null | null | false
|
[
"`HTTPDigestAuth.handle_401()` needs to persist cookies. Thanks for reporting this! I'm marking this as contributor friendly, anyone who wants it should take it. I'm looking at @gazpachoking and @sigmavirus24, they're the cookie masters here.\n",
"No problem, thanks for the awesome library.\n\nThe is a simple workaround in the time being if anyone needs it. It may not work in all situations but it should for regular session ids..\n\n\"\"\" GET on the URL that requires authentication, just for the cookies \"\"\"\nreq = requests.get(authUrl)\n\n\"\"\" Start the session already holding the cookies \"\"\"\nsess = requests.Session()\nsess.cookies = req.cookies\n\n\"\"\" Session should now auth with the session cookies present \"\"\"\n",
"Hmm, I took a bit of a peek. So, should a `Session` persist response cookies before and after calling hooks then?\n",
"I'm not sure what the division of responsibilities should be here. In principle a hook could change _everything_ about the response, but if that happened I'd be tempted to argue that the previous version of the response shouldn't be persisted. I wonder if the auth handler should do this itself (or whether it can without a huge rewrite).\n",
"Yeah, I was having the same trouble deciding what should do what. It certainly didn't seem right that the auth handler would do anything with session cookies. I like how the auth handler catches the 401 and makes a totally new response, but I'm not sure how the session should get access to the headers from the first response to persist the cookies. The 401 handler could certainly read the set-cookies headers from the first response and send those cookies when it retries, but I'm not sure how the set-cookie headers ever get to the session in that case.\n",
"Yeah, this is a thorny one. I'll have a ponder about it and see if I can think of a good flow here.\n",
"So I have two ideas for how to handle this:\n\nThe first is the least magic-y and is that we extract the cookies before dispatching the hook and compare the old response to the new one. If they're different, extract the cookies from the new one too.\n\nThe second is write a function that will take the session object and return a hook to be placed as the default hook for responses. When users add their own hooks, it will persist on the session and it will be called when the other hooks are called. This would remove the need for line 456 in `Session.send` too. We'd instantiate the hook upon Session initialization and so long as the user doesn't remove it, we'll be fine.\n",
"New option after a [conversation](https://botbot.me/freenode/python-requests/msg/2960213/) with @gazpachoking (which I would link to if botbot.me was working; _edit_ added the link since it's now up and running):\n\nSince extracting the cookies before the hook could result in cookies being stored that hook authors might not want stored, we can safely move the extraction to after all redirects have been handled because then the history will be available. We also know that the history and the responses in the history will be correct because if there were redirects, the hooks are called on those responses too. So we can do something akin to:\n\n``` python\nr = dispatch_hook('..')\n\n# resolve redirects\n\nhistory = ['list comprehension']\n\nif history:\n # fix the history\n\nfor resp in r.history:\n extract_cookies_to_jar(self.cookies, request, resp.raw)\n\nextract_cookies_to_jar(self.cookies, request, r.raw)\n```\n\nThis way the cookies are set and expired in the right order and only the cookies the hook author wants us to see are extracted. We're in the clear with this because the Auth Handlers properly also manage history (at least the built-in ones do and requests-kerberos does too. I'll check ntlm later).\n",
"@sigmavirus24: If I understand this right, we'd also have to add code to `DigestAuth` to propagate cookies for the redirects it handles. Correct?\n",
"Depends on which of the three you're talking about.\n",
"Your newest option.\n",
"@Lukasa the cookie extraction would take place on the history. DigestAuth won't require any changes at all. It already maintains history and we'll be parsing that history. \n",
"That's not my concern. My worry is the second request that is made by `handle_401`. If a `Set-Cookie` header comes in on the 401, the auth handler needs to extract that cookie and send it back on the new request. Right?\n",
"Ah, I see what you mean. Yeah that means DigestAuth will have to do some extra \nwork.\n",
"Wouldn't that already be broken now if it's a problem?\n",
"It is broken now, that's exactly what this issue is about. =P\n",
"> It is broken now, that's exactly what this issue is about. =P\n\nDoh!\n",
"Sucks a bit that we have to repeat the cookie parsing 3 places, don't have any better ideas right now though.\n",
"Shouldn't `r.cookies` return the proper cookies set by the server? In that case, what if we just clone the old request and call `p.prepare_cookies(r.cookies)` to add those cookies? It'll give us a proper PreparedRequest for the new response and will have the cookies in tow.\n\nIn fact, I just checked `requests/adapters.py` and before the response is returned to us the cookies are in fact parsed and returned on `Response.cookies`. Let's just use that!\n",
"Won't that just contain the cookies that the server set on that this response? And so we'd be missing the cookies from the session?\n",
"Hm. The cookies on the session should be in the Set-Cookie header on `r.request`. Any relevant ones were prepared there. Is it possible to extract those cookies and add them to the jar before preparing the new request?\n",
"It should be. I think that's the way to go. =)\n",
"So to recapitulate:\n\nIn `requests/auth.py` we're going to extract the old cookies from the `Cookie` header in `r.request` add that to a Jar and then add any other cookies in `r.cookies`. Then we're going to make a new PreparedRequest and send for the Authentication.\n\nI proposed earlier that in `requests/sessions.py` we move the cookie extraction after the history has been completed but I've just now realized this is problematic for the following reason:\n\nLet's say we hit a server (either with authentication or otherwise) that redirects us and sets a cookie. If we only extract the cookies to the session's jar after we follow the redirect, we won't have the proper cookie for retrieving the page we're redirected to. So in my opinion, that should stay exactly where it is. I believe all of this is happening in `Session#send` so every time we get to the cookie extraction point (on the redirect requests) cookies are updated on the session's jar anyway. This does not need to be changed. If you guys think otherwise, or can think of a reason why my proposed situation is impossible, let me know. But I'm 90% sure that change is wholly unnecessary.\n",
"Yeah, we definitely need to keep the cookie persistence in the redirect code, which is the same problem we have to solve in the auth code, i.e. recomputing new cookies based on previous ones and `Set-Cookie` headers in the response for the new request.\n\nI'm not sure adding `r.request.headers['Cookies']` to the `r.cookies` cookiejar in the auth code is exactly right though. For one, if the original response was trying to unset a cookie, it wouldn't work.\n",
"> I'm not sure adding r.request.headers['Cookies'] to the r.cookies cookiejar in the auth code is exactly right though. For one, if the original response was trying to unset a cookie, it wouldn't work.\n\nBut if we turn `r.request.headers['Cookies']` into a jar first, then update it with `r.cookies` won't that unset the cookies you're talking about? Just like how they work in the `send` method.\n",
"@sigmavirus24 I think so, yeah.\n",
"A cookiejar doesn't contain the unset commands though, it is already lost when we parsed the `Set-Cookie` header into the `r.cookies` jar.\n",
"To clarify, I think we need to parse the `Set-Cookie` header from the response into a jar that contains the request's cookies rather than adding the request's cookies into the jar created from the response's `Set-Cookies` header.\n",
"I thought that's what I said. Anyway can't talk now. Out to dinner with an old friend.\n",
"I meant we can't use `r.cookies`, we have to use the `Set-Cookie` header directly from `r`\n"
] |
https://api.github.com/repos/psf/requests/issues/1335
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1335/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1335/comments
|
https://api.github.com/repos/psf/requests/issues/1335/events
|
https://github.com/psf/requests/issues/1335
| 13,790,505
|
MDU6SXNzdWUxMzc5MDUwNQ==
| 1,335
|
Content-Length header is duplicated on Python3
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/150242?v=4",
"events_url": "https://api.github.com/users/valyagolev/events{/privacy}",
"followers_url": "https://api.github.com/users/valyagolev/followers",
"following_url": "https://api.github.com/users/valyagolev/following{/other_user}",
"gists_url": "https://api.github.com/users/valyagolev/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/valyagolev",
"id": 150242,
"login": "valyagolev",
"node_id": "MDQ6VXNlcjE1MDI0Mg==",
"organizations_url": "https://api.github.com/users/valyagolev/orgs",
"received_events_url": "https://api.github.com/users/valyagolev/received_events",
"repos_url": "https://api.github.com/users/valyagolev/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/valyagolev/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/valyagolev/subscriptions",
"type": "User",
"url": "https://api.github.com/users/valyagolev",
"user_view_type": "public"
}
|
[
{
"color": "e10c02",
"default": false,
"description": null,
"id": 117744,
"name": "Bug",
"node_id": "MDU6TGFiZWwxMTc3NDQ=",
"url": "https://api.github.com/repos/psf/requests/labels/Bug"
},
{
"color": "0b02e1",
"default": false,
"description": null,
"id": 191274,
"name": "Contributor Friendly",
"node_id": "MDU6TGFiZWwxOTEyNzQ=",
"url": "https://api.github.com/repos/psf/requests/labels/Contributor%20Friendly"
}
] |
closed
| true
| null |
[] | null | 6
|
2013-04-30T02:58:10Z
|
2021-09-09T03:00:27Z
|
2013-06-08T09:57:00Z
|
NONE
|
resolved
|
Content-Length header is duplicated if specified on Python3, leading to 400 responses:
```
Python 3.3.0 (default, Apr 30 2013, 06:45:58)
[GCC 4.2.1 Compatible Apple Clang 4.0 ((tags/Apple/clang-421.0.60))] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import requests
>>> requests.post("http://httpbin.org/post", headers={"Content-Length": 0})
<Response [400]>
```
We need to go deeper:
```
>>> import six
>>> six.moves.http_client.HTTPConnection.debuglevel = 1
>>> requests.post("http://httpbin.org/post", headers={"Content-Length": 0})
send: b'POST /post HTTP/1.1\r\nHost: httpbin.org\r\nAccept-Encoding: identity\r\nContent-Length: 0\r\nUser-Agent: python-requests/1.2.0 CPython/3.3.0 Darwin/12.3.0\r\nContent-Length: 0\r\nAccept: */*\r\nAccept-Encoding: gzip, deflate, compress\r\n\r\n'
reply: 'HTTP/1.1 400 BAD_REQUEST\r\n'
header: Content-Length header: Connection <Response [400]>
```
That's what happens:
``` http
POST /post HTTP/1.1
Host: httpbin.org
Accept-Encoding: identity
Content-Length: 0
User-Agent: python-requests/1.2.0 CPython/3.3.0 Darwin/12.3.0
Content-Length: 0
Accept: */*
Accept-Encoding: gzip, deflate, compress
```
Two content-lengths, one 400 response :-(
On Python2 everything's OK.
|
{
"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/1335/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1335/timeline
| null |
completed
| null | null | false
|
[
"Ok, so I've worked this out.\n\nIn [`PreparedRequest.prepare_headers()`](https://github.com/kennethreitz/requests/blob/master/requests/models.py#L328), we encode all the header keys as ASCII (the correctness of that is a discussion for another time). This includes the Content-Length you passed in on your original request. Later on, we call [`PreparedRequest.prepare_auth()`](https://github.com/kennethreitz/requests/blob/master/requests/models.py#L406), which calls [`PreparedRequest.prepare_content_length()`](https://github.com/kennethreitz/requests/blob/master/requests/models.py#L394). All fine.\n\nHowever, `prepare_content_length()` sets its content length as a native string, not an encoded one. This is a simple bug, so I'm going to mark this contributor friendly. If no-one fixes it before this evening I'll open a quick PR.\n",
"Ugh, crap. Turns out fixing this breaks some other stuff. That's not ideal.\n",
"I noticed something today that's possibly related.\n\nIf I specify a `Content-Length` header, `requests` ignores it and instead uses one it takes from the file instead. (py2). Maybe this is intended but as I understood user specified headers are supposed to take precedence over implicit addition of headers? This has caused me a bit of a problem as I can't return anything over `sys.maxint` from `__len__` of a file object as I get this traceback, so I can't upload files over 2GB using this method.\n\n``` python\n File \"/Users/paul/Source/Python/PythonApp/upload.py\", line 911, in _gUpload\n response = requests.put(signed_url, file_iterator, headers=headers, timeout=settings.UPLOAD_TIMEOUT)\n File \"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/requests/api.py\", line 98, in put\n return request('put', url, data=data, **kwargs)\n File \"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/requests/api.py\", line 44, in request\n return session.request(method=method, url=url, **kwargs)\n File \"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/requests/sessions.py\", line 276, in request\n prep = req.prepare()\n File \"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/requests/models.py\", line 224, in prepare\n p.prepare_body(self.data, self.files)\n File \"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/requests/models.py\", line 349, in prepare_body\n length = super_len(data)\n File \"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/requests/utils.py\", line 45, in super_len\n return len(o)\nOverflowError: long int too large to convert to int\n```\n",
"This bug should be resolved by #1338, so I'm going to close this issue to centralise discussion over there. Thanks so much for pointing it out!\n",
"@Lukasa thank you! Btw, you accidentally pushed a merge conflict :(\n",
"Oh man, so I did! I swear I fixed that! Awkward. =( Thanks for pointing it out. :cake:\n"
] |
https://api.github.com/repos/psf/requests/issues/1334
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1334/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1334/comments
|
https://api.github.com/repos/psf/requests/issues/1334/events
|
https://github.com/psf/requests/pull/1334
| 13,781,108
|
MDExOlB1bGxSZXF1ZXN0NTQzNTA4MQ==
| 1,334
|
resolve_redirects no longer throws an InvalidSchema exception when the scheme is uppercase
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/775576?v=4",
"events_url": "https://api.github.com/users/bobcarroll/events{/privacy}",
"followers_url": "https://api.github.com/users/bobcarroll/followers",
"following_url": "https://api.github.com/users/bobcarroll/following{/other_user}",
"gists_url": "https://api.github.com/users/bobcarroll/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/bobcarroll",
"id": 775576,
"login": "bobcarroll",
"node_id": "MDQ6VXNlcjc3NTU3Ng==",
"organizations_url": "https://api.github.com/users/bobcarroll/orgs",
"received_events_url": "https://api.github.com/users/bobcarroll/received_events",
"repos_url": "https://api.github.com/users/bobcarroll/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/bobcarroll/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/bobcarroll/subscriptions",
"type": "User",
"url": "https://api.github.com/users/bobcarroll",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 12
|
2013-04-29T21:05:06Z
|
2021-09-08T20:01:17Z
|
2013-06-08T10:18:25Z
|
CONTRIBUTOR
|
resolved
|
I had a case where the Location header had a URL with the scheme in uppercase, which caused an InvalidSchema exception.
|
{
"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/1334/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1334/timeline
| null | null | false
|
{
"diff_url": "https://github.com/psf/requests/pull/1334.diff",
"html_url": "https://github.com/psf/requests/pull/1334",
"merged_at": "2013-06-08T10:18:25Z",
"patch_url": "https://github.com/psf/requests/pull/1334.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/1334"
}
| true
|
[
"First, thanks for reporting this and particular thanks for supplying code as well! Very awesome. =D\n\nInterestingly, we're not spec compliant here. I dove into RFC 2616 looking for a reason to blame the web server admin, but I stumbled upon this (emphasis mine):\n\n> When comparing two URIs to decide if they match or not, a client SHOULD use a case-sensitive octet-by-octet comparison of the entire URIs, with these exceptions:\n> - A port that is empty or not given is equivalent to the default port for that \n> URI-reference;\n> - **Comparisons of host names MUST be case-insensitive**;\n> - **Comparisons of scheme names MUST be case-insensitive**;\n> - An empty abs_path is equivalent to an abs_path of \"/\".\n\nSo I'm +1 on this _idea_, and I actually think we need to extend it to the hostname portion as well.\n\nAs for the actual PR, I think it can be improved. =) It would be really helpful to have a test (or even some tests) for this. Also, we should extend it to handle hostnames too (if possible). However, I think the real place to fix this is in the test for the InvalidSchema exception. If we're allowed to send HTTP:// as the scheme, then we should allow that everywhere, not just on redirect.\n",
"I added tests, which is good because I wasn't taking into account URLs without a scheme. So it should actually work now beyond my original test case. :)\n\nIt looks like httplib is handling uppercase hostnames, so I'm not sure there's a need to address that. I tried your suggestion of moving the fix to get_adapter(), but that creates a whole bunch of other problems with the pool manager expecting the scheme to be lowercase. One of the tests creates a GET request with an uppercase scheme and it's handled properly. So I think this is only an issue with resolve_redirects and the Location header. What do you think?\n\nAlso, I updated httpbin with a new endpoint for testing this issue (https://github.com/rcarz/httpbin). If you're happy with my changes, I can submit a pull request for that too.\n",
"Fair enough, if moving the fix doesn't work then it doesn't work. :smile:\n\nI like the httpbin endpoint, and I think you should submit a PR for it to that project. As for the tests, they're great. One note: the second test should probably assert on the return code too.\n\nOtherwise, this is perfect. =)\n",
"Awesome! Can you do a quick rebase so we can merge it in? :)\n",
"Great! I added the assertion and rebased.\n",
"Heh it's failing because we're using a non-existent endpoint for httpbin.\n",
"There's a PR for it: https://github.com/kennethreitz/httpbin/pull/89\n",
"I rebased again.\n",
"@kennethreitz Can you restart https://travis-ci.org/kennethreitz/requests/builds/7518571 ? It appears I can't do it without making another commit.\n",
"I'm not sure I follow. Per http://www.ietf.org/rfc/rfc2965.txt hostname matching should be case-insensitive. Is that not how it's behaving today? A quick test with uppercase hosts seems to work.\n\nI'm curious the conditions under which #1385 are needed. For example, this prints 200 for me with no changes to requests:\n\n``` python\nimport requests\n\nr = requests.get('HTTP://www.google.com')\nprint r.status_code\n```\n\nMy patch addresses uppercase schemes in the Location header, so it only affects redirects. I did try what @ViktorHaag has proposed, but I seem to remember having issues with a pool manager?\n",
"@rcarz That's odd, vanilla requests throws exceptions when I do a get on `HTTP://www.google.com/`. TravisCI does too.\n\nI'm not sure you're right, @Anorov. As @rcarz points out, this change here only affects redirects. You can see this by looking at the Travis CI output for this change, where a test with upper-case scheme fails.\n\n#1385 is more comprehensive than this fix. I need to sit down and confirm whether #1385 covers all cases this fix does.\n",
"@Lukasa Ah yeah, you're right, sorry. I only looked at the changes and not the full file.\n\n@rcarz Web servers and DNS servers should always be treating hostnames case insensitively, yes. So it doesn't really matter if `requests` lowercases it or not. I think it would just go along well, aesthetically, if the scheme is also lowercased.\n\nEither way, I think this should all be resolved with one pull (whether it be this one or the other, I'm not sure). I think all schemes should be strictly lowercased early on, before processing any further.\n\nIf you place the changes made in this commit, essentially `url = '%s://%s' % (scheme.lower(), uri)`, somewhere early on in `Session.send`, I think every bird would be killed with one stone (so to speak). Anyone disagree?\n"
] |
https://api.github.com/repos/psf/requests/issues/1333
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1333/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1333/comments
|
https://api.github.com/repos/psf/requests/issues/1333/events
|
https://github.com/psf/requests/pull/1333
| 13,730,866
|
MDExOlB1bGxSZXF1ZXN0NTQxMTg2OQ==
| 1,333
|
Redid CaseInsensitiveDict to work correctly/sanely
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/882547?v=4",
"events_url": "https://api.github.com/users/cdunklau/events{/privacy}",
"followers_url": "https://api.github.com/users/cdunklau/followers",
"following_url": "https://api.github.com/users/cdunklau/following{/other_user}",
"gists_url": "https://api.github.com/users/cdunklau/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/cdunklau",
"id": 882547,
"login": "cdunklau",
"node_id": "MDQ6VXNlcjg4MjU0Nw==",
"organizations_url": "https://api.github.com/users/cdunklau/orgs",
"received_events_url": "https://api.github.com/users/cdunklau/received_events",
"repos_url": "https://api.github.com/users/cdunklau/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/cdunklau/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/cdunklau/subscriptions",
"type": "User",
"url": "https://api.github.com/users/cdunklau",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 19
|
2013-04-28T06:46:30Z
|
2021-09-08T23:05:04Z
|
2013-04-30T20:07:27Z
|
CONTRIBUTOR
|
resolved
|
Fixes #649, ~~#1321,~~ and #1329. Don't merge yet, I want to get
some opinions about this implementation.
There are a few things I'd like input on. I completely rewrote `CaseInsensitiveDict` because it was hard to read. Instead of subclassing `dict`, this just implements the `collections.MutableMapping` interface, storing the data in an internal dict (._store). The result is far more obvious and readable.
1. The [old version](https://github.com/kennethreitz/requests/blob/40a060cf579a7f0996c92eed578148e526d9416f/requests/structures.py#L64-L66) returns None for nonexistent keys instead of raising KeyError. Do we actually need this behavior? My version doesn't do this, but it would be fairly trivial to add.
2. ~~Do we want header names to be titlecased? This stores keys and returns them in lowercase.~~
Please let me know if I can improve this at all.
EDIT: Doesn't fix 1321
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/882547?v=4",
"events_url": "https://api.github.com/users/cdunklau/events{/privacy}",
"followers_url": "https://api.github.com/users/cdunklau/followers",
"following_url": "https://api.github.com/users/cdunklau/following{/other_user}",
"gists_url": "https://api.github.com/users/cdunklau/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/cdunklau",
"id": 882547,
"login": "cdunklau",
"node_id": "MDQ6VXNlcjg4MjU0Nw==",
"organizations_url": "https://api.github.com/users/cdunklau/orgs",
"received_events_url": "https://api.github.com/users/cdunklau/received_events",
"repos_url": "https://api.github.com/users/cdunklau/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/cdunklau/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/cdunklau/subscriptions",
"type": "User",
"url": "https://api.github.com/users/cdunklau",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/1333/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1333/timeline
| null | null | false
|
{
"diff_url": "https://github.com/psf/requests/pull/1333.diff",
"html_url": "https://github.com/psf/requests/pull/1333",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/1333.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/1333"
}
| true
|
[
"Ok, so I redid this to directly subclass MutableMapping. The above concerns remain, and I'm also concerned that this will break session pickles. Do we care about breaking pickles?\n",
"Another concern, brought up by @gazpachoking: The original implementation preserves the case of the header name first inserted, this implementation does not.\n",
"> Do we care about breaking pickles?\n\nYes. Yes we do.\n",
"@sigmavirus24 So it doesn't break pickles. The loaded session pickle just uses the original's dict:\n\n```\n(.venv)cdunklau@krusty:~/Development/requests$ git checkout master\nSwitched to branch 'master'\n(.venv)cdunklau@krusty:~/Development/requests$ python\nPython 2.7.3rc2 (default, Apr 22 2012, 22:30:17) \n[GCC 4.6.3] on linux2\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\nEnabled tab completion\n>>> import requests\n>>> s = requests.Session()\n>>> s.headers\n{'Accept-Encoding': 'gzip, deflate, compress', 'Accept': '*/*', 'User-Agent': 'python-requests/1.2.0 CPython/2.7.3rc2 Linux/3.2.0-4-amd64'}\n>>> s.headers.update({'Accept': 'application/json'})\n>>> import pickle\n>>> with open('/tmp/sessionpickle', 'w') as f:\n... pickle.dump(s, f)\n... \n>>> \n(.venv)cdunklau@krusty:~/Development/requests$ git checkout case_insensitive_headers \nSwitched to branch 'case_insensitive_headers'\nYour branch is ahead of 'origin/case_insensitive_headers' by 1 commit.\n(.venv)cdunklau@krusty:~/Development/requests$ python\nPython 2.7.3rc2 (default, Apr 22 2012, 22:30:17) \n[GCC 4.6.3] on linux2\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\nEnabled tab completion\n>>> import requests, pickle\n>>> with open('/tmp/sessionpickle') as f:\n... s = pickle.load(f)\n... \n>>> s\n<requests.sessions.Session object at 0xf293d0>\n>>> s.headers\n{'Accept-Encoding': 'gzip, deflate, compress', 'Accept': 'application/json', 'User-Agent': 'python-requests/1.2.0 CPython/2.7.3rc2 Linux/3.2.0-4-amd64'}\n>>> news = requests.Session()\n>>> news.headers\nCaseInsensitiveDict({'Accept-Encoding': 'gzip, deflate, compress', 'Accept': '*/*', 'User-Agent': 'python-requests/1.2.0 CPython/2.7.3rc2 Linux/3.2.0-4-amd64'})\n```\n",
"Awesome, thanks!\n",
"Ok, so as of 2b92e2c, here are the changes from the original implementation:\n1. CaseInsensitiveDict is rewritten as a subclass of `collections.MutableMapping`.\n2. It remembers the case of the last-set key, but `__setitem__` and `__delitem__` will handle keys without respect to case.\n3. It returns the key case as remembered for the `keys`, `items`, and `__iter__` methods.\n4. Query operations (`__getitem__` and `__contains__`) are done in a case-insensitive manner.\n5. The constructor as well as `update` and `__eq__` have undefined behavior when given multiple keys that have the same `lower()`.\n\nEdit:\n1. The `__repr__` now makes it obvious that it's not a normal dict.\n",
"_undefined behavior when given multiple keys that have the same `lower()`_ ? What happened to the `ValueError` idea? :)\n",
"@piotr-dobrogost There was some back and forth on IRC about it, and I was swayed. The undefined behavior is preferred because:\n1. Simplicity. (KISS)\n2. More dict-like in some circumstances.\n\nBut I can't remember the finer details. @gazpachoking, @Lukasa can you chime in?\n",
"@piotr-dobrogost Regular dicts have undefined behavior when you define two keys that are the same, since they are unordered `{'a': 3, 'a': 4}`, this would be the same as `CaseInsensitiveDict{{'A': 3, 'a': 4})`\n",
"Heh, coming from C++ (I guess the concept is present in other compiled languages, too) I take undefined behavior to mean the behavior is really undefined not that it's just not well defined which is what you describe and it's something quite different :)\n",
"Yeah, I was under the impression that doing what @gazpachoking described would cause a `ValueError`, but (totally insanely IMHO) it doesn't. So we should just match that behaviour.\n",
"Well, checking input arguments is not without cost and maybe this cost was unacceptable to authors of the standard dict (read Raymond :))?\n",
"> Heh, coming from C++ (I guess the concept is present in other compiled languages, too) I take undefined behavior to mean the behavior is really undefined not that it's just not well defined which is what you describe and it's something quite different :)\n\nOops, maybe I started using the wrong terminology and confused things.\n",
"Ok, looks like consensus on the \"undefined\" behavior for same-lower()-ed keys.\n\nThe only remaining thing: What should be the behavior of `__getitem__` for nonexistent keys? The original CID implementation returns `None` instead of raising `KeyError`.\n",
"I'm not sure the reason for the old behavior, but I vote for `KeyError`\n",
"Agreed. Let's be like `dict` wherever possible.\n",
"Sounds good. I need to work on the tests a bit more, then it'll be good to merge. Should I squash the commits and/or submit a new PR? This has gotten quite messy :)\n",
"The original claim that this fixes #1321 is incorrect. I have a test for it in 424c252, but it fails, so i've commented it for now.\n",
"Squashed changes into a new branch, PR #1339. Nitpicking, I know, but it makes it cleaner.\n"
] |
https://api.github.com/repos/psf/requests/issues/1332
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1332/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1332/comments
|
https://api.github.com/repos/psf/requests/issues/1332/events
|
https://github.com/psf/requests/pull/1332
| 13,726,332
|
MDExOlB1bGxSZXF1ZXN0NTQxMDIzMw==
| 1,332
|
Update urllib3 to 59de03e6163c6928dc01832ed6e48e9f6c34c795.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/48100?v=4",
"events_url": "https://api.github.com/users/bboe/events{/privacy}",
"followers_url": "https://api.github.com/users/bboe/followers",
"following_url": "https://api.github.com/users/bboe/following{/other_user}",
"gists_url": "https://api.github.com/users/bboe/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/bboe",
"id": 48100,
"login": "bboe",
"node_id": "MDQ6VXNlcjQ4MTAw",
"organizations_url": "https://api.github.com/users/bboe/orgs",
"received_events_url": "https://api.github.com/users/bboe/received_events",
"repos_url": "https://api.github.com/users/bboe/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/bboe/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/bboe/subscriptions",
"type": "User",
"url": "https://api.github.com/users/bboe",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 1
|
2013-04-27T21:34:40Z
|
2021-09-08T20:01:17Z
|
2013-04-28T23:58:09Z
|
CONTRIBUTOR
|
resolved
|
This update includes two fixes:
- https://github.com/shazow/urllib3/issues/149
- https://github.com/shazow/urllib3/issues/174
|
{
"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/1332/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1332/timeline
| null | null | false
|
{
"diff_url": "https://github.com/psf/requests/pull/1332.diff",
"html_url": "https://github.com/psf/requests/pull/1332",
"merged_at": "2013-04-28T23:58:09Z",
"patch_url": "https://github.com/psf/requests/pull/1332.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/1332"
}
| true
|
[
"thanks!\n"
] |
https://api.github.com/repos/psf/requests/issues/1331
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1331/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1331/comments
|
https://api.github.com/repos/psf/requests/issues/1331/events
|
https://github.com/psf/requests/pull/1331
| 13,725,085
|
MDExOlB1bGxSZXF1ZXN0NTQwOTc0OA==
| 1,331
|
Update urllib3 to 40fedda5a3f026454df7694603ececc20510e624.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/48100?v=4",
"events_url": "https://api.github.com/users/bboe/events{/privacy}",
"followers_url": "https://api.github.com/users/bboe/followers",
"following_url": "https://api.github.com/users/bboe/following{/other_user}",
"gists_url": "https://api.github.com/users/bboe/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/bboe",
"id": 48100,
"login": "bboe",
"node_id": "MDQ6VXNlcjQ4MTAw",
"organizations_url": "https://api.github.com/users/bboe/orgs",
"received_events_url": "https://api.github.com/users/bboe/received_events",
"repos_url": "https://api.github.com/users/bboe/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/bboe/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/bboe/subscriptions",
"type": "User",
"url": "https://api.github.com/users/bboe",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 1
|
2013-04-27T19:36:51Z
|
2021-09-08T20:01:16Z
|
2013-04-27T19:41:47Z
|
CONTRIBUTOR
|
resolved
|
This update includes two fixes:
- https://github.com/shazow/urllib3/issues/149
- https://github.com/shazow/urllib3/issues/174
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/48100?v=4",
"events_url": "https://api.github.com/users/bboe/events{/privacy}",
"followers_url": "https://api.github.com/users/bboe/followers",
"following_url": "https://api.github.com/users/bboe/following{/other_user}",
"gists_url": "https://api.github.com/users/bboe/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/bboe",
"id": 48100,
"login": "bboe",
"node_id": "MDQ6VXNlcjQ4MTAw",
"organizations_url": "https://api.github.com/users/bboe/orgs",
"received_events_url": "https://api.github.com/users/bboe/received_events",
"repos_url": "https://api.github.com/users/bboe/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/bboe/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/bboe/subscriptions",
"type": "User",
"url": "https://api.github.com/users/bboe",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/1331/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1331/timeline
| null | null | false
|
{
"diff_url": "https://github.com/psf/requests/pull/1331.diff",
"html_url": "https://github.com/psf/requests/pull/1331",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/1331.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/1331"
}
| true
|
[
"Ah sorry, closing this as I just realized the objects aren't unpickle-able. I'll reopen once that's fixed.\n"
] |
https://api.github.com/repos/psf/requests/issues/1330
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1330/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1330/comments
|
https://api.github.com/repos/psf/requests/issues/1330/events
|
https://github.com/psf/requests/pull/1330
| 13,720,072
|
MDExOlB1bGxSZXF1ZXN0NTQwNzg3OQ==
| 1,330
|
Fixing a tiny typo, noticed while working on the Polish translation
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/327323?v=4",
"events_url": "https://api.github.com/users/Kwpolska/events{/privacy}",
"followers_url": "https://api.github.com/users/Kwpolska/followers",
"following_url": "https://api.github.com/users/Kwpolska/following{/other_user}",
"gists_url": "https://api.github.com/users/Kwpolska/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Kwpolska",
"id": 327323,
"login": "Kwpolska",
"node_id": "MDQ6VXNlcjMyNzMyMw==",
"organizations_url": "https://api.github.com/users/Kwpolska/orgs",
"received_events_url": "https://api.github.com/users/Kwpolska/received_events",
"repos_url": "https://api.github.com/users/Kwpolska/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Kwpolska/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Kwpolska/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Kwpolska",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 1
|
2013-04-27T11:52:53Z
|
2021-09-08T20:01:16Z
|
2013-04-27T11:53:37Z
|
CONTRIBUTOR
|
resolved
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4",
"events_url": "https://api.github.com/users/kennethreitz/events{/privacy}",
"followers_url": "https://api.github.com/users/kennethreitz/followers",
"following_url": "https://api.github.com/users/kennethreitz/following{/other_user}",
"gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/kennethreitz",
"id": 119893,
"login": "kennethreitz",
"node_id": "MDQ6VXNlcjExOTg5Mw==",
"organizations_url": "https://api.github.com/users/kennethreitz/orgs",
"received_events_url": "https://api.github.com/users/kennethreitz/received_events",
"repos_url": "https://api.github.com/users/kennethreitz/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions",
"type": "User",
"url": "https://api.github.com/users/kennethreitz",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/1330/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1330/timeline
| null | null | false
|
{
"diff_url": "https://github.com/psf/requests/pull/1330.diff",
"html_url": "https://github.com/psf/requests/pull/1330",
"merged_at": "2013-04-27T11:53:37Z",
"patch_url": "https://github.com/psf/requests/pull/1330.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/1330"
}
| true
|
[
"Thanks!\n"
] |
|
https://api.github.com/repos/psf/requests/issues/1329
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1329/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1329/comments
|
https://api.github.com/repos/psf/requests/issues/1329/events
|
https://github.com/psf/requests/issues/1329
| 13,706,597
|
MDU6SXNzdWUxMzcwNjU5Nw==
| 1,329
|
Replacing existing session headers is not done case-insensitively
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/882547?v=4",
"events_url": "https://api.github.com/users/cdunklau/events{/privacy}",
"followers_url": "https://api.github.com/users/cdunklau/followers",
"following_url": "https://api.github.com/users/cdunklau/following{/other_user}",
"gists_url": "https://api.github.com/users/cdunklau/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/cdunklau",
"id": 882547,
"login": "cdunklau",
"node_id": "MDQ6VXNlcjg4MjU0Nw==",
"organizations_url": "https://api.github.com/users/cdunklau/orgs",
"received_events_url": "https://api.github.com/users/cdunklau/received_events",
"repos_url": "https://api.github.com/users/cdunklau/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/cdunklau/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/cdunklau/subscriptions",
"type": "User",
"url": "https://api.github.com/users/cdunklau",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 8
|
2013-04-26T20:22:33Z
|
2021-09-09T03:00:30Z
|
2013-05-01T17:52:33Z
|
CONTRIBUTOR
|
resolved
|
When updating a requests.sessions.Session object's headers with a differently-cased existing header name, subsequent requests made with the session object include both the default and the wrongly-cased version. This is surprising considering the docs mention the session's header dict is case insensitive.
While I would normally just think "ok, i'll just use the same casing as the default key", the examples in the docs use lowercase header names. The session header behavior also differs from the behavior of headers when supplied in the request itself with the `headers` kwarg:
``` python
import requests
s = requests.Session()
# Update dict as suggested by the session docs
s.headers.update({'accept': 'application/json'})
s.get('http://localhost:8080')
```
The request as received by the server (note "accept" and "Accept"):
```
GET / HTTP/1.1
Host: localhost:8080
accept: application/json
Accept-Encoding: gzip, deflate, compress
Accept: */*
User-Agent: python-requests/1.2.0 CPython/2.7.3rc2 Linux/3.2.0-4-amd64
```
Versus:
``` python
headers = {'accept': 'application/json'}
requests.get('http://localhost:8080', headers=headers)
```
Received request:
```
GET / HTTP/1.1
Host: localhost:8080
Accept-Encoding: gzip, deflate, compress
Accept: application/json
User-Agent: python-requests/1.2.0 CPython/2.7.3rc2 Linux/3.2.0-4-amd64
```
Obviously the docs are misleading, but I happen to really like the behavior demonstrated in the second request. I'm not sure how to try to fix the behavior. Perhaps a add_header method? That seems ugly though.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/882547?v=4",
"events_url": "https://api.github.com/users/cdunklau/events{/privacy}",
"followers_url": "https://api.github.com/users/cdunklau/followers",
"following_url": "https://api.github.com/users/cdunklau/following{/other_user}",
"gists_url": "https://api.github.com/users/cdunklau/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/cdunklau",
"id": 882547,
"login": "cdunklau",
"node_id": "MDQ6VXNlcjg4MjU0Nw==",
"organizations_url": "https://api.github.com/users/cdunklau/orgs",
"received_events_url": "https://api.github.com/users/cdunklau/received_events",
"repos_url": "https://api.github.com/users/cdunklau/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/cdunklau/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/cdunklau/subscriptions",
"type": "User",
"url": "https://api.github.com/users/cdunklau",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/1329/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1329/timeline
| null |
completed
| null | null | false
|
[
"Ok, so based on a suggestion from @Lukasa in IRC, I'm considering switching `.sessions.Session.headers` over to `.structures.CaseInsensitiveDict`, but it looks like its `.update` method doesn't do what I'd like. However, I don't really know what the sane behavior would be for edge cases where the input mapping has two keys that have the same `.lower()`...\n\nThis needs some extra thinking, I'll ponder it over the weekend.\n",
"I think the correct behaviour there is to throw a `ValueError`. We can't meaningfully merge the values: the user might want any of about three different things to happen and we don't know which, so I think we want to die.\n",
"I've made significant progress implementing CID as a wrapper around (not a subclass of) dict. All that remains to be done is flesh out the tests completely.\n\nI'll take the suggestion to throw a ValueError under advisement. I noticed that the fix for #649 wasn't merged. My fix for this issue should fix that one as well. I also believe it will be a better solution for #1321.\n",
"So far: https://github.com/cdunklau/requests/commit/6e476452f11c18a1be61905d1f12ae2679aee124\n",
"Fixed in e6e9b55.\n",
"But the 'latest' [document](http://docs.python-requests.org/en/latest/user/quickstart/#response-headers) still says, \n\n```\nIf a header doesn’t exist in the Response, its value defaults to None:\n```\n\nI hope someone can update it...\n",
"Mm. Do we want that behaviour? I feel like we should bring the docs in line with the current dict-like behaviour.\n",
":+1: for updating the docs to reflect the change. Sorry for not catching this.\n"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.