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/1529
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1529/labels{/name}
https://api.github.com/repos/psf/requests/issues/1529/comments
https://api.github.com/repos/psf/requests/issues/1529/events
https://github.com/psf/requests/pull/1529
17,969,701
MDExOlB1bGxSZXF1ZXN0NzU1NTgxNg==
1,529
bug fix for Python 3 support so that this line does not convert all dict...
{ "avatar_url": "https://avatars.githubusercontent.com/u/2981081?v=4", "events_url": "https://api.github.com/users/hunleyexpress/events{/privacy}", "followers_url": "https://api.github.com/users/hunleyexpress/followers", "following_url": "https://api.github.com/users/hunleyexpress/following{/other_user}", "gists_url": "https://api.github.com/users/hunleyexpress/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/hunleyexpress", "id": 2981081, "login": "hunleyexpress", "node_id": "MDQ6VXNlcjI5ODEwODE=", "organizations_url": "https://api.github.com/users/hunleyexpress/orgs", "received_events_url": "https://api.github.com/users/hunleyexpress/received_events", "repos_url": "https://api.github.com/users/hunleyexpress/repos", "site_admin": false, "starred_url": "https://api.github.com/users/hunleyexpress/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/hunleyexpress/subscriptions", "type": "User", "url": "https://api.github.com/users/hunleyexpress", "user_view_type": "public" }
[]
closed
true
null
[]
null
3
2013-08-12T22:26:47Z
2021-09-08T23:06:16Z
2013-08-13T05:44:32Z
NONE
resolved
... keys into binary byte strings and cause the CaseInsensitiveDict to fail to find existing keys, such as content-type
{ "avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4", "events_url": "https://api.github.com/users/Lukasa/events{/privacy}", "followers_url": "https://api.github.com/users/Lukasa/followers", "following_url": "https://api.github.com/users/Lukasa/following{/other_user}", "gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Lukasa", "id": 1382556, "login": "Lukasa", "node_id": "MDQ6VXNlcjEzODI1NTY=", "organizations_url": "https://api.github.com/users/Lukasa/orgs", "received_events_url": "https://api.github.com/users/Lukasa/received_events", "repos_url": "https://api.github.com/users/Lukasa/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Lukasa/starred{/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/1529/reactions" }
https://api.github.com/repos/psf/requests/issues/1529/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/1529.diff", "html_url": "https://github.com/psf/requests/pull/1529", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/1529.patch", "url": "https://api.github.com/repos/psf/requests/pulls/1529" }
true
[ "Thanks for this! Unfortunately, we've already got a fix for this in the 2.0 branch, from Pull Request #1338. Still, thanks for opening the pull request, and please keep contributing!\n", "what is the ETA on the 2.0 branch release? we'd like to stay current and\nnot have to merge this change into every release pull for a long period if\nwe can help it.\n\nthanks!\n\nOn Mon, Aug 12, 2013 at 10:44 PM, Cory Benfield [email protected]:\n\n> Thanks for this! Unfortunately, we've already got a fix for this in the\n> 2.0 branch, from Pull Request #1338https://github.com/kennethreitz/requests/issues/1338.\n> Still, thanks for opening the pull request, and please keep contributing!\n> \n> —\n> Reply to this email directly or view it on GitHubhttps://github.com/kennethreitz/requests/pull/1529#issuecomment-22544431\n> .\n", "We expect 2.0 to be the next release out the door, so hopefully that shouldn't be a problem. Sadly, even if it wasn't the next release out the door, we still couldn't merge this before then, because it's a backward-incompatible API change.\n" ]
https://api.github.com/repos/psf/requests/issues/1528
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1528/labels{/name}
https://api.github.com/repos/psf/requests/issues/1528/comments
https://api.github.com/repos/psf/requests/issues/1528/events
https://github.com/psf/requests/issues/1528
17,950,226
MDU6SXNzdWUxNzk1MDIyNg==
1,528
match_hostname() doesn't implement RFC 6125 wildcard matching rules
{ "avatar_url": "https://avatars.githubusercontent.com/u/444071?v=4", "events_url": "https://api.github.com/users/tiran/events{/privacy}", "followers_url": "https://api.github.com/users/tiran/followers", "following_url": "https://api.github.com/users/tiran/following{/other_user}", "gists_url": "https://api.github.com/users/tiran/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/tiran", "id": 444071, "login": "tiran", "node_id": "MDQ6VXNlcjQ0NDA3MQ==", "organizations_url": "https://api.github.com/users/tiran/orgs", "received_events_url": "https://api.github.com/users/tiran/received_events", "repos_url": "https://api.github.com/users/tiran/repos", "site_admin": false, "starred_url": "https://api.github.com/users/tiran/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/tiran/subscriptions", "type": "User", "url": "https://api.github.com/users/tiran", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2013-08-12T16:24:36Z
2021-09-09T02:11:40Z
2013-08-12T16:57:13Z
CONTRIBUTOR
resolved
Please see http://bugs.python.org/issue17997 for more information and a preliminary patch
{ "avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4", "events_url": "https://api.github.com/users/Lukasa/events{/privacy}", "followers_url": "https://api.github.com/users/Lukasa/followers", "following_url": "https://api.github.com/users/Lukasa/following{/other_user}", "gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Lukasa", "id": 1382556, "login": "Lukasa", "node_id": "MDQ6VXNlcjEzODI1NTY=", "organizations_url": "https://api.github.com/users/Lukasa/orgs", "received_events_url": "https://api.github.com/users/Lukasa/received_events", "repos_url": "https://api.github.com/users/Lukasa/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Lukasa/starred{/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/1528/reactions" }
https://api.github.com/repos/psf/requests/issues/1528/timeline
null
completed
null
null
false
[ "Thanks for raising this issue!\n\nAs far as I can see only the `urllib3` portion of the library includes `match_hostname()`. Can I ask you to go and open this issue [there](https://github.com/shazow/urllib3)?\n" ]
https://api.github.com/repos/psf/requests/issues/1527
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1527/labels{/name}
https://api.github.com/repos/psf/requests/issues/1527/comments
https://api.github.com/repos/psf/requests/issues/1527/events
https://github.com/psf/requests/pull/1527
17,943,515
MDExOlB1bGxSZXF1ZXN0NzU0MTkzMg==
1,527
Raise an error for unsupported hook event
{ "avatar_url": "https://avatars.githubusercontent.com/u/208304?v=4", "events_url": "https://api.github.com/users/paul-matthews/events{/privacy}", "followers_url": "https://api.github.com/users/paul-matthews/followers", "following_url": "https://api.github.com/users/paul-matthews/following{/other_user}", "gists_url": "https://api.github.com/users/paul-matthews/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/paul-matthews", "id": 208304, "login": "paul-matthews", "node_id": "MDQ6VXNlcjIwODMwNA==", "organizations_url": "https://api.github.com/users/paul-matthews/orgs", "received_events_url": "https://api.github.com/users/paul-matthews/received_events", "repos_url": "https://api.github.com/users/paul-matthews/repos", "site_admin": false, "starred_url": "https://api.github.com/users/paul-matthews/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/paul-matthews/subscriptions", "type": "User", "url": "https://api.github.com/users/paul-matthews", "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
6
2013-08-12T14:32:50Z
2021-09-08T23:07:24Z
2013-08-21T18:28:23Z
CONTRIBUTOR
resolved
Fixes #1525 against branch 2.0 - Raises a ValueError for an unsupported hook event
{ "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/1527/reactions" }
https://api.github.com/repos/psf/requests/issues/1527/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/1527.diff", "html_url": "https://github.com/psf/requests/pull/1527", "merged_at": "2013-08-21T18:28:23Z", "patch_url": "https://github.com/psf/requests/pull/1527.patch", "url": "https://api.github.com/repos/psf/requests/pulls/1527" }
true
[ "Beautiful, thanks so much! =D\n", "Hmm, I wonder if we should give people the ability to provide their own hooks...\n\nProbably not :)\n", "Thanks a million!\n", "> Probably not :)\n\nI am more strongly against it. I have no clue how we could provide \nuser-created hooks in a sane way.\n", "Well, I was thinking for use in custom adapters. Obviously, the intended actions would just be in the adapter though. So.... never mind :)\n", "Ah that makes more sense frankly. I like that idea too... hm.\n" ]
https://api.github.com/repos/psf/requests/issues/1526
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1526/labels{/name}
https://api.github.com/repos/psf/requests/issues/1526/comments
https://api.github.com/repos/psf/requests/issues/1526/events
https://github.com/psf/requests/pull/1526
17,939,986
MDExOlB1bGxSZXF1ZXN0NzU0MDA3Mw==
1,526
Raise an error for unsupported hook event
{ "avatar_url": "https://avatars.githubusercontent.com/u/208304?v=4", "events_url": "https://api.github.com/users/paul-matthews/events{/privacy}", "followers_url": "https://api.github.com/users/paul-matthews/followers", "following_url": "https://api.github.com/users/paul-matthews/following{/other_user}", "gists_url": "https://api.github.com/users/paul-matthews/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/paul-matthews", "id": 208304, "login": "paul-matthews", "node_id": "MDQ6VXNlcjIwODMwNA==", "organizations_url": "https://api.github.com/users/paul-matthews/orgs", "received_events_url": "https://api.github.com/users/paul-matthews/received_events", "repos_url": "https://api.github.com/users/paul-matthews/repos", "site_admin": false, "starred_url": "https://api.github.com/users/paul-matthews/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/paul-matthews/subscriptions", "type": "User", "url": "https://api.github.com/users/paul-matthews", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2013-08-12T13:24:25Z
2021-09-08T23:05:03Z
2013-08-12T13:25:35Z
CONTRIBUTOR
resolved
Fixes #1525 - Raises a ValueError for an unsupported hook event
{ "avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4", "events_url": "https://api.github.com/users/Lukasa/events{/privacy}", "followers_url": "https://api.github.com/users/Lukasa/followers", "following_url": "https://api.github.com/users/Lukasa/following{/other_user}", "gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Lukasa", "id": 1382556, "login": "Lukasa", "node_id": "MDQ6VXNlcjEzODI1NTY=", "organizations_url": "https://api.github.com/users/Lukasa/orgs", "received_events_url": "https://api.github.com/users/Lukasa/received_events", "repos_url": "https://api.github.com/users/Lukasa/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Lukasa/starred{/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/1526/reactions" }
https://api.github.com/repos/psf/requests/issues/1526/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/1526.diff", "html_url": "https://github.com/psf/requests/pull/1526", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/1526.patch", "url": "https://api.github.com/repos/psf/requests/pulls/1526" }
true
[ "Oh man, I'm so sorry, can you make this PR against the 2.0 branch? It's a breaking API change so it'll need to go there. =) I should have mentioned it before I sent you off to make this change. =(\n" ]
https://api.github.com/repos/psf/requests/issues/1525
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1525/labels{/name}
https://api.github.com/repos/psf/requests/issues/1525/comments
https://api.github.com/repos/psf/requests/issues/1525/events
https://github.com/psf/requests/issues/1525
17,937,890
MDU6SXNzdWUxNzkzNzg5MA==
1,525
KeyError during register_hook
{ "avatar_url": "https://avatars.githubusercontent.com/u/208304?v=4", "events_url": "https://api.github.com/users/paul-matthews/events{/privacy}", "followers_url": "https://api.github.com/users/paul-matthews/followers", "following_url": "https://api.github.com/users/paul-matthews/following{/other_user}", "gists_url": "https://api.github.com/users/paul-matthews/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/paul-matthews", "id": 208304, "login": "paul-matthews", "node_id": "MDQ6VXNlcjIwODMwNA==", "organizations_url": "https://api.github.com/users/paul-matthews/orgs", "received_events_url": "https://api.github.com/users/paul-matthews/received_events", "repos_url": "https://api.github.com/users/paul-matthews/repos", "site_admin": false, "starred_url": "https://api.github.com/users/paul-matthews/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/paul-matthews/subscriptions", "type": "User", "url": "https://api.github.com/users/paul-matthews", "user_view_type": "public" }
[]
closed
true
null
[]
null
6
2013-08-12T12:36:12Z
2021-09-09T02:11:40Z
2013-08-12T14:36:03Z
CONTRIBUTOR
resolved
If an event is added that isn't "response", during req.prepare() a KeyError is thrown. The error is difficult to track down and relates to the copying process of hooks from the request to the PreparedRequest. There should either be a better error message displayed. I.e. hook event not supported Or, as is in my pull request ( #1524 ) the RequestHooksMixin.register_hook method should handle creating the event.
{ "avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4", "events_url": "https://api.github.com/users/Lukasa/events{/privacy}", "followers_url": "https://api.github.com/users/Lukasa/followers", "following_url": "https://api.github.com/users/Lukasa/following{/other_user}", "gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Lukasa", "id": 1382556, "login": "Lukasa", "node_id": "MDQ6VXNlcjEzODI1NTY=", "organizations_url": "https://api.github.com/users/Lukasa/orgs", "received_events_url": "https://api.github.com/users/Lukasa/received_events", "repos_url": "https://api.github.com/users/Lukasa/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Lukasa/starred{/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/1525/reactions" }
https://api.github.com/repos/psf/requests/issues/1525/timeline
null
completed
null
null
false
[ "This is definitely a less-than-ideal behaviour, thanks for reporting this!\n\nIt seems to me that the right thing to do here is to throw a `ValueError` from [`register_hook`](https://github.com/kennethreitz/requests/blob/master/requests/models.py#L141) if a hook we don't support is added. =)\n", "This I can get behind. We could also potentially raise a NotImplementedError but that is idiomatic to methods on classes that are meant to be overloaded by child classes. A ValueError is the next best choice. \n", "I'm happy to provide a patch so that others aren't going to hit this issue.\n\nI would prefer a ValueError as stating that it's not implemented suggests that it's going to be. Which given the argument you've provided sounds unlikely.\n", "We'd be delighted to have a patch, thanks! =)\n", "In fact now only you can submit a patch for this issue. You're our only hope.\n", "This will be resolved by #1527. Thanks so much!\n" ]
https://api.github.com/repos/psf/requests/issues/1524
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1524/labels{/name}
https://api.github.com/repos/psf/requests/issues/1524/comments
https://api.github.com/repos/psf/requests/issues/1524/events
https://github.com/psf/requests/pull/1524
17,935,552
MDExOlB1bGxSZXF1ZXN0NzUzNzgxMQ==
1,524
Fixed KeyError on non deafult HOOK
{ "avatar_url": "https://avatars.githubusercontent.com/u/208304?v=4", "events_url": "https://api.github.com/users/paul-matthews/events{/privacy}", "followers_url": "https://api.github.com/users/paul-matthews/followers", "following_url": "https://api.github.com/users/paul-matthews/following{/other_user}", "gists_url": "https://api.github.com/users/paul-matthews/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/paul-matthews", "id": 208304, "login": "paul-matthews", "node_id": "MDQ6VXNlcjIwODMwNA==", "organizations_url": "https://api.github.com/users/paul-matthews/orgs", "received_events_url": "https://api.github.com/users/paul-matthews/received_events", "repos_url": "https://api.github.com/users/paul-matthews/repos", "site_admin": false, "starred_url": "https://api.github.com/users/paul-matthews/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/paul-matthews/subscriptions", "type": "User", "url": "https://api.github.com/users/paul-matthews", "user_view_type": "public" }
[]
closed
true
null
[]
null
7
2013-08-12T11:33:25Z
2021-09-08T21:01:05Z
2013-08-12T12:24:47Z
CONTRIBUTOR
resolved
At present, if you attempt to attach a hook that isn't for the event 'response' you'll get a KeyError during initialization of PreparedRequest. I intend to use the hook mechanism to add logic of my own and therefore create my own events. I believe this would be useful functionality for anyone extending the requests framework.
{ "avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4", "events_url": "https://api.github.com/users/Lukasa/events{/privacy}", "followers_url": "https://api.github.com/users/Lukasa/followers", "following_url": "https://api.github.com/users/Lukasa/following{/other_user}", "gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Lukasa", "id": 1382556, "login": "Lukasa", "node_id": "MDQ6VXNlcjEzODI1NTY=", "organizations_url": "https://api.github.com/users/Lukasa/orgs", "received_events_url": "https://api.github.com/users/Lukasa/received_events", "repos_url": "https://api.github.com/users/Lukasa/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Lukasa/starred{/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/1524/reactions" }
https://api.github.com/repos/psf/requests/issues/1524/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/1524.diff", "html_url": "https://github.com/psf/requests/pull/1524", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/1524.patch", "url": "https://api.github.com/repos/psf/requests/pulls/1524" }
true
[ "We only support the 'response' event so we do not need to handle this. If you'd like to extend the current system of hooks you'll probably have to subclass quite a number of objects to make them dispatch your hooks when you intend. We have no way of knowing when you want us to dispatch your hook if we're not explicitly supporting it.\n\ntl;dr I'm -1 on this.\n", "Mm, I'm broadly with @sigmavirus24. Seeing as you'll need to monkeypatch _anyway_ to get any of your hooks to be called, it's not a huge chore to monkeypatch this method to do the right thing. If we were going to take this, we'd have to decide to take a whole 'custom hooks' package, and that just seems like massive unnecessary complexity.\n\nThanks for the pull request though, and please do keep contributing!\n", "But I don't monkey patch, I extend the session object to add events.\n\nWhat's the point in adding a hooks system if it breaks when you try to use it. I'm simply requesting a fix of the code that already exists.\n", "I think this comes from a misunderstanding of the role of the hooks. They were never intended as extensible functionality. If you look at [the hooks file before we went to 1.0](https://github.com/kennethreitz/requests/blob/v0.14.2/requests/hooks.py), you'll notice that we explicitly enumerated the hooks and limited which hooks you could actually have. During the move to 1.0, we removed all the hooks but `response`. This was for two reasons. Firstly, we had excellent anecdotal evidence that they were essentially unused. Secondly, they were replaced with the vastly superior `Request` + `PreparedRequest` combination. This provided nearly unlimited access to the data through the whole sending process.\n\nIf you're extending the session object, you can simply extend the hooks mixin and load your new one instead of the old one. Exactly the same modification style, but requires no additional complexity upstream. =)\n", "> Firstly, we had excellent anecdotal evidence that they were essentially unused.\n\nWhat was it?\n", "@piotr-dobrogost No-one ever talked about them. Not in blog posts, not to Kenneth, not in GitHub issues, no handlers used them. We also got, as far as I recall, no complaints when we removed them. =)\n", "> as far as I recall, no complaints when we removed them. =)\n\nWe received less than a handful but more than 0.\n" ]
https://api.github.com/repos/psf/requests/issues/1523
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1523/labels{/name}
https://api.github.com/repos/psf/requests/issues/1523/comments
https://api.github.com/repos/psf/requests/issues/1523/events
https://github.com/psf/requests/issues/1523
17,933,636
MDU6SXNzdWUxNzkzMzYzNg==
1,523
Add content_type property to response
{ "avatar_url": "https://avatars.githubusercontent.com/u/128982?v=4", "events_url": "https://api.github.com/users/homm/events{/privacy}", "followers_url": "https://api.github.com/users/homm/followers", "following_url": "https://api.github.com/users/homm/following{/other_user}", "gists_url": "https://api.github.com/users/homm/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/homm", "id": 128982, "login": "homm", "node_id": "MDQ6VXNlcjEyODk4Mg==", "organizations_url": "https://api.github.com/users/homm/orgs", "received_events_url": "https://api.github.com/users/homm/received_events", "repos_url": "https://api.github.com/users/homm/repos", "site_admin": false, "starred_url": "https://api.github.com/users/homm/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/homm/subscriptions", "type": "User", "url": "https://api.github.com/users/homm", "user_view_type": "public" }
[]
closed
true
null
[]
null
4
2013-08-12T10:33:58Z
2021-09-09T02:11:41Z
2013-08-12T12:22:45Z
CONTRIBUTOR
resolved
Header `response.headers['Content-Type']` can include charset and other stuff. Consider to add `response.content_type` property with content type only. Rationale. With this property such check will be allowed: `response.content_type.enswith(('/json', '+json'))`
{ "avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4", "events_url": "https://api.github.com/users/Lukasa/events{/privacy}", "followers_url": "https://api.github.com/users/Lukasa/followers", "following_url": "https://api.github.com/users/Lukasa/following{/other_user}", "gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Lukasa", "id": 1382556, "login": "Lukasa", "node_id": "MDQ6VXNlcjEzODI1NTY=", "organizations_url": "https://api.github.com/users/Lukasa/orgs", "received_events_url": "https://api.github.com/users/Lukasa/received_events", "repos_url": "https://api.github.com/users/Lukasa/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Lukasa/starred{/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/1523/reactions" }
https://api.github.com/repos/psf/requests/issues/1523/timeline
null
completed
null
null
false
[ "Thanks for raising this issue!\n\nWhat's wrong with:\n\n``` python\n'json' in response.headers['Content-Type']\n```\n", "```\nWhat's wrong with:\n```\n\nThis is not durable. This allows `json` in any place within `Content-Type` header. Any way, this is just example. `content_type` without stuff could be useful in many cases.\n\n``` python\nresponse.content_type in ('text/html', 'text/xml', 'application/xml')\n```\n", "So it's worth noting that the default response of this project to any request to change the API is No. An API change request starts with -100 points and needs to justify itself to that level before inclusion.\n\nSadly, I don't think this is sufficiently useful to justify inclusion. It would get a decent amount of use, but it's not hard to do yourself and not super common (like JSON decoding). I just don't think the API would benefit particularly from its inclusion.\n\nI'll wait until @sigmavirus24 and/or @kennethreitz comments on this, but I'm -1. Sorry. =(\n\nNB: The transformation for anyone that needs it is\n\n``` python\nct = response.headers.get('Content-Type', '').split(';')[0]\n```\n\nAny RFC-2616 compliant Content-Type header should come through that just fine, including no header or an empty header.\n", "I'm with @Lukasa. This is convenient but non-obvious frankly. Most people will expect this to return the entire header not just one portion of what was returned. Even if this had a chance of making it I would want to rename it but there unfortunately isn't a better name.\n" ]
https://api.github.com/repos/psf/requests/issues/1522
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1522/labels{/name}
https://api.github.com/repos/psf/requests/issues/1522/comments
https://api.github.com/repos/psf/requests/issues/1522/events
https://github.com/psf/requests/issues/1522
17,874,823
MDU6SXNzdWUxNzg3NDgyMw==
1,522
non existant https site hangs
{ "avatar_url": "https://avatars.githubusercontent.com/u/5148144?v=4", "events_url": "https://api.github.com/users/compgeom/events{/privacy}", "followers_url": "https://api.github.com/users/compgeom/followers", "following_url": "https://api.github.com/users/compgeom/following{/other_user}", "gists_url": "https://api.github.com/users/compgeom/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/compgeom", "id": 5148144, "login": "compgeom", "node_id": "MDEyOk9yZ2FuaXphdGlvbjUxNDgxNDQ=", "organizations_url": "https://api.github.com/users/compgeom/orgs", "received_events_url": "https://api.github.com/users/compgeom/received_events", "repos_url": "https://api.github.com/users/compgeom/repos", "site_admin": false, "starred_url": "https://api.github.com/users/compgeom/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/compgeom/subscriptions", "type": "Organization", "url": "https://api.github.com/users/compgeom", "user_view_type": "public" }
[]
closed
true
null
[]
null
8
2013-08-09T17:19:00Z
2021-09-09T01:22:30Z
2013-08-31T06:01:32Z
NONE
resolved
The following hangs: requests.get("https://nonexistant-1111111111.blib.us") When one uses this url on chrome/firefox, they right away say its non existant or connection was reset. This is a https sni server. Does this belong to a unit test? Another related problem: requests.get("https://register.blib.us", verify=False, timeout=3.0) -> SSLError but both the following commands work fine (and get done within 5 seconds): requests.get("https://register.blib.us", verify=False) requests.get("https://register.blib.us") Any ideas if we are doing something wrong here?
{ "avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4", "events_url": "https://api.github.com/users/Lukasa/events{/privacy}", "followers_url": "https://api.github.com/users/Lukasa/followers", "following_url": "https://api.github.com/users/Lukasa/following{/other_user}", "gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Lukasa", "id": 1382556, "login": "Lukasa", "node_id": "MDQ6VXNlcjEzODI1NTY=", "organizations_url": "https://api.github.com/users/Lukasa/orgs", "received_events_url": "https://api.github.com/users/Lukasa/received_events", "repos_url": "https://api.github.com/users/Lukasa/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Lukasa/starred{/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/1522/reactions" }
https://api.github.com/repos/psf/requests/issues/1522/timeline
null
completed
null
null
false
[ "Hi there, thanks for raising this issue!\n\nFirstly, I can't reproduce any of these problems. Can I quickly check what version of Requests you're running?\n\n``` python\nimport requests\nprint requests.__version__\n```\n", "I can reproduce the timeout error. But only when using python2 and the pyopenssl codepath (requiring ndg-httpsclient and pyasn1)\n", "I just tried to reproduce the problem. Here is what I got:\n\nC:\\Python27>python\nPython 2.7.3 (default, Apr 10 2012, 23:31:26) [MSC v.1500 32 bit (Intel)] on win\n32\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\n\n> > > import requests\n> > > requests.**version**\n> > > '1.2.3'\n> > > requests.get(\"https://nonexistant-1111111111.blib.us\")\n\n... hangs ... Ctrl+C is disabled.\n\nThe other calls behave differently on my machine:\n\nc:\\Python27>python\nPython 2.7.3 (default, Apr 10 2012, 23:31:26) [MSC v.1500 32 bit (Intel)] on win\n32\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\n\n> > > import requests\n> > > requests.get(\"https://register.blib.us\", verify=False, timeout=3.0)\n> > > <Response [200]>\n> > > requests.get(\"https://register.blib.us\", verify=False)\n> > > <Response [200]>\n> > > requests.get(\"https://register.blib.us\")\n> > > <Response [200]>\n\nThe above calls all returned status 200. \n", "@pikumar can you reproduce the issue with the hanging request?\nI tried to reproduce this but I can't.\n\nMaybe some sort of personal firewall on your workstation interferes?\nI have seen a firewall that ninja-encrypted all outgoing traffic to port 993...\n", "@t-8ch Here are three machines I tried it on: (2 Windows7 boxes and 1 Ubuntu)\n\n# \n\nc:\\Python27\\Scripts>..\\python.exe\nPython 2.7.3 (default, Apr 10 2012, 23:31:26) [MSC v.1500 32 bit (Intel)] on win\n32\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\n\n> > > import requests\n> > > requests.get(\"https://nonexistant-1111111111.blib.us\")\n> > > <Hangs>\n\nCtrl+C does not work anymore.\n\n# \n\nMachine 2 (Windows 7 again):\n\nc:\\Python27>python\nPython 2.7.3 (default, Apr 10 2012, 23:31:26) [MSC v.1500 32 bit (Intel)] on win32\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\n\n> > > import requests\n> > > requests.get(\"https://nonexistant-1111111111.blib.us\")\n> > > Traceback (most recent call last):\n> > > File \"<stdin>\", line 1, in <module>\n> > > File \"c:\\Python27\\lib\\site-packages\\requests\\api.py\", line 55, in get\n> > > return request('get', url, *_kwargs)\n> > > File \"c:\\Python27\\lib\\site-packages\\requests\\api.py\", line 44, in request\n> > > return session.request(method=method, url=url, *_kwargs)\n> > > File \"c:\\Python27\\lib\\site-packages\\requests\\sessions.py\", line 354, in request\n> > > resp = self.send(prep, *_send_kwargs)\n> > > File \"c:\\Python27\\lib\\site-packages\\requests\\sessions.py\", line 460, in send\n> > > r = adapter.send(request, *_kwargs)\n> > > File \"c:\\Python27\\lib\\site-packages\\requests\\adapters.py\", line 246, in send\n> > > raise ConnectionError(e)\n> > > requests.exceptions.ConnectionError: HTTPSConnectionPool(host='nonexistant-1111111111.blib.us', port=443): Max retries exceeded with url: / (Caused by <class 'socket.error'>: [Errno 10054] An existing connection was forcibly closed by the remote host)\n\n# \n\nMachine 3 (ubuntu box):\n\n> > > requests.get(\"https://nonexistant-1111111111.blib.us\")\n> > > Traceback (most recent call last):\n> > > File \"<stdin>\", line 1, in <module>\n> > > File \"/usr/local/lib/python2.7/dist-packages/requests/api.py\", line 55, in get\n> > > return request('get', url, *_kwargs)\n> > > File \"/usr/local/lib/python2.7/dist-packages/requests/api.py\", line 44, in request\n> > > return session.request(method=method, url=url, *_kwargs)\n> > > File \"/usr/local/lib/python2.7/dist-packages/requests/sessions.py\", line 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 246, in send\n> > > raise ConnectionError(e)\n> > > requests.exceptions.ConnectionError: HTTPSConnectionPool(host='nonexistant-1111111111.blib.us', port\n> > > =443): Max retries exceeded with url: / (Caused by <class 'socket.error'>: [Errno 104] Connection re\n> > > set by peer)\n\n========================================== Back to Machine 1\n\nOn Machine 1 where things hang, if I change the timeout:\n\n> > > requests.get(\"https://nonexistant-1111111111.blib.us\", timeout=5.0)\n> > > Traceback (most recent call last):\n> > > File \"<stdin>\", line 1, in <module>\n> > > File \"c:\\Python27\\lib\\site-packages\\requests-1.2.3-py2.7.egg\\requests\\api.py\",\n> > > line 55, in get\n> > > return request('get', url, *_kwargs)\n> > > File \"c:\\Python27\\lib\\site-packages\\requests-1.2.3-py2.7.egg\\requests\\api.py\",\n> > > line 44, in request\n> > > return session.request(method=method, url=url, *_kwargs)\n> > > File \"c:\\Python27\\lib\\site-packages\\requests-1.2.3-py2.7.egg\\requests\\sessions\n> > > .py\", line 335, in request\n> > > resp = self.send(prep, *_send_kwargs)\n> > > File \"c:\\Python27\\lib\\site-packages\\requests-1.2.3-py2.7.egg\\requests\\sessions\n> > > .py\", line 438, in send\n> > > r = adapter.send(request, *_kwargs)\n> > > File \"c:\\Python27\\lib\\site-packages\\requests-1.2.3-py2.7.egg\\requests\\adapters\n> > > .py\", line 331, in send\n> > > raise SSLError(e)\n> > > requests.exceptions.SSLError: _ssl.c:489: The handshake operation timed out\n\nI am guessing that when one does not provide a timeout, this is the place where the code hangs? (And ctrl+c is disabled ? )\n", "Machine 2 and 3 behave correctly. `blib.us` resets the connection instead of sending a default certificate if SNI requests a nonexistent subdomain.\nThe fact the machine doesn't react to abort signal indicates, that it is stuck in a system call.\n\nWhats the difference between machines 1 and 2?\nI suspect some sort of firewall dropping TCP RST packets.\n", "Machine 1 is a virtual machine installed inside Machine 2. (Win 7 guest/host). Vbox guest is a usual NAT configuration. I just checked on Machine 1. Firefox and IE hang as well! So I guess it is not requests that has the problem. I guess time to close the issue? \n", "Mm, this looks like it isn't a Requests issue. I do hope you work out what's going on, though, @pikumar!\n\nThanks again @t-8ch!\n" ]
https://api.github.com/repos/psf/requests/issues/1521
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1521/labels{/name}
https://api.github.com/repos/psf/requests/issues/1521/comments
https://api.github.com/repos/psf/requests/issues/1521/events
https://github.com/psf/requests/issues/1521
17,873,008
MDU6SXNzdWUxNzg3MzAwOA==
1,521
Requires python to be run as root (sudo) on Ubuntu LTS
{ "avatar_url": "https://avatars.githubusercontent.com/u/514360?v=4", "events_url": "https://api.github.com/users/GeneThomas/events{/privacy}", "followers_url": "https://api.github.com/users/GeneThomas/followers", "following_url": "https://api.github.com/users/GeneThomas/following{/other_user}", "gists_url": "https://api.github.com/users/GeneThomas/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/GeneThomas", "id": 514360, "login": "GeneThomas", "node_id": "MDQ6VXNlcjUxNDM2MA==", "organizations_url": "https://api.github.com/users/GeneThomas/orgs", "received_events_url": "https://api.github.com/users/GeneThomas/received_events", "repos_url": "https://api.github.com/users/GeneThomas/repos", "site_admin": false, "starred_url": "https://api.github.com/users/GeneThomas/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/GeneThomas/subscriptions", "type": "User", "url": "https://api.github.com/users/GeneThomas", "user_view_type": "public" }
[]
closed
true
null
[]
null
7
2013-08-09T16:38:18Z
2021-09-09T02:11:42Z
2013-08-09T18:08:02Z
NONE
resolved
``` $git clone git://github.com/kennethreitz/requests.git $cd requests/ $python >>> import requests URL [method [body | -f filename]] Does a TCP connect and HTTP transfer, defaults to GET $ ``` falls over back to the command line, but ``` $sudo python >>> import requests >>>print requests.get('https://github.com/timeline.json').text ``` works ok I'm running Python ``` Python 2.7.3 (default, Apr 10 2013, 06:20:15) [GCC 4.6.3] on linux2 ``` On ``` Ubuntu LTS 12.04.2 LTS ``` Which is ``` Linux 3.5.0-37-generic, x86_64 ``` Any assistance will be greatly appreciated.
{ "avatar_url": "https://avatars.githubusercontent.com/u/514360?v=4", "events_url": "https://api.github.com/users/GeneThomas/events{/privacy}", "followers_url": "https://api.github.com/users/GeneThomas/followers", "following_url": "https://api.github.com/users/GeneThomas/following{/other_user}", "gists_url": "https://api.github.com/users/GeneThomas/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/GeneThomas", "id": 514360, "login": "GeneThomas", "node_id": "MDQ6VXNlcjUxNDM2MA==", "organizations_url": "https://api.github.com/users/GeneThomas/orgs", "received_events_url": "https://api.github.com/users/GeneThomas/received_events", "repos_url": "https://api.github.com/users/GeneThomas/repos", "site_admin": false, "starred_url": "https://api.github.com/users/GeneThomas/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/GeneThomas/subscriptions", "type": "User", "url": "https://api.github.com/users/GeneThomas", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/1521/reactions" }
https://api.github.com/repos/psf/requests/issues/1521/timeline
null
completed
null
null
false
[ "Works as expected on a Red Hat. (Linux 2.6.32-20130307.60.9.bh6.x86_64)\n", "Breaks on\n\n```\nUbuntu 12.04.1 LTS\n```\n\nWhich runs\n\n```\nLinux laptop 3.2.0-48-generic-pae, i386\n```\n", "Does it break on different machines running 12.04.1? Does it brake for other users on the same machine?\n", "Breaks on both the 12.04.1 and 12.04.2 machines that I have.\nIt works for other users.\n", "The message you are seeing is totally stumping me.\nCould you search your filesystem, for `Does a TCP connect and HTTP transfer` this is not from requests, but probably python tries to import something it shouldn't.\n", "And can you play with the `-E`, `-s` and `-S` command line switches to the python interpreter.\nCould you also post the output of running the code while suppling `-v` to the python interpreter?\n", "I only searched /usr/lib/python2.7. It is loading a custom http.py script on the $PYTHONPATH rather than the intended internal one. Thanks.\n" ]
https://api.github.com/repos/psf/requests/issues/1520
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1520/labels{/name}
https://api.github.com/repos/psf/requests/issues/1520/comments
https://api.github.com/repos/psf/requests/issues/1520/events
https://github.com/psf/requests/issues/1520
17,781,716
MDU6SXNzdWUxNzc4MTcxNg==
1,520
Requests get fails when env proxy does not have prefix
{ "avatar_url": "https://avatars.githubusercontent.com/u/2301254?v=4", "events_url": "https://api.github.com/users/juliusgawlas/events{/privacy}", "followers_url": "https://api.github.com/users/juliusgawlas/followers", "following_url": "https://api.github.com/users/juliusgawlas/following{/other_user}", "gists_url": "https://api.github.com/users/juliusgawlas/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/juliusgawlas", "id": 2301254, "login": "juliusgawlas", "node_id": "MDQ6VXNlcjIzMDEyNTQ=", "organizations_url": "https://api.github.com/users/juliusgawlas/orgs", "received_events_url": "https://api.github.com/users/juliusgawlas/received_events", "repos_url": "https://api.github.com/users/juliusgawlas/repos", "site_admin": false, "starred_url": "https://api.github.com/users/juliusgawlas/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/juliusgawlas/subscriptions", "type": "User", "url": "https://api.github.com/users/juliusgawlas", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2013-08-08T00:13:32Z
2021-09-09T02:11:43Z
2013-08-08T05:45:35Z
NONE
resolved
I am running requests release 1.2.3 and had problem that I tracked down to the following: $ export http_proxy=some-proxy.this.that $ python > import requests > requests.get('http://github.com') gets: Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/lib/python2.6/site-packages/requests-1.2.3-py2.6.egg/requests/api.py", line 55, in get return request('get', url, *_kwargs) File "/usr/lib/python2.6/site-packages/requests-1.2.3-py2.6.egg/requests/api.py", line 44, in request return session.request(method=method, url=url, *_kwargs) File "/usr/lib/python2.6/site-packages/requests-1.2.3-py2.6.egg/requests/sessions.py", line 335, in request resp = self.send(prep, *_send_kwargs) File "/usr/lib/python2.6/site-packages/requests-1.2.3-py2.6.egg/requests/sessions.py", line 438, in send r = adapter.send(request, *_kwargs) File "/usr/lib/python2.6/site-packages/requests-1.2.3-py2.6.egg/requests/adapters.py", line 272, in send conn = self.get_connection(request.url, proxies) File "/usr/lib/python2.6/site-packages/requests-1.2.3-py2.6.egg/requests/adapters.py", line 197, in get_connection conn = ProxyManager(self.poolmanager.connection_from_url(proxy)) File "/usr/lib/python2.6/site-packages/requests-1.2.3-py2.6.egg/requests/packages/urllib3/poolmanager.py", line 123, in connection_from_url return self.connection_from_host(u.host, port=u.port, scheme=u.scheme) File "/usr/lib/python2.6/site-packages/requests-1.2.3-py2.6.egg/requests/packages/urllib3/poolmanager.py", line 109, in connection_from_host pool = self._new_pool(scheme, host, port) File "/usr/lib/python2.6/site-packages/requests-1.2.3-py2.6.egg/requests/packages/urllib3/poolmanager.py", line 72, in _new_pool pool_cls = pool_classes_by_scheme[scheme] KeyError: 'some-proxy.this.that' This seems to be related to Issue #997 If $ export http_proxy=http://some-proxy.this.that all works fine. Sorry if I missing anything obvious. Julius (requests is awesome!)
{ "avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4", "events_url": "https://api.github.com/users/Lukasa/events{/privacy}", "followers_url": "https://api.github.com/users/Lukasa/followers", "following_url": "https://api.github.com/users/Lukasa/following{/other_user}", "gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Lukasa", "id": 1382556, "login": "Lukasa", "node_id": "MDQ6VXNlcjEzODI1NTY=", "organizations_url": "https://api.github.com/users/Lukasa/orgs", "received_events_url": "https://api.github.com/users/Lukasa/received_events", "repos_url": "https://api.github.com/users/Lukasa/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Lukasa/starred{/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/1520/reactions" }
https://api.github.com/repos/psf/requests/issues/1520/timeline
null
completed
null
null
false
[ "Thanks for raising this! This should be fixed in the next major release of Requests by #1497. =D\n", "Thanks!\n" ]
https://api.github.com/repos/psf/requests/issues/1519
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1519/labels{/name}
https://api.github.com/repos/psf/requests/issues/1519/comments
https://api.github.com/repos/psf/requests/issues/1519/events
https://github.com/psf/requests/issues/1519
17,699,319
MDU6SXNzdWUxNzY5OTMxOQ==
1,519
requests does always use .netrc credentials ignoring the ones specified at login
{ "avatar_url": "https://avatars.githubusercontent.com/u/102495?v=4", "events_url": "https://api.github.com/users/ssbarnea/events{/privacy}", "followers_url": "https://api.github.com/users/ssbarnea/followers", "following_url": "https://api.github.com/users/ssbarnea/following{/other_user}", "gists_url": "https://api.github.com/users/ssbarnea/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/ssbarnea", "id": 102495, "login": "ssbarnea", "node_id": "MDQ6VXNlcjEwMjQ5NQ==", "organizations_url": "https://api.github.com/users/ssbarnea/orgs", "received_events_url": "https://api.github.com/users/ssbarnea/received_events", "repos_url": "https://api.github.com/users/ssbarnea/repos", "site_admin": false, "starred_url": "https://api.github.com/users/ssbarnea/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/ssbarnea/subscriptions", "type": "User", "url": "https://api.github.com/users/ssbarnea", "user_view_type": "public" }
[]
closed
true
null
[]
null
3
2013-08-06T16:11:15Z
2021-09-09T02:11:44Z
2013-08-06T16:49:58Z
CONTRIBUTOR
resolved
It took me two full days of work to discover that python-requests was using the credentials from the `~/.netrc` file and ignoring the ones that I was specifing. I think that the correct behaviour should be to use the specified ones and ignore the netrc ones. Even the documentations seems to agree with me. Still, this is not what I discovered.
{ "avatar_url": "https://avatars.githubusercontent.com/u/102495?v=4", "events_url": "https://api.github.com/users/ssbarnea/events{/privacy}", "followers_url": "https://api.github.com/users/ssbarnea/followers", "following_url": "https://api.github.com/users/ssbarnea/following{/other_user}", "gists_url": "https://api.github.com/users/ssbarnea/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/ssbarnea", "id": 102495, "login": "ssbarnea", "node_id": "MDQ6VXNlcjEwMjQ5NQ==", "organizations_url": "https://api.github.com/users/ssbarnea/orgs", "received_events_url": "https://api.github.com/users/ssbarnea/received_events", "repos_url": "https://api.github.com/users/ssbarnea/repos", "site_admin": false, "starred_url": "https://api.github.com/users/ssbarnea/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/ssbarnea/subscriptions", "type": "User", "url": "https://api.github.com/users/ssbarnea", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/1519/reactions" }
https://api.github.com/repos/psf/requests/issues/1519/timeline
null
completed
null
null
false
[ "Should be fixed in 2.0.\nSee #1438/#1439\n", "Thanks! Any idea when we will see this release it c\n", "Totally up to Kenneth, I'm afraid. It'll be shipped when he's happy with what we've got. =)\n" ]
https://api.github.com/repos/psf/requests/issues/1518
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1518/labels{/name}
https://api.github.com/repos/psf/requests/issues/1518/comments
https://api.github.com/repos/psf/requests/issues/1518/events
https://github.com/psf/requests/issues/1518
17,618,908
MDU6SXNzdWUxNzYxODkwOA==
1,518
Why doesn't the Response constructor accept arguments?
{ "avatar_url": "https://avatars.githubusercontent.com/u/234019?v=4", "events_url": "https://api.github.com/users/kevinburke/events{/privacy}", "followers_url": "https://api.github.com/users/kevinburke/followers", "following_url": "https://api.github.com/users/kevinburke/following{/other_user}", "gists_url": "https://api.github.com/users/kevinburke/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kevinburke", "id": 234019, "login": "kevinburke", "node_id": "MDQ6VXNlcjIzNDAxOQ==", "organizations_url": "https://api.github.com/users/kevinburke/orgs", "received_events_url": "https://api.github.com/users/kevinburke/received_events", "repos_url": "https://api.github.com/users/kevinburke/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kevinburke/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kevinburke/subscriptions", "type": "User", "url": "https://api.github.com/users/kevinburke", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2013-08-05T04:40:51Z
2021-09-09T02:11:41Z
2013-08-12T14:35:28Z
CONTRIBUTOR
resolved
Reading through the code in `adapters.py`, I notice that a Response is created, and then has values assigned to it, like this: ``` response = Response() # Fallback to None if there's no status_code, for whatever reason. response.status_code = getattr(resp, 'status', None) # Make headers case-insensitive. response.headers = CaseInsensitiveDict(getattr(resp, 'headers', {})) # Set encoding. response.encoding = get_encoding_from_headers(response.headers) response.raw = resp response.reason = response.raw.reason ``` Is there a reason that these values are not passed directly into the Response constructor? I ask because I'd like to use the Response class for passing around HTTP response data internally (for things that aren't necessarily immediately following a `requests.request`, and the constructor feels like a logical place to do variable assignment.
{ "avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4", "events_url": "https://api.github.com/users/Lukasa/events{/privacy}", "followers_url": "https://api.github.com/users/Lukasa/followers", "following_url": "https://api.github.com/users/Lukasa/following{/other_user}", "gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Lukasa", "id": 1382556, "login": "Lukasa", "node_id": "MDQ6VXNlcjEzODI1NTY=", "organizations_url": "https://api.github.com/users/Lukasa/orgs", "received_events_url": "https://api.github.com/users/Lukasa/received_events", "repos_url": "https://api.github.com/users/Lukasa/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Lukasa/starred{/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/1518/reactions" }
https://api.github.com/repos/psf/requests/issues/1518/timeline
null
completed
null
null
false
[ "In addition it looks like `requests` only initializes a Response object in one place and a refactoring could be fairly simple\n", "There's no reason beyond style. We prefer it that way. =) You'll notice that the `Session` object has exactly the same interface.\n" ]
https://api.github.com/repos/psf/requests/issues/1517
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1517/labels{/name}
https://api.github.com/repos/psf/requests/issues/1517/comments
https://api.github.com/repos/psf/requests/issues/1517/events
https://github.com/psf/requests/issues/1517
17,614,489
MDU6SXNzdWUxNzYxNDQ4OQ==
1,517
python-requests authenticated proxy httplib.BadStatusLine
{ "avatar_url": "https://avatars.githubusercontent.com/u/954865?v=4", "events_url": "https://api.github.com/users/paragbaxi/events{/privacy}", "followers_url": "https://api.github.com/users/paragbaxi/followers", "following_url": "https://api.github.com/users/paragbaxi/following{/other_user}", "gists_url": "https://api.github.com/users/paragbaxi/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/paragbaxi", "id": 954865, "login": "paragbaxi", "node_id": "MDQ6VXNlcjk1NDg2NQ==", "organizations_url": "https://api.github.com/users/paragbaxi/orgs", "received_events_url": "https://api.github.com/users/paragbaxi/received_events", "repos_url": "https://api.github.com/users/paragbaxi/repos", "site_admin": false, "starred_url": "https://api.github.com/users/paragbaxi/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/paragbaxi/subscriptions", "type": "User", "url": "https://api.github.com/users/paragbaxi", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2013-08-04T23:20:33Z
2021-09-09T02:11:41Z
2013-08-12T14:35:15Z
NONE
resolved
From http://stackoverflow.com/questions/18020279/python-requests-authenticated-proxy-httplib-badstatusline Authenticated proxy through python-requests returns the following error: ``` >>> import requests >>> proxies = {'https': 'http://username:[email protected]:8080',} >>> requests.get('https://api.github.com/',proxies=proxies,verify=False) Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/lib/python2.6/site-packages/requests/api.py", line 55, in get return request('get', url, **kwargs) File "/usr/lib/python2.6/site-packages/requests/api.py", line 44, in request return session.request(method=method, url=url, **kwargs) File "/usr/lib/python2.6/site-packages/requests/sessions.py", line 335, in request resp = self.send(prep, **send_kwargs) File "/usr/lib/python2.6/site-packages/requests/sessions.py", line 438, in send r = adapter.send(request, **kwargs) File "/usr/lib/python2.6/site-packages/requests/adapters.py", line 327, in send raise ConnectionError(e) requests.exceptions.ConnectionError: HTTPConnectionPool(host='proxy.company.com', port=8080): Max retries exceeded with url: https://api.github.com/ (Caused by <class 'httplib.BadStatusLine'>: ) ``` Authenticated proxy works fine in curl: ``` $ curl --proxy-user username:password --proxy http://proxy.company.com:8080 -k https://api.github.com/ { "current_user_url": "https://api.github.com/user", "authorizations_url": "https://api.github.com/authorizations", "emails_url": "https://api.github.com/user/emails", "emojis_url": "https://api.github.com/emojis", "events_url": "https://api.github.com/events", "feeds_url": "https://api.github.com/feeds", "following_url": "https://api.github.com/user/following{/target}", "gists_url": "https://api.github.com/gists{/gist_id}", "hub_url": "https://api.github.com/hub", "issue_search_url": "https://api.github.com/legacy/issues/search/{owner}/{repo}/{state}/{keyword}", "issues_url": "https://api.github.com/issues", "keys_url": "https://api.github.com/user/keys", "notifications_url": "https://api.github.com/notifications", "organization_repositories_url": "https://api.github.com/orgs/{org}/repos/{?type,page,per_page,sort}", "organization_url": "https://api.github.com/orgs/{org}", "public_gists_url": "https://api.github.com/gists/public", "rate_limit_url": "https://api.github.com/rate_limit", "repository_url": "https://api.github.com/repos/{owner}/{repo}", "repository_search_url": "https://api.github.com/legacy/repos/search/{keyword}{?language,start_page}", "current_user_repositories_url": "https://api.github.com/user/repos{?type,page,per_page,sort}", "starred_url": "https://api.github.com/user/starred{/owner}{/repo}", "starred_gists_url": "https://api.github.com/gists/starred", "team_url": "https://api.github.com/teams", "user_url": "https://api.github.com/users/{user}", "user_organizations_url": "https://api.github.com/user/orgs", "user_repositories_url": "https://api.github.com/users/{user}/repos{?type,page,per_page,sort}", "user_search_url": "https://api.github.com/legacy/user/search/{keyword}" } ``` How do I troubleshoot?
{ "avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4", "events_url": "https://api.github.com/users/Lukasa/events{/privacy}", "followers_url": "https://api.github.com/users/Lukasa/followers", "following_url": "https://api.github.com/users/Lukasa/following{/other_user}", "gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Lukasa", "id": 1382556, "login": "Lukasa", "node_id": "MDQ6VXNlcjEzODI1NTY=", "organizations_url": "https://api.github.com/users/Lukasa/orgs", "received_events_url": "https://api.github.com/users/Lukasa/received_events", "repos_url": "https://api.github.com/users/Lukasa/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Lukasa/starred{/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/1517/reactions" }
https://api.github.com/repos/psf/requests/issues/1517/timeline
null
completed
null
null
false
[ "Requests has some weird problems with HTTPS proxies in the current release (and all previous ones). Can you try the fork in Pull Request #1515? That PR contains some fixes in urllib3 that should resolve most of our HTTPS and proxies problems.\n" ]
https://api.github.com/repos/psf/requests/issues/1516
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1516/labels{/name}
https://api.github.com/repos/psf/requests/issues/1516/comments
https://api.github.com/repos/psf/requests/issues/1516/events
https://github.com/psf/requests/pull/1516
17,598,261
MDExOlB1bGxSZXF1ZXN0NzM3MDk3Mw==
1,516
UnsupportedOperation errors
{ "avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4", "events_url": "https://api.github.com/users/Lukasa/events{/privacy}", "followers_url": "https://api.github.com/users/Lukasa/followers", "following_url": "https://api.github.com/users/Lukasa/following{/other_user}", "gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Lukasa", "id": 1382556, "login": "Lukasa", "node_id": "MDQ6VXNlcjEzODI1NTY=", "organizations_url": "https://api.github.com/users/Lukasa/orgs", "received_events_url": "https://api.github.com/users/Lukasa/received_events", "repos_url": "https://api.github.com/users/Lukasa/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Lukasa/starred{/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" } ]
closed
true
null
[]
null
0
2013-08-03T18:26:22Z
2021-09-08T23:06:07Z
2013-08-06T15:43:45Z
MEMBER
resolved
This should resolve #1504.
{ "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/1516/reactions" }
https://api.github.com/repos/psf/requests/issues/1516/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/1516.diff", "html_url": "https://github.com/psf/requests/pull/1516", "merged_at": "2013-08-06T15:43:45Z", "patch_url": "https://github.com/psf/requests/pull/1516.patch", "url": "https://api.github.com/repos/psf/requests/pulls/1516" }
true
[]
https://api.github.com/repos/psf/requests/issues/1515
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1515/labels{/name}
https://api.github.com/repos/psf/requests/issues/1515/comments
https://api.github.com/repos/psf/requests/issues/1515/events
https://github.com/psf/requests/pull/1515
17,594,417
MDExOlB1bGxSZXF1ZXN0NzM2OTU5Mw==
1,515
[2.0] Https proxy support
{ "avatar_url": "https://avatars.githubusercontent.com/u/238652?v=4", "events_url": "https://api.github.com/users/schlamar/events{/privacy}", "followers_url": "https://api.github.com/users/schlamar/followers", "following_url": "https://api.github.com/users/schlamar/following{/other_user}", "gists_url": "https://api.github.com/users/schlamar/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/schlamar", "id": 238652, "login": "schlamar", "node_id": "MDQ6VXNlcjIzODY1Mg==", "organizations_url": "https://api.github.com/users/schlamar/orgs", "received_events_url": "https://api.github.com/users/schlamar/received_events", "repos_url": "https://api.github.com/users/schlamar/repos", "site_admin": false, "starred_url": "https://api.github.com/users/schlamar/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/schlamar/subscriptions", "type": "User", "url": "https://api.github.com/users/schlamar", "user_view_type": "public" }
[ { "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
7
2013-08-03T12:02:13Z
2021-09-09T00:01:21Z
2013-08-14T20:41:08Z
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/1515/reactions" }
https://api.github.com/repos/psf/requests/issues/1515/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/1515.diff", "html_url": "https://github.com/psf/requests/pull/1515", "merged_at": "2013-08-14T20:41:08Z", "patch_url": "https://github.com/psf/requests/pull/1515.patch", "url": "https://api.github.com/repos/psf/requests/pulls/1515" }
true
[ "Looks like these test failures are transient, I think this is good. Thanks so much for your work @schlamar, as well as all of the urllib3 people who worked on this! =)\n", "Yeah once HTTPbin is pushed to heroku, these too will pass.\n", "[+1](http://youtu.be/qybUFnY7Y8w).\n", "+1\n", "socks5 proxy support\n", "@yfengz This will probably take some time, see https://github.com/shazow/urllib3/pull/68\n", ":sparkles: :cake: :sparkles:\n" ]
https://api.github.com/repos/psf/requests/issues/1514
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1514/labels{/name}
https://api.github.com/repos/psf/requests/issues/1514/comments
https://api.github.com/repos/psf/requests/issues/1514/events
https://github.com/psf/requests/pull/1514
17,555,849
MDExOlB1bGxSZXF1ZXN0NzM0OTEzNA==
1,514
Better percent-escape exception.
{ "avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4", "events_url": "https://api.github.com/users/Lukasa/events{/privacy}", "followers_url": "https://api.github.com/users/Lukasa/followers", "following_url": "https://api.github.com/users/Lukasa/following{/other_user}", "gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Lukasa", "id": 1382556, "login": "Lukasa", "node_id": "MDQ6VXNlcjEzODI1NTY=", "organizations_url": "https://api.github.com/users/Lukasa/orgs", "received_events_url": "https://api.github.com/users/Lukasa/received_events", "repos_url": "https://api.github.com/users/Lukasa/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions", "type": "User", "url": "https://api.github.com/users/Lukasa", "user_view_type": "public" }
[]
closed
true
null
[]
null
0
2013-08-02T11:31:59Z
2021-09-08T23:07:23Z
2013-08-02T16:48:33Z
MEMBER
resolved
Should resolve #1510. While improving exceptions for 2.0 we may as well get as much as possible done. For your ease, this PR is already against the 2.0 branch, so it should be an easy merge. =)
{ "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/1514/reactions" }
https://api.github.com/repos/psf/requests/issues/1514/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/1514.diff", "html_url": "https://github.com/psf/requests/pull/1514", "merged_at": "2013-08-02T16:48:33Z", "patch_url": "https://github.com/psf/requests/pull/1514.patch", "url": "https://api.github.com/repos/psf/requests/pulls/1514" }
true
[]
https://api.github.com/repos/psf/requests/issues/1513
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1513/labels{/name}
https://api.github.com/repos/psf/requests/issues/1513/comments
https://api.github.com/repos/psf/requests/issues/1513/events
https://github.com/psf/requests/issues/1513
17,542,362
MDU6SXNzdWUxNzU0MjM2Mg==
1,513
Started receiving intermittent ClosedPoolError's now that my AppEngine app is multi-threaded
{ "avatar_url": "https://avatars.githubusercontent.com/u/387613?v=4", "events_url": "https://api.github.com/users/savraj/events{/privacy}", "followers_url": "https://api.github.com/users/savraj/followers", "following_url": "https://api.github.com/users/savraj/following{/other_user}", "gists_url": "https://api.github.com/users/savraj/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/savraj", "id": 387613, "login": "savraj", "node_id": "MDQ6VXNlcjM4NzYxMw==", "organizations_url": "https://api.github.com/users/savraj/orgs", "received_events_url": "https://api.github.com/users/savraj/received_events", "repos_url": "https://api.github.com/users/savraj/repos", "site_admin": false, "starred_url": "https://api.github.com/users/savraj/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/savraj/subscriptions", "type": "User", "url": "https://api.github.com/users/savraj", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2013-08-02T02:54:23Z
2021-09-09T02:11:45Z
2013-08-02T03:21:36Z
NONE
resolved
> > ClosedPoolError: HTTPSConnectionPool(host=OMITTED, port=443): Pool is closed. Given that the requests homepage says requests is thread-safe, how should I handle these errors? Should I catch this exception and simply re-try, or is this a bug with the requests library?
{ "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/1513/reactions" }
https://api.github.com/repos/psf/requests/issues/1513/timeline
null
completed
null
null
false
[ "This could arise from your usage but in general we don't support AppEngine. If you can provide some code samples I might be able to suggest a different strategy but AppEngine could be the cause of your problems. Were I you, I'd investigate Rackspace if possible \n", "Or heroku, of course :)\n" ]
https://api.github.com/repos/psf/requests/issues/1512
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1512/labels{/name}
https://api.github.com/repos/psf/requests/issues/1512/comments
https://api.github.com/repos/psf/requests/issues/1512/events
https://github.com/psf/requests/pull/1512
17,527,412
MDExOlB1bGxSZXF1ZXN0NzMzMzYzNA==
1,512
HTTPS proxy support
{ "avatar_url": "https://avatars.githubusercontent.com/u/238652?v=4", "events_url": "https://api.github.com/users/schlamar/events{/privacy}", "followers_url": "https://api.github.com/users/schlamar/followers", "following_url": "https://api.github.com/users/schlamar/following{/other_user}", "gists_url": "https://api.github.com/users/schlamar/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/schlamar", "id": 238652, "login": "schlamar", "node_id": "MDQ6VXNlcjIzODY1Mg==", "organizations_url": "https://api.github.com/users/schlamar/orgs", "received_events_url": "https://api.github.com/users/schlamar/received_events", "repos_url": "https://api.github.com/users/schlamar/repos", "site_admin": false, "starred_url": "https://api.github.com/users/schlamar/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/schlamar/subscriptions", "type": "User", "url": "https://api.github.com/users/schlamar", "user_view_type": "public" }
[]
closed
true
null
[]
null
7
2013-08-01T19:52:16Z
2021-09-08T23:06:10Z
2013-08-03T12:02:56Z
CONTRIBUTOR
resolved
HTTPS proxy support finally made it into urllib3 (https://github.com/shazow/urllib3/pull/170), this is a patch for requests to support it.
{ "avatar_url": "https://avatars.githubusercontent.com/u/238652?v=4", "events_url": "https://api.github.com/users/schlamar/events{/privacy}", "followers_url": "https://api.github.com/users/schlamar/followers", "following_url": "https://api.github.com/users/schlamar/following{/other_user}", "gists_url": "https://api.github.com/users/schlamar/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/schlamar", "id": 238652, "login": "schlamar", "node_id": "MDQ6VXNlcjIzODY1Mg==", "organizations_url": "https://api.github.com/users/schlamar/orgs", "received_events_url": "https://api.github.com/users/schlamar/received_events", "repos_url": "https://api.github.com/users/schlamar/repos", "site_admin": false, "starred_url": "https://api.github.com/users/schlamar/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/schlamar/subscriptions", "type": "User", "url": "https://api.github.com/users/schlamar", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/1512/reactions" }
https://api.github.com/repos/psf/requests/issues/1512/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/1512.diff", "html_url": "https://github.com/psf/requests/pull/1512", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/1512.patch", "url": "https://api.github.com/repos/psf/requests/pulls/1512" }
true
[ "Finally! I spent 4 hours playing with openssl and different combinations of requests itself and different forked urllib3's... I'm happy it looks everything is working fine now.\n", "This is a great PR. =) One suggestion: it might be better to raise it against the 2.0 branch.\n", "> This is a great PR. =) One suggestion: it might be better to raise it against the 2.0 branch.\n\nx2\n", "Is there an ETA for 2.0 release?\n", "Not too far in the future. AFAIK we're not planning to have another point release before then. =)\n", "> Not too far in the future. AFAIK we're not planning to have another point release before then. =)\n\nSo why is there a separate branch at all? :)\n", "However, here we go: https://github.com/kennethreitz/requests/pull/1515\n" ]
https://api.github.com/repos/psf/requests/issues/1511
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1511/labels{/name}
https://api.github.com/repos/psf/requests/issues/1511/comments
https://api.github.com/repos/psf/requests/issues/1511/events
https://github.com/psf/requests/pull/1511
17,522,523
MDExOlB1bGxSZXF1ZXN0NzMzMDg1MQ==
1,511
Update urllib3 to 14b8945.
{ "avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4", "events_url": "https://api.github.com/users/Lukasa/events{/privacy}", "followers_url": "https://api.github.com/users/Lukasa/followers", "following_url": "https://api.github.com/users/Lukasa/following{/other_user}", "gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Lukasa", "id": 1382556, "login": "Lukasa", "node_id": "MDQ6VXNlcjEzODI1NTY=", "organizations_url": "https://api.github.com/users/Lukasa/orgs", "received_events_url": "https://api.github.com/users/Lukasa/received_events", "repos_url": "https://api.github.com/users/Lukasa/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions", "type": "User", "url": "https://api.github.com/users/Lukasa", "user_view_type": "public" }
[]
closed
true
null
[]
null
0
2013-08-01T18:22:57Z
2021-09-08T23:11:06Z
2013-08-01T19:54:19Z
MEMBER
resolved
Includes the truly awesome proxy support! =D
{ "avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4", "events_url": "https://api.github.com/users/Lukasa/events{/privacy}", "followers_url": "https://api.github.com/users/Lukasa/followers", "following_url": "https://api.github.com/users/Lukasa/following{/other_user}", "gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Lukasa", "id": 1382556, "login": "Lukasa", "node_id": "MDQ6VXNlcjEzODI1NTY=", "organizations_url": "https://api.github.com/users/Lukasa/orgs", "received_events_url": "https://api.github.com/users/Lukasa/received_events", "repos_url": "https://api.github.com/users/Lukasa/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Lukasa/starred{/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/1511/reactions" }
https://api.github.com/repos/psf/requests/issues/1511/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/1511.diff", "html_url": "https://github.com/psf/requests/pull/1511", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/1511.patch", "url": "https://api.github.com/repos/psf/requests/pulls/1511" }
true
[]
https://api.github.com/repos/psf/requests/issues/1510
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1510/labels{/name}
https://api.github.com/repos/psf/requests/issues/1510/comments
https://api.github.com/repos/psf/requests/issues/1510/events
https://github.com/psf/requests/issues/1510
17,495,832
MDU6SXNzdWUxNzQ5NTgzMg==
1,510
valueerror when unquoting bad url
{ "avatar_url": "https://avatars.githubusercontent.com/u/462486?v=4", "events_url": "https://api.github.com/users/errx/events{/privacy}", "followers_url": "https://api.github.com/users/errx/followers", "following_url": "https://api.github.com/users/errx/following{/other_user}", "gists_url": "https://api.github.com/users/errx/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/errx", "id": 462486, "login": "errx", "node_id": "MDQ6VXNlcjQ2MjQ4Ng==", "organizations_url": "https://api.github.com/users/errx/orgs", "received_events_url": "https://api.github.com/users/errx/received_events", "repos_url": "https://api.github.com/users/errx/repos", "site_admin": false, "starred_url": "https://api.github.com/users/errx/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/errx/subscriptions", "type": "User", "url": "https://api.github.com/users/errx", "user_view_type": "public" }
[]
closed
true
null
[]
null
3
2013-08-01T08:28:33Z
2021-09-09T02:11:42Z
2013-08-02T11:32:23Z
NONE
resolved
Maybe it should return another error? ``` >>> requests.get("http://%zz") Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/local/lib/python2.7/dist-packages/requests/api.py", line 55, in get return request('get', url, **kwargs) File "/usr/local/lib/python2.7/dist-packages/requests/api.py", line 44, in request return session.request(method=method, url=url, **kwargs) File "/usr/local/lib/python2.7/dist-packages/requests/sessions.py", line 324, in request prep = req.prepare() File "/usr/local/lib/python2.7/dist-packages/requests/models.py", line 222, in prepare p.prepare_url(self.url, self.params) File "/usr/local/lib/python2.7/dist-packages/requests/models.py", line 333, in prepare_url url = requote_uri(urlunparse([scheme, netloc, path, None, query, fragment])) File "/usr/local/lib/python2.7/dist-packages/requests/utils.py", line 383, in requote_uri return quote(unquote_unreserved(uri), safe="!#$%&'()*+,/:;=?@[]~") File "/usr/local/lib/python2.7/dist-packages/requests/utils.py", line 364, in unquote_unreserved c = chr(int(h, 16)) ValueError: invalid literal for int() with base 16: 'zz' ```
{ "avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4", "events_url": "https://api.github.com/users/Lukasa/events{/privacy}", "followers_url": "https://api.github.com/users/Lukasa/followers", "following_url": "https://api.github.com/users/Lukasa/following{/other_user}", "gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Lukasa", "id": 1382556, "login": "Lukasa", "node_id": "MDQ6VXNlcjEzODI1NTY=", "organizations_url": "https://api.github.com/users/Lukasa/orgs", "received_events_url": "https://api.github.com/users/Lukasa/received_events", "repos_url": "https://api.github.com/users/Lukasa/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Lukasa/starred{/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/1510/reactions" }
https://api.github.com/repos/psf/requests/issues/1510/timeline
null
completed
null
null
false
[ "Thanks for raising this! We should be handling it as part of 2.0: see #1514. =)\n", "Thanks for your pull request Lukasa.\nI am still having a problem. How could I achieve same behavior as the browsers for the redirect below?\nThanks again for your help!\n\nhttp://pixel.everesttech.net/1824/cq?ev_sid=3&ev_ln=assistance%20%C3%A0%20distance&ev_crx=6814336969&ev_mt=b&ev_n=g&ev_ltx=&ev_pl=&url=https%3A//secure.logmeinrescue.com/welcome/default.aspx%3Fdestination%3D/FR/welcome/remotesupport/default.aspx%26wt.srch%3D1%26utpk%3Dassistance%20%C3%A0%20distance%26originid%3D16808\n\nreturns an percent-escape exception when browsers redirects to\n\nhttps://secure.logmeinrescue.com/welcome/remotesupport/?wt.srch=1&utpk=assistance+%u00e0+distance&originid=16808&ef_id=UbIrlwAABS4E32%403%3a20130810145257%3as\n", "Yeah, that's an invalid URL in the second case: %u00e0 is not a valid string in a URI.\n" ]
https://api.github.com/repos/psf/requests/issues/1509
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1509/labels{/name}
https://api.github.com/repos/psf/requests/issues/1509/comments
https://api.github.com/repos/psf/requests/issues/1509/events
https://github.com/psf/requests/pull/1509
17,486,482
MDExOlB1bGxSZXF1ZXN0NzMxMTIxOQ==
1,509
[WIP] [2.0]
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2013-08-01T01:27:28Z
2021-09-08T23:08:15Z
2013-09-24T17:45:21Z
CONTRIBUTOR
resolved
TODO: - [ ] Pull in latest urllib3 before releasing.
{ "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/1509/reactions" }
https://api.github.com/repos/psf/requests/issues/1509/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/1509.diff", "html_url": "https://github.com/psf/requests/pull/1509", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/1509.patch", "url": "https://api.github.com/repos/psf/requests/pulls/1509" }
true
[ "https://github.com/kennethreitz/requests/releases/tag/2.0\n", "Updated this with a TODO list so we don't forget to do anything before releasing 2.0 :)\n" ]
https://api.github.com/repos/psf/requests/issues/1508
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1508/labels{/name}
https://api.github.com/repos/psf/requests/issues/1508/comments
https://api.github.com/repos/psf/requests/issues/1508/events
https://github.com/psf/requests/pull/1508
17,437,957
MDExOlB1bGxSZXF1ZXN0NzI4NDY0Mg==
1,508
remove duplicate comment
{ "avatar_url": "https://avatars.githubusercontent.com/u/220082?v=4", "events_url": "https://api.github.com/users/dieterv/events{/privacy}", "followers_url": "https://api.github.com/users/dieterv/followers", "following_url": "https://api.github.com/users/dieterv/following{/other_user}", "gists_url": "https://api.github.com/users/dieterv/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/dieterv", "id": 220082, "login": "dieterv", "node_id": "MDQ6VXNlcjIyMDA4Mg==", "organizations_url": "https://api.github.com/users/dieterv/orgs", "received_events_url": "https://api.github.com/users/dieterv/received_events", "repos_url": "https://api.github.com/users/dieterv/repos", "site_admin": false, "starred_url": "https://api.github.com/users/dieterv/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/dieterv/subscriptions", "type": "User", "url": "https://api.github.com/users/dieterv", "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" } ]
closed
true
null
[]
null
2
2013-07-31T07:30:35Z
2021-09-08T21:01:05Z
2013-08-01T01:36:08Z
CONTRIBUTOR
resolved
This is already mentioned at line 357...
{ "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/1508/reactions" }
https://api.github.com/repos/psf/requests/issues/1508/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/1508.diff", "html_url": "https://github.com/psf/requests/pull/1508", "merged_at": "2013-08-01T01:36:07Z", "patch_url": "https://github.com/psf/requests/pull/1508.patch", "url": "https://api.github.com/repos/psf/requests/pulls/1508" }
true
[ "This looks great, thanks! :cookie:\n", "Quick rebase?\n" ]
https://api.github.com/repos/psf/requests/issues/1507
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1507/labels{/name}
https://api.github.com/repos/psf/requests/issues/1507/comments
https://api.github.com/repos/psf/requests/issues/1507/events
https://github.com/psf/requests/pull/1507
17,434,402
MDExOlB1bGxSZXF1ZXN0NzI4MjgxNg==
1,507
Allow preparing of Requests from Session settings without sending.
{ "avatar_url": "https://avatars.githubusercontent.com/u/447615?v=4", "events_url": "https://api.github.com/users/rwe/events{/privacy}", "followers_url": "https://api.github.com/users/rwe/followers", "following_url": "https://api.github.com/users/rwe/following{/other_user}", "gists_url": "https://api.github.com/users/rwe/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/rwe", "id": 447615, "login": "rwe", "node_id": "MDQ6VXNlcjQ0NzYxNQ==", "organizations_url": "https://api.github.com/users/rwe/orgs", "received_events_url": "https://api.github.com/users/rwe/received_events", "repos_url": "https://api.github.com/users/rwe/repos", "site_admin": false, "starred_url": "https://api.github.com/users/rwe/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/rwe/subscriptions", "type": "User", "url": "https://api.github.com/users/rwe", "user_view_type": "public" }
[ { "color": "fbca04", "default": false, "description": null, "id": 44501249, "name": "Needs BDFL Input", "node_id": "MDU6TGFiZWw0NDUwMTI0OQ==", "url": "https://api.github.com/repos/psf/requests/labels/Needs%20BDFL%20Input" }, { "color": "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" }, { "color": "e11d21", "default": false, "description": null, "id": 44501305, "name": "Not Ready To Merge", "node_id": "MDU6TGFiZWw0NDUwMTMwNQ==", "url": "https://api.github.com/repos/psf/requests/labels/Not%20Ready%20To%20Merge" } ]
closed
true
null
[]
null
14
2013-07-31T04:51:20Z
2021-09-09T00:01:13Z
2013-08-01T01:21:28Z
CONTRIBUTOR
resolved
Attempt to address #1445. All tests pass. Note that I think it could likely make sense to change `Session.update_request` to be an internal method, since `Session.prepare_request` is really the only public use I can think of having use in practice.
{ "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/1507/reactions" }
https://api.github.com/repos/psf/requests/issues/1507/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/1507.diff", "html_url": "https://github.com/psf/requests/pull/1507", "merged_at": "2013-08-01T01:21:28Z", "patch_url": "https://github.com/psf/requests/pull/1507.patch", "url": "https://api.github.com/repos/psf/requests/pulls/1507" }
true
[ "In general I think this PR is good. =) I've got a few notes though.\n1. Why does `prepare_request` copy the request? I don't think I'd expect an allocation to happen here, myself.\n2. I don't think we need to expose both `update_request` and `prepare_request` on the `Session`. If it were me, my vote would be for exposing `update_request` (and then inlining `prepare_request`).\n3. I'm not sure `update_request` is the best name, though I can't think of a better one off the top if my head. =)\n\nThis is excellent work, thankyou! :cookie:\n", "- In the use-case described in #1445, I would not expect `Session.prepare_request` to alter any of the members of the originating request. The alternative to making a copy has strange and undesirable behaviour:\n\n``` python\nsession1 = Session()\nsession1.auth = AuthA()\n\nsession2 = Session()\nsession2.auth = AuthB()\n\n# r.auth starts off as None\nr = Request('GET', url)\n\n# r.auth will be unexpectedly modified!\nprep1 = session1.prepare_request(r)\n\n# Sent with AuthA, as expected.\nsession1.send(prep1)\n\nprep2 = session2.prepare_request(r)\n# Also sent with AuthA, not session2's AuthB! Unexpected.\nsession2.send(prep2)\n```\n\nNote that `prepare_request()` is a new user method, not called internally; `Session.request()` only uses `update_request()` and doesn't make any new allocations.\n\n**Maybe `create_prepared_request` would be a more clear name?**\n- I agree that it's not great having both `update_request` and `prepare_request` exposed. If I were to choose one, though, it would be `prepare_request` (possibly renamed to `create_prepared_request`). Since `update_request` destructively modifies its argument, which makes bugs like the above easy to introduce, I consider it the less friendly/safe of the two. I split it out that way only to avoid creating a temporary `Request` instance in `Session.request()` that would otherwise be immediately copied. I can't really think of another use-case where a user would need `update_request` where `prepare_request` wouldn't do.\n- I agree…though if it can be made private it matters a little less?\n", "Mm. I agree that you can see many situations in which modifying the Request itself creates unexpected behaviour. Conversely, though, I can definitely see situations in which `prepare_request`'s allocation hurts you: specifically, situations when you have only one `Session`. Then you have to absorb two allocations per request instead of one, which seems like a nasty waste of time for the GC.\n\nMy engineering inclination is to leave the `Request.copy` method in, and say that by default we don't do any extra allocations, and if you want to you have to do it yourself. This turns your code into:\n\n``` python\nsession1 = Session()\nsession1.auth = AuthA()\n\nsession2 = Session()\nsession2.auth = AuthB()\n\n# r.auth starts off as None\nr = Request('GET', url)\n\n# r.auth will now not be modified\nprep1 = session1.prepare_request(r.copy())\n\n# Sent with AuthA, as expected.\nsession1.send(prep1)\n\nprep2 = session2.prepare_request(r.copy())\n\n# Now sent with AuthB\nsession2.send(prep2)\n```\n\nThe problem is, I think that the API isn't as good here. I'm pretty torn. My intuition is that the _general_ use-case does not have the same unprepared `Request` being sent to different `Session`s, so we should optimise for that case. I'm prepared to be wrong here, though. @sigmavirus24, thoughts?\n\n**EDIT**: I should note that while the cost of extra allocations is usually not that high, it's inescapable, while the bug introduced by failing to copy a `Request` can be easily worked around.\n", "Two alternative ideas:\n\nInstead of calling `Request.prepare()`, create the `PreparedRequest` directly in `Session.prepare_request()` and pass in the merged arguments, e.g.\n\n``` python\n# in sessions.py, class Session\ndef prepare_request(self, request)\n p = PreparedRequest()\n\n p.prepare_method(request.method)\n p.prepare_url(request.url, request.params)\n p.prepare_headers(merge_setting(request.headers, self.headers))\n p.prepare_cookies(merge_setting(request.cookies, self.cookies))\n p.prepare_body(request.data, request.files)\n p.prepare_auth(request.auth or self.auth, request.url)\n p.prepare_hooks(request.hooks)\n return p\n```\n\nAnother would be to add those as `**kwargs` into `Request.prepare()` to keep that code centralized:\n\n``` python\n# in sessions.py, class Session\ndef prepare_request(self, request):\n return request.prepare(\n auth=self.auth,\n cookies=self.cookies,\n # etc.\n )\n```\n", "Both of these solutions seem like unnecessary hoops to leap through. Preparing a request is conceptually non-destructive, so it's not the problem here. The problem is _only_ whether we think it's OK to mutate a `Request` passed to a `Session`. If it isn't, then doing a copy is mandatory, even if we don't like the allocation. If it is, then we can avoid the allocation by requiring users to copy their `Request`.\n", "I'm not sure I clarified my thought process there properly.\n\nThe point of the above is that it supports the same behaviour as copying the `Request` but without the extra allocation. The only reason to copy the `Request` is to modify it safely, but the only reason it needs to be modified is to change what happens when you call `prepare` on it. Essentially the Request object is acting as implicit arguments a generic \"create a `PreparedRequest` bundle\" function.\n\nWhat do you think of just moving the preparation into the `PreparedRequest` constructor?\n\n``` python\n# class PreparedRequest, models.py\ndef __init__(self, method, url, headers, files,\n data, params, auth, cookies, hooks):\n self.prepare_method(method)\n self.prepare_url(url, params)\n self.prepare_headers(headers)\n self.prepare_cookies(cookies)\n self.prepare_body(data, files)\n self.prepare_auth(auth, url)\n self.prepare_hooks(hooks)\n```\n\n``` python\n# class Request, models.py\ndef prepare(self):\n \"\"\"Constructs a :class:`PreparedRequest <PreparedRequest>` for transmission and returns it.\"\"\"\n return PreparedRequest(\n method=self.method,\n url=self.url,\n headers=self.headers,\n files=self.files,\n data=self.data,\n params=self.params,\n auth=self.auth,\n cookies=self.cookies,\n hooks=self.hooks,\n )\n```\n\n``` python\n# class Session, sessions.py\ndef prepare_request(self, request):\n return PreparedRequest(\n method=request.method,\n url=request.url,\n headers=merge_setting(request.headers, self.headers),\n files=request.files,\n data=request.data,\n params=request.params,\n auth=merge_setting(request.auth, self.auth),\n cookies=merge_cookies(request.cookies, self.cookies),\n hooks=merge_setting(request.hooks, self.hooks),\n )\n```\n", "That's understandable, but I did get what you meant. =) My key argument here is that preparing a `Request` is orthogonal to this problem. We should be restricting ourselves to thinking about whether or not it's OK to mutate the original `Request` when passed to the `Session`. =D\n", "Roger :) The way I think of a `Request` is as an abstract descriptor of \"how to make a request from an HTTP endpoint\", and not tied to the particular instance of sending it nor even the session. From that perspective, mutating a user-supplied `Request` object under the covers when you're preparing for a specific dispatch seems wrong.\n\nThe problem trying to be solved here is that there's currently no way to take a user-created `Request` object and send it with a session whilst having those session parameters (specifically the `auth` setting) applied to the request.\n\nIf it's not okay to modify the `Request` object—and I believe it is not ok—then the only solutions are:\n1. Copy the `Request` before mutating that internal copy, as in the original PR.\n2. Merge the `Session`'s settings with that of the `Request` during the creation of the `PreparedRequest`, as in my previous comment.\n3. Modify the `PreparedRequest` itself, which I believe is infeasible to do correctly.\n\nI believe number 2 is the correct solution, based on my understanding of the abstractions involved. It introduces no extra allocations and the request-preparation can be isolated to the `PreparedRequest` constructor where it probably ought to have been anyway.\n\nI'd actually like to update the PR with that new thinking—it doesn't need to add a potentially-error-prone `Request.copy()` method, doesn't need to introduce a `Session.update_request()` method, and overall seems better to me.\n", "Here's my hang-up. It consists of two parts:\n1. > 90% of our users won't ever need this as such, our existing strategy is to use Request objects as organizational throw away objects, as such we never present them to the user directly as part of a Response. What we do allow is for a user to replicate what we do in order to send a PreparedRequest. So as the API is concerned, the most import objects are the Session and Response object. Next most important are PreparedRequest objects because those are directly exposed via the Response object and finally the Request object. I fail to see how we can not just explicitly document for the user that the Request object will be mutated. We're not using a purely functional language so there's no reasonable expectation that the Request will not be mutated.\n2. The second part, contingent on that first, is that when you prepare a request, you're not going to get it back and so it may be mutated. If you're using this advanced API then you should have read the docs where we can explicitly document that those objects will be mutated. Does this hamper your use case? Yes. Does it meet the needs of what is likely > 90% of our users? More emphatically, yes.\n\nI haven't skimmed your PR because it seems (from the conversation that I've read via email) that it's very much in flux. That said, if you can sell @Lukasa and me on why we need Ruby-ish methods here, we can probably sell @kennethreitz and frankly you haven't sold me.\n", "There are way too many words on this page for me to read.\n\nWe need a `Session.prepare` in addition to a `Request.prepare`.\n", "@kennethreitz That's what this diff does.\n", ":cake:\n", "@erydo Despite what it looks like above, I really did want this change. =) Just wanted the best possible form of it. I think, looking at the diff that got merged, this is probably either that or extremely close to it. Thanks so much for your work! (And for putting up with my constant badgering. :grin:)\n", "@Lukasa I actually very much appreciate the level of feedback on this :) And I'm glad it ended up with a better solution than my original suggestion. :+1: Thanks!\n" ]
https://api.github.com/repos/psf/requests/issues/1506
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1506/labels{/name}
https://api.github.com/repos/psf/requests/issues/1506/comments
https://api.github.com/repos/psf/requests/issues/1506/events
https://github.com/psf/requests/pull/1506
17,408,544
MDExOlB1bGxSZXF1ZXN0NzI2ODU0Mg==
1,506
Provide 'host' parameter to MockRequest.
{ "avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4", "events_url": "https://api.github.com/users/Lukasa/events{/privacy}", "followers_url": "https://api.github.com/users/Lukasa/followers", "following_url": "https://api.github.com/users/Lukasa/following{/other_user}", "gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Lukasa", "id": 1382556, "login": "Lukasa", "node_id": "MDQ6VXNlcjEzODI1NTY=", "organizations_url": "https://api.github.com/users/Lukasa/orgs", "received_events_url": "https://api.github.com/users/Lukasa/received_events", "repos_url": "https://api.github.com/users/Lukasa/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Lukasa/starred{/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" } ]
closed
true
null
[]
null
1
2013-07-30T17:22:20Z
2021-09-08T23:06:22Z
2013-08-01T01:22:03Z
MEMBER
resolved
This should resolve #1502.
{ "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/1506/reactions" }
https://api.github.com/repos/psf/requests/issues/1506/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/1506.diff", "html_url": "https://github.com/psf/requests/pull/1506", "merged_at": "2013-08-01T01:22:03Z", "patch_url": "https://github.com/psf/requests/pull/1506.patch", "url": "https://api.github.com/repos/psf/requests/pulls/1506" }
true
[ ":+1:\n" ]
https://api.github.com/repos/psf/requests/issues/1505
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1505/labels{/name}
https://api.github.com/repos/psf/requests/issues/1505/comments
https://api.github.com/repos/psf/requests/issues/1505/events
https://github.com/psf/requests/issues/1505
17,405,859
MDU6SXNzdWUxNzQwNTg1OQ==
1,505
No option to turn off SSL compression
{ "avatar_url": "https://avatars.githubusercontent.com/u/1367638?v=4", "events_url": "https://api.github.com/users/bugsduggan/events{/privacy}", "followers_url": "https://api.github.com/users/bugsduggan/followers", "following_url": "https://api.github.com/users/bugsduggan/following{/other_user}", "gists_url": "https://api.github.com/users/bugsduggan/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/bugsduggan", "id": 1367638, "login": "bugsduggan", "node_id": "MDQ6VXNlcjEzNjc2Mzg=", "organizations_url": "https://api.github.com/users/bugsduggan/orgs", "received_events_url": "https://api.github.com/users/bugsduggan/received_events", "repos_url": "https://api.github.com/users/bugsduggan/repos", "site_admin": false, "starred_url": "https://api.github.com/users/bugsduggan/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/bugsduggan/subscriptions", "type": "User", "url": "https://api.github.com/users/bugsduggan", "user_view_type": "public" }
[]
closed
true
null
[]
null
6
2013-07-30T16:31:35Z
2021-09-09T02:11:38Z
2013-08-15T07:49:40Z
NONE
resolved
I could be missing something but it looks like there is no way to turn off SSL compression.
{ "avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4", "events_url": "https://api.github.com/users/Lukasa/events{/privacy}", "followers_url": "https://api.github.com/users/Lukasa/followers", "following_url": "https://api.github.com/users/Lukasa/following{/other_user}", "gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Lukasa", "id": 1382556, "login": "Lukasa", "node_id": "MDQ6VXNlcjEzODI1NTY=", "organizations_url": "https://api.github.com/users/Lukasa/orgs", "received_events_url": "https://api.github.com/users/Lukasa/received_events", "repos_url": "https://api.github.com/users/Lukasa/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Lukasa/starred{/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/1505/reactions" }
https://api.github.com/repos/psf/requests/issues/1505/timeline
null
completed
null
null
false
[ "You're quite right, there is not. In no small part this is because this functionality is not exposed (at least not cleanly) in versions of Python before 3.3: additionally, AFAIK, urllib3 does not expose the functionality (@t-8ch knows the TLS support of urllib3 way better than I do, he'll be able to tell you).\n", "Nope urllib3 doesn't expose this at the moment.\nIt doesn't seem the `SSLContext.options` expose really much functionality at the moment.\nI think your best bet would be to monkeypatch `urllib3.util.ssl_wrap_socket()` (when used with requests it is `requests.packages.urllib3.util.ssl_wrap_socket()`) to set the options.\n\nHowever if you think it is a common use case feel free to open a pull request over at urllib3.\nIt should be fairly easy to add this. Just look for `ssl_version` to find the locations where you should make your changes.\nIt would probably be best if the version of `ssl_wrap_socket` not using `SSLContext` throws a `ValueError` if options are passed in.\n", "Thanks for the quick responses!\n\nOne further question: I'm a bit new to dynamic languages' idea of monkeypatching. Would that be a change in Requests or would I be monkeypatching from my own code which uses Requests?\n", "You would monkeypatch from your own code that uses Requests. =)\n", "Thanks :smile: \n", "Quick example, I simply copied the function from urllib3 and added the one line:\n\n``` py\nimport requests\nfrom ssl import SSLError, SSLContext, HAS_SNI, OP_NO_COMPRESSION\n\n\n# copied from urllib3/util.py (for the greatest part)\ndef ssl_wrap_socket(sock, keyfile=None, certfile=None, cert_reqs=None,\n ca_certs=None, server_hostname=None,\n ssl_version=None):\n \"\"\"\n All arguments except `server_hostname` have the same meaning as for\n :func:`ssl.wrap_socket`\n\n :param server_hostname:\n Hostname of the expected certificate\n \"\"\"\n context = SSLContext(ssl_version)\n context.verify_mode = cert_reqs\n\n # !!!! Only change\n context.options = OP_NO_COMPRESSION\n\n if ca_certs:\n try:\n context.load_verify_locations(ca_certs)\n # Py32 raises IOError\n # Py33 raises FileNotFoundError\n except Exception as e: # Reraise as SSLError\n raise SSLError(e)\n if certfile:\n # FIXME: This block needs a test.\n context.load_cert_chain(certfile, keyfile)\n if HAS_SNI: # Platform-specific: OpenSSL with enabled SNI\n return context.wrap_socket(sock, server_hostname=server_hostname)\n return context.wrap_socket(sock)\n\n# monkeypatch\nrequests.packages.urllib3.connectionpool.ssl_wrap_socket = ssl_wrap_socket\n\nprint(requests.get('https://httpbin.org/'))\n```\n" ]
https://api.github.com/repos/psf/requests/issues/1504
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1504/labels{/name}
https://api.github.com/repos/psf/requests/issues/1504/comments
https://api.github.com/repos/psf/requests/issues/1504/events
https://github.com/psf/requests/issues/1504
17,388,481
MDU6SXNzdWUxNzM4ODQ4MQ==
1,504
stream with io.ByteIO
{ "avatar_url": "https://avatars.githubusercontent.com/u/2760504?v=4", "events_url": "https://api.github.com/users/dedalus2000/events{/privacy}", "followers_url": "https://api.github.com/users/dedalus2000/followers", "following_url": "https://api.github.com/users/dedalus2000/following{/other_user}", "gists_url": "https://api.github.com/users/dedalus2000/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/dedalus2000", "id": 2760504, "login": "dedalus2000", "node_id": "MDQ6VXNlcjI3NjA1MDQ=", "organizations_url": "https://api.github.com/users/dedalus2000/orgs", "received_events_url": "https://api.github.com/users/dedalus2000/received_events", "repos_url": "https://api.github.com/users/dedalus2000/repos", "site_admin": false, "starred_url": "https://api.github.com/users/dedalus2000/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/dedalus2000/subscriptions", "type": "User", "url": "https://api.github.com/users/dedalus2000", "user_view_type": "public" }
[]
closed
true
null
[]
null
5
2013-07-30T10:28:19Z
2021-09-09T02:11:45Z
2013-08-03T18:26:42Z
NONE
resolved
I can't use io.ByteIO in order to "put" a stream of data In fact Requests use 'super_len' in "prepare_body" in order to check its length, and "super_len" checks for the "fileno" attribute. io.ByteIO has that attribute, but it "Returns underlying file descriptor if one exists.An IOError is raised if the IO object does not use a file descriptor." So I always get a "UnsupportedOperation: fileno" error. I see that super_len is under a "try:.. exception (TypeError, AttributeError):" ; I propose to add the "io.UnsupportedOperation" exception among the others
{ "avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4", "events_url": "https://api.github.com/users/Lukasa/events{/privacy}", "followers_url": "https://api.github.com/users/Lukasa/followers", "following_url": "https://api.github.com/users/Lukasa/following{/other_user}", "gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Lukasa", "id": 1382556, "login": "Lukasa", "node_id": "MDQ6VXNlcjEzODI1NTY=", "organizations_url": "https://api.github.com/users/Lukasa/orgs", "received_events_url": "https://api.github.com/users/Lukasa/received_events", "repos_url": "https://api.github.com/users/Lukasa/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Lukasa/starred{/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/1504/reactions" }
https://api.github.com/repos/psf/requests/issues/1504/timeline
null
completed
null
null
false
[ "Before we do that, why are you using `io.ByteIO`? Can I see a sample of your code?\n", "Beh, really I'm not using directly io.ByteIO \n\nI'm uploading a file on a webserver running werkzeug, who get the file in a FileStorage structure; the I proxy the content directly to a couchdb storage.\n\nFileStorage uses io.ByteIO\n\nI can avoid the problem by fixing my source code, but probably other modules/softwares use io.ByteIO for streaming and the \"io\" library is among the standard libraries (at least in 2.7), so I proposed this patch.\n", "Aha, that makes sense. Yeah, I'm in favour of using file-like objects here, so we should probably catch this exception. +1.\n", "I'm also +1 for this.\n", "This should hopefully be resolved in 2.0: see #1516. =) Thanks for suggesting this!\n" ]
https://api.github.com/repos/psf/requests/issues/1503
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1503/labels{/name}
https://api.github.com/repos/psf/requests/issues/1503/comments
https://api.github.com/repos/psf/requests/issues/1503/events
https://github.com/psf/requests/pull/1503
17,361,979
MDExOlB1bGxSZXF1ZXN0NzI0Mzg0Mw==
1,503
Fixing error return to be consistent with tuple return at the end of the method
{ "avatar_url": "https://avatars.githubusercontent.com/u/58394?v=4", "events_url": "https://api.github.com/users/skastel/events{/privacy}", "followers_url": "https://api.github.com/users/skastel/followers", "following_url": "https://api.github.com/users/skastel/following{/other_user}", "gists_url": "https://api.github.com/users/skastel/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/skastel", "id": 58394, "login": "skastel", "node_id": "MDQ6VXNlcjU4Mzk0", "organizations_url": "https://api.github.com/users/skastel/orgs", "received_events_url": "https://api.github.com/users/skastel/received_events", "repos_url": "https://api.github.com/users/skastel/repos", "site_admin": false, "starred_url": "https://api.github.com/users/skastel/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/skastel/subscriptions", "type": "User", "url": "https://api.github.com/users/skastel", "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
24
2013-07-29T20:39:42Z
2021-09-08T23:06:20Z
2013-09-24T17:48:07Z
CONTRIBUTOR
resolved
In passing I managed to produce a situation where I would get an error when this check fails. When this gets called on line 391: ``` python 391 # Multi-part file uploads. 392 if files: 393 (body, content_type) = self._encode_files(files, data) ``` Which would result in: `TypeError: 'NoneType' object is not iterable` This patch fixes that return.
{ "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/1503/reactions" }
https://api.github.com/repos/psf/requests/issues/1503/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/1503.diff", "html_url": "https://github.com/psf/requests/pull/1503", "merged_at": "2013-09-24T17:48:07Z", "patch_url": "https://github.com/psf/requests/pull/1503.patch", "url": "https://api.github.com/repos/psf/requests/pulls/1503" }
true
[ "Can you provide a snippet of code that reproduces the bug in the current version?\n", "Ok, I dug into this a little more and figured out exactly what the cause is. When you pass an string (or unicode) as the data param and a files dict to requests.post(), it returns None at the place my patch changes behavior. The downside of fixing this is that now when you pass a string body (empty or not) and a files dict, requests won't raise any sort of indication that it's ignoring your files dict. Here are three scenarios, you can just run this with nose to see the errors.\n\n``` python\n#! /usr/bin/env python\nimport requests\nimport StringIO\n\n\ndef test_regular_string_post():\n # Silently succeeds, but doesn't tell you that requests is ignoring your files dict\n data = \"\"\n stream = StringIO.StringIO(\"some content goes here\")\n resp = requests.post('http://httpbin.org/post', data=data,\n headers={'Accept': u'*/*', 'Host': u'httpbin.org', 'Expect': u'100-continue'},\n files={'file': (u'file.txt', stream, 'application/octet-stream')},\n cookies={},\n timeout=120)\n print resp.content\n\n\ndef test_unicode_string_post():\n # Loudly fails with TypeError\n data = u\"\"\n stream = StringIO.StringIO(\"some content goes here\")\n resp = requests.post('http://httpbin.org/post', data=data,\n headers={'Accept': u'*/*', 'Host': u'httpbin.org', 'Expect': u'100-continue'},\n files={'file': (u'file.txt', stream, 'application/octet-stream')},\n cookies={},\n timeout=120)\n print resp.content\n\n\ndef test_none_post():\n # Correctly succeeds\n data = None\n stream = StringIO.StringIO(\"some content goes here\")\n resp = requests.post('http://httpbin.org/post', data=data,\n headers={'Accept': u'*/*', 'Host': u'httpbin.org', 'Expect': u'100-continue'},\n files={'file': (u'file.txt', stream, 'application/octet-stream')},\n cookies={},\n timeout=120)\n print resp.content\n\n```\n", "This brings up a separate question, should _encode_files() raise an error when a files dict and a data string are provided rather than ignoring the files dict and posting the body?\n", "@skastel I think the answer here is yes. Here's why:\n\nIf the user passes the `files` parameter, Requests will _always_ do a `multipart/form-data` upload. Providing a simple plain text string as well doesn't easily work alongside that kind of upload, at least not in the current API. For this reason, I think the user should probably get a `ValueError` explaining that `data` may not be a string if the `files` parameter is present.\n", "I agree but that effectively changes the API in a way that may seem (although I find it hard to argue that it actually is) backwards incompatible. Would it then make sense to only raise that exception in 2.0?\n", "Ah, yeah, I'm implicitly viewing all current feature requests as 2.0 feature requests. =)\n", "I should clarify that I'm not opposed to including this for 2.0.\n", "@Lukasa I'd actually much prefer a `ValueError` here, it would be clear that something is wrong with the request rather than making the request without uploading the files. So rather than silently \"succeeding\" it would explicitly fail and the raised error could indicate that a `data` was a string instead of a dict. I agree it changes the API, but I don't think this is part of the documented API, is it?\n", "@skastel part of the documented API or not, it's a behaviour some people may (possibly unintentionally) rely on. People do weird things with code you release and they don't always tell you until you change it. This is a backwards incompatible change either way you slice it unfortunately.\n", "@sigmavirus24 is right. We're fascistic about the API. It should be set in stone outside of major version increases. Happily, 2.0 isn't too far away, so this is well timed.\n", "Sounds reasonable. For now this pull should at least result in consistent behavior whether data is a `unicode` or a `str` \n", "@Lukasa recommendation?\n", "I'm strongly +1 on changing this to throw an explanatory `ValueError`. If @skastel is happy to make that change, I'll be totally happy with merging this. =)\n", "Hey, sorry for the slow reply, just got back from a vacation.\n\nSo would we prefer to have models.py be modified to throw a `ValueError` like so:\n\n```\n95 if (not files):\n96 return (None, None)\n97 if isinstance(data, basestring):\n98 raise ValueError(\"Can't execute command with data string and files dict\n```\n\nDoes that seem like the right change?\n", "I think that where we currently return `None` we should instead throw a `ValueError`. One of the following two behaviours:\n\n``` python\nif (not files) or isinstance(data, basestring):\n raise ValueError(\"Invalid argument combination.\")\n```\n\n``` python\nif (not files):\n raise ValueError(\"Files must be provided.\")\nelif isinstance(data, basestring):\n raise ValueError(\"Data must not be a string.\")\n```\n", "Latest commit will raise `ValueError` when we get the inconsistent data/files arguments.\n", "Awesome. For the testing, take a look at [this](http://pytest.org/latest/assert.html#assertions-about-expected-exceptions).\n", "Tests use `self.assertRaises()` now instead of just running the code. Thanks for the tip!\n", "Ah, sorry, I should have been clearer. You can't use the context manager form of `assertRaises()` on Pythons earlier than 2.7. You'll need to use one of these two forms:\n\n``` python\npytest.raises(ExpectedException, func, *args, **kwargs)\npytest.raises(ExpectedException, \"func(*args, **kwargs)\")\n```\n\nThis is why the tests failed. That's totally my bad, sorry. =(\n", "Oh, d'oh, ok I'll fix that up.\n", "All clear now!\n", "Awesome, this is great work! =D I'm +1 on merging this for 2.0. \n", "Great, anything else you need from me, or should I just leave this open until you're ready to merge it into 2.0?\n", "As far as this PR goes, your work is done! Kenneth is the BDFL so he's the only person who merges code to this repo, so this will sit here until he has time to look at it. =) But rest assured, it _will_ get merged (or I'll annoy him until he does it).\n\nAgain, thanks so much! =D :cookie: :star: :cookie:\n" ]
https://api.github.com/repos/psf/requests/issues/1502
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1502/labels{/name}
https://api.github.com/repos/psf/requests/issues/1502/comments
https://api.github.com/repos/psf/requests/issues/1502/events
https://github.com/psf/requests/issues/1502
17,340,369
MDU6SXNzdWUxNzM0MDM2OQ==
1,502
AttributeError: 'MockRequest' object has no attribute 'host'
{ "avatar_url": "https://avatars.githubusercontent.com/u/5113469?v=4", "events_url": "https://api.github.com/users/tidoublemy/events{/privacy}", "followers_url": "https://api.github.com/users/tidoublemy/followers", "following_url": "https://api.github.com/users/tidoublemy/following{/other_user}", "gists_url": "https://api.github.com/users/tidoublemy/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/tidoublemy", "id": 5113469, "login": "tidoublemy", "node_id": "MDQ6VXNlcjUxMTM0Njk=", "organizations_url": "https://api.github.com/users/tidoublemy/orgs", "received_events_url": "https://api.github.com/users/tidoublemy/received_events", "repos_url": "https://api.github.com/users/tidoublemy/repos", "site_admin": false, "starred_url": "https://api.github.com/users/tidoublemy/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/tidoublemy/subscriptions", "type": "User", "url": "https://api.github.com/users/tidoublemy", "user_view_type": "public" }
[]
closed
true
null
[]
null
4
2013-07-29T13:53:32Z
2021-09-09T02:11:46Z
2013-08-01T01:22:03Z
NONE
resolved
This issue appears to be specific to Python 3 (with requests 1.2.3), and I believe it only occurs with cookies that specify port numbers. It looks to me like the "MockRequest" object defined in cookies.py provides a get_host() method that would work here, but the code inside cookiejar.py tries to go directly to the host attribute, bypassing the mock. Below is a stack trace showing the issue: Python 3.3.1 (v3.3.1:d9893d13c628, Apr 6 2013, 20:30:21) [MSC v.1600 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. > > > import requests > > > request = requests.head('https://cloudsquid.redewt.net:2083/') > > > Traceback (most recent call last): > > > File "<stdin>", line 1, in <module> > > > File "C:\Python33\lib\site-packages\requests\api.py", line 77, in head > > > return request('head', 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 337, in send > > > r = self.build_response(request, resp) > > > File "C:\Python33\lib\site-packages\requests\adapters.py", line 176, in build_response > > > extract_cookies_to_jar(response.cookies, req, resp) > > > File "C:\Python33\lib\site-packages\requests\cookies.py", line 109, 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 1044, in set_ok_port > > > req_port = request_port(request) > > > File "C:\Python33\lib\http\cookiejar.py", line 628, in request_port > > > host = request.host > > > AttributeError: 'MockRequest' object has no attribute 'host'
{ "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/1502/reactions" }
https://api.github.com/repos/psf/requests/issues/1502/timeline
null
completed
null
null
false
[ "What version of requests are you using? I feel like we fixed that already.\n", "Nope, I can hit it on Python 3, Requests 1.2.3. =)\n", "You may be recalling https://github.com/kennethreitz/requests/issues/1369 which I came across while looking into this one. Different issue though.\n", "There's a really easy fix here, in cookies.py add this to the mock\n\n``` python\n@property\ndef host(self):\n return self.get_host()\n```\n\nThat fixes the problem on my machine. Who wants to open the PR?\n" ]
https://api.github.com/repos/psf/requests/issues/1501
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1501/labels{/name}
https://api.github.com/repos/psf/requests/issues/1501/comments
https://api.github.com/repos/psf/requests/issues/1501/events
https://github.com/psf/requests/pull/1501
17,338,632
MDExOlB1bGxSZXF1ZXN0NzIzMTQzMw==
1,501
Fix duplication of efforts caught by @dofelw
{ "avatar_url": "https://avatars.githubusercontent.com/u/240830?v=4", "events_url": "https://api.github.com/users/sigmavirus24/events{/privacy}", "followers_url": "https://api.github.com/users/sigmavirus24/followers", "following_url": "https://api.github.com/users/sigmavirus24/following{/other_user}", "gists_url": "https://api.github.com/users/sigmavirus24/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/sigmavirus24", "id": 240830, "login": "sigmavirus24", "node_id": "MDQ6VXNlcjI0MDgzMA==", "organizations_url": "https://api.github.com/users/sigmavirus24/orgs", "received_events_url": "https://api.github.com/users/sigmavirus24/received_events", "repos_url": "https://api.github.com/users/sigmavirus24/repos", "site_admin": false, "starred_url": "https://api.github.com/users/sigmavirus24/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/sigmavirus24/subscriptions", "type": "User", "url": "https://api.github.com/users/sigmavirus24", "user_view_type": "public" }
[ { "color": "009800", "default": false, "description": null, "id": 44501218, "name": "Ready To Merge", "node_id": "MDU6TGFiZWw0NDUwMTIxOA==", "url": "https://api.github.com/repos/psf/requests/labels/Ready%20To%20Merge" } ]
closed
true
null
[]
null
3
2013-07-29T13:15:40Z
2021-09-08T23:05:17Z
2013-08-01T01:22:59Z
CONTRIBUTOR
resolved
Fixes #1499
{ "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/1501/reactions" }
https://api.github.com/repos/psf/requests/issues/1501/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/1501.diff", "html_url": "https://github.com/psf/requests/pull/1501", "merged_at": "2013-08-01T01:22:59Z", "patch_url": "https://github.com/psf/requests/pull/1501.patch", "url": "https://api.github.com/repos/psf/requests/pulls/1501" }
true
[ "This is an obvious +1. =)\n", "Feels good to be getting PRs opened on here again. Ah the fresh smell of wifi and internet in the morning.\n\nPowered by coffee.\n", "=D Always a pleasure to have them.\n" ]
https://api.github.com/repos/psf/requests/issues/1500
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1500/labels{/name}
https://api.github.com/repos/psf/requests/issues/1500/comments
https://api.github.com/repos/psf/requests/issues/1500/events
https://github.com/psf/requests/pull/1500
17,328,550
MDExOlB1bGxSZXF1ZXN0NzIyNjAzMw==
1,500
Update urllib3 to d89d508
{ "avatar_url": "https://avatars.githubusercontent.com/u/288652?v=4", "events_url": "https://api.github.com/users/gavrie/events{/privacy}", "followers_url": "https://api.github.com/users/gavrie/followers", "following_url": "https://api.github.com/users/gavrie/following{/other_user}", "gists_url": "https://api.github.com/users/gavrie/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/gavrie", "id": 288652, "login": "gavrie", "node_id": "MDQ6VXNlcjI4ODY1Mg==", "organizations_url": "https://api.github.com/users/gavrie/orgs", "received_events_url": "https://api.github.com/users/gavrie/received_events", "repos_url": "https://api.github.com/users/gavrie/repos", "site_admin": false, "starred_url": "https://api.github.com/users/gavrie/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/gavrie/subscriptions", "type": "User", "url": "https://api.github.com/users/gavrie", "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" } ]
closed
true
null
[]
null
1
2013-07-29T08:32:49Z
2021-09-08T23:06:04Z
2013-08-01T01:23:43Z
NONE
resolved
This fixes a bug in urllib3 that caused the Host header to be set incorrectly when a proxy is used together with a nonstandard port number. For example, when going to http://example.com:8000/ through a proxy, the Host header was set to 'example.com' instead of 'example.com:8000' which totally breaks Requests in such a case.
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/1500/reactions" }
https://api.github.com/repos/psf/requests/issues/1500/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/1500.diff", "html_url": "https://github.com/psf/requests/pull/1500", "merged_at": "2013-08-01T01:23:43Z", "patch_url": "https://github.com/psf/requests/pull/1500.patch", "url": "https://api.github.com/repos/psf/requests/pulls/1500" }
true
[ "Looks reasonable to me, there doesn't seem to be any problematic API changes.\n" ]
https://api.github.com/repos/psf/requests/issues/1499
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1499/labels{/name}
https://api.github.com/repos/psf/requests/issues/1499/comments
https://api.github.com/repos/psf/requests/issues/1499/events
https://github.com/psf/requests/issues/1499
17,327,720
MDU6SXNzdWUxNzMyNzcyMA==
1,499
Reset hooks after registering them?
{ "avatar_url": "https://avatars.githubusercontent.com/u/1287724?v=4", "events_url": "https://api.github.com/users/zhuhaow/events{/privacy}", "followers_url": "https://api.github.com/users/zhuhaow/followers", "following_url": "https://api.github.com/users/zhuhaow/following{/other_user}", "gists_url": "https://api.github.com/users/zhuhaow/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/zhuhaow", "id": 1287724, "login": "zhuhaow", "node_id": "MDQ6VXNlcjEyODc3MjQ=", "organizations_url": "https://api.github.com/users/zhuhaow/orgs", "received_events_url": "https://api.github.com/users/zhuhaow/received_events", "repos_url": "https://api.github.com/users/zhuhaow/repos", "site_admin": false, "starred_url": "https://api.github.com/users/zhuhaow/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/zhuhaow/subscriptions", "type": "User", "url": "https://api.github.com/users/zhuhaow", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2013-07-29T08:06:48Z
2021-09-09T02:11:47Z
2013-07-31T08:08:32Z
NONE
resolved
In `models.py` line 200, hooks is registered, which is actually copying `hooks` to `self.hooks`: ``` python self.hooks = default_hooks() for (k, v) in list(hooks.items()): self.register_hook(event=k, hook=v) ``` Then in line 212, `self.hooks` is reset again: ``` python self.hooks = hooks ```
{ "avatar_url": "https://avatars.githubusercontent.com/u/1287724?v=4", "events_url": "https://api.github.com/users/zhuhaow/events{/privacy}", "followers_url": "https://api.github.com/users/zhuhaow/followers", "following_url": "https://api.github.com/users/zhuhaow/following{/other_user}", "gists_url": "https://api.github.com/users/zhuhaow/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/zhuhaow", "id": 1287724, "login": "zhuhaow", "node_id": "MDQ6VXNlcjEyODc3MjQ=", "organizations_url": "https://api.github.com/users/zhuhaow/orgs", "received_events_url": "https://api.github.com/users/zhuhaow/received_events", "repos_url": "https://api.github.com/users/zhuhaow/repos", "site_admin": false, "starred_url": "https://api.github.com/users/zhuhaow/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/zhuhaow/subscriptions", "type": "User", "url": "https://api.github.com/users/zhuhaow", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/1499/reactions" }
https://api.github.com/repos/psf/requests/issues/1499/timeline
null
completed
null
null
false
[ "Good catch. Fixing this now.\n", "Thanks again for filing this\n" ]
https://api.github.com/repos/psf/requests/issues/1498
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1498/labels{/name}
https://api.github.com/repos/psf/requests/issues/1498/comments
https://api.github.com/repos/psf/requests/issues/1498/events
https://github.com/psf/requests/pull/1498
17,307,940
MDExOlB1bGxSZXF1ZXN0NzIxNzY5NA==
1,498
Wrap IncompleteRead in ChunkedEncodingError.
{ "avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4", "events_url": "https://api.github.com/users/Lukasa/events{/privacy}", "followers_url": "https://api.github.com/users/Lukasa/followers", "following_url": "https://api.github.com/users/Lukasa/following{/other_user}", "gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Lukasa", "id": 1382556, "login": "Lukasa", "node_id": "MDQ6VXNlcjEzODI1NTY=", "organizations_url": "https://api.github.com/users/Lukasa/orgs", "received_events_url": "https://api.github.com/users/Lukasa/received_events", "repos_url": "https://api.github.com/users/Lukasa/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Lukasa/starred{/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": "fbca04", "default": false, "description": null, "id": 44501249, "name": "Needs BDFL Input", "node_id": "MDU6TGFiZWw0NDUwMTI0OQ==", "url": "https://api.github.com/repos/psf/requests/labels/Needs%20BDFL%20Input" }, { "color": "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" }, { "color": "e11d21", "default": false, "description": null, "id": 44501305, "name": "Not Ready To Merge", "node_id": "MDU6TGFiZWw0NDUwMTMwNQ==", "url": "https://api.github.com/repos/psf/requests/labels/Not%20Ready%20To%20Merge" } ]
closed
true
null
[]
null
15
2013-07-28T06:43:35Z
2021-09-08T04:00:59Z
2013-08-01T01:23:14Z
MEMBER
resolved
This should improve the user experience from #1397. @sigmavirus24, @kennethreitz: I'm not really happy with the nested try...except blocks here. Suggestions for a better style? Nothing leaps out at me.
{ "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/1498/reactions" }
https://api.github.com/repos/psf/requests/issues/1498/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/1498.diff", "html_url": "https://github.com/psf/requests/pull/1498", "merged_at": "2013-08-01T01:23:14Z", "patch_url": "https://github.com/psf/requests/pull/1498.patch", "url": "https://api.github.com/repos/psf/requests/pulls/1498" }
true
[ "I can't read `r` after catching error (there is an explanation ?)\n\n``` python\ntry:\n r = requests.post(url, params=self.req_params, data=self.upload_handler)\nexcept requests.exceptions.ChunkedEncodingError, e:\n # got: ('Connection broken: IncompleteRead(0 bytes read)', IncompleteRead(0 bytes read))\n # it's a possible behaviour in my case and i want to catch it and read status code or json response\n app.logger(str(e))\n print r.status_code # or print r.json()\n # here my code is blocked indefinitely\n```\n", "@yoyoprs Your code definitely blocks on `status_code`? You won't be able to read any json response because the response is incomplete, but the `status_code` will be fine unless the server hasn't responded _at all_.\n", "@Lukasa To sum up, i send file with some parameters, on server side according to the request parameters i start to read file **or** return a json with code 200. UWSGI doesn't like when the body is not consumed and raise error (IncompleteRead, i deal with it).\nRequest returned by server is ok (200) :\n\n```\n[pid: 55942|app: 0|req: 2/3] x.x.x.x () {42 vars in 940 bytes} [Wed May 18 16:04:05 2016] GET /api/v1/apps/sync/diff?uuid=9ab08c9e-3632-4e24-bcb3-ab7c9414d75f&firstsync=0&type=2&filters=&report=0&path=%2Ftest&id=38504 => generated 165 bytes in 154 msecs (HTTP/1.1 200) 2 headers in 80 bytes\n```\n\nBut i can't read `status_code` or json ...\n", "Hang on, why is `r` in scope? With the code called the way you show it above, `r` should not even be in scope, which means you should get a `NameError`. Why don't you?\n", "@Lukasa I just noticed that the variable `r` is no longer found in the namespace\nNo NameError **!**\n\ntcpdump (no reset):\n\n``` bash\n18:10:35.667569 IP client.50122 > server.443: Flags [S], seq 865485447, win 65535, options [mss 1460,nop,wscale 5,nop,nop,TS val 379018341 ecr 0,sackOK,eol], length 0\n18:10:35.667623 IP server.443 > client.50122: Flags [S.], seq 4232375148, ack 865485448, win 28960, options [mss 1460,sackOK,TS val 2160547584 ecr 379018341,nop,wscale 7], length 0\n18:10:35.681804 IP client.50122 > server.443: Flags [.], ack 1, win 4117, options [nop,nop,TS val 379018353 ecr 2160547584], length 0\n18:10:35.684066 IP client.50122 > server.443: Flags [P.], seq 1:102, ack 1, win 4117, options [nop,nop,TS val 379018354 ecr 2160547584], length 101\n18:10:35.684101 IP server.443 > client.50122: Flags [.], ack 102, win 227, options [nop,nop,TS val 2160547601 ecr 379018354], length 0\n18:10:35.687532 IP server.443 > client.50122: Flags [.], seq 1:2897, ack 102, win 227, options [nop,nop,TS val 2160547604 ecr 379018354], length 2896\n18:10:35.687642 IP server.443 > client.50122: Flags [P.], seq 2897:3095, ack 102, win 227, options [nop,nop,TS val 2160547604 ecr 379018354], length 198\n18:10:35.702305 IP client.50122 > server.443: Flags [.], ack 2897, win 4050, options [nop,nop,TS val 379018373 ecr 2160547604], length 0\n18:10:35.703812 IP client.50122 > server.443: Flags [.], ack 3095, win 4044, options [nop,nop,TS val 379018373 ecr 2160547604], length 0\n18:10:35.714584 IP client.50122 > server.443: Flags [P.], seq 102:300, ack 3095, win 4096, options [nop,nop,TS val 379018383 ecr 2160547604], length 198\n18:10:35.716330 IP server.443 > client.50122: Flags [P.], seq 3095:3361, ack 300, win 235, options [nop,nop,TS val 2160547633 ecr 379018383], length 266\n18:10:35.729816 IP client.50122 > server.443: Flags [.], ack 3361, win 4087, options [nop,nop,TS val 379018398 ecr 2160547633], length 0\n18:10:35.734595 IP client.50122 > server.443: Flags [P.], seq 300:726, ack 3361, win 4096, options [nop,nop,TS val 379018398 ecr 2160547633], length 426\n18:10:35.773934 IP server.443 > client.50122: Flags [.], ack 726, win 243, options [nop,nop,TS val 2160547691 ecr 379018398], length 0\n18:10:35.845389 IP server.443 > client.50122: Flags [P.], seq 3361:3766, ack 726, win 243, options [nop,nop,TS val 2160547762 ecr 379018398], length 405\n18:10:35.859043 IP client.50122 > server.443: Flags [.], ack 3766, win 4083, options [nop,nop,TS val 379018524 ecr 2160547762], length 0\n18:10:35.901352 IP client.50122 > server.443: Flags [P.], seq 726:1264, ack 3766, win 4096, options [nop,nop,TS val 379018561 ecr 2160547762], length 538\n18:10:35.901394 IP server.443 > client.50122: Flags [.], ack 1264, win 252, options [nop,nop,TS val 2160547818 ecr 379018561], length 0\n18:10:36.050250 IP server.443 > client.50122: Flags [P.], seq 3766:4235, ack 1264, win 252, options [nop,nop,TS val 2160547967 ecr 379018561], length 469\n18:10:36.064314 IP client.50122 > server.443: Flags [.], ack 4235, win 4081, options [nop,nop,TS val 379018727 ecr 2160547967], length 0\n18:10:36.935368 IP client.50122 > server.443: Flags [P.], seq 1264:1882, ack 4235, win 4096, options [nop,nop,TS val 379019590 ecr 2160547967], length 618\n18:10:36.935408 IP server.443 > client.50122: Flags [.], ack 1882, win 262, options [nop,nop,TS val 2160548852 ecr 379019590], length 0\n18:10:36.937074 IP client.50122 > server.443: Flags [P.], seq 1882:1956, ack 4235, win 4096, options [nop,nop,TS val 379019590 ecr 2160547967], length 74\n18:10:36.937105 IP server.443 > client.50122: Flags [.], ack 1956, win 262, options [nop,nop,TS val 2160548854 ecr 379019590], length 0\n18:10:37.029133 IP server.443 > client.50122: Flags [P.], seq 4235:4480, ack 1956, win 262, options [nop,nop,TS val 2160548946 ecr 379019590], length 245\n18:10:37.029148 IP server.443 > client.50122: Flags [F.], seq 4480, ack 1956, win 262, options [nop,nop,TS val 2160548946 ecr 379019590], length 0\n18:10:37.042577 IP client.50122 > server.443: Flags [.], ack 4480, win 4088, options [nop,nop,TS val 379019703 ecr 2160548946], length 0\n18:10:37.044078 IP client.50122 > server.443: Flags [.], ack 4481, win 4096, options [nop,nop,TS val 379019703 ecr 2160548946], length 0\n18:10:37.045338 IP client.50122 > server.443: Flags [F.], seq 1956, ack 4481, win 4096, options [nop,nop,TS val 379019704 ecr 2160548946], length 0\n18:10:37.045369 IP server.443 > client.50122: Flags [.], ack 1957, win 262, options [nop,nop,TS val 2160548962 ecr 379019704], length 0\n```\n\ntraceback :\n\n```\nTraceback (most recent call last):\n File \"/my_app/handlers/propagate.py\", line 445, in _upload\n up.start()\n File \"/my_app/handlers/transfer.py\", line 239, in start\n params=self.req_params, data=self.upload_handler)\n File \"/my_app/handlers/http.py\", line 26, in wrapped\n return f(self, *args, **kwargs)\n File \"/my_app/handlers/http.py\", line 108, in request_post\n timeout=(self.connect_timeout, self.read_timeout))\n File \"/my_app/.virtualenvs/sync-in-app/lib/python2.7/site-packages/requests/sessions.py\", line 511, in post\n return self.request('POST', url, data=data, json=json, **kwargs)\n File \"/my_app/.virtualenvs/sync-in-app/lib/python2.7/site-packages/requests/sessions.py\", line 468, in request\n resp = self.send(prep, **send_kwargs)\n File \"/my_app/.virtualenvs/sync-in-app/lib/python2.7/site-packages/requests/sessions.py\", line 608, in send\n r.content\n File \"/my_app/.virtualenvs/sync-in-app/lib/python2.7/site-packages/requests/models.py\", line 737, in content\n self._content = bytes().join(self.iter_content(CONTENT_CHUNK_SIZE)) or bytes()\n File \"/my_app/.virtualenvs/sync-in-app/lib/python2.7/site-packages/requests/models.py\", line 663, in generate\n raise ChunkedEncodingError(e)\nChunkedEncodingError: ('Connection broken: IncompleteRead(0 bytes read)', IncompleteRead(0 bytes read))\n```\n", "If you change the call to use `stream=True` you should get a response object back. It'll change where the exception comes in your code, but it'll let you see more about what's going on.\n", "@Lukasa You are right, now i get `status_code` and `ChunkedEncodingError` exception is raised when i try to read `r.json()`. This behaviour suits me. Thank you :)\n", "No problem, I'm glad we were able to find something that works for you!\n", "@Lukasa One last question: I think there is a bug when i try to read a custom header (the problem seems to be string encoding)\n\nExample OK (original custom content: _TODO.md_)\n\n``` python\nprint r.headers\n# {'Transfer-Encoding': 'chunked', ..., 'custom': 'TODO.md', 'Content-Type': 'text/html; charset=utf-8'}\nprint r.headers['Transfer-Encoding']\n# chunked\nprint r.headers['custom'] \n#TODO.md\n```\n\nExample KO (original custom content: _hackiñg.txt_)\n\n``` python\nprint r.headers\n# {'Transfer-Encoding': 'chunked', '..., 'custom': 'hacki\\xf1g.txt', 'Content-Type': 'text/html; charset=utf-8'}\nprint r.headers['Transfer-Encoding']\n# chunked\nprint r.headers['custom'] \n# here code is blocked\n```\n\nSome times (in second case) code block on printing `Transfer-Encoding` header\nI use python 2.7\n", "What Python version are you using, please?\n", "Python 2.7.10 (default, Oct 23 2015, 19:19:21)\n", "Are you sure the code blocks on the header print, or does it throw an exception you're swallowing?\n", "ok you can kill me ... i use ThreadPool which hide some exceptions (UnicodeDecodeError for example ... ARGHH) ... sorry for your time :(\n", "=P No worries. Glad you worked it out!\n", "Thank's for your patience 👍 \n" ]
https://api.github.com/repos/psf/requests/issues/1497
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1497/labels{/name}
https://api.github.com/repos/psf/requests/issues/1497/comments
https://api.github.com/repos/psf/requests/issues/1497/events
https://github.com/psf/requests/pull/1497
17,307,771
MDExOlB1bGxSZXF1ZXN0NzIxNzYzNA==
1,497
[2.0] Proxy urls should have explicit schemes.
{ "avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4", "events_url": "https://api.github.com/users/Lukasa/events{/privacy}", "followers_url": "https://api.github.com/users/Lukasa/followers", "following_url": "https://api.github.com/users/Lukasa/following{/other_user}", "gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Lukasa", "id": 1382556, "login": "Lukasa", "node_id": "MDQ6VXNlcjEzODI1NTY=", "organizations_url": "https://api.github.com/users/Lukasa/orgs", "received_events_url": "https://api.github.com/users/Lukasa/received_events", "repos_url": "https://api.github.com/users/Lukasa/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Lukasa/starred{/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": "fbca04", "default": false, "description": null, "id": 44501249, "name": "Needs BDFL Input", "node_id": "MDU6TGFiZWw0NDUwMTI0OQ==", "url": "https://api.github.com/repos/psf/requests/labels/Needs%20BDFL%20Input" }, { "color": "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" }, { "color": "e11d21", "default": false, "description": null, "id": 44501305, "name": "Not Ready To Merge", "node_id": "MDU6TGFiZWw0NDUwMTMwNQ==", "url": "https://api.github.com/repos/psf/requests/labels/Not%20Ready%20To%20Merge" } ]
closed
true
null
[]
null
5
2013-07-28T06:17:58Z
2021-09-08T23:08:24Z
2013-08-01T01:28:35Z
MEMBER
resolved
This is for 2.0, and is in response to @t-8ch's suggestion that proxies should have explicit schemes instead of guessing (which is stupid). @sigmavirus24, @kennethreitz: I'm not entirely happy with the validation code being here: let me know if you have a better idea for where it should go.
{ "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/1497/reactions" }
https://api.github.com/repos/psf/requests/issues/1497/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/1497.diff", "html_url": "https://github.com/psf/requests/pull/1497", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/1497.patch", "url": "https://api.github.com/repos/psf/requests/pulls/1497" }
true
[ "I recently checked was curl is doing with different proxy schemes.\nCurl ignores the scheme and always connects to the proxy using plain http.\nWhat curl does support, what could be nice to have are `CONNECT` tunnels for plain http, if the proxy is messing things up.\n", "Shorter stacktraces == easier to read exceptions for most users. If we can do the validation when someone sets `Session.proxies` or passes the `proxies` parameter that would be awesome. The lowest they would then see would be `Session.request` which isn't all too horrible all things considered.\n", "@sigmavirus24 Yeah, I thought about that. Unfortunately, users can send directly into a Transport Adapter (it's a supported flow), and if they did that then they would lose this validation.\n", "Ah good call. This is an obvious :+1: then.\n", "Closing since this is merged into #1509\n" ]
https://api.github.com/repos/psf/requests/issues/1496
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1496/labels{/name}
https://api.github.com/repos/psf/requests/issues/1496/comments
https://api.github.com/repos/psf/requests/issues/1496/events
https://github.com/psf/requests/issues/1496
17,291,407
MDU6SXNzdWUxNzI5MTQwNw==
1,496
Can't install requests-1.2.3 on Python 3.3.2 via pip
{ "avatar_url": "https://avatars.githubusercontent.com/u/2358461?v=4", "events_url": "https://api.github.com/users/tz18/events{/privacy}", "followers_url": "https://api.github.com/users/tz18/followers", "following_url": "https://api.github.com/users/tz18/following{/other_user}", "gists_url": "https://api.github.com/users/tz18/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/tz18", "id": 2358461, "login": "tz18", "node_id": "MDQ6VXNlcjIzNTg0NjE=", "organizations_url": "https://api.github.com/users/tz18/orgs", "received_events_url": "https://api.github.com/users/tz18/received_events", "repos_url": "https://api.github.com/users/tz18/repos", "site_admin": false, "starred_url": "https://api.github.com/users/tz18/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/tz18/subscriptions", "type": "User", "url": "https://api.github.com/users/tz18", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2013-07-27T01:04:46Z
2021-09-09T02:11:49Z
2013-07-27T07:18:30Z
NONE
resolved
edit: sorry, I just realized Lukasa already responded to this [here](https://github.com/kennethreitz/requests/issues/1416#issuecomment-21607795) This is [issue 1416](https://github.com/kennethreitz/requests/issues/1416) again, I'm new to github and don't know how to reopen it or what, so I figured I'd do this. I was able to install requests by downloading the zip and doing setup.py install just fine. Anyway, it yields this: ``` C:\Python33\Scripts>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 "C:\Python33\Lib\site-packages\requests\packages\urllib3\contrib\ntlm pool.py", line 38 """ ^ SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in pos ition 130-131: truncated \uXXXX escape Successfully installed requests Cleaning up... ``` I mean, it says successfully installed but uh, it also throws an error.
{ "avatar_url": "https://avatars.githubusercontent.com/u/2358461?v=4", "events_url": "https://api.github.com/users/tz18/events{/privacy}", "followers_url": "https://api.github.com/users/tz18/followers", "following_url": "https://api.github.com/users/tz18/following{/other_user}", "gists_url": "https://api.github.com/users/tz18/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/tz18", "id": 2358461, "login": "tz18", "node_id": "MDQ6VXNlcjIzNTg0NjE=", "organizations_url": "https://api.github.com/users/tz18/orgs", "received_events_url": "https://api.github.com/users/tz18/received_events", "repos_url": "https://api.github.com/users/tz18/repos", "site_admin": false, "starred_url": "https://api.github.com/users/tz18/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/tz18/subscriptions", "type": "User", "url": "https://api.github.com/users/tz18", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/1496/reactions" }
https://api.github.com/repos/psf/requests/issues/1496/timeline
null
completed
null
null
false
[ "@tz18 For those approaching this issue in the future, please note that the fix is currently in the repository, it just hasn't been pushed to PyPI. Feel free to check out the GitHub code instead if you think you'll use NTLM.\n" ]
https://api.github.com/repos/psf/requests/issues/1495
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1495/labels{/name}
https://api.github.com/repos/psf/requests/issues/1495/comments
https://api.github.com/repos/psf/requests/issues/1495/events
https://github.com/psf/requests/issues/1495
17,232,262
MDU6SXNzdWUxNzIzMjI2Mg==
1,495
Can't set headers per part of multipart requests
{ "avatar_url": "https://avatars.githubusercontent.com/u/969813?v=4", "events_url": "https://api.github.com/users/sholsapp/events{/privacy}", "followers_url": "https://api.github.com/users/sholsapp/followers", "following_url": "https://api.github.com/users/sholsapp/following{/other_user}", "gists_url": "https://api.github.com/users/sholsapp/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/sholsapp", "id": 969813, "login": "sholsapp", "node_id": "MDQ6VXNlcjk2OTgxMw==", "organizations_url": "https://api.github.com/users/sholsapp/orgs", "received_events_url": "https://api.github.com/users/sholsapp/received_events", "repos_url": "https://api.github.com/users/sholsapp/repos", "site_admin": false, "starred_url": "https://api.github.com/users/sholsapp/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/sholsapp/subscriptions", "type": "User", "url": "https://api.github.com/users/sholsapp", "user_view_type": "public" }
[]
closed
true
null
[]
null
12
2013-07-25T20:05:59Z
2021-09-07T00:06:18Z
2013-07-30T15:24:22Z
NONE
resolved
I should be able to specify per-part headers for parts of a multipart requests. E.g., in the following examples, I should be able to specify different values for 'Content-Disposition' and 'Content-Type'. Request generated with: ``` requests.post(url , files=dict(('file1', '{"example": 1}'), ('file2', '{"example": 2}'))) ``` Request on wire: ``` POST /route/foobar HTTP/1.1 Host: sholsapp.com:11936 Content-Length: 682 Content-Type: multipart/form-data; boundary=586c8e04f40444d28160739615e0b7a7 Accept-Encoding: gzip, deflate, compress Accept: */* User-Agent: python-requests/1.1.0 CPython/2.6.6 Linux/2.6.32-131.4.1.el6.x86_64 --586c8e04f40444d28160739615e0b7a7 Content-Disposition: form-data; name="file1"; filename="file" Content-Type: application/octet-stream {"example": 1} --586c8e04f40444d28160739615e0b7a7-- Content-Disposition: form-data; name="file2"; filename="file2" Content-Type: application/octet-stream {"example": 2} --586c8e04f40444d28160739615e0b7a7 ``` I can't see an obvious way to do this using requests. Does anyone know how to accomplish this? _Would anyone be open to reviewing a patch that would add this functionality? If so, what things do they want to see considered, what API exposed, etc.?_ Thanks!
{ "avatar_url": "https://avatars.githubusercontent.com/u/969813?v=4", "events_url": "https://api.github.com/users/sholsapp/events{/privacy}", "followers_url": "https://api.github.com/users/sholsapp/followers", "following_url": "https://api.github.com/users/sholsapp/following{/other_user}", "gists_url": "https://api.github.com/users/sholsapp/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/sholsapp", "id": 969813, "login": "sholsapp", "node_id": "MDQ6VXNlcjk2OTgxMw==", "organizations_url": "https://api.github.com/users/sholsapp/orgs", "received_events_url": "https://api.github.com/users/sholsapp/received_events", "repos_url": "https://api.github.com/users/sholsapp/repos", "site_admin": false, "starred_url": "https://api.github.com/users/sholsapp/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/sholsapp/subscriptions", "type": "User", "url": "https://api.github.com/users/sholsapp", "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/1495/reactions" }
https://api.github.com/repos/psf/requests/issues/1495/timeline
null
completed
null
null
false
[ "Yeah, you can do this (sort of), but it's not a very clearly documented feature.\n\nWe don't allow you to set _arbitrary_ values of those headers, but we do allow you to change the name, filename and content-type values, like so:\n\n``` python\n>>> import requests\n>>> files = {'file1': ('filename', 'data', 'text/plain'), 'file2': ('otherfilename', 'data2', 'text/other')}\n>>> r = requests.post('http://httpbin.org/post', files=files)\n>>> r.status_code\n200\n```\n\nOn the wire, this looks like:\n\n```\nPOST /post HTTP/1.1\nHost: httpbin.org\nContent-Length: 318\nContent-Type: multipart/form-data; boundary=e1b0cf4b5e114bf088118fc0bbf4ee4c\nAccept-Encoding: gzip, deflate, compress\nAccept: */*\nUser-Agent: python-requests/1.2.3 CPython/2.7.2 Darwin/12.4.0\n\n--e1b0cf4b5e114bf088118fc0bbf4ee4c\nContent-Disposition: form-data; name=\"file2\"; filename=\"otherfilename\"\nContent-Type: text/other\n\ndata2\n--e1b0cf4b5e114bf088118fc0bbf4ee4c\nContent-Disposition: form-data; name=\"file1\"; filename=\"filename\"\nContent-Type: text/plain\n\ndata\n--e1b0cf4b5e114bf088118fc0bbf4ee4c--\n```\n\nDoes that provide the functionality you wanted?\n", "Almost, but not quite. To work with the system I'm communicating with, I would need the ability to set the \"Content-Location\" header per part. Is there a way to set that header?\n\nI figured we could abstract this feature out and allow one to add _any_ headers they would want per part, but it's not immediately obvious to me how that feature would be designed. I haven't seen the part of code that allows me to do what you showed, but I suppose you could extend it to allow a headers dict, too. \n", "The answer there is no. =) I also sincerely doubt there is going to be enthusiasm for adding it to the API. Each addition to the API is an increase in complexity and needs to be strongly justified by a compelling (and reasonably common) use-case. I'm prepared to be convinced, but I doubt such a use-case exists here.\n", "I think at a minimum the ability to change the \"Content-Location\" header is a must-have for library writers. I also like most of the arguments in http://tools.ietf.org/html/rfc2557.\n\nI agree it is probably not a super popular use-case... I'll do some more digging and see if there would be a non-obtrusive way of adding the feature.\n", "You should feel free to investigate, but the friction involved here is high. We delegate our building of multipart-encoded bodies to `urllib3` via [this function call here](https://github.com/kennethreitz/requests/tree/master/requests#L133). That function is defined [here](https://github.com/shazow/urllib3/blob/master/urllib3/filepost.py#L42) in urllib3. Any change you wanted to make would need to be implemented in urllib3 first, and would then be exposed (or not) in Requests.\n\nAs for whether or not changing `Content-Location` is a must-have, I'm not totally sure I agree: after all, this is the first time we've been asked for it! =D\n", "Thanks for the links. Being that urllib3 isn't flexible enough to support this, either, I think I'll have to look into rolling my own request for this thing. It's a shame, `requests` was _soo_ close.\n\nOr I'll go bug the urllib3 people now. =)\n", "@sholsapp is it possible to close this? You can open a pull request if and when you get these features accepted into urllib3. You can still reference this in that pull request but I cannot guarantee this will be accepted either way.\n", "Sure, yes, we can close this. I'm not sure if I'll continue using `requests` for this task so if there is uncertainty over whether people want this feature or not, I'll not send a pull request.\n", "The challenge is always to provide an implementation that does not add complexity to the mainline (standard multipart file uploads), _and_ that is intuitive for the unusual case. If you can provide such an API, you've got a much better chance of getting it accepted. =)\n", "In my opinion it is crucial to offer a full useable way to add any headers to the request.\nI have the same problem and it's very anoying.\n\nAt least you guys could display a solution to archive this without adding it to the stable release.\nI would appreciate it.\n", "@sharpshadow You can do this today, and if you'd looked around a little bit longer: say, at the urllib3 issue linked above, or [at the docs](http://docs.python-requests.org/en/latest/user/quickstart/#post-a-multipart-encoded-file), you'd have found that out.\n\nFiles takes a dictionary of keys to tuples, with the following meanings of each place in the tuple:\n\n```\n# 1-tuple (not a tuple at all)\n{fieldname: file_object}\n\n# 2-tuple\n{fieldname: (filename, file_object)}\n\n# 3-tuple\n{fieldname: (filename, file_object, content_type)}\n\n# 4-tuple\n{fieldname: (filename, file_object, content_type, headers)}\n```\n", "@Lukasa\nThank you very much. As mostly it was not the problem of missing ressources or bad dokumentation.\n", "dxsssssssssssss" ]
https://api.github.com/repos/psf/requests/issues/1494
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1494/labels{/name}
https://api.github.com/repos/psf/requests/issues/1494/comments
https://api.github.com/repos/psf/requests/issues/1494/events
https://github.com/psf/requests/pull/1494
17,226,441
MDExOlB1bGxSZXF1ZXN0NzE3NTA4OQ==
1,494
Document the Response.close() method.
{ "avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4", "events_url": "https://api.github.com/users/Lukasa/events{/privacy}", "followers_url": "https://api.github.com/users/Lukasa/followers", "following_url": "https://api.github.com/users/Lukasa/following{/other_user}", "gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Lukasa", "id": 1382556, "login": "Lukasa", "node_id": "MDQ6VXNlcjEzODI1NTY=", "organizations_url": "https://api.github.com/users/Lukasa/orgs", "received_events_url": "https://api.github.com/users/Lukasa/received_events", "repos_url": "https://api.github.com/users/Lukasa/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Lukasa/starred{/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" } ]
closed
true
null
[]
null
0
2013-07-25T18:11:26Z
2021-09-08T21:01:04Z
2013-07-28T06:04:34Z
MEMBER
resolved
Should resolve the problem from #1492.
{ "avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4", "events_url": "https://api.github.com/users/Lukasa/events{/privacy}", "followers_url": "https://api.github.com/users/Lukasa/followers", "following_url": "https://api.github.com/users/Lukasa/following{/other_user}", "gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Lukasa", "id": 1382556, "login": "Lukasa", "node_id": "MDQ6VXNlcjEzODI1NTY=", "organizations_url": "https://api.github.com/users/Lukasa/orgs", "received_events_url": "https://api.github.com/users/Lukasa/received_events", "repos_url": "https://api.github.com/users/Lukasa/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Lukasa/starred{/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/1494/reactions" }
https://api.github.com/repos/psf/requests/issues/1494/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/1494.diff", "html_url": "https://github.com/psf/requests/pull/1494", "merged_at": "2013-07-28T06:04:34Z", "patch_url": "https://github.com/psf/requests/pull/1494.patch", "url": "https://api.github.com/repos/psf/requests/pulls/1494" }
true
[]
https://api.github.com/repos/psf/requests/issues/1493
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1493/labels{/name}
https://api.github.com/repos/psf/requests/issues/1493/comments
https://api.github.com/repos/psf/requests/issues/1493/events
https://github.com/psf/requests/issues/1493
17,215,439
MDU6SXNzdWUxNzIxNTQzOQ==
1,493
add context manager support to Response
{ "avatar_url": "https://avatars.githubusercontent.com/u/5090005?v=4", "events_url": "https://api.github.com/users/julie777/events{/privacy}", "followers_url": "https://api.github.com/users/julie777/followers", "following_url": "https://api.github.com/users/julie777/following{/other_user}", "gists_url": "https://api.github.com/users/julie777/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/julie777", "id": 5090005, "login": "julie777", "node_id": "MDQ6VXNlcjUwOTAwMDU=", "organizations_url": "https://api.github.com/users/julie777/orgs", "received_events_url": "https://api.github.com/users/julie777/received_events", "repos_url": "https://api.github.com/users/julie777/repos", "site_admin": false, "starred_url": "https://api.github.com/users/julie777/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/julie777/subscriptions", "type": "User", "url": "https://api.github.com/users/julie777", "user_view_type": "public" }
[]
closed
true
null
[]
null
6
2013-07-25T14:48:53Z
2021-09-09T00:28:12Z
2013-08-15T07:49:57Z
NONE
resolved
This addresses the issue of exceeding the max number of open files. This provides a simple, elegant way to make sure connections are closed after use. Add **enter** and **exit** to Response. e.g. with requests.get("someurl") as r: ... # do something with r And alternative would be to provide a configuration for requests to automatically close connections after the response is created and contents retrieved. This would be useful in application where all responses are known to be short and chunking retrieval will not be used.
{ "avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4", "events_url": "https://api.github.com/users/Lukasa/events{/privacy}", "followers_url": "https://api.github.com/users/Lukasa/followers", "following_url": "https://api.github.com/users/Lukasa/following{/other_user}", "gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Lukasa", "id": 1382556, "login": "Lukasa", "node_id": "MDQ6VXNlcjEzODI1NTY=", "organizations_url": "https://api.github.com/users/Lukasa/orgs", "received_events_url": "https://api.github.com/users/Lukasa/received_events", "repos_url": "https://api.github.com/users/Lukasa/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Lukasa/starred{/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/1493/reactions" }
https://api.github.com/repos/psf/requests/issues/1493/timeline
null
completed
null
null
false
[ "Thanks for raising this issue @julie777!\n\nI'm strictly +0 on this. I can see the utility of it, but I don't know that a context manager on `Response` is semantically the right way to approach this issue. If @kennethreitz is +1 on this, though, I think it'd make a good addition to V2.0.\n", "I fully understand the motivation but the context of a request doesn't quite \nsemantically make sense to me.\n\nThe context of a session is intuitive, but not that of a response. Consider me \n-1 on this with that non-explanation.\n", "I actually want to revisit this issue.\n\nA not-uncommon use case of Requests is to open connections to download _part_ of a response, without downloading the whole body. In that case, to ensure that the connection pooling logic of `Session` objects still works, you need to make sure you call `Response.close()`. In this sort of use-case it does actually seem not-unreasonable to turn `Response` objects into context managers. @sigmavirus24, thoughts?\n", "For this not-unvery-such-rare case, [`contextlib.closing`](http://docs.python.org/2/library/contextlib.html#contextlib.closing) might sufice. Though it doesn't hurt to implement this, right?\n", "@pepijndevos It's not very hard to make objects context managers. (Not to sound like a pompous ass who's done this a million times)\n\n@Lukasa I think I know what you're talking about -- there have been a fair number of bug reports/stackoverflow questions about this. I'm willing (because people seem to find `Response#close` annoying) to bend on this. I still think that logically it's a bit of nonsense but from a purely utilitarian perspective, it makes sense.\n", "@pepijndevos I totally missed what you meant (contextlib provides a lot of things to help _make_ context managers). I didn't realize that it would close the thing. On that topic I'm 100% for documenting that pattern instead of making the `Response` object a context manager unto itself.\n" ]
https://api.github.com/repos/psf/requests/issues/1492
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1492/labels{/name}
https://api.github.com/repos/psf/requests/issues/1492/comments
https://api.github.com/repos/psf/requests/issues/1492/events
https://github.com/psf/requests/issues/1492
17,215,234
MDU6SXNzdWUxNzIxNTIzNA==
1,492
document use of Response.close
{ "avatar_url": "https://avatars.githubusercontent.com/u/5090005?v=4", "events_url": "https://api.github.com/users/julie777/events{/privacy}", "followers_url": "https://api.github.com/users/julie777/followers", "following_url": "https://api.github.com/users/julie777/following{/other_user}", "gists_url": "https://api.github.com/users/julie777/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/julie777", "id": 5090005, "login": "julie777", "node_id": "MDQ6VXNlcjUwOTAwMDU=", "organizations_url": "https://api.github.com/users/julie777/orgs", "received_events_url": "https://api.github.com/users/julie777/received_events", "repos_url": "https://api.github.com/users/julie777/repos", "site_admin": false, "starred_url": "https://api.github.com/users/julie777/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/julie777/subscriptions", "type": "User", "url": "https://api.github.com/users/julie777", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2013-07-25T14:44:57Z
2021-09-09T02:11:48Z
2013-07-28T06:05:52Z
NONE
resolved
In certain circumstances the number of open connections will quickly exceed the max open files limits for the use and cause connection failure. Garbage collection is unlikely to run automatically in time to solve the problem.
{ "avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4", "events_url": "https://api.github.com/users/Lukasa/events{/privacy}", "followers_url": "https://api.github.com/users/Lukasa/followers", "following_url": "https://api.github.com/users/Lukasa/following{/other_user}", "gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Lukasa", "id": 1382556, "login": "Lukasa", "node_id": "MDQ6VXNlcjEzODI1NTY=", "organizations_url": "https://api.github.com/users/Lukasa/orgs", "received_events_url": "https://api.github.com/users/Lukasa/received_events", "repos_url": "https://api.github.com/users/Lukasa/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions", "type": "User", "url": "https://api.github.com/users/Lukasa", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/1492/reactions" }
https://api.github.com/repos/psf/requests/issues/1492/timeline
null
completed
null
null
false
[ "Thanks for this suggestion @julie777! Should be implemented by #1494.\n" ]
https://api.github.com/repos/psf/requests/issues/1491
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1491/labels{/name}
https://api.github.com/repos/psf/requests/issues/1491/comments
https://api.github.com/repos/psf/requests/issues/1491/events
https://github.com/psf/requests/issues/1491
17,187,310
MDU6SXNzdWUxNzE4NzMxMA==
1,491
Installed certifi, set REQUESTS_CA_BUNDLE env var, still getting SSL error.
{ "avatar_url": "https://avatars.githubusercontent.com/u/1719342?v=4", "events_url": "https://api.github.com/users/hugh-dunne/events{/privacy}", "followers_url": "https://api.github.com/users/hugh-dunne/followers", "following_url": "https://api.github.com/users/hugh-dunne/following{/other_user}", "gists_url": "https://api.github.com/users/hugh-dunne/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/hugh-dunne", "id": 1719342, "login": "hugh-dunne", "node_id": "MDQ6VXNlcjE3MTkzNDI=", "organizations_url": "https://api.github.com/users/hugh-dunne/orgs", "received_events_url": "https://api.github.com/users/hugh-dunne/received_events", "repos_url": "https://api.github.com/users/hugh-dunne/repos", "site_admin": false, "starred_url": "https://api.github.com/users/hugh-dunne/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/hugh-dunne/subscriptions", "type": "User", "url": "https://api.github.com/users/hugh-dunne", "user_view_type": "public" }
[]
closed
true
null
[]
null
10
2013-07-24T23:48:40Z
2021-09-08T21:00:42Z
2013-07-25T19:40:21Z
NONE
resolved
I am using the jenkinsapi module which uses requests under the hood. If I try to use it out of the box, pointing it at a jenkins server that uses SSL, I get: SSLError: [Errno 1] _ssl.c:504: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed jenkinsapi doesn't provide a hook to set verify=False. I tried saving the certificate from the jenkins server and setting the REQUESTS_CA_BUNDLE environment variable to point to it, and still got the same error. I also tried installing certifi but it makes no difference. I know I could hack the jenkinsapi code but that is not satisfactory because all users of my code would have to do the same thing. Am I overlooking something?
{ "avatar_url": "https://avatars.githubusercontent.com/u/1719342?v=4", "events_url": "https://api.github.com/users/hugh-dunne/events{/privacy}", "followers_url": "https://api.github.com/users/hugh-dunne/followers", "following_url": "https://api.github.com/users/hugh-dunne/following{/other_user}", "gists_url": "https://api.github.com/users/hugh-dunne/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/hugh-dunne", "id": 1719342, "login": "hugh-dunne", "node_id": "MDQ6VXNlcjE3MTkzNDI=", "organizations_url": "https://api.github.com/users/hugh-dunne/orgs", "received_events_url": "https://api.github.com/users/hugh-dunne/received_events", "repos_url": "https://api.github.com/users/hugh-dunne/repos", "site_admin": false, "starred_url": "https://api.github.com/users/hugh-dunne/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/hugh-dunne/subscriptions", "type": "User", "url": "https://api.github.com/users/hugh-dunne", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/1491/reactions" }
https://api.github.com/repos/psf/requests/issues/1491/timeline
null
completed
null
null
false
[ "Can you show me what the saved certificate looked like please? Should be possible to simply paste it in here.\n", "Thanks for responding. I re-saved the certificate and things are working now.\n", "Damn! I spoke too soon. Here is the cert:\n\n-----BEGIN CERTIFICATE-----\nMIIGQDCCBSigAwIBAgIKWQnHpQAAAAAIzjANBgkqhkiG9w0BAQUFADBZMRMwEQYK\nCZImiZPyLGQBGRYDY29tMRQwEgYKCZImiZPyLGQBGRYEZWJheTEUMBIGCgmSJomT\n8ixkARkWBGNvcnAxFjAUBgNVBAMTDUFNRVItU1NMQ0EtMDIwHhcNMTIxMTE4MDUz\nMTA4WhcNMTQxMTE4MDUzMTA4WjB1MQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2Fs\naWZvcm5pYTERMA8GA1UEBxMIU2FuIEpvc2UxFDASBgNVBAoTC1BheVBhbCBJbmMu\nMQwwCgYDVQQLEwNDRUkxGjAYBgNVBAMTEWZ1c2lvbi5wYXlwYWwuY29tMIIBIjAN\nBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAwOZj4ezQ/k5vTU6E63uNsP+LZjeg\n4kTEUwSzFsRj3NImQdfOrQ7W7S386ep2EZZqmjevO6HBzkaXaYYQ0GSqthdspd53\nA8GnLi0q43oFy+kyAc2ItAM0SH/GOt0J+5EUdS12S821WMiwebHInSHINAjexAHN\nSm87yXCyO8mZ3Jzc3+PFraveF9WFmE0NLZUDpEMxq17K3/6iGLsVO/YZkUpaAXNJ\n962fGrIZ4xcvK//S903ehloKwQnRCgtNoGCmvsoDftbYye6LfRh/rH3xWFXIUmWG\nWib27ZwAgbyxz2FPcexie4FB/IzbH2l9Tp5rzGWfs1159VmVhQ/L3EJIDQIDAQAB\no4IC7DCCAugwHQYDVR0OBBYEFMkZJD5QaahE21k37UvPIP1VmZ1SMB8GA1UdIwQY\nMBaAFLI24M3s4ViBTJbTf1lWAEsUzehVMIIBDQYDVR0fBIIBBDCCAQAwgf2ggfqg\ngfeGgb9sZGFwOi8vL0NOPUFNRVItU1NMQ0EtMDIsQ049QU1FUi1TU0xDQS0wMixD\nTj1DRFAsQ049UHVibGljJTIwS2V5JTIwU2VydmljZXMsQ049U2VydmljZXMsQ049\nQ29uZmlndXJhdGlvbixEQz1jb3JwLERDPWViYXksREM9Y29tP2NlcnRpZmljYXRl\nUmV2b2NhdGlvbkxpc3Q/YmFzZT9vYmplY3RDbGFzcz1jUkxEaXN0cmlidXRpb25Q\nb2ludIYzaHR0cDovL3BraS5jb3JwLmViYXkuY29tL0NlcnREYXRhL0FNRVItU1NM\nQ0EtMDIuY3JsMIIBTgYIKwYBBQUHAQEEggFAMIIBPDCBsQYIKwYBBQUHMAKGgaRs\nZGFwOi8vL0NOPUFNRVItU1NMQ0EtMDIsQ049QUlBLENOPVB1YmxpYyUyMEtleSUy\nMFNlcnZpY2VzLENOPVNlcnZpY2VzLENOPUNvbmZpZ3VyYXRpb24sREM9Y29ycCxE\nQz1lYmF5LERDPWNvbT9jQUNlcnRpZmljYXRlP2Jhc2U/b2JqZWN0Q2xhc3M9Y2Vy\ndGlmaWNhdGlvbkF1dGhvcml0eTBbBggrBgEFBQcwAoZPaHR0cDovL3BraS5jb3Jw\nLmViYXkuY29tL0NlcnREYXRhL0FNRVItU1NMQ0EtMDIuY29ycC5lYmF5LmNvbV9B\nTUVSLVNTTENBLTAyLmNydDApBggrBgEFBQcwAYYdaHR0cDovL3BraS5jb3JwLmVi\nYXkuY29tL29jc3AwIQYJKwYBBAGCNxQCBBQeEgBXAGUAYgBTAGUAcgB2AGUAcjAL\nBgNVHQ8EBAMCBaAwEwYDVR0lBAwwCgYIKwYBBQUHAwEwDQYJKoZIhvcNAQEFBQAD\nggEBAFj5s9SdtRpXLz03BjPFsDvQPzoyML9ngHL5zyYMlotUpD7d+aO41Q2E2+LO\nREfbd3NAnLT3MfWMHAxNaZ4TRUog1fFJmLJxHTBax5fpmY8YAhiPjQIO+IZOUZO3\n4lAwXKsq4ylWS2tlbxL56mPngN2EzLisWgIZqJSx9zd1K/LvKyvs/R3wxBerhTN5\nLyHFf9/ByUhaqgIE8jydM4qiS8o3zxjrPAIbi6lnZjktkguYTSAKDoHb17BkNoPr\nmU1xDtD1/FuX22dfHpqmJSYVubPVfUTvGB3julT2GNNREoHsQI7wmgFBEMaTdvJq\n42DUnHIK0pdMzb2urxL/toZ3mHY=\n-----END CERTIFICATE-----\n\nTraceback (most recent call last):\n File \"goals.py\", line 3, in <module>\n J = api.Jenkins('https://fusion.[REDACTED].com/jenkins/')\n File \"C:\\python27\\lib\\site-packages\\jenkinsapi\\jenkins.py\", line 35, in **init**\n JenkinsBase.**init**(self, baseurl)\n File \"C:\\python27\\lib\\site-packages\\jenkinsapi\\jenkinsbase.py\", line 27, in **init**\n self.poll()\n File \"C:\\python27\\lib\\site-packages\\jenkinsapi\\jenkinsbase.py\", line 49, in poll\n self._data = self._poll()\n File \"C:\\python27\\lib\\site-packages\\jenkinsapi\\jenkinsbase.py\", line 53, in _poll\n return self.get_data(url)\n File \"C:\\python27\\lib\\site-packages\\jenkinsapi\\jenkinsbase.py\", line 57, in get_data\n response = requester.get_url(url)\n File \"C:\\python27\\lib\\site-packages\\jenkinsapi\\utils\\requester.py\", line 59, in get_url\n return requests.get(url, *_requestKwargs)\n File \"C:\\python27\\lib\\site-packages\\requests\\api.py\", line 55, in get\n return request('get', url, *_kwargs)\n File \"C:\\python27\\lib\\site-packages\\requests\\api.py\", line 44, in request\n return session.request(method=method, url=url, *_kwargs)\n File \"C:\\python27\\lib\\site-packages\\requests\\sessions.py\", line 335, in request\n resp = self.send(prep, *_send_kwargs)\n File \"C:\\python27\\lib\\site-packages\\requests\\sessions.py\", line 438, in send\n r = adapter.send(request, **kwargs)\n File \"C:\\python27\\lib\\site-packages\\requests\\adapters.py\", line 331, in send\n raise SSLError(e)\nrequests.exceptions.SSLError: [Errno 1] _ssl.c:504: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed\n", "Could you try to connect using requests directly, without going through jenkinsapi but while passing the certificate you safes to requests.\n", "r=requests.get(url,verify=certfile)\n\nSSLError: [Errno 1] _ssl.c:504: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed\n\nr=requests.get(url,cert=certfile)\n\nSSLError: [Errno 336265225] _ssl.c:351: error:140B0009:SSL routines:SSL_CTX_use_PrivateKey_file:PEM lib\n\nDoes that mean I'm supposed to have the private key? I doubt the server owners will let me have it.\n", "Sorry, ignore the second part - I figured out specifying \"cert\" is about authenticating yourself to the server which is not the issue here.\n", "Now we know the problem lies with the cert :-)\nGiven the cert is from the CA and not the server itself: Is the chain of thrust complete?\nYou should see this chain in your browser where you exported the cert.\nTo verifiy a certificate requests needs a complete chain. The last element is sent by the server, I assume you only saved the root certificate to a file.\nYou still need all the certificates between the root and the leaf. Those can either be sent by the server alongside the leaf cert, or you should be able to add them to the certificate file.\n", "Thanks - I finally got it working! To summarize, in case this is helpful to someone else: I needed to export every cert in the chain from the server itself to the root, saving each one in base64 format, then copy all the certs into a single file, and set the environment variable REQUESTS_CA_BUNDLE to point to it.\n\nThanks again for your help!\n", "For other Googlers - you can disable SSL verification in jenkinsapi using:\n\n``` python\nfrom jenkinsapi.jenkins import Jenkins\nfrom jenkinsapi.utils.requester import Requester\n\nj = Jenkins(base_url, requester=Requester(username, password, baseurl=base_url, ssl_verify=False))\n```\n", "I encountered the same issue and ssl certifacate verify failed issue, by review boto3 code, I found the REQUESTS_CA_BUNDLE is not set, so I fixed the both issue by setting it manually:\n\n```\nfrom boto3.session import Session\nimport os\n\n# debian\nos.environ['REQUESTS_CA_BUNDLE'] = os.path.join(\n '/etc/ssl/certs/',\n 'ca-certificates.crt')\n# centos\n# 'ca-bundle.crt')\n```\n\nFor aws-cli, I guess setting REQUESTS_CA_BUNDLE in ~/.bashrc will fix this issue (not tested because my aws-cli works without it)\n\n```\nREQUESTS_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt # ca-bundle.crt\nexport REQUESTS_CA_BUNDLE\n```\n" ]
https://api.github.com/repos/psf/requests/issues/1490
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1490/labels{/name}
https://api.github.com/repos/psf/requests/issues/1490/comments
https://api.github.com/repos/psf/requests/issues/1490/events
https://github.com/psf/requests/pull/1490
17,153,533
MDExOlB1bGxSZXF1ZXN0NzEzNTUyNw==
1,490
Better cookie docs on sessions.
{ "avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4", "events_url": "https://api.github.com/users/Lukasa/events{/privacy}", "followers_url": "https://api.github.com/users/Lukasa/followers", "following_url": "https://api.github.com/users/Lukasa/following{/other_user}", "gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Lukasa", "id": 1382556, "login": "Lukasa", "node_id": "MDQ6VXNlcjEzODI1NTY=", "organizations_url": "https://api.github.com/users/Lukasa/orgs", "received_events_url": "https://api.github.com/users/Lukasa/received_events", "repos_url": "https://api.github.com/users/Lukasa/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Lukasa/starred{/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" } ]
closed
true
null
[]
null
3
2013-07-24T12:26:49Z
2021-09-08T22:01:21Z
2013-07-24T13:12:10Z
MEMBER
resolved
Suggested as part of #1488.
{ "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/1490/reactions" }
https://api.github.com/repos/psf/requests/issues/1490/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/1490.diff", "html_url": "https://github.com/psf/requests/pull/1490", "merged_at": "2013-07-24T13:12:10Z", "patch_url": "https://github.com/psf/requests/pull/1490.patch", "url": "https://api.github.com/repos/psf/requests/pulls/1490" }
true
[ ":cookie:\n", "Boo. I was going to suggest improvements. I guess I'll just have to submit my own PR for it. :(\n", "Or you can suggest them and I'll write them up, if you don't feel like you have time. =)\n" ]
https://api.github.com/repos/psf/requests/issues/1489
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1489/labels{/name}
https://api.github.com/repos/psf/requests/issues/1489/comments
https://api.github.com/repos/psf/requests/issues/1489/events
https://github.com/psf/requests/pull/1489
17,150,268
MDExOlB1bGxSZXF1ZXN0NzEzMzY1Mg==
1,489
Session CookieJar
{ "avatar_url": "https://avatars.githubusercontent.com/u/684832?v=4", "events_url": "https://api.github.com/users/kefir-/events{/privacy}", "followers_url": "https://api.github.com/users/kefir-/followers", "following_url": "https://api.github.com/users/kefir-/following{/other_user}", "gists_url": "https://api.github.com/users/kefir-/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kefir-", "id": 684832, "login": "kefir-", "node_id": "MDQ6VXNlcjY4NDgzMg==", "organizations_url": "https://api.github.com/users/kefir-/orgs", "received_events_url": "https://api.github.com/users/kefir-/received_events", "repos_url": "https://api.github.com/users/kefir-/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kefir-/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kefir-/subscriptions", "type": "User", "url": "https://api.github.com/users/kefir-", "user_view_type": "public" }
[ { "color": "fbca04", "default": false, "description": null, "id": 44501249, "name": "Needs BDFL Input", "node_id": "MDU6TGFiZWw0NDUwMTI0OQ==", "url": "https://api.github.com/repos/psf/requests/labels/Needs%20BDFL%20Input" }, { "color": "e11d21", "default": false, "description": null, "id": 44501305, "name": "Not Ready To Merge", "node_id": "MDU6TGFiZWw0NDUwMTMwNQ==", "url": "https://api.github.com/repos/psf/requests/labels/Not%20Ready%20To%20Merge" } ]
closed
true
null
[]
null
2
2013-07-24T10:53:20Z
2021-09-08T21:01:04Z
2013-07-24T12:07:57Z
NONE
resolved
Suggested solution for #1488 Allows for code such as: ``` python #!/usr/bin/env python import requests import cookielib c = cookielib.LWPCookieJar(filename="test.cookies") s = requests.Session(cookiejar=c) r = s.get("http://www.reprap.no/") c.save() ```
{ "avatar_url": "https://avatars.githubusercontent.com/u/684832?v=4", "events_url": "https://api.github.com/users/kefir-/events{/privacy}", "followers_url": "https://api.github.com/users/kefir-/followers", "following_url": "https://api.github.com/users/kefir-/following{/other_user}", "gists_url": "https://api.github.com/users/kefir-/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kefir-", "id": 684832, "login": "kefir-", "node_id": "MDQ6VXNlcjY4NDgzMg==", "organizations_url": "https://api.github.com/users/kefir-/orgs", "received_events_url": "https://api.github.com/users/kefir-/received_events", "repos_url": "https://api.github.com/users/kefir-/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kefir-/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kefir-/subscriptions", "type": "User", "url": "https://api.github.com/users/kefir-", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/1489/reactions" }
https://api.github.com/repos/psf/requests/issues/1489/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/1489.diff", "html_url": "https://github.com/psf/requests/pull/1489", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/1489.patch", "url": "https://api.github.com/repos/psf/requests/pulls/1489" }
true
[ "Hi @kefir-, thanks for the Pull Request!\n\nUnfortunately, I don't think this will be accepted. As mentioned in #1488, you can set the `Session.cookies` parameter to an arbitrary cookiejar without difficulty. That is the expected way to use a different CookieJar type.\n", "Thanks for the details.\n" ]
https://api.github.com/repos/psf/requests/issues/1488
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1488/labels{/name}
https://api.github.com/repos/psf/requests/issues/1488/comments
https://api.github.com/repos/psf/requests/issues/1488/events
https://github.com/psf/requests/issues/1488
17,144,651
MDU6SXNzdWUxNzE0NDY1MQ==
1,488
Save cookiejar to file
{ "avatar_url": "https://avatars.githubusercontent.com/u/684832?v=4", "events_url": "https://api.github.com/users/kefir-/events{/privacy}", "followers_url": "https://api.github.com/users/kefir-/followers", "following_url": "https://api.github.com/users/kefir-/following{/other_user}", "gists_url": "https://api.github.com/users/kefir-/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kefir-", "id": 684832, "login": "kefir-", "node_id": "MDQ6VXNlcjY4NDgzMg==", "organizations_url": "https://api.github.com/users/kefir-/orgs", "received_events_url": "https://api.github.com/users/kefir-/received_events", "repos_url": "https://api.github.com/users/kefir-/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kefir-/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kefir-/subscriptions", "type": "User", "url": "https://api.github.com/users/kefir-", "user_view_type": "public" }
[]
closed
true
null
[]
null
5
2013-07-24T08:22:00Z
2021-09-09T02:11:49Z
2013-07-24T15:04:48Z
NONE
resolved
Hi, requests uses a RequestsCookieJar object internally, which is the object type returned from cookiejar_from_dict(). Am I missing a way to specify a different type of CookieJar object? I want to save cookies back to file after an HTTP session as done by LWPCookieJar. The way I've done this so far is to traverse s.cookies and add the cookies manually to my LWPCookieJar, as shown in the following code. I think it would be nicer if I could tell Session() what type of CookieJar to use, so that I could save directly afterwards. ``` python import requests import cookielib s = requests.Session() r = s.get("http://www.reprap.no/") jar = cookielib.LWPCookieJar(filename="test.cookies") for c in s.cookies: jar.set_cookie(c) jar.save() ``` Something like this looks like it should work with fewer lines of code, but I'm not sure this is the best approach in case something were to change in future versions: ``` python s = requests.Session() s.cookies = cookielib.LWPCookieJar(filename="test.cookies") r = s.get("http://www.reprap.no/") s.cookies.save() ```
{ "avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4", "events_url": "https://api.github.com/users/Lukasa/events{/privacy}", "followers_url": "https://api.github.com/users/Lukasa/followers", "following_url": "https://api.github.com/users/Lukasa/following{/other_user}", "gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Lukasa", "id": 1382556, "login": "Lukasa", "node_id": "MDQ6VXNlcjEzODI1NTY=", "organizations_url": "https://api.github.com/users/Lukasa/orgs", "received_events_url": "https://api.github.com/users/Lukasa/received_events", "repos_url": "https://api.github.com/users/Lukasa/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Lukasa/starred{/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/1488/reactions" }
https://api.github.com/repos/psf/requests/issues/1488/timeline
null
completed
null
null
false
[ "This already works. Seriously, try your example in the second line of code, it works fine.\n", "I was a little unclear on what you mean by \"second line of code\", but from your comment on my pull request I think you mean the second and shorter way to do this. Doing it that way works fine, like you say, so I'm happy to close this issue and my pull request.\n\n``` python\ns = requests.Session()\ns.cookies = cookielib.LWPCookieJar(filename=\"test.cookies\")\n```\n", "By the way, `Session().cookies` could perhaps be mentioned here in case someone else is looking for the same in the future:\n\nhttp://www.python-requests.org/en/latest/api/#request-sessions\n", "That's a good idea, I'll fix that up. =)\n", "Changes made in #1490. Thanks so much for raising this issue! :cookie: \n" ]
https://api.github.com/repos/psf/requests/issues/1487
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1487/labels{/name}
https://api.github.com/repos/psf/requests/issues/1487/comments
https://api.github.com/repos/psf/requests/issues/1487/events
https://github.com/psf/requests/pull/1487
17,143,504
MDExOlB1bGxSZXF1ZXN0NzEzMDA5Mg==
1,487
Rewrite test cases to remove dependency on httpbin.org and example.com
{ "avatar_url": "https://avatars.githubusercontent.com/u/836426?v=4", "events_url": "https://api.github.com/users/dpursehouse/events{/privacy}", "followers_url": "https://api.github.com/users/dpursehouse/followers", "following_url": "https://api.github.com/users/dpursehouse/following{/other_user}", "gists_url": "https://api.github.com/users/dpursehouse/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/dpursehouse", "id": 836426, "login": "dpursehouse", "node_id": "MDQ6VXNlcjgzNjQyNg==", "organizations_url": "https://api.github.com/users/dpursehouse/orgs", "received_events_url": "https://api.github.com/users/dpursehouse/received_events", "repos_url": "https://api.github.com/users/dpursehouse/repos", "site_admin": false, "starred_url": "https://api.github.com/users/dpursehouse/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/dpursehouse/subscriptions", "type": "User", "url": "https://api.github.com/users/dpursehouse", "user_view_type": "public" }
[ { "color": "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" } ]
closed
true
null
[]
null
10
2013-07-24T07:44:41Z
2021-09-08T23:05:15Z
2013-08-01T01:23:35Z
CONTRIBUTOR
resolved
Partial solution to #1485 Only fixes the uses of httpbin.org; there are still a couple of test cases referencing example.com I'm not sure if this solution is too much of a hack...
{ "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/1487/reactions" }
https://api.github.com/repos/psf/requests/issues/1487/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/1487.diff", "html_url": "https://github.com/psf/requests/pull/1487", "merged_at": "2013-08-01T01:23:35Z", "patch_url": "https://github.com/psf/requests/pull/1487.patch", "url": "https://api.github.com/repos/psf/requests/pulls/1487" }
true
[ "I don't think this is a hack at all, I think this is an excellent refactor/improvement of this test. =) +1 \n", "Cool :)\n\nThen I'll try to do the same kind of thing for the remaining ones that are hard-coded.\n", "It's worth noting that the title of this PR is misleading, though: this is not a solution to running offline. =)\n", "Offline is probably the wrong word. My intention is to make it possible to run the tests without having to connect to an external site.\n", "Title updated :)\n", "I don't think `test_uppercase_scheme` is redundant, it exercises some top-level code that a redirect doesn't.\n", "It's redundant because the upper case HTTP is tested in the mixed case\nscheme test that I refactored in one of the previous commits.\n\nIt's not related to the redirect test case fix.\n", "Ah, yes, you're quite right. =)\n", "OK, so with this series of commits it's possible to run the tests completely against a locally running httpbin server.\n", "Yes. It does. Thank you @dpursehouse \n" ]
https://api.github.com/repos/psf/requests/issues/1486
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1486/labels{/name}
https://api.github.com/repos/psf/requests/issues/1486/comments
https://api.github.com/repos/psf/requests/issues/1486/events
https://github.com/psf/requests/pull/1486
17,107,426
MDExOlB1bGxSZXF1ZXN0NzExMDIyMQ==
1,486
Use urlparse.urljointo construct httpbin url
{ "avatar_url": "https://avatars.githubusercontent.com/u/240830?v=4", "events_url": "https://api.github.com/users/sigmavirus24/events{/privacy}", "followers_url": "https://api.github.com/users/sigmavirus24/followers", "following_url": "https://api.github.com/users/sigmavirus24/following{/other_user}", "gists_url": "https://api.github.com/users/sigmavirus24/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/sigmavirus24", "id": 240830, "login": "sigmavirus24", "node_id": "MDQ6VXNlcjI0MDgzMA==", "organizations_url": "https://api.github.com/users/sigmavirus24/orgs", "received_events_url": "https://api.github.com/users/sigmavirus24/received_events", "repos_url": "https://api.github.com/users/sigmavirus24/repos", "site_admin": false, "starred_url": "https://api.github.com/users/sigmavirus24/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/sigmavirus24/subscriptions", "type": "User", "url": "https://api.github.com/users/sigmavirus24", "user_view_type": "public" }
[]
closed
true
null
[]
null
6
2013-07-23T15:27:56Z
2021-09-08T21:01:03Z
2013-07-23T16:03:05Z
CONTRIBUTOR
resolved
Just a slightly more reliable way of joining the url parts.
{ "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/1486/reactions" }
https://api.github.com/repos/psf/requests/issues/1486/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/1486.diff", "html_url": "https://github.com/psf/requests/pull/1486", "merged_at": "2013-07-23T16:03:05Z", "patch_url": "https://github.com/psf/requests/pull/1486.patch", "url": "https://api.github.com/repos/psf/requests/pulls/1486" }
true
[ "This won't work in Py3. =) Probably worth grabbing this out of the `compat` file. =)\n", "sigh :)\n", "Fixed.=P\n", "I might make a single-use website: http://www.willitworkonpython2and3.com/\n\nIts markup:\n\n``` html\n<html>\n<body>\n <h1>NO</h1>\n</body>\n</html>\n```\n", "@Lukasa love it :)\n", ":+1:\n" ]
https://api.github.com/repos/psf/requests/issues/1485
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1485/labels{/name}
https://api.github.com/repos/psf/requests/issues/1485/comments
https://api.github.com/repos/psf/requests/issues/1485/events
https://github.com/psf/requests/issues/1485
17,089,533
MDU6SXNzdWUxNzA4OTUzMw==
1,485
Not possible to use local httpbin server for all unit tests
{ "avatar_url": "https://avatars.githubusercontent.com/u/836426?v=4", "events_url": "https://api.github.com/users/dpursehouse/events{/privacy}", "followers_url": "https://api.github.com/users/dpursehouse/followers", "following_url": "https://api.github.com/users/dpursehouse/following{/other_user}", "gists_url": "https://api.github.com/users/dpursehouse/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/dpursehouse", "id": 836426, "login": "dpursehouse", "node_id": "MDQ6VXNlcjgzNjQyNg==", "organizations_url": "https://api.github.com/users/dpursehouse/orgs", "received_events_url": "https://api.github.com/users/dpursehouse/received_events", "repos_url": "https://api.github.com/users/dpursehouse/repos", "site_admin": false, "starred_url": "https://api.github.com/users/dpursehouse/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/dpursehouse/subscriptions", "type": "User", "url": "https://api.github.com/users/dpursehouse", "user_view_type": "public" }
[]
closed
true
null
[]
null
6
2013-07-23T08:39:04Z
2021-09-09T02:11:45Z
2013-08-03T06:30:17Z
CONTRIBUTOR
resolved
The test script allows to define `HTTPBIN_URL` in the environment to specify a locally running instance of httpbin to be used for testing. However there is one test case (`test_mixed_case_scheme_acceptable`) where the url is hard-coded to httpbin.org, and two test cases (`test_uppercase_scheme` and `test_uppercase_scheme_redirect`) where the url is hard-coded to example.com. This prevents testing of the Requests modules while behind a proxy that blocks outgoing requests (in my case specifically the https requests) or on a system without external internet connectivity (such as an internal CI system).
{ "avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4", "events_url": "https://api.github.com/users/Lukasa/events{/privacy}", "followers_url": "https://api.github.com/users/Lukasa/followers", "following_url": "https://api.github.com/users/Lukasa/following{/other_user}", "gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Lukasa", "id": 1382556, "login": "Lukasa", "node_id": "MDQ6VXNlcjEzODI1NTY=", "organizations_url": "https://api.github.com/users/Lukasa/orgs", "received_events_url": "https://api.github.com/users/Lukasa/received_events", "repos_url": "https://api.github.com/users/Lukasa/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Lukasa/starred{/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/1485/reactions" }
https://api.github.com/repos/psf/requests/issues/1485/timeline
null
completed
null
null
false
[ "See issue #1166\n", "I'm not sure how fast #1166 is progressing. It's tentatively earmarked for 2.0, but it might not make it.\n", "Sorry, I hadn't seen #1166 \nMy bad.\n\nAs far as I can see, fixing this one unit test should at least make it possible to use the current test suite offline.\n", "No worries. =) I'm not sure this fits our definition of 'offline' though: having to download and run httpbin is a bit of a hassle.\n", "> having to download and run httpbin is a bit of a hassle.\n\nSpecially when you're behind a proxy that doesn't like `pip` and you have to manually download and run setup.py for each of its dependencies, and their dependencies :(\n", "> Sorry, I hadn't seen #1166 \n\nNo need to be sorry. I'm trying to develop a solution for #1166 right now. If it comes down to the point where I don't have it ready for 2.0 I'm just going to use mock (which is in the standard library now as of Python 3.3) to make everything work offline. This would make a lot of things a bit easier.\n" ]
https://api.github.com/repos/psf/requests/issues/1484
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1484/labels{/name}
https://api.github.com/repos/psf/requests/issues/1484/comments
https://api.github.com/repos/psf/requests/issues/1484/events
https://github.com/psf/requests/pull/1484
17,088,356
MDExOlB1bGxSZXF1ZXN0NzA5OTgxMQ==
1,484
Add Eclipse and PyDev files to .gitignore
{ "avatar_url": "https://avatars.githubusercontent.com/u/836426?v=4", "events_url": "https://api.github.com/users/dpursehouse/events{/privacy}", "followers_url": "https://api.github.com/users/dpursehouse/followers", "following_url": "https://api.github.com/users/dpursehouse/following{/other_user}", "gists_url": "https://api.github.com/users/dpursehouse/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/dpursehouse", "id": 836426, "login": "dpursehouse", "node_id": "MDQ6VXNlcjgzNjQyNg==", "organizations_url": "https://api.github.com/users/dpursehouse/orgs", "received_events_url": "https://api.github.com/users/dpursehouse/received_events", "repos_url": "https://api.github.com/users/dpursehouse/repos", "site_admin": false, "starred_url": "https://api.github.com/users/dpursehouse/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/dpursehouse/subscriptions", "type": "User", "url": "https://api.github.com/users/dpursehouse", "user_view_type": "public" }
[ { "color": "fbca04", "default": false, "description": null, "id": 44501249, "name": "Needs BDFL Input", "node_id": "MDU6TGFiZWw0NDUwMTI0OQ==", "url": "https://api.github.com/repos/psf/requests/labels/Needs%20BDFL%20Input" } ]
closed
true
null
[]
null
4
2013-07-23T08:02:27Z
2021-09-08T21:01:03Z
2013-07-23T12:21:30Z
CONTRIBUTOR
resolved
{ "avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4", "events_url": "https://api.github.com/users/Lukasa/events{/privacy}", "followers_url": "https://api.github.com/users/Lukasa/followers", "following_url": "https://api.github.com/users/Lukasa/following{/other_user}", "gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Lukasa", "id": 1382556, "login": "Lukasa", "node_id": "MDQ6VXNlcjEzODI1NTY=", "organizations_url": "https://api.github.com/users/Lukasa/orgs", "received_events_url": "https://api.github.com/users/Lukasa/received_events", "repos_url": "https://api.github.com/users/Lukasa/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions", "type": "User", "url": "https://api.github.com/users/Lukasa", "user_view_type": "public" }
{ "+1": 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/1484/reactions" }
https://api.github.com/repos/psf/requests/issues/1484/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/1484.diff", "html_url": "https://github.com/psf/requests/pull/1484", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/1484.patch", "url": "https://api.github.com/repos/psf/requests/pulls/1484" }
true
[ "These files are specific to your environment and should not be in project's gitignore but in your global gitignore file.\n", "They are not in my global .gitignore file because I work on some projects where they are actually needed to be kept under version control.\n", "I'm not for merging this at all.\n", "Yeah, I think rather than do this you should put these settings into your project's `.git/info/exclude` file, which acts like a non-tracked `.gitignore` file.\n" ]
https://api.github.com/repos/psf/requests/issues/1483
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1483/labels{/name}
https://api.github.com/repos/psf/requests/issues/1483/comments
https://api.github.com/repos/psf/requests/issues/1483/events
https://github.com/psf/requests/pull/1483
17,085,522
MDExOlB1bGxSZXF1ZXN0NzA5ODMyMA==
1,483
Test cases fail when `HTTPBIN_URL` does not have trailing slash
{ "avatar_url": "https://avatars.githubusercontent.com/u/836426?v=4", "events_url": "https://api.github.com/users/dpursehouse/events{/privacy}", "followers_url": "https://api.github.com/users/dpursehouse/followers", "following_url": "https://api.github.com/users/dpursehouse/following{/other_user}", "gists_url": "https://api.github.com/users/dpursehouse/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/dpursehouse", "id": 836426, "login": "dpursehouse", "node_id": "MDQ6VXNlcjgzNjQyNg==", "organizations_url": "https://api.github.com/users/dpursehouse/orgs", "received_events_url": "https://api.github.com/users/dpursehouse/received_events", "repos_url": "https://api.github.com/users/dpursehouse/repos", "site_admin": false, "starred_url": "https://api.github.com/users/dpursehouse/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/dpursehouse/subscriptions", "type": "User", "url": "https://api.github.com/users/dpursehouse", "user_view_type": "public" }
[ { "color": "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" } ]
closed
true
null
[]
null
4
2013-07-23T06:18:03Z
2021-09-08T11:00:52Z
2013-07-23T12:23:11Z
CONTRIBUTOR
resolved
Test cases can be run against a local httpbin server defined by the `HTTPBIN_URL` environment variable, but it causes tests to fail if the given URL does not end with a slash. Ensure that the URL always ends with a slash.
{ "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/1483/reactions" }
https://api.github.com/repos/psf/requests/issues/1483/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/1483.diff", "html_url": "https://github.com/psf/requests/pull/1483", "merged_at": "2013-07-23T12:23:11Z", "patch_url": "https://github.com/psf/requests/pull/1483.patch", "url": "https://api.github.com/repos/psf/requests/pulls/1483" }
true
[ "Do you mind putting a comment here just saying why this is being done, so we don't forget down the line?\n", "No prob. I just amended the commit to include a comment.\n", "Cool, I'm +1 on this. Ready to merge. =D\n", "There's a cleaner solution to this using a urllib function but I'm not sure of the name at the moment.\n" ]
https://api.github.com/repos/psf/requests/issues/1482
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1482/labels{/name}
https://api.github.com/repos/psf/requests/issues/1482/comments
https://api.github.com/repos/psf/requests/issues/1482/events
https://github.com/psf/requests/pull/1482
17,080,461
MDExOlB1bGxSZXF1ZXN0NzA5NTgyNg==
1,482
Fix test cases that fail when running behind a proxy
{ "avatar_url": "https://avatars.githubusercontent.com/u/836426?v=4", "events_url": "https://api.github.com/users/dpursehouse/events{/privacy}", "followers_url": "https://api.github.com/users/dpursehouse/followers", "following_url": "https://api.github.com/users/dpursehouse/following{/other_user}", "gists_url": "https://api.github.com/users/dpursehouse/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/dpursehouse", "id": 836426, "login": "dpursehouse", "node_id": "MDQ6VXNlcjgzNjQyNg==", "organizations_url": "https://api.github.com/users/dpursehouse/orgs", "received_events_url": "https://api.github.com/users/dpursehouse/received_events", "repos_url": "https://api.github.com/users/dpursehouse/repos", "site_admin": false, "starred_url": "https://api.github.com/users/dpursehouse/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/dpursehouse/subscriptions", "type": "User", "url": "https://api.github.com/users/dpursehouse", "user_view_type": "public" }
[ { "color": "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" } ]
closed
true
null
[]
null
5
2013-07-23T01:56:03Z
2021-09-08T21:01:03Z
2013-07-23T12:23:35Z
CONTRIBUTOR
resolved
When sending a request via `Session.send()` the proxies must be explicitly given with the `proxies` argument. This is not done in the test cases, which means that they fail when run on a system that is behind a proxy. Add the `proxies` argument in the calls to `Session.send()` in test cases.
{ "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/1482/reactions" }
https://api.github.com/repos/psf/requests/issues/1482/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/1482.diff", "html_url": "https://github.com/psf/requests/pull/1482", "merged_at": "2013-07-23T12:23:35Z", "patch_url": "https://github.com/psf/requests/pull/1482.patch", "url": "https://api.github.com/repos/psf/requests/pulls/1482" }
true
[ "Rather than use this on each call to `Session.send()`, can you set `Session.proxies` at the top of the routine?\n", "Do you mean in `test_mixed_case_scheme_acceptable`?\n\nIt wouldn't reduce the diff because a new Session object is created before each call to send().\n\nSo instead of several blocks like:\n\n```\ns = requests.Session()\nr = requests.Request('GET', 'http://httpbin.org/get')\nr = s.send(r.prepare(), proxies=proxies)\nself.assertEqual(r.status_code,200)\n```\n\nWe end up with several blocks like:\n\n```\ns = requests.Session()\ns.proxies = proxies\nr = requests.Request('GET', 'http://httpbin.org/get')\nr = s.send(r.prepare())\nself.assertEqual(r.status_code,200)\n```\n", "A new session is only created the first two times. =)\n", "OK. I've amended the commit to make it set the proxies with `s.proxies = getproxies()`\n", "Cool, I'm +1 on this. =) Thanks so much!\n" ]
https://api.github.com/repos/psf/requests/issues/1481
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1481/labels{/name}
https://api.github.com/repos/psf/requests/issues/1481/comments
https://api.github.com/repos/psf/requests/issues/1481/events
https://github.com/psf/requests/issues/1481
17,075,802
MDU6SXNzdWUxNzA3NTgwMg==
1,481
zlib Error -2 while decompressing in 1.2.3
{ "avatar_url": "https://avatars.githubusercontent.com/u/119481?v=4", "events_url": "https://api.github.com/users/skestle/events{/privacy}", "followers_url": "https://api.github.com/users/skestle/followers", "following_url": "https://api.github.com/users/skestle/following{/other_user}", "gists_url": "https://api.github.com/users/skestle/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/skestle", "id": 119481, "login": "skestle", "node_id": "MDQ6VXNlcjExOTQ4MQ==", "organizations_url": "https://api.github.com/users/skestle/orgs", "received_events_url": "https://api.github.com/users/skestle/received_events", "repos_url": "https://api.github.com/users/skestle/repos", "site_admin": false, "starred_url": "https://api.github.com/users/skestle/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/skestle/subscriptions", "type": "User", "url": "https://api.github.com/users/skestle", "user_view_type": "public" }
[]
closed
true
null
[]
null
9
2013-07-22T23:05:45Z
2021-09-08T23:06:12Z
2013-07-23T15:15:48Z
NONE
resolved
When using requests 1.2.3, I get zlib errors using easywebdav and requests. If I install 1.1.0 instead, it works fine. File "./export-setup-pages.py", line 84, in <module> downloadFolder(wikiWebDav, os.path.join(outputFolder, localPath)) File "./export-setup-pages.py", line 30, in downloadFolder download(webDav, resource, localPath, path) File "./export-setup-pages.py", line 41, in download webDav.download(remoteFile, localFile) File "./python-env/local/lib/python2.7/site-packages/easywebdav/client.py", line 127, in download shutil.copyfileobj(response.raw, f) File "/usr/lib/python2.7/shutil.py", line 49, in copyfileobj buf = fsrc.read(length) File "/media/speedy/development/projects/Other/OrionIT/scripts/woki/python-env/local/lib/python2.7/site-packages/requests/packages/urllib3/response.py", line 191, in read buf = self._decoder.decompress(binary_type()) zlib.error: Error -2 while decompressing: inconsistent stream state Is this a known issue? I can't find anything on the interwebs. For background, I'm trying to download from confluence through an nginx proxy (I think)
{ "avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4", "events_url": "https://api.github.com/users/Lukasa/events{/privacy}", "followers_url": "https://api.github.com/users/Lukasa/followers", "following_url": "https://api.github.com/users/Lukasa/following{/other_user}", "gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Lukasa", "id": 1382556, "login": "Lukasa", "node_id": "MDQ6VXNlcjEzODI1NTY=", "organizations_url": "https://api.github.com/users/Lukasa/orgs", "received_events_url": "https://api.github.com/users/Lukasa/received_events", "repos_url": "https://api.github.com/users/Lukasa/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Lukasa/starred{/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/1481/reactions" }
https://api.github.com/repos/psf/requests/issues/1481/timeline
null
completed
null
null
false
[ "So at some point between V1.1.0 and v1.2.3, urllib3 updated its decompression routines to use `zlib`. This has seemed to introduce some problem with gzip, though it's very unclear what that problem is at this stage. I believe this issue to be the same as #1472.\n\nThere is currently a urllib3 issue tracking this (shazow/urllib3#206), so I recommend you pop over to that and see if you can help them out there. =)\n", "I don't think its the same issue as shazow/urllib3#206.\nThe problem is rather, that the decoder is exhaustet by requests itself to populate `Response.content` and when trying to read from the raw urllib3 response you one hits the same decoder requests already has used, which now has no content left.\n\nMinimal example (modeled after the provided stacktrace):\n\n``` py\nimport requests\nimport shutil\nimport StringIO\n\ns = StringIO.StringIO()\nr = requests.get('http://httpbin.org/gzip')\nshutil.copyfileobj(r.raw, s)\n```\n", "On the other hand: According to the comment `models.py` you are only allowed to access `Response.raw` if the request was made with `stream=True`. And indeed, it works then. I will check easywebdav and take a look how requests are made.\n", "Yep. The problem is easywebdav not setting `stream=True`.\nI don't know if this should be treated as a regression, as the comment doesn't allow the usage of `Response.raw` without this parameter.\nSomeone with authority should decide this.\n", "Thanks so much for doing the detective work @t-8ch! The interface is very clear, you cannot use `Response.raw` unless `stream=True`, and that has been the case for a very long time. The `stream` parameter was introduced in 1.0.0 and the note you're referencing was also added in the same release.\n\nWith such a note in place, Requests was within its rights to do whatever it wants to the `raw` parameter when `stream` isn't set to `True`. I recommend opening a PR on easywebdav to fix this problem.\n\nThanks for raising this issue @skestle, and thanks so much for your investigation @t-8ch! :star2: :cake: :star2:\n", "Found a way to reproduce this:\n\n``` python\n>>> r = requests.get('http://httpbin.org/gzip', stream=True)\n>>> _ = r.raw.read(10000, decode_content=True); print len(_)\n382\n>>> _ = r.raw.read(10000, decode_content=True); print len(_)\n0\n>>> _ = r.raw.read(10000, decode_content=True); print len(_)\nTraceback (most recent call last):\n File \"<console>\", line 1, in <module>\n File \"/Users/bryanhelmig/.virtualenvs/zapier/lib/python2.7/site-packages/requests/packages/urllib3/response.py\", line 224, in read\n \"failed to decode it.\" % content_encoding, e)\nDecodeError: ('Received response with content-encoding: gzip, but failed to decode it.', error('Error -2 while decompressing: inconsistent stream state',))\n```\n\nFor anyone Googling this. Dunno if it is a bug? But if the server is not delivering gzip - you can read from the socket all day long with no stream errors.\n", "@bryanhelmig your problem here is entirely unrelated to the bug originally reported. The original report is about consuming from requests' API first and then consuming from the raw attribute. This seems different to me even thought the message from the gzip library is the same\n", "Oops, indeed it is. I've been Googling around a bit - forgive me for the random comment. If nothing else someone might be able springboard off from the same error message. Apologies!\n", "## No worries. I think I might toy with your code though. I'm curious why that's happening \n\nSent from my Android device with K-9 Mail. Please excuse my brevity.\n" ]
https://api.github.com/repos/psf/requests/issues/1480
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1480/labels{/name}
https://api.github.com/repos/psf/requests/issues/1480/comments
https://api.github.com/repos/psf/requests/issues/1480/events
https://github.com/psf/requests/issues/1480
17,048,273
MDU6SXNzdWUxNzA0ODI3Mw==
1,480
[Errno 2] _ssl.c:504: The operation did not complete (read)
{ "avatar_url": "https://avatars.githubusercontent.com/u/238549?v=4", "events_url": "https://api.github.com/users/rubik/events{/privacy}", "followers_url": "https://api.github.com/users/rubik/followers", "following_url": "https://api.github.com/users/rubik/following{/other_user}", "gists_url": "https://api.github.com/users/rubik/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/rubik", "id": 238549, "login": "rubik", "node_id": "MDQ6VXNlcjIzODU0OQ==", "organizations_url": "https://api.github.com/users/rubik/orgs", "received_events_url": "https://api.github.com/users/rubik/received_events", "repos_url": "https://api.github.com/users/rubik/repos", "site_admin": false, "starred_url": "https://api.github.com/users/rubik/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/rubik/subscriptions", "type": "User", "url": "https://api.github.com/users/rubik", "user_view_type": "public" }
[]
closed
true
null
[]
null
24
2013-07-22T14:10:51Z
2021-09-08T05:00:46Z
2013-09-21T15:24:49Z
NONE
resolved
I'm using [rauth](https://github.com/litl/rauth) in my Django application and encoutering this error. rauth is based on requests, and looking at the traceback you can see that the error indeed comes from requests: ``` File "/www/srv/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response 115. response = callback(request, *callback_args, **callback_kwargs) File "./proj/apps/core/views.py" in end_pipeline 62. make_absolute(reverse('home'))}) File "/www/srv/lib/python2.7/site-packages/rauth/service.py" in get_auth_session 533. return self.get_session(self.get_access_token(method, **kwargs)) File "/www/srv/lib/python2.7/site-packages/rauth/service.py" in get_access_token 518. r = self.get_raw_access_token(method, **kwargs) File "/www/srv/lib/python2.7/site-packages/rauth/service.py" in get_raw_access_token 496. return session.request(method, self.access_token_url, **kwargs) File "/www/srv/lib/python2.7/site-packages/rauth/session.py" in request 360. return super(OAuth2Session, self).request(method, url, **req_kwargs) File "/www/srv/lib/python2.7/site-packages/requests/sessions.py" in request 335. resp = self.send(prep, **send_kwargs) File "/www/srv/lib/python2.7/site-packages/requests/sessions.py" in send 438. r = adapter.send(request, **kwargs) File "/www/srv/lib/python2.7/site-packages/requests/adapters.py" in send 331. raise SSLError(e) Exception Type: SSLError at /accounts/end-pipeline/ Exception Value: [Errno 2] _ssl.c:504: The operation did not complete (read) ``` This seems to be caused by payloads larger than usual. The strange thing is that in the development environment it works perfectly, but not in production. And this is blocking the deployment. Please help me to solve this as soon as possible if you can. I found only another issue with the same problem here: pika/pika#59. That was solved. There is an issue in Python tracker here: http://bugs.python.org/issue12343
{ "avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4", "events_url": "https://api.github.com/users/Lukasa/events{/privacy}", "followers_url": "https://api.github.com/users/Lukasa/followers", "following_url": "https://api.github.com/users/Lukasa/following{/other_user}", "gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Lukasa", "id": 1382556, "login": "Lukasa", "node_id": "MDQ6VXNlcjEzODI1NTY=", "organizations_url": "https://api.github.com/users/Lukasa/orgs", "received_events_url": "https://api.github.com/users/Lukasa/received_events", "repos_url": "https://api.github.com/users/Lukasa/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Lukasa/starred{/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/1480/reactions" }
https://api.github.com/repos/psf/requests/issues/1480/timeline
null
completed
null
null
false
[ "Could you remove the except clause at `adapters.py:330` so we can see where exactly this exception comes from?\n(Handshake or normal `read`)\n", "Thanks for the quick reply! There you go:\n\n```\nFile \"/www/srv/lib/python2.7/site-packages/django/core/handlers/base.py\" in get_response\n 115. response = callback(request, *callback_args, **callback_kwargs)\nFile \"./proj/apps/core/views.py\" in end_pipeline\n 62. make_absolute(reverse('home'))})\nFile \"/www/srv/lib/python2.7/site-packages/rauth/service.py\" in get_auth_session\n 533. return self.get_session(self.get_access_token(method, **kwargs))\nFile \"/www/srv/lib/python2.7/site-packages/rauth/service.py\" in get_access_token\n 518. r = self.get_raw_access_token(method, **kwargs)\nFile \"/www/srv/lib/python2.7/site-packages/rauth/service.py\" in get_raw_access_token\n 496. return session.request(method, self.access_token_url, **kwargs)\nFile \"/www/srv/lib/python2.7/site-packages/rauth/session.py\" in request\n 360. return super(OAuth2Session, self).request(method, url, **req_kwargs)\nFile \"/www/srv/lib/python2.7/site-packages/requests/sessions.py\" in request\n 335. resp = self.send(prep, **send_kwargs)\nFile \"/www/srv/lib/python2.7/site-packages/requests/sessions.py\" in send\n 438. r = adapter.send(request, **kwargs)\nFile \"/www/srv/lib/python2.7/site-packages/requests/adapters.py\" in send\n 292. timeout=timeout\nFile \"/www/srv/lib/python2.7/site-packages/requests/packages/urllib3/connectionpool.py\" in urlopen\n 461. raise SSLError(e)\n```\n\nAlthough I'm afraid it's not enough. There is another except:\n\n```\n # Timed out by socket\n raise TimeoutError(self, url,\n \"Request timed out. (timeout=%s)\" %\n timeout)\n except BaseSSLError as e:\n # SSL certificate error\n raise SSLError(e) ...\n except CertificateError as e:\n # Name mismatch\n raise SSLError(e) # <---- This is line 461\n except (HTTPException, SocketError) as e:\n```\n\nI'll drop this except as well, so that we can see clearly.\n", "Damn, after removing that one it's a mess. The error is now `HTTPSConnectionPool(host='github.com', port=443): Max retries exceeded with url: /login/oauth/access_token (Caused by <class 'ssl.SSLError'>: [Errno 2] _ssl.c:504: The operation did not complete (read))`. And the traceback:\n\n```\nFile \"/www/srv/lib/python2.7/site-packages/django/core/handlers/base.py\" in get_response\n 115. response = callback(request, *callback_args, **callback_kwargs)\nFile \"./proj/apps/core/views.py\" in end_pipeline\n 62. make_absolute(reverse('home'))})\nFile \"/www/srv/lib/python2.7/site-packages/rauth/service.py\" in get_auth_session\n 533. return self.get_session(self.get_access_token(method, **kwargs))\nFile \"/www/srv/lib/python2.7/site-packages/rauth/service.py\" in get_access_token\n 518. r = self.get_raw_access_token(method, **kwargs)\nFile \"/www/srv/lib/python2.7/site-packages/rauth/service.py\" in get_raw_access_token\n 496. return session.request(method, self.access_token_url, **kwargs)\nFile \"/www/srv/lib/python2.7/site-packages/rauth/session.py\" in request\n 360. return super(OAuth2Session, self).request(method, url, **req_kwargs)\nFile \"/www/srv/lib/python2.7/site-packages/requests/sessions.py\" in request\n 335. resp = self.send(prep, **send_kwargs)\nFile \"/www/srv/lib/python2.7/site-packages/requests/sessions.py\" in send\n 438. r = adapter.send(request, **kwargs)\nFile \"/www/srv/lib/python2.7/site-packages/requests/adapters.py\" in send\n 292. timeout=timeout\nFile \"/www/srv/lib/python2.7/site-packages/requests/packages/urllib3/connectionpool.py\" in urlopen\n 474. raise MaxRetryError(self, url, e)\n```\n", "Oh no, we got real problems here. With Django's inbuilt development server everything works (even with `DEBUG=False`), whereas with Circus + Chaussette it raises the error from above! oO\nAny tips? I'm getting mad...\n", "I'm on my phone currently, so I can't dig really deep into this. Can you look at the value of the timeout parameter? According to the big you linked the socket is in nonblocking mode which raises this exception, if the previous operation has not yet competed. If I'm not mistaken, the socket should be in blocking mode.\n", "I get this error with boto and requests, so it's a problem with an underlying library, maybe urllib3?\n\nI don't get the error in my scripts running in my current shell, either django dev server or from a normal shell script. However, when I run inside foreman or honcho (uses subprocess) it happens. I'm reproducing this behavior in Ubuntu Precise and Mac OSX 10.8 by running a breakout script as `python breakout.py` successfully while `foreman run python breakout.py` fails. I reset my virtualenv to old versions of these packages to test and it didn't change the outcome, so it could be something in Python or something in the path that is wrong?\n", "It's worth confirming whether you can reproduce this with a totally clean virtualenv, installing all the packages directly from PyPI. A lot of these problems appear from incorrect installations.\n", "@Lukasa I said in my last message that's what I did.\n\nJust to clarify - I did an `rm -fr venv && virtualenv venv`\n", "Still trying to track it down, I added `print traceback.format_exc(e)` to requests/adapters.py:331 and this is what I get:\n\n```\n$ foreman run python tasks.py \nINFO:requests.packages.urllib3.connectionpool:Starting new HTTPS connection (1): x.s3.amazonaws.com\nTraceback (most recent call last):\n File \"/x/venv/lib/python2.7/site-packages/requests/adapters.py\", line 292, in send\n timeout=timeout\n File \"/x/venv/lib/python2.7/site-packages/requests/packages/urllib3/connectionpool.py\", line 461, in urlopen\n raise SSLError(e)\nSSLError: [Errno 2] _ssl.c:503: The operation did not complete (read)\n```\n", "Moving the print statement to that line in connectionpool.py:\n\n```\n$ foreman run python tasks.py \nINFO:requests.packages.urllib3.connectionpool:Starting new HTTPS connection (1): x.s3.amazonaws.com\nTraceback (most recent call last):\n File \"/x/venv/lib/python2.7/site-packages/requests/packages/urllib3/connectionpool.py\", line 428, in urlopen\n body=body, headers=headers)\n File \"/x/venv/lib/python2.7/site-packages/requests/packages/urllib3/connectionpool.py\", line 280, in _make_request\n conn.request(method, url, **httplib_request_kw)\n File \"/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py\", line 955, in request\n self._send_request(method, url, body, headers)\n File \"/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py\", line 989, in _send_request\n self.endheaders(body)\n File \"/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py\", line 951, in endheaders\n self._send_output(message_body)\n File \"/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py\", line 811, in _send_output\n self.send(msg)\n File \"/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py\", line 773, in send\n self.connect()\n File \"/x/venv/lib/python2.7/site-packages/requests/packages/urllib3/connectionpool.py\", line 107, in connect\n ssl_version=resolved_ssl_version)\n File \"/x/venv/lib/python2.7/site-packages/requests/packages/urllib3/util.py\", line 378, in ssl_wrap_socket\n ssl_version=ssl_version)\n File \"/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ssl.py\", line 372, in wrap_socket\n ciphers=ciphers)\n File \"/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ssl.py\", line 134, in __init__\n self.do_handshake()\n File \"/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ssl.py\", line 296, in do_handshake\n self._sslobj.do_handshake()\nSSLError: [Errno 2] _ssl.c:503: The operation did not complete (read)\n\nTraceback (most recent call last):\n File \"tasks.py\", line 12, in <module>\n print requests.get('https://x.s3.amazonaws.com')\n File \"/x/venv/lib/python2.7/site-packages/requests/api.py\", line 55, in get\n return request('get', url, **kwargs)\n File \"/x/venv/lib/python2.7/site-packages/requests/api.py\", line 44, in request\n return session.request(method=method, url=url, **kwargs)\n File \"/x/venv/lib/python2.7/site-packages/requests/sessions.py\", line 335, in request\n resp = self.send(prep, **send_kwargs)\n File \"/x/venv/lib/python2.7/site-packages/requests/sessions.py\", line 438, in send\n r = adapter.send(request, **kwargs)\n File \"/x/venv/lib/python2.7/site-packages/requests/adapters.py\", line 331, in send\n raise SSLError(e)\nrequests.exceptions.SSLError: [Errno 2] _ssl.c:503: The operation did not complete (read)\n```\n", "These tracebacks make it look like you have an SSL problem. I shall now invoke Requests' resident SSL specialist by saying his name three times: @t-8ch @t-8ch @t-8ch \n", "Related? http://bugs.python.org/issue12343\n", "@jsullivanlive I can't reproduce this on my end.\nCould you provide a minimal code sample?\nIf I'm looking at your example about `tasks.py` I don't see any timeouts involved. On the other hand this behaviour should only occur if non-blocking mode is active which isn't the default.\n\nA shot in the dark would be to go to `requests/packages/urllib3/util.py` and modify the `ssl_wrap_socket` function to look like this:\n\n``` py\ndef ssl_wrap_socket(sock, keyfile=None, certfile=None, cert_reqs=None,\n ca_certs=None, server_hostname=None,\n ssl_version=None):\n s = wrap_socket(sock, keyfile=keyfile, certfile=certfile,\n ca_certs=ca_certs, cert_reqs=cert_reqs,\n ssl_version=ssl_version)\n s.do_handshake()\n return s\n```\n", "Is it possible foreman is making it run in non blocking mode? I will try\nwith your modification and get back to you.\n\n## \n\nSent from my iPhone\n", "Thanks for the help, but this was my mistake - I had a local import in my breakout which had the line `from gevent import monkey; monkey.patch_socket()` embedded in it. It apparently wasn't enough of a breakout! When switching patch_socket to patch_all the gevent error goes away. Maybe @rubik 's server is using patch_socket instead, I found that in examples of auto-reload servers.\n", "I tried tracking it down just like you did, with no success. It put print_exc everywhere, in requests and urllib3. More importantly, this problem only showed up in production stack (circus + Chaussette) and not with Django's development server.\n", "@jsullivanlive: thanks for the cue, I'll look for that!\n", "Thanks for posting your solution @jsullivanlive. :+1:\n", "Unfortunately I'm using Chaussette with meinheld backend, not Gevent. And meinheld does not use gevent, I checked that...\n", "http://meinheld.org says async in the first paragraph...\n\nThis may have something to do with it:\nhttps://github.com/mopemope/meinheld/blob/master/meinheld/patch.py\n", "There is also mopemope/meinheld#27\n", "Wow thanks a lot guys. That was big help. I'm investigating further!\n", "Just to say, you are giving me good clues for problem I am having now four years after the main discussion.\r\nThx and have a good sleep", "Had an issue with ssl and large messages (experienced several SSLWantWriteErrors) - fixed it by using [gevent's monkey patching](http://www.gevent.org/gevent.monkey.html). Thx for pointing me in this direction :)\r\n\r\n" ]
https://api.github.com/repos/psf/requests/issues/1479
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1479/labels{/name}
https://api.github.com/repos/psf/requests/issues/1479/comments
https://api.github.com/repos/psf/requests/issues/1479/events
https://github.com/psf/requests/pull/1479
17,035,225
MDExOlB1bGxSZXF1ZXN0NzA3MTAxNw==
1,479
Fix a few warnings flagged by PyDev
{ "avatar_url": "https://avatars.githubusercontent.com/u/836426?v=4", "events_url": "https://api.github.com/users/dpursehouse/events{/privacy}", "followers_url": "https://api.github.com/users/dpursehouse/followers", "following_url": "https://api.github.com/users/dpursehouse/following{/other_user}", "gists_url": "https://api.github.com/users/dpursehouse/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/dpursehouse", "id": 836426, "login": "dpursehouse", "node_id": "MDQ6VXNlcjgzNjQyNg==", "organizations_url": "https://api.github.com/users/dpursehouse/orgs", "received_events_url": "https://api.github.com/users/dpursehouse/received_events", "repos_url": "https://api.github.com/users/dpursehouse/repos", "site_admin": false, "starred_url": "https://api.github.com/users/dpursehouse/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/dpursehouse/subscriptions", "type": "User", "url": "https://api.github.com/users/dpursehouse", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2013-07-22T08:17:51Z
2021-09-08T21:01:02Z
2013-07-22T08:31:16Z
CONTRIBUTOR
resolved
- Unused import of urlparse - Unnecessary definition of variable - Incorrect indentation
{ "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/1479/reactions" }
https://api.github.com/repos/psf/requests/issues/1479/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/1479.diff", "html_url": "https://github.com/psf/requests/pull/1479", "merged_at": "2013-07-22T08:31:16Z", "patch_url": "https://github.com/psf/requests/pull/1479.patch", "url": "https://api.github.com/repos/psf/requests/pulls/1479" }
true
[ "thanks!\n" ]
https://api.github.com/repos/psf/requests/issues/1478
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1478/labels{/name}
https://api.github.com/repos/psf/requests/issues/1478/comments
https://api.github.com/repos/psf/requests/issues/1478/events
https://github.com/psf/requests/pull/1478
17,032,209
MDExOlB1bGxSZXF1ZXN0NzA2OTUxNQ==
1,478
Add myself to the authors list
{ "avatar_url": "https://avatars.githubusercontent.com/u/836426?v=4", "events_url": "https://api.github.com/users/dpursehouse/events{/privacy}", "followers_url": "https://api.github.com/users/dpursehouse/followers", "following_url": "https://api.github.com/users/dpursehouse/following{/other_user}", "gists_url": "https://api.github.com/users/dpursehouse/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/dpursehouse", "id": 836426, "login": "dpursehouse", "node_id": "MDQ6VXNlcjgzNjQyNg==", "organizations_url": "https://api.github.com/users/dpursehouse/orgs", "received_events_url": "https://api.github.com/users/dpursehouse/received_events", "repos_url": "https://api.github.com/users/dpursehouse/repos", "site_admin": false, "starred_url": "https://api.github.com/users/dpursehouse/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/dpursehouse/subscriptions", "type": "User", "url": "https://api.github.com/users/dpursehouse", "user_view_type": "public" }
[]
closed
true
null
[]
null
0
2013-07-22T06:20:32Z
2021-09-08T21:01:02Z
2013-07-22T07:09:35Z
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/1478/reactions" }
https://api.github.com/repos/psf/requests/issues/1478/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/1478.diff", "html_url": "https://github.com/psf/requests/pull/1478", "merged_at": "2013-07-22T07:09:35Z", "patch_url": "https://github.com/psf/requests/pull/1478.patch", "url": "https://api.github.com/repos/psf/requests/pulls/1478" }
true
[]
https://api.github.com/repos/psf/requests/issues/1477
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1477/labels{/name}
https://api.github.com/repos/psf/requests/issues/1477/comments
https://api.github.com/repos/psf/requests/issues/1477/events
https://github.com/psf/requests/pull/1477
17,026,803
MDExOlB1bGxSZXF1ZXN0NzA2NzA2Mg==
1,477
Add a simple example of custom authentication in the documentation
{ "avatar_url": "https://avatars.githubusercontent.com/u/836426?v=4", "events_url": "https://api.github.com/users/dpursehouse/events{/privacy}", "followers_url": "https://api.github.com/users/dpursehouse/followers", "following_url": "https://api.github.com/users/dpursehouse/following{/other_user}", "gists_url": "https://api.github.com/users/dpursehouse/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/dpursehouse", "id": 836426, "login": "dpursehouse", "node_id": "MDQ6VXNlcjgzNjQyNg==", "organizations_url": "https://api.github.com/users/dpursehouse/orgs", "received_events_url": "https://api.github.com/users/dpursehouse/received_events", "repos_url": "https://api.github.com/users/dpursehouse/repos", "site_admin": false, "starred_url": "https://api.github.com/users/dpursehouse/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/dpursehouse/subscriptions", "type": "User", "url": "https://api.github.com/users/dpursehouse", "user_view_type": "public" }
[]
closed
true
null
[]
null
3
2013-07-22T00:17:21Z
2021-09-08T21:01:01Z
2013-07-22T06:04:31Z
CONTRIBUTOR
resolved
{ "avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4", "events_url": "https://api.github.com/users/Lukasa/events{/privacy}", "followers_url": "https://api.github.com/users/Lukasa/followers", "following_url": "https://api.github.com/users/Lukasa/following{/other_user}", "gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Lukasa", "id": 1382556, "login": "Lukasa", "node_id": "MDQ6VXNlcjEzODI1NTY=", "organizations_url": "https://api.github.com/users/Lukasa/orgs", "received_events_url": "https://api.github.com/users/Lukasa/received_events", "repos_url": "https://api.github.com/users/Lukasa/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions", "type": "User", "url": "https://api.github.com/users/Lukasa", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/1477/reactions" }
https://api.github.com/repos/psf/requests/issues/1477/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/1477.diff", "html_url": "https://github.com/psf/requests/pull/1477", "merged_at": "2013-07-22T06:04:31Z", "patch_url": "https://github.com/psf/requests/pull/1477.patch", "url": "https://api.github.com/repos/psf/requests/pulls/1477" }
true
[ "Great work, thanks! :cake:\n", "Thanks for merging.\n\nBTW do these documentation updates justify adding myself to the authors list?\n", "Absolutely! Documentation contributions are super-valuable. =) \n" ]
https://api.github.com/repos/psf/requests/issues/1476
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1476/labels{/name}
https://api.github.com/repos/psf/requests/issues/1476/comments
https://api.github.com/repos/psf/requests/issues/1476/events
https://github.com/psf/requests/pull/1476
17,011,138
MDExOlB1bGxSZXF1ZXN0NzA2NTYxNg==
1,476
[2.0] Add copy method to PreparedRequest objects
{ "avatar_url": "https://avatars.githubusercontent.com/u/240830?v=4", "events_url": "https://api.github.com/users/sigmavirus24/events{/privacy}", "followers_url": "https://api.github.com/users/sigmavirus24/followers", "following_url": "https://api.github.com/users/sigmavirus24/following{/other_user}", "gists_url": "https://api.github.com/users/sigmavirus24/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/sigmavirus24", "id": 240830, "login": "sigmavirus24", "node_id": "MDQ6VXNlcjI0MDgzMA==", "organizations_url": "https://api.github.com/users/sigmavirus24/orgs", "received_events_url": "https://api.github.com/users/sigmavirus24/received_events", "repos_url": "https://api.github.com/users/sigmavirus24/repos", "site_admin": false, "starred_url": "https://api.github.com/users/sigmavirus24/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/sigmavirus24/subscriptions", "type": "User", "url": "https://api.github.com/users/sigmavirus24", "user_view_type": "public" }
[ { "color": "02e10c", "default": false, "description": null, "id": 76800, "name": "Feature Request", "node_id": "MDU6TGFiZWw3NjgwMA==", "url": "https://api.github.com/repos/psf/requests/labels/Feature%20Request" }, { "color": "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" } ]
closed
true
null
[]
null
11
2013-07-20T20:42:09Z
2021-09-08T23:08:19Z
2013-07-27T01:16:00Z
CONTRIBUTOR
resolved
I really think it is only needed for `PreparedRequest` objects, but I could see a desire to implement it on `Request` objects too. The reasoning is simple. Currently, we have duplicated code to make copies of `PreparedRequests` to preserve the history of the requests sent and be able to make new ones. We could not only reduce duplication, but also ensure (via tests) that the library won't break in weird ways because of this in the future. It would be a dead-simple method to write, and would be very useful and probably even more useful to authentication handler authors.
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/1476/reactions" }
https://api.github.com/repos/psf/requests/issues/1476/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/1476.diff", "html_url": "https://github.com/psf/requests/pull/1476", "merged_at": "2013-07-27T01:16:00Z", "patch_url": "https://github.com/psf/requests/pull/1476.patch", "url": "https://api.github.com/repos/psf/requests/pulls/1476" }
true
[ "For reference, here's [one way of implementing this](https://github.com/sigmavirus24/requests/commit/b84547d78699a3a5c75dbdf2c2e422dbaa83b988).\n", "I think there's no good reason not to go straight to a Pull Request with that commit. =)\n", "Kind of wish I could just turn this issue into a PR but I don't have the privileges here. Also we should make that 2.0 branch so I can target that since you cannot edit a PR's target after it has been created. \n", "Actually, @Lukasa, you can do that for me with this issue. :-P\n", "Don't you have the same privileges as me with this repository?\n", "As of the last time I checked, no. I'll try again though and edit this comment with the results.\n\nClearly I was wrong. :)\n", ":sparkles: :+1: :sparkles:\n", ":heart: :hamburger: :haircut: \n", "@kennethreitz is this good for merging?\n", "Also, do you want tests for this? \n", "oh thought i did\n" ]
https://api.github.com/repos/psf/requests/issues/1475
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1475/labels{/name}
https://api.github.com/repos/psf/requests/issues/1475/comments
https://api.github.com/repos/psf/requests/issues/1475/events
https://github.com/psf/requests/pull/1475
17,008,665
MDExOlB1bGxSZXF1ZXN0NzA2MDc2OQ==
1,475
[WIP] [2.0] Clean up Exceptions
{ "avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4", "events_url": "https://api.github.com/users/Lukasa/events{/privacy}", "followers_url": "https://api.github.com/users/Lukasa/followers", "following_url": "https://api.github.com/users/Lukasa/following{/other_user}", "gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Lukasa", "id": 1382556, "login": "Lukasa", "node_id": "MDQ6VXNlcjEzODI1NTY=", "organizations_url": "https://api.github.com/users/Lukasa/orgs", "received_events_url": "https://api.github.com/users/Lukasa/received_events", "repos_url": "https://api.github.com/users/Lukasa/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions", "type": "User", "url": "https://api.github.com/users/Lukasa", "user_view_type": "public" }
[ { "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
14
2013-07-20T17:04:19Z
2021-09-09T00:01:20Z
2013-09-24T17:48:38Z
MEMBER
resolved
This PR is a work in progress. It addresses some problems we've got with Exceptions. Currently it contains two fixes: - Resolves the misspelling of 'scheme', reimplementing the fix proposed in #1187. - Attempts to provide a fix of #1294. This second part is of particular interest. I want to know what @sigmavirus24 thinks of this possible fix.
{ "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/1475/reactions" }
https://api.github.com/repos/psf/requests/issues/1475/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/1475.diff", "html_url": "https://github.com/psf/requests/pull/1475", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/1475.patch", "url": "https://api.github.com/repos/psf/requests/pulls/1475" }
true
[ "Let include the old misspelled version too, for compatiblity's sake. Simple subclass :)\n", "Done. =)\n", "I think that if we're making breaking API changes, we shouldn't be concerning ourselves too seriously with backwards compatible error changes. The point of the semantic version bump is that things are going to change in a manner that is backwards incompatible.\n", "@sigmavirus24 i agree, but it's so easy, might as well. It's one line :)\n", "No worries. Just playing devil's advocate. :)\n", "quick rebase against the `2.0` branch?\n", "Done. =)\n", "This is failing because someone (:wink:) still hasn't merged [these changes](https://github.com/kennethreitz/httpbin/pull/110) on httpbin.\n", "My name is Kenneth and I receive too many pull requests.\n\nBest problem ever :)\n", "Its time to scale. Introduce Kenneth robot to handle pull request?\nOn Aug 2, 2013 7:34 AM, \"Kenneth Reitz\" [email protected] wrote:\n\n> My name is Kenneth and I receive too many pull requests.\n> \n> Best problem ever :)\n> \n> —\n> Reply to this email directly or view it on GitHubhttps://github.com/kennethreitz/requests/pull/1475#issuecomment-21982443\n> .\n", "@kennethreitz indeed the best problem ever. Fwiw I'd be happy to help with httpbin's PRs.\n\nAlso @kracekumar we can rebuild him faster, stronger, better. ;)\n", "Uh, @kennethreitz, I think you may have merged #1509 into this instead of the other way around...\n\n**EDIT**: No, I'm just an idiot.\n", "lukasa, there's a ton of stuff in here now. What's the status?\n", "Yeah, took me a while to work out what happened. The PR is still against master, but I rebased against 2.0 at your request. If you'd prefer I can try to reopen against 2.0. \n" ]
https://api.github.com/repos/psf/requests/issues/1474
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1474/labels{/name}
https://api.github.com/repos/psf/requests/issues/1474/comments
https://api.github.com/repos/psf/requests/issues/1474/events
https://github.com/psf/requests/pull/1474
17,005,421
MDExOlB1bGxSZXF1ZXN0NzA1OTU3MQ==
1,474
Some tiny fixes to the documentation
{ "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-07-20T11:32:41Z
2021-09-08T23:05:13Z
2013-07-20T12:15:07Z
CONTRIBUTOR
resolved
Very tiny and cosmetic, mostly in grammar and in reST. _This also shows that I am working on the Polish translation today, something I haven’t had time for during the past three months._
{ "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/1474/reactions" }
https://api.github.com/repos/psf/requests/issues/1474/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/1474.diff", "html_url": "https://github.com/psf/requests/pull/1474", "merged_at": "2013-07-20T12:15:07Z", "patch_url": "https://github.com/psf/requests/pull/1474.patch", "url": "https://api.github.com/repos/psf/requests/pulls/1474" }
true
[ "many thanks!\n" ]
https://api.github.com/repos/psf/requests/issues/1473
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1473/labels{/name}
https://api.github.com/repos/psf/requests/issues/1473/comments
https://api.github.com/repos/psf/requests/issues/1473/events
https://github.com/psf/requests/pull/1473
16,992,065
MDExOlB1bGxSZXF1ZXN0NzA1MjkxMQ==
1,473
Collect cookies sent on a 401 Challenge
{ "avatar_url": "https://avatars.githubusercontent.com/u/240830?v=4", "events_url": "https://api.github.com/users/sigmavirus24/events{/privacy}", "followers_url": "https://api.github.com/users/sigmavirus24/followers", "following_url": "https://api.github.com/users/sigmavirus24/following{/other_user}", "gists_url": "https://api.github.com/users/sigmavirus24/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/sigmavirus24", "id": 240830, "login": "sigmavirus24", "node_id": "MDQ6VXNlcjI0MDgzMA==", "organizations_url": "https://api.github.com/users/sigmavirus24/orgs", "received_events_url": "https://api.github.com/users/sigmavirus24/received_events", "repos_url": "https://api.github.com/users/sigmavirus24/repos", "site_admin": false, "starred_url": "https://api.github.com/users/sigmavirus24/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/sigmavirus24/subscriptions", "type": "User", "url": "https://api.github.com/users/sigmavirus24", "user_view_type": "public" }
[ { "color": "e11d21", "default": false, "description": null, "id": 44501305, "name": "Not Ready To Merge", "node_id": "MDU6TGFiZWw0NDUwMTMwNQ==", "url": "https://api.github.com/repos/psf/requests/labels/Not%20Ready%20To%20Merge" } ]
closed
true
null
[]
null
18
2013-07-19T20:46:23Z
2021-09-08T23:06:16Z
2013-08-01T01:33:56Z
CONTRIBUTOR
resolved
On 401's the cookies received aren't sent back to the server. Fixes: #1336 Also this will rely on some changes in HTTPBin for testing. I'm going to start a pull over there too.
{ "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/1473/reactions" }
https://api.github.com/repos/psf/requests/issues/1473/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/1473.diff", "html_url": "https://github.com/psf/requests/pull/1473", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/1473.patch", "url": "https://api.github.com/repos/psf/requests/pulls/1473" }
true
[ "And to elaborate. One of the tests will fail until the changes I added over on kennethreitz/httpbin#110 are accepted. Although those are not 100% correct (i.e. I don't think we should always be expecting a Cookie header to be returned. Then again, if this works, we should be fine with using that. Tests will just fail until then.\n", "As a side note, we tend to make copies of PreparedRequests in at least two places (now) so I'm all for adding a `.copy()` method to them to make it easier to duplicate them. Objections?\n", "@Lukasa some eyes on this early on will be helpful too.\n", "This is still failing because we need the changes in httpbin first, but in the meantime I'd love to refactor this after #1476 gets accepted.\n\nOtherwise this should fix everything related to the bug linked above.\n", "Rebased against master to for 286ddb6.\n\nAny new feedback would be more than welcome.\n", "quick rebase?\n", "@kennethreitz it's failing on travis because there's a related PR on HTTPbin that needs to be merged for the tests to pass. This doesn't need to be rebased at the moment, there's no merge conflicts according to GitHub.\n", "oh sorry\n", "BTW, we're getting sponsorship from rackspace, so we should have a real jenkins cluster soon :)\n", "Can't wait to move off of travis.\n", "Safe to assume this also fixes them for 301's?\n", "Closing since merged into #1509\n", "> Safe to assume this also fixes them for 301's?\n\nNo. I wasn't aware there was an issue with those. I'll hop on that too. Can you add a failing test?\n", "> BTW, we're getting sponsorship from rackspace, so we should have a real jenkins cluster soon :)\n\nWoot woot!\n", "Oh there may not be one. I thought there was.\n", "Cookies are collected on redirects successfully.\n\nI think @gazpachoking worked on that successfully. This was a similar problem \nthat wasn't able to be handled the same way.\n", "most excellent! \n\n:dango: \n", ":metal:\n" ]
https://api.github.com/repos/psf/requests/issues/1472
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1472/labels{/name}
https://api.github.com/repos/psf/requests/issues/1472/comments
https://api.github.com/repos/psf/requests/issues/1472/events
https://github.com/psf/requests/issues/1472
16,974,999
MDU6SXNzdWUxNjk3NDk5OQ==
1,472
DecodeError in 1.2.3; regression from 1.2.0
{ "avatar_url": "https://avatars.githubusercontent.com/u/74351?v=4", "events_url": "https://api.github.com/users/maxcountryman/events{/privacy}", "followers_url": "https://api.github.com/users/maxcountryman/followers", "following_url": "https://api.github.com/users/maxcountryman/following{/other_user}", "gists_url": "https://api.github.com/users/maxcountryman/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/maxcountryman", "id": 74351, "login": "maxcountryman", "node_id": "MDQ6VXNlcjc0MzUx", "organizations_url": "https://api.github.com/users/maxcountryman/orgs", "received_events_url": "https://api.github.com/users/maxcountryman/received_events", "repos_url": "https://api.github.com/users/maxcountryman/repos", "site_admin": false, "starred_url": "https://api.github.com/users/maxcountryman/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/maxcountryman/subscriptions", "type": "User", "url": "https://api.github.com/users/maxcountryman", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2013-07-19T14:53:46Z
2021-09-09T00:10:01Z
2013-07-19T16:20:42Z
CONTRIBUTOR
resolved
``` ... /project/virtualenv/lib/python2.6/requests/packages/urllib3/response.py", line 188, in read "failed to decode it." % content_encoding) DecodeError: Received response with content-encoding: gzip, but failed to decode it. ``` This is against a URL which 1.2.0 handles without a problem. Since 1.2.3 this exception pops 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/1472/reactions" }
https://api.github.com/repos/psf/requests/issues/1472/timeline
null
completed
null
null
false
[ "I'm prepared to believe this was broken by commit 6d6252aa9fc4bb38d7f68073b41092c31ddb146b, and more specifically [this commit](https://github.com/shazow/urllib3/commit/d00d3052382de69382e21af8d10524e5aefadde8). \n\nI'm pretty sure this failure is in urllib3, not Requests: can you open this issue over there, and cc @schlamar on it?\n", "Sounds reasonable. I'll open up an issue over there. Thanks!\n" ]
https://api.github.com/repos/psf/requests/issues/1471
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1471/labels{/name}
https://api.github.com/repos/psf/requests/issues/1471/comments
https://api.github.com/repos/psf/requests/issues/1471/events
https://github.com/psf/requests/issues/1471
16,972,044
MDU6SXNzdWUxNjk3MjA0NA==
1,471
"AttributeError: 'NoneType' object has no attribute '__dict__'" when using custom authentication class
{ "avatar_url": "https://avatars.githubusercontent.com/u/836426?v=4", "events_url": "https://api.github.com/users/dpursehouse/events{/privacy}", "followers_url": "https://api.github.com/users/dpursehouse/followers", "following_url": "https://api.github.com/users/dpursehouse/following{/other_user}", "gists_url": "https://api.github.com/users/dpursehouse/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/dpursehouse", "id": 836426, "login": "dpursehouse", "node_id": "MDQ6VXNlcjgzNjQyNg==", "organizations_url": "https://api.github.com/users/dpursehouse/orgs", "received_events_url": "https://api.github.com/users/dpursehouse/received_events", "repos_url": "https://api.github.com/users/dpursehouse/repos", "site_admin": false, "starred_url": "https://api.github.com/users/dpursehouse/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/dpursehouse/subscriptions", "type": "User", "url": "https://api.github.com/users/dpursehouse", "user_view_type": "public" }
[]
closed
true
null
[]
null
5
2013-07-19T13:53:06Z
2021-09-09T02:11:50Z
2013-07-22T06:07:15Z
CONTRIBUTOR
resolved
A short script to reproduce this issue is here: https://gist.github.com/dpursehouse/6039233 At this point I'm not sure if it's a bug, or I'm missing something obvious and just doing it wrong...
{ "avatar_url": "https://avatars.githubusercontent.com/u/836426?v=4", "events_url": "https://api.github.com/users/dpursehouse/events{/privacy}", "followers_url": "https://api.github.com/users/dpursehouse/followers", "following_url": "https://api.github.com/users/dpursehouse/following{/other_user}", "gists_url": "https://api.github.com/users/dpursehouse/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/dpursehouse", "id": 836426, "login": "dpursehouse", "node_id": "MDQ6VXNlcjgzNjQyNg==", "organizations_url": "https://api.github.com/users/dpursehouse/orgs", "received_events_url": "https://api.github.com/users/dpursehouse/received_events", "repos_url": "https://api.github.com/users/dpursehouse/repos", "site_admin": false, "starred_url": "https://api.github.com/users/dpursehouse/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/dpursehouse/subscriptions", "type": "User", "url": "https://api.github.com/users/dpursehouse", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/1471/reactions" }
https://api.github.com/repos/psf/requests/issues/1471/timeline
null
completed
null
null
false
[ "Doing something wrong. Your output looks like it's from a version of Requests pre-v1.0.0. =)\n", "It's from a version installed a couple of weeks ago. And I get the same\non a different computer where I just installed the latest version\nyesterday...\n", "Oh I'm sorry, I'm being an idiot! =D Though to be fair, the traceback on a newer version of Requests is totally different. =P\n\nThe `__call__` method has to return the updated Request:\n\n``` python\nimport requests\nclass TestAuth(requests.auth.AuthBase):\n def __call__(self, r):\n return r\n```\n", "Ah, ok. Thanks, I'll try that later.\n", "It works as described. Documentation is updated, so this can be closed now.\n" ]
https://api.github.com/repos/psf/requests/issues/1470
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1470/labels{/name}
https://api.github.com/repos/psf/requests/issues/1470/comments
https://api.github.com/repos/psf/requests/issues/1470/events
https://github.com/psf/requests/pull/1470
16,969,842
MDExOlB1bGxSZXF1ZXN0NzA0MDkzOQ==
1,470
Remove charset from JSON types: not valid.
{ "avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4", "events_url": "https://api.github.com/users/Lukasa/events{/privacy}", "followers_url": "https://api.github.com/users/Lukasa/followers", "following_url": "https://api.github.com/users/Lukasa/following{/other_user}", "gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Lukasa", "id": 1382556, "login": "Lukasa", "node_id": "MDQ6VXNlcjEzODI1NTY=", "organizations_url": "https://api.github.com/users/Lukasa/orgs", "received_events_url": "https://api.github.com/users/Lukasa/received_events", "repos_url": "https://api.github.com/users/Lukasa/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Lukasa/starred{/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
7
2013-07-19T13:04:50Z
2021-09-08T23:08:28Z
2013-07-19T13:45:56Z
MEMBER
resolved
This resolves #1467.
{ "avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4", "events_url": "https://api.github.com/users/Lukasa/events{/privacy}", "followers_url": "https://api.github.com/users/Lukasa/followers", "following_url": "https://api.github.com/users/Lukasa/following{/other_user}", "gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Lukasa", "id": 1382556, "login": "Lukasa", "node_id": "MDQ6VXNlcjEzODI1NTY=", "organizations_url": "https://api.github.com/users/Lukasa/orgs", "received_events_url": "https://api.github.com/users/Lukasa/received_events", "repos_url": "https://api.github.com/users/Lukasa/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Lukasa/starred{/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/1470/reactions" }
https://api.github.com/repos/psf/requests/issues/1470/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/1470.diff", "html_url": "https://github.com/psf/requests/pull/1470", "merged_at": "2013-07-19T13:45:56Z", "patch_url": "https://github.com/psf/requests/pull/1470.patch", "url": "https://api.github.com/repos/psf/requests/pulls/1470" }
true
[ "Did github change their responses?\n", "Oh, I was doing this off the back of httpbin's headers, which I thought was what we were using at this stage of the docs. Haven't checked GH.\n", "ah, gotcha. indeed, incorrect.\n", "I've been thinking more about allowing json uploads lately. would be pretty cool.\n", "Could make it part of 2.0. =)\n", "+1!\n", "I'm thinking:\n\n``` python\nurl = 'http://httpbin.org\ndata = {'some': 'data'}\n\nrequests.post('http://httpbin.org/post', data={'some': 'data'}, json=True)\n```\n" ]
https://api.github.com/repos/psf/requests/issues/1469
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1469/labels{/name}
https://api.github.com/repos/psf/requests/issues/1469/comments
https://api.github.com/repos/psf/requests/issues/1469/events
https://github.com/psf/requests/issues/1469
16,969,271
MDU6SXNzdWUxNjk2OTI3MQ==
1,469
content type header is null
{ "avatar_url": "https://avatars.githubusercontent.com/u/4864933?v=4", "events_url": "https://api.github.com/users/timmyschweer/events{/privacy}", "followers_url": "https://api.github.com/users/timmyschweer/followers", "following_url": "https://api.github.com/users/timmyschweer/following{/other_user}", "gists_url": "https://api.github.com/users/timmyschweer/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/timmyschweer", "id": 4864933, "login": "timmyschweer", "node_id": "MDQ6VXNlcjQ4NjQ5MzM=", "organizations_url": "https://api.github.com/users/timmyschweer/orgs", "received_events_url": "https://api.github.com/users/timmyschweer/received_events", "repos_url": "https://api.github.com/users/timmyschweer/repos", "site_admin": false, "starred_url": "https://api.github.com/users/timmyschweer/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/timmyschweer/subscriptions", "type": "User", "url": "https://api.github.com/users/timmyschweer", "user_view_type": "public" }
[]
closed
true
null
[]
null
10
2013-07-19T12:51:06Z
2021-09-09T02:11:51Z
2013-07-19T18:45:47Z
NONE
resolved
1. What am I doing? using python requests to upload very large files to an java restlet that uses "org.apache.commons.fileupload" to receive the upload. 2. Python source code: ``` import requests url = "http://127.0.0.1:8888/service/rest/project/27/uploadfile/filename.zip" filepath = "/home/user/3gb-file.zip" session = requests.Session() session.trust_env = False session.auth = requests.auth.HTTPDigestAuth("user", "mypassword") fpFile = open(filepath, 'rb') session.post(url, data=fpFile, timeout=20) fpFile.close() ``` 1. Java Exception Message: ``` [INFO] org.apache.commons.fileupload.FileUploadBase$InvalidContentTypeException: the request doesn't contain a multipart/form-data or multipart/mixed stream, content type header is null [INFO] [ERROR] Jul 19, 2013 2:11:11 PM org.restlet.engine.log.LogFilter afterHandle at org.apache.commons.fileupload.FileUploadBase$FileItemIteratorImpl.<init>(FileUploadBase.java:908) [INFO] at org.apache.commons.fileupload.FileUploadBase.getItemIterator(FileUploadBase.java:331) ``` I checked the request header from the Response object, and there really is no "Content-Type" specified. I'm using the current requests library version 1.2.3 and python version 2.7.2
{ "avatar_url": "https://avatars.githubusercontent.com/u/4864933?v=4", "events_url": "https://api.github.com/users/timmyschweer/events{/privacy}", "followers_url": "https://api.github.com/users/timmyschweer/followers", "following_url": "https://api.github.com/users/timmyschweer/following{/other_user}", "gists_url": "https://api.github.com/users/timmyschweer/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/timmyschweer", "id": 4864933, "login": "timmyschweer", "node_id": "MDQ6VXNlcjQ4NjQ5MzM=", "organizations_url": "https://api.github.com/users/timmyschweer/orgs", "received_events_url": "https://api.github.com/users/timmyschweer/received_events", "repos_url": "https://api.github.com/users/timmyschweer/repos", "site_admin": false, "starred_url": "https://api.github.com/users/timmyschweer/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/timmyschweer/subscriptions", "type": "User", "url": "https://api.github.com/users/timmyschweer", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/1469/reactions" }
https://api.github.com/repos/psf/requests/issues/1469/timeline
null
completed
null
null
false
[ "Hi @timmyschweer, thanks for opening this issue!\n\nYou should upload this as a file, rather than as a single giant data string. Try using:\n\n``` python\nimport requests\nurl = \"http://127.0.0.1:8888/service/rest/project/27/uploadfile/filename.zip\"\nfilepath = \"/home/user/3gb-file.zip\"\nsession = requests.Session()\nsession.trust_env = False\nsessionauth = requests.auth.HTTPDigestAuth(\"user\", \"password\")\nfiles = {'file': open(filepath, 'rb')}\nsession.post(url, files=files, timeout=20)\n```\n", "Hi @Lukasa, thank you for your reply =)\nI already used the way you suggest. For small files that does work, but for large ones python crashes after 99% memory usage..\nThe idea was to use upload streaming without copying the whole file to memory:\nhttp://docs.python-requests.org/en/latest/user/advanced/#streaming-uploads\n", "Ah, ok. In that case we don't provide a `Content-Type` header because we don't know what the body of the message actually is. You'll need to set the `Content-Type` header yourself. =)\n", "@Lukasa i already tried that! then the boundary is missing =/\n", "What are you setting the `Content-Type` header to?\n", "1. drops an \"missing boundary exception\" on restlet side:\n\n```\nsession.post(url, data=fpFile, headers={'Content-Type':'multipart/form-data' })\n```\n1. using an stolen boundary (from another post request) the \"org.apache.commons.fileupload\" can't find any fileitem\n\n```\nsession.post(url, data=fpFile, headers={'Content-Type':'multipart/form-data; boundary=fe3ea15cf3314b448addc215130893a0' })\n```\n\nseems like the \"org.apache.commons.fileupload\" is not capable of receiving data this way ha? :'(\n", "Nah, it's that you're lying to it! =D\n\nYou aren't sending `multipart/form-data`. Chunked encoding is sending the literal contents of the file, just in chunks. Your `Content-Type` header should be the actual MIME type of the data you're sending. For example, for a zip file, it should be `application/zip`.\n", "@Lukasa thank you for your brain muscle action!\nI investigated the apache commons Fileupload class and it ONLY accepts multipart uploads with an boundary.. Due the fact that i can't write an FileUpload class that can handle streams without boundary i don't have a solution for my problem..\n\nIs there another way of using\n\n```\nfiles = {'file': open(filepath, 'rb')}\nsession.post(url, files=files, timeout=20)\n```\n\nwithout copying the file to memory?\n", "Re my brain: I'm always happy to help! It's what I'm here for. =)\n\nUnfortunately, in vanilla Requests the answer is simply no.\n\nMaking this work is a fairly major diversion from how Requests works. If you wanted this to work you'd need to submit an improvement to [`urllib3`](https://github.com/shazow/urllib3). This improvement would fundamentally change the way urllib3 handles multipart data.\n\nIt is not _impossible_ that we'll consider this as part of our work on Requests 2.0, as it would certainly been an awesome feature. However, it's not in the immediate plan. Sorry. =(\n", "okay, would never have thought it would work that simple... Dependent on the mediatype I'm using the file upload multipart parser or directly writing the HTTP stream to disk.\n\n@Lukasa thx for your help!\n\nHere's my java restlet code:\n\n```\nimport java.io.IOException;\nimport java.util.ArrayList;\nimport java.util.List;\n\nimport org.apache.commons.fileupload.FileItem;\nimport org.apache.commons.fileupload.FileUploadException;\nimport org.apache.commons.fileupload.disk.DiskFileItem;\nimport org.apache.commons.fileupload.disk.DiskFileItemFactory;\nimport org.apache.commons.fileupload.util.Streams;\nimport org.restlet.data.MediaType;\nimport org.restlet.data.Status;\nimport org.restlet.ext.fileupload.RestletFileUpload;\nimport org.restlet.representation.Representation;\nimport org.restlet.representation.Variant;\nimport org.restlet.resource.ResourceException;\nimport org.restlet.resource.ServerResource;\nimport org.slf4j.Logger;\nimport org.slf4j.LoggerFactory;\n\npublic final class FileUploadResource extends ServerResource {\n\n private static final Logger LOG = LoggerFactory.getLogger(UploadFileResource.class);\n\n private String fileName;\n\n private final DiskFileItemFactory diskFileItemFactory;\n\n public FileUploadResource() {\n super();\n this.diskFileItemFactory = new DiskFileItemFactory();\n // always write file to disk independent from the size\n this.diskFileItemFactory.setSizeThreshold(0);\n }\n\n @Override\n protected void doInit() {\n this.fileName = this.getAttribute(\"file_name\");\n }\n\n private List<FileItem> parseMultiPartUpload(final Representation representation) {\n final List<FileItem> fileItemList = new ArrayList<FileItem>();\n // necessary to parse the Representation to FileItem objects\n final RestletFileUpload fileUpload = new RestletFileUpload(this.diskFileItemFactory);\n try {\n fileItemList.addAll(fileUpload.parseRepresentation(representation));\n } catch (final FileUploadException e) {\n LOG.error(\"parseMultiPartUpload(): error occured when parsing representation\", e);\n throw new ResourceException(Status.CLIENT_ERROR_BAD_REQUEST, e);\n }\n return fileItemList;\n }\n\n private List<FileItem> parseUploadStream(final Representation representation) {\n final List<FileItem> fileItemList = new ArrayList<FileItem>();\n String mediaType = \"\";\n if (representation.getMediaType() != null) {\n mediaType = representation.getMediaType().toString();\n }\n final FileItem fileItem = this.diskFileItemFactory\n .createItem(\"file\", mediaType, false, this.fileName);\n try {\n Streams.copy(representation.getStream(), fileItem.getOutputStream(), true);\n fileItemList.add(fileItem);\n } catch (final IOException e) {\n LOG.error(\"post():failed reading upload stream\", e);\n throw new ResourceException(Status.CLIENT_ERROR_BAD_REQUEST, e);\n }\n return fileItemList;\n }\n\n @Override\n public Representation post(final Representation representation, final Variant variant) {\n LOG.debug(\"post(): adding file variant {}\", variant);\n return this.post(representation);\n }\n\n @Override\n public Representation post(final Representation representation) {\n LOG.debug(\"post():\");\n // all items that will be found\n final List<FileItem> allItems = new ArrayList<FileItem>();\n // list of items that are real files not form fields\n final List<FileItem> fileItems = new ArrayList<FileItem>();\n if (representation.getMediaType() != null\n && representation.getMediaType().isCompatible(MediaType.MULTIPART_ALL)) {\n allItems.addAll(this.parseMultiPartUpload(representation));\n } else {\n allItems.addAll(this.parseUploadStream(representation));\n }\n for (final FileItem fileItem : allItems) {\n if (!fileItem.isFormField()) {\n fileItems.add(fileItem);\n }\n }\n // VALIDATING 1 FILE IS UPLOADED\n if (fileItems.size() == 0) {\n LOG.error(\"post(): no file item was found.\");\n throw new ResourceException(Status.CLIENT_ERROR_EXPECTATION_FAILED, \"no file item was found.\");\n } else if (fileItems.size() > 1) {\n LOG.error(\"post(): more than one file item was found.\");\n throw new ResourceException(Status.CLIENT_ERROR_EXPECTATION_FAILED,\n \"more than one file item was found.\");\n }\n final DiskFileItem diskFileItem = (DiskFileItem) fileItems.get(0);\n if (diskFileItem.getSize() == 0) {\n LOG.warn(\"post(): file '{}' is empty and won't be added.\", this.fileName);\n throw new ResourceException(Status.CLIENT_ERROR_UNPROCESSABLE_ENTITY, \"uploaded file was empty\");\n } else {\n // DO WHAT YOU WANT WITH THE FILE\n }\n return representation;\n }\n}\n```\n" ]
https://api.github.com/repos/psf/requests/issues/1468
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1468/labels{/name}
https://api.github.com/repos/psf/requests/issues/1468/comments
https://api.github.com/repos/psf/requests/issues/1468/events
https://github.com/psf/requests/issues/1468
16,967,051
MDU6SXNzdWUxNjk2NzA1MQ==
1,468
Included charade package is licensed under the GPL
{ "avatar_url": "https://avatars.githubusercontent.com/u/40906?v=4", "events_url": "https://api.github.com/users/bfirsh/events{/privacy}", "followers_url": "https://api.github.com/users/bfirsh/followers", "following_url": "https://api.github.com/users/bfirsh/following{/other_user}", "gists_url": "https://api.github.com/users/bfirsh/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/bfirsh", "id": 40906, "login": "bfirsh", "node_id": "MDQ6VXNlcjQwOTA2", "organizations_url": "https://api.github.com/users/bfirsh/orgs", "received_events_url": "https://api.github.com/users/bfirsh/received_events", "repos_url": "https://api.github.com/users/bfirsh/repos", "site_admin": false, "starred_url": "https://api.github.com/users/bfirsh/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/bfirsh/subscriptions", "type": "User", "url": "https://api.github.com/users/bfirsh", "user_view_type": "public" }
[]
closed
true
null
[]
null
4
2013-07-19T11:22:45Z
2021-09-09T02:11:51Z
2013-07-19T13:02:07Z
NONE
resolved
https://github.com/kennethreitz/requests/blob/master/requests/packages/charade/__init__.py IANAL but doesn't this make requests unusable in commercial products? The top-level Apache license is a bit misleading.
{ "avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4", "events_url": "https://api.github.com/users/Lukasa/events{/privacy}", "followers_url": "https://api.github.com/users/Lukasa/followers", "following_url": "https://api.github.com/users/Lukasa/following{/other_user}", "gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Lukasa", "id": 1382556, "login": "Lukasa", "node_id": "MDQ6VXNlcjEzODI1NTY=", "organizations_url": "https://api.github.com/users/Lukasa/orgs", "received_events_url": "https://api.github.com/users/Lukasa/received_events", "repos_url": "https://api.github.com/users/Lukasa/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Lukasa/starred{/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/1468/reactions" }
https://api.github.com/repos/psf/requests/issues/1468/timeline
null
completed
null
null
false
[ "It's under the LGPL (as far as I can see). Given that we haven't modified `charade` in any way, and that the user can easily swap `charade` for their own copy, I think this means we're fine. We probably _should_ provide the `charade` and `urllib3` licenses in a top-level file though.\n", "We used to...\n", "https://github.com/kennethreitz/requests/blob/master/NOTICE\n\n## \n\nKenneth Reitz\n\nOn Jul 19, 2013, at 7:28 AM, Cory Benfield [email protected] wrote:\n\nIt's under the LGPL (as far as I can see). Given that we haven't modified\ncharade in any way, and that the user can easily swap charade for their own\ncopy, I think this means we're fine. We probably _should_ provide the\ncharade and urllib3 licenses in a top-level file though.\n\n—\nReply to this email directly or view it on\nGitHubhttps://github.com/kennethreitz/requests/issues/1468#issuecomment-21244742\n.\n", "Aha, awesome, totally missed that. =) In that case, I pronounce us legally in the clear!\n" ]
https://api.github.com/repos/psf/requests/issues/1467
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1467/labels{/name}
https://api.github.com/repos/psf/requests/issues/1467/comments
https://api.github.com/repos/psf/requests/issues/1467/events
https://github.com/psf/requests/issues/1467
16,966,581
MDU6SXNzdWUxNjk2NjU4MQ==
1,467
Remove Charset from JSON in Examples
{ "avatar_url": "https://avatars.githubusercontent.com/u/7396?v=4", "events_url": "https://api.github.com/users/mitsuhiko/events{/privacy}", "followers_url": "https://api.github.com/users/mitsuhiko/followers", "following_url": "https://api.github.com/users/mitsuhiko/following{/other_user}", "gists_url": "https://api.github.com/users/mitsuhiko/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/mitsuhiko", "id": 7396, "login": "mitsuhiko", "node_id": "MDQ6VXNlcjczOTY=", "organizations_url": "https://api.github.com/users/mitsuhiko/orgs", "received_events_url": "https://api.github.com/users/mitsuhiko/received_events", "repos_url": "https://api.github.com/users/mitsuhiko/repos", "site_admin": false, "starred_url": "https://api.github.com/users/mitsuhiko/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/mitsuhiko/subscriptions", "type": "User", "url": "https://api.github.com/users/mitsuhiko", "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-07-19T11:07:33Z
2021-09-08T23:07:59Z
2013-07-19T13:05:03Z
CONTRIBUTOR
resolved
Some examples in the quickstart talk about a server that returns application/json with a charset declaration even though no standard ever allowed that. Considering that people constantly get that wrong I recommend changing the example so that it just talks about application/json. http://docs.python-requests.org/en/latest/user/quickstart/#response-headers
{ "avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4", "events_url": "https://api.github.com/users/Lukasa/events{/privacy}", "followers_url": "https://api.github.com/users/Lukasa/followers", "following_url": "https://api.github.com/users/Lukasa/following{/other_user}", "gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Lukasa", "id": 1382556, "login": "Lukasa", "node_id": "MDQ6VXNlcjEzODI1NTY=", "organizations_url": "https://api.github.com/users/Lukasa/orgs", "received_events_url": "https://api.github.com/users/Lukasa/received_events", "repos_url": "https://api.github.com/users/Lukasa/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions", "type": "User", "url": "https://api.github.com/users/Lukasa", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/1467/reactions" }
https://api.github.com/repos/psf/requests/issues/1467/timeline
null
completed
null
null
false
[ "+1. Not a bad idea at all.\n", "See #1470.\n" ]
https://api.github.com/repos/psf/requests/issues/1466
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1466/labels{/name}
https://api.github.com/repos/psf/requests/issues/1466/comments
https://api.github.com/repos/psf/requests/issues/1466/events
https://github.com/psf/requests/pull/1466
16,962,782
MDExOlB1bGxSZXF1ZXN0NzAzNjk3OA==
1,466
Fix doc
{ "avatar_url": "https://avatars.githubusercontent.com/u/225986?v=4", "events_url": "https://api.github.com/users/s7v7nislands/events{/privacy}", "followers_url": "https://api.github.com/users/s7v7nislands/followers", "following_url": "https://api.github.com/users/s7v7nislands/following{/other_user}", "gists_url": "https://api.github.com/users/s7v7nislands/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/s7v7nislands", "id": 225986, "login": "s7v7nislands", "node_id": "MDQ6VXNlcjIyNTk4Ng==", "organizations_url": "https://api.github.com/users/s7v7nislands/orgs", "received_events_url": "https://api.github.com/users/s7v7nislands/received_events", "repos_url": "https://api.github.com/users/s7v7nislands/repos", "site_admin": false, "starred_url": "https://api.github.com/users/s7v7nislands/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/s7v7nislands/subscriptions", "type": "User", "url": "https://api.github.com/users/s7v7nislands", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2013-07-19T09:14:59Z
2021-09-08T23:01:17Z
2013-07-19T11:12:29Z
CONTRIBUTOR
resolved
fix doc
{ "avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4", "events_url": "https://api.github.com/users/Lukasa/events{/privacy}", "followers_url": "https://api.github.com/users/Lukasa/followers", "following_url": "https://api.github.com/users/Lukasa/following{/other_user}", "gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Lukasa", "id": 1382556, "login": "Lukasa", "node_id": "MDQ6VXNlcjEzODI1NTY=", "organizations_url": "https://api.github.com/users/Lukasa/orgs", "received_events_url": "https://api.github.com/users/Lukasa/received_events", "repos_url": "https://api.github.com/users/Lukasa/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Lukasa/starred{/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/1466/reactions" }
https://api.github.com/repos/psf/requests/issues/1466/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/1466.diff", "html_url": "https://github.com/psf/requests/pull/1466", "merged_at": "2013-07-19T11:12:29Z", "patch_url": "https://github.com/psf/requests/pull/1466.patch", "url": "https://api.github.com/repos/psf/requests/pulls/1466" }
true
[ "Brilliant stuff @s7v7nislands, thanks so much! :stars: \n" ]
https://api.github.com/repos/psf/requests/issues/1465
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1465/labels{/name}
https://api.github.com/repos/psf/requests/issues/1465/comments
https://api.github.com/repos/psf/requests/issues/1465/events
https://github.com/psf/requests/pull/1465
16,961,243
MDExOlB1bGxSZXF1ZXN0NzAzNjE2Mw==
1,465
Improve documentation of netrc authentication
{ "avatar_url": "https://avatars.githubusercontent.com/u/836426?v=4", "events_url": "https://api.github.com/users/dpursehouse/events{/privacy}", "followers_url": "https://api.github.com/users/dpursehouse/followers", "following_url": "https://api.github.com/users/dpursehouse/following{/other_user}", "gists_url": "https://api.github.com/users/dpursehouse/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/dpursehouse", "id": 836426, "login": "dpursehouse", "node_id": "MDQ6VXNlcjgzNjQyNg==", "organizations_url": "https://api.github.com/users/dpursehouse/orgs", "received_events_url": "https://api.github.com/users/dpursehouse/received_events", "repos_url": "https://api.github.com/users/dpursehouse/repos", "site_admin": false, "starred_url": "https://api.github.com/users/dpursehouse/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/dpursehouse/subscriptions", "type": "User", "url": "https://api.github.com/users/dpursehouse", "user_view_type": "public" }
[]
closed
true
null
[]
null
3
2013-07-19T08:32:39Z
2021-09-08T21:01:01Z
2013-07-19T13:45:18Z
CONTRIBUTOR
resolved
The documentation does not make it clear that when the credentials from netrc are used, Requests authenticates with HTTP Basic Auth. I just spent ages trying to figure out why it wasn't working, and it was because although the credentials in the netrc were correct, the server actually required HTTP Digest Auth. Add a section in the authentication documentation to make it clear that HTTP Basic Auth is used.
{ "avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4", "events_url": "https://api.github.com/users/Lukasa/events{/privacy}", "followers_url": "https://api.github.com/users/Lukasa/followers", "following_url": "https://api.github.com/users/Lukasa/following{/other_user}", "gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Lukasa", "id": 1382556, "login": "Lukasa", "node_id": "MDQ6VXNlcjEzODI1NTY=", "organizations_url": "https://api.github.com/users/Lukasa/orgs", "received_events_url": "https://api.github.com/users/Lukasa/received_events", "repos_url": "https://api.github.com/users/Lukasa/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Lukasa/starred{/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/1465/reactions" }
https://api.github.com/repos/psf/requests/issues/1465/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/1465.diff", "html_url": "https://github.com/psf/requests/pull/1465", "merged_at": "2013-07-19T13:45:18Z", "patch_url": "https://github.com/psf/requests/pull/1465.patch", "url": "https://api.github.com/repos/psf/requests/pulls/1465" }
true
[ "Hi @dpursehouse, thanks for this PR!\n\nI think this would be better placed as a subheading under the `Basic Authentication` section. Do you mind moving it?\n", "@Lukasa No problem. I just added a new commit.\n", "Awesome, that looks good to me! Thanks a bunch! :cake:\n" ]
https://api.github.com/repos/psf/requests/issues/1464
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1464/labels{/name}
https://api.github.com/repos/psf/requests/issues/1464/comments
https://api.github.com/repos/psf/requests/issues/1464/events
https://github.com/psf/requests/pull/1464
16,960,571
MDExOlB1bGxSZXF1ZXN0NzAzNTgzNg==
1,464
Fix #1322: Add note in docs about None not being sent as data
{ "avatar_url": "https://avatars.githubusercontent.com/u/836426?v=4", "events_url": "https://api.github.com/users/dpursehouse/events{/privacy}", "followers_url": "https://api.github.com/users/dpursehouse/followers", "following_url": "https://api.github.com/users/dpursehouse/following{/other_user}", "gists_url": "https://api.github.com/users/dpursehouse/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/dpursehouse", "id": 836426, "login": "dpursehouse", "node_id": "MDQ6VXNlcjgzNjQyNg==", "organizations_url": "https://api.github.com/users/dpursehouse/orgs", "received_events_url": "https://api.github.com/users/dpursehouse/received_events", "repos_url": "https://api.github.com/users/dpursehouse/repos", "site_admin": false, "starred_url": "https://api.github.com/users/dpursehouse/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/dpursehouse/subscriptions", "type": "User", "url": "https://api.github.com/users/dpursehouse", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2013-07-19T08:12:50Z
2021-09-08T21:01:01Z
2013-07-19T08:19:55Z
CONTRIBUTOR
resolved
In the case: payload = {'key1': 'value1', 'key2': 'value2', 'key3': None} r = requests.get("http://httpbin.org", params=payload) the parameter `key3` will not be sent as a parameter in the URL. Mention this in the documentation.
{ "avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4", "events_url": "https://api.github.com/users/Lukasa/events{/privacy}", "followers_url": "https://api.github.com/users/Lukasa/followers", "following_url": "https://api.github.com/users/Lukasa/following{/other_user}", "gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Lukasa", "id": 1382556, "login": "Lukasa", "node_id": "MDQ6VXNlcjEzODI1NTY=", "organizations_url": "https://api.github.com/users/Lukasa/orgs", "received_events_url": "https://api.github.com/users/Lukasa/received_events", "repos_url": "https://api.github.com/users/Lukasa/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Lukasa/starred{/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/1464/reactions" }
https://api.github.com/repos/psf/requests/issues/1464/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/1464.diff", "html_url": "https://github.com/psf/requests/pull/1464", "merged_at": "2013-07-19T08:19:55Z", "patch_url": "https://github.com/psf/requests/pull/1464.patch", "url": "https://api.github.com/repos/psf/requests/pulls/1464" }
true
[ "Awesome, thanks for this @dpursehouse! :star2: \n" ]
https://api.github.com/repos/psf/requests/issues/1463
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1463/labels{/name}
https://api.github.com/repos/psf/requests/issues/1463/comments
https://api.github.com/repos/psf/requests/issues/1463/events
https://github.com/psf/requests/pull/1463
16,943,863
MDExOlB1bGxSZXF1ZXN0NzAyNjY2OA==
1,463
Update urllib3 to a43319f
{ "avatar_url": "https://avatars.githubusercontent.com/u/1144861?v=4", "events_url": "https://api.github.com/users/AudriusButkevicius/events{/privacy}", "followers_url": "https://api.github.com/users/AudriusButkevicius/followers", "following_url": "https://api.github.com/users/AudriusButkevicius/following{/other_user}", "gists_url": "https://api.github.com/users/AudriusButkevicius/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/AudriusButkevicius", "id": 1144861, "login": "AudriusButkevicius", "node_id": "MDQ6VXNlcjExNDQ4NjE=", "organizations_url": "https://api.github.com/users/AudriusButkevicius/orgs", "received_events_url": "https://api.github.com/users/AudriusButkevicius/received_events", "repos_url": "https://api.github.com/users/AudriusButkevicius/repos", "site_admin": false, "starred_url": "https://api.github.com/users/AudriusButkevicius/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/AudriusButkevicius/subscriptions", "type": "User", "url": "https://api.github.com/users/AudriusButkevicius", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2013-07-18T21:09:16Z
2021-09-08T20:01:30Z
2013-07-18T22:00:28Z
NONE
resolved
Includes a fix for a race condition
{ "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/1463/reactions" }
https://api.github.com/repos/psf/requests/issues/1463/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/1463.diff", "html_url": "https://github.com/psf/requests/pull/1463", "merged_at": "2013-07-18T22:00:28Z", "patch_url": "https://github.com/psf/requests/pull/1463.patch", "url": "https://api.github.com/repos/psf/requests/pulls/1463" }
true
[ "thanks!\n" ]
https://api.github.com/repos/psf/requests/issues/1462
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1462/labels{/name}
https://api.github.com/repos/psf/requests/issues/1462/comments
https://api.github.com/repos/psf/requests/issues/1462/events
https://github.com/psf/requests/issues/1462
16,908,342
MDU6SXNzdWUxNjkwODM0Mg==
1,462
multipart/form-data and datetime data
{ "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
5
2013-07-18T08:16:08Z
2021-09-09T01:22:33Z
2013-08-27T07:59:06Z
NONE
resolved
I raise an bug that you already fix in the past on this issue : https://github.com/kennethreitz/requests/issues/661 or https://github.com/kennethreitz/requests/issues/737 I tried the same methodology with that code : ``` import requets requests.post("http://httpbin.org/post", data={'a': 0}) requests.post("http://httpbin.org/post", data={'a': 0.0}) requests.post("http://httpbin.org/post", data={'a': 0}, files={'b': 'foo'}) requests.post("http://httpbin.org/post", data={'a': 0.0}, files={'b': 'foo'}) ``` With the 1.2.0 version, no error is raised. With 1.2.3 version, I have that traceback : ``` Traceback (most recent call last): File "test.py", line 8, in <module> requests.post("http://httpbin.org/post", data={'a': 0.0}, files={'b': 'foo'}) File ".../dev/lib/python2.7/site-packages/requests/api.py", line 88, in post return request('post', url, data=data, **kwargs) File ".../dev/lib/python2.7/site-packages/requests/api.py", line 44, in request return session.request(method=method, url=url, **kwargs) File ".../dev/lib/python2.7/site-packages/requests/sessions.py", line 324, in request prep = req.prepare() File ".../dev/lib/python2.7/site-packages/requests/models.py", line 225, in prepare p.prepare_body(self.data, self.files) File ".../dev/lib/python2.7/site-packages/requests/models.py", line 385, in prepare_body (body, content_type) = self._encode_files(files, data) File ".../dev/lib/python2.7/site-packages/requests/models.py", line 133, in _encode_files body, content_type = encode_multipart_formdata(new_fields) File ".../dev/lib/python2.7/site-packages/requests/packages/urllib3/filepost.py", line 90, in encode_multipart_formdata body.write(data) TypeError: 'float' does not have the buffer interface ``` My original problem was with a python datetime in the data dict Thanks,
{ "avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4", "events_url": "https://api.github.com/users/Lukasa/events{/privacy}", "followers_url": "https://api.github.com/users/Lukasa/followers", "following_url": "https://api.github.com/users/Lukasa/following{/other_user}", "gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Lukasa", "id": 1382556, "login": "Lukasa", "node_id": "MDQ6VXNlcjEzODI1NTY=", "organizations_url": "https://api.github.com/users/Lukasa/orgs", "received_events_url": "https://api.github.com/users/Lukasa/received_events", "repos_url": "https://api.github.com/users/Lukasa/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions", "type": "User", "url": "https://api.github.com/users/Lukasa", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/1462/reactions" }
https://api.github.com/repos/psf/requests/issues/1462/timeline
null
completed
null
null
false
[ "Hi @ppavril, thanks for raising this issue!\n\nSo the problem here is that we don't ask for a string representation of keys or values. I think the correct fix is changing the following code (at [line 102 of models.py](https://github.com/kennethreitz/requests/blob/master/requests/models.py#L102)) from:\n\n``` python\nfor field, val in fields:\n if isinstance(val, basestring) or not hasattr(val, '__iter__'):\n val = [val]\n for v in val:\n if v is not None:\n new_fields.append(\n (field.decode('utf-8') if isinstance(field, bytes) else field,\n v.encode('utf-8') if isinstance(v, str) else v))\n```\n\nto:\n\n``` python\nfor field, val in fields:\n if isinstance(val, basestring) or not hasattr(val, '__iter__'):\n val = [val]\n for v in val:\n if v is not None:\n if not isinstance(v, basestring):\n v = str(v)\n\n new_fields.append(\n (field.decode('utf-8') if isinstance(field, bytes) else field,\n v.encode('utf-8') if isinstance(v, str) else v))\n```\n\nHowever, this is a breaking API change (we now coerce non-string types in the data dict), so should become part of #1459. We should also take advantage of that to clean this section of code up, because it's not totally easy to follow.\n\nIn the meantime @ppavril, you can work around this by calling `str()` on all your data values before passing them to Requests.\n", "Thank you for your quick answer.\nI think remaining on 1.2.0 version now and look at your improvements and chagement when I'll upgrade.\nThanks,\n", "Funny thing. I misread @Lukasa's snippet and typed out this whole response as to why it was not optimal then looked at it again and deleted it. :-) \n", "I rewrote that snippet twice. =P\n", "Implemented in #1537.\n" ]
https://api.github.com/repos/psf/requests/issues/1461
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1461/labels{/name}
https://api.github.com/repos/psf/requests/issues/1461/comments
https://api.github.com/repos/psf/requests/issues/1461/events
https://github.com/psf/requests/issues/1461
16,839,706
MDU6SXNzdWUxNjgzOTcwNg==
1,461
https POST works on Mac but fails on Windows
{ "avatar_url": "https://avatars.githubusercontent.com/u/815071?v=4", "events_url": "https://api.github.com/users/heetderks/events{/privacy}", "followers_url": "https://api.github.com/users/heetderks/followers", "following_url": "https://api.github.com/users/heetderks/following{/other_user}", "gists_url": "https://api.github.com/users/heetderks/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/heetderks", "id": 815071, "login": "heetderks", "node_id": "MDQ6VXNlcjgxNTA3MQ==", "organizations_url": "https://api.github.com/users/heetderks/orgs", "received_events_url": "https://api.github.com/users/heetderks/received_events", "repos_url": "https://api.github.com/users/heetderks/repos", "site_admin": false, "starred_url": "https://api.github.com/users/heetderks/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/heetderks/subscriptions", "type": "User", "url": "https://api.github.com/users/heetderks", "user_view_type": "public" }
[]
closed
true
null
[]
null
7
2013-07-16T23:18:40Z
2021-09-09T02:11:48Z
2013-07-28T06:05:25Z
NONE
resolved
Trying to post an API call to voeis.msu.montana.edu, a hydrology data management site running on https. Script works fine on my MacBookPro (v 10.8.2)... but fails miserably on Windows 7 (two different machines): \requests\adapters.py", line 331, in send raise SSLError(e) requests.exceptions.SSLError: [Errno 1] _ssl.c:504: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed I am pretty sure I was having the same issue when I was trying to use poster and urllib2 for the same purpose.
{ "avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4", "events_url": "https://api.github.com/users/Lukasa/events{/privacy}", "followers_url": "https://api.github.com/users/Lukasa/followers", "following_url": "https://api.github.com/users/Lukasa/following{/other_user}", "gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Lukasa", "id": 1382556, "login": "Lukasa", "node_id": "MDQ6VXNlcjEzODI1NTY=", "organizations_url": "https://api.github.com/users/Lukasa/orgs", "received_events_url": "https://api.github.com/users/Lukasa/received_events", "repos_url": "https://api.github.com/users/Lukasa/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Lukasa/starred{/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/1461/reactions" }
https://api.github.com/repos/psf/requests/issues/1461/timeline
null
completed
null
null
false
[ "So the problem here is that the SSL certificate presented by `voeis.msu.montana.edu` is failing certificate validation. You can temporary work around the problem by setting `verify=False` on your requests calls.\n\nI'm pretty sure this means their root certificate isn't in our local `cacerts.pem` file, which means that likely needs updating.\n", "Hmm, we actually do have GeoTrust Global CA in our certs file, and their certificate is super-old, so that seems unlikely to be it.\n", "I did use the verify=False workaround for now... but that is only a workaround. What I don't understand is why it works great on my Mac, but fails gloriously on Windows. What is different with how they handle certs? Is one trying to use your **cacert.pem**, and the other trying to use something else?\n", "my first guess would be openssl differentes \n", "I can reproduce this on arch. It seems the server doesn't include the intermediary certificate `GeoTrust SSL CA`.\nMaybe openssl on OS X caches certificates like browsers.\nYou should be able to extract the intermediary certificate with a browser in PEM-Format and add this to `cacert.pem`.\n", "@t-8ch did you mean for us to add it to the copy of `cacert.pem` in requests or just for @heetderks to do that for himself? If the former, I'm not sure we should be adding extra certs to that file, especially if it seems to be a server issue.\n", "I meant @heetderks. The certificate isn't included with Firefox or Chrome, so I don't think requests should ship it by default.\nAs you said, this is a server issue.\n" ]
https://api.github.com/repos/psf/requests/issues/1460
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1460/labels{/name}
https://api.github.com/repos/psf/requests/issues/1460/comments
https://api.github.com/repos/psf/requests/issues/1460/events
https://github.com/psf/requests/issues/1460
16,811,619
MDU6SXNzdWUxNjgxMTYxOQ==
1,460
Update Certs
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2013-07-16T14:15:20Z
2021-09-09T00:34:28Z
2013-10-21T01:10:53Z
CONTRIBUTOR
resolved
https://bitbucket.org/tiran/storeroom/
{ "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/1460/reactions" }
https://api.github.com/repos/psf/requests/issues/1460/timeline
null
completed
null
null
false
[ "Can we close this as a duplicate of #1659? There's no point having two of these open.\n" ]
https://api.github.com/repos/psf/requests/issues/1459
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1459/labels{/name}
https://api.github.com/repos/psf/requests/issues/1459/comments
https://api.github.com/repos/psf/requests/issues/1459/events
https://github.com/psf/requests/issues/1459
16,755,012
MDU6SXNzdWUxNjc1NTAxMg==
1,459
Consider 2.0
{ "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": "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-07-15T13:56:58Z
2021-09-09T00:34:30Z
2013-10-05T17:02:40Z
CONTRIBUTOR
resolved
/cc @Lukasa @sigmavirus24 What would Requests 2.0 include? - #1338 - ...
{ "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/1459/reactions" }
https://api.github.com/repos/psf/requests/issues/1459/timeline
null
completed
null
null
false
[ "My 2c:\n- support HTTPS proxies\n- require an explicit procotol in proxy URLs\n- remove the `proxies` parameter, introduce `proxy`. People can use transport adapters (see discussion in #1192)\n", "I agree with @t-8ch's first two points. (It's worth noting that the first point actually requires upstream work.) I'm not really bothered about his third, I'd be happy to leave it as-is.\n\nOn top of that, I'd want to consider:\n- Provide a `Session.build_request()` function (or equivalent). The biggest problem with preparing `Request`s yourself is that you have to reimplement portions of `Session.request()`. We should make it as easy as possible to not do that.\n", "Personally I'd like to seriously improve the docs for the project before we do another release for any major or minor version.\n\nAlso, this isn't a breaking API change but we need to hop back on it: https://github.com/kennethreitz/requests/issues/1155\n", "Perhaps we could also address #1294. It isn't hard to address but I'd like to stop nesting so many exceptions so far down. It seems like each library is capturing and re-raising in a wrapped exception. I understand why, I just don't like it in the slightest. I think we should at least attempt to expose the base message and errno (if any) to the user for greater ease of use.\n", "Also, I've been meaning to take a crack at #1166 and @Lukasa's suggestion to provide `Session.build_request()` would make that much much easier. `mock` makes it nice but making the methods as patchable as possible is also very nice.\n\nFor the record, I haven't looked closely at any of the vcr clones, but none of them really work the way I want them too. (Yes I know, that means I should make my own. But time is precious now that I have a real job.)\n", "Let's also add a fix for #1462, including a cleanup of the code in the `RequestsEncodingMixin` (which is pretty spaghetti-like).\n", "The fix I want to make for #1462 will require code that I implemented in #1338. Rather than do something complex with branches of branches, I'll just wait until we merge that. =)\n", "While we're at it #1187 could be re-opened and is certainly valid and is a large breaking change\n", "#1460\n", "We might consider starting a 2.0 branch so we can apply any hotfixes to the 1.x series while we work on 2.0. I for one don't think we should rush too quickly into 2.0. We can maintain the 2.0 branch pulling master in regularly, but send all 2.0 related PRs to that branch instead of master.\n", "+1 for having a branch. =)\n", "Also we should consider one last 1.x release since there are ~70 commits between 1.2.3 and now.\n", "Started a new branch #1509 \n", "https://github.com/kennethreitz/requests/releases/tag/2.0\n", ":heart:\n", "I am currently in the process of adding SOCKS proxy (SOCKS4 and SOCKS5) support to `urllib3`. Afterwards, I would like to submit a pull to get it integrated into `requests` 2.0. It is essentially an extension of the HTTPS proxy support patch. Usage would be as follows: `requests.get(url, proxies={\"http\": \"socks5://localhost:1080\"})`, with a scheme of either `socks4://` or `socks5://`.\n\nJust so I'm on board with what everyone wants, does this seem reasonable? Such support is a bit too low-level to be implemented simply as an Adapter, and I think it's something that should be provided by both libraries by default. I also have noticed that people have been requesting SOCKS support for a while now.\n", "I think it is probably reasonable. Getting a huge improvement in proxy support for 2.0 would be fantastic. Make sure you submit your PR to the 2.0 branch and not master.\n\nThanks @Anorov \n:metal: :cake: :beer: :cactus: \n", "@sigmavirus24 Yep, I fully agree.\n\nI'd just like to get the go-ahead from @kennethreitz before fully continuing, in the event he thinks it's not deserving of being put into requests core.\n", "If it's in vanilla urllib3, then +1 :)\n", "I've been working on support for setting separate connect, read and total timeout values in urllib3 - would probably require a change to the timeout interface for requests. https://github.com/shazow/urllib3/pull/231\n", "@kevinburke That looks awesome. Great job! It'll resolve some of our open issues, like #1577.\n\nWe need to propose our API changes. I really like the current clean form of `timeout`, so I think the best API is to do the following:\n- Add a `requests.utils.Timeout` class (which is a simple subclass of the `urllib3` timeout class.\n- Extend the `timeout` parameter to be a number or optionally an instance of the `Timeout` class.\n\n@kevinburke, when this gets merged you should let me know, and I can either implement the Requests' side myself or code review your version of it. =)\n", "@kevinburke request:\n\nAllow the Timeout class's `__init__` method to take an instance of itself and handles `None`. If it does, we can always just easily do (on our end):\n\n```\ndef request(method, url, data=None, ..., timeout=None, ...):\n timeout = Timeout(timeout)\n # ...\n```\n\nIf you can do that :heart:\n", "@sigmavirus24 The only issue there is that None has a specific meaning for timeouts - it implies never timeout, vs. some sentinel object which signifies \"use the system default timeout\"\n", "@kevinburke since this is going into 2.0 which do you think is better. Currently I believe we do not operate with any default timeout (i.e., None) so keeping that behaviour would not be a big deal. Using some \"system default\" (which I frankly wasn't aware existed) would be a breaking API change and would be okay since 2.0 allows for those.\n\nI personally am in favor of keeping the current behaviour but I'm open to arguments for using a system default.\n", "Make timeout universal, or create a new universalTimeout param,\ncoz there seem to be multiple cases where timeout does not work... :-(\nhttps://github.com/kennethreitz/requests/issues/1617\nhttps://github.com/kennethreitz/requests/issues/1577\n", "Can we move all discussion of timeouts to #1594 please?\n", "Closing this since 2.0 has been released\n" ]
https://api.github.com/repos/psf/requests/issues/1458
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1458/labels{/name}
https://api.github.com/repos/psf/requests/issues/1458/comments
https://api.github.com/repos/psf/requests/issues/1458/events
https://github.com/psf/requests/pull/1458
16,714,854
MDExOlB1bGxSZXF1ZXN0NjkwOTI2NA==
1,458
Trivial typo in README
{ "avatar_url": "https://avatars.githubusercontent.com/u/674963?v=4", "events_url": "https://api.github.com/users/poirier/events{/privacy}", "followers_url": "https://api.github.com/users/poirier/followers", "following_url": "https://api.github.com/users/poirier/following{/other_user}", "gists_url": "https://api.github.com/users/poirier/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/poirier", "id": 674963, "login": "poirier", "node_id": "MDQ6VXNlcjY3NDk2Mw==", "organizations_url": "https://api.github.com/users/poirier/orgs", "received_events_url": "https://api.github.com/users/poirier/received_events", "repos_url": "https://api.github.com/users/poirier/repos", "site_admin": false, "starred_url": "https://api.github.com/users/poirier/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/poirier/subscriptions", "type": "User", "url": "https://api.github.com/users/poirier", "user_view_type": "public" }
[]
closed
true
null
[]
null
4
2013-07-13T13:07:40Z
2021-09-08T20:01:29Z
2013-07-13T13:15:29Z
NONE
resolved
Utterly trivial :-)
{ "avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4", "events_url": "https://api.github.com/users/Lukasa/events{/privacy}", "followers_url": "https://api.github.com/users/Lukasa/followers", "following_url": "https://api.github.com/users/Lukasa/following{/other_user}", "gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Lukasa", "id": 1382556, "login": "Lukasa", "node_id": "MDQ6VXNlcjEzODI1NTY=", "organizations_url": "https://api.github.com/users/Lukasa/orgs", "received_events_url": "https://api.github.com/users/Lukasa/received_events", "repos_url": "https://api.github.com/users/Lukasa/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Lukasa/starred{/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/1458/reactions" }
https://api.github.com/repos/psf/requests/issues/1458/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/1458.diff", "html_url": "https://github.com/psf/requests/pull/1458", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/1458.patch", "url": "https://api.github.com/repos/psf/requests/pulls/1458" }
true
[ "Thanks for the pull request @poirier! However, that's not a typo: it means 'highlight this like it's python in an interactive console'. =D\n", "D'oh! Thinking too much about PyCon lately and assumed that's what happened to someone else. Sorry for the bother.\n", "Pull requests are never a bother, we love having them, even if we don't accept them. Thanks so much for contributing! =)\n", "> Pull requests are never a bother, we love having them, even if we don't accept them. Thanks so much for contributing! =)\n\nThis x2. Please don't be afraid to open other PRs. And if you'd like to ask someone in private before doing so, you can email me and I'll happily answer.\n" ]
https://api.github.com/repos/psf/requests/issues/1457
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1457/labels{/name}
https://api.github.com/repos/psf/requests/issues/1457/comments
https://api.github.com/repos/psf/requests/issues/1457/events
https://github.com/psf/requests/issues/1457
16,712,616
MDU6SXNzdWUxNjcxMjYxNg==
1,457
Returns empty with Google over HTTPS
{ "avatar_url": "https://avatars.githubusercontent.com/u/4113784?v=4", "events_url": "https://api.github.com/users/liquidscorpio/events{/privacy}", "followers_url": "https://api.github.com/users/liquidscorpio/followers", "following_url": "https://api.github.com/users/liquidscorpio/following{/other_user}", "gists_url": "https://api.github.com/users/liquidscorpio/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/liquidscorpio", "id": 4113784, "login": "liquidscorpio", "node_id": "MDQ6VXNlcjQxMTM3ODQ=", "organizations_url": "https://api.github.com/users/liquidscorpio/orgs", "received_events_url": "https://api.github.com/users/liquidscorpio/received_events", "repos_url": "https://api.github.com/users/liquidscorpio/repos", "site_admin": false, "starred_url": "https://api.github.com/users/liquidscorpio/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/liquidscorpio/subscriptions", "type": "User", "url": "https://api.github.com/users/liquidscorpio", "user_view_type": "public" }
[]
closed
true
null
[]
null
37
2013-07-13T08:40:53Z
2021-09-09T02:11:46Z
2013-07-17T11:46:19Z
NONE
resolved
``` python import requests In [2]: r = requests.get('https://google.com') In [3]: r.text Out[3]: u'' In [4]: r = requests.get('http://google.com') In [5]: r.text Out[5]: u'<!doctype html><html itemscope="itemscope"... ```
{ "avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4", "events_url": "https://api.github.com/users/Lukasa/events{/privacy}", "followers_url": "https://api.github.com/users/Lukasa/followers", "following_url": "https://api.github.com/users/Lukasa/following{/other_user}", "gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Lukasa", "id": 1382556, "login": "Lukasa", "node_id": "MDQ6VXNlcjEzODI1NTY=", "organizations_url": "https://api.github.com/users/Lukasa/orgs", "received_events_url": "https://api.github.com/users/Lukasa/received_events", "repos_url": "https://api.github.com/users/Lukasa/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Lukasa/starred{/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/1457/reactions" }
https://api.github.com/repos/psf/requests/issues/1457/timeline
null
completed
null
null
false
[ "Facing similiar issue with Twitter too\n\n``` python\nIn [13]: r = requests.get('https://twitter.com')\n\nIn [14]: r.text\nOut[14]: u''\n\nIn [15]: r = requests.get('http://twitter.com')\n\nIn [16]: r.text\nOut[16]: u''\n\nIn [17]: r.history\nOut[17]: (<Response [301]>,)\n\nIn [18]: r.history[0].headers['location']\nOut[18]: 'https://twitter.com/'\n```\n\nBecause Twitter always redirects to https:// I am unable to retrieve any response from non-htttps twitter either.\n", "@drepo This works just fine on my machine. I'm inclined to suggest that you've got an SSL-related problem. What OS are you using?\n", "Fedora 18 (3.9.6-200.fc18.x86_64)\n", "Two follow-up questions: where did you get the version of Python you're using (e.g. did you built it yourself?), and what version of OpenSSL do you have installed?\n", "$ python -V\nPython 2.7.3\n$ openssl\nOpenSSL> version\nOpenSSL 1.0.1e-fips 11 Feb 2013\n", "Python is OS distro default not compiled.\n", "That's strange, the default OS distro should be fine with SSL. Out of interest, did you `pip install` requests or did you get it from `yum`? (Also, what version are you running? `import requests; print requests.__version__`)\n", "``` python\nIn [8]: requests.__version__\nOut[8]: '1.2.3'\n```\n\nRequests is installed from pip.\n", "Wow, that's bizarre. Let me spin up an F18 VM and see what I can see. It'll take a little while.\n", "``` python\nIn [1]: import httplib2\n\nIn [2]: h = httplib2.Http()\n\nIn [3]: r, c = h.request('https://google.com')\n\nIn [4]: c\nOut[4]: '<!doctype html><html itemscope=\"itemscope\" itemtype=\"http://schema.org/WebPage\">...\n```\n\nWorking using httplib2!\n", "So quite likely not an SSL issue.\n", "I disagree. =) We do some funky stuff with SSL, differently to what httplib2 does. Additionally, seeing as you only see it on HTTPS, there's really only one conclusion. =)\n", "BTW, the status_code on all failed https requests using (requests) is always 200.\n", "Twitter sends a content length header, what do you get?\n\n``` py\nr = requests.get('https://twitter.com')\nprint r.headers['content-length']\n```\n\nAre you using pyOpenSSL/pyasn1?\n\n```\n$ pip freeze | egrep 'pyOpenSSL|pyasn1'\npyOpenSSL==0.13\npyasn1==0.1.7\n```\n", "@t-8ch Response to your questions:\n\n``` shell\n# pip freeze | egrep 'pyOpenSSL|pyasn1'\npyOpenSSL==0.13\n```\n\n``` python\nIn [1]: import requests\n\nIn [2]: r = requests.get('https://twitter.com')\n\nIn [3]: r.headers['content-length']\n---------------------------------------------------------------------------\nKeyError \n```\n", "It really doesn't look like you're getting any data on that connection.\n", "And still it is taking horrible long (>40secs) to respond.\n", "Can you try with python3?\n", "@t-8ch Let me try.\n", "Ok, I cannot reproduce this on a fresh Fedora install, which means it's either a problem with your system setup or your network. I'm going to let @t-8ch take the lead on the system setup end because he knows it better than me. =)\n", "@Lukasa Thanks for the help. I am setting up a virtenv for py3 and trying it out as per @t-8ch's sugesstion.\n", "@t-8ch Using python3, the problem persists\n\n``` shell\nPython 3.3.0 (default, Sep 29 2012, 22:07:38) \n[GCC 4.7.2 20120921 (Red Hat 4.7.2-2)] on linux\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\n>>> import requests\n>>> r = requests.get('https://google.com')\n>>> r.text\n''\n>>> requests.__version__\n'1.2.3'\n>>> \n```\n", "Hm, I can't reproduce on my VM.\n\nWhat does the following do:\n\n``` py\nimport requests\nimport ssl\nimport socket\nimport time\n\nHOST = b'google.com'\n\nprint('--> plain socket')\nsock = socket.create_connection((HOST, 443))\nssl_sock = ssl.wrap_socket(sock)\nssl_sock.send(b'GET / HTTP/1.1\\nHost: ' + HOST + b'\\n\\n')\ntime.sleep(1)\nprint(ssl_sock.recv(1000))\n\nprint('--> urllib3')\nhttp = requests.packages.urllib3.PoolManager()\nr = http.request('GET', b'https://' + HOST + b'/')\nprint(r.data)\n```\n", "@t-8ch \nI messed up my Fedora 18 installation and did a clean install of F19; the problem persists. (Note: also persist on Mint 15). Here is the output of your code:\n\n``` shell\n--> plain socket\nHTTP/1.1 301 Moved Permanently\nLocation: https://www.google.com/\nContent-Type: text/html; charset=UTF-8\nDate: Mon, 15 Jul 2013 08:54:18 GMT\nExpires: Wed, 14 Aug 2013 08:54:18 GMT\nCache-Control: public, max-age=2592000\nServer: gws\nContent-Length: 220\nX-XSS-Protection: 1; mode=block\nX-Frame-Options: SAMEORIGIN\n\n<HTML><HEAD><meta http-equiv=\"content-type\" content=\"text/html;charset=utf-8\">\n<TITLE>301 Moved</TITLE></HEAD><BODY>\n<H1>301 Moved</H1>\nThe document has moved\n<A HREF=\"https://www.google.com/\">here</A>.\n</BODY></HTML>\n\n--> urllib3\nTraceback (most recent call last):\n File \"temp.py\", line 16, in <module>\n http = requests.packages.urllib3.PoolManager()\nAttributeError: 'module' object has no attribute 'packages'\n```\n", "That's interesting, it looks like your Requests install is no good. How are you able to put requests through that at all?\n", "I do not know if its bad (used pip only). But observed a new thing, Non HTTPS HEAD requests are also failing in the same vein.\n\n``` python\nIn [4]: r = requests.head('http://google.com')\n\nIn [5]: r\nOut[5]: <Response [200]>\n\nIn [6]: r.text\nOut[6]: u''\n```\n", "HEAD requests are not supposed to return any content in their body, so this is expected.\n@Lukasa is right. Your installation of requests is seriously broken.\nWhat do `requests.__file__` and `requests.__dict__` contain?\n", "Post a fresh install, I usually use an init script to setup/install the tools and requests is a part of that script. This time, post installation, I only installed requests and it is working:\n\n``` python\n>>> import requests\n>>> r = requests.get('https://google.com')\n>>> r.text\nu'<!doctype html><html itemscope=\"itemscope\" it\n```\n\nIt seems there is something in that installation chain which is breaking requests. I will have to investigate further to figure out, my preliminary guess is that some oauth library is breaking it. \n", "Ok, I'm glad you have somewhere to start looking. In the meantime, as this is not a Requests bug, I'm going to close this issue. Feel free to keep commenting here if you need further assistance!\n", "As and when I do figure out the situation, I will post it here. BTW, Thanks @Lukasa and @t-8ch, you have been quite helpful. :)\n" ]
https://api.github.com/repos/psf/requests/issues/1456
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1456/labels{/name}
https://api.github.com/repos/psf/requests/issues/1456/comments
https://api.github.com/repos/psf/requests/issues/1456/events
https://github.com/psf/requests/pull/1456
16,712,298
MDExOlB1bGxSZXF1ZXN0NjkwODMyNQ==
1,456
Changed the "im_used" informational status code for the value given by IANA (226)
{ "avatar_url": "https://avatars.githubusercontent.com/u/4022350?v=4", "events_url": "https://api.github.com/users/phndiaye/events{/privacy}", "followers_url": "https://api.github.com/users/phndiaye/followers", "following_url": "https://api.github.com/users/phndiaye/following{/other_user}", "gists_url": "https://api.github.com/users/phndiaye/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/phndiaye", "id": 4022350, "login": "phndiaye", "node_id": "MDQ6VXNlcjQwMjIzNTA=", "organizations_url": "https://api.github.com/users/phndiaye/orgs", "received_events_url": "https://api.github.com/users/phndiaye/received_events", "repos_url": "https://api.github.com/users/phndiaye/repos", "site_admin": false, "starred_url": "https://api.github.com/users/phndiaye/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/phndiaye/subscriptions", "type": "User", "url": "https://api.github.com/users/phndiaye", "user_view_type": "public" }
[ { "color": "e11d21", "default": false, "description": null, "id": 44501305, "name": "Not Ready To Merge", "node_id": "MDU6TGFiZWw0NDUwMTMwNQ==", "url": "https://api.github.com/repos/psf/requests/labels/Not%20Ready%20To%20Merge" } ]
closed
true
null
[]
null
4
2013-07-13T07:57:23Z
2021-09-08T23:07:22Z
2013-07-15T13:21:31Z
NONE
resolved
Changed the "im_used" informational status code for the value given by IANA (226) See RFC 3229 at http://tools.ietf.org/html/rfc3229#section-10.4.1 and HTTP status codes at http://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml
{ "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/1456/reactions" }
https://api.github.com/repos/psf/requests/issues/1456/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/1456.diff", "html_url": "https://github.com/psf/requests/pull/1456", "merged_at": "2013-07-15T13:21:31Z", "patch_url": "https://github.com/psf/requests/pull/1456.patch", "url": "https://api.github.com/repos/psf/requests/pulls/1456" }
true
[ "@phndiaye Awesome, thanks for this! While we're here, do you want to fix up 208? It should be \"already_reported\".\n", "Done. By the way, i've seen some status codes that did not match with the ones in the IANA list, but i don't if @kennethreitz did that intentionnaly or if it's just some errors. \n\nEg:\n\n`uri_too_long` is set to 122 in requests but the IANA set it to 414 (103 to 199 are unassigned)\n", "Some are intentional, some are errors. `uri_too_long` looks like it's wrong to me. =)\n", "That's what i thought too :). I will be searching for some status like the `uri_too_long` and do a \"global\" commit of the corrections.\n" ]
https://api.github.com/repos/psf/requests/issues/1455
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1455/labels{/name}
https://api.github.com/repos/psf/requests/issues/1455/comments
https://api.github.com/repos/psf/requests/issues/1455/events
https://github.com/psf/requests/issues/1455
16,712,270
MDU6SXNzdWUxNjcxMjI3MA==
1,455
The http status code for "IM USED" is 226 and not 208
{ "avatar_url": "https://avatars.githubusercontent.com/u/4022350?v=4", "events_url": "https://api.github.com/users/phndiaye/events{/privacy}", "followers_url": "https://api.github.com/users/phndiaye/followers", "following_url": "https://api.github.com/users/phndiaye/following{/other_user}", "gists_url": "https://api.github.com/users/phndiaye/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/phndiaye", "id": 4022350, "login": "phndiaye", "node_id": "MDQ6VXNlcjQwMjIzNTA=", "organizations_url": "https://api.github.com/users/phndiaye/orgs", "received_events_url": "https://api.github.com/users/phndiaye/received_events", "repos_url": "https://api.github.com/users/phndiaye/repos", "site_admin": false, "starred_url": "https://api.github.com/users/phndiaye/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/phndiaye/subscriptions", "type": "User", "url": "https://api.github.com/users/phndiaye", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2013-07-13T07:52:32Z
2021-09-09T02:11:54Z
2013-07-13T15:47:00Z
NONE
resolved
In **request.status_codes**, the **im_used status code is 208**, but the _IANA give it the 226 status code_, as you can see it at http://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml
{ "avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4", "events_url": "https://api.github.com/users/Lukasa/events{/privacy}", "followers_url": "https://api.github.com/users/Lukasa/followers", "following_url": "https://api.github.com/users/Lukasa/following{/other_user}", "gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Lukasa", "id": 1382556, "login": "Lukasa", "node_id": "MDQ6VXNlcjEzODI1NTY=", "organizations_url": "https://api.github.com/users/Lukasa/orgs", "received_events_url": "https://api.github.com/users/Lukasa/received_events", "repos_url": "https://api.github.com/users/Lukasa/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Lukasa/starred{/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/1455/reactions" }
https://api.github.com/repos/psf/requests/issues/1455/timeline
null
completed
null
null
false
[ "See #1456 for the discussion of this. \n" ]
https://api.github.com/repos/psf/requests/issues/1454
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1454/labels{/name}
https://api.github.com/repos/psf/requests/issues/1454/comments
https://api.github.com/repos/psf/requests/issues/1454/events
https://github.com/psf/requests/issues/1454
16,641,756
MDU6SXNzdWUxNjY0MTc1Ng==
1,454
requests force override query string encoding
{ "avatar_url": "https://avatars.githubusercontent.com/u/254841?v=4", "events_url": "https://api.github.com/users/thadeusb/events{/privacy}", "followers_url": "https://api.github.com/users/thadeusb/followers", "following_url": "https://api.github.com/users/thadeusb/following{/other_user}", "gists_url": "https://api.github.com/users/thadeusb/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/thadeusb", "id": 254841, "login": "thadeusb", "node_id": "MDQ6VXNlcjI1NDg0MQ==", "organizations_url": "https://api.github.com/users/thadeusb/orgs", "received_events_url": "https://api.github.com/users/thadeusb/received_events", "repos_url": "https://api.github.com/users/thadeusb/repos", "site_admin": false, "starred_url": "https://api.github.com/users/thadeusb/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/thadeusb/subscriptions", "type": "User", "url": "https://api.github.com/users/thadeusb", "user_view_type": "public" }
[]
closed
true
null
[]
null
3
2013-07-11T16:57:14Z
2021-09-08T13:05:45Z
2013-07-13T15:47:11Z
NONE
resolved
I am dealing with a legacy platform that does not understand URL encoded parameters. I have the following parameters ``` params = {'fiz': 'foo:bar', 'biz': 'barfoo'} ``` url generated by requests ``` http://localhost/?fiz=foo%3Abar&biz=barfoo ``` required url for the legacy platform ``` http://localhost/?fiz=foo:bar&biz=barfoo ``` I tried creating a custom query string and adding that to the url, however requests will decode this query, and re-encode it. ``` improt urllib qry = urllib.urlencode(params).replace('%3A', ':') requests.get(url+'?'+qry) #: requests encodes the colon back to %3A ``` Is there any quick work around that doesn't look as verbose as using straight urllib2? is it possible to get a "safe" or "replace" list hooked into the API, this would need to be done at the requests layer as python 2.7 is required.
{ "avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4", "events_url": "https://api.github.com/users/Lukasa/events{/privacy}", "followers_url": "https://api.github.com/users/Lukasa/followers", "following_url": "https://api.github.com/users/Lukasa/following{/other_user}", "gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Lukasa", "id": 1382556, "login": "Lukasa", "node_id": "MDQ6VXNlcjEzODI1NTY=", "organizations_url": "https://api.github.com/users/Lukasa/orgs", "received_events_url": "https://api.github.com/users/Lukasa/received_events", "repos_url": "https://api.github.com/users/Lukasa/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Lukasa/starred{/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/1454/reactions" }
https://api.github.com/repos/psf/requests/issues/1454/timeline
null
completed
null
null
false
[ "This is a bit awkward to do in Requests. As I see it, you have two options. The first is to prepare the `Request` objects yourself:\n\n``` python\nimport requests\nimport urllib\n\nurl = 'http://test.com/'\nqry = urllib.urlencode(params).replace('%3A', ':')\n\ns = requests.Session()\nreq = requests.Request(method='GET', url=url)\nprep = req.prepare()\nprep.url = url + qry\nr = s.send(prep)\n```\n\nYour other option would be to build a Transport Adapter that mutates the URLs before sending them on, like so:\n\n``` python\nimport requests\nimport urllib\n\nclass MutatingAdapter(requests.adapters.HTTPAdapter):\n def send(self, request, **kwargs):\n main, querystr = request.url.split('?') # Nasty hack, not always valid.\n querystr = urllib.unquote(querystr)\n querystr = urllib.quote(querystr, '/&:=')\n request.url = '?'.join([main, querystr])\n\n super(MutatingAdapter, self).send(request, **kwargs)\n```\n", "I recommend the first option.\n", "you could try the json parameter of requests.post() and requests.get() http://stackoverflow.com/a/26344315/1056345" ]
https://api.github.com/repos/psf/requests/issues/1453
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1453/labels{/name}
https://api.github.com/repos/psf/requests/issues/1453/comments
https://api.github.com/repos/psf/requests/issues/1453/events
https://github.com/psf/requests/issues/1453
16,613,275
MDU6SXNzdWUxNjYxMzI3NQ==
1,453
Provide way to cache DNS lookups when making repeated requests to the same host
{ "avatar_url": "https://avatars.githubusercontent.com/u/522344?v=4", "events_url": "https://api.github.com/users/alanhamlett/events{/privacy}", "followers_url": "https://api.github.com/users/alanhamlett/followers", "following_url": "https://api.github.com/users/alanhamlett/following{/other_user}", "gists_url": "https://api.github.com/users/alanhamlett/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/alanhamlett", "id": 522344, "login": "alanhamlett", "node_id": "MDQ6VXNlcjUyMjM0NA==", "organizations_url": "https://api.github.com/users/alanhamlett/orgs", "received_events_url": "https://api.github.com/users/alanhamlett/received_events", "repos_url": "https://api.github.com/users/alanhamlett/repos", "site_admin": false, "starred_url": "https://api.github.com/users/alanhamlett/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/alanhamlett/subscriptions", "type": "User", "url": "https://api.github.com/users/alanhamlett", "user_view_type": "public" }
[]
closed
true
null
[]
null
5
2013-07-11T03:57:42Z
2021-09-08T17:05:28Z
2013-07-20T15:41:30Z
CONTRIBUTOR
resolved
A nice feature would be the ability to cache DNS requests when making multiple requests to the same host. This would include: - an optional timeout for invalidating a cached DNS lookup - possibly persist the cache across multiple python processes
{ "avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4", "events_url": "https://api.github.com/users/Lukasa/events{/privacy}", "followers_url": "https://api.github.com/users/Lukasa/followers", "following_url": "https://api.github.com/users/Lukasa/following{/other_user}", "gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Lukasa", "id": 1382556, "login": "Lukasa", "node_id": "MDQ6VXNlcjEzODI1NTY=", "organizations_url": "https://api.github.com/users/Lukasa/orgs", "received_events_url": "https://api.github.com/users/Lukasa/received_events", "repos_url": "https://api.github.com/users/Lukasa/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Lukasa/starred{/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/1453/reactions" }
https://api.github.com/repos/psf/requests/issues/1453/timeline
null
completed
null
null
false
[ "Hi @alanhamlett, thanks for raising this issue!\n\nUnfortunately, this would not be simple to do. Requests doesn't handle any of the low-level HTTP connection processing, we pass that off to [urllib3](https://github.com/shazow/urllib3). urllib3 also appears not to have any explicit hostname resolution calls in it, which means that it passes that job off to httplib in the standard library.\n\nIf httplib provided that feature this would be easy enough to plumb through, but it doesn't. This means any change made in urllib3 would have to circumvent the standard httplib hostname resolution behaviour, which would be pretty awkward. Altogether I doubt there's going to be much appetite for this feature.\n", "My use case:\nFor some reason, requests to my local server via its vhost name are ultra slow, and I suspect DNS to be the culprit. Everyone suggests to use 127.0.0.1 rather than `localhost` or whatnot. Unfortunately, I can't do that - the server runs on HTTPS which needs the host name to work. So I'm stuck with DNS query every cron job.\n", "@rr- You're taking a long time to resolve `localhost`? That name should be served from your hosts file, and shouldn't take long _at all_. If you're only using `localhost` as an example, you should consider adding a hosts file entry for the server in question.\n", "I'm sorry but I jumped to conclusions. The bottleneck was somewhere else altogether and the logs I had fooled me into thinking it was the connection that was slow. You're right, the requests are fast. Yep, I used `localhost` only as example. Yep, using `/etc/hosts` improves situation (and seems to be downright necessary for certain scenarios involving NAT).\n", "@rr- You should not need `/etc/hosts` for anything else except `localhost`.\nIf you need a DNS cache check out `nscd` or `dnsmasq`\n" ]
https://api.github.com/repos/psf/requests/issues/1452
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1452/labels{/name}
https://api.github.com/repos/psf/requests/issues/1452/comments
https://api.github.com/repos/psf/requests/issues/1452/events
https://github.com/psf/requests/issues/1452
16,565,527
MDU6SXNzdWUxNjU2NTUyNw==
1,452
The users' doc is mixing the python2, python3 syntax and error.
{ "avatar_url": "https://avatars.githubusercontent.com/u/225986?v=4", "events_url": "https://api.github.com/users/s7v7nislands/events{/privacy}", "followers_url": "https://api.github.com/users/s7v7nislands/followers", "following_url": "https://api.github.com/users/s7v7nislands/following{/other_user}", "gists_url": "https://api.github.com/users/s7v7nislands/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/s7v7nislands", "id": 225986, "login": "s7v7nislands", "node_id": "MDQ6VXNlcjIyNTk4Ng==", "organizations_url": "https://api.github.com/users/s7v7nislands/orgs", "received_events_url": "https://api.github.com/users/s7v7nislands/received_events", "repos_url": "https://api.github.com/users/s7v7nislands/repos", "site_admin": false, "starred_url": "https://api.github.com/users/s7v7nislands/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/s7v7nislands/subscriptions", "type": "User", "url": "https://api.github.com/users/s7v7nislands", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2013-07-10T08:18:45Z
2021-09-09T00:10:12Z
2014-02-03T10:53:41Z
CONTRIBUTOR
resolved
Should we fix this? if I file a patch, which python version syntax is perfered? for example: python2: >>> print r.url python3: >>> r.content b'[{"repository"
{ "avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4", "events_url": "https://api.github.com/users/Lukasa/events{/privacy}", "followers_url": "https://api.github.com/users/Lukasa/followers", "following_url": "https://api.github.com/users/Lukasa/following{/other_user}", "gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Lukasa", "id": 1382556, "login": "Lukasa", "node_id": "MDQ6VXNlcjEzODI1NTY=", "organizations_url": "https://api.github.com/users/Lukasa/orgs", "received_events_url": "https://api.github.com/users/Lukasa/received_events", "repos_url": "https://api.github.com/users/Lukasa/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Lukasa/starred{/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/1452/reactions" }
https://api.github.com/repos/psf/requests/issues/1452/timeline
null
completed
null
null
false
[ "Hi @s7v7nislands, thanks for opening this issue!\n\nWe're always open to having documentation updates! If you feel the need to make this change, we would expect Python 2 to be the version in the documentation.\n", "@s7v7nislands basically I think it somewhat safe to assume that people using python 3000 realize that print is now a function that requires parentheses. As for displaying data, you can use `b'[{\"repository\": \"kennethreitz/requests\"}]'` because on python 2 `b'string' == 'string'` unlike python 3000 so that distinction is actually good to point out.\n\nI guess, I'm saying that the better way is to put as much subtext in as possible (if that makes sense). I've had \"improve requests documentation\" on my todo list for a while now but I keep finding it hard to find the time. I know I won't have time this weekend but ideally next weekend I might be able to get to some of this. We really need to explicitly define the behaviour differences on python 2 and python 3. For simple examples, you can stick to whichever you feel is best. Python 2 (or python 3.3) might give you the most flexibility so you can clearly illustrate \"HEY THIS IS UNICODE!\" with a `u'string'`.\n\nAnd either way, it's good practice whether writing python 2 or 3 to use parentheses when writing print statements (especially if you want your code to work on both without much effort) so tacitly enforcing that with users is a good thing. :) In all the examples for github3.py (for [example](http://github3py.readthedocs.org/en/latest/#example)) I use syntax which I'm certain will work on python 2.6+ since the library works on python 2.6+. \n" ]
https://api.github.com/repos/psf/requests/issues/1451
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1451/labels{/name}
https://api.github.com/repos/psf/requests/issues/1451/comments
https://api.github.com/repos/psf/requests/issues/1451/events
https://github.com/psf/requests/pull/1451
16,547,723
MDExOlB1bGxSZXF1ZXN0NjgxOTAyMw==
1,451
View a PreparedRequest as a curl command
{ "avatar_url": "https://avatars.githubusercontent.com/u/470362?v=4", "events_url": "https://api.github.com/users/matthewlmcclure/events{/privacy}", "followers_url": "https://api.github.com/users/matthewlmcclure/followers", "following_url": "https://api.github.com/users/matthewlmcclure/following{/other_user}", "gists_url": "https://api.github.com/users/matthewlmcclure/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/matthewlmcclure", "id": 470362, "login": "matthewlmcclure", "node_id": "MDQ6VXNlcjQ3MDM2Mg==", "organizations_url": "https://api.github.com/users/matthewlmcclure/orgs", "received_events_url": "https://api.github.com/users/matthewlmcclure/received_events", "repos_url": "https://api.github.com/users/matthewlmcclure/repos", "site_admin": false, "starred_url": "https://api.github.com/users/matthewlmcclure/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/matthewlmcclure/subscriptions", "type": "User", "url": "https://api.github.com/users/matthewlmcclure", "user_view_type": "public" }
[ { "color": "e11d21", "default": false, "description": null, "id": 44501305, "name": "Not Ready To Merge", "node_id": "MDU6TGFiZWw0NDUwMTMwNQ==", "url": "https://api.github.com/repos/psf/requests/labels/Not%20Ready%20To%20Merge" } ]
closed
true
null
[]
null
0
2013-07-09T21:11:38Z
2021-09-08T20:01:29Z
2013-07-13T15:46:27Z
CONTRIBUTOR
resolved
This is a prototype solution for https://github.com/kennethreitz/requests/issues/1450 .
{ "avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4", "events_url": "https://api.github.com/users/Lukasa/events{/privacy}", "followers_url": "https://api.github.com/users/Lukasa/followers", "following_url": "https://api.github.com/users/Lukasa/following{/other_user}", "gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Lukasa", "id": 1382556, "login": "Lukasa", "node_id": "MDQ6VXNlcjEzODI1NTY=", "organizations_url": "https://api.github.com/users/Lukasa/orgs", "received_events_url": "https://api.github.com/users/Lukasa/received_events", "repos_url": "https://api.github.com/users/Lukasa/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Lukasa/starred{/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/1451/reactions" }
https://api.github.com/repos/psf/requests/issues/1451/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/1451.diff", "html_url": "https://github.com/psf/requests/pull/1451", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/1451.patch", "url": "https://api.github.com/repos/psf/requests/pulls/1451" }
true
[]
https://api.github.com/repos/psf/requests/issues/1450
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1450/labels{/name}
https://api.github.com/repos/psf/requests/issues/1450/comments
https://api.github.com/repos/psf/requests/issues/1450/events
https://github.com/psf/requests/issues/1450
16,547,535
MDU6SXNzdWUxNjU0NzUzNQ==
1,450
View a Request, PreparedRequest as a curl command
{ "avatar_url": "https://avatars.githubusercontent.com/u/470362?v=4", "events_url": "https://api.github.com/users/matthewlmcclure/events{/privacy}", "followers_url": "https://api.github.com/users/matthewlmcclure/followers", "following_url": "https://api.github.com/users/matthewlmcclure/following{/other_user}", "gists_url": "https://api.github.com/users/matthewlmcclure/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/matthewlmcclure", "id": 470362, "login": "matthewlmcclure", "node_id": "MDQ6VXNlcjQ3MDM2Mg==", "organizations_url": "https://api.github.com/users/matthewlmcclure/orgs", "received_events_url": "https://api.github.com/users/matthewlmcclure/received_events", "repos_url": "https://api.github.com/users/matthewlmcclure/repos", "site_admin": false, "starred_url": "https://api.github.com/users/matthewlmcclure/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/matthewlmcclure/subscriptions", "type": "User", "url": "https://api.github.com/users/matthewlmcclure", "user_view_type": "public" }
[]
closed
true
null
[]
null
6
2013-07-09T21:07:32Z
2021-09-09T02:11:54Z
2013-07-10T17:26:59Z
CONTRIBUTOR
resolved
In #139 and #97 there was work to view a Request as a curl command. It looks like it's gone. I can't seem to navigate the revision history to find when it was removed and see if there's any explanation why. Would you be interested in bringing it or something like it back?
{ "avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4", "events_url": "https://api.github.com/users/Lukasa/events{/privacy}", "followers_url": "https://api.github.com/users/Lukasa/followers", "following_url": "https://api.github.com/users/Lukasa/following{/other_user}", "gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Lukasa", "id": 1382556, "login": "Lukasa", "node_id": "MDQ6VXNlcjEzODI1NTY=", "organizations_url": "https://api.github.com/users/Lukasa/orgs", "received_events_url": "https://api.github.com/users/Lukasa/received_events", "repos_url": "https://api.github.com/users/Lukasa/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Lukasa/starred{/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/1450/reactions" }
https://api.github.com/repos/psf/requests/issues/1450/timeline
null
completed
null
null
false
[ "I would be -1 on this. It's far beyond the scope of the library. We don't log anything (if I remember correctly) currently and adding a method like that isn't something we have had for quite some time (since at least 0.11 since that's around when I started using requests, over a year ago).\n", "Thanks for the pull request @matthewlmcclure! Unfortunately, I think Ian is right on this one. We haven't had this feature for a long time and it's not really one that's missed.\n", "No problem. I'll explore doing it outside of Requests proper. Thanks for the quick replies. \n", "Very nice idea. I agree there's no place for this in the lib but still a very nice feature.\n", "I man, I totally forgot that we used to do this. Good times :)\n", "Here's [the same implementation in a separately importable module](https://gist.github.com/matthewlmcclure/5980698). Improvements welcome.\n" ]
https://api.github.com/repos/psf/requests/issues/1449
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1449/labels{/name}
https://api.github.com/repos/psf/requests/issues/1449/comments
https://api.github.com/repos/psf/requests/issues/1449/events
https://github.com/psf/requests/issues/1449
16,546,479
MDU6SXNzdWUxNjU0NjQ3OQ==
1,449
SSLError: EOF occurred in violation of protocol
{ "avatar_url": "https://avatars.githubusercontent.com/u/819571?v=4", "events_url": "https://api.github.com/users/kylestev/events{/privacy}", "followers_url": "https://api.github.com/users/kylestev/followers", "following_url": "https://api.github.com/users/kylestev/following{/other_user}", "gists_url": "https://api.github.com/users/kylestev/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kylestev", "id": 819571, "login": "kylestev", "node_id": "MDQ6VXNlcjgxOTU3MQ==", "organizations_url": "https://api.github.com/users/kylestev/orgs", "received_events_url": "https://api.github.com/users/kylestev/received_events", "repos_url": "https://api.github.com/users/kylestev/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kylestev/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kylestev/subscriptions", "type": "User", "url": "https://api.github.com/users/kylestev", "user_view_type": "public" }
[]
closed
true
null
[]
null
9
2013-07-09T20:46:06Z
2021-09-09T00:01:05Z
2013-09-21T15:24:23Z
NONE
resolved
I am behind a proxy at work and in order for my requests to be routed (even internally) I have to connect to a proxy. I have tried doing so in multiple different ways in order to get my script to function. I can run things such as the `easy_install` command line tool if I set the `http_proxy` and `https_proxy` environment variables to: `protocol://my_username:my_password@proxy_fqdn:proxy_port` (`protocol` = http or https). It appears that Requests does not look for this information however so I am left to use an HTTPProxyAuth object. Relevant information to my setup/environment - Python 2.6 - Requests 1.2.3 - Red Hat Enterprise Linux 6.4 - My full username has a backslash (\) in it since all employees use Active Record credentials (ie: domain\username) - the domain only consists of alphabetic characters - My password has symbols in it (ie: !@#$%^&\* etc.) Stack trace ``` Traceback (most recent call last): File "mpss.py", line omitted, in <module> print main(args) File "mpss.py", line omitted, in main content = sesh.get(URL_MPSS_BUILDS, proxies=PROXIES, auth=auth).content File "/usr/lib/python2.6/site-packages/requests-1.2.3-py2.6.egg/requests/sessions.py", line 347, in get return self.request('GET', url, **kwargs) File "/usr/lib/python2.6/site-packages/requests-1.2.3-py2.6.egg/requests/sessions.py", line 335, in request resp = self.send(prep, **send_kwargs) File "/usr/lib/python2.6/site-packages/requests-1.2.3-py2.6.egg/requests/sessions.py", line 438, in send r = adapter.send(request, **kwargs) File "/usr/lib/python2.6/site-packages/requests-1.2.3-py2.6.egg/requests/adapters.py", line 331, in send raise SSLError(e) requests.exceptions.SSLError: [Errno 8] _ssl.c:490: EOF occurred in violation of protocol ``` Source ``` from requests import Session from requests.auth import HTTPProxyAuth URL_MPSS_BUILDS = 'https://sub.domain.employer.com/builds/mpss/' PROXIES = { 'http': 'http://proxy.campus.employer.com:911', 'https': 'https://proxy.campus.employer.com:911' } sesh = Session() auth = HTTPProxyAuth(username, password) content = sesh.get(URL_MPSS_BUILDS, proxies=PROXIES, auth=auth).content ``` Please note that my actual code looks a lot nicer - I have extracted the relevant lines as needed to reproduce this bug. Is there anything I am doing wrong? I have also tried the following variations to find a fix: - Remove protocol from value portion of the `PROXIES` dictionary --> Causes a KeyError similar to #997 - Tried formatting the PROXIES values with user:pass@fqdn:port but that didn't work - didn't expect it to either Proxy preferences in RHEL 6.4 - this is the system I am running this script on as well as where I got the initial proxy FQDNs from. I checked the laptop that was issued to me by my employer and it has the same settings as well. ![proxy prefs](https://f.cloud.github.com/assets/819571/770765/53a5e8cc-e8d4-11e2-9c25-d3344ecabdc4.png)
{ "avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4", "events_url": "https://api.github.com/users/Lukasa/events{/privacy}", "followers_url": "https://api.github.com/users/Lukasa/followers", "following_url": "https://api.github.com/users/Lukasa/following{/other_user}", "gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Lukasa", "id": 1382556, "login": "Lukasa", "node_id": "MDQ6VXNlcjEzODI1NTY=", "organizations_url": "https://api.github.com/users/Lukasa/orgs", "received_events_url": "https://api.github.com/users/Lukasa/received_events", "repos_url": "https://api.github.com/users/Lukasa/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions", "type": "User", "url": "https://api.github.com/users/Lukasa", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/1449/reactions" }
https://api.github.com/repos/psf/requests/issues/1449/timeline
null
completed
null
null
false
[ "Try to use `http://` in both proxy urls.\nPlease be aware, that support fpr https over proxies is in fact broken. However, depending on your proxy software it may work nevertheless, although the data isn't encrypted on the way between your proxy and you and only gets encrypted by the proxy. You have to try it yourself and decide, whether this restriction doesn't prevent you from using it.\n\n``` py\nPROXIES = {\n 'http': 'http://proxy.campus.employer.com:911',\n 'https': 'http://proxy.campus.employer.com:911'\n}\n```\n", "To elaborate on what @t-8ch has just said, this is a known bug in Requests and has been around for some time (see #1359). Until we manage to get proper HTTPS proxying support in urllib3 there is very little we can do about it. Try following @t-8ch's suggestions for the moment.\n", "Forgot to mention in my list that I have already tried that...\n\n```\n<HTML><HEAD>\n<TITLE>Request Error</TITLE>\n</HEAD>\n<BODY>\n<FONT face=\"Helvetica\">\n<big><strong></strong></big><BR>\n</FONT>\n<blockquote>\n<TABLE border=0 cellPadding=1 width=\"80%\">\n<TR><TD>\n<FONT face=\"Helvetica\">\n<big>Request Error (invalid_request)</big>\n<BR>\n<BR>\n</FONT>\n</TD></TR>\n<TR><TD>\n<FONT face=\"Helvetica\">\nYour request could not be processed. Request could not be handled\n</FONT>\n</TD></TR>\n<TR><TD>\n<FONT face=\"Helvetica\">\nThis could be caused by a misconfiguration, or possibly a malformed request.\n</FONT>\n</TD></TR>\n<TR><TD>\n<FONT face=\"Helvetica\" SIZE=2>\n<BR>\nFor assistance, contact your network support team.\n</FONT>\n</TD></TR>\n</TABLE>\n</blockquote>\n</FONT>\n</BODY></HTML>\n```\n", "I know this isn't exactly helpful but thank you for such an excellent issue report. One thing I'd ask to see, out of some level of curiosity, is which version of openssl you're running. While @t-8ch and @lukasa are 100% correct, I wonder of this isn't an SSL issue being masked by proxies.\n", "As a member of a debug team of a broad software stack, I understand the \nagony of trying to find the root cause of bugs from customers that don't \nsubmit detailed bug reports. It took a good chunk of time out of my \nlunch break to prepare it, but I just thought that making it easier on \nyou guys would speed things along. I really appreciate the requests \nlibrary and how easy it makes Python web interactions. I'd like to thank \nyou guys for all the work you do to keep this open source project active \nand going in the right direction. If I do find a work around, I'll be \nsure to post it here so others can find it.\n\nFeel free to close this if you deem it necessary.\n\nOn 7/9/2013 7:36 PM, Ian Cordasco wrote:\n\n> I know this isn't exactly helpful but thank you for such an excellent \n> issue report. One thing I'd ask to see, out of some level of \n> curiosity, is which version of openssl you're running. While @t-8ch \n> https://github.com/t-8ch and @lukasa https://github.com/lukasa are \n> 100% correct, I wonder of this isn't an SSL issue being masked by proxies.\n> \n> —\n> Reply to this email directly or view it on GitHub \n> https://github.com/kennethreitz/requests/issues/1449#issuecomment-20718442.\n", "It's perfectly possible this is an SSL issue, SSL negotiation problems tend to show similar errors. I need to spend some time looking into the proxy stuff in Requests, and get clear in my head what we can and can't do. In the meantime, @kylestev, it would be worth trying to grab tcpdump from the connection: it's possible the SSL handshake isn't completing.\n", "I can do this tomorrow. I was out of office today and my dev machine (w/\nrhel) is at the office. Will update tomorrow with tcpdump\nOn Jul 9, 2013 11:18 PM, \"Cory Benfield\" [email protected] wrote:\n\n> It's perfectly possible this is an SSL issue, SSL negotiation problems\n> tend to show similar errors. I need to spend some time looking into the\n> proxy stuff in Requests, and get clear in my head what we can and can't do.\n> In the meantime, @kylestev https://github.com/kylestev, it would be\n> worth trying to grab tcpdump from the connection: it's possible the SSL\n> handshake isn't completing.\n> \n> —\n> Reply to this email directly or view it on GitHubhttps://github.com/kennethreitz/requests/issues/1449#issuecomment-20723581\n> .\n", "@kylestev any update? \n", "Closed due to inactivity.\n" ]
https://api.github.com/repos/psf/requests/issues/1448
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1448/labels{/name}
https://api.github.com/repos/psf/requests/issues/1448/comments
https://api.github.com/repos/psf/requests/issues/1448/events
https://github.com/psf/requests/issues/1448
16,520,750
MDU6SXNzdWUxNjUyMDc1MA==
1,448
The problem with stream=True
{ "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
9
2013-07-09T11:56:12Z
2021-09-09T02:11:56Z
2013-07-09T13:54:17Z
NONE
resolved
``` python import requests r = requests.get('http://servag.rupsy.ru/media/2/Amanojaku_and_ZY_-_Womtek_Julla-2013/Mensaje.jpg', stream=True) cc = 1 while True: print('read ' + str(cc*1024*100)) r.iter_content(1024*100).__next__() cc += 1 ``` Output ``` read 102400 read 204800 read 307200 read 409600 read 512000 read 614400 ``` Thereafter, the script is not responding. If you press Ctrl-C: ``` Traceback (most recent call last): File "test.py", line 7, in <module> r.iter_content(1024*100).__next__() File "/opt/python33/lib/python3.3/site-packages/requests-1.2.0-py3.3.egg/requests/models.py", line 528, in generate chunk = self.raw.read(chunk_size) File "/opt/python33/lib/python3.3/site-packages/requests-1.2.0-py3.3.egg/requests/packages/urllib3/response.py", line 148, in read data = self._fp.read(amt) File "/opt/python33/lib/python3.3/http/client.py", line 503, in read return super(HTTPResponse, self).read(amt) File "/opt/python33/lib/python3.3/http/client.py", line 542, in readinto n = self.fp.readinto(b) File "/opt/python33/lib/python3.3/socket.py", line 297, in readinto return self._sock.recv_into(b) ``` Debian 6.0, Python 3.2 or Python 3.3, requests 1.2.3 or last or 1.2.0 Under Python 3.3 and Windows 7 is no such problem
{ "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" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/1448/reactions" }
https://api.github.com/repos/psf/requests/issues/1448/timeline
null
completed
null
null
false
[ "You should not be using `iter_content` like that. You should do `for i in r.iter_content():`\n", "In particular, what you're doing here is creating a new generator each time you run around the loop. `r.iter_content()` returns a _new_ generator, on which you call `__next__`. In some cases this _might_ work, but that's simply good luck and not something on which you want to rely.\n", "Ok\n\n``` python\nimport requests\n\nr = requests.get('http://servag.rupsy.ru/media/2/Amanojaku_and_ZY_-_Womtek_Julla-2013/Mensaje.jpg', stream=True)\ncc = 1\nfor i in r.iter_content(1024*100):\n print('read ' + str(cc*1024*100))\n cc += 1\n```\n\nBut this not resolve problem!\n", "I'm installing a Debian VM right now, I'll see what I can do.\n", "I'll test as well in 20\n", "Ok, with a freshly installed Debian 7.1, Python 3.3 and Requests 1.2.3 I can't reproduce this.\n", "Please, try with another url:\n\n``` python\nimport requests\n\nr = requests.get('http://servag.rupsy.ru/media/2/Manifest_-_Expedientes_X-2013/00-Manifest-X_Files-A-Front_Cover.jpg', stream=True)\ncc = 1\nfor i in r.iter_content(1024*100):\n print('read ' + str(cc*1024*100))\n cc += 1\n```\n", "Again, the request completes successfully for me under Python 3.3 on Debian 7.1.\n", "Thank you for all - problem not in requests!\nAlso, I found this problem when i get these files with wget.\n" ]
https://api.github.com/repos/psf/requests/issues/1447
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1447/labels{/name}
https://api.github.com/repos/psf/requests/issues/1447/comments
https://api.github.com/repos/psf/requests/issues/1447/events
https://github.com/psf/requests/issues/1447
16,519,868
MDU6SXNzdWUxNjUxOTg2OA==
1,447
Response hook's callback function returns a value to cause exception
{ "avatar_url": "https://avatars.githubusercontent.com/u/1916906?v=4", "events_url": "https://api.github.com/users/ahmedtalhakhan/events{/privacy}", "followers_url": "https://api.github.com/users/ahmedtalhakhan/followers", "following_url": "https://api.github.com/users/ahmedtalhakhan/following{/other_user}", "gists_url": "https://api.github.com/users/ahmedtalhakhan/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/ahmedtalhakhan", "id": 1916906, "login": "ahmedtalhakhan", "node_id": "MDQ6VXNlcjE5MTY5MDY=", "organizations_url": "https://api.github.com/users/ahmedtalhakhan/orgs", "received_events_url": "https://api.github.com/users/ahmedtalhakhan/received_events", "repos_url": "https://api.github.com/users/ahmedtalhakhan/repos", "site_admin": false, "starred_url": "https://api.github.com/users/ahmedtalhakhan/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/ahmedtalhakhan/subscriptions", "type": "User", "url": "https://api.github.com/users/ahmedtalhakhan", "user_view_type": "public" }
[]
closed
true
null
[]
null
7
2013-07-09T11:31:04Z
2021-09-09T02:11:56Z
2013-07-09T12:17:50Z
NONE
resolved
The documentation for response hooks says "If the callback function returns a value, it is assumed that it is to replace the data that was passed in. If the function doesn’t return anything, nothing else is effected" Now i am trying to return a value(int in my case) from my hook function and it throws an exception. This will be valid in all the cases when the return value is an object that DOESNOT have the raw() method defined for it. Here is some code ``` def hook(resp,**kwargs): print resp.url return 1 def main() s = requests.Session() s.hooks = {"response":hook} r = s.get("http://localhost/index.html") ``` And here is the exception: ``` http://localhost/index.html Traceback (most recent call last): File "/home/talha/ws/test.py", line 85, in <module> main() File "/home/talha/ws/test.py", line 72, in main r = s.get("http://localhost/index.html") File "/usr/lib/python2.7/site-packages/requests/sessions.py", line 347, in get return self.request('GET', url, **kwargs) File "/usr/lib/python2.7/site-packages/requests/sessions.py", line 335, in request resp = self.send(prep, **send_kwargs) File "/usr/lib/python2.7/site-packages/requests/sessions.py", line 446, in send extract_cookies_to_jar(self.cookies, request, r.raw) AttributeError: 'int' object has no attribute 'raw' ``` The code in sessions.py @line 446 is trying to extract cookies after the dispatch_hook..From source ``` # Response manipulation hooks r = dispatch_hook('response', hooks, r, **kwargs) # Persist cookies extract_cookies_to_jar(self.cookies, request, r.raw) ``` Either the documentation needs to change or the handling needs to be re-worked. What is the best way to handle this ?
{ "avatar_url": "https://avatars.githubusercontent.com/u/1916906?v=4", "events_url": "https://api.github.com/users/ahmedtalhakhan/events{/privacy}", "followers_url": "https://api.github.com/users/ahmedtalhakhan/followers", "following_url": "https://api.github.com/users/ahmedtalhakhan/following{/other_user}", "gists_url": "https://api.github.com/users/ahmedtalhakhan/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/ahmedtalhakhan", "id": 1916906, "login": "ahmedtalhakhan", "node_id": "MDQ6VXNlcjE5MTY5MDY=", "organizations_url": "https://api.github.com/users/ahmedtalhakhan/orgs", "received_events_url": "https://api.github.com/users/ahmedtalhakhan/received_events", "repos_url": "https://api.github.com/users/ahmedtalhakhan/repos", "site_admin": false, "starred_url": "https://api.github.com/users/ahmedtalhakhan/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/ahmedtalhakhan/subscriptions", "type": "User", "url": "https://api.github.com/users/ahmedtalhakhan", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/1447/reactions" }
https://api.github.com/repos/psf/requests/issues/1447/timeline
null
completed
null
null
false
[ "Sorry, the documentation could be more clear here. The value you return from the hook _must_ be a `Requests.Response` object or something that duck-types to it (e.g. a subclass).\n", "You traced it back to the wrong line. The problematic line is probably inside `dispatch_hooks`. I'll look into this in an hour or so\n", "And sorry for closing, hate this app\n", "Nah, Ian, you just can't return an integer from a response hook. That would be crazy. =) An integer is not a response.\n", "Agreed. The correct approach to be taken should be a subclass of `response`\n\n```\nclass MyIntResponse(Response):\ndef __init__(self, integer):\n super(MyIntResponse, self).__init__()\n self._content_consumed = True\n self._content = integer\n\ndef hook(resp,**kwargs):\n print resp.url\n newresp = MyIntResponse(1)\n newresp.raw = resp.raw # copy across original HTTP response object\n```\n", "I solved it after digging more into it..Will close. Thanks\n", "Yeah the docs are bad and I feel bad\n" ]
https://api.github.com/repos/psf/requests/issues/1446
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1446/labels{/name}
https://api.github.com/repos/psf/requests/issues/1446/comments
https://api.github.com/repos/psf/requests/issues/1446/events
https://github.com/psf/requests/issues/1446
16,496,055
MDU6SXNzdWUxNjQ5NjA1NQ==
1,446
Cookies not passed on through redirect
{ "avatar_url": "https://avatars.githubusercontent.com/u/4968324?v=4", "events_url": "https://api.github.com/users/yunruiwatts/events{/privacy}", "followers_url": "https://api.github.com/users/yunruiwatts/followers", "following_url": "https://api.github.com/users/yunruiwatts/following{/other_user}", "gists_url": "https://api.github.com/users/yunruiwatts/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/yunruiwatts", "id": 4968324, "login": "yunruiwatts", "node_id": "MDQ6VXNlcjQ5NjgzMjQ=", "organizations_url": "https://api.github.com/users/yunruiwatts/orgs", "received_events_url": "https://api.github.com/users/yunruiwatts/received_events", "repos_url": "https://api.github.com/users/yunruiwatts/repos", "site_admin": false, "starred_url": "https://api.github.com/users/yunruiwatts/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/yunruiwatts/subscriptions", "type": "User", "url": "https://api.github.com/users/yunruiwatts", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2013-07-08T21:46:22Z
2021-09-08T23:10:43Z
2013-07-09T15:29:59Z
NONE
resolved
I've been using requests 1.2.0 to log into a server, but when I upgraded to 1.2.3 today I found that a change in 1.2.1 breaks my code. I log in with the line ``` response = requests.post(<endpoint>, data={'username':<username>, 'password':<password>}) ``` The server responds with a 302 that sets the authentication cookies and redirects me to the welcome page. In 1.2.0, the authentication cookies can be found in the `response` variable's cookies, but not in 1.2.1. I haven't found what change in the code is causing this different behavior, but I did notice that in the `response` variable I can access the history and get the cookies from the 302 response, so I'm guessing the issue is with the redirect.
{ "avatar_url": "https://avatars.githubusercontent.com/u/4968324?v=4", "events_url": "https://api.github.com/users/yunruiwatts/events{/privacy}", "followers_url": "https://api.github.com/users/yunruiwatts/followers", "following_url": "https://api.github.com/users/yunruiwatts/following{/other_user}", "gists_url": "https://api.github.com/users/yunruiwatts/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/yunruiwatts", "id": 4968324, "login": "yunruiwatts", "node_id": "MDQ6VXNlcjQ5NjgzMjQ=", "organizations_url": "https://api.github.com/users/yunruiwatts/orgs", "received_events_url": "https://api.github.com/users/yunruiwatts/received_events", "repos_url": "https://api.github.com/users/yunruiwatts/repos", "site_admin": false, "starred_url": "https://api.github.com/users/yunruiwatts/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/yunruiwatts/subscriptions", "type": "User", "url": "https://api.github.com/users/yunruiwatts", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/1446/reactions" }
https://api.github.com/repos/psf/requests/issues/1446/timeline
null
completed
null
null
false
[ "Hi @yunruiwatts! Thanks for raising this issue!\n\nThe breaking change was 49a3664222d9e17ab83d089e4d1b1e30c998f59c. The reason for this change is that the old behaviour was incorrect. `Response.cookies` [is defined as](http://docs.python-requests.org/en/latest/api.html#requests.Response):\n\n> A CookieJar of Cookies the server sent back.\n\nThe intention behind this documentation is that it's a CookieJar of Cookies the server sent back _on that response_. Those aren't the cookies you want, you want the ones the server sent on the _previous_ response.\n\nThere are two ways for you to get the cookies you want: either extract them from a `Session` or extract them from `r.history[-1]`. Either should work. If your use case is only that you're later going to make requests that you want to authenticate with that cookie, you should just be using a `Session` to send all your requests: that will handle cookie persistence for you.\n", "Thanks for the informative response! I had not seen the `Session` objects, but that seems to make more sense.\n\nI saw in the history that version 1.2.0 has \"Fixed cookies on sessions and on requests\", but 1.2.1 does not have anything related to cookies in its section of the history. It might be a good idea to put something in the documentation so it's clear that this is an intentional change of behavior.\n" ]
https://api.github.com/repos/psf/requests/issues/1445
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1445/labels{/name}
https://api.github.com/repos/psf/requests/issues/1445/comments
https://api.github.com/repos/psf/requests/issues/1445/events
https://github.com/psf/requests/issues/1445
16,488,882
MDU6SXNzdWUxNjQ4ODg4Mg==
1,445
Ability to create requests with session context without sending immedately
{ "avatar_url": "https://avatars.githubusercontent.com/u/7097?v=4", "events_url": "https://api.github.com/users/robcowie/events{/privacy}", "followers_url": "https://api.github.com/users/robcowie/followers", "following_url": "https://api.github.com/users/robcowie/following{/other_user}", "gists_url": "https://api.github.com/users/robcowie/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/robcowie", "id": 7097, "login": "robcowie", "node_id": "MDQ6VXNlcjcwOTc=", "organizations_url": "https://api.github.com/users/robcowie/orgs", "received_events_url": "https://api.github.com/users/robcowie/received_events", "repos_url": "https://api.github.com/users/robcowie/repos", "site_admin": false, "starred_url": "https://api.github.com/users/robcowie/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/robcowie/subscriptions", "type": "User", "url": "https://api.github.com/users/robcowie", "user_view_type": "public" }
[]
closed
true
null
[]
null
10
2013-07-08T19:22:19Z
2021-09-09T02:11:38Z
2013-08-15T07:53:07Z
NONE
resolved
I've just been scratching my head whilst trying to figure out how to create a Request() instance independently of a session and have that session 'prepare' it by augmenting it with the session context (cookies etc.) before sending it. Looks like it isn't possible without custom transports (described in https://github.com/kennethreitz/requests/issues/1280?source=cc) My use case is thus... 1. My code is provided with a session, constructed elsewhere. Typically it has auth cookies. 2. One of several functions that build and return an unprepared request instance are selected at run time and called. The request is then potentially manipulated by yet more code, also determined by run-time conditions. 3. The request is prepared - in the context of the existing session - and sent. Currently this is not possible. I am required to manually add cookies and other session-borne context to the request before preparing it and passing to session.send(). It therefore seems difficult to separate session creation and request creation. It would be nice to have some way of providing an unprepared request to a session and have the session prepare it. Something like... ``` python response = Session().send(unprepared_request) # or... s = Session() request = s.prepare(unprepared_request) s.send(request) # or... Session().request(method, uri, return_response=true, **kargs) ``` It appears that similar requests have been declined in the past. I'd like to re-open the discussion if possible. If there is still no appetite for it, I'll have to maintain a fork I guess. Rather that than complicate matters with custom transports.
{ "avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4", "events_url": "https://api.github.com/users/Lukasa/events{/privacy}", "followers_url": "https://api.github.com/users/Lukasa/followers", "following_url": "https://api.github.com/users/Lukasa/following{/other_user}", "gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Lukasa", "id": 1382556, "login": "Lukasa", "node_id": "MDQ6VXNlcjEzODI1NTY=", "organizations_url": "https://api.github.com/users/Lukasa/orgs", "received_events_url": "https://api.github.com/users/Lukasa/received_events", "repos_url": "https://api.github.com/users/Lukasa/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Lukasa/starred{/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/1445/reactions" }
https://api.github.com/repos/psf/requests/issues/1445/timeline
null
completed
null
null
false
[ "_Note: I deleted your other comment to keep this all in once place._\n\nCustom transports won't help, they don't have easy access to the `Session` object. I'm sure some Python hackery could be performed to give it to them, but it's kind of insane, that's not what they're for. The custom adapter in the linked issue was to solve that specific issue, not in general.\n\nI'm not 100% opposed to this, I'm really not. I think a small refactor would be needed to break up the logic of `Session.request()`, but that would be plenty do-able. What I am not sold on is whether there is generally a use-case for building an unprepared Request yourself but then wanting to pass it through a Session. Do you mind elaborating on your use-case?\n", "cheers for the delete. I intended to do it... but I'm on a bus right now.\n\nBriefly, my use case is a code framework which provides users with the ability to provide functions to - amongst other things - build a session (usually requests but not always), and build requests given a set of parameters (usually just a url).\n\nThe framework then uses these functions to repeatedly build requests and ultimately hand them off to the session for dispatch.\n\nBetween each of these steps, other non-http things happen. Basically, as it exists now the framework user has the ability to define how the requests and the session are built, each in isolation.\n\nI'll try to provide some simplified code examples later.\n", "This isn't my actual code but shows the use case\n\n``` python\nfrom mylib import Importer\n\ndef request_factory(uri):\n return requests.Request('GET', uri)\n\ndef session_with_cookie(**kargs):\n sess = requests.Session()\n sess.get('http://httpbin.org/cookies/set?k1=v1')\n return sess\n\nconfig = {'uris': [], 'a': 'a'}\nimp = Importer(request=request_factory, session=session_with_cookie)\nimp.run(config)\n```\n\nOn `imp.run()` a request is created for each supplied url, and sent with the session created by `session_with_cookie`.\n", "Mm, I guess I can see wanting to do this. I'm still pretty much +0 on it though, so I'll defer to @sigmavirus24 and @kennethreitz.\n", "If the answer is no, I'd still be interested to hear your ideas about how you _would_ implement it.\n", "How I _would_ implement it is easy: I'd add a new `Session.build_request()` function to the `Session` object, and put the `Request`-specific portions of the setup in there, then call that from `Session.request()`.\n", "I'm all for breaking some stuff into a separate method to make testing in the future easier. Whether we want to make that part of the public API, I don't know. \n", "Well with a possible 2.0 this is possible. \n", "I actually want this too.\n\nTo clarify the use case, I expect to be able to do something like this.\n\n``` python\nclass FooApiRequests(object):\n def __init__(self, server_url='http://example.com'):\n self.server_url = server_url\n\n def foo(self):\n return Request('GET', self.server_url + '/foo')\n\nrequests = FooApiRequests()\nsession = Session(auth=SomeAuthThing())\n\nreq = requests.foo()\nsession.send(req.prepare())\n```\n\nHowever, `Session.send` doesn't apply its configuration (e.g. `auth`) that way. Essentially, I'd like the \"thing that creates request objects\" independent of the Session.\n\nIn our real code, `FooApiRequests` represents a larger API request-factory creating many kinds of requests; and whose requests may get reused elsewhere for things like automated-retries-after-auth, etc.\n\nI'd be _basically_ okay doing this:\n\n``` python\nclass FooApiRequests(object):\n def __init__(self, session, server_url='http://example.com'):\n self.session = session\n self.server_url = server_url\n\n def foo(self):\n return self.session.build_request('GET', self.server_url + '/foo')\n\nsession = Session(auth=SomeAuthThing())\nrequests = FooApiRequests(session=session)\n\nreq = requests.foo()\nsession.send(req.prepare())\n```\n\nbut I think this would be even better:\n\n``` python\nclass FooApiRequests(object):\n def __init__(self, server_url='http://example.com'):\n self.server_url = server_url\n\n def foo(self):\n return Request('GET', self.server_url + '/foo')\n\nsession = Session(auth=SomeAuthThing())\nrequests = FooApiRequests()\n\nreq = requests.foo()\nprepared_request = session.prepare_request(req)\nsession.send(prepared_request)\n```\n\nIn which `Session.prepare_request()` creates a `PreparedRequest` whose settings have been merged with the session's.\n\nI'd be okay making that change and submitting a PR if it seems like a good solution. It's a non-breaking API change. @sigmavirus24 and @Lukasa, if I were to go ahead with that, would it be likely to be merged in? Any suggestions?\n", "Resolved by #1507. =)\n" ]
https://api.github.com/repos/psf/requests/issues/1443
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1443/labels{/name}
https://api.github.com/repos/psf/requests/issues/1443/comments
https://api.github.com/repos/psf/requests/issues/1443/events
https://github.com/psf/requests/issues/1443
16,435,461
MDU6SXNzdWUxNjQzNTQ2MQ==
1,443
tests fail on Python 2.7 OSX
{ "avatar_url": "https://avatars.githubusercontent.com/u/204779?v=4", "events_url": "https://api.github.com/users/jvanasco/events{/privacy}", "followers_url": "https://api.github.com/users/jvanasco/followers", "following_url": "https://api.github.com/users/jvanasco/following{/other_user}", "gists_url": "https://api.github.com/users/jvanasco/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/jvanasco", "id": 204779, "login": "jvanasco", "node_id": "MDQ6VXNlcjIwNDc3OQ==", "organizations_url": "https://api.github.com/users/jvanasco/orgs", "received_events_url": "https://api.github.com/users/jvanasco/received_events", "repos_url": "https://api.github.com/users/jvanasco/repos", "site_admin": false, "starred_url": "https://api.github.com/users/jvanasco/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/jvanasco/subscriptions", "type": "User", "url": "https://api.github.com/users/jvanasco", "user_view_type": "public" }
[]
closed
true
null
[]
null
5
2013-07-06T20:56:53Z
2021-09-09T02:11:57Z
2013-07-06T23:23:07Z
CONTRIBUTOR
resolved
The following tests fail: ``` #### ERROR: test_custom_content_type (__main__.RequestsTestCase) File "test_requests.py", line 397, in test_custom_content_type UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 11167: ordinal not in range(128) Fails due to UTF-8/Unicode characters in the test_requests.py document; if you replace `__file__` with `__file__.txt` that only contains ASCII data, it passes. #### ERROR: test_different_encodings_dont_break_post (__main__.RequestsTestCase) File "test_requests.py", line 357, in test_different_encodings_dont_break_post UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 11162: ordinal not in range(128) Fails due to UTF-8/Unicode characters in the test_requests.py document; if you replace `__file__` with `__file__.txt` that only contains ASCII data, it passes. #### ERROR: test_unicode_header_name (__main__.RequestsTestCase) File "test_requests.py", line 345, in test_unicode_header_name UnicodeDecodeError: 'ascii' codec can't decode byte 0xff in position 0: ordinal not in range(128) No idea how to fix. #### ERROR: test_unicode_multipart_post (__main__.RequestsTestCase) File "test_requests.py", line 363, in test_unicode_multipart_post UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 84: ordinal not in range(128) No idea how to fix. #### ERROR: test_mixed_case_scheme_acceptable (__main__.RequestsTestCase) Traceback (most recent call last): SSLError: [Errno 1] _ssl.c:499: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed ``` I'd suggest a two part fix: 1- rewrite test to not verify ssl certificates: ``` > def test_mixed_case_scheme_acceptable(self): >+ verify = False ... >- r = s.send(r.prepare()) >+ r = s.send(r.prepare(), verify=verify) ``` 2- write another test suite to ensure `verify` can be turned on and off, and that PEM can be sent [ ie, in line with http://docs.python-requests.org/en/latest/user/advanced/#ssl-cert-verification and http://stackoverflow.com/questions/10667960/python-requests-throwing-up-sslerror ]
{ "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/1443/reactions" }
https://api.github.com/repos/psf/requests/issues/1443/timeline
null
completed
null
null
false
[ "Unfortunately, I can't reproduce this against HEAD:\n\n```\n============================= test session starts ==============================\nplatform darwin -- Python 2.7.5 -- pytest-2.3.4\ncollected 71 items \n\ntest_requests.py .......................................................................\n\n========================== 71 passed in 21.62 seconds ==========================\n```\n", "I'll try upgrading my Python ( it's 2.7 ) but also try a fresh install to see if this happens again.\n\nThis seems to work fine on a debian 2.6 and ubuntu 2.7.3 ;\n\nMy distro could have been built wrong. \n", "Confirmed that it passes on 2.7.5; sorry for sounding the alarm. The 2.7 Python.org distro must have been built wrong. \n", "No worries. Thanks for being patient enough to file and then double-check.\n", "Yeah, I want to echo that. =) If you think something has gone wrong, please tell us. It's so valuable. :cake:\n" ]
https://api.github.com/repos/psf/requests/issues/1442
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1442/labels{/name}
https://api.github.com/repos/psf/requests/issues/1442/comments
https://api.github.com/repos/psf/requests/issues/1442/events
https://github.com/psf/requests/issues/1442
16,415,597
MDU6SXNzdWUxNjQxNTU5Nw==
1,442
feature request - cookiejar to accept and return actual cookies
{ "avatar_url": "https://avatars.githubusercontent.com/u/204779?v=4", "events_url": "https://api.github.com/users/jvanasco/events{/privacy}", "followers_url": "https://api.github.com/users/jvanasco/followers", "following_url": "https://api.github.com/users/jvanasco/following{/other_user}", "gists_url": "https://api.github.com/users/jvanasco/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/jvanasco", "id": 204779, "login": "jvanasco", "node_id": "MDQ6VXNlcjIwNDc3OQ==", "organizations_url": "https://api.github.com/users/jvanasco/orgs", "received_events_url": "https://api.github.com/users/jvanasco/received_events", "repos_url": "https://api.github.com/users/jvanasco/repos", "site_admin": false, "starred_url": "https://api.github.com/users/jvanasco/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/jvanasco/subscriptions", "type": "User", "url": "https://api.github.com/users/jvanasco", "user_view_type": "public" }
[]
closed
true
null
[]
null
7
2013-07-05T19:20:57Z
2021-09-09T01:22:32Z
2013-08-27T08:03:12Z
CONTRIBUTOR
resolved
I'm setting up regression testing on an application , which has me doing a lot cookie manipulation : pulling cookies out of a session, retrying a request, putting them back in, etc. the current cookiejar has great behaviors which I wouldn't change – i'd just want to extend them a bit... right now the cookiejar builds a new cookie via kwargs, and returns the values. that loses a lot data that is really useful on testing. i can still do what i need to do, it's just more code. i'd like to propose these 2 additions : - `cookiejar.cookie_add` - adds a Cookie object - `cookiejar.cookie_get` - gets a Cookie object
{ "avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4", "events_url": "https://api.github.com/users/Lukasa/events{/privacy}", "followers_url": "https://api.github.com/users/Lukasa/followers", "following_url": "https://api.github.com/users/Lukasa/following{/other_user}", "gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Lukasa", "id": 1382556, "login": "Lukasa", "node_id": "MDQ6VXNlcjEzODI1NTY=", "organizations_url": "https://api.github.com/users/Lukasa/orgs", "received_events_url": "https://api.github.com/users/Lukasa/received_events", "repos_url": "https://api.github.com/users/Lukasa/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Lukasa/starred{/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/1442/reactions" }
https://api.github.com/repos/psf/requests/issues/1442/timeline
null
completed
null
null
false
[ "Hi @jvanasco, thanks for opening this issue!\n\nHave you tried `RequestsCookieJar.set_cookie()`? This should do your cookie adding. As for retrieving cookies, you should be able to iterate over the `RequestsCookieJar` to get the cookies out. Does that seem like what you need?\n", "I missed `RequestsCookieJar.set_cookie` -- thanks! ( i can't believe i missed it! I was even digging in the source files )\n\nI am iterating through `RequestsCookieJar` to find the cookies and grab them. I was just thinking that this seemed like a common enough practice, and the addition of a `kwarg` to the `get` and `find` functions could easily return a cookie object (instead of the value).\n\nJust to be clear - I have everything working for me right now. I just think the extra code needed to grab the cookie out of a jar is a common enough situation that it would be better placed in `requests`.\n", "I'm +0 on this. I can see the utility of having such a function, but it's not as though the building blocks for it aren't exposed. If it was implemented, I'd recommend using new functions (not adding a keyword argument). This is just because a function should really only return objects of one type (plus None).\n", "Well if you change your mind, I tossed what I wrote into a changeset : https://github.com/jvanasco/requests/commit/ef59f15dd4a0017f872536744ed1733e18da11ca\n\nI also added two new test suites ( btw, the existing tests failed in 4 places )\n", "If the existing tests are failing, please do file a bug report with details.\n", "@sigmavirus24 done - https://github.com/kennethreitz/requests/issues/1443\n", "At this stage, I'm fairly convinced we won't be implementing this. Thanks so much for the suggestion!\n" ]
https://api.github.com/repos/psf/requests/issues/1441
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1441/labels{/name}
https://api.github.com/repos/psf/requests/issues/1441/comments
https://api.github.com/repos/psf/requests/issues/1441/events
https://github.com/psf/requests/pull/1441
16,359,569
MDExOlB1bGxSZXF1ZXN0NjcyNzM1MQ==
1,441
Remove urllib3-specific kwargs from non-urllib3 branch.
{ "avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4", "events_url": "https://api.github.com/users/Lukasa/events{/privacy}", "followers_url": "https://api.github.com/users/Lukasa/followers", "following_url": "https://api.github.com/users/Lukasa/following{/other_user}", "gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Lukasa", "id": 1382556, "login": "Lukasa", "node_id": "MDQ6VXNlcjEzODI1NTY=", "organizations_url": "https://api.github.com/users/Lukasa/orgs", "received_events_url": "https://api.github.com/users/Lukasa/received_events", "repos_url": "https://api.github.com/users/Lukasa/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Lukasa/starred{/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" } ]
closed
true
null
[]
null
2
2013-07-04T09:41:43Z
2021-09-08T23:05:14Z
2013-07-15T13:22:41Z
MEMBER
resolved
As pointed out by @lukesneeringer in #1395, the kwargs in the non-urllib3 branch of the `iter_content` code are urllib3 specific. This PR will finish the split I originally made in #1425. /cc @sigmavirus24 and @lukesneeringer who have both done work that has been rendered unnecessary (though not useless) by this change.
{ "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/1441/reactions" }
https://api.github.com/repos/psf/requests/issues/1441/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/1441.diff", "html_url": "https://github.com/psf/requests/pull/1441", "merged_at": "2013-07-15T13:22:41Z", "patch_url": "https://github.com/psf/requests/pull/1441.patch", "url": "https://api.github.com/repos/psf/requests/pulls/1441" }
true
[ "My work can be considered unnecessary for newer versions of requests, but anyone intent on using an older version will not find it unnecessary ;)\n", "Also :+1:\n" ]
https://api.github.com/repos/psf/requests/issues/1440
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1440/labels{/name}
https://api.github.com/repos/psf/requests/issues/1440/comments
https://api.github.com/repos/psf/requests/issues/1440/events
https://github.com/psf/requests/pull/1440
16,230,040
MDExOlB1bGxSZXF1ZXN0NjY1ODM2NQ==
1,440
unquote double-quotes cookie values
{ "avatar_url": "https://avatars.githubusercontent.com/u/89607?v=4", "events_url": "https://api.github.com/users/fcurella/events{/privacy}", "followers_url": "https://api.github.com/users/fcurella/followers", "following_url": "https://api.github.com/users/fcurella/following{/other_user}", "gists_url": "https://api.github.com/users/fcurella/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/fcurella", "id": 89607, "login": "fcurella", "node_id": "MDQ6VXNlcjg5NjA3", "organizations_url": "https://api.github.com/users/fcurella/orgs", "received_events_url": "https://api.github.com/users/fcurella/received_events", "repos_url": "https://api.github.com/users/fcurella/repos", "site_admin": false, "starred_url": "https://api.github.com/users/fcurella/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/fcurella/subscriptions", "type": "User", "url": "https://api.github.com/users/fcurella", "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" } ]
closed
true
null
[]
null
9
2013-07-01T19:08:17Z
2021-09-08T23:05:11Z
2013-07-15T13:54:01Z
CONTRIBUTOR
resolved
Reading the spec, seems to me that quote-enclosed values should be returned unclosed. My interpretation is that the quotes are not part of the value, but they are considered 'punctuation'. I'm not confident I'm reading the spec right, and I don't have a big knowledge of the many actual server implementations out there (for example: does anyone actually send cookies with `Version="1"`?), so feel free to prove me wrong.
{ "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/1440/reactions" }
https://api.github.com/repos/psf/requests/issues/1440/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/1440.diff", "html_url": "https://github.com/psf/requests/pull/1440", "merged_at": "2013-07-15T13:54:01Z", "patch_url": "https://github.com/psf/requests/pull/1440.patch", "url": "https://api.github.com/repos/psf/requests/pulls/1440" }
true
[ "to expand on this, a request to a url with `Set-Cookie: foo=\"bar:baz\";` currently result in a cookie with value `\"\\\"bar:baz\\\"\"`\n\nwith this patch, the value returned will be `bar:baz`.\n\nAlternatively, we might want to have `\"bar:baz\"` as the returned value instead.\n", "Hi @fcurella! Thanks so much for the pull request! This is good work. :cake:\n\nThe relevant section of RFC 6265 is this one:\n\n```\n cookie-pair = cookie-name \"=\" cookie-value\n cookie-name = token\n cookie-value = *cookie-octet / ( DQUOTE *cookie-octet DQUOTE )\n```\n\nThis suggests to me that the cookie value includes the double-quotes. Otherwise, the spec would read:\n\n```\n cookie-pair = cookie-name \"=\" cookie-value / ( DQUOTE cookie-value DQUOTE )\n cookie-name = token\n cookie-value = *cookie-octet\n```\n\nOf course, reading RFCs is a dark art, and so I could be wrong here. Nevertheless, I think we're safest if we assume that the quotes should be included. That way, if the remote end considers them semantically meaningful, it'll get them back; and if it doesn't, it should be stripping them (since it added them in the first place).\n\nI do, however, agree that we shouldn't be _escaping_ them in the cookie values. =)\n", "Ready to merge?\n", "I think we're holding out for tests.\n", "_tear_ look at us, being all responsible.\n", "It's almost like this is a real open-source project! :car:\n", "@Lukasa: I've added https://github.com/kennethreitz/requests/pull/1440/files#L2R173 already, but I can write more. What kind of tests would like fro me to add?\n", "Ah, sorry, I totally missed that.\n\n@kennethreitz this is good-to-go. =)\n", ":sparkles: :cake: :sparkles:\n" ]
https://api.github.com/repos/psf/requests/issues/1439
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1439/labels{/name}
https://api.github.com/repos/psf/requests/issues/1439/comments
https://api.github.com/repos/psf/requests/issues/1439/events
https://github.com/psf/requests/pull/1439
16,115,240
MDExOlB1bGxSZXF1ZXN0NjYwMjE2NA==
1,439
Make sure netrc doesn't override any authentication settings explicitly set by the client
{ "avatar_url": "https://avatars.githubusercontent.com/u/26339?v=4", "events_url": "https://api.github.com/users/voberoi/events{/privacy}", "followers_url": "https://api.github.com/users/voberoi/followers", "following_url": "https://api.github.com/users/voberoi/following{/other_user}", "gists_url": "https://api.github.com/users/voberoi/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/voberoi", "id": 26339, "login": "voberoi", "node_id": "MDQ6VXNlcjI2MzM5", "organizations_url": "https://api.github.com/users/voberoi/orgs", "received_events_url": "https://api.github.com/users/voberoi/received_events", "repos_url": "https://api.github.com/users/voberoi/repos", "site_admin": false, "starred_url": "https://api.github.com/users/voberoi/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/voberoi/subscriptions", "type": "User", "url": "https://api.github.com/users/voberoi", "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" } ]
closed
true
null
[]
null
2
2013-06-27T21:24:25Z
2021-09-08T23:06:30Z
2013-07-15T13:22:54Z
CONTRIBUTOR
resolved
This fixes issue #1438. .netrc is still going to be used by default if it's available (that's the intended behavior based on #446), but now any explicit settings (whether they're set on the session or passed to request()) will take precedence.
{ "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/1439/reactions" }
https://api.github.com/repos/psf/requests/issues/1439/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/1439.diff", "html_url": "https://github.com/psf/requests/pull/1439", "merged_at": "2013-07-15T13:22:54Z", "patch_url": "https://github.com/psf/requests/pull/1439.patch", "url": "https://api.github.com/repos/psf/requests/pulls/1439" }
true
[ "This looks excellent @voberoi, thank you! :cake:\n", "No, thank _you_ for all the time and thoughtful effort going into requests.\n" ]
https://api.github.com/repos/psf/requests/issues/1438
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1438/labels{/name}
https://api.github.com/repos/psf/requests/issues/1438/comments
https://api.github.com/repos/psf/requests/issues/1438/events
https://github.com/psf/requests/issues/1438
16,109,993
MDU6SXNzdWUxNjEwOTk5Mw==
1,438
netrc auth settings override explicit session settings
{ "avatar_url": "https://avatars.githubusercontent.com/u/26339?v=4", "events_url": "https://api.github.com/users/voberoi/events{/privacy}", "followers_url": "https://api.github.com/users/voberoi/followers", "following_url": "https://api.github.com/users/voberoi/following{/other_user}", "gists_url": "https://api.github.com/users/voberoi/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/voberoi", "id": 26339, "login": "voberoi", "node_id": "MDQ6VXNlcjI2MzM5", "organizations_url": "https://api.github.com/users/voberoi/orgs", "received_events_url": "https://api.github.com/users/voberoi/received_events", "repos_url": "https://api.github.com/users/voberoi/repos", "site_admin": false, "starred_url": "https://api.github.com/users/voberoi/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/voberoi/subscriptions", "type": "User", "url": "https://api.github.com/users/voberoi", "user_view_type": "public" }
[]
closed
true
null
[]
null
4
2013-06-27T19:35:25Z
2021-09-09T02:11:44Z
2013-07-20T15:42:42Z
CONTRIBUTOR
resolved
Netrc authentication will blow away any explicit authentication settings you've set on a session, and it causes unexpected behavior that is annoying to debug: 1. "Why are these credentials not working?" 2. Print out what requests is sending over the wire. 3. Decode the basic authentication header, realize it's wrong 4. Poke through library to figure out where these credentials that aren't anywhere in your code are coming from. 5. Realize it's the way netrc is handled, modify the code to pass in authentication info in request(...), because that's the only way it'll work. ``` python session = requests.session() session.auth = ("username", "password") # This will not use "username", "password", but whatever's in .netrc r = session.get("http://www.hostinnetrc.com") # This works r = session.get("http://www.hostinnetrc.com", auth=("username", "password")) ``` Seems like both of those examples above should use "username", "password".
{ "avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4", "events_url": "https://api.github.com/users/Lukasa/events{/privacy}", "followers_url": "https://api.github.com/users/Lukasa/followers", "following_url": "https://api.github.com/users/Lukasa/following{/other_user}", "gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Lukasa", "id": 1382556, "login": "Lukasa", "node_id": "MDQ6VXNlcjEzODI1NTY=", "organizations_url": "https://api.github.com/users/Lukasa/orgs", "received_events_url": "https://api.github.com/users/Lukasa/received_events", "repos_url": "https://api.github.com/users/Lukasa/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Lukasa/starred{/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/1438/reactions" }
https://api.github.com/repos/psf/requests/issues/1438/timeline
null
completed
null
null
false
[ "I'm happy to patch this and send you a pull request if you agree, just drop a note here.\n", "Yeah, I agree that this is wrong. Feel free to submit a Pull Request. =)\n", "This is absolutely a bug. Sorry about that :(\n", "No problem!\n" ]
https://api.github.com/repos/psf/requests/issues/1437
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1437/labels{/name}
https://api.github.com/repos/psf/requests/issues/1437/comments
https://api.github.com/repos/psf/requests/issues/1437/events
https://github.com/psf/requests/pull/1437
16,081,768
MDExOlB1bGxSZXF1ZXN0NjU4Njc2Mw==
1,437
Fixed wrong method call at streaming example
{ "avatar_url": "https://avatars.githubusercontent.com/u/190381?v=4", "events_url": "https://api.github.com/users/lukaszb/events{/privacy}", "followers_url": "https://api.github.com/users/lukaszb/followers", "following_url": "https://api.github.com/users/lukaszb/following{/other_user}", "gists_url": "https://api.github.com/users/lukaszb/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/lukaszb", "id": 190381, "login": "lukaszb", "node_id": "MDQ6VXNlcjE5MDM4MQ==", "organizations_url": "https://api.github.com/users/lukaszb/orgs", "received_events_url": "https://api.github.com/users/lukaszb/received_events", "repos_url": "https://api.github.com/users/lukaszb/repos", "site_admin": false, "starred_url": "https://api.github.com/users/lukaszb/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/lukaszb/subscriptions", "type": "User", "url": "https://api.github.com/users/lukaszb", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2013-06-27T11:38:09Z
2021-09-08T20:01:28Z
2013-06-27T18:18:56Z
CONTRIBUTOR
resolved
405 is returned if POST request is performed to http://httpbin.org/stream/20
{ "avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4", "events_url": "https://api.github.com/users/Lukasa/events{/privacy}", "followers_url": "https://api.github.com/users/Lukasa/followers", "following_url": "https://api.github.com/users/Lukasa/following{/other_user}", "gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Lukasa", "id": 1382556, "login": "Lukasa", "node_id": "MDQ6VXNlcjEzODI1NTY=", "organizations_url": "https://api.github.com/users/Lukasa/orgs", "received_events_url": "https://api.github.com/users/Lukasa/received_events", "repos_url": "https://api.github.com/users/Lukasa/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Lukasa/starred{/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/1437/reactions" }
https://api.github.com/repos/psf/requests/issues/1437/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/1437.diff", "html_url": "https://github.com/psf/requests/pull/1437", "merged_at": "2013-06-27T18:18:56Z", "patch_url": "https://github.com/psf/requests/pull/1437.patch", "url": "https://api.github.com/repos/psf/requests/pulls/1437" }
true
[ "Thanks so much @lukaszb! :cake:\n" ]
https://api.github.com/repos/psf/requests/issues/1436
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1436/labels{/name}
https://api.github.com/repos/psf/requests/issues/1436/comments
https://api.github.com/repos/psf/requests/issues/1436/events
https://github.com/psf/requests/issues/1436
16,010,863
MDU6SXNzdWUxNjAxMDg2Mw==
1,436
Prepared requests do not observe REQUESTS_CA_BUNDLE for SSL verification
{ "avatar_url": "https://avatars.githubusercontent.com/u/508928?v=4", "events_url": "https://api.github.com/users/yieldsfalsehood/events{/privacy}", "followers_url": "https://api.github.com/users/yieldsfalsehood/followers", "following_url": "https://api.github.com/users/yieldsfalsehood/following{/other_user}", "gists_url": "https://api.github.com/users/yieldsfalsehood/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/yieldsfalsehood", "id": 508928, "login": "yieldsfalsehood", "node_id": "MDQ6VXNlcjUwODkyOA==", "organizations_url": "https://api.github.com/users/yieldsfalsehood/orgs", "received_events_url": "https://api.github.com/users/yieldsfalsehood/received_events", "repos_url": "https://api.github.com/users/yieldsfalsehood/repos", "site_admin": false, "starred_url": "https://api.github.com/users/yieldsfalsehood/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/yieldsfalsehood/subscriptions", "type": "User", "url": "https://api.github.com/users/yieldsfalsehood", "user_view_type": "public" }
[]
closed
true
null
[]
null
9
2013-06-26T01:12:35Z
2021-09-08T08:00:39Z
2014-10-05T17:34:09Z
NONE
resolved
With an environment like this (assuming the server's certificate is in whatever bundle being referenced): ``` REQUESTS_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt ``` This code block works fine, and it fails expectedly if the certificate is missing from the bundle above. ``` >>> requests.get('https://some-domain') ``` This code block fails, throwing a "certificate verify failed" exception. ``` >>> s = requests.Session() >>> req = requests.Request('GET', 'https://some-domain') >>> s.send(req) ``` The first block calls Session.request, which creates a request object then passes it to the session's send method. In Session.request there's logic to try populating the value of verify with REQUESTS_CA_BUNDLE from the environment. Whatever value winds up in verify is then handed off to the session's send method. In the second block, manually calling the send method doesn't allow for that environment lookup logic to be called. It seems like it'd be more consistent and convenient moving that logic to the adapter's cert_verify method.
{ "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/1436/reactions" }
https://api.github.com/repos/psf/requests/issues/1436/timeline
null
completed
null
null
false
[ "Hi @yieldsfalsehood, thanks for raising this issue!\n\nThat verification logic is the odd-one-out in `Session.request()`, as it's the only thing that isn't directly related to preparing `PreparedRequest`s.\n\nI think the correct behaviour would be to move the two blocks that handle verification into `Session.send()` instead. It shouldn't go into the Adapter because the Adapter doesn't know about trusting environment variables (and shouldn't). If you have time I encourage you to open a Pull Request, otherwise I'll get around to this later today. =)\n", "Actually, on second thought, I'm no longer convinced we should change this.\n\nI've moved that code in a local copy of Requests, and while everything works fine it just looks _wrong_ to me. `Session.send()` doesn't really mess about with keyword arguments, but this change would do that.\n\nI'm now tempted to say that if you've circumvented `Session.request()` (in order to prepare Requests yourself), you must make sure you do whatever you need from `Session.request()`. In this case, that's merging cookies and getting data from environment variables.\n\nI'm now +0 on this, so I'll wait until we get input from @kennethreitz and @sigmavirus24.\n", "Thanks for the feedback. I'm submit a change and tests to work on this.\n\nRegarding placement, I looked in to the adapter's cert_verify because it seemed the lowest level place to add the lookup logic for that env variable (it's already doing a lookup for the fallback bundle there), but I agree it makes sense to have it where we can check if the trusted environment flag is set. And I agree that if I take control of owning the request object by evading Session.request I am in charge of how I manipulate it (that's the point of being able to create and send the request object manually).\n\nHowever, I think logic like cookie merging is different than the environment lookup - cookie merging is a higher level process that might need to be customized in the application but the environment lookup will always be the same, which amounts to requiring the end users to do the lookup and pass in the location of the bundle whenever prepared requests are being used. I believe it adds more functionality encapsulating that logic in Requests so that the library behaves the same (in regards to environment lookups) regardless of how requests are issued.\n", "In case you're interested I pushed my test cases up to my fork. They're hackish, but I think they accomplish what they need to.\n", "Hmm, I'm prepared to be convinced by that line of argument. I'd still like at least one of @kennethreitz and @sigmavirus24 to weigh in, but I think that's reasonable. \n", "I think this was fixed in #2718. Closing for now. If I'm wrong, ping us and we'll reopen it.\n", "@sigmavirus24 this doesn't seem to be fixed, at the very least not in the way that is outlined in this issue. Tested in 2.6.0 (version I was using) and 2.18.1 (latest).\r\n\r\n**testcase.py**\r\n```py\r\nfrom os import environ\r\nfrom requests import Request, Session\r\n\r\n\r\nenviron['REQUESTS_CA_BUNDLE'] = '/etc/ssl/certs/ca-certificates.crt'\r\n\r\nsession = Session()\r\nrequest = Request(method='GET', url='https://debug.lan/health').prepare()\r\n\r\ntry:\r\n print(session.send(request, timeout=10))\r\nexcept Exception as e:\r\n print(e)\r\n\r\ntry:\r\n print(session.get('https://debug.lan/health', timeout=10))\r\nexcept Exception as e:\r\n print(e)\r\n```\r\n\r\n**output**\r\n```\r\n[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:581)\r\n<Response [200]>\r\n```", "@mal We added an API for doing what you need: see #2178.", "Aha, thanks @Lukasa, this does the job 👍 \r\n\r\n```py\r\nsession.send(request, timeout=10,\r\n **session.merge_environment_settings(request.url, None, None, None, None))\r\n```" ]
https://api.github.com/repos/psf/requests/issues/1435
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1435/labels{/name}
https://api.github.com/repos/psf/requests/issues/1435/comments
https://api.github.com/repos/psf/requests/issues/1435/events
https://github.com/psf/requests/pull/1435
16,005,953
MDExOlB1bGxSZXF1ZXN0NjU0Njk3Mw==
1,435
@1434 https://github.com/kennethreitz/requests/issues/1434
{ "avatar_url": "https://avatars.githubusercontent.com/u/387737?v=4", "events_url": "https://api.github.com/users/chinux23/events{/privacy}", "followers_url": "https://api.github.com/users/chinux23/followers", "following_url": "https://api.github.com/users/chinux23/following{/other_user}", "gists_url": "https://api.github.com/users/chinux23/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/chinux23", "id": 387737, "login": "chinux23", "node_id": "MDQ6VXNlcjM4NzczNw==", "organizations_url": "https://api.github.com/users/chinux23/orgs", "received_events_url": "https://api.github.com/users/chinux23/received_events", "repos_url": "https://api.github.com/users/chinux23/repos", "site_admin": false, "starred_url": "https://api.github.com/users/chinux23/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/chinux23/subscriptions", "type": "User", "url": "https://api.github.com/users/chinux23", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2013-06-25T22:41:02Z
2021-09-08T20:01:29Z
2013-06-25T22:49:04Z
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/1435/reactions" }
https://api.github.com/repos/psf/requests/issues/1435/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/1435.diff", "html_url": "https://github.com/psf/requests/pull/1435", "merged_at": "2013-06-25T22:49:04Z", "patch_url": "https://github.com/psf/requests/pull/1435.patch", "url": "https://api.github.com/repos/psf/requests/pulls/1435" }
true
[ "#1434 \n", "Thanks! This will merge as soon as Travis says it passes :)\n" ]
https://api.github.com/repos/psf/requests/issues/1434
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1434/labels{/name}
https://api.github.com/repos/psf/requests/issues/1434/comments
https://api.github.com/repos/psf/requests/issues/1434/events
https://github.com/psf/requests/issues/1434
15,983,794
MDU6SXNzdWUxNTk4Mzc5NA==
1,434
stream_decode_response_unicode fails in Python 3 at rv = decoder.decode('', final=True)
{ "avatar_url": "https://avatars.githubusercontent.com/u/387737?v=4", "events_url": "https://api.github.com/users/chinux23/events{/privacy}", "followers_url": "https://api.github.com/users/chinux23/followers", "following_url": "https://api.github.com/users/chinux23/following{/other_user}", "gists_url": "https://api.github.com/users/chinux23/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/chinux23", "id": 387737, "login": "chinux23", "node_id": "MDQ6VXNlcjM4NzczNw==", "organizations_url": "https://api.github.com/users/chinux23/orgs", "received_events_url": "https://api.github.com/users/chinux23/received_events", "repos_url": "https://api.github.com/users/chinux23/repos", "site_admin": false, "starred_url": "https://api.github.com/users/chinux23/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/chinux23/subscriptions", "type": "User", "url": "https://api.github.com/users/chinux23", "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
3
2013-06-25T15:17:55Z
2021-09-09T03:00:20Z
2013-06-26T07:38:03Z
CONTRIBUTOR
resolved
``` rv = decoder.decode('', final=True) should be rv = decoder.decode(b'', final=True) ``` otherwise, this fails: ``` import codecs decoder = codecs.getincrementaldecoder("utf-8")(errors='replace') rv = decoder.decode('', final=True) ``` Traceback: ``` --------------------------------------------------------------------------- TypeError Traceback (most recent call last) <ipython-input-21-86c335a3edfc> in <module>() ----> 1 rv = decoder.decode('', final=True) /Users/chen/Virtualenvs/python3Env/lib/python3.3/codecs.py in decode(self, input, final) 297 def decode(self, input, final=False): 298 # decode input (taking the buffer into account) --> 299 data = self.buffer + input 300 (result, consumed) = self._buffer_decode(data, self.errors, final) 301 # keep undecoded input until the next call TypeError: can't concat bytes to str ``` Original Code attached: ``` def stream_decode_response_unicode(iterator, r): """Stream decodes a iterator.""" if r.encoding is None: for item in iterator: yield item return decoder = codecs.getincrementaldecoder(r.encoding)(errors='replace') for chunk in iterator: rv = decoder.decode(chunk) if rv: yield rv rv = decoder.decode('', final=True) if rv: yield rv ```
{ "avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4", "events_url": "https://api.github.com/users/Lukasa/events{/privacy}", "followers_url": "https://api.github.com/users/Lukasa/followers", "following_url": "https://api.github.com/users/Lukasa/following{/other_user}", "gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Lukasa", "id": 1382556, "login": "Lukasa", "node_id": "MDQ6VXNlcjEzODI1NTY=", "organizations_url": "https://api.github.com/users/Lukasa/orgs", "received_events_url": "https://api.github.com/users/Lukasa/received_events", "repos_url": "https://api.github.com/users/Lukasa/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Lukasa/starred{/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/1434/reactions" }
https://api.github.com/repos/psf/requests/issues/1434/timeline
null
completed
null
null
false
[ "Hi @chinux23, thanks for raising this issue! I agree, that looks fairly clearly wrong to me. I don't have time to fix it right now, so you should feel free to open a Pull Request if you want to fix it yourself. Otherwise, I'm marking this as Contributor Friendly until I can get around to it. =)\n", "I can make a fix for this. I'll submit a pull request once I am done. Thanks.\n", "Fixed by #1435. Thanks so much!\n" ]
https://api.github.com/repos/psf/requests/issues/1433
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1433/labels{/name}
https://api.github.com/repos/psf/requests/issues/1433/comments
https://api.github.com/repos/psf/requests/issues/1433/events
https://github.com/psf/requests/issues/1433
15,959,607
MDU6SXNzdWUxNTk1OTYwNw==
1,433
Separate password management from authentication managers
{ "avatar_url": "https://avatars.githubusercontent.com/u/308610?v=4", "events_url": "https://api.github.com/users/jaraco/events{/privacy}", "followers_url": "https://api.github.com/users/jaraco/followers", "following_url": "https://api.github.com/users/jaraco/following{/other_user}", "gists_url": "https://api.github.com/users/jaraco/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/jaraco", "id": 308610, "login": "jaraco", "node_id": "MDQ6VXNlcjMwODYxMA==", "organizations_url": "https://api.github.com/users/jaraco/orgs", "received_events_url": "https://api.github.com/users/jaraco/received_events", "repos_url": "https://api.github.com/users/jaraco/repos", "site_admin": false, "starred_url": "https://api.github.com/users/jaraco/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/jaraco/subscriptions", "type": "User", "url": "https://api.github.com/users/jaraco", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2013-06-25T03:24:56Z
2021-09-09T03:00:21Z
2013-06-25T16:23:01Z
CONTRIBUTOR
resolved
In urllib2, the semantic concept of password management is separate from the authentication mechanisms. This means that one can implement password management (resolution of a username and password in a realm) independent of authentication mechanisms (basic, digest, etc). With requests, it's not clear how one could do this if it's even possible. In particular, I'm working on a library that allows resolving a password late and only after the server has prompted for it. From the documentation and reading the code, it appears that requests requires that the authentication be known before the initial request is made, or for digest auth, it can be resolved later. For example, see [this code](https://bitbucket.org/jaraco/lpaste/src/88a8a13b7ba79651102fb3937220a8eddbd9b6c4/lpaste/lpaste.py?at=default#cl-129) where the password manager is set up independently of the auth mechanism, and where the keyring-based implementation is only invoked if authentication is required. I'd like to port that code to requests, but it seems to do that, I'd have to write a custom AuthBase, borrow the handle_401 from DigestAuth, borrow the password encoding from the basic auth class as well, plus customize it to the library's specific needs. What hooks/options does requests provide that might help facilitate this need? Should requests be extended here to support these sorts of use cases? Should requests follow the same separation of responsibilities as urllib2 does, or is there a better approach in the spirit of requests?
{ "avatar_url": "https://avatars.githubusercontent.com/u/308610?v=4", "events_url": "https://api.github.com/users/jaraco/events{/privacy}", "followers_url": "https://api.github.com/users/jaraco/followers", "following_url": "https://api.github.com/users/jaraco/following{/other_user}", "gists_url": "https://api.github.com/users/jaraco/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/jaraco", "id": 308610, "login": "jaraco", "node_id": "MDQ6VXNlcjMwODYxMA==", "organizations_url": "https://api.github.com/users/jaraco/orgs", "received_events_url": "https://api.github.com/users/jaraco/received_events", "repos_url": "https://api.github.com/users/jaraco/repos", "site_admin": false, "starred_url": "https://api.github.com/users/jaraco/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/jaraco/subscriptions", "type": "User", "url": "https://api.github.com/users/jaraco", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/1433/reactions" }
https://api.github.com/repos/psf/requests/issues/1433/timeline
null
completed
null
null
false
[ "Hi @jaraco, thanks for opening this issue! =)\n\nI'll begin by addressing your actual problem. Simply put, the easiest way to resolve the password after the server has prompted for it is to not attach an auth handler to the original request, then check the response code:\n\n``` python\nr = requests.get('http://authpage.com/')\n\nif r.status_code == 401:\n user, pass = prompt_for_auth()\n r = requests.get('http://authpage.com/', auth=(user, pass))\n```\n\nIf you feel as though this has too much boilerplate for you (which it would do if you do this a lot), take a look at what the Digest Auth handler does to handle 401 responses. You can easily write a Basic Auth handler that exhibits the same behaviour:\n\n``` python\nfrom requests.auth import AuthBase, _basic_auth_str\n\nclass DelayedBasicAuth(AuthBase):\n \"\"\"\n A class that implements HTTP Basic Authentication by waiting for a 401\n response and then attaching the auth data.\n \"\"\"\n def __init__(self):\n pass\n\n def __call__(self, r):\n r.register_hook('response', self.handle_401)\n return r\n\n def credentials(self):\n if not (self.username and self.password):\n self.username, self.password = prompt_for_auth()\n\n return self.username, self.password\n\n def handle_401(self, r, **kwargs):\n num_401_calls = getattr(self, 'num_401_calls', 1)\n auth_hdr = r.headers.get('www-authenticate', '')\n\n if 'basic' in auth_hdr.lower() and num_401_calls < 2:\n setattr(self, 'num_401_calls', num_401_calls + 1)\n\n r.content\n r.raw.release_conn()\n\n user, pword = self.credentials()\n\n r.request.headers['Authorization'] = _basic_auth_str(user, pword)\n _r = r.connection.send(r.request, **kwargs)\n _r.history.append(r)\n\n return _r\n\n setattr(self, 'num_401_calls', 1)\n return r\n```\n\nThese should both allow the kind of delayed activation you want, and indeed the `handle_401()` hook should be able to block as long as necessary (e.g. to accept user input).\n\nHopefully these address your specific problem. Now I'll address your more philosophical questions.\n\nOne of the things that Requests desperately tries to avoid is the complexity of urllib2's password API. It's not that we don't think separating credential management and authentication is _ipso facto_ a bad idea, but the API is dire.\n\nRequests is pragmatic. Design decisions are made with simplicity and pragmatism as the primary two concerns. This means we have to answer two questions:\n1. Can this separation of concerns be implemented in a way that doesn't inconvenience the vast majority of users, who honestly couldn't care less?\n2. Is this separation of concerns actually worth having in the library proper?\n\nI'm not sure about (1), though my gut feeling is 'no'. I'm certainly open to someone proving me wrong. More importantly, I don't know that I think the answer to (2) is 'yes'. I'm prepared to be convinced, but at the moment I'm pretty comfortably leaning towards this being something that people who want it have to implement themselves.\n", "@Lukasa \nThanks so much for the detailed and informative response.\n\nI had gone down the 'handle_401' route, but didn't like it because it didn't seem reusable and seemed to combine too many factors (authentication, request/response workflow, password management), so that's why I abandoned it and ended up here.\n\nI thought maybe I was just framing the problem wrong and sure enough, your simple example works very nicely for my needs.\n\nModeled after your example, I [implemented this](https://bitbucket.org/jaraco/lpaste/src/4e127b565867eb149b62d753d9c467cbfd196453/lpaste/lpaste.py?at=default#cl-139), which greatly simplified the implementation.\n\nRegarding the separation of concerns, I believe it should be possible to provide an extensible mechanism for auth that separate concerns but degrade nicely to the simple, default pattern. I'll have to defer that work for later, though, and leave this issue closed in the meantime.\n" ]
https://api.github.com/repos/psf/requests/issues/1432
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1432/labels{/name}
https://api.github.com/repos/psf/requests/issues/1432/comments
https://api.github.com/repos/psf/requests/issues/1432/events
https://github.com/psf/requests/issues/1432
15,929,807
MDU6SXNzdWUxNTkyOTgwNw==
1,432
Issue trying to specify http_pool_maxsize
{ "avatar_url": "https://avatars.githubusercontent.com/u/4803025?v=4", "events_url": "https://api.github.com/users/DaveDunne/events{/privacy}", "followers_url": "https://api.github.com/users/DaveDunne/followers", "following_url": "https://api.github.com/users/DaveDunne/following{/other_user}", "gists_url": "https://api.github.com/users/DaveDunne/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/DaveDunne", "id": 4803025, "login": "DaveDunne", "node_id": "MDQ6VXNlcjQ4MDMwMjU=", "organizations_url": "https://api.github.com/users/DaveDunne/orgs", "received_events_url": "https://api.github.com/users/DaveDunne/received_events", "repos_url": "https://api.github.com/users/DaveDunne/repos", "site_admin": false, "starred_url": "https://api.github.com/users/DaveDunne/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/DaveDunne/subscriptions", "type": "User", "url": "https://api.github.com/users/DaveDunne", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2013-06-24T15:12:42Z
2021-09-09T03:00:21Z
2013-06-24T16:46:48Z
NONE
resolved
When trying to specifiy other values for http_pool_maxsize self.session.mount('http://', requests.adapters.HTTPAdapter(pool_connections=self.pool_connections, pool_maxsize=self.pool_maxsize, max_retries=self.max_retries, pool_block=self.is_pool_block)) Error Traceback (most recent call last): File "/usr/lib/python2.7/unittest/case.py", line 327, in run .......... return self.session.put(self.swiftAuthPath + SWAUTH_API_VERSION_2 + "/" + account, headers=headers) File "/usr/local/lib/python2.7/dist-packages/requests/sessions.py", line 387, in put return self.request('PUT', url, data=data, *_kwargs) File "/usr/local/lib/python2.7/dist-packages/requests/sessions.py", line 335, in request resp = self.send(prep, *_send_kwargs) File "/usr/local/lib/python2.7/dist-packages/requests/sessions.py", line 438, in send r = adapter.send(request, *_kwargs) File "/usr/local/lib/python2.7/dist-packages/requests/adapters.py", line 272, in send conn = self.get_connection(request.url, proxies) File "/usr/local/lib/python2.7/dist-packages/requests/adapters.py", line 199, in get_connection conn = self.poolmanager.connection_from_url(url) File "/usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/poolmanager.py", line 123, in connection_from_url return self.connection_from_host(u.host, port=u.port, scheme=u.scheme) File "/usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/poolmanager.py", line 109, in connection_from_host pool = self._new_pool(scheme, host, port) File "/usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/poolmanager.py", line 79, in _new_pool return pool_cls(host, port, *_kwargs) File "/usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/connectionpool.py", line 189, in **init** for _ in xrange(maxsize): TypeError: an integer is required Problem is that it tries to create a xrange when doing **init** in connectionpool.py and supplies a string and I get this above exception Am I doing something wrong? This only seems to work with the default Thanks Dave
{ "avatar_url": "https://avatars.githubusercontent.com/u/4803025?v=4", "events_url": "https://api.github.com/users/DaveDunne/events{/privacy}", "followers_url": "https://api.github.com/users/DaveDunne/followers", "following_url": "https://api.github.com/users/DaveDunne/following{/other_user}", "gists_url": "https://api.github.com/users/DaveDunne/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/DaveDunne", "id": 4803025, "login": "DaveDunne", "node_id": "MDQ6VXNlcjQ4MDMwMjU=", "organizations_url": "https://api.github.com/users/DaveDunne/orgs", "received_events_url": "https://api.github.com/users/DaveDunne/received_events", "repos_url": "https://api.github.com/users/DaveDunne/repos", "site_admin": false, "starred_url": "https://api.github.com/users/DaveDunne/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/DaveDunne/subscriptions", "type": "User", "url": "https://api.github.com/users/DaveDunne", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/1432/reactions" }
https://api.github.com/repos/psf/requests/issues/1432/timeline
null
completed
null
null
false
[ "Hi there, thanks for raising this issue!\n\nThis works fine for me if I use an integer as the `pool_maxsize` argument. Out of interest, what is `self.pool_maxsize` in your example?\n", "Hey thanks Lukasa,\n\nSorry - I have just converted the string to an int and its working. \n\nDave\n" ]
https://api.github.com/repos/psf/requests/issues/1431
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1431/labels{/name}
https://api.github.com/repos/psf/requests/issues/1431/comments
https://api.github.com/repos/psf/requests/issues/1431/events
https://github.com/psf/requests/issues/1431
15,903,050
MDU6SXNzdWUxNTkwMzA1MA==
1,431
Https and proxies problem (Fiddler2)
{ "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
4
2013-06-23T21:55:25Z
2021-09-09T03:00:20Z
2013-06-27T20:00:21Z
NONE
resolved
I am trying to redirect my python requests through Fiddler2 so I can monitor what is going on. As far as I know I have set up Fiddler correctly because I can see my http requests going through. However, my https requests are getting this error: An exception of type SSLError occured, these were the arguments: (SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:547)'),),) My code looks like this: ``` proxies = { "http":"http://127.0.0.1:8888", "https":"https://127.0.0.1:8888", } url1='https://membership.usairways.com/Login.aspxReturnUrl=http:%2f%2fwww.usairways.com%2fdefault.aspx' s = requests.Session() s.mount('https://', ssladapter.SSLAdapter(ssl_version = PROTOCOL_SSLv3)) r1 = s.get(url1, proxies = proxies) #USair Home Page ``` I have tried other https web addresses and I get the same error. The code works fine if I remove the proxies argument(but is fine for http). Any ideas?
{ "avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4", "events_url": "https://api.github.com/users/Lukasa/events{/privacy}", "followers_url": "https://api.github.com/users/Lukasa/followers", "following_url": "https://api.github.com/users/Lukasa/following{/other_user}", "gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Lukasa", "id": 1382556, "login": "Lukasa", "node_id": "MDQ6VXNlcjEzODI1NTY=", "organizations_url": "https://api.github.com/users/Lukasa/orgs", "received_events_url": "https://api.github.com/users/Lukasa/received_events", "repos_url": "https://api.github.com/users/Lukasa/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions", "type": "User", "url": "https://api.github.com/users/Lukasa", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/1431/reactions" }
https://api.github.com/repos/psf/requests/issues/1431/timeline
null
completed
null
null
false
[ "Are you trying to do transparent HTTPS proxying (e.g. just forward the encrypted traffic through) or are you trying to use Fiddler2 as a MITM proxy?\n", "I am trying to debug some website scraping code and wanted to see what was going on with the headers, post data and cookies that I am sending using Requests. I wanted to make sure that I was using Requests properly. I use Fiddler2 and Tamper Data to watch the data being sent from the browser to the target server. I matched the data being sent using Requests but I am still getting an 400 error. \n\nNow, here is the kicker. When I don't include all the header data (took some out. found by trial and error) I get a correct 200 response and the data I need. I just wanted to know why and wanted to investigate what Requests was actually sending (outside of IDE).\n\nSince I'm new to all of this and judging from your comment I'm guessing this can't be done because of the ssl encryption hence not a problem with Requests at all. Correct? :) If there is a way I surely would like to know ;)\n", "You have two options here:\n1. Requests keeps all that data lying around. You can see what was sent on a request by examining `Response.request`, e.g. `Response.request.headers`. This is a `PreparedRequest` object, so has all the data of that object. The history is also available, if you saw any redirects: `Response.history`.\n2. Use a Man-in-the-Middle proxy. You _can't_ use a transparent proxy here, partly because Requests doesn't support them (yet) and partly because all the traffic would be encrypted and you wouldn't see a thing. I don't know much about Fiddler2, but [mitmproxy](http://mitmproxy.org/) is totally awesome and does MITM stuff. =)\n", "Thanks for all your help. I will check out mitmproxy. :)\n" ]
https://api.github.com/repos/psf/requests/issues/1430
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1430/labels{/name}
https://api.github.com/repos/psf/requests/issues/1430/comments
https://api.github.com/repos/psf/requests/issues/1430/events
https://github.com/psf/requests/issues/1430
15,901,557
MDU6SXNzdWUxNTkwMTU1Nw==
1,430
url encoding issue
{ "avatar_url": "https://avatars.githubusercontent.com/u/347288?v=4", "events_url": "https://api.github.com/users/Chris2048/events{/privacy}", "followers_url": "https://api.github.com/users/Chris2048/followers", "following_url": "https://api.github.com/users/Chris2048/following{/other_user}", "gists_url": "https://api.github.com/users/Chris2048/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Chris2048", "id": 347288, "login": "Chris2048", "node_id": "MDQ6VXNlcjM0NzI4OA==", "organizations_url": "https://api.github.com/users/Chris2048/orgs", "received_events_url": "https://api.github.com/users/Chris2048/received_events", "repos_url": "https://api.github.com/users/Chris2048/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Chris2048/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Chris2048/subscriptions", "type": "User", "url": "https://api.github.com/users/Chris2048", "user_view_type": "public" }
[]
closed
true
null
[]
null
5
2013-06-23T20:11:15Z
2021-09-09T03:00:22Z
2013-06-24T12:10:44Z
NONE
resolved
The Hacker News API requires a '+' in the URL for certain kinds of searches. If I put one in a parameter, it is escaped by requests and doesn't work. A workaround is to put the parameter in the URL string.
{ "avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4", "events_url": "https://api.github.com/users/Lukasa/events{/privacy}", "followers_url": "https://api.github.com/users/Lukasa/followers", "following_url": "https://api.github.com/users/Lukasa/following{/other_user}", "gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Lukasa", "id": 1382556, "login": "Lukasa", "node_id": "MDQ6VXNlcjEzODI1NTY=", "organizations_url": "https://api.github.com/users/Lukasa/orgs", "received_events_url": "https://api.github.com/users/Lukasa/received_events", "repos_url": "https://api.github.com/users/Lukasa/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Lukasa/starred{/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/1430/reactions" }
https://api.github.com/repos/psf/requests/issues/1430/timeline
null
completed
null
null
false
[ "Hi @Chris2048! Does the Hacker News API not treat the encoded version of the `+` character the same as an unencoded version?\n", "No, right now (for me) \"http://api.thriftdb.com/api.hnsearch.com/items/_search?filter[fields][create_ts]=[2013-06-23T00:00:00Z%20+%20TO%20+%20*]\" returns 3451 hits, but \"http://api.thriftdb.com/api.hnsearch.com/items/_search?filter[fields][create_ts]=[2013-06-23T00:00:00Z%20%2B%20TO%20%2B%20*]\" returns 'null' hits...\n", "I'm pretty sure that the API is doing the wrong thing here.\n\nThe '+' character has a syntactic meaning in the query string. Spaces may be encoded either to the literal `+` or to `%20`. For this reason, a non-space `+` character _must_ be encoded to `%2B`. Given that the HN API is clearly using the `%20` representation of a space, I think someone needs to tell them that they can't use the `+` like that.\n\nUnfortunately, this makes it a lot harder for us to help you on this problem. You do have some options. One would be to break open the flow, building `PreparedRequests` yourself and adjusting their URLs. You could potentially use @sigmavirus24's [uritemplate](https://github.com/sigmavirus24/uritemplate) library to help with that.\n", "Just tried \"http://api.thriftdb.com/api.hnsearch.com/items/_search?filter[fields][create_ts]=[2013-06-23T00:00:00Z%20TO%20*]\" and it works. Wonder why the tutorials indicate the use of a '+'...\n", "Hmm, that is odd. Well, I'm glad you got your code working! Let me know if you have any further problems. =)\n" ]
https://api.github.com/repos/psf/requests/issues/1429
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/1429/labels{/name}
https://api.github.com/repos/psf/requests/issues/1429/comments
https://api.github.com/repos/psf/requests/issues/1429/events
https://github.com/psf/requests/pull/1429
15,884,797
MDExOlB1bGxSZXF1ZXN0NjQ4NzA2MA==
1,429
Packaging warning, in via @andrewgross.
{ "avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4", "events_url": "https://api.github.com/users/Lukasa/events{/privacy}", "followers_url": "https://api.github.com/users/Lukasa/followers", "following_url": "https://api.github.com/users/Lukasa/following{/other_user}", "gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Lukasa", "id": 1382556, "login": "Lukasa", "node_id": "MDQ6VXNlcjEzODI1NTY=", "organizations_url": "https://api.github.com/users/Lukasa/orgs", "received_events_url": "https://api.github.com/users/Lukasa/received_events", "repos_url": "https://api.github.com/users/Lukasa/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Lukasa/starred{/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": "e11d21", "default": false, "description": null, "id": 44501305, "name": "Not Ready To Merge", "node_id": "MDU6TGFiZWw0NDUwMTMwNQ==", "url": "https://api.github.com/repos/psf/requests/labels/Not%20Ready%20To%20Merge" } ]
closed
true
null
[]
null
1
2013-06-22T14:05:03Z
2021-09-08T20:01:28Z
2013-06-24T07:48:48Z
MEMBER
resolved
Warn about including `cacerts.pem`. @andrewgross: This is my idea about better placement. Do you think this wording of the warning would have been helpful?
{ "avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4", "events_url": "https://api.github.com/users/Lukasa/events{/privacy}", "followers_url": "https://api.github.com/users/Lukasa/followers", "following_url": "https://api.github.com/users/Lukasa/following{/other_user}", "gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Lukasa", "id": 1382556, "login": "Lukasa", "node_id": "MDQ6VXNlcjEzODI1NTY=", "organizations_url": "https://api.github.com/users/Lukasa/orgs", "received_events_url": "https://api.github.com/users/Lukasa/received_events", "repos_url": "https://api.github.com/users/Lukasa/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Lukasa/starred{/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/1429/reactions" }
https://api.github.com/repos/psf/requests/issues/1429/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/1429.diff", "html_url": "https://github.com/psf/requests/pull/1429", "merged_at": "2013-06-24T07:48:48Z", "patch_url": "https://github.com/psf/requests/pull/1429.patch", "url": "https://api.github.com/repos/psf/requests/pulls/1429" }
true
[ "The wording is fine.\n" ]