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/528
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/528/labels{/name}
https://api.github.com/repos/psf/requests/issues/528/comments
https://api.github.com/repos/psf/requests/issues/528/events
https://github.com/psf/requests/pull/528
3,911,817
MDExOlB1bGxSZXF1ZXN0MTA4Mzc3Mw==
528
Include tests in tarballs.
{ "avatar_url": "https://avatars.githubusercontent.com/u/504287?v=4", "events_url": "https://api.github.com/users/floppym/events{/privacy}", "followers_url": "https://api.github.com/users/floppym/followers", "following_url": "https://api.github.com/users/floppym/following{/other_user}", "gists_url": "https://api.github.com/users/floppym/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/floppym", "id": 504287, "login": "floppym", "node_id": "MDQ6VXNlcjUwNDI4Nw==", "organizations_url": "https://api.github.com/users/floppym/orgs", "received_events_url": "https://api.github.com/users/floppym/received_events", "repos_url": "https://api.github.com/users/floppym/repos", "site_admin": false, "starred_url": "https://api.github.com/users/floppym/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/floppym/subscriptions", "type": "User", "url": "https://api.github.com/users/floppym", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2012-03-31T18:25:31Z
2021-09-08T14:01:11Z
2012-03-31T18:36:21Z
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/528/reactions" }
https://api.github.com/repos/psf/requests/issues/528/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/528.diff", "html_url": "https://github.com/psf/requests/pull/528", "merged_at": "2012-03-31T18:36:21Z", "patch_url": "https://github.com/psf/requests/pull/528.patch", "url": "https://api.github.com/repos/psf/requests/pulls/528" }
true
[ "Thanks!\n" ]
https://api.github.com/repos/psf/requests/issues/527
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/527/labels{/name}
https://api.github.com/repos/psf/requests/issues/527/comments
https://api.github.com/repos/psf/requests/issues/527/events
https://github.com/psf/requests/issues/527
3,911,037
MDU6SXNzdWUzOTExMDM3
527
Add Compliance Documentation
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
[ { "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
0
2012-03-31T16:05:17Z
2021-09-09T06:00:52Z
2012-08-10T16:09:48Z
CONTRIBUTOR
resolved
#480
{ "avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4", "events_url": "https://api.github.com/users/Lukasa/events{/privacy}", "followers_url": "https://api.github.com/users/Lukasa/followers", "following_url": "https://api.github.com/users/Lukasa/following{/other_user}", "gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Lukasa", "id": 1382556, "login": "Lukasa", "node_id": "MDQ6VXNlcjEzODI1NTY=", "organizations_url": "https://api.github.com/users/Lukasa/orgs", "received_events_url": "https://api.github.com/users/Lukasa/received_events", "repos_url": "https://api.github.com/users/Lukasa/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Lukasa/starred{/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/527/reactions" }
https://api.github.com/repos/psf/requests/issues/527/timeline
null
completed
null
null
false
[]
https://api.github.com/repos/psf/requests/issues/526
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/526/labels{/name}
https://api.github.com/repos/psf/requests/issues/526/comments
https://api.github.com/repos/psf/requests/issues/526/events
https://github.com/psf/requests/issues/526
3,908,744
MDU6SXNzdWUzOTA4NzQ0
526
Multipart (files=) Strings
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
[ { "color": "e102d8", "default": false, "description": null, "id": 117745, "name": "Planned", "node_id": "MDU6TGFiZWwxMTc3NDU=", "url": "https://api.github.com/repos/psf/requests/labels/Planned" }, { "color": "0b02e1", "default": false, "description": null, "id": 191274, "name": "Contributor Friendly", "node_id": "MDU6TGFiZWwxOTEyNzQ=", "url": "https://api.github.com/repos/psf/requests/labels/Contributor%20Friendly" } ]
closed
true
null
[]
null
10
2012-03-31T06:29:52Z
2021-09-09T08:00:48Z
2012-05-08T05:00:03Z
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/526/reactions" }
https://api.github.com/repos/psf/requests/issues/526/timeline
null
completed
null
null
false
[ "do you mean like: \nr = requests.post(url, files={'file.txt': 'some_data', 'rb')})\n", "exactly\n", "https://github.com/kennethreitz/requests/pull/559\n", "just occured to me you probably want unicode string support. I'll update tomorrow\n", "Hows the Pull request look? Consider yourself bugged.\n", "I thought you were going to update? :P\n", "i did. commit 3d097b2cfea47917d03486951b54f937868bbd15 covers unicode. wasn't aware, but since on same branch it included with original pull request.\n", "i'll go about updating the docs as well if its approved.\n", "docs added\n", ":cake:\n" ]
https://api.github.com/repos/psf/requests/issues/525
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/525/labels{/name}
https://api.github.com/repos/psf/requests/issues/525/comments
https://api.github.com/repos/psf/requests/issues/525/events
https://github.com/psf/requests/issues/525
3,908,722
MDU6SXNzdWUzOTA4NzIy
525
Distibute Workload
{ "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": "02e10c", "default": false, "description": null, "id": 76800, "name": "Feature Request", "node_id": "MDU6TGFiZWw3NjgwMA==", "url": "https://api.github.com/repos/psf/requests/labels/Feature%20Request" } ]
closed
true
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
[ { "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" } ]
null
8
2012-03-31T06:22:48Z
2021-09-09T07:05:27Z
2012-07-27T05:58:41Z
CONTRIBUTOR
resolved
This is not scalable. --- ### First steps: - Think through contribution workflow - Heavily document said workflow. ### Next steps: - Move personal emails to mailing list - Heavily encourage someone that "gets it" to become heavily involved and get collab'd
{ "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/525/reactions" }
https://api.github.com/repos/psf/requests/issues/525/timeline
null
completed
null
null
false
[ "Development is quite fine, actually. Support / Questions are the issue. \n", "A guide through the modules and bug triaging would be great too.\n", "+100\n", "From my point of view, the PyDev collaboration workflow is the best: http://pydev.org/about.html\n- Users support => stackoverflow\n- Discussion between contributors => mailing-list\n\nDetailed explanations from Fabio (PyDev project leader): http://pydev.blogspot.com/2012/02/pydev-forums-stackoverflow.html\n", "Documentation on triaging would be great. I've gone through a large number of Issues that have been merged and could be closed but don't know how best to convey this knowledge.\n", "http://geemus.com/blog/2011/11/27/less-is-more\n", ":thumbsup:\n", "If you have some time, you should watch this video about the opensource community construction: http://video.fosdem.org/2012/maintracks/k.1.105/You_re_doing_it_wrong_.webm\nI've seen his presentation in live at FOSDEM, it was very interesting.\nThe abstract: https://archive.fosdem.org/2012/schedule/event/really_grow_community.html\n" ]
https://api.github.com/repos/psf/requests/issues/524
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/524/labels{/name}
https://api.github.com/repos/psf/requests/issues/524/comments
https://api.github.com/repos/psf/requests/issues/524/events
https://github.com/psf/requests/issues/524
3,908,713
MDU6SXNzdWUzOTA4NzEz
524
Document Custom Encodings
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
[ { "color": "e102d8", "default": false, "description": null, "id": 117745, "name": "Planned", "node_id": "MDU6TGFiZWwxMTc3NDU=", "url": "https://api.github.com/repos/psf/requests/labels/Planned" }, { "color": "0b02e1", "default": false, "description": null, "id": 191274, "name": "Contributor Friendly", "node_id": "MDU6TGFiZWwxOTEyNzQ=", "url": "https://api.github.com/repos/psf/requests/labels/Contributor%20Friendly" } ]
closed
true
null
[]
null
1
2012-03-31T06:19:11Z
2021-09-09T06:00:53Z
2012-08-10T16:09:32Z
CONTRIBUTOR
resolved
``` r = requests.get(...) r.encoding = 'myencoding' ```
{ "avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4", "events_url": "https://api.github.com/users/Lukasa/events{/privacy}", "followers_url": "https://api.github.com/users/Lukasa/followers", "following_url": "https://api.github.com/users/Lukasa/following{/other_user}", "gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Lukasa", "id": 1382556, "login": "Lukasa", "node_id": "MDQ6VXNlcjEzODI1NTY=", "organizations_url": "https://api.github.com/users/Lukasa/orgs", "received_events_url": "https://api.github.com/users/Lukasa/received_events", "repos_url": "https://api.github.com/users/Lukasa/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Lukasa/starred{/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/524/reactions" }
https://api.github.com/repos/psf/requests/issues/524/timeline
null
completed
null
null
false
[ "#480\n" ]
https://api.github.com/repos/psf/requests/issues/523
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/523/labels{/name}
https://api.github.com/repos/psf/requests/issues/523/comments
https://api.github.com/repos/psf/requests/issues/523/events
https://github.com/psf/requests/issues/523
3,908,608
MDU6SXNzdWUzOTA4NjA4
523
Document new SSL Client Cert Usage
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
[ { "color": "e102d8", "default": false, "description": null, "id": 117745, "name": "Planned", "node_id": "MDU6TGFiZWwxMTc3NDU=", "url": "https://api.github.com/repos/psf/requests/labels/Planned" }, { "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
2012-03-31T05:42:02Z
2021-09-09T06:00:51Z
2012-08-16T21:45:34Z
CONTRIBUTOR
resolved
As seen here: https://github.com/kennethreitz/requests/pull/485
{ "avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4", "events_url": "https://api.github.com/users/Lukasa/events{/privacy}", "followers_url": "https://api.github.com/users/Lukasa/followers", "following_url": "https://api.github.com/users/Lukasa/following{/other_user}", "gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Lukasa", "id": 1382556, "login": "Lukasa", "node_id": "MDQ6VXNlcjEzODI1NTY=", "organizations_url": "https://api.github.com/users/Lukasa/orgs", "received_events_url": "https://api.github.com/users/Lukasa/received_events", "repos_url": "https://api.github.com/users/Lukasa/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Lukasa/starred{/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/523/reactions" }
https://api.github.com/repos/psf/requests/issues/523/timeline
null
completed
null
null
false
[ "Is this done, should the issue be closed?\n", "Yes. =)\n" ]
https://api.github.com/repos/psf/requests/issues/522
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/522/labels{/name}
https://api.github.com/repos/psf/requests/issues/522/comments
https://api.github.com/repos/psf/requests/issues/522/events
https://github.com/psf/requests/issues/522
3,908,564
MDU6SXNzdWUzOTA4NTY0
522
Accept "dictionary update sequences" everywhere.
{ "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": "02e10c", "default": false, "description": null, "id": 76800, "name": "Feature Request", "node_id": "MDU6TGFiZWw3NjgwMA==", "url": "https://api.github.com/repos/psf/requests/labels/Feature%20Request" }, { "color": "e102d8", "default": false, "description": null, "id": 117745, "name": "Planned", "node_id": "MDU6TGFiZWwxMTc3NDU=", "url": "https://api.github.com/repos/psf/requests/labels/Planned" }, { "color": "0b02e1", "default": false, "description": null, "id": 191274, "name": "Contributor Friendly", "node_id": "MDU6TGFiZWwxOTEyNzQ=", "url": "https://api.github.com/repos/psf/requests/labels/Contributor%20Friendly" } ]
closed
true
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
[ { "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" } ]
null
4
2012-03-31T05:25:59Z
2021-09-09T05:29:56Z
2013-01-17T14:50:44Z
CONTRIBUTOR
resolved
Blocking OAuthLib, right @idangazit ?
{ "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/522/reactions" }
https://api.github.com/repos/psf/requests/issues/522/timeline
null
completed
null
null
false
[ "Not sure.\n\nUpdating data dicts is problematic because order might be sensitive, however we can get around that by just returning the form-urlencoded string.\n", "While I'm looking at #785, I was wondering what exactly you meant by this. Do you mean something like:\n\n``` python\nfrom requests import session\n\ns = session(params={'page': '2'}, headers={'Content-Type': 'application/json'})\n# use s for some requests\ns.params.update(page='3', user='sigmavirus24')\n```\n", "@idan @kennethreitz you never answered my question, and beyond that accepting update sequences everywhere seems a bit unreasonable\n", "This was a terrible idea.\n" ]
https://api.github.com/repos/psf/requests/issues/521
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/521/labels{/name}
https://api.github.com/repos/psf/requests/issues/521/comments
https://api.github.com/repos/psf/requests/issues/521/events
https://github.com/psf/requests/issues/521
3,884,819
MDU6SXNzdWUzODg0ODE5
521
Treating resource as file-like object seems to not work
{ "avatar_url": "https://avatars.githubusercontent.com/u/74351?v=4", "events_url": "https://api.github.com/users/maxcountryman/events{/privacy}", "followers_url": "https://api.github.com/users/maxcountryman/followers", "following_url": "https://api.github.com/users/maxcountryman/following{/other_user}", "gists_url": "https://api.github.com/users/maxcountryman/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/maxcountryman", "id": 74351, "login": "maxcountryman", "node_id": "MDQ6VXNlcjc0MzUx", "organizations_url": "https://api.github.com/users/maxcountryman/orgs", "received_events_url": "https://api.github.com/users/maxcountryman/received_events", "repos_url": "https://api.github.com/users/maxcountryman/repos", "site_admin": false, "starred_url": "https://api.github.com/users/maxcountryman/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/maxcountryman/subscriptions", "type": "User", "url": "https://api.github.com/users/maxcountryman", "user_view_type": "public" }
[]
closed
true
null
[]
null
3
2012-03-29T17:56:58Z
2021-09-09T09:00:40Z
2012-03-31T13:22:05Z
CONTRIBUTOR
resolved
For instance, in previous versions of requests it was possible to pass a repines to `open()` which would read the resource, such as an image, from the response object. It seems as though the `raw` attribute should handle this however when trying to pass the raw attribute of a response to `open()` an error is raised: ``` >>> open(requests.get('http://www.iana.org/_img/iana-logo-pageheader.png').raw) Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: coercing to Unicode: need string or buffer, HTTPResponse found ``` What is the proper way of handling this kind of functionality? Is there a preferred method for pulling down raw data and parsing it as a file-like object?
{ "avatar_url": "https://avatars.githubusercontent.com/u/74351?v=4", "events_url": "https://api.github.com/users/maxcountryman/events{/privacy}", "followers_url": "https://api.github.com/users/maxcountryman/followers", "following_url": "https://api.github.com/users/maxcountryman/following{/other_user}", "gists_url": "https://api.github.com/users/maxcountryman/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/maxcountryman", "id": 74351, "login": "maxcountryman", "node_id": "MDQ6VXNlcjc0MzUx", "organizations_url": "https://api.github.com/users/maxcountryman/orgs", "received_events_url": "https://api.github.com/users/maxcountryman/received_events", "repos_url": "https://api.github.com/users/maxcountryman/repos", "site_admin": false, "starred_url": "https://api.github.com/users/maxcountryman/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/maxcountryman/subscriptions", "type": "User", "url": "https://api.github.com/users/maxcountryman", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/521/reactions" }
https://api.github.com/repos/psf/requests/issues/521/timeline
null
completed
null
null
false
[ "Note that while you can use StringIO to convert `response.content` it doesn't seem to play nice with `open()`. However for my particular use case (pulling down an image) StringIO did the trick.\n", "You should be using `response.raw` directly instead of running `open` on it. It should work with most things.\n", "Cool. Thanks!\n" ]
https://api.github.com/repos/psf/requests/issues/520
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/520/labels{/name}
https://api.github.com/repos/psf/requests/issues/520/comments
https://api.github.com/repos/psf/requests/issues/520/events
https://github.com/psf/requests/issues/520
3,871,005
MDU6SXNzdWUzODcxMDA1
520
requests leaves a hanging connection for each request
{ "avatar_url": "https://avatars.githubusercontent.com/u/975735?v=4", "events_url": "https://api.github.com/users/Bluehorn/events{/privacy}", "followers_url": "https://api.github.com/users/Bluehorn/followers", "following_url": "https://api.github.com/users/Bluehorn/following{/other_user}", "gists_url": "https://api.github.com/users/Bluehorn/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Bluehorn", "id": 975735, "login": "Bluehorn", "node_id": "MDQ6VXNlcjk3NTczNQ==", "organizations_url": "https://api.github.com/users/Bluehorn/orgs", "received_events_url": "https://api.github.com/users/Bluehorn/received_events", "repos_url": "https://api.github.com/users/Bluehorn/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Bluehorn/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Bluehorn/subscriptions", "type": "User", "url": "https://api.github.com/users/Bluehorn", "user_view_type": "public" }
[ { "color": "e10c02", "default": false, "description": null, "id": 117744, "name": "Bug", "node_id": "MDU6TGFiZWwxMTc3NDQ=", "url": "https://api.github.com/repos/psf/requests/labels/Bug" } ]
closed
true
null
[]
null
62
2012-03-29T07:19:00Z
2021-09-03T00:10:52Z
2012-08-06T04:38:28Z
NONE
resolved
This was already noted in #458, but deserves an extra ticket: When using the simple API (via requests.head/get/post etc.), the requests module leaves a connection open until it is garbage collected. This eats up resources on the server site and it really impolite. How to reproduce: Run this script (can somebody please tell me how one can embed a gist in markdown? The help page shows only the result of embedding...): https://gist.github.com/2234274 Result on my system: <pre> torsten@sharokan:~/workspace/loco2-git$ python demo.py Open sockets after 20 head requests: COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME python 13928 torsten 3u IPv4 616968 0t0 TCP sharokan.fritz.box:50072->bk-in-f94.1e100.net:www (ESTABLISHED) python 13928 torsten 4u IPv4 616972 0t0 TCP sharokan.fritz.box:50073->bk-in-f94.1e100.net:www (ESTABLISHED) python 13928 torsten 5u IPv4 616976 0t0 TCP sharokan.fritz.box:50074->bk-in-f94.1e100.net:www (ESTABLISHED) python 13928 torsten 6u IPv4 616980 0t0 TCP sharokan.fritz.box:50075->bk-in-f94.1e100.net:www (ESTABLISHED) python 13928 torsten 7u IPv4 616984 0t0 TCP sharokan.fritz.box:50076->bk-in-f94.1e100.net:www (ESTABLISHED) python 13928 torsten 8u IPv4 616988 0t0 TCP sharokan.fritz.box:50077->bk-in-f94.1e100.net:www (ESTABLISHED) python 13928 torsten 9u IPv4 616992 0t0 TCP sharokan.fritz.box:50078->bk-in-f94.1e100.net:www (ESTABLISHED) python 13928 torsten 10u IPv4 616996 0t0 TCP sharokan.fritz.box:50079->bk-in-f94.1e100.net:www (ESTABLISHED) python 13928 torsten 11u IPv4 617000 0t0 TCP sharokan.fritz.box:50080->bk-in-f94.1e100.net:www (ESTABLISHED) python 13928 torsten 12u IPv4 617004 0t0 TCP sharokan.fritz.box:50081->bk-in-f94.1e100.net:www (ESTABLISHED) python 13928 torsten 13u IPv4 617008 0t0 TCP sharokan.fritz.box:50082->bk-in-f94.1e100.net:www (ESTABLISHED) python 13928 torsten 14u IPv4 617012 0t0 TCP sharokan.fritz.box:50083->bk-in-f94.1e100.net:www (ESTABLISHED) python 13928 torsten 15u IPv4 617016 0t0 TCP sharokan.fritz.box:50084->bk-in-f94.1e100.net:www (ESTABLISHED) python 13928 torsten 16u IPv4 617020 0t0 TCP sharokan.fritz.box:50085->bk-in-f94.1e100.net:www (ESTABLISHED) python 13928 torsten 17u IPv4 617024 0t0 TCP sharokan.fritz.box:50086->bk-in-f94.1e100.net:www (ESTABLISHED) python 13928 torsten 18u IPv4 617028 0t0 TCP sharokan.fritz.box:50087->bk-in-f94.1e100.net:www (ESTABLISHED) python 13928 torsten 19u IPv4 617032 0t0 TCP sharokan.fritz.box:50088->bk-in-f94.1e100.net:www (ESTABLISHED) python 13928 torsten 20u IPv4 617036 0t0 TCP sharokan.fritz.box:50089->bk-in-f94.1e100.net:www (ESTABLISHED) python 13928 torsten 21u IPv4 617040 0t0 TCP sharokan.fritz.box:50090->bk-in-f94.1e100.net:www (ESTABLISHED) python 13928 torsten 22u IPv4 617044 0t0 TCP sharokan.fritz.box:50091->bk-in-f94.1e100.net:www (ESTABLISHED) Garbage collection result: 1700 Open sockets after garbage collection: </pre> I think the sockets should be closed immediately when the session is unrefed. FYI, I found this when testing a local webservice by running it in CherryPy which defaults to 10 threads - after 10 requests, the web server was blocked.
{ "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/520/reactions" }
https://api.github.com/repos/psf/requests/issues/520/timeline
null
completed
null
null
false
[ "Digging further, this seems due to a reference loop and is really a problem inherited from httplib: The HTTPResponse keeps a reference to the file object as _fileobject. I would argue that that reference should be dropped after the complete response was read (it should not be possible to read from the socket of a pooled connection using some old response).\n", "Okay, and the reason this shows up is because there is a reference cycle between the request and response object.\nOtherwise, when the response object is dropped, the file would be closed. Due to the ref cycle, this can only happen on the next garbage collection.\n", "Is the the same issue as in #239?\n", "@shazow any thoughts?\n", "Are we talking about urllib3 request/response objects, or requests request/response objects?\n\nurllib3 cleans up in the [response.release_conn](https://github.com/shazow/urllib3/blob/master/urllib3/response.py#L96) method. The connection gets None'd for the exact reason that @Bluehorn mentioned. We could also None the `self._fp` but that's more for custom interfaces; I don't think httplib uses it.\n\nWe can definitely be more aggressive with closing connections in the cleanup of Requests's context manager. Right now to manually close connections, you'd need to iterate for each pool and pop its queue of connections and close them if they're open. If that's what we want to do, then I can definitely add a helper in urllib3 for \"closing pools\" which will do that in one call.\n", "Another approach would be to break the hard cycle between response and request by changing req.response to a weakref proxy before returning it from the session: http://dpaste.org/GOqzA/.\n", "@bluehorn's test continues to reproduce in trunk for me. Thanks!\n\nHere's something else interesting. If I change the test like so:\n\n``` diff\ndiff --git a/conntest.py b/conntest.py\nindex 3eac6c7..ec30d3f 100644\n--- a/conntest.py\n+++ b/conntest.py\n@@ -2,8 +2,10 @@ import gc, os, subprocess, requests\n\n gc.disable() # Just to make sure - I have seen this with gc enabled\n\n+s = requests.session()\n+\n for x in range(20):\n- requests.head(\"http://www.google.com/\")\n+ s.head(\"http://www.google.com/\")\n```\n\nI get the same result, 20 leaked `ESTABLISHED` connections. Are we sure that keep-alive is working?\n", "Sorry, documentation-reading fail. I wasn't consuming the content of the response objects. If I do that, things work as expected, connections get reused, and in the end only one is left alive.\n", "Here's my understanding of this issue so far:\n1. @Bluehorn and @gsakkis are right: the root problem is the reference cycle between `requests.Request` and `requests.Response`.\n2. Breaking this cycle in a crude way, e.g., removing the `request` member of the `Response` class, fixes @Bluehorn's test case.\n3. Although it might be possible to improve the way Requests uses urllib3, that can't fix the test case, because by default Requests returns the `Response` object with the socket still open and the body unread. Therefore, we rely on garbage collection to close the socket when clients don't read all the data. (Technically, since the test case is doing a `HEAD` request, the implementation of `requests.head` could be changed to close the socket. But the problem would still exist for the analogous test case calling `requests.get`.)\n\nSo here are the three viable approaches that occur to me:\n1. Replace `Response.request` with a `weakref.proxy`, as @gsakkis suggested. This breaks the following test: `r = requests.get(httpbin('get)); assert r.request.sent` (because `r.request` has been garbage-collected already, so we get \"ReferenceError: weakly-referenced object no longer exists\"). Anyway, this involves a smallish API breakage.\n2. Remove `Response.request`. This has the advantage of not using weak references. This breaks the above test and also breaks `HTTPDigestAuth`, which uses the `response` hook and expects the `Response` object it operates on to have a `request` member. We could work around this by changing the hook API, but either way, it seems like a larger API break.\n3. Enable `prefetch` and disable `keep_alive` by default, and then ensure that all the data is read and the socket is closed before we return to the client.\n\nRandom thought: it seems like keep-alive should be off by default. Outside the context of a session, we have no way to reuse the connection anyway.\n", "Heh, we could remove `Response.request` in general, but add it back in for the duration of the hook invocation. This makes #2 look more like #1, in terms of API breakage.\n\nhttps://gist.github.com/2621434\n", "In favor of option 3: any solution that relies on eager garbage collection won't work with PyPy.\n", "Once upon a time `prefetch` was on by default, we went through significant lengths to fix that. :)\n\nAlso it's pretty rare that you'll only make 1 request to a host in a script, so having `keep_alive` on by default is a nice feature. Otherwise we'd be content using urllib{1,2} with a thin API wrapper.\n", "@shazow \n\nCan you clarify the reasons for defaulting `prefetch` to off instead of on?\n\nSo --- defaulting `keep_alive=True` in the context of a session makes sense. But in the context of the vanilla API, that is to say, a plain `requests.get` or `requests.post`, there doesn't seem to be any mechanism for reusing the keep-alive connections, because an ephemeral `Session` object is created and it is given an ephemeral `PoolManager` in `init_poolmanager()`.\n", "Perhaps the original reason was that it made urllib3 and requests perform better in naive benchmarks. Upon further consideration, it also made sense to fetch only the data we're actually using, especially for large responses when we only really care about headers. Someday in the future when we add ETAG-based caching, this will be a necessity. Overall, lots of upsides, no real downsides (until now).\n\nI'm not super familiar with the Requests code in this context, but I'd imagine we'd want a reused static PoolManager instance for these things.\n", "A static or module-level mechanism for sharing and reusing the connections would make sense. On the other hand, it would significantly worsen the current \"gotcha\" with leaked connections, because if a client doesn't call `.content`, those connections will remain reserved in the static pool forever --- not even GC will be able to reclaim them.\n", "What if we made an explicit `del` call on the connection when [the LRU](https://github.com/shazow/urllib3/blob/master/urllib3/_collections.py) invalidates the object?\n", "Then we'd just leak connections up to the size of the LRU cache (10 by default?).\n\nMy vote would be to enable `prefetch=True`, keep `keep_alive=True`, and add a module-level connection pool for reusing connections. I don't think this would break a future implementation of ETAG caching; we could just check the ETAG before prefetching and hang up the phone if the data is cached.\n", "Is an O(1) leak really a leak? ;)\n\nI'm -0 on `prefetch=True` just because I feel the current settings cover the +80% use case, but I wouldn't shed any tears. Up to @kennethreitz, I'd say.\n", "In the real world, everything is a constant factor ;-)\n", "Module-level connection pool doesn't sound like a good idea to me. Setting `prefetch=True` just because that's easier :) doesn't sound good, either. Just saying.\n", "@piotr-dobrogost if we don't prefetch, I don't see a good solution that works on all platforms, including those like PyPy that lack eager garbage collection.\n\nFor comparison, here's something that always infuriated me about urllib2:\n\n``` python\ntry:\n fileobj = urllib2.urlopen(MY_URL)\n text = fileobj.read()\nfinally:\n fileobj.close()\n```\n\nSeems like the 80%, batteries-included thing is to have an API that reads the whole page in a fire-and-forget way.\n", "A module-level connection pool? Absolutely not. That's what `session` is for.\n", "That makes sense, as long as we turn off `keep_alive` by default. I think:\n1. Default `prefetch=True`\n2. Default `keep_alive=False` (unless we're in an actual `Session`)\n3. Ensure the connections are being closed\n\nThis will resolve the connection leak. Optionally, we could also break the reference cycle, as a memory-usage optimization for CPython.\n", "All requests are made within a session.\n", "Right. For \"actual Session\", read \"non-ephemeral Session\", i.e., \"Session created by the client with the expectation of reuse.\"\n", "But I guess this doesn't answer all the questions about expected behavior of `Session` objects. I think something like this:\n1. A non-ephemeral `Session` should send `Connection: keep-alive` by default, and retain connections in a pool\n2. On CPython, the `Session` object should not be involved in any reference cycles, and those connections should be disposed of when the object goes out of scope\n3. For PyPy etc., there should be a `Session.dispose()` and/or a context manager that manually closes the connections\n", "It shouldn't matter if it's ephemeral or not. When the session dies (and the connections therein), so should the connection pool. \n\nThere should be no specific behavior for different platforms.\n", "Well, we wouldn't special-case behavior inside Requests itself based on platforms. CPython would do the right thing whether or not the client called `dispose()` (which is what CPython users probably expect --- instantaneous scope-based GC). PyPy users would have to ensure that they called `dispose()`.\n\nAs for why it would matter whether the session is ephemeral or not, @craigholm makes a good point on #458: a client that does not support persistent connections \"must\" send `Connection: close`. If we're creating the session just to destroy it, that's essentially not supporting persistent connections. (Technically, you can get the session as `resp.request.session` and reuse it, but if we get rid of the reference cycle, that would also go away.)\n", "`Session` objects actually already have a context manager API, it just doesn't do anything. Let's put it to work :)\n", "@slingamn keep-alive should be on, we're using it for 301s and the like.\n" ]
https://api.github.com/repos/psf/requests/issues/519
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/519/labels{/name}
https://api.github.com/repos/psf/requests/issues/519/comments
https://api.github.com/repos/psf/requests/issues/519/events
https://github.com/psf/requests/pull/519
3,846,754
MDExOlB1bGxSZXF1ZXN0MTA2MDkxNA==
519
little correction of curl in docs
{ "avatar_url": "https://avatars.githubusercontent.com/u/10137?v=4", "events_url": "https://api.github.com/users/ghost/events{/privacy}", "followers_url": "https://api.github.com/users/ghost/followers", "following_url": "https://api.github.com/users/ghost/following{/other_user}", "gists_url": "https://api.github.com/users/ghost/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/ghost", "id": 10137, "login": "ghost", "node_id": "MDQ6VXNlcjEwMTM3", "organizations_url": "https://api.github.com/users/ghost/orgs", "received_events_url": "https://api.github.com/users/ghost/received_events", "repos_url": "https://api.github.com/users/ghost/repos", "site_admin": false, "starred_url": "https://api.github.com/users/ghost/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/ghost/subscriptions", "type": "User", "url": "https://api.github.com/users/ghost", "user_view_type": "public" }
[]
closed
false
null
[]
null
1
2012-03-28T08:48:30Z
2014-06-18T09:18:42Z
2012-03-31T02:58:38Z
NONE
null
{ "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/519/reactions" }
https://api.github.com/repos/psf/requests/issues/519/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/519.diff", "html_url": "https://github.com/psf/requests/pull/519", "merged_at": "2012-03-31T02:58:38Z", "patch_url": "https://github.com/psf/requests/pull/519.patch", "url": "https://api.github.com/repos/psf/requests/pulls/519" }
true
[ "awesome, thanks!\n" ]
https://api.github.com/repos/psf/requests/issues/518
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/518/labels{/name}
https://api.github.com/repos/psf/requests/issues/518/comments
https://api.github.com/repos/psf/requests/issues/518/events
https://github.com/psf/requests/pull/518
3,834,472
MDExOlB1bGxSZXF1ZXN0MTA1NzM5Ng==
518
Updates Tests to use new Exceptions
{ "avatar_url": "https://avatars.githubusercontent.com/u/155016?v=4", "events_url": "https://api.github.com/users/silent1mezzo/events{/privacy}", "followers_url": "https://api.github.com/users/silent1mezzo/followers", "following_url": "https://api.github.com/users/silent1mezzo/following{/other_user}", "gists_url": "https://api.github.com/users/silent1mezzo/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/silent1mezzo", "id": 155016, "login": "silent1mezzo", "node_id": "MDQ6VXNlcjE1NTAxNg==", "organizations_url": "https://api.github.com/users/silent1mezzo/orgs", "received_events_url": "https://api.github.com/users/silent1mezzo/received_events", "repos_url": "https://api.github.com/users/silent1mezzo/repos", "site_admin": false, "starred_url": "https://api.github.com/users/silent1mezzo/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/silent1mezzo/subscriptions", "type": "User", "url": "https://api.github.com/users/silent1mezzo", "user_view_type": "public" }
[]
closed
true
null
[]
null
4
2012-03-27T19:18:31Z
2021-09-08T14:01:10Z
2012-04-02T18:24:58Z
CONTRIBUTOR
resolved
Tests now use MissingSchema and InvalidSchema added in b973d08b0e46d25c4e5b9b7e8e5e6a4ca440594a.
{ "avatar_url": "https://avatars.githubusercontent.com/u/155016?v=4", "events_url": "https://api.github.com/users/silent1mezzo/events{/privacy}", "followers_url": "https://api.github.com/users/silent1mezzo/followers", "following_url": "https://api.github.com/users/silent1mezzo/following{/other_user}", "gists_url": "https://api.github.com/users/silent1mezzo/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/silent1mezzo", "id": 155016, "login": "silent1mezzo", "node_id": "MDQ6VXNlcjE1NTAxNg==", "organizations_url": "https://api.github.com/users/silent1mezzo/orgs", "received_events_url": "https://api.github.com/users/silent1mezzo/received_events", "repos_url": "https://api.github.com/users/silent1mezzo/repos", "site_admin": false, "starred_url": "https://api.github.com/users/silent1mezzo/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/silent1mezzo/subscriptions", "type": "User", "url": "https://api.github.com/users/silent1mezzo", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/518/reactions" }
https://api.github.com/repos/psf/requests/issues/518/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/518.diff", "html_url": "https://github.com/psf/requests/pull/518", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/518.patch", "url": "https://api.github.com/repos/psf/requests/pulls/518" }
true
[ "This is great, but it looks like it was done off a really old copy of the codebase. Can chance you could update this with the latest version of `develop`?\n", "Hrm, must have gone off master instead of develop. I'll update it.\n", "Thanks a ton.\n", "Going to start over, I merged my master with your develop.\n" ]
https://api.github.com/repos/psf/requests/issues/517
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/517/labels{/name}
https://api.github.com/repos/psf/requests/issues/517/comments
https://api.github.com/repos/psf/requests/issues/517/events
https://github.com/psf/requests/issues/517
3,828,678
MDU6SXNzdWUzODI4Njc4
517
Response.content raises timeout in safe_mode
{ "avatar_url": "https://avatars.githubusercontent.com/u/292606?v=4", "events_url": "https://api.github.com/users/spulec/events{/privacy}", "followers_url": "https://api.github.com/users/spulec/followers", "following_url": "https://api.github.com/users/spulec/following{/other_user}", "gists_url": "https://api.github.com/users/spulec/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/spulec", "id": 292606, "login": "spulec", "node_id": "MDQ6VXNlcjI5MjYwNg==", "organizations_url": "https://api.github.com/users/spulec/orgs", "received_events_url": "https://api.github.com/users/spulec/received_events", "repos_url": "https://api.github.com/users/spulec/repos", "site_admin": false, "starred_url": "https://api.github.com/users/spulec/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/spulec/subscriptions", "type": "User", "url": "https://api.github.com/users/spulec", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2012-03-27T14:35:11Z
2021-09-09T08:00:34Z
2012-06-15T18:39:58Z
CONTRIBUTOR
resolved
This seems to happen very infrequently and I'm not able to recreate it, but I figured that I'd throw the traceback up here and see if someone can figure it out. ``` python response = requests.get(url, timeout=10, config={'safe_mode': True}) if response.ok: content = response.content ``` File "/requests/models.py", line 757, in content self._content = None File "/requests/models.py", line 668, in generate chunk = self.raw.read(chunk_size) File "/requests/packages/urllib3/response.py", line 168, in read self.release_conn() File "/python2.7/httplib.py", line 561, in read s = self.fp.read(amt) File "/python2.7/socket.py", line 384, in read raise
{ "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/517/reactions" }
https://api.github.com/repos/psf/requests/issues/517/timeline
null
completed
null
null
false
[ "This should be better now.\n", "Great, thanks.\n" ]
https://api.github.com/repos/psf/requests/issues/516
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/516/labels{/name}
https://api.github.com/repos/psf/requests/issues/516/comments
https://api.github.com/repos/psf/requests/issues/516/events
https://github.com/psf/requests/pull/516
3,827,654
MDExOlB1bGxSZXF1ZXN0MTA1NDc1MA==
516
Move pre_request to a more usable place, followup to #382
{ "avatar_url": "https://avatars.githubusercontent.com/u/139033?v=4", "events_url": "https://api.github.com/users/EnTeQuAk/events{/privacy}", "followers_url": "https://api.github.com/users/EnTeQuAk/followers", "following_url": "https://api.github.com/users/EnTeQuAk/following{/other_user}", "gists_url": "https://api.github.com/users/EnTeQuAk/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/EnTeQuAk", "id": 139033, "login": "EnTeQuAk", "node_id": "MDQ6VXNlcjEzOTAzMw==", "organizations_url": "https://api.github.com/users/EnTeQuAk/orgs", "received_events_url": "https://api.github.com/users/EnTeQuAk/received_events", "repos_url": "https://api.github.com/users/EnTeQuAk/repos", "site_admin": false, "starred_url": "https://api.github.com/users/EnTeQuAk/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/EnTeQuAk/subscriptions", "type": "User", "url": "https://api.github.com/users/EnTeQuAk", "user_view_type": "public" }
[]
closed
true
null
[]
null
7
2012-03-27T13:44:06Z
2021-09-08T14:01:10Z
2012-05-02T22:58:08Z
CONTRIBUTOR
resolved
Having the hook called so late makes it impossible to overwrite the HTTP request calling behavior and set self.sent to True in case of possible cache matches for example. This way we can interfere before we waste any CPU time to calculate a request. As a side note I am not sure if this whole process should be splitted into two parts: pre_prepare_request and pre_request so that one hook really can interfere before we calculate anything and the other can use the certificate and gathered authentication information to make it's decisions... not sure
{ "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/516/reactions" }
https://api.github.com/repos/psf/requests/issues/516/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/516.diff", "html_url": "https://github.com/psf/requests/pull/516", "merged_at": "2012-05-02T22:58:08Z", "patch_url": "https://github.com/psf/requests/pull/516.patch", "url": "https://api.github.com/repos/psf/requests/pulls/516" }
true
[ "Hmm, interesting. Maybe a whole new hook should be added instead.\n", "Yea, as I said, but I am pretty unsure about where would be the best place, suggestions welcome, I can adapt the patch.\n\nThe question is how many hooks are user friendly in the end and if it makes even sense to create a whole bunch of new hooks like for:\n- prepare\n- pre_request\n- post_request\n", "I've encountered the same problem with `pre_request` at beginning of writing [requests-cache](https://github.com/reclosedev/requests-cache) (solved with monkey-patching `send`). \n\nI'm agree that new hook like `pre_send` can be better. Another option, is to check for `if not self.sent` right after `dispatch_hook`.\n", "+1 for `pre_send`\n", "This pull request [passes](http://travis-ci.org/kennethreitz/requests/builds/1217420) (merged f2590187 into 2159c802).\n", "This pull request [passes](http://travis-ci.org/kennethreitz/requests/builds/1231720) (merged f2590187 into 2159c802).\n", "Merged, thanks guys!\n" ]
https://api.github.com/repos/psf/requests/issues/515
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/515/labels{/name}
https://api.github.com/repos/psf/requests/issues/515/comments
https://api.github.com/repos/psf/requests/issues/515/events
https://github.com/psf/requests/issues/515
3,823,558
MDU6SXNzdWUzODIzNTU4
515
Suggestion to change iter_lines() logic
{ "avatar_url": "https://avatars.githubusercontent.com/u/311929?v=4", "events_url": "https://api.github.com/users/kracekumar/events{/privacy}", "followers_url": "https://api.github.com/users/kracekumar/followers", "following_url": "https://api.github.com/users/kracekumar/following{/other_user}", "gists_url": "https://api.github.com/users/kracekumar/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kracekumar", "id": 311929, "login": "kracekumar", "node_id": "MDQ6VXNlcjMxMTkyOQ==", "organizations_url": "https://api.github.com/users/kracekumar/orgs", "received_events_url": "https://api.github.com/users/kracekumar/received_events", "repos_url": "https://api.github.com/users/kracekumar/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kracekumar/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kracekumar/subscriptions", "type": "User", "url": "https://api.github.com/users/kracekumar", "user_view_type": "public" }
[]
closed
true
null
[]
null
10
2012-03-27T09:08:35Z
2021-09-09T08:00:46Z
2012-05-08T05:15:10Z
CONTRIBUTOR
resolved
`def iter_lines(self, chunk_size=10 * 1024, decode_unicode=None):` `iter_lines()` uses chunk_size, rather than that it would be better if `\r\n` is used, `iter_lines()` is used when connection is open for long timing, I recently tried the example(twitter streaming api), code - http://kracekumar.com/post/19556427690/n00bs-epic-research-on-twitters-streaming-api-on snippet found exception like `String Index Out of Range`.
{ "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/515/reactions" }
https://api.github.com/repos/psf/requests/issues/515/timeline
null
completed
null
null
false
[ "Here is the example error, \nIndexError: string index out of range\n[2012-03-29 15:12] ERROR: Generic: Uncaught exception occurred\nTraceback (most recent call last):\n File \"collector.py\", line 63, in <module>\n store_live_tweets()\n File \"collector.py\", line 54, in store_live_tweets\n for line in r.iter_lines():\n File \"/home/kracekumar/lib/python2.7/requests/models.py\", line 729, in iter_lines\n if lines[-1][-1] == chunk[-1]:\nIndexError: string index out of range\n", "I changed chunk_size to 2*1024, seems to work. If actual size is less than chunk_size wondering what will happen?(last message sent)\n", "This shouldn't happen anymore.\n", "So what is the take away, user should specify according to the content, or requests will figure out ?\n", "Today again I faced the same issue. \n", "Same thing here (Twitter streaming API). Please reopen.\n\n```\nTraceback (most recent call last):\n File \"twtrack.py\", line 26, in <module>\n for line in r.iter_lines():\n File \"/usr/lib/python2.7/site-packages/requests/models.py\", line 729, in iter_lines\n if lines[-1][-1] == chunk[-1]:\nIndexError: string index out of range\n```\n", "I'm sorry, I installed requests without using pip's `-U` switch and didn't realize that an older version of requests was already installed... After the update it seems to work :)\n", "FYI, I use version `0.10.8` stil same error. \n", "Sorry for all that buzz. A friend of mine uses requests v0.11.1 and the original bug (string index out of range) appeared again.\n", "I have tracked down the iter_lines IndexError to this: If the chunk is `''` (empty string), `chunk[-1]` will fail. If the chunk ends with `'\\n\\n'`, `lines[-1][-1]` will fail, as `lines[-1] = ''`.\n\nSo to check `lines[-1][-1] == chunk[-1]`, you must make sure that `lines and lines[-1] and chunk`.\n" ]
https://api.github.com/repos/psf/requests/issues/514
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/514/labels{/name}
https://api.github.com/repos/psf/requests/issues/514/comments
https://api.github.com/repos/psf/requests/issues/514/events
https://github.com/psf/requests/issues/514
3,820,143
MDU6SXNzdWUzODIwMTQz
514
latest source doesn't supports Python 2.5.4 on OS X
{ "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
3
2012-03-27T01:36:30Z
2021-09-09T09:00:41Z
2012-03-27T12:16:26Z
NONE
resolved
``` $ sudo python2.5 setup.py develop Traceback (most recent call last): File "setup.py", line 6, in <module> import requests File "/Users/lee/Downloads/py-pkgs/requests/requests/__init__.py", line 25, in <module> from . import utils File "/Users/lee/Downloads/py-pkgs/requests/requests/utils.py", line 232 return b"".join(L) ^ SyntaxError: invalid syntax $ python2.5 --version Python 2.5.4 ```
{ "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/514/reactions" }
https://api.github.com/repos/psf/requests/issues/514/timeline
null
completed
null
null
false
[ "Python 2.5 support was intentionally dropped.\n", "It's not a good idea, lots of modules still support Python 2.5。\n\nOn Mac OS X 10.6, I have to use Python 2.5(because of it works with Tkinter, but Py2.6 or Py2.7 doesn't), \nrequests is a great project if it could supports Python 2.5 and help us get out of the hell of httplib/urllib/urllib2.\n", "I can assure you, it's a great idea :)\n\n---\n\nYou're always welcome to use an older release.\n" ]
https://api.github.com/repos/psf/requests/issues/513
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/513/labels{/name}
https://api.github.com/repos/psf/requests/issues/513/comments
https://api.github.com/repos/psf/requests/issues/513/events
https://github.com/psf/requests/issues/513
3,807,856
MDU6SXNzdWUzODA3ODU2
513
ImportError: No module named certifi
{ "avatar_url": "https://avatars.githubusercontent.com/u/1576055?v=4", "events_url": "https://api.github.com/users/morogoro/events{/privacy}", "followers_url": "https://api.github.com/users/morogoro/followers", "following_url": "https://api.github.com/users/morogoro/following{/other_user}", "gists_url": "https://api.github.com/users/morogoro/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/morogoro", "id": 1576055, "login": "morogoro", "node_id": "MDQ6VXNlcjE1NzYwNTU=", "organizations_url": "https://api.github.com/users/morogoro/orgs", "received_events_url": "https://api.github.com/users/morogoro/received_events", "repos_url": "https://api.github.com/users/morogoro/repos", "site_admin": false, "starred_url": "https://api.github.com/users/morogoro/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/morogoro/subscriptions", "type": "User", "url": "https://api.github.com/users/morogoro", "user_view_type": "public" }
[]
closed
true
null
[]
null
21
2012-03-26T12:43:04Z
2021-09-09T09:00:34Z
2012-05-03T06:12:17Z
NONE
resolved
Hi I have install a Requests module in my python v 2.7.2 as you instructed but I tried to create a simple script using Requests module i got the above error. The script look like this with error > > > import requests > > > > > > r = requests.get('https://facebook.com',auth=('email', 'password')) Traceback (most recent call last): File "<stdin>", line 1, in <module> File "C:\Python27\lib\site-packages\requests\api.py", line 51, in get return request('get', url, *_kwargs) File "C:\Python27\lib\site-packages\requests\api.py", line 39, in request return s.request(method=method, url=url, *_kwargs) File "C:\Python27\lib\site-packages\requests\sessions.py", line 203, in reques t r.send(prefetch=prefetch) File "C:\Python27\lib\site-packages\requests\models.py", line 502, in send cert_loc = **import**('certifi').where() ImportError: No module named certifi
{ "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/513/reactions" }
https://api.github.com/repos/psf/requests/issues/513/timeline
null
completed
null
null
false
[ "Did you install using easy_install or pip? It looks like you don't have the dependencies installed.\n", "I just download zipball from GitHub website, then I unzipped and install it by run a setup.py install in DOS command.\n\nI am new in python I don't understand what is dependencies, and I choose the above option of installing because it look easy but the one from pip i didn't understand..\n\nFor example the said: Download get-pip.py and execute it, using the Python interpreter of your choice.... I don't get it\nthen this command are you running on DOS or on which interface\n\"$ curl https://raw.github.com/pypa/pip/master/contrib/get-pip.py | python\"\n", "The above command in a shell command being executed in a Linux environment.\n\nFollow these instructions to install pip on Windows: http://docs.python-guide.org/en/latest/starting/install/win/#distribute-pip\n\nTo summarize:\n1. Download and run http://python-distribute.org/distribute_setup.py (`python distribute_setup.py`).\n2. Install pip with the command `easy_install pip`.\n\nDependencies are other pieces of software/libraries that something requires in order to function. If you install python modules using pip, the required dependencies will be downloaded and installed automatically.\n", "I still received an error from DOS command said \" 'easy_install' is not recognized as an internal or external command,\noperable program or batch file.\"\n\nI managed to download distribute_setup.py, then I copy that file in the desktop. After that I went to DOS command i type this way\nC:\\Users\\linda\\Desktop\\python>easy_install pip\n'easy_install' is not recognized as an internal or external command,\noperable program or batch file.\n\nThe I tried another I got the same error\n\nC:>easy_install pip\n'easy_install' is not recognized as an internal or external command,\noperable program or batch file.\n", "> I managed to download distribute_setup.py, then I copy that file in the desktop.\n\nHave you run the script? (`python distribute_setup.py`).\n\nAlso, make sure `easy_install.exe` is on your `PATH`: http://packages.python.org/distribute/easy_install.html#windows-notes\n", "Sorry before I try anything I don't have that file easy_install.exe. I just download only python distribute_setup.py file, where can I get that file.\n", "That's what running `distribute_setup.py` does, it installs it for you. The executable should then be in `C:\\\\Python2X\\\\Scripts` which should be in your PATH.\n", "I managed to do as you said i got this results\n\nC:\\Python27\\Scripts>easy_install pip\nSearching for pip\nBest match: pip 1.1\nProcessing pip-1.1-py2.7.egg\npip 1.1 is already the active version in easy-install.pth\nInstalling pip-script.py script to C:\\Python27\\Scripts\nInstalling pip.exe script to C:\\Python27\\Scripts\nInstalling pip-2.7-script.py script to C:\\Python27\\Scripts\nInstalling pip-2.7.exe script to C:\\Python27\\Scripts\n\nUsing c:\\python27\\lib\\site-packages\\pip-1.1-py2.7.egg\nProcessing dependencies for pip\nFinished processing dependencies for pip\n\nBut when I went back to run that code in python shell I got the same error which said\n\"ImportError: No module named certifi\"\n\nSo I don't know what is problem now\n", "Now that you have installed pip, you need to use it to install requests. `pip install requests`.\n", "I have already install requests before that why when I run your command I got the following results\n\nC:\\Python27\\Scripts>pip install requests\nRequirement already satisfied (use --upgrade to upgrade): requests in c:\\python2\n7\\lib\\site-packages\nCleaning up...\n", "@morogoro plese do what it says(use --upgrade) since you may have requests module in the right place without the dependencies which may confuse pip.\n", "BKY can help me with the command that I should type in DOS for upgrade \n", "@morogoro It should be\nC:\\Python27\\Scripts>pip install --upgrade requests\n", "I got this \nC:\\Python27\\Scripts>pip install --upgrade requests\nRequirement already up-to-date: requests in c:\\python27\\lib\\site-packages\nCleaning up...\n", "@morogoro Then can you please try to _delete_ everything seems like \"requests\" in your site-packages folder and try again?\n", "its working now thanks a lot @BYK @johtso \n", "Hey @morogoro, I seem to be having the exact same problem you were having. I've tried deleting everything and re-installing but have had no luck. \nMay I ask what exactly you did to get it working? \nThanks. \n", "@rbui have you tried doing `pip uninstall requests` maybe?\n", "@johtso That was exactly what I was looking for, thanks for the quick reply!\n", "+1 to having this problem.\n\nI did a clean virtualenv and ran `pip install requests`. I can see it downloading and installing certifi but it seems like their setup is broken since I still get the error ImportError: No module named certifi \n\n**EDIT**: Totally removing both requests and certifi and then re-installing worked.\n", "Hey @rbui sorry for not reply quickly, I was not around..........\n" ]
https://api.github.com/repos/psf/requests/issues/512
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/512/labels{/name}
https://api.github.com/repos/psf/requests/issues/512/comments
https://api.github.com/repos/psf/requests/issues/512/events
https://github.com/psf/requests/pull/512
3,798,734
MDExOlB1bGxSZXF1ZXN0MTA0MzQzOQ==
512
Adds MissingSchema and InvalidSchema Exceptions
{ "avatar_url": "https://avatars.githubusercontent.com/u/155016?v=4", "events_url": "https://api.github.com/users/silent1mezzo/events{/privacy}", "followers_url": "https://api.github.com/users/silent1mezzo/followers", "following_url": "https://api.github.com/users/silent1mezzo/following{/other_user}", "gists_url": "https://api.github.com/users/silent1mezzo/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/silent1mezzo", "id": 155016, "login": "silent1mezzo", "node_id": "MDQ6VXNlcjE1NTAxNg==", "organizations_url": "https://api.github.com/users/silent1mezzo/orgs", "received_events_url": "https://api.github.com/users/silent1mezzo/received_events", "repos_url": "https://api.github.com/users/silent1mezzo/repos", "site_admin": false, "starred_url": "https://api.github.com/users/silent1mezzo/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/silent1mezzo/subscriptions", "type": "User", "url": "https://api.github.com/users/silent1mezzo", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2012-03-25T15:04:58Z
2021-09-08T23:05:21Z
2012-03-25T19:00:57Z
CONTRIBUTOR
resolved
Here's a potential fix for #510. Adds MissingSchema and InvalidSchema which inherit both RequestException and ValueError.
{ "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/512/reactions" }
https://api.github.com/repos/psf/requests/issues/512/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/512.diff", "html_url": "https://github.com/psf/requests/pull/512", "merged_at": "2012-03-25T19:00:57Z", "patch_url": "https://github.com/psf/requests/pull/512.patch", "url": "https://api.github.com/repos/psf/requests/pulls/512" }
true
[ "Perfect. Thanks!\n" ]
https://api.github.com/repos/psf/requests/issues/511
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/511/labels{/name}
https://api.github.com/repos/psf/requests/issues/511/comments
https://api.github.com/repos/psf/requests/issues/511/events
https://github.com/psf/requests/pull/511
3,790,830
MDExOlB1bGxSZXF1ZXN0MTA0MTE3NA==
511
Added url to LocationParseError message
{ "avatar_url": "https://avatars.githubusercontent.com/u/864821?v=4", "events_url": "https://api.github.com/users/kvonhorn/events{/privacy}", "followers_url": "https://api.github.com/users/kvonhorn/followers", "following_url": "https://api.github.com/users/kvonhorn/following{/other_user}", "gists_url": "https://api.github.com/users/kvonhorn/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kvonhorn", "id": 864821, "login": "kvonhorn", "node_id": "MDQ6VXNlcjg2NDgyMQ==", "organizations_url": "https://api.github.com/users/kvonhorn/orgs", "received_events_url": "https://api.github.com/users/kvonhorn/received_events", "repos_url": "https://api.github.com/users/kvonhorn/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kvonhorn/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kvonhorn/subscriptions", "type": "User", "url": "https://api.github.com/users/kvonhorn", "user_view_type": "public" }
[]
closed
true
null
[]
null
4
2012-03-24T07:01:24Z
2021-09-08T14:01:09Z
2012-03-24T18:07:00Z
NONE
resolved
requests/packages/urllib3/connectionpool.py - Added the url that couldn't be parsed to LocationParseError message.
{ "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/511/reactions" }
https://api.github.com/repos/psf/requests/issues/511/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/511.diff", "html_url": "https://github.com/psf/requests/pull/511", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/511.patch", "url": "https://api.github.com/repos/psf/requests/pulls/511" }
true
[ "Sorry, I didn't realize the 2 commits were going to get tracked into the same pull request.\n\nThe first commit simply interpolates the URL into error message passed into the exception.\n\nThe other commit copies form data into the request that gets made after a redirect. I couldn't create a unit test for this, but I have solved a problem I'm having at work POSTing data on the intranet after receiving a 301.\n", "Hi @kvonhorn, thanks for noticing that bug in urllib3. Could you make this change to urllib3 and pull request there?\n", "Closing for urllib3.\n", "Is there any chance of getting commit 8c5d06148bfa94ba87f369202b909d8c79897568 pulled, @kennethreitz?\n" ]
https://api.github.com/repos/psf/requests/issues/510
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/510/labels{/name}
https://api.github.com/repos/psf/requests/issues/510/comments
https://api.github.com/repos/psf/requests/issues/510/events
https://github.com/psf/requests/issues/510
3,782,827
MDU6SXNzdWUzNzgyODI3
510
Thrown exceptions do not derive from RequestException
{ "avatar_url": "https://avatars.githubusercontent.com/u/100643?v=4", "events_url": "https://api.github.com/users/gora/events{/privacy}", "followers_url": "https://api.github.com/users/gora/followers", "following_url": "https://api.github.com/users/gora/following{/other_user}", "gists_url": "https://api.github.com/users/gora/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/gora", "id": 100643, "login": "gora", "node_id": "MDQ6VXNlcjEwMDY0Mw==", "organizations_url": "https://api.github.com/users/gora/orgs", "received_events_url": "https://api.github.com/users/gora/received_events", "repos_url": "https://api.github.com/users/gora/repos", "site_admin": false, "starred_url": "https://api.github.com/users/gora/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/gora/subscriptions", "type": "User", "url": "https://api.github.com/users/gora", "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
1
2012-03-23T16:36:15Z
2021-09-09T09:00:41Z
2012-03-26T13:56:53Z
NONE
resolved
I am at the latest version of requests, 0.10.8, and it advertises itself as all exceptions being derived from RequestException. This is not true, as at least requests/models.py throws ValueError in several places. The code, or the documentation, should be fixed. Thanks, and thanks for a great 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/510/reactions" }
https://api.github.com/repos/psf/requests/issues/510/timeline
null
completed
null
null
false
[ "Hmm, we should use multiple inheritance I suppose. \n\nThanks for the catch!\n" ]
https://api.github.com/repos/psf/requests/issues/509
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/509/labels{/name}
https://api.github.com/repos/psf/requests/issues/509/comments
https://api.github.com/repos/psf/requests/issues/509/events
https://github.com/psf/requests/issues/509
3,776,769
MDU6SXNzdWUzNzc2NzY5
509
Closing a connection
{ "avatar_url": "https://avatars.githubusercontent.com/u/797922?v=4", "events_url": "https://api.github.com/users/ruxandraburtica/events{/privacy}", "followers_url": "https://api.github.com/users/ruxandraburtica/followers", "following_url": "https://api.github.com/users/ruxandraburtica/following{/other_user}", "gists_url": "https://api.github.com/users/ruxandraburtica/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/ruxandraburtica", "id": 797922, "login": "ruxandraburtica", "node_id": "MDQ6VXNlcjc5NzkyMg==", "organizations_url": "https://api.github.com/users/ruxandraburtica/orgs", "received_events_url": "https://api.github.com/users/ruxandraburtica/received_events", "repos_url": "https://api.github.com/users/ruxandraburtica/repos", "site_admin": false, "starred_url": "https://api.github.com/users/ruxandraburtica/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/ruxandraburtica/subscriptions", "type": "User", "url": "https://api.github.com/users/ruxandraburtica", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2012-03-23T08:48:38Z
2021-09-09T08:00:35Z
2012-06-15T18:40:40Z
NONE
resolved
Hi, Currently, I see no method of closing an HTTP streaming connection that uses iter_content for getting data (not even setting self._content_consumed to True). When do you think something like this might be available (or is it, and I haven't found it?)
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/509/reactions" }
https://api.github.com/repos/psf/requests/issues/509/timeline
null
completed
null
null
false
[ "does the connection stay open if you, say, `del` the response?\n", "Yes, the socket remains open.\n" ]
https://api.github.com/repos/psf/requests/issues/508
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/508/labels{/name}
https://api.github.com/repos/psf/requests/issues/508/comments
https://api.github.com/repos/psf/requests/issues/508/events
https://github.com/psf/requests/pull/508
3,769,032
MDExOlB1bGxSZXF1ZXN0MTAzMTI5OQ==
508
Suggesting changing "async.map(rs)" to "responses = async.map(rs)" just ...
{ "avatar_url": "https://avatars.githubusercontent.com/u/863286?v=4", "events_url": "https://api.github.com/users/dalanmiller/events{/privacy}", "followers_url": "https://api.github.com/users/dalanmiller/followers", "following_url": "https://api.github.com/users/dalanmiller/following{/other_user}", "gists_url": "https://api.github.com/users/dalanmiller/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/dalanmiller", "id": 863286, "login": "dalanmiller", "node_id": "MDQ6VXNlcjg2MzI4Ng==", "organizations_url": "https://api.github.com/users/dalanmiller/orgs", "received_events_url": "https://api.github.com/users/dalanmiller/received_events", "repos_url": "https://api.github.com/users/dalanmiller/repos", "site_admin": false, "starred_url": "https://api.github.com/users/dalanmiller/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/dalanmiller/subscriptions", "type": "User", "url": "https://api.github.com/users/dalanmiller", "user_view_type": "public" }
[]
closed
true
null
[]
null
4
2012-03-22T18:57:39Z
2021-09-08T14:01:09Z
2012-03-22T19:00:54Z
CONTRIBUTOR
resolved
...to show that it returns a list rather than mutating the original? Maybe this is apparent for most, but I was a bit confused =/ http://goo.gl/gE4up
{ "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/508/reactions" }
https://api.github.com/repos/psf/requests/issues/508/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/508.diff", "html_url": "https://github.com/psf/requests/pull/508", "merged_at": "2012-03-22T19:00:54Z", "patch_url": "https://github.com/psf/requests/pull/508.patch", "url": "https://api.github.com/repos/psf/requests/pulls/508" }
true
[ "I like it, but that isn't how the interactive interpreter actually works. \n", "My apologies, technically you would want to\n\n```\n>>> responses = async.map(rs)\n```\n\nthen \n\n```\n>>> print responses \n[<Response [200]>, <Response [200]>, <Response [200]>, <Response [200]>]\n```\n\nto show the list of request objects as you do in the original documentation.\n", "all better :) \n\nthanks!\n", "(Seems I was trying to reply to the OP and somehow only saw his pull and not this thread. Ignore the above post. Need a bit more practice with the GitHub interface...)\n" ]
https://api.github.com/repos/psf/requests/issues/507
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/507/labels{/name}
https://api.github.com/repos/psf/requests/issues/507/comments
https://api.github.com/repos/psf/requests/issues/507/events
https://github.com/psf/requests/issues/507
3,768,253
MDU6SXNzdWUzNzY4MjUz
507
Allow overriding/disabling an entire default kwarg (as well as individual keys)
{ "avatar_url": "https://avatars.githubusercontent.com/u/830800?v=4", "events_url": "https://api.github.com/users/johtso/events{/privacy}", "followers_url": "https://api.github.com/users/johtso/followers", "following_url": "https://api.github.com/users/johtso/following{/other_user}", "gists_url": "https://api.github.com/users/johtso/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/johtso", "id": 830800, "login": "johtso", "node_id": "MDQ6VXNlcjgzMDgwMA==", "organizations_url": "https://api.github.com/users/johtso/orgs", "received_events_url": "https://api.github.com/users/johtso/received_events", "repos_url": "https://api.github.com/users/johtso/repos", "site_admin": false, "starred_url": "https://api.github.com/users/johtso/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/johtso/subscriptions", "type": "User", "url": "https://api.github.com/users/johtso", "user_view_type": "public" }
[]
closed
true
null
[]
null
10
2012-03-22T18:13:01Z
2021-09-09T06:00:57Z
2012-07-27T05:58:13Z
CONTRIBUTOR
resolved
It would be good if it was possible to completely disable/override a default kwarg, in addition to the current ability to disable individual keys by setting them to `None`. Maybe this could be done by passing the function an empty object for the kwarg as supposed to `None`.
{ "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/507/reactions" }
https://api.github.com/repos/psf/requests/issues/507/timeline
null
completed
null
null
false
[ "`kwarg = False` makes sense to me.\n", "Another possibility, for which I can't really think of an elegant solution, would be the ability to replace a default kwarg with another set of key/values, as supposed to explicitly specifying that each key that is present in the default should be disabled.\n\nSo basically the ability above, plus specifying a new set of key/vals for the request.\n", "@johtso \nAs I don't get the above description, could you please write a short example showing what you have in mind ?\n", "@piotr-dobrogost\nSo, currently \"Any dictionaries that you pass to a request method will be merged with the session-level values that are set\". If you wanted to send a request with none of the default params defined for the session, you would have to do something like this:\n\nSetup:\n\n``` python\ndefault_params = dict(a=1, b=2, c=3, d=4)\ns = requests.session(params=default_params)\n```\n\nThe request:\n\n``` python\nr = s.get(url, params=dict(a=None, b=None, c=None, d=None))\n```\n\nA possible solution would be to allow something like this:\n\n``` python\nr = s.get(url, params=False)\n```\n\nI was then contemplating the possibility of someone wanting to send a request with none of the default values for a parameter, and also with some new values, which would currently be achieved like so:\n\n``` python\nr = s.get(url, params=dict(a=None, b=None, c=None, d=None, foo='bar'))\n```\n\nThis might not be a use case worth worrying about, it certainly makes things trickier as the nice concise `=False` solution wouldn't do the job. Just throwing it out there.\n", "Thanks for writing examples. I think it would be nice to support different kinds of merging request specific `params` dict with the session's `params` dict. Suppressing session values with `false` is tempting but feels like too big a shortcut. Clear and extensible solution would be to introduce additional argument to `reqest()` specifying how merging should be done. Something like `params_combine_mode='update'|'overwrite'|'supplement'` with the default being `update` I guess.\n", "Hmm, I do like the extensibility of that solution, but it would mean having a \"combine_mode\" option for each of [the parameters that get merged](https://github.com/kennethreitz/requests/blob/develop/requests/sessions.py#L53).. that seems really verbose.\n\nMaybe there could be a single parameter `merge_modes` that takes a list of `attrs` and `mode` pairs.\n\nOr, how about making `Request()` take either just a dict that gets merged, or a tuple of `(dict, merge_mode)`. That could be pretty nice and concise.\n", "> Maybe there could be a single parameter `merge_modes` that takes a list of `attrs` and `mode` pairs.\n\nWhen order doesn't matter I always prefer dict to list. With this reservation the idea is ok.\n\nThe second idea with tuples of `(dict, merge_mode)` is even better.\n", "Oops, right, of course a dict would be the way to go :)\n\nI'm trying to think of what an example might look like if you just wanted to, say, not send any parameters when default params have been defined for the session. I suppose something like:\n\n``` python\nsession.get(url, params=({}, 'overwrite'))\n```\n\nI suppose that's not too bad..\n", "@kennethreitz \n\nHow do you like this?\n", "@kennethreitz \n\nWhy did you close this?\n" ]
https://api.github.com/repos/psf/requests/issues/506
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/506/labels{/name}
https://api.github.com/repos/psf/requests/issues/506/comments
https://api.github.com/repos/psf/requests/issues/506/events
https://github.com/psf/requests/issues/506
3,768,156
MDU6SXNzdWUzNzY4MTU2
506
[docs] Confusing sidebar title "Support requests"
{ "avatar_url": "https://avatars.githubusercontent.com/u/483109?v=4", "events_url": "https://api.github.com/users/hannosch/events{/privacy}", "followers_url": "https://api.github.com/users/hannosch/followers", "following_url": "https://api.github.com/users/hannosch/following{/other_user}", "gists_url": "https://api.github.com/users/hannosch/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/hannosch", "id": 483109, "login": "hannosch", "node_id": "MDQ6VXNlcjQ4MzEwOQ==", "organizations_url": "https://api.github.com/users/hannosch/orgs", "received_events_url": "https://api.github.com/users/hannosch/received_events", "repos_url": "https://api.github.com/users/hannosch/repos", "site_admin": false, "starred_url": "https://api.github.com/users/hannosch/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/hannosch/subscriptions", "type": "User", "url": "https://api.github.com/users/hannosch", "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
3
2012-03-22T18:08:09Z
2021-09-09T09:00:39Z
2012-04-02T07:44:01Z
NONE
resolved
Every time I read the sidebar in the docs, I stumble upon "Support Requests", automatically assuming I'll find info on issue trackers or other means to request support. While I get: "If you love Requests, consider making a small donation on Flattr: " But of course "requests" here is the name of the project and not the verb. Could you maybe change the title to "Donate"?
{ "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/506/reactions" }
https://api.github.com/repos/psf/requests/issues/506/timeline
null
completed
null
null
false
[ "Ah, nice observation. \"Donate\" sounds good :)\n", "Honestly, I might remove it soon. It doesn't really do anything :)\n", "Wow, it's up to ~$56.09 now. I guess I will keep it :)\n" ]
https://api.github.com/repos/psf/requests/issues/505
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/505/labels{/name}
https://api.github.com/repos/psf/requests/issues/505/comments
https://api.github.com/repos/psf/requests/issues/505/events
https://github.com/psf/requests/issues/505
3,757,337
MDU6SXNzdWUzNzU3MzM3
505
Allow disabling of cookie persistance/sending
{ "avatar_url": "https://avatars.githubusercontent.com/u/830800?v=4", "events_url": "https://api.github.com/users/johtso/events{/privacy}", "followers_url": "https://api.github.com/users/johtso/followers", "following_url": "https://api.github.com/users/johtso/following{/other_user}", "gists_url": "https://api.github.com/users/johtso/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/johtso", "id": 830800, "login": "johtso", "node_id": "MDQ6VXNlcjgzMDgwMA==", "organizations_url": "https://api.github.com/users/johtso/orgs", "received_events_url": "https://api.github.com/users/johtso/received_events", "repos_url": "https://api.github.com/users/johtso/repos", "site_admin": false, "starred_url": "https://api.github.com/users/johtso/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/johtso/subscriptions", "type": "User", "url": "https://api.github.com/users/johtso", "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
13
2012-03-22T03:10:59Z
2021-09-09T08:00:41Z
2012-05-30T00:02:17Z
CONTRIBUTOR
resolved
It should be possible to disable the cookie persistence functionality of a `Session`, possibly by passing the `config` parameter `False`. Assuming it is not already possible, it would also be good to be able to stop cookies from being sent when generating a request.
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/505/reactions" }
https://api.github.com/repos/psf/requests/issues/505/timeline
null
completed
null
null
false
[ "+1\n", "On second thoughts, using `cookie=False` to signify not wanting to store or send cookies would be ambiguous. That wouldn't allow for someone to have default cookies for their session, but not store cookies sent by servers.\n\nSo maybe a `store_cookies` option would be a better idea.\n", "@johtso are you working on this?\n", "@barberj I'm afraid I haven't had a chance to work on this, no.\n", "I'd like to work on this issue.\n\nWhich one of below are best for API design?\n\n``` python\nimport requests\n\ns = requests.session()\n\ns.get('http://httpbin.org/cookies/set/sessioncookie/123456789')\nr = s.get(\"http://httpbin.org/cookies\", store_cookies=False)\n```\n\n``` python\nimport requests\n\ns = requests.session()\n\ns.get('http://httpbin.org/cookies/set/sessioncookie/123456789')\nconfig = dict(store_cookies=False)\nr = s.get(\"http://httpbin.org/cookies\", config=config)\n```\n", "@berkerpeksag awesome! The second one (with `config`) is definitely best\n", "@kennethreitz thanks!\n", "Relevant: http://tools.ietf.org/html/rfc6265#section-7.2\nThey call it a **private browsing** mode\n", "My understanding is that:\n1. Private browsing means \"save all cookies during the session, but don't persist them to disk when the session is closed\" --- that is to say, the current behavior of the `session` object\n2. This ticket is to implement the option, \"discard all cookies during the session\", which is somewhat different\n\n@berkerpeksag there's an unmerged branch out for review (#565) that will modify cookie handling. Wild guess: if it gets merged, you could implement this functionality using a `MockCookieJar` that discards all cookies.\n", "@berkerpeksag actually, `MockCookieJar` is a terrible suggestion, please ignore me :-)\n", "@berkerpeksag Sorry I fixed the one which you had picked originally ( I followed the suggestions you made here though :D ). I am new to python and I found this one to be one of the easier ones to fix.\n", "@amalakar no problem, have fun with Python :)\n\n@slingamn thanks for the suggestions :)\n", "Done :)\n" ]
https://api.github.com/repos/psf/requests/issues/504
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/504/labels{/name}
https://api.github.com/repos/psf/requests/issues/504/comments
https://api.github.com/repos/psf/requests/issues/504/events
https://github.com/psf/requests/issues/504
3,757,096
MDU6SXNzdWUzNzU3MDk2
504
Update docs on redirection to reflect HEAD's allow_redirect=False default
{ "avatar_url": "https://avatars.githubusercontent.com/u/830800?v=4", "events_url": "https://api.github.com/users/johtso/events{/privacy}", "followers_url": "https://api.github.com/users/johtso/followers", "following_url": "https://api.github.com/users/johtso/following{/other_user}", "gists_url": "https://api.github.com/users/johtso/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/johtso", "id": 830800, "login": "johtso", "node_id": "MDQ6VXNlcjgzMDgwMA==", "organizations_url": "https://api.github.com/users/johtso/orgs", "received_events_url": "https://api.github.com/users/johtso/received_events", "repos_url": "https://api.github.com/users/johtso/repos", "site_admin": false, "starred_url": "https://api.github.com/users/johtso/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/johtso/subscriptions", "type": "User", "url": "https://api.github.com/users/johtso", "user_view_type": "public" }
[]
closed
true
null
[]
null
0
2012-03-22T02:36:38Z
2021-09-09T08:00:36Z
2012-06-15T18:40:21Z
CONTRIBUTOR
resolved
Now that `requests.head` no longer defaults to following redirects, the docs should reflect that. http://docs.python-requests.org/en/v0.10.7/user/quickstart/#redirection-and-history
{ "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/504/reactions" }
https://api.github.com/repos/psf/requests/issues/504/timeline
null
completed
null
null
false
[]
https://api.github.com/repos/psf/requests/issues/503
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/503/labels{/name}
https://api.github.com/repos/psf/requests/issues/503/comments
https://api.github.com/repos/psf/requests/issues/503/events
https://github.com/psf/requests/issues/503
3,752,623
MDU6SXNzdWUzNzUyNjIz
503
Some notes for the quickstart tutorial
{ "avatar_url": "https://avatars.githubusercontent.com/u/91895?v=4", "events_url": "https://api.github.com/users/plaes/events{/privacy}", "followers_url": "https://api.github.com/users/plaes/followers", "following_url": "https://api.github.com/users/plaes/following{/other_user}", "gists_url": "https://api.github.com/users/plaes/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/plaes", "id": 91895, "login": "plaes", "node_id": "MDQ6VXNlcjkxODk1", "organizations_url": "https://api.github.com/users/plaes/orgs", "received_events_url": "https://api.github.com/users/plaes/received_events", "repos_url": "https://api.github.com/users/plaes/repos", "site_admin": false, "starred_url": "https://api.github.com/users/plaes/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/plaes/subscriptions", "type": "User", "url": "https://api.github.com/users/plaes", "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
11
2012-03-21T20:07:56Z
2021-09-09T08:00:33Z
2012-06-13T08:10:39Z
CONTRIBUTOR
resolved
Decided to do a smaller script today that uses requests, so I opened up the tutorial and spent too much time trying to figure out following two things: - What should I import to get started? IMHO, first code example in the tutorial should be: `import requests` - How can I nicely build urls for simple get request that contain variables/parameters... The `params` argument to `Request` class should be mentioned to show how to build urls with variables. URLs with various variables are quite common and finding the `params` is not trivial unless you know where to look (and I eventually had to ask).
{ "avatar_url": "https://avatars.githubusercontent.com/u/91895?v=4", "events_url": "https://api.github.com/users/plaes/events{/privacy}", "followers_url": "https://api.github.com/users/plaes/followers", "following_url": "https://api.github.com/users/plaes/following{/other_user}", "gists_url": "https://api.github.com/users/plaes/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/plaes", "id": 91895, "login": "plaes", "node_id": "MDQ6VXNlcjkxODk1", "organizations_url": "https://api.github.com/users/plaes/orgs", "received_events_url": "https://api.github.com/users/plaes/received_events", "repos_url": "https://api.github.com/users/plaes/repos", "site_admin": false, "starred_url": "https://api.github.com/users/plaes/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/plaes/subscriptions", "type": "User", "url": "https://api.github.com/users/plaes", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/503/reactions" }
https://api.github.com/repos/psf/requests/issues/503/timeline
null
completed
null
null
false
[ "+1 especially for the missing import requests. People ALWAYS copy and paste the example code into a console. If it doesn't work you'll loose half of the audience. Please fix it\n", "Half of python developers don't know they have to import modules?\n", "They know, but they don't know what module should they import. Consider e.g. \"from datetime import datetime\" or \"pip install scikit-learn\" but 'import sklearn'. \n", "No, they do. But most of the people just copy and paste. So please do them a favor and do not make them search for what to import. It's faster and easier to use.\n", "Have the criteria for this issue been met? This issue seemed like a good place to start contributing, but it looks like information for `import` and `params` has been included in the pull request Lukasa linked. Thanks.\n", "Pull #619 has addressed these issues. Closing \\o/\n", "@plaes Awesome, thanks for the quick response.\n", "Cool, it's much better now. It is not perfectly copy'n pastable because of the >>> prefix in each line.\n@kylerob I would remove that \">>>\" because for every pythonista it is clear that you can type into the terminal. A side effect would be that one can copy and paste.\n", "@jups23 that's a good idea. @kennethreitz, what do you think about me removing all of the >>> prefixes from all code examples to allow easy copy/paste?\n", "`>>>` should only be present in a code block when it's necessary: when it's showing interactive examples.\n", "While we're here, the first code block [here](http://docs.python-requests.org/en/latest/user/quickstart/#response-status-codes) isn't rendering properly in my browser (Chrome 20.0.1132.34 beta and Safari 5.1.7 (7534.57.2) on OS X 10.7). Might be worth tackling as part of this issue as well. (Not sure why it's not displaying properly, because [GitHub shows it fine](https://github.com/kennethreitz/requests/blob/develop/docs/user/quickstart.rst#response-status-codes).)\n\nI'm all for @kylerob removing the >>> prefixes where appropriate. Might even be worth adjusting the way some of the text flows to remove as many as possible, allowing for more copy-pasting.\n" ]
https://api.github.com/repos/psf/requests/issues/502
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/502/labels{/name}
https://api.github.com/repos/psf/requests/issues/502/comments
https://api.github.com/repos/psf/requests/issues/502/events
https://github.com/psf/requests/pull/502
3,744,750
MDExOlB1bGxSZXF1ZXN0MTAyMDg0MA==
502
making `body` an attribute of the request object; maybe fixes #445
{ "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
29
2012-03-21T12:39:00Z
2021-09-08T14:01:08Z
2012-05-08T05:06:40Z
CONTRIBUTOR
resolved
This occurred to me as a potential workaround for issues with pre-request hooks being unable to alter `body` within their scope. Particularly those found in oauth-requests, where the body of a request cannot be recalculated. Here the issue seems to be that `body` is assigned as a local variable. So if we simply make `body` an attribute of the object we can manually override its value in the scope of the hook. Here is a simple example of what this might look like: `request.data, request._enc_data = request._encode_params(my_params)` this sets us up for `request.body = request._enc_data` and we can now alter body as we should like.
{ "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/502/reactions" }
https://api.github.com/repos/psf/requests/issues/502/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/502.diff", "html_url": "https://github.com/psf/requests/pull/502", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/502.patch", "url": "https://api.github.com/repos/psf/requests/pulls/502" }
true
[ "This is an interesting alternative. I believe requests should do the calculation of these things based on the manipulation of some of the request parameters, but this patch is easier to merge without conflicts in other features, like stream uploads.\n\nI think there is one issue with:\n\n``` python\nrequest.data, request._enc_data = request._encode_params(my_params)\nrequest.body = request._enc_data\n```\n\nRemember that the `request.body` is not only `data`, but also `files` merged in. The problem with this, would be that I will have to replicate some of the encoding in the hook.\n\nThe perfect fit would be that this pull request added a `_encode_body` static method similar to the one I proposed in #445, but expecting external parameters. Beware that `Content-Type` should be editable too, because recalculating multipart requests, gets new Content-Types.\n\nCheers,\nMiguel\n", "The benefit here is that you can calculate `request.body` however you like, up to and including `files`. Additionally the `Content-Type` header is easily overridden as is in the scope of hook, e.g.: `request.headers['Content-Type'] = 'application/x-www-form-urlencoded'`.\n", "You are right Max, I forgot `Content-Type` can be edited through headers.\n\nI agree with you, this gives all the choices to the hook's author. I think adding a body encoding method to requests, would be helpful, to avoid replicating functionality that I don't think should be done by the hook.\n\nGood work!\n", "I agree completely with you Miguel: in the long run it would be nice to see the hook logic handle this internally so that pre-request hooks can be less hacky, e.g. by not having to call `request._encode_params`.\n\nAnyway looking forward to more feedback on this idea. :cake:\n", "Yes. Just to make sure we've understood each other. The hook should call something like `request._encode_body(data, files)`. `request._encode_params`, doesn't take `files` into account. That's why I was proposing this method.\n", "Right, it doesn't, however in the scope of the hook you could use whatever method you like to generate the body. So if you wanted you could create a `request._encode_body` method and use it to generate the body as you liked. The primary thrust of this patch is to liberate the body variable by making it an attribute of the request without disrupting the existing infrastructure too much.\n", "Ok, then we are on the same track :)\n", "I've been thinking a lot lately about `Request` keeping a reference to the original value of every parameter as well as the calculated version.\n\n`Request._url` = value of `url` param\n`Request._params` = value of `params` param\n`Request.url` = url + parms\n", "Thoughts?\n", "I would prefer a naming like Werkzeug or other WSGI frameworks use, `args` for GET parameters, `form` for POST parameters, `url` for the whole url and `base_url` for the url without the query string.\n\nSo a generig `args` or `params` plus `url` and `base_url` could be fine, I do not see a reason why both should be hidden, they can easily be public.\n", "Requests already has a well thought-out naming system for those things. No need to change it for this.\n", "Keeping references seems like a good idea to me. \n", "Do you think making `body` an attribute for the time being is unobtrusive enough to merge?\n", "I'd prefer `_data` and `data`\n", "Sure. So are suggesting we rename `body` to `data`? (The problem here seems to be related to the fact that `body` is set in the scope of the method and then cannot be reset in the scope of the hook.)\n", "I'd be happy to fix up this commit to conform with your ideas for this Kenneth, but I guess I'm still unclear how keeping original values around is going to address the fact that `body` isn't currently an attribute of `Request` and thus is unmodifiable in the scope of a pre-request hook, which seems to be at the heart of the bug referenced.\n", "@maxcountryman right now, original/modified values are all mixed together. Its unclear. `body` needs to be called `content`. \n", "And could we make it an attribute of the request object? I can take a closer look at this if you'd like.\n", "Correct. \n", "Not sure if this is what you had in mind or not... :)\n", "How about\n\n`Request.original.url` = value of `url` param\n`Request.original.params` = value of `params` param\n\ninstead of\n\n`Request._url` = value of `url` param\n`Request._params` = value of `params` param\n", "`original` could be a dictionary.\n", "`content_type` as previously discussed, can already be overridden.\n\nCan I make a suggestion that the naming convention changes be moved to another commit? I don't think they necessarily relate to #445.\n", "> `original` could be a dictionary.\n\nSure, this is what I had in mind.\n", "@maxcountryman \n\nI'm talking about passing the original value of `content_type` to hooks not the ability to modify it. Passing content and not passing content type feels wrong.\n", "@piotr-dobrogost even so I think it's beyond the scope of this particular bug, no? Easy enough to add but, it just seems like this patch is starting to grow past the original issue... Maybe we should break the two objectives off into separate commits?\n", "This patch is also needed by Rauth: https://github.com/litl/rauth/issues/6\n", "We don't want to add something that will need to be changed later. \n\nPlease be patient :)\n", "This shouldn't be an issue anymore.\n" ]
https://api.github.com/repos/psf/requests/issues/501
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/501/labels{/name}
https://api.github.com/repos/psf/requests/issues/501/comments
https://api.github.com/repos/psf/requests/issues/501/events
https://github.com/psf/requests/pull/501
3,728,779
MDExOlB1bGxSZXF1ZXN0MTAxMzk0MQ==
501
Make HEAD requests follow redirects by default
{ "avatar_url": "https://avatars.githubusercontent.com/u/830800?v=4", "events_url": "https://api.github.com/users/johtso/events{/privacy}", "followers_url": "https://api.github.com/users/johtso/followers", "following_url": "https://api.github.com/users/johtso/following{/other_user}", "gists_url": "https://api.github.com/users/johtso/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/johtso", "id": 830800, "login": "johtso", "node_id": "MDQ6VXNlcjgzMDgwMA==", "organizations_url": "https://api.github.com/users/johtso/orgs", "received_events_url": "https://api.github.com/users/johtso/received_events", "repos_url": "https://api.github.com/users/johtso/repos", "site_admin": false, "starred_url": "https://api.github.com/users/johtso/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/johtso/subscriptions", "type": "User", "url": "https://api.github.com/users/johtso", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2012-03-20T14:34:59Z
2021-09-08T14:01:08Z
2012-03-22T02:32:19Z
CONTRIBUTOR
resolved
[The docs](http://docs.python-requests.org/en/v0.10.7/user/quickstart/#redirection-and-history) imply that GET, HEAD and OPTION should all default to following redirects, but currently `allow_redirects` defaults to False for HEAD requests.
{ "avatar_url": "https://avatars.githubusercontent.com/u/830800?v=4", "events_url": "https://api.github.com/users/johtso/events{/privacy}", "followers_url": "https://api.github.com/users/johtso/followers", "following_url": "https://api.github.com/users/johtso/following{/other_user}", "gists_url": "https://api.github.com/users/johtso/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/johtso", "id": 830800, "login": "johtso", "node_id": "MDQ6VXNlcjgzMDgwMA==", "organizations_url": "https://api.github.com/users/johtso/orgs", "received_events_url": "https://api.github.com/users/johtso/received_events", "repos_url": "https://api.github.com/users/johtso/repos", "site_admin": false, "starred_url": "https://api.github.com/users/johtso/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/johtso/subscriptions", "type": "User", "url": "https://api.github.com/users/johtso", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/501/reactions" }
https://api.github.com/repos/psf/requests/issues/501/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/501.diff", "html_url": "https://github.com/psf/requests/pull/501", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/501.patch", "url": "https://api.github.com/repos/psf/requests/pulls/501" }
true
[ "This is how HEAD should behave, it's the docs that need to be updated.\n" ]
https://api.github.com/repos/psf/requests/issues/500
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/500/labels{/name}
https://api.github.com/repos/psf/requests/issues/500/comments
https://api.github.com/repos/psf/requests/issues/500/events
https://github.com/psf/requests/issues/500
3,722,903
MDU6SXNzdWUzNzIyOTAz
500
Async requests don't honor timeout param
{ "avatar_url": "https://avatars.githubusercontent.com/u/843283?v=4", "events_url": "https://api.github.com/users/prior/events{/privacy}", "followers_url": "https://api.github.com/users/prior/followers", "following_url": "https://api.github.com/users/prior/following{/other_user}", "gists_url": "https://api.github.com/users/prior/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/prior", "id": 843283, "login": "prior", "node_id": "MDQ6VXNlcjg0MzI4Mw==", "organizations_url": "https://api.github.com/users/prior/orgs", "received_events_url": "https://api.github.com/users/prior/received_events", "repos_url": "https://api.github.com/users/prior/repos", "site_admin": false, "starred_url": "https://api.github.com/users/prior/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/prior/subscriptions", "type": "User", "url": "https://api.github.com/users/prior", "user_view_type": "public" }
[ { "color": "e10c02", "default": false, "description": null, "id": 117744, "name": "Bug", "node_id": "MDU6TGFiZWwxMTc3NDQ=", "url": "https://api.github.com/repos/psf/requests/labels/Bug" } ]
closed
true
null
[]
null
13
2012-03-20T05:07:44Z
2021-09-09T08:00:45Z
2012-05-10T22:05:42Z
NONE
resolved
Timeouts on the synchronous requests behave as expected, but the same exact calls with requests.async take twice as long to timeout (twice as long as the timeout specified).
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/500/reactions" }
https://api.github.com/repos/psf/requests/issues/500/timeline
null
completed
null
null
false
[ "On my system, timeout in synchronous requests is also flaky:\n\n```\n>>> import time, requests\n>>> start = time.time(); r = requests.get('http://httpbin.org/delay/4', timeout=2.0); print time.time() - start, r.status_code\n4.55748391151 200\n>>> start = time.time(); r = requests.get('http://httpbin.org/delay/4', timeout=2.0); print time.time() - start, r.status_code\n4.54007601738 200\n>>> start = time.time(); r = requests.get('http://httpbin.org/delay/4', timeout=2.0); print time.time() - start, r.status_code\n4.5993411541 200\n>>> start = time.time(); r = requests.get('http://httpbin.org/delay/4', timeout=2.0); print time.time() - start, r.status_code\n4.37087607384 200\n>>> start = time.time(); r = requests.get('http://httpbin.org/delay/4', timeout=2.0); print time.time() - start, r.status_code\n4.36421513557 200\n```\n", "But sometimes:\n\n```\n>>> start = time.time(); r = requests.get('http://httpbin.org/delay/4', timeout=2.0); print time.time() - start, r.status_code\nTraceback (most recent call last):\n File \"<stdin>\", line 1, in <module>\n File \"requests/api.py\", line 52, in get\n return request('get', url, **kwargs)\n File \"requests/api.py\", line 40, in request\n return s.request(method=method, url=url, **kwargs)\n File \"requests/sessions.py\", line 229, in request\n r.send(prefetch=prefetch)\n File \"requests/models.py\", line 604, in send\n raise Timeout('Request timed out.')\nrequests.exceptions.Timeout: Request timed out.\n```\n", "Oh, wow, this is a really cool bug. Importing `requests.async` screws up timeouts for all requests, even synchronous ones.\n\n```\n\n>>> import requests\n>>> import time\n>>> start = time.time(); r = requests.get('http://httpbin.org/delay/4', timeout=2.0); print time.time() - start, r.status_code\nTraceback (most recent call last):\n File \"<stdin>\", line 1, in <module>\n File \"requests/api.py\", line 52, in get\n return request('get', url, **kwargs)\n File \"requests/api.py\", line 40, in request\n return s.request(method=method, url=url, **kwargs)\n File \"requests/sessions.py\", line 229, in request\n r.send(prefetch=prefetch)\n File \"requests/models.py\", line 604, in send\n raise Timeout('Request timed out.')\nrequests.exceptions.Timeout: Request timed out.\n>>> start = time.time(); r = requests.get('http://httpbin.org/delay/4', timeout=2.0); print time.time() - start, r.status_code\nTraceback (most recent call last):\n File \"<stdin>\", line 1, in <module>\n File \"requests/api.py\", line 52, in get\n return request('get', url, **kwargs)\n File \"requests/api.py\", line 40, in request\n return s.request(method=method, url=url, **kwargs)\n File \"requests/sessions.py\", line 229, in request\n r.send(prefetch=prefetch)\n File \"requests/models.py\", line 604, in send\n raise Timeout('Request timed out.')\nrequests.exceptions.Timeout: Request timed out.\n>>> import requests.async\n>>> start = time.time(); r = requests.get('http://httpbin.org/delay/4', timeout=2.0); print time.time() - start, r.status_code\n4.38320612907 200\n>>> start = time.time(); r = requests.get('http://httpbin.org/delay/4', timeout=2.0); print time.time() - start, r.status_code\n4.67993688583 200\n```\n", "Looks like a problem with `gevent`'s monkeypatching, because this fixes it:\n\n``` diff\ndiff --git a/requests/async.py b/requests/async.py\nindex f12cf26..ed18464 100644\n--- a/requests/async.py\n+++ b/requests/async.py\n@@ -17,7 +17,7 @@ except ImportError:\n raise RuntimeError('Gevent is required for requests.async.')\n\n # Monkey-patch.\n-curious_george.patch_all(thread=False, select=False)\n+curious_george.patch_all(thread=False, select=False, socket=False)\n```\n\nI have no idea what to make of this.\n", "Here's part of the problem: in principle, socket timeouts only affect socket I/O operations, i.e., `read` and `send`, not polling operations like `select` and `epoll`. (See the docs on `SO_RCVTIMEO` and `SO_SNDTIMEO` here: http://linux.die.net/man/7/socket.)\n\nI think the fix for this is to change `requests.async.map` so that it calls `gevent.joinall` with a timeout argument, looping until all requests have either timed out or completed.\n\nThis does not explain why importing `async` is breaking ordinary synchronous requests; AFAICT sockets that have been set to non-blocking mode should still respect `SO_RCVTIMEO` during `read()`.\n", "For some time now I can't get async to work reliably. I'm not sure if my problem is related by I get this:\n\n```\n>>> requests.request('get', 'http://httpbin.org/get').status_code\n200\n>>> requests.request('get', 'http://httpbin.org/get').status_code\n200\n>>> requests.request('get', 'http://httpbin.org/get').status_code\n200\n>>> requests.request('get', 'http://httpbin.org/get').status_code\n200\n>>> from requests import async\n>>> requests.request('get', 'http://httpbin.org/get').status_code\nTraceback (most recent call last):\n File \"<stdin>\", line 1, in <module>\n File \"c:\\users\\piotr\\projects\\requests\\requests\\api.py\", line 40, in request\n return s.request(method=method, url=url, **kwargs)\n File \"c:\\users\\piotr\\projects\\requests\\requests\\sessions.py\", line 229, in request\n r.send(prefetch=prefetch)\n File \"c:\\users\\piotr\\projects\\requests\\requests\\models.py\", line 598, in send\n raise ConnectionError(e)\nrequests.exceptions.ConnectionError: HTTPConnectionPool(host='httpbin.org', port=80): Max retries exceeded with url: /get\n>>> requests.request('get', 'http://httpbin.org/get').status_code\n200\n>>> requests.request('get', 'http://httpbin.org/get').status_code\nTraceback (most recent call last):\n File \"<stdin>\", line 1, in <module>\n File \"c:\\users\\piotr\\projects\\requests\\requests\\api.py\", line 40, in request\n return s.request(method=method, url=url, **kwargs)\n File \"c:\\users\\piotr\\projects\\requests\\requests\\sessions.py\", line 229, in request\n r.send(prefetch=prefetch)\n File \"c:\\users\\piotr\\projects\\requests\\requests\\models.py\", line 598, in send\n raise ConnectionError(e)\nrequests.exceptions.ConnectionError: HTTPConnectionPool(host='httpbin.org', port=80): Max retries exceeded with url: /get\n```\n", "@piotr-dobrogost doesn't reproduce for me in Linux. But yeah, it wouldn't surprise me if it were a cross-platform issue with gevent's monkeypatching. See if it goes away under the abovementioned patch?\n", "> doesn't reproduce for me in Linux.\n\nIt's nondeterministic. Could you run it in a loop?\n\n> See if it goes away under the abovementioned patch?\n\nYes, it does.\nRunning https://gist.github.com/2630312 without patch 3 times:\n\n```\nSYNC http errors: 0.000000%, exceptions 80.000000%\nASYNC http errors: 88.000000%, exceptions 0.000000%\n\nSYNC http errors: 0.000000%, exceptions 84.000000%\nASYNC http errors: 90.000000%, exceptions 0.000000%\n\nSYNC http errors: 0.000000%, exceptions 90.000000%\nASYNC http errors: 96.000000%, exceptions 0.000000%\n```\n\nRunning https://gist.github.com/2630312 with patch 3 times:\n\n3x\n\n```\nSYNC http errors: 0.000000%, exceptions 0.000000%\nASYNC http errors: 0.000000%, exceptions 0.000000%\n```\n", "Ran it three times against the unpatched code, no errors. I'm pretty sure it's cross-platform.\n", "```\n[shivaram@good-fortune ~/workspace/requests]$ python ./requests-issue-500.py \n. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . \nSYNC http errors: 0.000000%, exceptions 0.000000%\n. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . \nASYNC http errors: 0.000000%, exceptions 0.000000%\n```\n", "I shared https://github.com/kennethreitz/requests/issues/500#issuecomment-5508478 link on freenode #gevent IRC channel and colinmarc replied:\n\n> the gevent socket module keeps track of what the actual timeout on the socket is supposed to be\n> so if you settimeout(0.0) on a gevent socket, it will still throw EWOULDBLOCK like normal\n> and if you settimeout(1.0), then it will create a Timeout object and throw the exception after a second, but still yield back to the loop in that second\n> so it should behave the same, yeah\n", "I looked in the gevent codebase and their current socket timeout test case doesn't cover this issue, only that timeout on `read` is respected. I'll see if I can work up a test case for this behavior.\n", "Async is removed from requests now. A new module, [grequests](https://github.com/kennethreitz/grequests) will replace it.\n" ]
https://api.github.com/repos/psf/requests/issues/499
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/499/labels{/name}
https://api.github.com/repos/psf/requests/issues/499/comments
https://api.github.com/repos/psf/requests/issues/499/events
https://github.com/psf/requests/issues/499
3,722,640
MDU6SXNzdWUzNzIyNjQw
499
AuthBase has unwieldy access to r.params
{ "avatar_url": "https://avatars.githubusercontent.com/u/218132?v=4", "events_url": "https://api.github.com/users/jmoiron/events{/privacy}", "followers_url": "https://api.github.com/users/jmoiron/followers", "following_url": "https://api.github.com/users/jmoiron/following{/other_user}", "gists_url": "https://api.github.com/users/jmoiron/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/jmoiron", "id": 218132, "login": "jmoiron", "node_id": "MDQ6VXNlcjIxODEzMg==", "organizations_url": "https://api.github.com/users/jmoiron/orgs", "received_events_url": "https://api.github.com/users/jmoiron/received_events", "repos_url": "https://api.github.com/users/jmoiron/repos", "site_admin": false, "starred_url": "https://api.github.com/users/jmoiron/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/jmoiron/subscriptions", "type": "User", "url": "https://api.github.com/users/jmoiron", "user_view_type": "public" }
[]
closed
true
null
[]
null
6
2012-03-20T04:19:37Z
2021-09-09T04:00:35Z
2012-07-03T18:57:52Z
NONE
resolved
Because `_enc_params` seems to already be built by the time auth is applied, and r.params is no longer a dictionary, authentication schemes that require signatures to be passed as a param (like LastFM's, possibly others) end up being kind of unwieldy. Here's some working LastFM auth code, for example: ``` python from hashlib import md5 from requests.auth import AuthBase from urllib import urlencode key = "xxx" secret = "xxx-secret" class LastFMAuth(AuthBase): """Implement LastFM's annoying authentication.""" def __init__(self, session_key): self.session_key = session_key def __call__(self, r): r.params.append(('sk', self.session_key)) r.params.append(('api_key', key)) encode = lambda x: unicode(x).encode("utf-8") signature = list(sorted(r.params)) signature = "".join([encode(k) + encode(v) for k,v in signature]) + secret r.params.append(("api_sig", md5(signature).hexdigest())) r._enc_params = urlencode(r.params) return r ``` I think it would suffice to delay setting `_enc_params` until after auth is applied; even if such a thing is documented it still feels kind of strange.
{ "avatar_url": "https://avatars.githubusercontent.com/u/218132?v=4", "events_url": "https://api.github.com/users/jmoiron/events{/privacy}", "followers_url": "https://api.github.com/users/jmoiron/followers", "following_url": "https://api.github.com/users/jmoiron/following{/other_user}", "gists_url": "https://api.github.com/users/jmoiron/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/jmoiron", "id": 218132, "login": "jmoiron", "node_id": "MDQ6VXNlcjIxODEzMg==", "organizations_url": "https://api.github.com/users/jmoiron/orgs", "received_events_url": "https://api.github.com/users/jmoiron/received_events", "repos_url": "https://api.github.com/users/jmoiron/repos", "site_admin": false, "starred_url": "https://api.github.com/users/jmoiron/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/jmoiron/subscriptions", "type": "User", "url": "https://api.github.com/users/jmoiron", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/499/reactions" }
https://api.github.com/repos/psf/requests/issues/499/timeline
null
completed
null
null
false
[ "I believe this has changed recently.\n", "request.params is indeed a dictionary in requests-0.13.1, which means the code in this ticket no longer works and the `_enc_params = urlencode(...)` step is no longer necessary for auth using params.\n", "@jmoiron @kennethreitz I'm sorry, but how can it be currently done?\nBuilding API client for another service that uses signature-based authentication and when I'm trying to add parameters by editing r.params, I receive:\nAttributeError: 'PreparedRequest' object has no attribute 'params'\n", "@pitsevich the API has changed in the most recent releases of requests. As of 1.x you have no access to the params attribute. If you want to modify the params you'll have to parse the url and unquote the param string, add your params, re-quote it and then unparse the url.\n", "@sigmavirus24 thanks, this worked!\n", "@pitsevich glad to help.\n" ]
https://api.github.com/repos/psf/requests/issues/498
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/498/labels{/name}
https://api.github.com/repos/psf/requests/issues/498/comments
https://api.github.com/repos/psf/requests/issues/498/events
https://github.com/psf/requests/issues/498
3,704,324
MDU6SXNzdWUzNzA0MzI0
498
App Engine Fixes
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
[ { "color": "e10c02", "default": false, "description": null, "id": 117744, "name": "Bug", "node_id": "MDU6TGFiZWwxMTc3NDQ=", "url": "https://api.github.com/repos/psf/requests/labels/Bug" }, { "color": "0b02e1", "default": false, "description": null, "id": 191274, "name": "Contributor Friendly", "node_id": "MDU6TGFiZWwxOTEyNzQ=", "url": "https://api.github.com/repos/psf/requests/labels/Contributor%20Friendly" }, { "color": "fbca04", "default": false, "description": null, "id": 615414998, "name": "GAE Support", "node_id": "MDU6TGFiZWw2MTU0MTQ5OTg=", "url": "https://api.github.com/repos/psf/requests/labels/GAE%20Support" } ]
closed
true
null
[]
null
30
2012-03-19T02:03:45Z
2021-09-08T09:00:49Z
2012-07-27T05:29:28Z
CONTRIBUTOR
resolved
http://stackoverflow.com/questions/9762685/using-the-requests-python-library-in-google-app-engine/9763217
{ "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/498/reactions" }
https://api.github.com/repos/psf/requests/issues/498/timeline
null
completed
null
null
false
[ "@singingwolfboy Your pull request in #493 had a lot of fixes for this. If you're up for it, you could merge against the latest urllib3 which supports AppEngine and just make the requests-specific changes without introducing Py25 support. :)\n", "@kennethreitz How do you want to handle merging in the latest urllib3? Once that's dealt with, I can make the necessary changes to make `requests` compatible with App Engine on Python 2.7.\n", "@shazow I'm a bit of a noob but could try my hand at a merge.... this would be incredibly helpful to those of us in the python environment on app engine!\n", "Urllib3 changes have already been merged.\n", "I need to actually spin up an account and see what's wrong I guess :)\n", "Hey, I just tried this again with the current master branch. Looks like the same AttributeError referenced in the above stackoverflow post, which @shazow mentioned probably has to do with using the local filesystem for certain things in Requests. The local filesystem is not available on AppEngine- I tend to use StringIO in a lot cases where I'd relied on the file system in the past, but not sure how how helpful that is.\n", "@rdixit can you try it again with the latest from the `develop` branch?\n", "Hi, tried it with the develop branch, but I think it's the same issue as OP.\n\n> > > from libraries import requests\n> > > \n> > > response = requests.get('http://www.google.com')\n\nTraceback (most recent call last):\n File \"/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/ext/admin/**init**.py\", line 320, in post\n exec(compiled_code, globals())\n File \"<string>\", line 3, in <module>\n File \"/Users/Rohan/Dropbox/MuktiTechnologiesINC/MuktiTechnologies/GAE/humanmictweet/GAE/libraries/requests/api.py\", line 52, in get\n return request('get', url, *_kwargs)\n File \"/Users/Rohan/Dropbox/MuktiTechnologiesINC/MuktiTechnologies/GAE/humanmictweet/GAE/libraries/requests/api.py\", line 40, in request\n return s.request(method=method, url=url, *_kwargs)\n File \"/Users/Rohan/Dropbox/MuktiTechnologiesINC/MuktiTechnologies/GAE/humanmictweet/GAE/libraries/requests/sessions.py\", line 208, in request\n r.send(prefetch=prefetch)\n File \"/Users/Rohan/Dropbox/MuktiTechnologiesINC/MuktiTechnologies/GAE/humanmictweet/GAE/libraries/requests/models.py\", line 473, in send\n self.auth = get_netrc_auth(url)\n File \"/Users/Rohan/Dropbox/MuktiTechnologiesINC/MuktiTechnologies/GAE/humanmictweet/GAE/libraries/requests/utils.py\", line 43, in get_netrc_auth\n for loc in locations:\n File \"/Users/Rohan/Dropbox/MuktiTechnologiesINC/MuktiTechnologies/GAE/humanmictweet/GAE/libraries/requests/utils.py\", line 40, in <genexpr>\n locations = (os.path.expanduser('~/{0}'.format(f)) for f in NETRC_FILES)\n File \"/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/posixpath.py\", line 260, in expanduser\n userhome = pwd.getpwuid(os.getuid()).pw_dir\nAttributeError: 'module' object has no attribute 'getuid'\n", "Ah, interesting. One more quick fix here...\n", "Care to try again?\n\nThanks for this by the way :)\n", "No problem, I'm happy to help even in a small way.\n\nHere's the new traceback:\n\nTraceback (most recent call last):\n File \"/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/ext/admin/**init**.py\", line 320, in post\n exec(compiled_code, globals())\n File \"<string>\", line 3, in <module>\n File \"/Users/Rohan/Dropbox/MuktiTechnologiesINC/MuktiTechnologies/GAE/humanmictweet/GAE/libraries/requests/api.py\", line 52, in get\n return request('get', url, *_kwargs)\n File \"/Users/Rohan/Dropbox/MuktiTechnologiesINC/MuktiTechnologies/GAE/humanmictweet/GAE/libraries/requests/api.py\", line 40, in request\n return s.request(method=method, url=url, *_kwargs)\n File \"/Users/Rohan/Dropbox/MuktiTechnologiesINC/MuktiTechnologies/GAE/humanmictweet/GAE/libraries/requests/sessions.py\", line 208, in request\n r.send(prefetch=prefetch)\n File \"/Users/Rohan/Dropbox/MuktiTechnologiesINC/MuktiTechnologies/GAE/humanmictweet/GAE/libraries/requests/models.py\", line 575, in send\n timeout=self.timeout,\n File \"/Users/Rohan/Dropbox/MuktiTechnologiesINC/MuktiTechnologies/GAE/humanmictweet/GAE/libraries/requests/packages/urllib3/connectionpool.py\", line 383, in urlopen\n body=body, headers=headers)\n File \"/Users/Rohan/Dropbox/MuktiTechnologiesINC/MuktiTechnologies/GAE/humanmictweet/GAE/libraries/requests/packages/urllib3/connectionpool.py\", line 265, in _make_request\n conn._http_vsn_str, # pylint: disable-msg=W0212\nAttributeError: HTTPConnection instance has no attribute '_http_vsn_str'\n", "@shazow, I choose you!\n\n![](http://4.bp.blogspot.com/_J0fSQHG901k/Sw40rKFnN8I/AAAAAAAAAT4/cLXi4xhQTNQ/s1600/ash+trowing+pokeball.png)\n", "/me scurries over. (will check this out this afternoon)\n", "Here's a fixen: https://github.com/shazow/urllib3/commit/a17aa2650e6c3748a801cf611b62fd53eb36c74c\n\nTry meow?\n", "@rdixit care to try again?\n", "Would be nice if we had some sort of (semi?) automated testing for AppEngine. You should hook us up somehow, @rdixit. ;)\n", "@shazow if only we knew a Google Employee...\n", "I guess I should set up app engine testing in jenkins..\n", "Traceback (most recent call last):\n File \"/base/python27_runtime/python27_lib/versions/1/google/appengine/runtime/wsgi.py\", line 193, in Handle\n result = handler(self._environ, self._StartResponse)\n File \"/base/python27_runtime/python27_lib/versions/third_party/webapp2-2.3/webapp2.py\", line 1519, in __call__\n response = self._internal_error(e)\n File \"/base/python27_runtime/python27_lib/versions/third_party/webapp2-2.3/webapp2.py\", line 1511, in __call__\n rv = self.handle_exception(request, response, e)\n File \"/base/python27_runtime/python27_lib/versions/third_party/webapp2-2.3/webapp2.py\", line 1505, in **call**\n rv = self.router.dispatch(request, response)\n File \"/base/python27_runtime/python27_lib/versions/third_party/webapp2-2.3/webapp2.py\", line 1253, in default_dispatcher\n return route.handler_adapter(request, response)\n File \"/base/python27_runtime/python27_lib/versions/third_party/webapp2-2.3/webapp2.py\", line 1077, in **call**\n return handler.dispatch()\n File \"/base/python27_runtime/python27_lib/versions/third_party/webapp2-2.3/webapp2.py\", line 547, in dispatch\n return self.handle_exception(e, self.app.debug)\n File \"/base/python27_runtime/python27_lib/versions/third_party/webapp2-2.3/webapp2.py\", line 545, in dispatch\n return method(_args, *_kwargs)\n File \"/base/data/home/apps/s~requeststest/1.358094966291529965/requeststest.py\", line 10, in get\n self.response.out.write(requests.get(\"http://www.google.com\"))\n File \"requests.zip/requests/api.py\", line 52, in get\n return request('get', url, *_kwargs)\n File \"requests.zip/requests/api.py\", line 40, in request\n return s.request(method=method, url=url, *_kwargs)\n File \"requests.zip/requests/sessions.py\", line 208, in request\n r.send(prefetch=prefetch)\n File \"requests.zip/requests/models.py\", line 473, in send\n self.auth = get_netrc_auth(url)\n File \"requests.zip/requests/utils.py\", line 44, in get_netrc_auth\n for loc in locations:\n File \"requests.zip/requests/utils.py\", line 41, in <genexpr>\n locations = (os.path.expanduser('~/{0}'.format(f)) for f in NETRC_FILES)\n File \"/base/python27_runtime/python27_dist/lib/python2.7/posixpath.py\", line 259, in expanduser\n import pwd\nImportError: No module named pwd\n\nI can get requests running in the App Engine environment by changing utils.py line 69 on the develop branch to read:\n\n```\nexcept (AttributeError, ImportError):\n```\n", "This is mind-blowing. Does `import os.path` really cause a crash on AppEngine?\n", "Sorry about the delay (this is actually the first public Github thread I've ever contributed to!) Here's the new traceback, at least as of the commit referenced above. \n\nTraceback (most recent call last):\n File \"/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/ext/admin/**init**.py\", line 320, in post\n exec(compiled_code, globals())\n File \"<string>\", line 1, in <module>\n File \"/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver_import_hook.py\", line 676, in Decorate\n return func(self, _args, *_kwargs)\n File \"/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver_import_hook.py\", line 1850, in load_module\n return self.FindAndLoadModule(submodule, fullname, search_path)\n File \"/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver_import_hook.py\", line 676, in Decorate\n return func(self, _args, *_kwargs)\n File \"/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver_import_hook.py\", line 1722, in FindAndLoadModule\n description)\n File \"/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver_import_hook.py\", line 676, in Decorate\n return func(self, _args, *_kwargs)\n File \"/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver_import_hook.py\", line 1665, in LoadModuleRestricted\n description)\n File \"/Users/rohan/Dropbox/MuktiTechnologiesINC/MuktiTechnologies/GAE/sunlight/GAE/requests/**init**.py\", line 25, in <module>\n from . import utils\n File \"/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver_import_hook.py\", line 676, in Decorate\n return func(self, _args, *_kwargs)\n File \"/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver_import_hook.py\", line 1850, in load_module\n return self.FindAndLoadModule(submodule, fullname, search_path)\n File \"/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver_import_hook.py\", line 676, in Decorate\n return func(self, _args, *_kwargs)\n File \"/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver_import_hook.py\", line 1722, in FindAndLoadModule\n description)\n File \"/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver_import_hook.py\", line 676, in Decorate\n return func(self, _args, *_kwargs)\n File \"/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver_import_hook.py\", line 1665, in LoadModuleRestricted\n description)\n File \"/Users/rohan/Dropbox/MuktiTechnologiesINC/MuktiTechnologies/GAE/sunlight/GAE/requests/utils.py\", line 21, in <module>\n from .compat import parse_http_list as _parse_list_header\n File \"/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver_import_hook.py\", line 676, in Decorate\n return func(self, _args, *_kwargs)\n File \"/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver_import_hook.py\", line 1850, in load_module\n return self.FindAndLoadModule(submodule, fullname, search_path)\n File \"/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver_import_hook.py\", line 676, in Decorate\n return func(self, _args, *_kwargs)\n File \"/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver_import_hook.py\", line 1722, in FindAndLoadModule\n description)\n File \"/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver_import_hook.py\", line 676, in Decorate\n return func(self, _args, *_kwargs)\n File \"/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver_import_hook.py\", line 1665, in LoadModuleRestricted\n description)\n File \"/Users/rohan/Dropbox/MuktiTechnologiesINC/MuktiTechnologies/GAE/sunlight/GAE/requests/compat.py\", line 86, in <module>\n from .packages.oreos.monkeys import SimpleCookie\n File \"/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver_import_hook.py\", line 676, in Decorate\n return func(self, _args, *_kwargs)\n File \"/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver_import_hook.py\", line 1850, in load_module\n return self.FindAndLoadModule(submodule, fullname, search_path)\n File \"/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver_import_hook.py\", line 676, in Decorate\n return func(self, _args, *_kwargs)\n File \"/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver_import_hook.py\", line 1722, in FindAndLoadModule\n description)\n File \"/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver_import_hook.py\", line 676, in Decorate\n return func(self, _args, *_kwargs)\n File \"/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver_import_hook.py\", line 1665, in LoadModuleRestricted\n description)\n File \"/Users/rohan/Dropbox/MuktiTechnologiesINC/MuktiTechnologies/GAE/sunlight/GAE/requests/packages/__init__.py\", line 3, in <module>\n from . import urllib3\n File \"/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver_import_hook.py\", line 676, in Decorate\n return func(self, _args, *_kwargs)\n File \"/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver_import_hook.py\", line 1850, in load_module\n return self.FindAndLoadModule(submodule, fullname, search_path)\n File \"/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver_import_hook.py\", line 676, in Decorate\n return func(self, _args, *_kwargs)\n File \"/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver_import_hook.py\", line 1722, in FindAndLoadModule\n description)\n File \"/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver_import_hook.py\", line 676, in Decorate\n return func(self, _args, *_kwargs)\n File \"/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver_import_hook.py\", line 1665, in LoadModuleRestricted\n description)\n File \"/Users/rohan/Dropbox/MuktiTechnologiesINC/MuktiTechnologies/GAE/sunlight/GAE/requests/packages/urllib3/**init**.py\", line 16, in <module>\n from .connectionpool import (\n File \"/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver_import_hook.py\", line 676, in Decorate\n return func(self, _args, *_kwargs)\n File \"/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver_import_hook.py\", line 1850, in load_module\n return self.FindAndLoadModule(submodule, fullname, search_path)\n File \"/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver_import_hook.py\", line 676, in Decorate\n return func(self, _args, *_kwargs)\n File \"/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver_import_hook.py\", line 1722, in FindAndLoadModule\n description)\n File \"/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver_import_hook.py\", line 676, in Decorate\n return func(self, _args, *_kwargs)\n File \"/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver_import_hook.py\", line 1665, in LoadModuleRestricted\n description)\n File \"/Users/rohan/Dropbox/MuktiTechnologiesINC/MuktiTechnologies/GAE/sunlight/GAE/requests/packages/urllib3/connectionpool.py\", line 42, in <module>\n from .request import RequestMethods\n File \"/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver_import_hook.py\", line 676, in Decorate\n return func(self, _args, *_kwargs)\n File \"/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver_import_hook.py\", line 1850, in load_module\n return self.FindAndLoadModule(submodule, fullname, search_path)\n File \"/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver_import_hook.py\", line 676, in Decorate\n return func(self, _args, *_kwargs)\n File \"/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver_import_hook.py\", line 1722, in FindAndLoadModule\n description)\n File \"/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver_import_hook.py\", line 676, in Decorate\n return func(self, _args, *_kwargs)\n File \"/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver_import_hook.py\", line 1665, in LoadModuleRestricted\n description)\n File \"/Users/rohan/Dropbox/MuktiTechnologiesINC/MuktiTechnologies/GAE/sunlight/GAE/requests/packages/urllib3/request.py\", line 12, in <module>\n from .filepost import encode_multipart_formdata\n File \"/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver_import_hook.py\", line 676, in Decorate\n return func(self, _args, *_kwargs)\n File \"/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver_import_hook.py\", line 1850, in load_module\n return self.FindAndLoadModule(submodule, fullname, search_path)\n File \"/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver_import_hook.py\", line 676, in Decorate\n return func(self, _args, *_kwargs)\n File \"/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver_import_hook.py\", line 1722, in FindAndLoadModule\n description)\n File \"/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver_import_hook.py\", line 676, in Decorate\n return func(self, _args, *_kwargs)\n File \"/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver_import_hook.py\", line 1665, in LoadModuleRestricted\n description)\n File \"/Users/rohan/Dropbox/MuktiTechnologiesINC/MuktiTechnologies/GAE/sunlight/GAE/requests/packages/urllib3/filepost.py\", line 15, in <module>\n from io import BytesIO\n File \"/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver_import_hook.py\", line 676, in Decorate\n return func(self, _args, *_kwargs)\n File \"/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver_import_hook.py\", line 1850, in load_module\n return self.FindAndLoadModule(submodule, fullname, search_path)\n File \"/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver_import_hook.py\", line 676, in Decorate\n return func(self, _args, *_kwargs)\n File \"/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver_import_hook.py\", line 1722, in FindAndLoadModule\n description)\n File \"/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver_import_hook.py\", line 676, in Decorate\n return func(self, _args, *_kwargs)\n File \"/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver_import_hook.py\", line 1665, in LoadModuleRestricted\n description)\n File \"/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/io.py\", line 63, in <module>\n import _fileio\nImportError: No module named _fileio\n\nHope that is helpful.\n", "Oh, sorry, I didn't mean to poke you or anything. I was just shocked that the standard library appears to be broken on GAE.\n\nThanks for the traceback!\n", "A slight possibility but the problem @rdixit having might be due to different Python versions. As many know GAE comes with two Python runtimes: 2.5 and 2.7 where @rdixit appears to be using 2.6\n", "Been a while since there were any updates on this issue. Is requests still broken on App Engine?\n", "Just did a test myself. Google App Engine w/ Python 2.7. Works in development, but I get a traceback in production, last line as follows:\n\n```\nFile \"/base/python27_runtime/python27_dist/lib/python2.7/posixpath.py\", line 259, in expanduser\n import pwd\nImportError: No module named pwd\n```\n", "Ugh, I hate App Engine so much.\n", "Yeah, it's a love/hate relationship.... :/\n", "fixed!\n", "::snaps:: ::applause::\n", ":metal:\n" ]
https://api.github.com/repos/psf/requests/issues/497
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/497/labels{/name}
https://api.github.com/repos/psf/requests/issues/497/comments
https://api.github.com/repos/psf/requests/issues/497/events
https://github.com/psf/requests/pull/497
3,703,992
MDExOlB1bGxSZXF1ZXN0MTAwNDE4Ng==
497
Develop
{ "avatar_url": "https://avatars.githubusercontent.com/u/446062?v=4", "events_url": "https://api.github.com/users/iandanforth/events{/privacy}", "followers_url": "https://api.github.com/users/iandanforth/followers", "following_url": "https://api.github.com/users/iandanforth/following{/other_user}", "gists_url": "https://api.github.com/users/iandanforth/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/iandanforth", "id": 446062, "login": "iandanforth", "node_id": "MDQ6VXNlcjQ0NjA2Mg==", "organizations_url": "https://api.github.com/users/iandanforth/orgs", "received_events_url": "https://api.github.com/users/iandanforth/received_events", "repos_url": "https://api.github.com/users/iandanforth/repos", "site_admin": false, "starred_url": "https://api.github.com/users/iandanforth/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/iandanforth/subscriptions", "type": "User", "url": "https://api.github.com/users/iandanforth", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2012-03-19T01:13:54Z
2021-09-08T14:01:07Z
2012-03-19T02:04:56Z
CONTRIBUTOR
resolved
I'm including requests as part of a project I'm working on and noticed that Sphinx complains about **kwargs unless the stars are escaped. If you want them these commits fix that.
{ "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/497/reactions" }
https://api.github.com/repos/psf/requests/issues/497/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/497.diff", "html_url": "https://github.com/psf/requests/pull/497", "merged_at": "2012-03-19T02:04:56Z", "patch_url": "https://github.com/psf/requests/pull/497.patch", "url": "https://api.github.com/repos/psf/requests/pulls/497" }
true
[ "Awesome, thanks!\n" ]
https://api.github.com/repos/psf/requests/issues/496
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/496/labels{/name}
https://api.github.com/repos/psf/requests/issues/496/comments
https://api.github.com/repos/psf/requests/issues/496/events
https://github.com/psf/requests/issues/496
3,703,636
MDU6SXNzdWUzNzAzNjM2
496
Response.ok raises Timeout Exception in safe_mode
{ "avatar_url": "https://avatars.githubusercontent.com/u/292606?v=4", "events_url": "https://api.github.com/users/spulec/events{/privacy}", "followers_url": "https://api.github.com/users/spulec/followers", "following_url": "https://api.github.com/users/spulec/following{/other_user}", "gists_url": "https://api.github.com/users/spulec/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/spulec", "id": 292606, "login": "spulec", "node_id": "MDQ6VXNlcjI5MjYwNg==", "organizations_url": "https://api.github.com/users/spulec/orgs", "received_events_url": "https://api.github.com/users/spulec/received_events", "repos_url": "https://api.github.com/users/spulec/repos", "site_admin": false, "starred_url": "https://api.github.com/users/spulec/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/spulec/subscriptions", "type": "User", "url": "https://api.github.com/users/spulec", "user_view_type": "public" }
[ { "color": "e10c02", "default": false, "description": null, "id": 117744, "name": "Bug", "node_id": "MDU6TGFiZWwxMTc3NDQ=", "url": "https://api.github.com/repos/psf/requests/labels/Bug" }, { "color": "0b02e1", "default": false, "description": null, "id": 191274, "name": "Contributor Friendly", "node_id": "MDU6TGFiZWwxOTEyNzQ=", "url": "https://api.github.com/repos/psf/requests/labels/Contributor%20Friendly" } ]
closed
true
null
[]
null
2
2012-03-19T00:21:18Z
2021-09-09T09:00:38Z
2012-04-06T01:45:25Z
CONTRIBUTOR
resolved
``` python >>> import requests >>> requests.__version__ '0.10.8' >>> res = requests.get("http://localhost:8000/", timeout=1, config={'safe_mode': True}) >>> res.ok Traceback (most recent call last): File "<console>", line 1, in <module> File "../requests/models.py", line 650, in ok self.raise_for_status() File "../requests/models.py", line 800, in raise_for_status raise self.error Timeout: Request timed out. >>> ``` This certainly feels unintuitive as a user. It should probably always return a boolean. A simple solution is to have raise_for_status catch RequestException instead of just HTTPError, but I'm not sure if that would have other implications.
{ "avatar_url": "https://avatars.githubusercontent.com/u/292606?v=4", "events_url": "https://api.github.com/users/spulec/events{/privacy}", "followers_url": "https://api.github.com/users/spulec/followers", "following_url": "https://api.github.com/users/spulec/following{/other_user}", "gists_url": "https://api.github.com/users/spulec/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/spulec", "id": 292606, "login": "spulec", "node_id": "MDQ6VXNlcjI5MjYwNg==", "organizations_url": "https://api.github.com/users/spulec/orgs", "received_events_url": "https://api.github.com/users/spulec/received_events", "repos_url": "https://api.github.com/users/spulec/repos", "site_admin": false, "starred_url": "https://api.github.com/users/spulec/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/spulec/subscriptions", "type": "User", "url": "https://api.github.com/users/spulec", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/496/reactions" }
https://api.github.com/repos/psf/requests/issues/496/timeline
null
completed
null
null
false
[ "This is definitely a bug.\n", "Merged!\n" ]
https://api.github.com/repos/psf/requests/issues/495
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/495/labels{/name}
https://api.github.com/repos/psf/requests/issues/495/comments
https://api.github.com/repos/psf/requests/issues/495/events
https://github.com/psf/requests/issues/495
3,703,486
MDU6SXNzdWUzNzAzNDg2
495
requests fails on request.get call in Google App Engine python environment
{ "avatar_url": "https://avatars.githubusercontent.com/u/23572?v=4", "events_url": "https://api.github.com/users/rdixit/events{/privacy}", "followers_url": "https://api.github.com/users/rdixit/followers", "following_url": "https://api.github.com/users/rdixit/following{/other_user}", "gists_url": "https://api.github.com/users/rdixit/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/rdixit", "id": 23572, "login": "rdixit", "node_id": "MDQ6VXNlcjIzNTcy", "organizations_url": "https://api.github.com/users/rdixit/orgs", "received_events_url": "https://api.github.com/users/rdixit/received_events", "repos_url": "https://api.github.com/users/rdixit/repos", "site_admin": false, "starred_url": "https://api.github.com/users/rdixit/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/rdixit/subscriptions", "type": "User", "url": "https://api.github.com/users/rdixit", "user_view_type": "public" }
[ { "color": "fbca04", "default": false, "description": null, "id": 615414998, "name": "GAE Support", "node_id": "MDU6TGFiZWw2MTU0MTQ5OTg=", "url": "https://api.github.com/repos/psf/requests/labels/GAE%20Support" } ]
closed
true
null
[]
null
0
2012-03-18T23:52:27Z
2021-09-08T09:00:49Z
2012-07-27T05:59:57Z
NONE
resolved
Duplicate: http://stackoverflow.com/questions/9762685/using-the-requests-python-library-in-google-app-engine Google App Engine is used by a lot of developers. I use the python environment myself. It's sandboxed and can't rely on any non-Python code. It also has other restrictions (for example, you need to use this patched version of urllib3 https://github.com/shazow/urllib3/issues/61.) I can successfully > > > import requests but then > > > response = requests.get('someurl') fails with the following traceback. Does anyone know what's going on? Traceback (most recent call last): File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/ext/admin/init.py", line 317, in post exec(compiled_code, globals()) File "", line 6, in File "/Users/Rohan/Dropbox/MuktiTechnologiesINC/MuktiTechnologies/GAE/humanmictweet/GAE/libraries/requests/api.py", line 52, in get return request('get', url, *_kwargs) File "/Users/Rohan/Dropbox/MuktiTechnologiesINC/MuktiTechnologies/GAE/humanmictweet/GAE/libraries/requests/api.py", line 40, in request return s.request(method=method, url=url, *_kwargs) File "/Users/Rohan/Dropbox/MuktiTechnologiesINC/MuktiTechnologies/GAE/humanmictweet/GAE/libraries/requests/sessions.py", line 208, in request r.send(prefetch=prefetch) File "/Users/Rohan/Dropbox/MuktiTechnologiesINC/MuktiTechnologies/GAE/humanmictweet/GAE/libraries/requests/models.py", line 458, in send self.auth = get_netrc_auth(url) File "/Users/Rohan/Dropbox/MuktiTechnologiesINC/MuktiTechnologies/GAE/humanmictweet/GAE/libraries/requests/utils.py", line 43, in get_netrc_auth for loc in locations: File "/Users/Rohan/Dropbox/MuktiTechnologiesINC/MuktiTechnologies/GAE/humanmictweet/GAE/libraries/requests/utils.py", line 40, in locations = (os.path.expanduser('~/{0}'.format(f)) for f in NETRC_FILES) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/posixpath.py", line 260, in expanduser userhome = pwd.getpwuid(os.getuid()).pw_dir AttributeError: 'module' object has no attribute 'getuid'
{ "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/495/reactions" }
https://api.github.com/repos/psf/requests/issues/495/timeline
null
completed
null
null
false
[]
https://api.github.com/repos/psf/requests/issues/494
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/494/labels{/name}
https://api.github.com/repos/psf/requests/issues/494/comments
https://api.github.com/repos/psf/requests/issues/494/events
https://github.com/psf/requests/pull/494
3,702,018
MDExOlB1bGxSZXF1ZXN0MTAwMzU2NQ==
494
Add quickstart doc and example for passing parameters in a GET request
{ "avatar_url": "https://avatars.githubusercontent.com/u/94069?v=4", "events_url": "https://api.github.com/users/JDrosdeck/events{/privacy}", "followers_url": "https://api.github.com/users/JDrosdeck/followers", "following_url": "https://api.github.com/users/JDrosdeck/following{/other_user}", "gists_url": "https://api.github.com/users/JDrosdeck/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/JDrosdeck", "id": 94069, "login": "JDrosdeck", "node_id": "MDQ6VXNlcjk0MDY5", "organizations_url": "https://api.github.com/users/JDrosdeck/orgs", "received_events_url": "https://api.github.com/users/JDrosdeck/received_events", "repos_url": "https://api.github.com/users/JDrosdeck/repos", "site_admin": false, "starred_url": "https://api.github.com/users/JDrosdeck/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/JDrosdeck/subscriptions", "type": "User", "url": "https://api.github.com/users/JDrosdeck", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2012-03-18T19:41:38Z
2021-09-08T14:01:07Z
2012-03-19T02:07:31Z
CONTRIBUTOR
resolved
I added some documentation on passing parameters in a get request. I didn't see it documented anywhere else and had to dig through the source to figure out the argument.
{ "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/494/reactions" }
https://api.github.com/repos/psf/requests/issues/494/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/494.diff", "html_url": "https://github.com/psf/requests/pull/494", "merged_at": "2012-03-19T02:07:31Z", "patch_url": "https://github.com/psf/requests/pull/494.patch", "url": "https://api.github.com/repos/psf/requests/pulls/494" }
true
[ "Love it. Thanks!\n" ]
https://api.github.com/repos/psf/requests/issues/493
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/493/labels{/name}
https://api.github.com/repos/psf/requests/issues/493/comments
https://api.github.com/repos/psf/requests/issues/493/events
https://github.com/psf/requests/pull/493
3,688,584
MDExOlB1bGxSZXF1ZXN0OTk5MTYw
493
Adds support for Google App Engine
{ "avatar_url": "https://avatars.githubusercontent.com/u/132355?v=4", "events_url": "https://api.github.com/users/singingwolfboy/events{/privacy}", "followers_url": "https://api.github.com/users/singingwolfboy/followers", "following_url": "https://api.github.com/users/singingwolfboy/following{/other_user}", "gists_url": "https://api.github.com/users/singingwolfboy/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/singingwolfboy", "id": 132355, "login": "singingwolfboy", "node_id": "MDQ6VXNlcjEzMjM1NQ==", "organizations_url": "https://api.github.com/users/singingwolfboy/orgs", "received_events_url": "https://api.github.com/users/singingwolfboy/received_events", "repos_url": "https://api.github.com/users/singingwolfboy/repos", "site_admin": false, "starred_url": "https://api.github.com/users/singingwolfboy/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/singingwolfboy/subscriptions", "type": "User", "url": "https://api.github.com/users/singingwolfboy", "user_view_type": "public" }
[]
closed
true
null
[]
null
12
2012-03-16T20:11:53Z
2021-09-09T00:01:14Z
2012-03-17T19:15:35Z
NONE
resolved
Issue #194
{ "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/493/reactions" }
https://api.github.com/repos/psf/requests/issues/493/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/493.diff", "html_url": "https://github.com/psf/requests/pull/493", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/493.patch", "url": "https://api.github.com/repos/psf/requests/pulls/493" }
true
[ "I'd be happy to accept a pull request that works with 2.6–3.2 (I know App Engine supports 2.7), but the urllib3 changes need to occur in the urllib3 repository.\n", "There are several problems with this pull request:\n- Attempts to reintroduce Python 2.5 support while breaking Python 3 support.\n - Removes usage of bytes\n - Removes new exception syntax\n - Backports LifoQueue which is unnecessary since urllib3 works fine with standard Queue when Lifo is not available.\n- Removes is_connection_dropped which will regress several important bugs in non-AppEngine environments. A better solution is to check if select is available and pass if it's not.\n- Some weird getattr stuff in the set_cert method, not sure I understand what it's doing and why.\n\nOverall it makes urllib3 and Requests very specific to Python 2.5 and AppEngine. I'm not a fan of this. I'd say Python 2.6+ and Python 3+ support is more important than AppEngine, but I'm confident we can do a better job to support AppEngine without breaking everything in the process.\n", "Interestingly 2.5 support isn't even necessary for App Engine, which has had a good Python 2.7 runtime for a while now. (The 2.5 runtime is single-threaded CGI, so it requires many more instances to handle any significant request volume; in other words, it is legacy).\n", "Urllib3 supports app engine now.\n", ":cake:\n", "Btw, @kennethreitz: Requests still does not support AppEngine, since you're depending on various filesystem things for configuration magic that AppEngine doesn't have. Not sure if you want to reopen this bug.\n", "@shazow those should all be supplementary. I guess I should fire up an app engine app and find out :)\n", "@kennethreitz Here's a failure for example: http://stackoverflow.com/questions/9762685/using-the-requests-python-library-in-google-app-engine/9763217\n", "I wasn't expecting this pull request to be accepted: I simply submitted it for other people to take a look at. I need `requests` to work with Python 2.5 on App Engine, which is why I made some of the changes I did. I'm happy to create a separate pull request to make `requests` run on Python 2.7 on App Engine without breaking forwards-compatibility, once the updated `urllib3` code is pulled in: I'm not sure what the protocol is for that.\n", "If anyone cares, this would still be awesome.\n", "yeah, it would still be appreciated! @singingwolfboy, is requests using the 2.5 environment functional on App Engine as is..?\n", "@rdixit It was working when last I touched my fork. I haven't touched it in a _long_ time, though.\n" ]
https://api.github.com/repos/psf/requests/issues/492
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/492/labels{/name}
https://api.github.com/repos/psf/requests/issues/492/comments
https://api.github.com/repos/psf/requests/issues/492/events
https://github.com/psf/requests/issues/492
3,684,979
MDU6SXNzdWUzNjg0OTc5
492
Adding headers to a request causes .get() to not follow redirects
{ "avatar_url": "https://avatars.githubusercontent.com/u/627790?v=4", "events_url": "https://api.github.com/users/alexkehayias/events{/privacy}", "followers_url": "https://api.github.com/users/alexkehayias/followers", "following_url": "https://api.github.com/users/alexkehayias/following{/other_user}", "gists_url": "https://api.github.com/users/alexkehayias/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/alexkehayias", "id": 627790, "login": "alexkehayias", "node_id": "MDQ6VXNlcjYyNzc5MA==", "organizations_url": "https://api.github.com/users/alexkehayias/orgs", "received_events_url": "https://api.github.com/users/alexkehayias/received_events", "repos_url": "https://api.github.com/users/alexkehayias/repos", "site_admin": false, "starred_url": "https://api.github.com/users/alexkehayias/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/alexkehayias/subscriptions", "type": "User", "url": "https://api.github.com/users/alexkehayias", "user_view_type": "public" }
[]
closed
true
null
[]
null
4
2012-03-16T16:22:12Z
2021-09-09T09:00:42Z
2012-03-16T16:35:20Z
NONE
resolved
The GET request is not following redirects when setting a header even with allow_redirects set to True. In this example setting a header manually for the user-agent causes the request to not follow redirects. I would expect that even with setting headers it would give the same output as not setting a header. ``` url = "http://t.co/ms7J7HJ0" r = requests.get(url) r.url >>> u'http://www.inc.com/magazine/20070501/column-guest.html' headers = { 'User-Agent' : 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/535.21 (KHTML, like Gecko) Chrome/19.0.1042.0 Safari/535.21' } r = requests.get(url, headers=headers, allow_redirects=True) r.url >>> u'http://t.co/ms7J7HJ0' ```
{ "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/492/reactions" }
https://api.github.com/repos/psf/requests/issues/492/timeline
null
completed
null
null
false
[ "What you're actually seeing here is that `t.co` is actually doing an HTTP redirect for scripts and a JavaScript Location redirect (in HTML) for browsers :)\n", "Ok so by setting user-agent header I'm getting the js redirect, but it does nothing since it's not a real browser? Just trying to understand the behavior. Is that how bit.ly works as well?\n", "Exactly. I didn't know this until just now ;)\n\nIf you look at the response.content of the second request there you'll see :)\n", "ok cool, makes sense. Thanks!\n" ]
https://api.github.com/repos/psf/requests/issues/491
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/491/labels{/name}
https://api.github.com/repos/psf/requests/issues/491/comments
https://api.github.com/repos/psf/requests/issues/491/events
https://github.com/psf/requests/pull/491
3,683,919
MDExOlB1bGxSZXF1ZXN0OTk3MTIw
491
Remove redundant generator for chunked transfer encoding
{ "avatar_url": "https://avatars.githubusercontent.com/u/1220295?v=4", "events_url": "https://api.github.com/users/machalekj/events{/privacy}", "followers_url": "https://api.github.com/users/machalekj/followers", "following_url": "https://api.github.com/users/machalekj/following{/other_user}", "gists_url": "https://api.github.com/users/machalekj/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/machalekj", "id": 1220295, "login": "machalekj", "node_id": "MDQ6VXNlcjEyMjAyOTU=", "organizations_url": "https://api.github.com/users/machalekj/orgs", "received_events_url": "https://api.github.com/users/machalekj/received_events", "repos_url": "https://api.github.com/users/machalekj/repos", "site_admin": false, "starred_url": "https://api.github.com/users/machalekj/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/machalekj/subscriptions", "type": "User", "url": "https://api.github.com/users/machalekj", "user_view_type": "public" }
[]
closed
true
null
[]
null
3
2012-03-16T15:29:37Z
2021-09-08T14:01:06Z
2012-03-19T02:16:23Z
NONE
resolved
Generator for non-chunked encoding uses method read of httplib.HTTPResponse which also checks and correctly handles chunked encoding.
{ "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/491/reactions" }
https://api.github.com/repos/psf/requests/issues/491/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/491.diff", "html_url": "https://github.com/psf/requests/pull/491", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/491.patch", "url": "https://api.github.com/repos/psf/requests/pulls/491" }
true
[ " @ronnypfannsch ?\n", "Actually this also fix at least one bug resulting from interfering HTTPResponse internals: I cannot tell you the principle exactly, but for some requests with chunked encoding and empty body like method HEAD, it keeps hanging when you try to access property content:\n\nimport requests\nr = requests.head('http://www.httpwatch.com/httpgallery/chunked/'\nr.content\n", "Thanks!\n" ]
https://api.github.com/repos/psf/requests/issues/490
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/490/labels{/name}
https://api.github.com/repos/psf/requests/issues/490/comments
https://api.github.com/repos/psf/requests/issues/490/events
https://github.com/psf/requests/issues/490
3,681,501
MDU6SXNzdWUzNjgxNTAx
490
Access to response.content fails with response hook
{ "avatar_url": "https://avatars.githubusercontent.com/u/1542066?v=4", "events_url": "https://api.github.com/users/dorvak/events{/privacy}", "followers_url": "https://api.github.com/users/dorvak/followers", "following_url": "https://api.github.com/users/dorvak/following{/other_user}", "gists_url": "https://api.github.com/users/dorvak/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/dorvak", "id": 1542066, "login": "dorvak", "node_id": "MDQ6VXNlcjE1NDIwNjY=", "organizations_url": "https://api.github.com/users/dorvak/orgs", "received_events_url": "https://api.github.com/users/dorvak/received_events", "repos_url": "https://api.github.com/users/dorvak/repos", "site_admin": false, "starred_url": "https://api.github.com/users/dorvak/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/dorvak/subscriptions", "type": "User", "url": "https://api.github.com/users/dorvak", "user_view_type": "public" }
[]
closed
true
null
[]
null
3
2012-03-16T12:34:38Z
2021-09-09T07:05:26Z
2012-07-27T05:59:29Z
NONE
resolved
Trying to access the response.contents in an async setting and, f.e. pass them to a variable, fails somehow: Traceback (most recent call last): File "build/bdist.macosx-10.6-x86_64/egg/gevent/greenlet.py", line 390, in run result = self._run(_self.args, *_self.kwargs) File "build/bdist.macosx-10.6-x86_64/egg/requests/models.py", line 569, in send self.response.content AttributeError: 'int' object has no attribute 'content' <Greenlet at 0x102584eb0: <bound method Request.send of <Request [GET]>>(prefetch=True)> failed with AttributeError However, printing the response via hook methods works correct...
{ "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/490/reactions" }
https://api.github.com/repos/psf/requests/issues/490/timeline
null
completed
null
null
false
[ "I ran into this today where if the function called by hook returns something it causes this attribute error.\n\ni.e. \n\n```\ndef good(x):\n print(x.text)\n\ndef bad(x)\n return x.text\n```\n\nThis is more just confirmation. I don't know if this is expected behaviour...\n", "I have this problem, too. \n\nI am using grequests to send POST requests to an external API, which gives me a nice speedup. However, when I use a hook method and access response.text, this happens:\n\nTraceback (most recent call last):\n File \"/python2.7/site-packages/gevent/greenlet.py\", line 328, in run\n result = self._run(_self.args, *_self.kwargs)\n File \"python2.7/site-packages/requests/models.py\", line 630, in send\n self.response.content\nAttributeError: 'str' object has no attribute 'content'\n<Greenlet at 0x10143e5f0: <bound method Request.send of <Request [POST]>>(prefetch=True)> failed with AttributeError\n\nDespite this message, the code still works. \n", "I have experimented with different ways of setting prefetch to False. This makes no difference, the same error still appears.\n\nSimply commenting out the offending line solves my particular problem. My hook method does everything I want with the response so I don't need this. \n\n```\n # If prefetch is True, mark content as consumed.\n if prefetch or self.prefetch:\n # Save the response.\n #self.response.content\n pass\n```\n\nSomeone with a better grasp of the overall design should probably take a look at this.\n" ]
https://api.github.com/repos/psf/requests/issues/489
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/489/labels{/name}
https://api.github.com/repos/psf/requests/issues/489/comments
https://api.github.com/repos/psf/requests/issues/489/events
https://github.com/psf/requests/pull/489
3,676,191
MDExOlB1bGxSZXF1ZXN0OTk0MDEy
489
fixing link to AUTHORS in README
{ "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
1
2012-03-16T01:05:13Z
2021-09-08T14:01:05Z
2012-03-16T01:13:26Z
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/489/reactions" }
https://api.github.com/repos/psf/requests/issues/489/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/489.diff", "html_url": "https://github.com/psf/requests/pull/489", "merged_at": "2012-03-16T01:13:26Z", "patch_url": "https://github.com/psf/requests/pull/489.patch", "url": "https://api.github.com/repos/psf/requests/pulls/489" }
true
[ "Thanks!\n" ]
https://api.github.com/repos/psf/requests/issues/488
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/488/labels{/name}
https://api.github.com/repos/psf/requests/issues/488/comments
https://api.github.com/repos/psf/requests/issues/488/events
https://github.com/psf/requests/pull/488
3,671,108
MDExOlB1bGxSZXF1ZXN0OTkxNzI0
488
Excluding select from the monkey patching that gevent does to allow sele...
{ "avatar_url": "https://avatars.githubusercontent.com/u/64894?v=4", "events_url": "https://api.github.com/users/newmaniese/events{/privacy}", "followers_url": "https://api.github.com/users/newmaniese/followers", "following_url": "https://api.github.com/users/newmaniese/following{/other_user}", "gists_url": "https://api.github.com/users/newmaniese/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/newmaniese", "id": 64894, "login": "newmaniese", "node_id": "MDQ6VXNlcjY0ODk0", "organizations_url": "https://api.github.com/users/newmaniese/orgs", "received_events_url": "https://api.github.com/users/newmaniese/received_events", "repos_url": "https://api.github.com/users/newmaniese/repos", "site_admin": false, "starred_url": "https://api.github.com/users/newmaniese/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/newmaniese/subscriptions", "type": "User", "url": "https://api.github.com/users/newmaniese", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2012-03-15T18:42:57Z
2021-09-08T23:08:14Z
2012-03-19T02:08:51Z
CONTRIBUTOR
resolved
...ct.poll and requests.async in the same project Fix for issue #487, including a regression test that checks the existence of select.poll before and after loading requests.async.
{ "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/488/reactions" }
https://api.github.com/repos/psf/requests/issues/488/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/488.diff", "html_url": "https://github.com/psf/requests/pull/488", "merged_at": "2012-03-19T02:08:51Z", "patch_url": "https://github.com/psf/requests/pull/488.patch", "url": "https://api.github.com/repos/psf/requests/pulls/488" }
true
[ "Thanks for the fix!\n" ]
https://api.github.com/repos/psf/requests/issues/487
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/487/labels{/name}
https://api.github.com/repos/psf/requests/issues/487/comments
https://api.github.com/repos/psf/requests/issues/487/events
https://github.com/psf/requests/issues/487
3,669,946
MDU6SXNzdWUzNjY5OTQ2
487
Use of requests.async removes select.poll
{ "avatar_url": "https://avatars.githubusercontent.com/u/64894?v=4", "events_url": "https://api.github.com/users/newmaniese/events{/privacy}", "followers_url": "https://api.github.com/users/newmaniese/followers", "following_url": "https://api.github.com/users/newmaniese/following{/other_user}", "gists_url": "https://api.github.com/users/newmaniese/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/newmaniese", "id": 64894, "login": "newmaniese", "node_id": "MDQ6VXNlcjY0ODk0", "organizations_url": "https://api.github.com/users/newmaniese/orgs", "received_events_url": "https://api.github.com/users/newmaniese/received_events", "repos_url": "https://api.github.com/users/newmaniese/repos", "site_admin": false, "starred_url": "https://api.github.com/users/newmaniese/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/newmaniese/subscriptions", "type": "User", "url": "https://api.github.com/users/newmaniese", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2012-03-15T17:33:05Z
2021-09-09T09:00:41Z
2012-03-19T02:08:38Z
CONTRIBUTOR
resolved
You can reproduce this: ``` In [1]: import select; select.poll Out[1]: <function select.poll> In [2]: from requests import async In [3]: import select; select.poll --------------------------------------------------------------------------- AttributeError Traceback (most recent call last) /opt/VirtualEnvs/weather-daemon/src/wxcdc/wxcdc/<ipython-input-3-a25f519ae2a6> in <module>() ----> 1 import select; select.poll AttributeError: 'module' object has no attribute 'poll' ``` The line that seems to be causing this is the monkey patching done in async: https://github.com/kennethreitz/requests/blob/develop/requests/async.py#L20 ``` curious_george.patch_all(thread=False) ``` We can remove the patching of select from this and things seem to work. Do we need to patch select? Should we look into what else we don't need to patch in this documentation: http://www.gevent.org/gevent.monkey.html ? ``` curious_george.patch_all(thread=False, select=False) ```
{ "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/487/reactions" }
https://api.github.com/repos/psf/requests/issues/487/timeline
null
completed
null
null
false
[ "Wow, that's bizarre. Thanks.\n" ]
https://api.github.com/repos/psf/requests/issues/486
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/486/labels{/name}
https://api.github.com/repos/psf/requests/issues/486/comments
https://api.github.com/repos/psf/requests/issues/486/events
https://github.com/psf/requests/pull/486
3,660,417
MDExOlB1bGxSZXF1ZXN0OTg3MzM3
486
Fix issue #484
{ "avatar_url": "https://avatars.githubusercontent.com/u/778344?v=4", "events_url": "https://api.github.com/users/pinkerton/events{/privacy}", "followers_url": "https://api.github.com/users/pinkerton/followers", "following_url": "https://api.github.com/users/pinkerton/following{/other_user}", "gists_url": "https://api.github.com/users/pinkerton/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/pinkerton", "id": 778344, "login": "pinkerton", "node_id": "MDQ6VXNlcjc3ODM0NA==", "organizations_url": "https://api.github.com/users/pinkerton/orgs", "received_events_url": "https://api.github.com/users/pinkerton/received_events", "repos_url": "https://api.github.com/users/pinkerton/repos", "site_admin": false, "starred_url": "https://api.github.com/users/pinkerton/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/pinkerton/subscriptions", "type": "User", "url": "https://api.github.com/users/pinkerton", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2012-03-15T03:07:46Z
2021-09-08T14:01:06Z
2012-03-15T03:08:17Z
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/486/reactions" }
https://api.github.com/repos/psf/requests/issues/486/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/486.diff", "html_url": "https://github.com/psf/requests/pull/486", "merged_at": "2012-03-15T03:08:17Z", "patch_url": "https://github.com/psf/requests/pull/486.patch", "url": "https://api.github.com/repos/psf/requests/pulls/486" }
true
[ "thanks!\n" ]
https://api.github.com/repos/psf/requests/issues/485
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/485/labels{/name}
https://api.github.com/repos/psf/requests/issues/485/comments
https://api.github.com/repos/psf/requests/issues/485/events
https://github.com/psf/requests/pull/485
3,658,214
MDExOlB1bGxSZXF1ZXN0OTg2Mzky
485
Client SSL Cert Support
{ "avatar_url": "https://avatars.githubusercontent.com/u/877347?v=4", "events_url": "https://api.github.com/users/chadnickbok/events{/privacy}", "followers_url": "https://api.github.com/users/chadnickbok/followers", "following_url": "https://api.github.com/users/chadnickbok/following{/other_user}", "gists_url": "https://api.github.com/users/chadnickbok/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/chadnickbok", "id": 877347, "login": "chadnickbok", "node_id": "MDQ6VXNlcjg3NzM0Nw==", "organizations_url": "https://api.github.com/users/chadnickbok/orgs", "received_events_url": "https://api.github.com/users/chadnickbok/received_events", "repos_url": "https://api.github.com/users/chadnickbok/repos", "site_admin": false, "starred_url": "https://api.github.com/users/chadnickbok/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/chadnickbok/subscriptions", "type": "User", "url": "https://api.github.com/users/chadnickbok", "user_view_type": "public" }
[]
closed
true
null
[]
null
5
2012-03-14T23:01:49Z
2021-09-08T14:01:05Z
2012-03-15T00:29:39Z
NONE
resolved
Exposed key_file and cert_file in requests, to support https client certificates.
{ "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/485/reactions" }
https://api.github.com/repos/psf/requests/issues/485/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/485.diff", "html_url": "https://github.com/psf/requests/pull/485", "merged_at": "2012-03-15T00:29:39Z", "patch_url": "https://github.com/psf/requests/pull/485.patch", "url": "https://api.github.com/repos/psf/requests/pulls/485" }
true
[ "Ideal:\n\n``` python\n# Default, CA Bundle, like browser. Today.\nrequests.get(..., verify=True)\n\n# No SSL check. Today.\nrequests.get(..., verify=False)\n\n# Private PEM\nrequests.get(..., cert='/path/to.pem')\n\n# Private Cert / Key\nrequests.get(..., cert=('cert', 'key'))\n\n# No SSL check.\nrequests.get(..., cert='/path/to.pem', verify=False)\n```\n", "My apologies, but I'm not currently in a position to be able to supply a good, or repeatable, test-case for this new functionality, as it requires a correctly configured server.\n\nI've tested this in my own environment, and it suits my needs well enough; if there are any issues, please let me know.\n", "Same. I trust that it works properly though. If it doesn't, it's urllib3's fault :)\n", ":cake:\n", "Confirming - works perfectly :) Thank you very much.\n" ]
https://api.github.com/repos/psf/requests/issues/484
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/484/labels{/name}
https://api.github.com/repos/psf/requests/issues/484/comments
https://api.github.com/repos/psf/requests/issues/484/events
https://github.com/psf/requests/issues/484
3,649,094
MDU6SXNzdWUzNjQ5MDk0
484
_LegalChars should include more characters.
{ "avatar_url": "https://avatars.githubusercontent.com/u/1536813?v=4", "events_url": "https://api.github.com/users/listeng/events{/privacy}", "followers_url": "https://api.github.com/users/listeng/followers", "following_url": "https://api.github.com/users/listeng/following{/other_user}", "gists_url": "https://api.github.com/users/listeng/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/listeng", "id": 1536813, "login": "listeng", "node_id": "MDQ6VXNlcjE1MzY4MTM=", "organizations_url": "https://api.github.com/users/listeng/orgs", "received_events_url": "https://api.github.com/users/listeng/received_events", "repos_url": "https://api.github.com/users/listeng/repos", "site_admin": false, "starred_url": "https://api.github.com/users/listeng/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/listeng/subscriptions", "type": "User", "url": "https://api.github.com/users/listeng", "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
3
2012-03-14T14:27:47Z
2021-09-06T00:06:33Z
2012-06-15T18:41:59Z
NONE
resolved
I found _LegalChars in monkeys.py file is not include "@" and it will output as Cookie: key="@abc" instead of Cookie: key=@abc so that the server can not recognize the key of cookies. I think maybe more characters should be including in _LegalChars.
{ "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/484/reactions" }
https://api.github.com/repos/psf/requests/issues/484/timeline
null
completed
null
null
false
[ "The whole reason that file exists is to add more and more _LegalChars, one at a time. :) \n\nSend a pull request!\n", "This code looks isolated now:\n\n```\n[shivaram@good-fortune ~/workspace/requests]$ git grep monkeys\nrequests/packages/oreos/core.py:from .monkeys import SimpleCookie\nrequests/packages/oreos/monkeys.py:oreos.monkeys\n```\n", "Oreos has been removed.\n" ]
https://api.github.com/repos/psf/requests/issues/483
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/483/labels{/name}
https://api.github.com/repos/psf/requests/issues/483/comments
https://api.github.com/repos/psf/requests/issues/483/events
https://github.com/psf/requests/pull/483
3,640,901
MDExOlB1bGxSZXF1ZXN0OTc5MDE4
483
removing unused import
{ "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
2012-03-14T00:12:50Z
2021-08-31T00:07:28Z
2012-03-16T01:14: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/483/reactions" }
https://api.github.com/repos/psf/requests/issues/483/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/483.diff", "html_url": "https://github.com/psf/requests/pull/483", "merged_at": "2012-03-16T01:14:35Z", "patch_url": "https://github.com/psf/requests/pull/483.patch", "url": "https://api.github.com/repos/psf/requests/pulls/483" }
true
[ "oops ;)\n" ]
https://api.github.com/repos/psf/requests/issues/482
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/482/labels{/name}
https://api.github.com/repos/psf/requests/issues/482/comments
https://api.github.com/repos/psf/requests/issues/482/events
https://github.com/psf/requests/issues/482
3,637,512
MDU6SXNzdWUzNjM3NTEy
482
Feature any http verb in docs
{ "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": "0b02e1", "default": false, "description": null, "id": 191274, "name": "Contributor Friendly", "node_id": "MDU6TGFiZWwxOTEyNzQ=", "url": "https://api.github.com/repos/psf/requests/labels/Contributor%20Friendly" } ]
closed
true
null
[]
null
10
2012-03-13T20:18:37Z
2014-06-26T01:47:26Z
2012-05-29T23:50:05Z
CONTRIBUTOR
null
{ "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/482/reactions" }
https://api.github.com/repos/psf/requests/issues/482/timeline
null
completed
null
null
false
[ "As @kennethreitz knows, I'm preparing to use requests in a different project, and was testing out the GitHub API. The following is something I did from the python command line interpreter:\n\n``` python\nimport requests\na = ('sigmavirus24', 'not_my_real_password')\nurl = 'https://api.github.com/repos/sigmavirus24/issues.py/issues/comments/4524692' # This no longer exists, you'll see why\ndata = u'{\"body\": \"Amend comment.\"}'\nr = requests.patch(url, data, auth=a)\n# Checked what GitHub returned (response code 200)\nr = requests.request('DELETE', url, auth=a)\n# GitHub responded with code 204 -- successful deletion of a comment on an issue.\n```\n", "@kennethreitz: Whereabouts in the docs did you want these? The only place that currently exists that looks suitable is docs/quickstart.rst, but that document is getting increasingly large. Should we consider busting the verbs out into a new file? Or are you happy to extend the quickstart? Either way, I'm happy to write these and add them into #619.\n", "Probably in the \"advanced\" section\n", "I love requests so much, thanks for your excellent work!\n", "Sounds great! I'll get right on it!\n", "@Fighter42 I don't know why you commented 11 times but this is already taken care of [here](http://docs.python-requests.org/en/latest/user/advanced/#http-verbs)\n", "I feed my cat!\n", "@RAINCEN Really? _Really?_\n", "@Lukasa the emails I received from @RAINCEN had the same message that @Fighter42 posted about 20 times (of which I deleted all but one). I have to wonder if these are just spam accounts or if perhaps this is related to [recent attempts to brute force passwords on accounts](https://github.com/blog/1698-weak-passwords-brute-forced). Regardless, it's probably advisable to just ignore everyone who makes similar comments on this issue. It's been closed for so long.\n", "github great\n" ]
https://api.github.com/repos/psf/requests/issues/481
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/481/labels{/name}
https://api.github.com/repos/psf/requests/issues/481/comments
https://api.github.com/repos/psf/requests/issues/481/events
https://github.com/psf/requests/issues/481
3,624,363
MDU6SXNzdWUzNjI0MzYz
481
LookupError when you read the text of pages with an unknown encoding
{ "avatar_url": "https://avatars.githubusercontent.com/u/112152?v=4", "events_url": "https://api.github.com/users/e98cuenc/events{/privacy}", "followers_url": "https://api.github.com/users/e98cuenc/followers", "following_url": "https://api.github.com/users/e98cuenc/following{/other_user}", "gists_url": "https://api.github.com/users/e98cuenc/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/e98cuenc", "id": 112152, "login": "e98cuenc", "node_id": "MDQ6VXNlcjExMjE1Mg==", "organizations_url": "https://api.github.com/users/e98cuenc/orgs", "received_events_url": "https://api.github.com/users/e98cuenc/received_events", "repos_url": "https://api.github.com/users/e98cuenc/repos", "site_admin": false, "starred_url": "https://api.github.com/users/e98cuenc/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/e98cuenc/subscriptions", "type": "User", "url": "https://api.github.com/users/e98cuenc", "user_view_type": "public" }
[]
closed
true
null
[]
null
4
2012-03-13T05:49:48Z
2021-09-09T09:00:44Z
2012-03-13T20:27:44Z
NONE
resolved
On one of the pages that I'm parsing I got: File "/usr/local/lib/python2.7/dist-packages/requests/models.py", line 777, in text content = str(self.content, encoding, errors='replace') LookupError: unknown encoding: ISO-LATIN-1 I think it would be more sensible to try a default encoding (utf-8 and windows-1252 as a fallback) when Python doesn't support the encoding defined in the page. Also, using encoding.lower().replace('-latin-', '-8859-') will go a long way fixing the common case of pages using iso-latin-N instead of iso-8859-N.
{ "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/481/reactions" }
https://api.github.com/repos/psf/requests/issues/481/timeline
null
completed
null
null
false
[ "duplicate of #338\n", "We currently have a pretty robust encoding detection system, but it's only a fallback for when the server doesn't specify an encoding.\n", "We're currently blindly trusting that the encoding that the server is responding with will exist. \n\nPerhaps a map of encodings (e.g. ISO-LATIN-1 => latin1) is best?\n", "Closing for #338\n" ]
https://api.github.com/repos/psf/requests/issues/480
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/480/labels{/name}
https://api.github.com/repos/psf/requests/issues/480/comments
https://api.github.com/repos/psf/requests/issues/480/events
https://github.com/psf/requests/issues/480
3,603,638
MDU6SXNzdWUzNjAzNjM4
480
utils.get_encoding_from_headers returns ISO-8859-1 incorrectly
{ "avatar_url": "https://avatars.githubusercontent.com/u/285920?v=4", "events_url": "https://api.github.com/users/umbrae/events{/privacy}", "followers_url": "https://api.github.com/users/umbrae/followers", "following_url": "https://api.github.com/users/umbrae/following{/other_user}", "gists_url": "https://api.github.com/users/umbrae/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/umbrae", "id": 285920, "login": "umbrae", "node_id": "MDQ6VXNlcjI4NTkyMA==", "organizations_url": "https://api.github.com/users/umbrae/orgs", "received_events_url": "https://api.github.com/users/umbrae/received_events", "repos_url": "https://api.github.com/users/umbrae/repos", "site_admin": false, "starred_url": "https://api.github.com/users/umbrae/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/umbrae/subscriptions", "type": "User", "url": "https://api.github.com/users/umbrae", "user_view_type": "public" }
[]
closed
true
null
[]
null
16
2012-03-11T21:25:16Z
2021-09-09T06:00:48Z
2012-07-27T06:05:05Z
CONTRIBUTOR
resolved
When I call get_encoding_from_headers on this url: http://thelastpsychiatrist.com/2012/02/my_fiancee_is_pushing_me_away.html The response is ISO-8859-1: ``` (Pdb) get_encoding_from_headers(self.response.headers) 'ISO-8859-1' ``` Even though the headers don't contain that characterset: ``` (Pdb) self.response.headers {'date': 'Sun, 11 Mar 2012 21:10:40 GMT', 'transfer-encoding': 'chunked', 'content-type': 'text/html', 'server': 'Apache/2.2.22'} ``` It looks like this was an intentional choice in the source, but this is problematic for me because, if I knew that the encoding was guessed, I'd want to check the HTML meta tag myself - which would then properly parse as UTF-8. I think the better solution for is to either return None explicitly, or provide a default kwarg param that people could set to an encoding manually if they wanted to. I can patch this if it sounds like a good solution.
{ "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/480/reactions" }
https://api.github.com/repos/psf/requests/issues/480/timeline
null
completed
null
null
false
[ "(Also, for the record, this is causing encoding errors for words like fiancée, which is how I noticed the discrepancy.)\n", "You actually can set an encoding manually today — it's just not very obvious/documented.\n\nHere's the workflow:\n\n```\nr = requests.get(...)\nr.encoding = 'myencoding'\n```\n\nThen, when you call `r.text`, that encoding will be used.\n\n---\n\nThe initial implementation of response encoding did take `meta` tags into consideration, but I decided to remove it to keep things within a small scope. In short, `meta` tags are HTML, not HTTP :)\n", "@kennethreitz If I'm understanding you, I don't think this issue is solved from my perspective. Let me give you my use case.\n\nWhen I fetch an HTML resource with requests, I want to parse the HTML with the encoding as it was intended. That means:\n1. Looking in the HTTP header.\n2. Looking in the meta tag.\n3. Making a dumb guess using something like chardet.\n\n_Setting_ the encoding on a request doesn't help me there, because I want to get the natural encoding response. And if it failed to get it from the headers, I can continue down the line and look at the meta tag.\n\nRight now in my code I'm working around this by just checking to see if requests responded with ISO-8859-1 and ignoring it because I don't have any guarantees it was actually there. The better solution for me would be for this method to return None.\n", "Ah, well Requests already makes a dumb guess using chardet if no header is specified. Hopefully that makes the meta tag parsing unnecessary. \n\n`r.encoding` is set automatically if the headers specify an encoding.\n\n``` python\nr = requests.get(...)\n\n# Check meta tags if no encoding was in headers\nf not r.encoding or r.encoding == 'ISO-8859-1':\n r.encoding=my_meta_parser(r)\n\n# If no encoding was returned, chardet will automatically be used.\n```\n\nAlso, `ISO-8859-1` is only used as a default if \"text\" is present in the content type. There's some weird RFC for that or something.\n", "Oh, I didn't realize that was to spec—Bizarre! In that case then I'll just keep my current workflow, which is essentially the same as the code chunk you've got up there. Thanks.\n", "For future reference to anyone who stumbles upon this, the spec is:\n\nhttp://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.7.1\n\n> The \"charset\" parameter is used with some media types to define the character set (section 3.4) of the data. When no explicit charset parameter is provided by the sender, media subtypes of the \"text\" type are defined to have a default charset value of \"ISO-8859-1\" when received via HTTP. Data in character sets other than \"ISO-8859-1\" or its subsets MUST be labeled with an appropriate charset value. See section 3.4.1 for compatibility problems.\n", "Excellent :)\n\nI really should document this stuff...\n", "I'm running into this issue as well. RFC2616 does that subtypes of text are defined to have a default charset value of ISO-8859-1. However, W3 also says\n\n> The HTTP protocol ([RFC2616], section 3.7.1) mentions ISO-8859-1 as a default character encoding when the \n> \"charset\" parameter is absent from the \"Content-Type\" header field. In practice, this recommendation has proved \n> useless because some servers don't allow a \"charset\" parameter to be sent, and others may not be configured to \n> send the parameter. Therefore, user agents must not assume any default value for the \"charset\" parameter.\n\nhttp://www.w3.org/TR/html4/charset.html#h-5.2.2\n\nIn practice, site admins seem to be pretty lazy about properly specifying an encoding in headers. The upshot is that for non-English language sites defaulting ISO-8859-1 will almost certainly be wrong. They go on to say\n\n> To sum up, conforming user agents must observe the following priorities when determining a document's character\n> encoding (from highest priority to lowest):\n> 1. An HTTP \"charset\" parameter in a \"Content-Type\" field.\n> 2. A META declaration with \"http-equiv\" set to \"Content-Type\" and a value set for \"charset\".\n> 3. The charset attribute set on an element that designates an external resource.\n\nSo then I think the more compliant thing to do would be to just drop the check for 'text' in Content-Type and fall back to the meta.\n", "While it's possible that guessing is wrong, we can't fall back to the META declaration because Requests doesn't parse HTML. That's really the job of the user, not Requests.\n", "I'm confident that my current character workflow is correct. \n\nHowever, I'm not against removing the 'text' default. \n", "That is, if I can be convinced :)\n", "Fair enough. :)\n\nFor HTML the value of encoding is going to be misleading so there should at least be \na big red sticker somewhere. The ISO-8859-1 default is a pretty obscure point that is going\nto be missed by most users of the library. In fact, ISO-8859-1 is probably not what was meant by the\nserver either. This seems out of keeping of the spirit of the rest of this package. \n\nThis also means that Request.encoding isn't even a good starting point if you are trying to get HTML\nbecause of the default behavior. (which is what .text does right now)\n\nFor .text the doc string basically says it will make its best effort to give you unicode. It even goes as\nfar as using chardet to make a guess. To do that but not run a regex against the code to check for\ncontent-type seems silly.\n\nWith the current behavior if someone requests a utf-8 encoded document from a server that neglects\nto put a content-type in the headers (which people may not even have control over) Request.text will mangle\nthe document. It will use the assumed ISO-8859-1 encoding, skipping chardet entirely, and just do\nstr(content, 'ISO-8859-1', errors='replace'). This basically makes Request.text useless. \n\nFor Request.text, something like below seems like a more appropriate way to guess. It would also be\nnice to have the guess_encoding function available in .utils\n\n``` python\n\ndef is_valid(charset, bytes):\n try:\n _ = bytes.decode(charset)\n except:\n return False\n return True\n\ndef guess_encoding(response):\n '''\n Guesses the encoding for a document in the following order:\n 1. content-type header\n 2. content type from <meta.. tags\n 3. content-type from chardet\n '''\n if 'content-type' in response.headers:\n content_type, params = cgi.parse_header(response.headers['content-type'])\n\n if 'charset' in params:\n charset = params['charset'].strip(\"'\\\"\")\n if is_valid(charset, response.content):\n return charset\n\n meta_encodings = requests.utils.get_encodings_from_content(response.content)\n for charset in meta_encodings:\n if is_valid(charset, response.content):\n return charset\n\n detected = chardet.detect(response.content)\n if detected:\n return detected['encoding']\n\n```\n", "No, requests is not an HTML library. We used to do meta tags and it was a mistake.\n", "That's totally reasonable, and I respect the decision to limit the scope of the library. But, please at least consider returning None when the character encoding is unspecified by the content-type. In practice, an unspecified content-type rarely actually implies ISO-8859-1. \n\nDoing that would at least allow someone processing HTML to determine that they need to do more work, and would lead to Response.text making use of chardet which is far more likely to produce the correct encoding. As it stands now Response.text is completely unreliable.\n\nEdit: Just to add, really returning unicode is basically impossible without deeper processing of the content. I'm not sure what the use case is for attempting to get unicode without checking this. The .text function should probably get the axe if it can't do that. Otherwise it is basically just offering people rides in a dynamite truck - it will probably get you there ok, unless you hit a pothole that is. \n", "One more thing to bug you further about this :)\n\nWhat if I added code making it so that if you set the value of r.encoding to a callable it would use that to resolve the encoding? Or maybe some sort of a hook? That would be pretty in-line with the behavior of encoding now without introducing the html specific code into the library, and would also be usable for other things like xml.\n", "We already have an extensive hook system:\n\nhttp://docs.python-requests.org/en/latest/user/advanced/#event-hooks\n" ]
https://api.github.com/repos/psf/requests/issues/479
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/479/labels{/name}
https://api.github.com/repos/psf/requests/issues/479/comments
https://api.github.com/repos/psf/requests/issues/479/events
https://github.com/psf/requests/issues/479
3,602,742
MDU6SXNzdWUzNjAyNzQy
479
Python 3: data dict is incorrectly encoded for multi-part file uploads
{ "avatar_url": "https://avatars.githubusercontent.com/u/94054?v=4", "events_url": "https://api.github.com/users/joelverhagen/events{/privacy}", "followers_url": "https://api.github.com/users/joelverhagen/followers", "following_url": "https://api.github.com/users/joelverhagen/following{/other_user}", "gists_url": "https://api.github.com/users/joelverhagen/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/joelverhagen", "id": 94054, "login": "joelverhagen", "node_id": "MDQ6VXNlcjk0MDU0", "organizations_url": "https://api.github.com/users/joelverhagen/orgs", "received_events_url": "https://api.github.com/users/joelverhagen/received_events", "repos_url": "https://api.github.com/users/joelverhagen/repos", "site_admin": false, "starred_url": "https://api.github.com/users/joelverhagen/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/joelverhagen/subscriptions", "type": "User", "url": "https://api.github.com/users/joelverhagen", "user_view_type": "public" }
[]
closed
true
null
[]
null
0
2012-03-11T19:02:03Z
2021-09-09T07:05:25Z
2012-07-27T06:00:40Z
NONE
resolved
**This problem is Python 3 specific.** I am performing this test on Python 3.2.2 and `requests` 0.10.8. Take a look at the following minimal example code. ``` python import requests import io response = requests.post("http://www.joelverhagen.com/sandbox/tests/upload.php", data = { "foo": "bar", "jibba": "jabba", }) print("-- WITHOUT UPLOAD --") print(response.text) exampleFile = io.StringIO("Hello, world.") exampleFile.seek(0) response = requests.post("http://www.joelverhagen.com/sandbox/tests/upload.php", data = { "foo": "bar", "jibba": "jabba", }, files = { "file": ("file.txt", exampleFile) }) print("-- WITH UPLOAD --") print(response.text) ``` The script being queries is on my own website, and I will leave it up until this issue is closed. The output is the following: ``` -- WITHOUT UPLOAD -- Array ( [jibba] => jabba [foo] => bar ) -- WITH UPLOAD -- Array ( [b'jibba'] => jabba [b'foo'] => bar ) ``` As you can see, the keys of the `data` keyword argument are not encoded correctly when there is a file upload. I have done some digging, and I have tracked down the problem. In **models.py**, there is a static method on the `Request` class called `_encode_params`. This encodes each of the values and keys to UTF-8 bytes using `.encode('utf-8')`. In Python 3, this results in the new `bytes` type, whereas in Python 2, a normal string was returned. This doesn't cause a problem until `urllib3`'s `encode_multipart_formdata` function (in **filepost.py**) uses the string formatting operator `%` and `%s` to concat the key into the request body. This basically ends up calling `str()` on the bytes object which is why we see the `b''` literal in the key name. I wasn't sure whether this is a problem with `urllib3` or `requests` because I'm not sure if [shazow](https://github.com/shazow/urllib3/tree/master/urllib3) want bytes or strings being sent to `encode_multipart_formdata`.
{ "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/479/reactions" }
https://api.github.com/repos/psf/requests/issues/479/timeline
null
completed
null
null
false
[]
https://api.github.com/repos/psf/requests/issues/478
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/478/labels{/name}
https://api.github.com/repos/psf/requests/issues/478/comments
https://api.github.com/repos/psf/requests/issues/478/events
https://github.com/psf/requests/pull/478
3,590,994
MDExOlB1bGxSZXF1ZXN0OTYwMjg3
478
SOCKS support
{ "avatar_url": "https://avatars.githubusercontent.com/u/651797?v=4", "events_url": "https://api.github.com/users/foxx/events{/privacy}", "followers_url": "https://api.github.com/users/foxx/followers", "following_url": "https://api.github.com/users/foxx/following{/other_user}", "gists_url": "https://api.github.com/users/foxx/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/foxx", "id": 651797, "login": "foxx", "node_id": "MDQ6VXNlcjY1MTc5Nw==", "organizations_url": "https://api.github.com/users/foxx/orgs", "received_events_url": "https://api.github.com/users/foxx/received_events", "repos_url": "https://api.github.com/users/foxx/repos", "site_admin": false, "starred_url": "https://api.github.com/users/foxx/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/foxx/subscriptions", "type": "User", "url": "https://api.github.com/users/foxx", "user_view_type": "public" }
[]
closed
true
null
[]
null
35
2012-03-09T22:41:37Z
2021-09-08T06:00:49Z
2012-05-08T05:05:26Z
NONE
resolved
Hi all, I've now managed to add proper SOCKS proxy and HTTPS/SSL proxy support (took me about 6 hours, but was well worth the effort) - SOCKS proxy support is done via a slightly modified SocksIpy. - All unit tests seem to pass fine (have included tests/test_proxies.py as it's own file, as the test will only pass if you have the necessary proxy servers running - obv.) - proxiesDict should be backwards compatible (have tested it with multiple values) - now accepts 'socks4://' and 'socks5':// - HTTPS/SSL proxy support uses the _tunnel() method exposed from httplib - HTTPS/SSL proxy support forcibly disables SSL certificate validation - Has been tested extensively against 'Burp Proxy' and 'dante-server' - DNS lookups are still performed by native socket() This code is going to be used extensively by one of our clients, so if we find any problems I'll let you know. Hope this helps! Cal --- Example usage: ``` # SOCKS5 proxy for HTTP/HTTPS proxiesDict = { 'http' : "socks5://1.2.3.4:1080", 'https' : "socks5://1.2.3.4:1080" } # SOCKS4 proxy for HTTP/HTTPS proxiesDict = { 'http' : "socks4://1.2.3.4:1080", 'https' : "socks4://1.2.3.4:1080" } # HTTP proxy for HTTP/HTTPS proxiesDict = { 'http' : "1.2.3.4:1080", 'https' : "1.2.3.4:1080" } ``` test_requests.py before modifications: ``` FAILED (failures=1, errors=14) ``` test_requests.py after modifications: ``` FAILED (failures=1, errors=14) ``` Here is the result of the test_proxies.py (slightly trimmed): ``` HTTPS via SOCKS5 ------------------------------------------------------------ <br><p>Your IP address is<br><b>173.255.xxx.xxx</b></p> HTTP via SOCKS5 ------------------------------------------------------------ <br><p>Your IP address is<br><b>173.255.xxx.xxx</b></p> HTTPS via HTTP Proxy ------------------------------------------------------------ <br><p>Your IP address is<br><b>89.238.xxx.xxx</b></p> HTTP via HTTP Proxy ------------------------------------------------------------ <br><p>Your IP address is<br><b>89.238.xxx.xxx</b></p> HTTPS via no proxy ------------------------------------------------------------ <br><p>Your IP address is<br><b>82.30.xxx.xxx</b></p> HTTP via no proxy ------------------------------------------------------------ <br><p>Your IP address is<br><b>82.30.xxx.xxx</b></p> ```
{ "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/478/reactions" }
https://api.github.com/repos/psf/requests/issues/478/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/478.diff", "html_url": "https://github.com/psf/requests/pull/478", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/478.patch", "url": "https://api.github.com/repos/psf/requests/pulls/478" }
true
[ "I was working on doing this, but got a bit tangled with how to integrate it with connectionpool.py. Thank you for your work, this is something that's been needed for a while.\n\nHowever, big warning: You are using an old and defective version of SocksiPy! If you run your test with SOCKS servers that do not respond, the program hangs indefinitely. This is due to a bug in __recvall(). If the socket sends no data, its while loop will run infinitely, so it needs a line like \"if not d: raise SomeError\"\n\nThe HTTP proxy negotiator has a similar bug, but it seems you're only using the SOCKS parts and sticking with requests' native HTTP proxy support.\n\nI recommend you look at the latest branch on my page: https://github.com/Anorov/PySocks\n\nIt's currently just a copy of the original maintainer's branch. They fixed the __recvall() bug, some other bugs, and also made it Py3k. I personally changed a few things that I have yet to commit, but most of them are just changing in the exception naming and fixing __negotiatehttp(), which is unnecessary for requests. So the current branch should be fine.\n\nOn a separate note, do persistent connections and keep-alives work properly through both SOCKS and HTTP proxies, in this fork? That is a major component that I've been fighting with when using SocksiPy in conjunction with other libraries (not requests though).\n", "Ahh, thanks for letting me know!\n\nAlthough I don't fully understand some of the bugs you have patched in socksipy, I can confirm that unit tests are still passing after applying your modifications - so I have pushed this change up.\n\nI've tried to make sure my patches fallback to previous behaviour where ever possible, and it only uses socksipy if it absolutely needs to.\n\nThanks for your help on this, if you can think of any other changes that should go up please let me know and I'd be happy to assist.\n\nCal\n", "Also @kennethreitz my apologies that this wasn't branched from the 'develop' branch, by the time I had realised it was too late. On the plus side, it seems master and develop were in sync at the time of forking.\n", "@Anorov just saw your question about keep-alive's. Currently, keep-alive's are forcibly disabled for SSL over HTTP proxy, however SOCKS4/5 and HTTP over HTTP proxy keep-alive's will work without problem.\n", "+1\n", "@foxx\nThanks for looking into this issue.\nIf you have a chance, would you be able to provide an example of authenticating to the proxy in case of https over http?\n\nCheers\n", "Hi @vly,\n\nNot a problem, I'll take a look at this today and update the test file to reflect this. \n", "@vly I can confirm that currently the code does not currently have proxy authentication support (however afaik, proxy authentication is not currently in the original code either).\n\nIt does still however work for remote authentication (i.e. using auth= to authenticate to the site).\n\n@kennethreitz can you confirm if you would be happy to merge the code in its current state, with proxy authentication being done at a later date?\n", "@foxx \nThanks for the confirmation.\nWas wondering if I just didn't know the correct syntax. http via http proxy auth works fine either passed via user:pass@ or Authorization basic header item.\n", "@vly Excellent stuff - it would be great to have proxy authentication support, however this patch was contributed as open source from work done for a clients specific requirement - which sadly doesn't require proxy authentication. I'm hoping @kennethreitz will accept the patch without, and either myself or someone else will add proxy authentication support at a later date.\n", "This looks _awesome_! \n\nHowever, the urllib3 changes should be happening at the [shazow/urllib3](https://github.com/shazow/urllib3) repo\n", "@shazow any comments on this? I know there was another SOCKS implementation submitted recently, right?\n", "@shazow Let me know if you would consider merging in my changes, and if so, then I will create a new fork of urllib3 with the necessary modifications (as the patch in its current state _might_ not cleanly apply to the urllib3 repo, or at the very least would only have the new features usable via undocumented attributes).\n---edited---\n", "@shazow Or - you could accept the patch as 'undocumented features', then apply your own changes in the future to use them in a documented fashion (as they should apply cleanly - they just won't be accessibly without setting some undocumented attributes). Then once this has been done, Python Requests would be modified to use the documented approach.\n\nThis would mean the features will be accessible quicker, without being blocked on many other issues. I was thinking of just applying the patches myself to urllib3, but it would appear you have quite a few other issues that _might_ block this, as well as a design decision needed, which would probably take up too much time for me to do myself.\n", "@foxx Hey there! @wolever has been helping me code review and manage with this particular feature request. Could you take a look at this @wolever?\n\nSuperquick glance at it looks alright. Our long-term redesign ambitions will make this code simpler but that's a way's out so let's not wait for that. Cleanup into urllib3's codebase and some unit tests in urllib3's suite would be great. :)\n", "@shazow Sounds good man. @wolever can you make sure you are happy with this code and approach, if so I will make the necessary fork/mods. ---edited---\n", "@wolever Any update on your thoughts for this patch?? \n", "After some thought, I believe this should be possible (and, in fact, desirable) to implement this proxy support entirely in urllib3 by passing the `proxy_url=` string directly to the `HTTP[S]ConnectionPool` classes. This would imply that:\n- `PoolManagerManager.__init__` should also accept a `proxy=` keyword\n- `proxy_from_url` would need to have the signature `proxy_from_pool(proxy_url)` and it would need to return a `PoolManager(proxy_url=proxy_url)`.\n- The `ProxyManager` would be deprecated, as it can only handle one specific kind of proxy (regular HTTP proxies).\n- A bunc hof code will be added to `HTTPConnectionPool`. In general this would be suboptimal… But there are plans to do some large-scale refactoring of urllib3 anyway, and we can make the `HTTPConnectionPool` pretty then :)\n\nThe possible `proxy_url` schemes would then be something like:\n- `http[s]` — for \"regular\" HTTP proxies\n- `http[s]+connect` — for `CONNECT` HTTP proxies (ie, https://github.com/shazow/urllib3/pull/56)\n- `socks{4,5}` — for SOCKS4/SOCKS5 proxies\n\nCare will need to be taken so as not to confuse the scheme of the _proxy_ with the scheme of the _connection_ (ex, it should be possible to make an HTTP connection over an `https` or `https+connect` proxy, or an HTTPS connection over an `http` or `http+connect` proxy)… But apart from that, I feel like this will be a straight-forward change, especially given that you've got the tricky bits implemented already.\n\nBelow is a quick sketch of what I'm thinking of for `HTTPConnectionPool`. It's not exhaustive by any means, but between it, your SOCKSs stuff and @senko's CONNECT proxy stuff, I think this will be the best way of supporting proxies in urllib3 for now.\n\n``` python\n\nclass HTTPConnectionPool(RequestMethods):\n def __init__(..., proxy_url=None):\n self.proxy_scheme, self.proxy_host, self.proxy_port = get_host(proxy_url)\n\n def _new_conn(self):\n if self.proxy_scheme.startswith('http'):\n host, port = self.proxy_host, self.proxy_port\n else:\n host, port = self.host, self.port\n\n if self.proxy_scheme.startswith('socks'):\n sock = create_a_new_socks_socket()\n else:\n sock = None\n\n conn = HTTPConnection(host=host, port=port, sock=sock)\n if self.proxy_scheme.endswith('+connect'):\n set_tunnel = getattr(conn, 'set_tunnel', None)\n set_tunnel = set_tunnel or getattr(conn, '_set_tunnel', None)\n if set_tunnel is not None:\n set_tunnel(self.proxy_host, self.proxy_port)\n\n def urlopen(...):\n ...\n if self.proxy_scheme in ['http', 'https']:\n headers = dict(headers)\n headers.update({\n 'Accept': '*/*',\n 'Proxy-Connection': 'Keep-Alive',\n })\n ...\n```\n", "Oh, yes — I don't know exactly how this will interact with requests (especially the `HTTPProxyAuth`)… So if anything I've suggested won't play well with requests, that's likely just my ignorance.\n\nPlease let me know if there's anything else I can do to help. I'm back to normal life now, so I should be able to reply in a more timely fashion.\n", "@wolever Thank you for the feedback on this! It all looks fine, with the slight change that connections to HTTPS over HTTP proxy should default to the 'CONNECT' method (without needing to add +connect).\n\nI've booked out some hours for Friday to get the modifications done, and I can also make the necessary Python Requests modifications afterwards too. However - if anyone else wants to have a shot at this then please do feel free!\n", "Made a few updates to https://github.com/Anorov/PySocks but they shouldn't really affect urllib3 at all. I'll continue to maintain the branch as actively as possible.\n\nAlso, as was mentioned earlier, this pull request should probably be moved to the urllib3 repo instead of the requests one.\n\nHope you and wolever get this integrated nicely. This will be a great addition for urllib3 and requests.\n", "@Anorov Many thanks for the updates! On Friday (if no one else has done the patch by then) - I will get a new urllib3 fork created with the necessary changes - assuming they are accepted I will then update my branch on this pull request too.\n", "You guys are awesome, urllib3 and requests is lucky to have such contributors. :)\n", "+1000.\n\nSorry for the delay on this stuff — I've been super slammed since PyCon. Will review soon :)\n", "Apologies for the slight delay on getting this patch done, will have it ready by mid week.\n", "Looking forward to it :)\n", "Any update?\n", "Apologies, this kept going further and further down the todo list - you know how it is :)\n\nI've just bumped it back up again - will get it done in the next few days.\n", "No rush — just wanted to make sure you weren't waiting on anything from anyone.\n", "Working on this now\n" ]
https://api.github.com/repos/psf/requests/issues/477
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/477/labels{/name}
https://api.github.com/repos/psf/requests/issues/477/comments
https://api.github.com/repos/psf/requests/issues/477/events
https://github.com/psf/requests/pull/477
3,590,884
MDExOlB1bGxSZXF1ZXN0OTYwMjM1
477
potentially fixes #338
{ "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
2012-03-09T22:31:39Z
2021-09-08T22:01:18Z
2012-03-16T01:15:28Z
CONTRIBUTOR
resolved
This attempts to fix an issue where encoding of a string might fail when the encoding is set to some unknown format. Here we attempt to catch the LookupException and subsequently blindly encode the string one final time. That is we call str() over response.content without specifying an encoding. This may still fail in certain cases but does properly handle the case of #338 by returning the expected string.
{ "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/477/reactions" }
https://api.github.com/repos/psf/requests/issues/477/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/477.diff", "html_url": "https://github.com/psf/requests/pull/477", "merged_at": "2012-03-16T01:15:28Z", "patch_url": "https://github.com/psf/requests/pull/477.patch", "url": "https://api.github.com/repos/psf/requests/pulls/477" }
true
[ "Thanks @piotr-dobrogost, I've updated with a (hopefully) better comment.\n", "Love this. Thanks!\n" ]
https://api.github.com/repos/psf/requests/issues/476
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/476/labels{/name}
https://api.github.com/repos/psf/requests/issues/476/comments
https://api.github.com/repos/psf/requests/issues/476/events
https://github.com/psf/requests/pull/476
3,585,298
MDExOlB1bGxSZXF1ZXN0OTU3Nzg2
476
adding a request_status attribute to HTTPError
{ "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
7
2012-03-09T16:19:00Z
2021-09-08T14:01:04Z
2012-03-09T16:51:36Z
CONTRIBUTOR
resolved
HTTPError provides a nice way to handle errors via response.raise_for_status, however even though the HTTP status code is included in the error message string, this does not necessarily provide a clean API with which to interface over the request's status_code when an error occurs. Particularly this is useful when using a module or class that wraps requests and returns some parsed response but leaves error handling up to whatever is using it. For instance, if such a class were to call raise_for_status, while it's possible to see if a string representation of an HTTP code is in the error message via str(404) in (str), this isn't as clean as being able to simply use e.status_code and compare directly via 404 == e.status_code.
{ "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/476/reactions" }
https://api.github.com/repos/psf/requests/issues/476/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/476.diff", "html_url": "https://github.com/psf/requests/pull/476", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/476.patch", "url": "https://api.github.com/repos/psf/requests/pulls/476" }
true
[ "Hmm, I like it. I think it would be better to give it the entire response object though. Closing for now :)\n", "Want me to update this and use the response object instead? :)\n", "That'd be great! \n", "Also, you accidentally changed the exception messages to all be redirect :)\n", "Damn, I was hoping you'd not notice my foolishness; I guess I didn't update the pull request in time. :( //shamed\n", "hehe :)\n", ":sparkles: :cake: :sparkles: \n\nThanks!\n" ]
https://api.github.com/repos/psf/requests/issues/475
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/475/labels{/name}
https://api.github.com/repos/psf/requests/issues/475/comments
https://api.github.com/repos/psf/requests/issues/475/events
https://github.com/psf/requests/pull/475
3,572,385
MDExOlB1bGxSZXF1ZXN0OTUyODc3
475
Generate chunked ValueError fix
{ "avatar_url": "https://avatars.githubusercontent.com/u/285920?v=4", "events_url": "https://api.github.com/users/umbrae/events{/privacy}", "followers_url": "https://api.github.com/users/umbrae/followers", "following_url": "https://api.github.com/users/umbrae/following{/other_user}", "gists_url": "https://api.github.com/users/umbrae/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/umbrae", "id": 285920, "login": "umbrae", "node_id": "MDQ6VXNlcjI4NTkyMA==", "organizations_url": "https://api.github.com/users/umbrae/orgs", "received_events_url": "https://api.github.com/users/umbrae/received_events", "repos_url": "https://api.github.com/users/umbrae/repos", "site_admin": false, "starred_url": "https://api.github.com/users/umbrae/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/umbrae/subscriptions", "type": "User", "url": "https://api.github.com/users/umbrae", "user_view_type": "public" }
[]
closed
true
null
[]
null
7
2012-03-08T21:25:34Z
2021-09-08T23:08:17Z
2012-03-08T22:57:58Z
CONTRIBUTOR
resolved
Here's a potential fix for #436 - @RonnyPfannschmidt is this what you had in mind?
{ "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/475/reactions" }
https://api.github.com/repos/psf/requests/issues/475/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/475.diff", "html_url": "https://github.com/psf/requests/pull/475", "merged_at": "2012-03-08T22:57:58Z", "patch_url": "https://github.com/psf/requests/pull/475.patch", "url": "https://api.github.com/repos/psf/requests/pulls/475" }
true
[ "You're the best!\n\nThe `t.co` test needs to be moved to `text_requests_ext.py`, because `test_requests.py` needs to be workable locally `\n", ":+1:\n", "Merged! I'll try to get this out later today.\n", ":sparkles: :cake: :sparkles:\n", "looks good\n", "Awesome, thanks Kenneth - this is huge for us, this and the CookieError stuff are 100% of our requests-related errors!\n", "Released! Cookie errors should be suppressed now too. Let me know if you have nay issues\n" ]
https://api.github.com/repos/psf/requests/issues/474
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/474/labels{/name}
https://api.github.com/repos/psf/requests/issues/474/comments
https://api.github.com/repos/psf/requests/issues/474/events
https://github.com/psf/requests/pull/474
3,570,404
MDExOlB1bGxSZXF1ZXN0OTUyMDM1
474
Tox for testing
{ "avatar_url": "https://avatars.githubusercontent.com/u/850859?v=4", "events_url": "https://api.github.com/users/danverbraganza/events{/privacy}", "followers_url": "https://api.github.com/users/danverbraganza/followers", "following_url": "https://api.github.com/users/danverbraganza/following{/other_user}", "gists_url": "https://api.github.com/users/danverbraganza/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/danverbraganza", "id": 850859, "login": "danverbraganza", "node_id": "MDQ6VXNlcjg1MDg1OQ==", "organizations_url": "https://api.github.com/users/danverbraganza/orgs", "received_events_url": "https://api.github.com/users/danverbraganza/received_events", "repos_url": "https://api.github.com/users/danverbraganza/repos", "site_admin": false, "starred_url": "https://api.github.com/users/danverbraganza/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/danverbraganza/subscriptions", "type": "User", "url": "https://api.github.com/users/danverbraganza", "user_view_type": "public" }
[]
closed
true
null
[]
null
3
2012-03-08T19:24:18Z
2021-09-08T14:01:03Z
2012-03-09T16:38:42Z
NONE
resolved
Hey there, maintainer dudes, Keeping track of the setup environments for python 2 and 3 (and keeping them separate) was driving me nuts, so I've added support for testing with tox and nosetests. If you have tox installed-- ``` pip install tox ``` Then for each environment it will build requests into its own virtualenv with its own dependencies, run all the tests, and give you results. Currently, this exposes that gevent is outside of the requests setup.py (by design, I imagine) so it needs to be included seperately for test_requests_async.py to work without throwing a RunTimeException. Some tests in the Python 3 environment fail because And envoy is not in the requirements of setup, despite being referenced in the test cases. Tox is a great way to test on multiple virtual environments (and it interfaces with hudson jenkins too, if that counts as a win). Danver Braganza
{ "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/474/reactions" }
https://api.github.com/repos/psf/requests/issues/474/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/474.diff", "html_url": "https://github.com/psf/requests/pull/474", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/474.patch", "url": "https://api.github.com/repos/psf/requests/pulls/474" }
true
[ "Hey there. I actually had tox setup for a while for requests, but prefer to make that a personal decision:\n\nhttp://ci.kennethreitz.com/job/requests/\n\nAs long as the tox.ini should never require any configuration from the user, I may not be against adding this back in.\n", "Holding off on this for now. I'll reconsider once I get the new test stuff in place (python3 really messed it up :)\n", "I guess I just want to keep this out of source control. Maybe we could keep it in a gist and have the existing `make init` pull that down locally if needed.\n" ]
https://api.github.com/repos/psf/requests/issues/473
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/473/labels{/name}
https://api.github.com/repos/psf/requests/issues/473/comments
https://api.github.com/repos/psf/requests/issues/473/events
https://github.com/psf/requests/pull/473
3,562,200
MDExOlB1bGxSZXF1ZXN0OTQ5NTAy
473
Proxy configuration by environment variables
{ "avatar_url": "https://avatars.githubusercontent.com/u/195266?v=4", "events_url": "https://api.github.com/users/jgorset/events{/privacy}", "followers_url": "https://api.github.com/users/jgorset/followers", "following_url": "https://api.github.com/users/jgorset/following{/other_user}", "gists_url": "https://api.github.com/users/jgorset/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/jgorset", "id": 195266, "login": "jgorset", "node_id": "MDQ6VXNlcjE5NTI2Ng==", "organizations_url": "https://api.github.com/users/jgorset/orgs", "received_events_url": "https://api.github.com/users/jgorset/received_events", "repos_url": "https://api.github.com/users/jgorset/repos", "site_admin": false, "starred_url": "https://api.github.com/users/jgorset/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/jgorset/subscriptions", "type": "User", "url": "https://api.github.com/users/jgorset", "user_view_type": "public" }
[]
closed
true
null
[]
null
3
2012-03-08T12:46:51Z
2021-09-08T23:08:15Z
2012-03-09T16:07:21Z
CONTRIBUTOR
resolved
Hi, I recently received [an issue](https://github.com/jgorset/facepy/issues/21) that describes difficulties in using proxies with [Facepy](http://github.com/jgorset/facepy), a Facebook Graph API client that uses requests internally. I would like to keep proxies out of my interface, so I've facilitated the configuration of proxies in requests through the environment variables `HTTP_PROXY` and `HTTPS_PROXY`. I'm not sure how I might test this feature, but if you have any ideas please let me know and I'll get right to it.
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/473/reactions" }
https://api.github.com/repos/psf/requests/issues/473/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/473.diff", "html_url": "https://github.com/psf/requests/pull/473", "merged_at": "2012-03-09T16:07:21Z", "patch_url": "https://github.com/psf/requests/pull/473.patch", "url": "https://api.github.com/repos/psf/requests/pulls/473" }
true
[ "You're incredible :)\n", "Now, now... ;-)\n", ":sparkles: :cake: :sparkles:\n" ]
https://api.github.com/repos/psf/requests/issues/472
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/472/labels{/name}
https://api.github.com/repos/psf/requests/issues/472/comments
https://api.github.com/repos/psf/requests/issues/472/events
https://github.com/psf/requests/pull/472
3,536,038
MDExOlB1bGxSZXF1ZXN0OTQwMTA1
472
A fix for https://github.com/kennethreitz/requests/issues/461
{ "avatar_url": "https://avatars.githubusercontent.com/u/850859?v=4", "events_url": "https://api.github.com/users/danverbraganza/events{/privacy}", "followers_url": "https://api.github.com/users/danverbraganza/followers", "following_url": "https://api.github.com/users/danverbraganza/following{/other_user}", "gists_url": "https://api.github.com/users/danverbraganza/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/danverbraganza", "id": 850859, "login": "danverbraganza", "node_id": "MDQ6VXNlcjg1MDg1OQ==", "organizations_url": "https://api.github.com/users/danverbraganza/orgs", "received_events_url": "https://api.github.com/users/danverbraganza/received_events", "repos_url": "https://api.github.com/users/danverbraganza/repos", "site_admin": false, "starred_url": "https://api.github.com/users/danverbraganza/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/danverbraganza/subscriptions", "type": "User", "url": "https://api.github.com/users/danverbraganza", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2012-03-07T01:05:38Z
2021-09-04T00:06:49Z
2012-03-09T16:46:36Z
NONE
resolved
Added testcase showing a non-standard unicode character (in this case, A-umlaut), returned by the server in a redirect, breaks py27 requests. I have a class of urls which I need to get in py27 which break, because the server returns a _relative redirect_ with a high unicode character in it. Because of how str and unicode are re-bound in py_27 mode for requests, this means that unicode is being called on an object that does not implicitly convert to unicode (it has an ord > 127). The other minor change I made is a small hack to remove the unicode-literal u from test_requests_ext.py so it can be run on python3. This fix, which seems to work for me (hurray), is to urllib.quote the relative returned by the server. This percent-encodes the non-standard characters in the unicode, and then everything behaves nicely. All tests pass for python 2.7.2 and python 3.2.2 on Linux.
{ "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/472/reactions" }
https://api.github.com/repos/psf/requests/issues/472/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/472.diff", "html_url": "https://github.com/psf/requests/pull/472", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/472.patch", "url": "https://api.github.com/repos/psf/requests/pulls/472" }
true
[ "Okay I seem to have made a real dog's dinner of this pull request. By accident I pushed some commits relevant to testing to this branch. I've now reverted these. Herp. Derp.\n\nThe truth is that for `requests.compat.urljoin()` to work, it needs to accept ANSI-7 compatible strings. I found another test case that was breaking, and I've now fixed that too by using the extremely excellent `requests.util.requote_uri` instead of just `requests.compat.quote`.\n", "All merged :)\n" ]
https://api.github.com/repos/psf/requests/issues/471
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/471/labels{/name}
https://api.github.com/repos/psf/requests/issues/471/comments
https://api.github.com/repos/psf/requests/issues/471/events
https://github.com/psf/requests/issues/471
3,535,456
MDU6SXNzdWUzNTM1NDU2
471
Raise ValueError, not KeyError, in case the schema is unknown
{ "avatar_url": "https://avatars.githubusercontent.com/u/748944?v=4", "events_url": "https://api.github.com/users/wbolster/events{/privacy}", "followers_url": "https://api.github.com/users/wbolster/followers", "following_url": "https://api.github.com/users/wbolster/following{/other_user}", "gists_url": "https://api.github.com/users/wbolster/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/wbolster", "id": 748944, "login": "wbolster", "node_id": "MDQ6VXNlcjc0ODk0NA==", "organizations_url": "https://api.github.com/users/wbolster/orgs", "received_events_url": "https://api.github.com/users/wbolster/received_events", "repos_url": "https://api.github.com/users/wbolster/repos", "site_admin": false, "starred_url": "https://api.github.com/users/wbolster/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/wbolster/subscriptions", "type": "User", "url": "https://api.github.com/users/wbolster", "user_view_type": "public" }
[]
closed
true
null
[]
null
0
2012-03-07T00:06:10Z
2021-09-09T07:05:26Z
2012-07-27T06:00:28Z
NONE
resolved
Requests raises ValueError for most incorrect urls, but in case the schema is unknown (e.g. "foo://a/b/c"), KeyError is used. ``` >>> requests.get('foo://a/b/c') KeyError: u'foo' >>> requests.get('x//a/b/c') ValueError: Invalid URL 'x//a/b/c': No schema supplied ``` This makes it hard to differentiate between "erroneous url" versus "http request failed".
{ "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/471/reactions" }
https://api.github.com/repos/psf/requests/issues/471/timeline
null
completed
null
null
false
[]
https://api.github.com/repos/psf/requests/issues/470
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/470/labels{/name}
https://api.github.com/repos/psf/requests/issues/470/comments
https://api.github.com/repos/psf/requests/issues/470/events
https://github.com/psf/requests/pull/470
3,510,605
MDExOlB1bGxSZXF1ZXN0OTMwMDIw
470
Fix and considerably simplify the iter_lines() function
{ "avatar_url": "https://avatars.githubusercontent.com/u/10137?v=4", "events_url": "https://api.github.com/users/ghost/events{/privacy}", "followers_url": "https://api.github.com/users/ghost/followers", "following_url": "https://api.github.com/users/ghost/following{/other_user}", "gists_url": "https://api.github.com/users/ghost/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/ghost", "id": 10137, "login": "ghost", "node_id": "MDQ6VXNlcjEwMTM3", "organizations_url": "https://api.github.com/users/ghost/orgs", "received_events_url": "https://api.github.com/users/ghost/received_events", "repos_url": "https://api.github.com/users/ghost/repos", "site_admin": false, "starred_url": "https://api.github.com/users/ghost/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/ghost/subscriptions", "type": "User", "url": "https://api.github.com/users/ghost", "user_view_type": "public" }
[]
closed
false
null
[]
null
10
2012-03-05T17:49:55Z
2014-07-20T01:36:09Z
2012-03-09T16:07:21Z
NONE
null
1. Do not use rstrip() as this would also throw away meaningful whitespaces 2. Avoid assuming what striplines() considers a line break terminator, the list of those is quite long in Unicode. 3. Add tests for the above edge cases. This should look much better now. The only question I have is whether iter_content() could yield an empty chunk? generate()/generate_chunked() never do but the decoder might. In that case, I'll need to amend this.
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/470/reactions" }
https://api.github.com/repos/psf/requests/issues/470/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/470.diff", "html_url": "https://github.com/psf/requests/pull/470", "merged_at": "2012-03-09T16:07:21Z", "patch_url": "https://github.com/psf/requests/pull/470.patch", "url": "https://api.github.com/repos/psf/requests/pulls/470" }
true
[ "Oh, and I removed the chunk_size argument as it doesn't make much sense (it has no effect whatsoever on the output of the generator).\n", "Now that I think about it, this is wrong and the old code was correct when it comes to \\r\\n split across two chunks.\n", "I love it!\n\nDo you think chunk_size would never be needed on iter_lines?\n", "I don't think so. It's arguably not very useful for iter_content() either as long it's approximate and doesn't reflect the post-decompression stream (my plan is to get to that one next). But for iter_lines, it really only fine-tunes how the function works and not its output so that should justify its removal unless I'm missing something...\n\nI'll need to give this one more iteration to handle the multi-character line terminators properly.\n", "@kennethreitz It's kind of strange that iter_lines() does not perform decoding (or even has an argument to control that). There is no concept of lines in binary streams. Any specific reason for that?\n", "Yes it does, it has `decode_unicode`, which is false by default. You can't always infer encoding.\n", "@kennethreitz Sure but it doesn't even try. Encoding detection only runs for text(). Lines are a text concept so iter_lines() should perform both the encoding detection step and actually decode. If it's impossible, it should ideally fail.\n", "I think I'm going to merge this, adding back in chunk_size for backwards compatibility if anything else.\n", "Gah, unfortunately this wasn't compatible with python3.\n", "Thanks a million for this, btw. I hated that code :)\n" ]
https://api.github.com/repos/psf/requests/issues/469
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/469/labels{/name}
https://api.github.com/repos/psf/requests/issues/469/comments
https://api.github.com/repos/psf/requests/issues/469/events
https://github.com/psf/requests/issues/469
3,487,655
MDU6SXNzdWUzNDg3NjU1
469
Printing request text?
{ "avatar_url": "https://avatars.githubusercontent.com/u/899458?v=4", "events_url": "https://api.github.com/users/marblar/events{/privacy}", "followers_url": "https://api.github.com/users/marblar/followers", "following_url": "https://api.github.com/users/marblar/following{/other_user}", "gists_url": "https://api.github.com/users/marblar/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/marblar", "id": 899458, "login": "marblar", "node_id": "MDQ6VXNlcjg5OTQ1OA==", "organizations_url": "https://api.github.com/users/marblar/orgs", "received_events_url": "https://api.github.com/users/marblar/received_events", "repos_url": "https://api.github.com/users/marblar/repos", "site_admin": false, "starred_url": "https://api.github.com/users/marblar/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/marblar/subscriptions", "type": "User", "url": "https://api.github.com/users/marblar", "user_view_type": "public" }
[]
closed
true
null
[]
null
4
2012-03-03T04:06:10Z
2021-09-09T08:00:34Z
2012-06-15T18:42:24Z
NONE
resolved
It would be convenient if the object returned by Response.request had an equivalent to Response.text.
{ "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/469/reactions" }
https://api.github.com/repos/psf/requests/issues/469/timeline
null
completed
null
null
false
[ "Unfortunately, that would create a huge waste of memory as we move to streaming request bodies.\n", "However, a property for generating the body might be fine.\n", "+1\n\nA property for generating the request body could help me a lot while testing.\n", "This will happen with the fancy new flask merge.\n" ]
https://api.github.com/repos/psf/requests/issues/468
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/468/labels{/name}
https://api.github.com/repos/psf/requests/issues/468/comments
https://api.github.com/repos/psf/requests/issues/468/events
https://github.com/psf/requests/issues/468
3,477,034
MDU6SXNzdWUzNDc3MDM0
468
data can not be passed in session initialization
{ "avatar_url": "https://avatars.githubusercontent.com/u/252257?v=4", "events_url": "https://api.github.com/users/maraujop/events{/privacy}", "followers_url": "https://api.github.com/users/maraujop/followers", "following_url": "https://api.github.com/users/maraujop/following{/other_user}", "gists_url": "https://api.github.com/users/maraujop/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/maraujop", "id": 252257, "login": "maraujop", "node_id": "MDQ6VXNlcjI1MjI1Nw==", "organizations_url": "https://api.github.com/users/maraujop/orgs", "received_events_url": "https://api.github.com/users/maraujop/received_events", "repos_url": "https://api.github.com/users/maraujop/repos", "site_admin": false, "starred_url": "https://api.github.com/users/maraujop/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/maraujop/subscriptions", "type": "User", "url": "https://api.github.com/users/maraujop", "user_view_type": "public" }
[]
closed
true
null
[]
null
12
2012-03-02T14:02:07Z
2021-09-09T08:00:39Z
2012-06-15T18:25:45Z
NONE
resolved
https://github.com/kennethreitz/requests/blob/develop/requests/sessions.py#L65 If `params` can be passed, shouldn't `data` be available too? Miguel
{ "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/468/reactions" }
https://api.github.com/repos/psf/requests/issues/468/timeline
null
completed
null
null
false
[ "That's a bit odd, I think.\n", "I guess I can think of a few use cases though...\n", "Being one passing `access_token` for OAuth2 apis. See:\nhttps://github.com/maraujop/requests-oauth2\n\nCheers,\nMiguel\n", "We should talk. There's some pretty serious efforts going on to get oauth into requests right now. You should help :)\n", "See: https://github.com/idangazit/oauthlib\n", "I'm very surprised about this. If you re-read carefully <a href=\"https://github.com/kennethreitz/requests/issues/65\">requests issue #65</a>, you will remember that it was me the first one trying to integrate OAuth into requests. I actually integrated the feature into requests' core the first time. But at that time, authentication needed to be polished, so you requested me to take it out and wait for the hook system.\n\nAfter the hook system landed in, I redid my work turning it into a hook. I asked you what to do with it and at that time you were \"leaning more towards having a requests-oauth module\". After days without answer and people sending me requests to release it, I decided to create a separate repository for it.\n\nIt took you quite some time to list the module in the docs and I haven't seen you mention it publicly anywhere. Usually people list OAuth support as a first level feature in an http library. One day, out of the blue, @idangazit appeared and started complaining about an issue with cookies in my hook. I fixed it in a day. But he started talking about refactoring everything into core and adding Header authentication (which I didn't support at that time). I remember telling him: \"I'm open to all the pull requests you want to send me\".\n\nSuddenly, he got assigned the task to integrate OAuth into requests' core. Several questions pop into my head: why him? why not integrating requests-oauth? How many requests libraries will benefit from a universal OAuth signing library (oauthlib)? why not reusing requests-oauth code base somehow? \n\nAll I can say is that OAuth1.0 has more details and specifics to cover than the ones you can do in a universal signing library. Those ones take time to polish. requests-oauth2 could be merged into requests right away, as the concept of a universal library for this version of the protocol doesn't make much sense. It's orders of magnitude easier to handle and initialize.\n\nFinally, meanwhile I was working on requests-oauth, I think I've found and submitted 4 or 5 issues in requests, for which some had patches. I also started the keepalive branch. But not a single line of code I did is included in this project.\n\nI'm not sure why I should help in this initiative when It's my project the one that has been helping coders handle OAuth with requests for months. I've put a lot of time and effort in it already, Shouldn't it be the other way? \n\nWhen I did this specifically for requests, was because this is the future of Python's https libraries. The only thing oauthlib is covering now, that I'm missing is the provider part. I believe they are working on the provider for OAuth1.0. This is an important gap to cover in the community as there is not a single good OAuth1 Python provider.\n\nHowever, more and more, OAuth2 is conquering the scene and apps like <a href=\"https://github.com/hiidef/oauth2app\">oauth2app</a> do a decent job providing it. Sites like Github, started serving their API with OAuth2, facebook only uses OAuth2 at the moment, Twitter is planning the movement. OAuth1 will be with us for some time, probably years, but most likely it will fade away and luckily it's not the future of OAuth.\n\nCheers,\nMiguel\n", "I'll give a more appropriate / lengthy discussion here soon, but here's some context...\n\nOAuthlib's goal is to be the gold standard OAuth implementation for _all_ clients, not just Requests. We just happen to be working closely together. OAuth1 and OAuth2 will be covered and all permutations thereof. All frameworks (django, flask, etc) will have shims available to utilize it on consumer and provider ends.\n\nAll of the excellent work you've done for bringing oauth into requests could be _immensely_ useful to the development of `oauthlib`, which is the best thing going forward for the Python community as a whole. Not just requests.\n\n---\n\nThe reason your pull requests as of late have been sitting there is because they are _great_ changes that need to happen and can't be merged in immediately because of the fundamental changes they make. Normally it'd be easier, but there's underway a rearchitecture of requests / flask / werkzeug / cache / httplib / dns security libraries. This is all pretty much undocumented at this point, but I hope to fix that this week. Lots of great progress happened at PyCon. \n", "Other people actively involved in this are: @dgouldin, @pydanny, @ghickman, and @ib-lundgren. Dozens are passively involved. \n\nHere's a log of the stuff that went down at PyCon: https://github.com/pydanny/pycon2012-oauth-sprint/blob/master/index.rst\n\n@ib-lundgren is a grad student that is hoping to do his thesis on OAuthlib, actually :)\n", "@maraujop - A critical point of OAuthLib is to provide a library of utilities and functions audited by security people at Google, Canonical, et al. There is not a bit of requests in it, which sucks because urllib2 sucks. However, because OAuthLib is currently dependency free, that means projects that can't support requests can use it trivially. This means that not will OAuthLib be able to help replace python-oauth2 in existing systems, it can also target systems where people have cooked up their own hacky solutions because of the impossibility of dependency management.\n\nAs for OAuth2, we would love to have used that as our target. Unfortunately, as OAuth2 is not a finalized specification, that's not realistic. Even if we did it anyway, the security teams can't/won't audit it.\n", "I think we'll have OAuth2 shortly after OAuth1 is solid. We'll have to raise some `BoundToChange` warnings though :)\n", "@pydanny @kennethreitz I'm very aware of what oauthlib is. I totally understand its advantages, and let me insist that I've never wanted to state it's a bad project or idea. It also will ease releasing providers for different Python frameworks, something as I said is missing and that is a hard task.\n\nWhen I started requests-oauth, I wanted to add OAuth consumer ability to requests, which I guess we agree it's the future of http libraries in Python. \n\nI guess what I don't understand is why oauthlib started from scratch, when there were very good projects with lots of corner cases covered. The code base of those projects was a good starting point. Projects like mine or python-oauth2 (mine was based on it in the beginning), could have been refactored into a independent library. I'm guessing with the entrance of these great new devs, this is now a reality, as they are capturing their know-how in oauthlib, great.\n\n> All of the excellent work you've done for bringing oauth into requests could be immensely useful to the development of oauthlib, which is the best thing going forward for the Python community as a whole. Not just requests.\n\nThanks. I'm working hard on trying to maintain my hook up to date as you know, as this is the most used choice for requests and several people depend on my development to continue working on their projects.\n\n> The reason your pull requests as of late have been sitting there is because they are great changes that need to happen and can't be merged in immediately because of the fundamental changes they make. Normally it'd be easier, but there's underway a rearchitecture of requests / flask / werkzeug / cache / httplib / dns security libraries. This is all pretty much undocumented at this point, but I hope to fix that this week. Lots of great progress happened at PyCon.\n\nI'm looking forward to seeing what this is all about. It felt that 27 days for getting an answer on an issue that was blocking the development of an important plugin of the application, was too long, considering 7 days before, I got an answer on an other issue #468. I know myself how busy we can all be with our lives and open source all at the same time. In your case maintaining big projects such as requests, it's even more demanding.\n\nWhat I'm saying is that at the moment, requests-oauth is what people are using, until OAuth gets merged into core, there needs to be a way I can keep development alive. If I stop maintaining today my hook because something is superseding it, there will be a gap of time in which people will have no choice. I depend now on you to be able to maintain it.\n\nCheers,\nMiguel\n", "Closing.\n" ]
https://api.github.com/repos/psf/requests/issues/467
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/467/labels{/name}
https://api.github.com/repos/psf/requests/issues/467/comments
https://api.github.com/repos/psf/requests/issues/467/events
https://github.com/psf/requests/issues/467
3,472,665
MDU6SXNzdWUzNDcyNjY1
467
url is quoted twice before finally sending the request
{ "avatar_url": "https://avatars.githubusercontent.com/u/405972?v=4", "events_url": "https://api.github.com/users/reorx/events{/privacy}", "followers_url": "https://api.github.com/users/reorx/followers", "following_url": "https://api.github.com/users/reorx/following{/other_user}", "gists_url": "https://api.github.com/users/reorx/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/reorx", "id": 405972, "login": "reorx", "node_id": "MDQ6VXNlcjQwNTk3Mg==", "organizations_url": "https://api.github.com/users/reorx/orgs", "received_events_url": "https://api.github.com/users/reorx/received_events", "repos_url": "https://api.github.com/users/reorx/repos", "site_admin": false, "starred_url": "https://api.github.com/users/reorx/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/reorx/subscriptions", "type": "User", "url": "https://api.github.com/users/reorx", "user_view_type": "public" }
[]
closed
true
null
[]
null
3
2012-03-02T06:27:05Z
2021-09-09T09:00:47Z
2012-03-02T06:33:07Z
NONE
resolved
well this is my code: ``` Python import logging logging.getLogger().setLevel(logging.DEBUG) import requests logging.info('requests version: %s' % requests.__version__) requests.get('http://www.baidu.com/[email protected]') ``` and this is the output I got from terminal after running the code > INFO:root:requests version: 0.10.1 > INFO:requests.packages.urllib3.connectionpool:Starting new HTTP connection (1): www.baidu.com > DEBUG:requests.packages.urllib3.connectionpool:"GET /omg%2540requests.com HTTP/1.1" 302 222 > INFO:requests.packages.urllib3.connectionpool:Starting new HTTP connection (2): www.baidu.com > DEBUG:requests.packages.urllib3.connectionpool:"GET /search/error.html HTTP/1.1" 200 1262 Look at the third line of results, what do you see? ``` /omg%2540requests.com ``` OMG, path of the url was quoted twice! ([email protected] -> omg%40requests.com -> omg%2540requests.com) Although the request I made was just a sample and has no actual meaning, but this is a very serious BUG, I tried this url with Chrome, curl and wget, everyone of them works fine. It's very curious that the newest version 0.10.6 doesn't have this problem, but I still want to grumble a little about it :\, cause requests, my favourite python request module, almost made me crazy this afternoon
{ "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/467/reactions" }
https://api.github.com/repos/psf/requests/issues/467/timeline
null
completed
null
null
false
[ "Supporting Python3 caused a lot of bugs :)\n\nBugs that are now worked out with the new url quoting system.\n", "LIke you said, it was a very serious bug, and it was fixed :)\n", "@kennethreitz Yes guy, it has been fixed, and you are really efficient :)\n" ]
https://api.github.com/repos/psf/requests/issues/466
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/466/labels{/name}
https://api.github.com/repos/psf/requests/issues/466/comments
https://api.github.com/repos/psf/requests/issues/466/events
https://github.com/psf/requests/pull/466
3,466,521
MDExOlB1bGxSZXF1ZXN0OTE0NTc3
466
fixing a capitalization error in the send() method doc string
{ "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
1
2012-03-01T22:20:28Z
2021-09-08T23:08:16Z
2012-03-01T22:21:46Z
CONTRIBUTOR
resolved
Pedantic but hey, why not? :)
{ "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/466/reactions" }
https://api.github.com/repos/psf/requests/issues/466/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/466.diff", "html_url": "https://github.com/psf/requests/pull/466", "merged_at": "2012-03-01T22:21:46Z", "patch_url": "https://github.com/psf/requests/pull/466.patch", "url": "https://api.github.com/repos/psf/requests/pulls/466" }
true
[ "These are the best ones :) \n\nThanks! :cake:\n" ]
https://api.github.com/repos/psf/requests/issues/465
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/465/labels{/name}
https://api.github.com/repos/psf/requests/issues/465/comments
https://api.github.com/repos/psf/requests/issues/465/events
https://github.com/psf/requests/issues/465
3,441,305
MDU6SXNzdWUzNDQxMzA1
465
no way to read uncompressed content as file-like object
{ "avatar_url": "https://avatars.githubusercontent.com/u/491659?v=4", "events_url": "https://api.github.com/users/scoder/events{/privacy}", "followers_url": "https://api.github.com/users/scoder/followers", "following_url": "https://api.github.com/users/scoder/following{/other_user}", "gists_url": "https://api.github.com/users/scoder/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/scoder", "id": 491659, "login": "scoder", "node_id": "MDQ6VXNlcjQ5MTY1OQ==", "organizations_url": "https://api.github.com/users/scoder/orgs", "received_events_url": "https://api.github.com/users/scoder/received_events", "repos_url": "https://api.github.com/users/scoder/repos", "site_admin": false, "starred_url": "https://api.github.com/users/scoder/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/scoder/subscriptions", "type": "User", "url": "https://api.github.com/users/scoder", "user_view_type": "public" }
[]
closed
true
null
[]
null
44
2012-02-29T18:14:13Z
2021-09-09T04:00:38Z
2012-07-26T19:37:46Z
NONE
resolved
According to the documentation, there are three ways to read the content of the response: `.text`, `.content` and `.raw`. The first two consider the transfer encoding and decompress the stream automatically when producing their in-memory result. However, especially for the case that the result is large, there is currently no simple way to get at the decompressed result in the form of a file-like object, e.g. to pass it straight into an XML or Json parser. From the point of view of a library that aims to make HTTP requests user friendly, why should a user have to care about something as low-level as the compression type of the stream that was internally negotiated between the web server and the library? After all, it's the library's "fault" if it defaults to accepting such a stream. In this light, the `.raw` stream is a bit too raw for my taste. Maybe a fourth property like `.stream` might provide a better abstraction level?
{ "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": 2, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 2, "url": "https://api.github.com/repos/psf/requests/issues/465/reactions" }
https://api.github.com/repos/psf/requests/issues/465/timeline
null
completed
null
null
false
[ "`Response.iter_content`\n", "Erm, no, that's an iterator. I was asking for a file-like object, i.e. something that document processors can read from directly.\n", "It would be pretty simple to make a file-like object with `iter_content`\n", "Thanks for the quick reply, BTW.\n", "I agree. Still, it would be even easier for `requests` to provide this functionality. My point is that `.raw` is the wrong level of abstraction for most use cases that want to read from the stream, because it exposes transfer level details.\n\nPersonally, I don't see a major use case for iterating line by line or even chunk by chunk over the result of an HTTP request, but I see several major use cases for parsing from it as a file-like object, specifically response formats that require a document parser, such as HTML, XML, Json etc.\n", "Note also that it's much easier to write an iterator that wraps a file-like object, than a file-like object that wraps an iterator.\n", "I came up with the following code. It handles all necessary cases, but I find it rather complex. That's why I said I wanted something like this as part of the library. Users shouldn't have to figure this out themselves.\n\nI think that the code inside of requests' models.py uses the wrong abstraction here. It should decompress the raw stream _before_ it starts with its iteration machinery, not during iteration. Going from a file-like to an iterator just to go back to a file-like is just plain stupid. A single API transformation is more than enough and most users won't care about content iterators anyway.\n\n```\nclass FileLikeDecompressor(object):\n \"\"\"\n File-like object that wraps and decompresses an HTTP stream transparently.\n \"\"\"\n def __init__(self, stream, mode='gzip'):\n self.stream = stream\n zlib_mode = 16 + zlib.MAX_WBITS if mode == 'gzip' else -zlib.MAX_WBITS # magic\n self.dec = zlib.decompressobj(zlib_mode)\n self.data = ''\n\n def read(self, n=None):\n if self.dec is None:\n return '' # all done\n if n is None:\n data = self.data + self.dec.decompress(self.stream.read())\n self.data = self.dec = None\n return data\n while len(self.data) < n:\n new_data = self.stream.read(n)\n self.data += self.dec.decompress(new_data)\n if not new_data:\n self.dec = None\n break\n if self.data:\n data, self.data = self.data[:n], self.data[n:]\n return data\n return ''\n\ndef decompressed(response):\n \"\"\"\n Return a file-like object that represents the uncompressed HTTP response data.\n For compressed HTTP responses, wraps the stream in a FileLikeDecompressor.\n \"\"\"\n stream = response.raw\n mode = response.headers.get('content-encoding')\n if mode in ('gzip', 'deflate'):\n return FileLikeDecompressor(stream, mode)\n return stream\n```\n", "Why don't you build the file-like object from `content_iter` as proposed. This could look like:\n\n```\nclass FileLikeFromIter(object):\n def __init__(self, content_iter):\n self.iter = content_iter\n self.data = ''\n\n def __iter__(self):\n return self.iter\n\n def read(self, n=None):\n if n is None:\n return self.data + '\\n'.join(l for l in self.iter)\n else:\n while len(self.data) < n:\n try:\n self.data = '\\n'.join((self.data, self.iter.next()))\n except StopIteration:\n break\n result, self.data = self.data[:n], self.data[n:]\n return result\n```\n", "You may want to read my comment again, specifically the paragraph that precedes the code I posted.\n", "Yes, but this solution is still cleaner (and IMO easier) than doing the decompression at a second place because this is already built-in in requests.\n\nBut I agree with you in general, a `r.file` (or something like this) has much more use cases than `r.raw`. So I would like to see this included in requests, too. @kennethreitz \n", "\"response.stream\" sounds like a good name to me.\n", "This is what response.raw is for :)\n", "That was also what I intuitively thought when I saw it. But then I realised that response.raw is broken because it exposes internal details of the underlying transport layer that users shouldn't have to care about.\n", "The only method they should need is `raw.read`?\n", "Well, yes - except that raw.read() behaves differently depending on the internal negotiations between client and server. It sometimes returns the expected data and sometimes it returns bare compressed bytes.\n", "Basically, `response.raw` is a nice-to-have feature that most users would happily ignore and some power-users could find helpful, whereas a compression-independent `response.stream` is a feature that most streaming users would want.\n", "+1\n", "+1\n", "Is this design bug going to be fixed?\n", "~~not sure how correct or efficient this way is, but for me, the following works~~:\n\n``` python\n>>> import lxml # a parser that scorns encoding\n>>> unicode_response_string = response.text\n>>> lxml.etree.XML(bytes(bytearray(unicode_response_string, encoding='utf-8'))) # provided unicode() means utf-8\n<Element html at 0x105364870>\n```\n", "@kernc: That's a bizarre thing to be doing. `response.content` is already a bytestring, so what you're doing here is decoding the content with whatever the hell codec Python chooses, then re-encoding it as utf-8.\n\nThis is _not_ a bug, and it is quite definitely not the bug you suggested. If you really need a file-like object, I recommend StringIO and BytesIO.\n", "@Lukasa is correct. `content` should always be a bytestring (in Python 3 it's an explicit bytestring; in Python 2 str == bytes). The only item that is not a bytestring is `text`.\n", "@kennethreitz any news on this? This is a pretty serious design bug and it's best to sort it out early. The more code gets written to work around it, the more costly it becomes for everyone.\n", "This is no design bug, it is just a feature request. And as requests has a [feature freeze](http://docs.python-requests.org/en/latest/dev/todo#feature-freeze) I assume this won't make it in requests anytime soon (if at all)...\n", "I don't think redeclaring a long standing design bug a \"missing feature\"\nmakes it go away all that easily. I heard that the author is thinking about\nmaking \"requests\" part of the Python stdlib. That would be a good\nopportunity to fix this.\n", "> I heard that the author is thinking about\n> making \"requests\" part of the Python stdlib.\n\nNot really: http://docs.python-requests.org/en/latest/dev/philosophy/#standard-library\n", "This is not a bug, it's a feature request. Requests isn't doing anything wrong, it's simply not doing something that is optional. That's the very definition of a feature.\n\nAdditionally, preparing for the stdlib is exactly why Requests is in feature freeze. Once Requests is in the stdlib it becomes very hard to make timely bug fixes. As a result, if adding the new feature adds bugs or regresses behaviour, the version in stdlib can't be fixed until the next minor release. That would be bad.\n", "Marc Schlaich, 19.03.2013 08:41:\n\n> > I heard that the author is thinking about\n> > making \"requests\" part of the Python stdlib.\n> \n> Not really: http://docs.python-requests.org/en/latest/dev/philosophy/#standard-library\n\nI read it here:\n\nhttp://python-notes.boredomandlaziness.org/en/latest/conferences/pyconus2013/20130313-language-summit.html\n\nStefan\n", "I already explained why this is a design bug and not a feature request: the existing API uses the wrong abstraction and leaks negotiation details of the connection into user space that are at the mercy of the remote site, and thus, that the user should not have to care about. That renders the current raw stream reading support hard to use. Essentially, this is a request for fixing a feature that's broken, not a request for a new feature.\n", "Let me sum this up cleanly. The bug is that any real world usage of the raw stream reading feature will have to reimplement a part of the library, specifically the entire conditional stream decompression part, because the feature is useless without it, as soon as the client permits compression. We are talking about code here that is already there, in \"requests\" - it's just used in the wrong spot. It should be used below the raw reading level, not above it, because the client cannot control if the server honours the accept header or not. Compression should be a transparent negotiation detail of the connection, not something that hurts any user who enables the relevant header.\n\nI cannot think of any use case where the client would be interested in the compressed stream, especially if it cannot predict if the stream will really be compressed or not, as the server can happily ignore the client's wish. It's a pure negotiation detail. That's why raw stream reading uses the wrong abstraction by prefering the extremely unlikely use case over the most common one.\n" ]
https://api.github.com/repos/psf/requests/issues/464
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/464/labels{/name}
https://api.github.com/repos/psf/requests/issues/464/comments
https://api.github.com/repos/psf/requests/issues/464/events
https://github.com/psf/requests/pull/464
3,425,287
MDExOlB1bGxSZXF1ZXN0ODk5NjE0
464
Removed prefetch from args.
{ "avatar_url": "https://avatars.githubusercontent.com/u/1093243?v=4", "events_url": "https://api.github.com/users/brendanmaguire/events{/privacy}", "followers_url": "https://api.github.com/users/brendanmaguire/followers", "following_url": "https://api.github.com/users/brendanmaguire/following{/other_user}", "gists_url": "https://api.github.com/users/brendanmaguire/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/brendanmaguire", "id": 1093243, "login": "brendanmaguire", "node_id": "MDQ6VXNlcjEwOTMyNDM=", "organizations_url": "https://api.github.com/users/brendanmaguire/orgs", "received_events_url": "https://api.github.com/users/brendanmaguire/received_events", "repos_url": "https://api.github.com/users/brendanmaguire/repos", "site_admin": false, "starred_url": "https://api.github.com/users/brendanmaguire/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/brendanmaguire/subscriptions", "type": "User", "url": "https://api.github.com/users/brendanmaguire", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2012-02-28T20:17:28Z
2021-09-08T14:01:03Z
2012-02-28T20:19:25Z
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/464/reactions" }
https://api.github.com/repos/psf/requests/issues/464/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/464.diff", "html_url": "https://github.com/psf/requests/pull/464", "merged_at": "2012-02-28T20:19:25Z", "patch_url": "https://github.com/psf/requests/pull/464.patch", "url": "https://api.github.com/repos/psf/requests/pulls/464" }
true
[ "Thanks!\n", "http://ci.kennethreitz.com/job/requests/127/\n" ]
https://api.github.com/repos/psf/requests/issues/463
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/463/labels{/name}
https://api.github.com/repos/psf/requests/issues/463/comments
https://api.github.com/repos/psf/requests/issues/463/events
https://github.com/psf/requests/pull/463
3,425,133
MDExOlB1bGxSZXF1ZXN0ODk5NTQ0
463
Prefetch for sessions
{ "avatar_url": "https://avatars.githubusercontent.com/u/1093243?v=4", "events_url": "https://api.github.com/users/brendanmaguire/events{/privacy}", "followers_url": "https://api.github.com/users/brendanmaguire/followers", "following_url": "https://api.github.com/users/brendanmaguire/following{/other_user}", "gists_url": "https://api.github.com/users/brendanmaguire/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/brendanmaguire", "id": 1093243, "login": "brendanmaguire", "node_id": "MDQ6VXNlcjEwOTMyNDM=", "organizations_url": "https://api.github.com/users/brendanmaguire/orgs", "received_events_url": "https://api.github.com/users/brendanmaguire/received_events", "repos_url": "https://api.github.com/users/brendanmaguire/repos", "site_admin": false, "starred_url": "https://api.github.com/users/brendanmaguire/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/brendanmaguire/subscriptions", "type": "User", "url": "https://api.github.com/users/brendanmaguire", "user_view_type": "public" }
[]
closed
true
null
[]
null
3
2012-02-28T20:07:55Z
2021-09-08T23:06:06Z
2012-02-28T20:08:49Z
CONTRIBUTOR
resolved
Implementation for this issue: https://github.com/kennethreitz/requests/issues/358
{ "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/463/reactions" }
https://api.github.com/repos/psf/requests/issues/463/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/463.diff", "html_url": "https://github.com/psf/requests/pull/463", "merged_at": "2012-02-28T20:08:49Z", "patch_url": "https://github.com/psf/requests/pull/463.patch", "url": "https://api.github.com/repos/psf/requests/pulls/463" }
true
[ "Beautiful. Thanks!\n", "send another :)\n", "Oops! Done. :)\n" ]
https://api.github.com/repos/psf/requests/issues/462
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/462/labels{/name}
https://api.github.com/repos/psf/requests/issues/462/comments
https://api.github.com/repos/psf/requests/issues/462/events
https://github.com/psf/requests/issues/462
3,423,393
MDU6SXNzdWUzNDIzMzkz
462
requests.get response.content is no longer unicode in 0.10.6
{ "avatar_url": "https://avatars.githubusercontent.com/u/59438?v=4", "events_url": "https://api.github.com/users/peczenyj/events{/privacy}", "followers_url": "https://api.github.com/users/peczenyj/followers", "following_url": "https://api.github.com/users/peczenyj/following{/other_user}", "gists_url": "https://api.github.com/users/peczenyj/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/peczenyj", "id": 59438, "login": "peczenyj", "node_id": "MDQ6VXNlcjU5NDM4", "organizations_url": "https://api.github.com/users/peczenyj/orgs", "received_events_url": "https://api.github.com/users/peczenyj/received_events", "repos_url": "https://api.github.com/users/peczenyj/repos", "site_admin": false, "starred_url": "https://api.github.com/users/peczenyj/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/peczenyj/subscriptions", "type": "User", "url": "https://api.github.com/users/peczenyj", "user_view_type": "public" }
[]
closed
true
null
[]
null
3
2012-02-28T18:24:35Z
2021-09-09T09:00:48Z
2012-02-28T18:30:03Z
NONE
resolved
Hi this code: <code> import requests response = requests.get("http://localhost:8888/", allow_redirects=False) print type(response.content) </code> in requests=0.9.1 prints type 'unicode' but now, with requests=0.10.6 prints type 'str' it's break the backward compatibility :( http headers for this request: < HTTP/1.1 200 OK < Content-Length: 1627 < Etag: "0d4a9d4d7ccb27902918a63155d797ca80389ab9" < Content-Type: text/html; charset=UTF-8 < Server: TornadoServer/2.0
{ "avatar_url": "https://avatars.githubusercontent.com/u/59438?v=4", "events_url": "https://api.github.com/users/peczenyj/events{/privacy}", "followers_url": "https://api.github.com/users/peczenyj/followers", "following_url": "https://api.github.com/users/peczenyj/following{/other_user}", "gists_url": "https://api.github.com/users/peczenyj/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/peczenyj", "id": 59438, "login": "peczenyj", "node_id": "MDQ6VXNlcjU5NDM4", "organizations_url": "https://api.github.com/users/peczenyj/orgs", "received_events_url": "https://api.github.com/users/peczenyj/received_events", "repos_url": "https://api.github.com/users/peczenyj/repos", "site_admin": false, "starred_url": "https://api.github.com/users/peczenyj/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/peczenyj/subscriptions", "type": "User", "url": "https://api.github.com/users/peczenyj", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/462/reactions" }
https://api.github.com/repos/psf/requests/issues/462/timeline
null
completed
null
null
false
[ "Sorry... \n", "`response.content` is bytes. `response.text` is unicode.\n", "Sorry about this, I just read the History file and find this warning.\n" ]
https://api.github.com/repos/psf/requests/issues/461
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/461/labels{/name}
https://api.github.com/repos/psf/requests/issues/461/comments
https://api.github.com/repos/psf/requests/issues/461/events
https://github.com/psf/requests/pull/461
3,422,199
MDExOlB1bGxSZXF1ZXN0ODk4Mjc2
461
Decode URL to utf-8 before joining.
{ "avatar_url": "https://avatars.githubusercontent.com/u/285920?v=4", "events_url": "https://api.github.com/users/umbrae/events{/privacy}", "followers_url": "https://api.github.com/users/umbrae/followers", "following_url": "https://api.github.com/users/umbrae/following{/other_user}", "gists_url": "https://api.github.com/users/umbrae/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/umbrae", "id": 285920, "login": "umbrae", "node_id": "MDQ6VXNlcjI4NTkyMA==", "organizations_url": "https://api.github.com/users/umbrae/orgs", "received_events_url": "https://api.github.com/users/umbrae/received_events", "repos_url": "https://api.github.com/users/umbrae/repos", "site_admin": false, "starred_url": "https://api.github.com/users/umbrae/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/umbrae/subscriptions", "type": "User", "url": "https://api.github.com/users/umbrae", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2012-02-28T17:15:36Z
2021-09-08T23:05:23Z
2012-03-08T22:58:00Z
CONTRIBUTOR
resolved
To avoid UnicodeDecodeError's like on http://blip.fm/~1abvfu Note: This doesn't have a test, which sucks, because for the life of me I can't seem to figure out how to trigger this error with httpbin. Maybe flask has better handling of UTF-8 characters than the server used at blip.fm and others? Really not sure. Here's an ad-hoc test for you: Before: ``` >>> import requests >>> requests.head('http://blip.fm/~1abvfu', allow_redirects=True) Traceback (most recent call last): File "<stdin>", line 1, in <module> File "requests/api.py", line 73, in head return request('head', url, **kwargs) File "requests/api.py", line 39, in request return s.request(method=method, url=url, **kwargs) File "requests/sessions.py", line 200, in request r.send(prefetch=prefetch) File "requests/models.py", line 559, in send self._build_response(r) File "requests/models.py", line 232, in _build_response url = urljoin(r.url, url) File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/urlparse.py", line 219, in urljoin params, query, fragment)) File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/urlparse.py", line 184, in urlunparse return urlunsplit((scheme, netloc, url, query, fragment)) File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/urlparse.py", line 190, in urlunsplit url = '//' + (netloc or '') + url UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 62: ordinal not in range(128) ``` After: ``` >>> import requests >>> requests.head('http://blip.fm/~1abvfu', allow_redirects=True) <Response [200]> ```
{ "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/461/reactions" }
https://api.github.com/repos/psf/requests/issues/461/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/461.diff", "html_url": "https://github.com/psf/requests/pull/461", "merged_at": "2012-03-08T22:58:00Z", "patch_url": "https://github.com/psf/requests/pull/461.patch", "url": "https://api.github.com/repos/psf/requests/pulls/461" }
true
[ "Note that you can't assume that the Location header will be UTF-8 (as opposed to another encoding), so the correct fix is actually to quote the string (the commit in #472 gets it right)\n", "Glad to hear someone took care of it.\n" ]
https://api.github.com/repos/psf/requests/issues/460
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/460/labels{/name}
https://api.github.com/repos/psf/requests/issues/460/comments
https://api.github.com/repos/psf/requests/issues/460/events
https://github.com/psf/requests/issues/460
3,406,236
MDU6SXNzdWUzNDA2MjM2
460
Path quoting is unnecessarily aggressive
{ "avatar_url": "https://avatars.githubusercontent.com/u/45699?v=4", "events_url": "https://api.github.com/users/dvogel/events{/privacy}", "followers_url": "https://api.github.com/users/dvogel/followers", "following_url": "https://api.github.com/users/dvogel/following{/other_user}", "gists_url": "https://api.github.com/users/dvogel/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/dvogel", "id": 45699, "login": "dvogel", "node_id": "MDQ6VXNlcjQ1Njk5", "organizations_url": "https://api.github.com/users/dvogel/orgs", "received_events_url": "https://api.github.com/users/dvogel/received_events", "repos_url": "https://api.github.com/users/dvogel/repos", "site_admin": false, "starred_url": "https://api.github.com/users/dvogel/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/dvogel/subscriptions", "type": "User", "url": "https://api.github.com/users/dvogel", "user_view_type": "public" }
[]
closed
true
null
[]
null
5
2012-02-27T19:11:18Z
2021-09-09T09:00:47Z
2012-03-08T01:20:27Z
NONE
resolved
`utils.requote_path` passes `safe=b""` into `urllib.quote`, which causes some characters to be encoded that don't have to be. This is allowed by the [RFC](http://www.faqs.org/rfcs/rfc1738.html), however there is some ambiguity in the RFC as to whether the encoded characters have the same meaning as their unencoded representations. This ambiguity allows [some web servers](http://www.latimes.com/health/la-he-qnexa-fda-20120223,0,1643846.story) to consider _/a,b_ and _/a%2Cb_ to refer to different resources. I think we should only encode characters that must be encoded, as that should lead to the widest compatibility. This would mean passing `safe=b"$+!*'(),"` to urllib.quote. Alternatively, `Request` could acccept a parameter to pass on as the `safe` argument to `urllib.quote`.
{ "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/460/reactions" }
https://api.github.com/repos/psf/requests/issues/460/timeline
null
completed
null
null
false
[ "I'm not against `safe=b\"$+!*'(),\"`. \n", "I'd love to be abled to pass my own safe string--I'm running into an issue where '=' is used in the path (not the query string) and requests quoting it is causing the server to 404\n", "A new configuration perhaps?\n\n## \n\nKenneth Reitz\n\nOn Mar 7, 2012, at 1:41 PM, Mark [email protected] wrote:\n\n> I'd love to be abled to pass my own safe string--I'm running into an issue where '=' is used in the path (not the query string) and requests quoting it is causing the server to 404\n> \n> ---\n> \n> Reply to this email directly or view it on GitHub:\n> https://github.com/kennethreitz/requests/issues/460#issuecomment-4374303\n", "Sorry for my comment--looks like 0.10.6 works for my case (we were on a pretty old version). A new config may be nice, but it's no longer pressing for my issue.\n\nAs a side note, requests is a great library--I'm a huge fan.\n", "Requests v0.10.7 was just released with a new `encode_uri` configuration!\n" ]
https://api.github.com/repos/psf/requests/issues/459
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/459/labels{/name}
https://api.github.com/repos/psf/requests/issues/459/comments
https://api.github.com/repos/psf/requests/issues/459/events
https://github.com/psf/requests/issues/459
3,395,038
MDU6SXNzdWUzMzk1MDM4
459
Unicode cookie key values fail in translate
{ "avatar_url": "https://avatars.githubusercontent.com/u/663390?v=4", "events_url": "https://api.github.com/users/mlakewood/events{/privacy}", "followers_url": "https://api.github.com/users/mlakewood/followers", "following_url": "https://api.github.com/users/mlakewood/following{/other_user}", "gists_url": "https://api.github.com/users/mlakewood/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/mlakewood", "id": 663390, "login": "mlakewood", "node_id": "MDQ6VXNlcjY2MzM5MA==", "organizations_url": "https://api.github.com/users/mlakewood/orgs", "received_events_url": "https://api.github.com/users/mlakewood/received_events", "repos_url": "https://api.github.com/users/mlakewood/repos", "site_admin": false, "starred_url": "https://api.github.com/users/mlakewood/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/mlakewood/subscriptions", "type": "User", "url": "https://api.github.com/users/mlakewood", "user_view_type": "public" }
[]
closed
true
null
[]
null
4
2012-02-27T01:34:21Z
2021-09-09T09:00:33Z
2012-05-03T06:33:32Z
NONE
resolved
Hi, the following code ``` import requests cookie = {u'test_cookie': 'foobar'} res = requests.get('http://httpbin.org/cookies', cookies=cookie) print res.cookies ``` thows the following error ``` Python File "requests_translate_bug.py", line 5, in <module> res = requests.get('http://httpbin.org/cookies', cookies=cookie) File "/home/markl/Envs/req-bug/lib/python2.6/site-packages/requests/api.py", line 51, in get return request('get', url, **kwargs) File "/home/markl/Envs/req-bug/lib/python2.6/site-packages/requests/api.py", line 39, in request return s.request(method=method, url=url, **kwargs) File "/home/markl/Envs/req-bug/lib/python2.6/site-packages/requests/sessions.py", line 200, in request r.send(prefetch=prefetch) File "/home/markl/Envs/req-bug/lib/python2.6/site-packages/requests/models.py", line 507, in send c[k] = v File "/home/markl/Envs/req-bug/lib/python2.6/site-packages/requests/packages/oreos/monkeys.py", line 604, in __setitem__ self.__set(key, rval, cval) File "/home/markl/Envs/req-bug/lib/python2.6/site-packages/requests/packages/oreos/monkeys.py", line 597, in __set M.set(key, real_value, coded_value) File "/home/markl/Envs/req-bug/lib/python2.6/site-packages/requests/packages/oreos/monkeys.py", line 470, in set if "" != translate(key, idmap, LegalChars): File "/usr/lib/python2.6/string.py", line 493, in translate return s.translate(table, deletions) TypeError: translate() takes exactly one argument (2 given) ``` If the key in the cookies dictionary isnt a unicode character then this doesnt happen. (req-bug)markl@markl-desktop:~/dev/requests-bug$ pip freeze certifi==0.0.8 chardet==1.0.1 requests==0.10.6 wsgiref==0.1.2 (req-bug)markl@markl-desktop:~/dev/requests-bug$ Hope it helps. Cheers Mark
{ "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/459/reactions" }
https://api.github.com/repos/psf/requests/issues/459/timeline
null
completed
null
null
false
[ "This is related to #536. The root cause is that HTML headers only support Latin-1 encoding, so unicode is not allowed in either the key or the data within a cookie. It appears that httpbin is happy to ignore this, and so it is sending back invalid cookies with unicode encoding.\n\nThe correct solution is to urlencode the contents of a cookie before setting, but ideally this would be done before it's passed in to requests.\n\nAny thoughts on whether it makes sense to try to handle this case within requests? Or, would it just be better to throw an error that is more descriptive?\n", "I can see where you coming from in regards to the HTML spec and Latin-1 encoding. I guess the risks as far as requests fixing a unicode key is that its unable to translate it to Latin-1 for some reason and then the request breaks which could be much harder to track down.\n\nProbably a better error would be the best way and possibly a check up front in terms of the request?\n", "Original test case no longer crashes:\n\n```\n>>> import requests\n>>> cookie = {u'test_cookie': 'foobar'}\n>>> res = requests.get('http://httpbin.org/cookies', cookies=cookie)\n>>> print res.cookies\n<<class 'requests.cookies.RequestsCookieJar'>[<Cookie test_cookie=foobar for />]>\n>>> cookie = list(res.cookies)[0]\n>>> cookie.name, cookie.value\n(u'test_cookie', 'foobar')\n```\n\nI think this is probably resolved, since `cookielib` is taking care of unicode-to-bytes now.\n", "\\o/\n" ]
https://api.github.com/repos/psf/requests/issues/458
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/458/labels{/name}
https://api.github.com/repos/psf/requests/issues/458/comments
https://api.github.com/repos/psf/requests/issues/458/events
https://github.com/psf/requests/issues/458
3,394,145
MDU6SXNzdWUzMzk0MTQ1
458
requests should send "Connection: close" if keep-alive is disabled
{ "avatar_url": "https://avatars.githubusercontent.com/u/1476786?v=4", "events_url": "https://api.github.com/users/craigholm/events{/privacy}", "followers_url": "https://api.github.com/users/craigholm/followers", "following_url": "https://api.github.com/users/craigholm/following{/other_user}", "gists_url": "https://api.github.com/users/craigholm/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/craigholm", "id": 1476786, "login": "craigholm", "node_id": "MDQ6VXNlcjE0NzY3ODY=", "organizations_url": "https://api.github.com/users/craigholm/orgs", "received_events_url": "https://api.github.com/users/craigholm/received_events", "repos_url": "https://api.github.com/users/craigholm/repos", "site_admin": false, "starred_url": "https://api.github.com/users/craigholm/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/craigholm/subscriptions", "type": "User", "url": "https://api.github.com/users/craigholm", "user_view_type": "public" }
[ { "color": "e10c02", "default": false, "description": null, "id": 117744, "name": "Bug", "node_id": "MDU6TGFiZWwxMTc3NDQ=", "url": "https://api.github.com/repos/psf/requests/labels/Bug" } ]
closed
true
null
[]
null
6
2012-02-26T23:17:29Z
2021-09-09T00:34:26Z
2012-06-15T18:41:19Z
NONE
resolved
From Section 14.10 of RFC2616: 'HTTP/1.1 applications that do not support persistent connections MUST include the "close" connection option in every message.' If keep-alive is disabled, a session object creates a new connection for each request, but each previous connection isn't closed until the connection times out or the garbage collector takes care of it. This wastes resources on both sides of the connection. (As an aside, I've noticed that http://httpbin.org/headers returns "Connection: keep-alive" in the headers object even if the client sent "Connection: close").
{ "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/458/reactions" }
https://api.github.com/repos/psf/requests/issues/458/timeline
null
completed
null
null
false
[ "Keep-alive is almost always on, really. \n", "@kennethreitz - what if I explicitly want it off?\n", "@yuvadm why?\n", "@kennethreitz for example, if I'm on a server with limited resources and I know for sure that I'm making a single connection that should immediately be closed.\n", "The client will now send `Connection: close`, but I'm not 100% sure the interaction with local connection pooling is correct. In particular, if you set `config={'keep_alive': False}` in the test case at #520, the sockets remain open, but they're in the `CLOSE_WAIT` state instead of `ESTABLISHED`.\n\nI'm going to leave this open until the situation with #520 has been clarified.\n", "I think I understand this a little better now. Probably the Right Thing is for `urllib3.HTTPResponse` to look in the headers and close the connection if the server sent `Connection: close`.\n" ]
https://api.github.com/repos/psf/requests/issues/457
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/457/labels{/name}
https://api.github.com/repos/psf/requests/issues/457/comments
https://api.github.com/repos/psf/requests/issues/457/events
https://github.com/psf/requests/pull/457
3,388,993
MDExOlB1bGxSZXF1ZXN0ODg2NTI3
457
[enh] async.imap added -- generator object handling
{ "avatar_url": "https://avatars.githubusercontent.com/u/20240?v=4", "events_url": "https://api.github.com/users/asciimoo/events{/privacy}", "followers_url": "https://api.github.com/users/asciimoo/followers", "following_url": "https://api.github.com/users/asciimoo/following{/other_user}", "gists_url": "https://api.github.com/users/asciimoo/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/asciimoo", "id": 20240, "login": "asciimoo", "node_id": "MDQ6VXNlcjIwMjQw", "organizations_url": "https://api.github.com/users/asciimoo/orgs", "received_events_url": "https://api.github.com/users/asciimoo/received_events", "repos_url": "https://api.github.com/users/asciimoo/repos", "site_admin": false, "starred_url": "https://api.github.com/users/asciimoo/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/asciimoo/subscriptions", "type": "User", "url": "https://api.github.com/users/asciimoo", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2012-02-26T03:38:15Z
2021-09-08T23:01:13Z
2012-02-26T03:40:24Z
CONTRIBUTOR
resolved
standard async map eats huge amount of memory depending on the number/size of requests, imap solves this problem. sample usage: ``` python from requests import async requests = (async.get('http://127.0.0.1/%d' % i) for i in xrange(100000)) for response in async.imap(requests, size=10): print response.text ```
{ "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/457/reactions" }
https://api.github.com/repos/psf/requests/issues/457/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/457.diff", "html_url": "https://github.com/psf/requests/pull/457", "merged_at": "2012-02-26T03:40:24Z", "patch_url": "https://github.com/psf/requests/pull/457.patch", "url": "https://api.github.com/repos/psf/requests/pulls/457" }
true
[ "Beautiful. Thanks!\n", "\\o/\n" ]
https://api.github.com/repos/psf/requests/issues/456
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/456/labels{/name}
https://api.github.com/repos/psf/requests/issues/456/comments
https://api.github.com/repos/psf/requests/issues/456/events
https://github.com/psf/requests/issues/456
3,375,549
MDU6SXNzdWUzMzc1NTQ5
456
Custom client SSL certificate
{ "avatar_url": "https://avatars.githubusercontent.com/u/188063?v=4", "events_url": "https://api.github.com/users/viraptor/events{/privacy}", "followers_url": "https://api.github.com/users/viraptor/followers", "following_url": "https://api.github.com/users/viraptor/following{/other_user}", "gists_url": "https://api.github.com/users/viraptor/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/viraptor", "id": 188063, "login": "viraptor", "node_id": "MDQ6VXNlcjE4ODA2Mw==", "organizations_url": "https://api.github.com/users/viraptor/orgs", "received_events_url": "https://api.github.com/users/viraptor/received_events", "repos_url": "https://api.github.com/users/viraptor/repos", "site_admin": false, "starred_url": "https://api.github.com/users/viraptor/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/viraptor/subscriptions", "type": "User", "url": "https://api.github.com/users/viraptor", "user_view_type": "public" }
[]
closed
true
null
[]
null
7
2012-02-24T16:57:26Z
2021-09-09T09:00:43Z
2012-03-14T23:04:21Z
NONE
resolved
Either it's not available in the documentation or not implemented at all, but I'd like to set the certificate I want to use myself. Ideally that would accept pkcs12, or cert+key PEM file.
{ "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/456/reactions" }
https://api.github.com/repos/psf/requests/issues/456/timeline
null
completed
null
null
false
[ "You can do a PEM file today. you pass the PEM to the `verify` argument. \n\nYou can also set the `REQUESTS_CA_BUNDLE` OR `CURL_CA_BUNDLE` environment variable.\n", "I just checked this, but it seems the `verify` option is for something a bit different. It allows you to pass your own CA / trust chain and verify the other end against it. What I'm looking for is a way to pass my own key and certificate for the client side. Those parameters are called `key_file` and `cert_file` in urllib3.\nI'd like to reopen this bug if possible.\n", "Sorry for the misunderstanding. \n\nI'd love to support this if the right API can be determined.\n", "``` python\n# Default, CA Bundle, like browser. Today.\nrequests.get(..., verify=True)\n\n# No SSL check. Today.\nrequests.get(..., verify=False)\n\n# Private PEM\nrequests.get(..., cert='/path/to.pem')\n\n# Private Cert / Key\nrequests.get(..., cert=('cert', 'key'))\n\n# No SSL check.\nrequests.get(..., cert='/path/to.pem', verify=False)\n```\n", "I had this same need, and quickly implemented it:\n\nhttps://github.com/kennethreitz/requests/pull/485\n\nMy api might not be as pretty as you'd like, but it seems to work for me.\n", "@chadnickbok this looks great! Moving discussion to that thread.\n", "Moving to #485\n" ]
https://api.github.com/repos/psf/requests/issues/455
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/455/labels{/name}
https://api.github.com/repos/psf/requests/issues/455/comments
https://api.github.com/repos/psf/requests/issues/455/events
https://github.com/psf/requests/issues/455
3,375,016
MDU6SXNzdWUzMzc1MDE2
455
Regression: cookie values containing '/' are quoted
{ "avatar_url": "https://avatars.githubusercontent.com/u/464726?v=4", "events_url": "https://api.github.com/users/millerdev/events{/privacy}", "followers_url": "https://api.github.com/users/millerdev/followers", "following_url": "https://api.github.com/users/millerdev/following{/other_user}", "gists_url": "https://api.github.com/users/millerdev/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/millerdev", "id": 464726, "login": "millerdev", "node_id": "MDQ6VXNlcjQ2NDcyNg==", "organizations_url": "https://api.github.com/users/millerdev/orgs", "received_events_url": "https://api.github.com/users/millerdev/received_events", "repos_url": "https://api.github.com/users/millerdev/repos", "site_admin": false, "starred_url": "https://api.github.com/users/millerdev/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/millerdev/subscriptions", "type": "User", "url": "https://api.github.com/users/millerdev", "user_view_type": "public" }
[]
closed
true
null
[]
null
4
2012-02-24T16:28:32Z
2021-09-09T09:00:32Z
2012-05-03T23:11:17Z
NONE
resolved
This seems to be a similar issue to that described in #440. This is a regression since Requests v0.7.6 (well, that's the previous version I was using), which did not quote cookie values containing a `/` character. The session cookie that I send to an internal web service stopped working when I upgraded to 0.10.4. The server does not recognize the quoted cookie value sent by 0.10.4. Unfortunately I have no control over the server, so I think changing requests is my only option.
{ "avatar_url": "https://avatars.githubusercontent.com/u/464726?v=4", "events_url": "https://api.github.com/users/millerdev/events{/privacy}", "followers_url": "https://api.github.com/users/millerdev/followers", "following_url": "https://api.github.com/users/millerdev/following{/other_user}", "gists_url": "https://api.github.com/users/millerdev/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/millerdev", "id": 464726, "login": "millerdev", "node_id": "MDQ6VXNlcjQ2NDcyNg==", "organizations_url": "https://api.github.com/users/millerdev/orgs", "received_events_url": "https://api.github.com/users/millerdev/received_events", "repos_url": "https://api.github.com/users/millerdev/repos", "site_admin": false, "starred_url": "https://api.github.com/users/millerdev/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/millerdev/subscriptions", "type": "User", "url": "https://api.github.com/users/millerdev", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/455/reactions" }
https://api.github.com/repos/psf/requests/issues/455/timeline
null
completed
null
null
false
[ "Does the test case for backslashes at #440 suffice to close this also?\n", "I'm not sure. The #450 changeset does not appear to fix this issue. Maybe `/` should be added to the `_RFC2965Forbidden` exception list? I am running a patched version of Requests that does exactly that.\n\nOn the other hand, I'm not sure if the conclusion reached in #440 (\"that valid cookie chars are any ASCII char excepting comma, colon, backslash, double-quote, control characters and whitespace\") is properly implemented by the [current version of oreos/monkeys.py](https://github.com/kennethreitz/requests/blob/ee861f42873ed3b19dd382c3d6fb9e0d5a7521cf/requests/packages/oreos/monkeys.py).\n", "Sorry, that was unclear. The relevant discussion at #440 is not the referenced changeset, but rather the fact that this test case:\n\nhttps://github.com/kennethreitz/requests/issues/440#issuecomment-5481547\n\npasses under v0.12.0 (master branch / pip). Master is no longer using oreos, it's using `cookielib`.\n", "Ah, I see. Yes, that appears to resolve this issue. I did a quick test here and observe this:\n\n```\n$ pip install \"requests==0.10.4\"\n$ python\nPython 2.6.4 (r264:75821M, Oct 27 2009, 19:48:32) \n[GCC 4.0.1 (Apple Inc. build 5493)] on darwin\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\n>>> import requests\n>>> print requests.get('http://httpbin.org/headers', cookies={\"this_is_a\": \"slash/\"}).text\n{\n \"headers\": {\n \"Content-Length\": \"\", \n \"Accept-Encoding\": \"identity, deflate, compress, gzip\", \n \"Connection\": \"keep-alive\", \n \"Accept\": \"*/*\", \n \"User-Agent\": \"python-requests/0.10.4\", \n \"Host\": \"httpbin.org\", \n \"Cookie\": \"this_is_a=\\\"slash/\\\"\", \n \"Content-Type\": \"\"\n }\n}\n>>> \n\n$ pip install \"requests==0.12.0\"\n$ python\nPython 2.6.4 (r264:75821M, Oct 27 2009, 19:48:32) \n[GCC 4.0.1 (Apple Inc. build 5493)] on darwin\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\n>>> import requests\n>>> print requests.get('http://httpbin.org/headers', cookies={\"this_is_a\": \"slash/\"}).text\n{\n \"headers\": {\n \"Content-Length\": \"\", \n \"Accept-Encoding\": \"identity, deflate, compress, gzip\", \n \"Connection\": \"keep-alive\", \n \"Accept\": \"*/*\", \n \"User-Agent\": \"python-requests/0.12.0\", \n \"Host\": \"httpbin.org\", \n \"Cookie\": \"this_is_a=slash/\", \n \"Content-Type\": \"\"\n }\n}\n>>> \n```\n" ]
https://api.github.com/repos/psf/requests/issues/454
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/454/labels{/name}
https://api.github.com/repos/psf/requests/issues/454/comments
https://api.github.com/repos/psf/requests/issues/454/events
https://github.com/psf/requests/issues/454
3,374,901
MDU6SXNzdWUzMzc0OTAx
454
'already consumed' accessing response.text with Content-Length: 0
{ "avatar_url": "https://avatars.githubusercontent.com/u/22370?v=4", "events_url": "https://api.github.com/users/charles-dyfis-net/events{/privacy}", "followers_url": "https://api.github.com/users/charles-dyfis-net/followers", "following_url": "https://api.github.com/users/charles-dyfis-net/following{/other_user}", "gists_url": "https://api.github.com/users/charles-dyfis-net/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/charles-dyfis-net", "id": 22370, "login": "charles-dyfis-net", "node_id": "MDQ6VXNlcjIyMzcw", "organizations_url": "https://api.github.com/users/charles-dyfis-net/orgs", "received_events_url": "https://api.github.com/users/charles-dyfis-net/received_events", "repos_url": "https://api.github.com/users/charles-dyfis-net/repos", "site_admin": false, "starred_url": "https://api.github.com/users/charles-dyfis-net/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/charles-dyfis-net/subscriptions", "type": "User", "url": "https://api.github.com/users/charles-dyfis-net", "user_view_type": "public" }
[]
closed
true
null
[]
null
9
2012-02-24T16:22:26Z
2021-09-09T09:00:48Z
2012-02-26T04:24:04Z
NONE
resolved
``` >>> import requests >>> requests.__version__ '0.10.4' >>> response = requests.get('http://httpbin.org/stream/0') >>> response.text Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/cduffy/VC/releng-db/virtualenv/local/lib/python2.7/site-packages/requests/models.py", line 774, in text content = str(self.content, encoding, errors='replace') File "/home/cduffy/VC/releng-db/virtualenv/local/lib/python2.7/site-packages/requests/models.py", line 740, in content 'The content for this response was already consumed') RuntimeError: The content for this response was already consumed ```
{ "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/454/reactions" }
https://api.github.com/repos/psf/requests/issues/454/timeline
null
completed
null
null
false
[ "Does this happen every time for you?\n", "Yes, this is 100% reproducible in my environment.\n", "Funny thing; I have two virtualenvs with requests 0.10.4 and in one of them I get above traceback while in the other one I get `None`.\n", "@piotr-dobrogost, i bet in one you don't have the 'chardet' dependency available.\n", "This is an extremely serious bug. \n", "https://github.com/kennethreitz/requests/blob/develop/requests/models.py#L742 might be the source: if iter_content() returns nothing - as should be the case with `Content-Length: 0` - it will set _content to None which is also used as a sentinel value.\n", "I'm seeing this error as well, basic traceback:\n\n```\n File \"runfats.py\", line 117, in runfat\n out.append(ctx.response.content)\n File \"/Users/eric/.virtualenvs/fats/lib/python2.6/site-packages/requests/models.py\", line 740, in content\n 'The content for this response was already consumed')\n RuntimeError: The content for this response was already consumed\n```\n", "I'm working on this as we speak.\n", "Fix released.\n" ]
https://api.github.com/repos/psf/requests/issues/453
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/453/labels{/name}
https://api.github.com/repos/psf/requests/issues/453/comments
https://api.github.com/repos/psf/requests/issues/453/events
https://github.com/psf/requests/issues/453
3,362,507
MDU6SXNzdWUzMzYyNTA3
453
Warn CookieErrors
{ "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
2012-02-23T20:32:06Z
2021-09-09T09:00:34Z
2012-05-03T06:25:56Z
CONTRIBUTOR
resolved
#335
{ "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/453/reactions" }
https://api.github.com/repos/psf/requests/issues/453/timeline
null
completed
null
null
false
[ "Possibly obviated:\n\n```\n>>> import requests\n>>> c = requests.get('http://www.miniclip.com/games/en/').cookies\n>>> c\n<<class 'requests.cookies.RequestsCookieJar'>[Cookie(version=0, name='ad_is_enabled-position2:homepage', value='true', port=None, port_specified=False, domain='.miniclip.com', domain_specified=True, domain_initial_dot=True, path='/', path_specified=True, secure=False, expires=1336026534, discard=False, comment=None, comment_url=None, rest={}, rfc2109=False), Cookie(version=0, name='ad_is_enabled-showcase:homepage', value='false', port=None, port_specified=False, domain='.miniclip.com', domain_specified=True, domain_initial_dot=True, path='/', path_specified=True, secure=False, expires=1336026534, discard=False, comment=None, comment_url=None, rest={}, rfc2109=False), Cookie(version=0, name='ad_is_enabled-supershowcase:homepage', value='true', port=None, port_specified=False, domain='.miniclip.com', domain_specified=True, domain_initial_dot=True, path='/', path_specified=True, secure=False, expires=1336026534, discard=False, comment=None, comment_url=None, rest={}, rfc2109=False), Cookie(version=0, name='ipLocation', value='US', port=None, port_specified=False, domain='.miniclip.com', domain_specified=True, domain_initial_dot=True, path='/', path_specified=True, secure=False, expires=1367562234, discard=False, comment=None, comment_url=None, rest={}, rfc2109=False), Cookie(version=0, name='language', value='en', port=None, port_specified=False, domain='.miniclip.com', domain_specified=True, domain_initial_dot=True, path='/', path_specified=True, secure=False, expires=1336458234, discard=False, comment=None, comment_url=None, rest={}, rfc2109=False), Cookie(version=0, name='PHPSESSID', value='2332060593395073024-1012474929-3899013470707777536', port=None, port_specified=False, domain='www.miniclip.com', domain_specified=False, domain_initial_dot=False, path='/', path_specified=True, secure=False, expires=1367562234, discard=False, comment=None, comment_url=None, rest={}, rfc2109=False)]>\n>>> [(cookie.name, cookie.value) for cookie in c]\n[('ad_is_enabled-position2:homepage', 'true'), ('ad_is_enabled-showcase:homepage', 'false'), ('ad_is_enabled-supershowcase:homepage', 'true'), ('ipLocation', 'US'), ('language', 'en'), ('PHPSESSID', '2332060593395073024-1012474929-3899013470707777536')]\n```\n", "Good enough for me :)\n" ]
https://api.github.com/repos/psf/requests/issues/452
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/452/labels{/name}
https://api.github.com/repos/psf/requests/issues/452/comments
https://api.github.com/repos/psf/requests/issues/452/events
https://github.com/psf/requests/pull/452
3,358,652
MDExOlB1bGxSZXF1ZXN0ODc0ODA2
452
get_unicode_from_response returned str instead of unicode
{ "avatar_url": "https://avatars.githubusercontent.com/u/283441?v=4", "events_url": "https://api.github.com/users/honzajavorek/events{/privacy}", "followers_url": "https://api.github.com/users/honzajavorek/followers", "following_url": "https://api.github.com/users/honzajavorek/following{/other_user}", "gists_url": "https://api.github.com/users/honzajavorek/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/honzajavorek", "id": 283441, "login": "honzajavorek", "node_id": "MDQ6VXNlcjI4MzQ0MQ==", "organizations_url": "https://api.github.com/users/honzajavorek/orgs", "received_events_url": "https://api.github.com/users/honzajavorek/received_events", "repos_url": "https://api.github.com/users/honzajavorek/repos", "site_admin": false, "starred_url": "https://api.github.com/users/honzajavorek/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/honzajavorek/subscriptions", "type": "User", "url": "https://api.github.com/users/honzajavorek", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2012-02-23T16:29:48Z
2021-09-08T14:01:02Z
2012-02-26T04:15:57Z
CONTRIBUTOR
resolved
A typo causing `TypeError: str() takes at most 1 argument (2 given)`.
{ "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/452/reactions" }
https://api.github.com/repos/psf/requests/issues/452/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/452.diff", "html_url": "https://github.com/psf/requests/pull/452", "merged_at": "2012-02-26T04:15:57Z", "patch_url": "https://github.com/psf/requests/pull/452.patch", "url": "https://api.github.com/repos/psf/requests/pulls/452" }
true
[ "Thanks!\n", "You are welcome. I'm sorry, I got sick and I couldn't send amended changes. At least my pull request initiated the fix :-)\n" ]
https://api.github.com/repos/psf/requests/issues/451
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/451/labels{/name}
https://api.github.com/repos/psf/requests/issues/451/comments
https://api.github.com/repos/psf/requests/issues/451/events
https://github.com/psf/requests/pull/451
3,334,076
MDExOlB1bGxSZXF1ZXN0ODY3MzM3
451
Recalculating body and content type after hooks
{ "avatar_url": "https://avatars.githubusercontent.com/u/252257?v=4", "events_url": "https://api.github.com/users/maraujop/events{/privacy}", "followers_url": "https://api.github.com/users/maraujop/followers", "following_url": "https://api.github.com/users/maraujop/following{/other_user}", "gists_url": "https://api.github.com/users/maraujop/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/maraujop", "id": 252257, "login": "maraujop", "node_id": "MDQ6VXNlcjI1MjI1Nw==", "organizations_url": "https://api.github.com/users/maraujop/orgs", "received_events_url": "https://api.github.com/users/maraujop/received_events", "repos_url": "https://api.github.com/users/maraujop/repos", "site_admin": false, "starred_url": "https://api.github.com/users/maraujop/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/maraujop/subscriptions", "type": "User", "url": "https://api.github.com/users/maraujop", "user_view_type": "public" }
[]
closed
true
null
[]
null
8
2012-02-22T15:19:15Z
2021-09-08T14:01:02Z
2012-05-08T05:04:51Z
NONE
resolved
This a patch for issue #GH-445 Perfomance improvements are left to be done. For example, only recalculating when `request.data` or `request.files` have changed. - File pointers are reset to position 0 to re-read files, when `_encode_body` is called several times. - _enc_data is recalculated using data which might have changed.
{ "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/451/reactions" }
https://api.github.com/repos/psf/requests/issues/451/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/451.diff", "html_url": "https://github.com/psf/requests/pull/451", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/451.patch", "url": "https://api.github.com/repos/psf/requests/pulls/451" }
true
[ "Sorry for the delay on this. Do you think there will be problems with this once we move to streaming uploads?\n", "Integrating the offered solution (42392c9) with streaming uploads will definitely take a little bit of reworking but the time spent reworking things would be worth it. How soon is the streaming uploads work going to be folded into master?\n", "This is the first time I hear about streaming uploads in requests. But my guess is that as I reset the pointer in the file to 0 using `seek`, this will cause trouble. \n\nThere are many possible alternatives to solve this bug. I've fixed it for the current version of requests. Anyhow, as you understand this is necessary for the hook system to be able to alter the data sent by requests. \n\nAs soon as this solution or any other goes into requests core, I will release a new version of requests-oauth that will be very stable and cover pretty much the whole OAuth spec.\n\nCheers,\nMiguel\n", "I'm more and more tempted to move to only generators on the streaming uploads. Some interesting thoughts on this happened this weekend.\n", "As we've mentioned, boto will need streaming uploads, so we'd love to help however we can here.\n", "Kenneth, \n\nhow long are streaming uploads going to take? I'm thinking you could merge a solution to make the hook system more flexible. Then adapt it when streaming uploads and other features land in. Meanwhile I could unblock the development of requests-oauth.\n\nAlso, if you guys don't mind. I think streaming uploads should be discussed in a separate issue. \n\nCheers,\nMiguel\n", "+1 for getting this merged. See https://github.com/maraujop/requests-oauth/issues/20\n", "This shouldn't be an issue anymore, since we moved the location of the `auth` hook section.\n" ]
https://api.github.com/repos/psf/requests/issues/450
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/450/labels{/name}
https://api.github.com/repos/psf/requests/issues/450/comments
https://api.github.com/repos/psf/requests/issues/450/events
https://github.com/psf/requests/pull/450
3,323,771
MDExOlB1bGxSZXF1ZXN0ODYzOTUy
450
Issue #440: Accept '=' in cookie keys.
{ "avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4", "events_url": "https://api.github.com/users/Lukasa/events{/privacy}", "followers_url": "https://api.github.com/users/Lukasa/followers", "following_url": "https://api.github.com/users/Lukasa/following{/other_user}", "gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Lukasa", "id": 1382556, "login": "Lukasa", "node_id": "MDQ6VXNlcjEzODI1NTY=", "organizations_url": "https://api.github.com/users/Lukasa/orgs", "received_events_url": "https://api.github.com/users/Lukasa/received_events", "repos_url": "https://api.github.com/users/Lukasa/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions", "type": "User", "url": "https://api.github.com/users/Lukasa", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2012-02-21T23:28:58Z
2021-09-08T14:01:01Z
2012-02-26T04:14:11Z
MEMBER
resolved
This fix resolves issues #440 and #286 by allowing the '=' character in cookie values.
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/450/reactions" }
https://api.github.com/repos/psf/requests/issues/450/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/450.diff", "html_url": "https://github.com/psf/requests/pull/450", "merged_at": "2012-02-26T04:14:11Z", "patch_url": "https://github.com/psf/requests/pull/450.patch", "url": "https://api.github.com/repos/psf/requests/pulls/450" }
true
[ "Thanks!\n" ]
https://api.github.com/repos/psf/requests/issues/449
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/449/labels{/name}
https://api.github.com/repos/psf/requests/issues/449/comments
https://api.github.com/repos/psf/requests/issues/449/events
https://github.com/psf/requests/pull/449
3,322,238
MDExOlB1bGxSZXF1ZXN0ODYzMzIw
449
Don't bonk if .netrc isn't readable
{ "avatar_url": "https://avatars.githubusercontent.com/u/272675?v=4", "events_url": "https://api.github.com/users/benweatherman/events{/privacy}", "followers_url": "https://api.github.com/users/benweatherman/followers", "following_url": "https://api.github.com/users/benweatherman/following{/other_user}", "gists_url": "https://api.github.com/users/benweatherman/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/benweatherman", "id": 272675, "login": "benweatherman", "node_id": "MDQ6VXNlcjI3MjY3NQ==", "organizations_url": "https://api.github.com/users/benweatherman/orgs", "received_events_url": "https://api.github.com/users/benweatherman/received_events", "repos_url": "https://api.github.com/users/benweatherman/repos", "site_admin": false, "starred_url": "https://api.github.com/users/benweatherman/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/benweatherman/subscriptions", "type": "User", "url": "https://api.github.com/users/benweatherman", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2012-02-21T21:53:54Z
2021-09-08T14:01:00Z
2012-02-21T21:55:50Z
CONTRIBUTOR
resolved
It's possible in some shared hosting environments that the .netrc file isn't readable by the user for the calling process. In that circumstance, just forgo the netrc authentication.
{ "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/449/reactions" }
https://api.github.com/repos/psf/requests/issues/449/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/449.diff", "html_url": "https://github.com/psf/requests/pull/449", "merged_at": "2012-02-21T21:55:50Z", "patch_url": "https://github.com/psf/requests/pull/449.patch", "url": "https://api.github.com/repos/psf/requests/pulls/449" }
true
[ "Thanks! Nice catch.\n" ]
https://api.github.com/repos/psf/requests/issues/448
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/448/labels{/name}
https://api.github.com/repos/psf/requests/issues/448/comments
https://api.github.com/repos/psf/requests/issues/448/events
https://github.com/psf/requests/issues/448
3,314,778
MDU6SXNzdWUzMzE0Nzc4
448
request body expects unicode instead of bytes
{ "avatar_url": "https://avatars.githubusercontent.com/u/1458134?v=4", "events_url": "https://api.github.com/users/mstan-xx/events{/privacy}", "followers_url": "https://api.github.com/users/mstan-xx/followers", "following_url": "https://api.github.com/users/mstan-xx/following{/other_user}", "gists_url": "https://api.github.com/users/mstan-xx/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/mstan-xx", "id": 1458134, "login": "mstan-xx", "node_id": "MDQ6VXNlcjE0NTgxMzQ=", "organizations_url": "https://api.github.com/users/mstan-xx/orgs", "received_events_url": "https://api.github.com/users/mstan-xx/received_events", "repos_url": "https://api.github.com/users/mstan-xx/repos", "site_admin": false, "starred_url": "https://api.github.com/users/mstan-xx/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/mstan-xx/subscriptions", "type": "User", "url": "https://api.github.com/users/mstan-xx", "user_view_type": "public" }
[]
closed
true
null
[]
null
3
2012-02-21T17:23:21Z
2021-09-09T09:00:45Z
2012-03-08T14:15:36Z
NONE
resolved
The documentation states that : data – (optional) Dictionary or bytes to send in the body of the Request However the code in models.py (line 429 in 0.10.4) uses : "isinstance(self.data, str)" to check for non-form data, and "str" was imported from requests.compat as unicode (str for python 3, unicode for python 2) This means that: 1. implementation does not conform to documentation 2. unexpected behaviour with python 2.x, for example calling requests.post(url, data="mydata") will NOT result in a non-encoded data, because "mydata" will be a byte string, not a unicode one I was expecting both unicode and bytes to be considered non-form data parameters
{ "avatar_url": "https://avatars.githubusercontent.com/u/1458134?v=4", "events_url": "https://api.github.com/users/mstan-xx/events{/privacy}", "followers_url": "https://api.github.com/users/mstan-xx/followers", "following_url": "https://api.github.com/users/mstan-xx/following{/other_user}", "gists_url": "https://api.github.com/users/mstan-xx/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/mstan-xx", "id": 1458134, "login": "mstan-xx", "node_id": "MDQ6VXNlcjE0NTgxMzQ=", "organizations_url": "https://api.github.com/users/mstan-xx/orgs", "received_events_url": "https://api.github.com/users/mstan-xx/received_events", "repos_url": "https://api.github.com/users/mstan-xx/repos", "site_admin": false, "starred_url": "https://api.github.com/users/mstan-xx/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/mstan-xx/subscriptions", "type": "User", "url": "https://api.github.com/users/mstan-xx", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/448/reactions" }
https://api.github.com/repos/psf/requests/issues/448/timeline
null
completed
null
null
false
[ "Also the tests hides the problem by importing str from request.compat, which is just wrong, unless importing request.compat is mentioned and required in the documentation. A test script should look and behave just like a regular client of the library.\n", "It seems that this problem is linked to the issue #444. requests.post(url, files=files) fails because the picture can't be converted from byte string to unicode. \n", "no longer reproducible\n" ]
https://api.github.com/repos/psf/requests/issues/447
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/447/labels{/name}
https://api.github.com/repos/psf/requests/issues/447/comments
https://api.github.com/repos/psf/requests/issues/447/events
https://github.com/psf/requests/pull/447
3,307,979
MDExOlB1bGxSZXF1ZXN0ODU4ODg3
447
Added StringIO/Image example to quickstart documentation.
{ "avatar_url": "https://avatars.githubusercontent.com/u/105168?v=4", "events_url": "https://api.github.com/users/dbrgn/events{/privacy}", "followers_url": "https://api.github.com/users/dbrgn/followers", "following_url": "https://api.github.com/users/dbrgn/following{/other_user}", "gists_url": "https://api.github.com/users/dbrgn/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/dbrgn", "id": 105168, "login": "dbrgn", "node_id": "MDQ6VXNlcjEwNTE2OA==", "organizations_url": "https://api.github.com/users/dbrgn/orgs", "received_events_url": "https://api.github.com/users/dbrgn/received_events", "repos_url": "https://api.github.com/users/dbrgn/repos", "site_admin": false, "starred_url": "https://api.github.com/users/dbrgn/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/dbrgn/subscriptions", "type": "User", "url": "https://api.github.com/users/dbrgn", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2012-02-21T08:26:24Z
2021-09-08T14:01:00Z
2012-02-21T08:27:16Z
CONTRIBUTOR
resolved
I added an example of how to create an Image object from the binary response content. I think this is quite a common issue.
{ "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/447/reactions" }
https://api.github.com/repos/psf/requests/issues/447/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/447.diff", "html_url": "https://github.com/psf/requests/pull/447", "merged_at": "2012-02-21T08:27:16Z", "patch_url": "https://github.com/psf/requests/pull/447.patch", "url": "https://api.github.com/repos/psf/requests/pulls/447" }
true
[ "I love it. Thanks!\n" ]
https://api.github.com/repos/psf/requests/issues/446
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/446/labels{/name}
https://api.github.com/repos/psf/requests/issues/446/comments
https://api.github.com/repos/psf/requests/issues/446/events
https://github.com/psf/requests/pull/446
3,300,604
MDExOlB1bGxSZXF1ZXN0ODU2NjQ3
446
.netrc support
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
[]
closed
true
null
[]
null
3
2012-02-20T20:36:57Z
2021-09-08T23:06:29Z
2012-02-20T21:21:05Z
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/446/reactions" }
https://api.github.com/repos/psf/requests/issues/446/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/446.diff", "html_url": "https://github.com/psf/requests/pull/446", "merged_at": "2012-02-20T21:21:05Z", "patch_url": "https://github.com/psf/requests/pull/446.patch", "url": "https://api.github.com/repos/psf/requests/pulls/446" }
true
[ "Please don't enable that by default or at least provide a way to make it stop from reading those files.\n", "It'll be on by default. I was thinking of adding a config for not using it though. \n", "trust_env = False\n" ]
https://api.github.com/repos/psf/requests/issues/445
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/445/labels{/name}
https://api.github.com/repos/psf/requests/issues/445/comments
https://api.github.com/repos/psf/requests/issues/445/events
https://github.com/psf/requests/issues/445
3,299,646
MDU6SXNzdWUzMjk5NjQ2
445
Impossible to alter body in hooks
{ "avatar_url": "https://avatars.githubusercontent.com/u/252257?v=4", "events_url": "https://api.github.com/users/maraujop/events{/privacy}", "followers_url": "https://api.github.com/users/maraujop/followers", "following_url": "https://api.github.com/users/maraujop/following{/other_user}", "gists_url": "https://api.github.com/users/maraujop/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/maraujop", "id": 252257, "login": "maraujop", "node_id": "MDQ6VXNlcjI1MjI1Nw==", "organizations_url": "https://api.github.com/users/maraujop/orgs", "received_events_url": "https://api.github.com/users/maraujop/received_events", "repos_url": "https://api.github.com/users/maraujop/repos", "site_admin": false, "starred_url": "https://api.github.com/users/maraujop/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/maraujop/subscriptions", "type": "User", "url": "https://api.github.com/users/maraujop", "user_view_type": "public" }
[]
closed
true
null
[]
null
5
2012-02-20T19:25:46Z
2021-09-09T08:00:35Z
2012-06-15T18:41:43Z
NONE
resolved
As you can see in this line: https://github.com/kennethreitz/requests/blob/develop/requests/models.py#L524 Body is precalculated and there is no way to alter it in a hook. It should be calculated after the hook. So if the hook alters `data` or `files`, it gets updated. Example. If I do this with requests-oauth: ``` python response = client.post('http://api.twitter.com/oauth/request_token', {'oauth_callback': 'oob'}) ``` If in requests-oauth I want to avoid throwing `oauth_*` parameters into body, if header authentication is set. There is no way I can do this. This forces me to add an extra parameter for requests-oauth that is only used in connection initialization. I'm not submitting a patch, as this can be fixed several ways and it might have some side-effects I'm not aware of. Cheers, Miguel
{ "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/445/reactions" }
https://api.github.com/repos/psf/requests/issues/445/timeline
null
completed
null
null
false
[ "Ok, \n\nSeveral of my issues in requests-oauth, needed this to be addressed. I'm submitting a pull request with a fix for this issue, that I've tested against latest requests-oauth `dev` branch https://github.com/maraujop/requests-oauth and it's fully working.\n\nAs you understand, what this means, is that people can alter `request.data` or `request.files` in a hook and have that new data encoded and sent.\n\nPlease, consider merging this asap, so I can release a new version of requests-oauth with several fixes and upgrades. \n\nCheers,\nMiguel\n", "Could you please merge this in or fix it your own way, so I can release a stable version of requests-oauth with several bug fixes ?\n\nThanks\n", "@maraujop\n\n> As you can see in this line:\n\nIf you refer to code please remember to link to specific commit not to moving target (head) :)\n", "You are right Piotr, thanks for letting me know :)\n", "I think this should be better now.\n" ]
https://api.github.com/repos/psf/requests/issues/444
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/444/labels{/name}
https://api.github.com/repos/psf/requests/issues/444/comments
https://api.github.com/repos/psf/requests/issues/444/events
https://github.com/psf/requests/issues/444
3,290,973
MDU6SXNzdWUzMjkwOTcz
444
UnicodeDecodeError when posting a Multipart-Encoded binary File
{ "avatar_url": "https://avatars.githubusercontent.com/u/465400?v=4", "events_url": "https://api.github.com/users/cedricbonhomme/events{/privacy}", "followers_url": "https://api.github.com/users/cedricbonhomme/followers", "following_url": "https://api.github.com/users/cedricbonhomme/following{/other_user}", "gists_url": "https://api.github.com/users/cedricbonhomme/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/cedricbonhomme", "id": 465400, "login": "cedricbonhomme", "node_id": "MDQ6VXNlcjQ2NTQwMA==", "organizations_url": "https://api.github.com/users/cedricbonhomme/orgs", "received_events_url": "https://api.github.com/users/cedricbonhomme/received_events", "repos_url": "https://api.github.com/users/cedricbonhomme/repos", "site_admin": false, "starred_url": "https://api.github.com/users/cedricbonhomme/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/cedricbonhomme/subscriptions", "type": "User", "url": "https://api.github.com/users/cedricbonhomme", "user_view_type": "public" }
[]
closed
true
null
[]
null
4
2012-02-20T07:19:16Z
2021-09-09T00:01:00Z
2012-06-15T18:43:10Z
NONE
resolved
I think that there is still a bug related to the bug #403. ``` python >>> files = {"xml": open("photos.xml", "r"), "image": open("Vienna-Orchestra.jpg", "rb")} >>> r = requests.post(url, files=files, auth=('***', '***')) Traceback (most recent call last): File "<stdin>", line 1, in <module> File "build/bdist.linux-i686/egg/requests/api.py", line 84, in post File "build/bdist.linux-i686/egg/requests/api.py", line 39, in request File "build/bdist.linux-i686/egg/requests/sessions.py", line 200, in request File "build/bdist.linux-i686/egg/requests/models.py", line 535, in send File "build/bdist.linux-i686/egg/requests/packages/urllib3/connectionpool.py", line 370, in urlopen File "build/bdist.linux-i686/egg/requests/packages/urllib3/connectionpool.py", line 246, in _make_request File "/usr/local/lib/python2.7/httplib.py", line 946, in request self._send_request(method, url, body, headers) File "/usr/local/lib/python2.7/httplib.py", line 987, in _send_request self.endheaders(body) File "/usr/local/lib/python2.7/httplib.py", line 940, in endheaders self._send_output(message_body) File "/usr/local/lib/python2.7/httplib.py", line 801, in _send_output msg += message_body UnicodeDecodeError: 'ascii' codec can't decode byte 0xff in position 484: ordinal not in range(128) ``` I've made different tests and always get the same problem. It works quite well if the photo is a simple text file.
{ "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/444/reactions" }
https://api.github.com/repos/psf/requests/issues/444/timeline
null
completed
null
null
false
[ "I'm trying to solve the problem in urllib3/connectionpool.py line 370 by this way:\n\n``` python\n# Make the request on the httplib connection object\n httplib_response = self._make_request(conn, method, url,\n timeout=timeout,\n body=unicode.encode(unicode(body, errors='ignore')), headers=headers)\n```\n\nThe photo and XML file are now sent to the server without errors. But the photograph can't be displayed since it contains less information than the original (due to \"errors='ignore'\")...\n", "It looks to me like this should be filed against shazow/urllib3\n", "If anyone runs across this issue, be sure that all the arguments you pass into requests are byte strings (besides just the payload or `data`). Any unicode instances making their way in will pollute the message building in httplib (in my case it was passing in a unicode u\"POST\" method).\n", "So I don't understand why I'm still getting this error? I'm not passing any unicode. Trying to post a binary file via:\n<code>response = requests.post(url, files=files, auth=oauth, params=params, verify=False)</code>\n" ]
https://api.github.com/repos/psf/requests/issues/443
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/443/labels{/name}
https://api.github.com/repos/psf/requests/issues/443/comments
https://api.github.com/repos/psf/requests/issues/443/events
https://github.com/psf/requests/pull/443
3,283,896
MDExOlB1bGxSZXF1ZXN0ODUxMzc4
443
Implemented #439. Added supporting test.
{ "avatar_url": "https://avatars.githubusercontent.com/u/120119?v=4", "events_url": "https://api.github.com/users/sharat87/events{/privacy}", "followers_url": "https://api.github.com/users/sharat87/followers", "following_url": "https://api.github.com/users/sharat87/following{/other_user}", "gists_url": "https://api.github.com/users/sharat87/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/sharat87", "id": 120119, "login": "sharat87", "node_id": "MDQ6VXNlcjEyMDExOQ==", "organizations_url": "https://api.github.com/users/sharat87/orgs", "received_events_url": "https://api.github.com/users/sharat87/received_events", "repos_url": "https://api.github.com/users/sharat87/repos", "site_admin": false, "starred_url": "https://api.github.com/users/sharat87/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/sharat87/subscriptions", "type": "User", "url": "https://api.github.com/users/sharat87", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2012-02-19T10:02:19Z
2021-09-08T23:06:00Z
2012-02-20T17:07:17Z
CONTRIBUTOR
resolved
Addresses #439, along a test.
{ "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/443/reactions" }
https://api.github.com/repos/psf/requests/issues/443/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/443.diff", "html_url": "https://github.com/psf/requests/pull/443", "merged_at": "2012-02-20T17:07:17Z", "patch_url": "https://github.com/psf/requests/pull/443.patch", "url": "https://api.github.com/repos/psf/requests/pulls/443" }
true
[ "Thanks!\n" ]
https://api.github.com/repos/psf/requests/issues/442
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/442/labels{/name}
https://api.github.com/repos/psf/requests/issues/442/comments
https://api.github.com/repos/psf/requests/issues/442/events
https://github.com/psf/requests/pull/442
3,283,886
MDExOlB1bGxSZXF1ZXN0ODUxMzc3
442
Tests cannot be run successfully after cloning the repo
{ "avatar_url": "https://avatars.githubusercontent.com/u/120119?v=4", "events_url": "https://api.github.com/users/sharat87/events{/privacy}", "followers_url": "https://api.github.com/users/sharat87/followers", "following_url": "https://api.github.com/users/sharat87/following{/other_user}", "gists_url": "https://api.github.com/users/sharat87/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/sharat87", "id": 120119, "login": "sharat87", "node_id": "MDQ6VXNlcjEyMDExOQ==", "organizations_url": "https://api.github.com/users/sharat87/orgs", "received_events_url": "https://api.github.com/users/sharat87/received_events", "repos_url": "https://api.github.com/users/sharat87/repos", "site_admin": false, "starred_url": "https://api.github.com/users/sharat87/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/sharat87/subscriptions", "type": "User", "url": "https://api.github.com/users/sharat87", "user_view_type": "public" }
[]
closed
true
null
[]
null
7
2012-02-19T09:58:46Z
2021-09-08T14:00:59Z
2012-02-20T17:04:35Z
CONTRIBUTOR
resolved
There seems to be some fiddling to be done before the tests can be run successfully right after a clone. Changes in this pull request is how I got them to work on my clone.
{ "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/442/reactions" }
https://api.github.com/repos/psf/requests/issues/442/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/442.diff", "html_url": "https://github.com/psf/requests/pull/442", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/442.patch", "url": "https://api.github.com/repos/psf/requests/pulls/442" }
true
[ "Okay, this pull request looks slightly messed up.\n\nKenneth, I can create pull request with just the changes of adding dependencies to requirements.txt and removing the unused envoy import. And close this one. What say?\n", "All of these changes are unnecesary\n", "> But, what I'm saying is one should be able to just clone, get deps, run tests, modify code, run tests.\n\nTrue. Dependencies needed to run tests should be well documented and there should be some easy way of installing them. Btw, nose is in no way a requirement and should not be listed as such.\n\nThe easiest way of making some progress in this matter is to create requirements-tests.txt file with a list of dependencies and information when each dependency is needed.\n", "> nose is in no way a requirement and should not be listed as such\n\nYep. Nose being listed there gives a (false?) impression that nose is all that's necessary to run the tests successfully. :)\n\n> The easiest way of making some progress in this matter is to create requirements-tests.txt file with a list of dependencies and information when each dependency is needed.\n\nI like this idea. Possible to get this accepted?\n", "test_requires in setup.py is a nice place for testing requirements\nThere is also extras_require for extra stuff (optional feature in module)\nOr setup_requires for setup time dependency\n\nThere is very little documentation about those options.\n", "I don't think it's really a big deal, honestly.\n", "Nope indeed, but that's the pythonic way to do it.\n" ]
https://api.github.com/repos/psf/requests/issues/441
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/441/labels{/name}
https://api.github.com/repos/psf/requests/issues/441/comments
https://api.github.com/repos/psf/requests/issues/441/events
https://github.com/psf/requests/issues/441
3,282,000
MDU6SXNzdWUzMjgyMDAw
441
Should requests honor http-equiv meta refresh?
{ "avatar_url": "https://avatars.githubusercontent.com/u/639096?v=4", "events_url": "https://api.github.com/users/mattklein/events{/privacy}", "followers_url": "https://api.github.com/users/mattklein/followers", "following_url": "https://api.github.com/users/mattklein/following{/other_user}", "gists_url": "https://api.github.com/users/mattklein/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/mattklein", "id": 639096, "login": "mattklein", "node_id": "MDQ6VXNlcjYzOTA5Ng==", "organizations_url": "https://api.github.com/users/mattklein/orgs", "received_events_url": "https://api.github.com/users/mattklein/received_events", "repos_url": "https://api.github.com/users/mattklein/repos", "site_admin": false, "starred_url": "https://api.github.com/users/mattklein/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/mattklein/subscriptions", "type": "User", "url": "https://api.github.com/users/mattklein", "user_view_type": "public" }
[]
closed
true
null
[]
null
3
2012-02-18T23:55:46Z
2021-09-09T09:00:48Z
2012-02-21T17:59:51Z
NONE
resolved
It's possible for a server to instruct a client to redirect to a URL by using the [http-equiv meta tag](http://en.wikipedia.org/wiki/Meta_refresh). It's antiquated, but it's still out there, and browsers still handle it as a redirect. Should requests honor the http-equiv refresh, handling it essentially the same as a 301? I'd like to think so, because that's what browsers do. To do so would mean having requests parse the <head> section of the response body -- which shouldn't be too difficult or inefficient (even without BeautifulSoup ;). Has this been considered/addressed?
{ "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/441/reactions" }
https://api.github.com/repos/psf/requests/issues/441/timeline
null
completed
null
null
false
[ "IMO this seems very much overkill for an HTTP library—not all HTTP is HTML, and even when it is, this would be something that could be pretty easily built by a user who needed it.\n", "Like @umbrae said, this is an HTTP library, not an HTML library.\n", "Fair points, I definitely respect the desire to keep the library small and focused, and love requests for what it is. For me the question came down to how much you want requests to be able to quack like a browser. I guess the more fitting solution for that need is mechanize.\n\n[Here's a thread](http://www.gossamer-threads.com/lists/python/bugs/459451) from way back when John Lee added support for http-equiv into \"ClientCookie\" (which later became mechanize), including a debate about whether/how that support should be integrated into urllib2. It wasn't, but mechanize's HTTPEquivProcessor is available for use with urllib2 to do what I want -- hande http-equiv tags as if they were HTTP headers.\n" ]
https://api.github.com/repos/psf/requests/issues/440
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/440/labels{/name}
https://api.github.com/repos/psf/requests/issues/440/comments
https://api.github.com/repos/psf/requests/issues/440/events
https://github.com/psf/requests/issues/440
3,280,797
MDU6SXNzdWUzMjgwNzk3
440
Requests (via oreos.monkeys) quotes cookie *values* -- browsers do not
{ "avatar_url": "https://avatars.githubusercontent.com/u/639096?v=4", "events_url": "https://api.github.com/users/mattklein/events{/privacy}", "followers_url": "https://api.github.com/users/mattklein/followers", "following_url": "https://api.github.com/users/mattklein/following{/other_user}", "gists_url": "https://api.github.com/users/mattklein/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/mattklein", "id": 639096, "login": "mattklein", "node_id": "MDQ6VXNlcjYzOTA5Ng==", "organizations_url": "https://api.github.com/users/mattklein/orgs", "received_events_url": "https://api.github.com/users/mattklein/received_events", "repos_url": "https://api.github.com/users/mattklein/repos", "site_admin": false, "starred_url": "https://api.github.com/users/mattklein/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/mattklein/subscriptions", "type": "User", "url": "https://api.github.com/users/mattklein", "user_view_type": "public" }
[]
closed
true
null
[]
null
11
2012-02-18T19:35:12Z
2021-09-09T09:00:35Z
2012-05-03T06:10:16Z
NONE
resolved
I'm having an issue that has me questioning Requests's (Oreo's?) cookie handling. Using Requests, I submit a request that successfully authenticates me to a particular server. The response includes a cookie whose _value_ contains an equals ("=") character. Because the cookie's value contains "=", which is not a "legal" char (as per _LegalChars in monkeys.py), Requests quotes the entire cookie value when it submits it in subsequent requests. The server, though, considers the quoted cookie to be different than the cookie it sent to the client -- so the client is no longer authenticated. See this flow: ``` In [6]: session = requests.session(headers=_default_headers) In [7]: data = { ...: 'userID': 'myuser', ...: 'password': 'mypassword', ...: } In [8]: resp = session.post('https://www.discovercard.com/cardmembersvcs/loginlogout/app/signin', data=data) In [9]: resp.headers Out[9]: {'cache-control': 'no-cache="set-cookie, set-cookie2"', 'connection': 'Keep-Alive', <snip> 'set-cookie': 'v1st=6B2AF394DCD43A57; path=/; expires=Wed, 19 Feb 2020 14:28:00 GMT; domain=.discovercard.com, dfsedskey=62689366; Expires=Sun, 17 Feb 2013 17:25:06 GMT; Path=/; Domain=.discovercard.com, PMData=PMV3EKKwYWpRB0ZAh7NnXgngf+fGUH7/c6RfKfa7Hiv5v2h1S1iS4MjexZtrnrPMErcNR0eyCzoWUfNFrj6bUkqxR0aQ==; Expires=Sun, 17 Feb 2013 17:25:06 GMT; Path=/; Domain=.discovercard.com; Secure, dcsession=E7dc4gmtmOk9LkTB4xeTjRs82g8=; Path=/; Domain=.discovercard.com; Secure, ACLOGIN=incntvtyp1=CBB; Expires=Sun, 17 Feb 2013 17:25:06 GMT; Path=/; Domain=.discovercard.com, ACHASH=1338528939; Expires=Sun, 17 Feb 2013 17:25:06 GMT; Path=/; Domain=.discovercard.com, dcuserid=***CLEARED***; Path=/; Domain=.discovercard.com, JSESSIONID=0001cT7y8RWiiQDuizJpy2gjQWw:16cfscb3m; Path=/', <snip> } ``` So the _value_ of the cookie with key "dcsession" is "E7dc4gmtmOk9LkTB4xeTjRs82g8=". The cookies dict is as expected: ``` In [10]: session.cookies['dcsession'] Out[10]: 'E7dc4gmtmOk9LkTB4xeTjRs82g8=' In [11]: resp.cookies['dcsession'] Out[11]: 'E7dc4gmtmOk9LkTB4xeTjRs82g8=' ``` But when I make my next request to the server: ``` In [12]: resp = session.get('https://www.discovercard.com/cardmembersvcs/achome/homepage') ``` The response to that request indicates "session timed out or not established". This is because of how the cookie was sent in this request: ``` In [14]: resp.request.headers['Cookie'] Out[14]: 'ACHASH=1338528939; ACLOGIN="incntvtyp1=CBB"; JSESSIONID="0001cT7y8RWiiQDuizJpy2gjQWw:16cfscb3m"; PMData="PMV3EKKwYWpRB0ZAh7NnXgngf+fGUH7/c6RfKfa7Hiv5v2h1S1iS4MjexZtrnrPMErcNR0eyCzoWUfNFrj6bUkqxR0aQ=="; dcsession="E7dc4gmtmOk9LkTB4xeTjRs82g8="; dcuserid=***CLEARED***; dfsedskey=62689366; v1st=6B2AF394DCD43A57' ``` Because the server considers the quoted cookie being returned as being different from the non-quoted cookie it sent, the session is no longer authenticated. The condition where the cookie comes back from the server containing the equals character is not rare or intermittent -- it always comes back like this, and so the authentication always fails. This is not broken for people using browsers! No browser I've tried (Chrome, Safari) quotes the cookie values, so there's no problem authenticating and carrying on a session. Obviously the server in this case is an established financial institution, presumably with many millions of users, so I think that the way Requests/Oreos is handling cookies is a problem. From what I can tell from the code, Requests instantiates a monkeys.SimpleCookie. SimpleCookie decides that, since the value contains something other than what's in _LegalChars, it needs to quote the value. I can patch this so that it works for me any number of ways: adding "=" into _LegalChars, or preventing SimpleCookie from ever quoting a value, or having Requests use BaseCookie rather than SimpleCookie, or having my application re-construct the cookie header from the cookies before my next request, etc. But this does feel like a bug that should be fixed in the main branch for everybody. I'm happy to contribute a fix but am interested to know what Kenneth and/or anybody else thinks is the right way to do it.
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/440/reactions" }
https://api.github.com/repos/psf/requests/issues/440/timeline
null
completed
null
null
false
[ "we can add `=` to the list of safe chars, as long as it doesn't have any negative implications. That's the whole reason oreos exists right now.\n", "Yeah, that would definitely fix it for me. But I guess I'm confused as to why it's ever necessary/desired to quote a cookie's value. Why would we ever want a client to submit a cookie to the server that's not exactly what the server sent to the client?\n", "The reason it's necessary/desired is that [RFC 2965](http://www.ietf.org/rfc/rfc2965.txt) requires that a cookie value either be a token, [which may not contain an '=' character](http://www.ietf.org/rfc/rfc2068.txt), or a quoted string. If the server isn't quoting the string, the server is non-compliant. As @kennethreitz says, Oreos already allows non-RFC-compliant characters in cookie keys because they're commonly sent out.\n", "Well it doesn't seem to break any of the test suite if I add = to the _RFC2965Forbidden list. Oreos accepts them in the cookie key in _CookiePattern, so everything should be fine.\n", "Let's do it.\n", "This issue is a duplicate of #286\n", "Thanks for the explanation and the fix! Adding \"=\" into the LegalChars solves my problem just fine.\n\nUpon further reading through the specs, though, I still think that request's handling/expectations of cookies isn't quite right. [RFC2965](http://www.ietf.org/rfc/rfc2965.txt) is the spec for \"new-style\" cookies, but it acknowledges (in section 9) that \"old-style\" cookies may still be in use by some servers. The spec for old-style cookies is the [\"Netscape spec\"](http://curl.haxx.se/rfc/cookie_spec.html). New-style cookies are sent from a server via the **Set-Cookie2** header; RFC2965 specifies that their values can contain only the characters you specify (e.g., not \"=\"), or else they need to be quoted. Old-style cookies are sent from a server via the **Set-Cookie** header; the Netscape spec specifies that these cookies are _not_ quoted, and their value is \"a sequence of characters excluding semi-colon, comma and white space\".\n\nApparently RFC2965 and new-style cookies haven't been widely adopted. And it appears that requests doesn't even check for the Set-Cookie2 header; it just takes the cookie from the Set-Cookie header. So requests shouldn't expect that what it gets in the Set-Cookie header should be an RFC2965-compliant cookie, just a Netscape spec-compliant cookie. And it should return this cookie back to the server unchanged (i.e., unquoted). (And this would match with the way browsers seem to be handling these \"=\" containing cookies.)\n\nNote further that [RFC6265](http://tools.ietf.org/html/rfc6265) obsoletes RFC2965 (eesh). RFC6265 acknowledges that Set-Cookie2 cookies never caught on in practice.\n\n[This StackOverflow thread](http://stackoverflow.com/questions/577191/what-is-the-current-state-of-the-cookie2-specification) is also helpful. It states that most browsers still only support the initial Netscape spec.\n\nSo the cookie specs over time have been Netscape spec -> RFC2109 -> RFC2965 -> RFC6265, but it's really only the Netscape spec that's been widely adopted.\n", "First, props for the time you clearly had to spend delving through IETF specs. Reading them usually makes me want to gouge my eyes out with a spoon, so thanks for doing the research for me. =D\n\nSo, my reading of RFC6265 is that valid cookie chars are any ASCII char excepting comma, colon, backslash, double-quote, control characters and whitespace, and any ASCII percent-encoding that does not give a comma, colon, backslash, double-quote or control characters. A valid cookie key is made up of these chars or a quoted version of them.\n\nDoes that agree with other people's reading of this spec?\n", "I just looked at 6265 again, remembering [not to take the cork off the fork](http://www.youtube.com/watch?v=nqMc9B7uDV8), and yes, that's the way I read it too. :)\n", "Hmm, is this resolved?\n\n```\n>>> import requests\n>>> print requests.get('http://httpbin.org/headers', cookies={\"this_is_a\": \"slash/\"}).text\n{\n \"headers\": {\n \"Content-Length\": \"\", \n \"Accept-Encoding\": \"identity, deflate, compress, gzip\", \n \"Connection\": \"keep-alive\", \n \"Accept\": \"*/*\", \n \"User-Agent\": \"python-requests/0.12.0\", \n \"Host\": \"httpbin.org\", \n \"Cookie\": \"this_is_a=slash/\", \n \"Content-Type\": \"\"\n }\n}\n>>> print requests.get('http://httpbin.org/headers', cookies={\"this_is_a\": \"equals=sign\"}).text\n{\n \"headers\": {\n \"Content-Length\": \"\", \n \"Accept-Encoding\": \"identity, deflate, compress, gzip\", \n \"Connection\": \"keep-alive\", \n \"Accept\": \"*/*\", \n \"User-Agent\": \"python-requests/0.12.0\", \n \"Host\": \"httpbin.org\", \n \"Cookie\": \"this_is_a=equals=sign\", \n \"Content-Type\": \"\"\n }\n}\n```\n\n```\n>>> import requests\n>>> c = requests.get('http://httpbin.org/headers', cookies={\"this_is_a\": \"equals=sign\"}).cookies\n>>> c = requests.get('http://httpbin.org/cookies', cookies=c).cookies\n>>> print c\n<<class 'requests.cookies.RequestsCookieJar'>[<Cookie this_is_a=equals=sign for />]>\n>>> print c['this_is_a']\nequals=sign\n```\n\nI'm not sure if these test cases are relevant and right, though.\n", "looks good to me ;)\n" ]
https://api.github.com/repos/psf/requests/issues/439
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/439/labels{/name}
https://api.github.com/repos/psf/requests/issues/439/comments
https://api.github.com/repos/psf/requests/issues/439/events
https://github.com/psf/requests/issues/439
3,278,807
MDU6SXNzdWUzMjc4ODA3
439
Make Session objects picklable
{ "avatar_url": "https://avatars.githubusercontent.com/u/120119?v=4", "events_url": "https://api.github.com/users/sharat87/events{/privacy}", "followers_url": "https://api.github.com/users/sharat87/followers", "following_url": "https://api.github.com/users/sharat87/following{/other_user}", "gists_url": "https://api.github.com/users/sharat87/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/sharat87", "id": 120119, "login": "sharat87", "node_id": "MDQ6VXNlcjEyMDExOQ==", "organizations_url": "https://api.github.com/users/sharat87/orgs", "received_events_url": "https://api.github.com/users/sharat87/received_events", "repos_url": "https://api.github.com/users/sharat87/repos", "site_admin": false, "starred_url": "https://api.github.com/users/sharat87/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/sharat87/subscriptions", "type": "User", "url": "https://api.github.com/users/sharat87", "user_view_type": "public" }
[]
closed
true
null
[]
null
5
2012-02-18T12:16:35Z
2021-09-09T09:00:49Z
2012-02-20T17:05:25Z
CONTRIBUTOR
resolved
Currently, when we try to pickle a `Session` object, we get this: ``` File "[...]python2.7/copy_reg.py", line 70, in _reduce_ex raise TypeError, "can't pickle %s objects" % base.__name__ TypeError: can't pickle lock objects ``` The `Session` objects can be made pickleable rather easily. If you are willing to accept this functionality, I can create a pull request. I showed the [implementation](http://sharats.me/serializing-python-requests-session-objects-for-fun-and-profit.html#implement) on my blog post about this.
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/439/reactions" }
https://api.github.com/repos/psf/requests/issues/439/timeline
null
completed
null
null
false
[ "Broken link\n", "Sorry, fixed now.\n", "Let's do it!\n", "I committed my changes and referred to this issue number in the commit message. Can you pull with that or should I create a new pull request (which creates a new issue I believe)?\n\nEdit: Apparently there needs to be a pull request created.\n", "Awesome!\n" ]
https://api.github.com/repos/psf/requests/issues/438
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/438/labels{/name}
https://api.github.com/repos/psf/requests/issues/438/comments
https://api.github.com/repos/psf/requests/issues/438/events
https://github.com/psf/requests/issues/438
3,274,745
MDU6SXNzdWUzMjc0NzQ1
438
SPNEGO auth failed on master vs 0.4.1
{ "avatar_url": "https://avatars.githubusercontent.com/u/379552?v=4", "events_url": "https://api.github.com/users/jassinm/events{/privacy}", "followers_url": "https://api.github.com/users/jassinm/followers", "following_url": "https://api.github.com/users/jassinm/following{/other_user}", "gists_url": "https://api.github.com/users/jassinm/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/jassinm", "id": 379552, "login": "jassinm", "node_id": "MDQ6VXNlcjM3OTU1Mg==", "organizations_url": "https://api.github.com/users/jassinm/orgs", "received_events_url": "https://api.github.com/users/jassinm/received_events", "repos_url": "https://api.github.com/users/jassinm/repos", "site_admin": false, "starred_url": "https://api.github.com/users/jassinm/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/jassinm/subscriptions", "type": "User", "url": "https://api.github.com/users/jassinm", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2012-02-17T22:04:02Z
2021-09-09T07:05:26Z
2012-07-27T06:00:11Z
NONE
resolved
hi , first thanks for this awsome lib. my code is working successfully under 0.4.1. moving to master or 0.10.2 i noticed the following : passing a cookiejar object does not work but a dict is nicer anyway and access cookies directly from response is nice. but some of the requests i m doing with master keep on getting a SPNEGO authentifcation failed. any idea? would really like to move to the latest requests. Thanks
{ "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/438/reactions" }
https://api.github.com/repos/psf/requests/issues/438/timeline
null
completed
null
null
false
[ "I just tested different version and the latest working version is 0.7.6 where i don't get the SPNEGO authentication. i can at least use my refactored code from 0.4.1 to 0.10.2 ( using response.cookies...) with this version and hope for a fix.\njust tested 0.10.3 with the same problem.\n\nI suppose the problem is due to cookie changes and redirect changes introduced in 0.8.0. \n\nlooking at the different commits between 0.7.6 and 0.8.0 : checking out f5bbb9714d66103280d0ca10742877f4522787ff works and checking out 498b446f141675026ae7364b922f03cde1de728c introduces the SPNEGO error. quite difficult to find the part which breaks thing as merge's have not been squashed\n", "Cookie handling has been refactored. Try revisiting the issue now? Also, is it feasible to provide a test case?\n" ]
https://api.github.com/repos/psf/requests/issues/437
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/437/labels{/name}
https://api.github.com/repos/psf/requests/issues/437/comments
https://api.github.com/repos/psf/requests/issues/437/events
https://github.com/psf/requests/issues/437
3,266,795
MDU6SXNzdWUzMjY2Nzk1
437
Requests gets 404 but it shouldn't be
{ "avatar_url": "https://avatars.githubusercontent.com/u/86238?v=4", "events_url": "https://api.github.com/users/namlook/events{/privacy}", "followers_url": "https://api.github.com/users/namlook/followers", "following_url": "https://api.github.com/users/namlook/following{/other_user}", "gists_url": "https://api.github.com/users/namlook/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/namlook", "id": 86238, "login": "namlook", "node_id": "MDQ6VXNlcjg2MjM4", "organizations_url": "https://api.github.com/users/namlook/orgs", "received_events_url": "https://api.github.com/users/namlook/received_events", "repos_url": "https://api.github.com/users/namlook/repos", "site_admin": false, "starred_url": "https://api.github.com/users/namlook/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/namlook/subscriptions", "type": "User", "url": "https://api.github.com/users/namlook", "user_view_type": "public" }
[]
closed
true
null
[]
null
4
2012-02-17T12:26:57Z
2021-09-09T09:00:49Z
2012-02-18T10:00:02Z
NONE
resolved
When accessing a simple website, Requests get 404 error while Restkit success with a 200 : ``` python >>> l = requests.get("http://www.ecrans.fr/OVH-L-Internet-giga-familial,14088.html") >>> l.status_code 404 >>> r = restkit.request("http://www.ecrans.fr/OVH-L-Internet-giga-familial,14088.html") >>> r.status_int 200 ```
{ "avatar_url": "https://avatars.githubusercontent.com/u/86238?v=4", "events_url": "https://api.github.com/users/namlook/events{/privacy}", "followers_url": "https://api.github.com/users/namlook/followers", "following_url": "https://api.github.com/users/namlook/following{/other_user}", "gists_url": "https://api.github.com/users/namlook/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/namlook", "id": 86238, "login": "namlook", "node_id": "MDQ6VXNlcjg2MjM4", "organizations_url": "https://api.github.com/users/namlook/orgs", "received_events_url": "https://api.github.com/users/namlook/received_events", "repos_url": "https://api.github.com/users/namlook/repos", "site_admin": false, "starred_url": "https://api.github.com/users/namlook/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/namlook/subscriptions", "type": "User", "url": "https://api.github.com/users/namlook", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/437/reactions" }
https://api.github.com/repos/psf/requests/issues/437/timeline
null
completed
null
null
false
[ "Are you using 0.10.2?\n", "Nop, I used 0.10.1. I tried with 0.10.2 and it works fine. Thanks !\n", "There were some improvements to the escape mechanism.\n", "This improvements closed the issue #404 too\n" ]
https://api.github.com/repos/psf/requests/issues/436
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/436/labels{/name}
https://api.github.com/repos/psf/requests/issues/436/comments
https://api.github.com/repos/psf/requests/issues/436/events
https://github.com/psf/requests/issues/436
3,260,503
MDU6SXNzdWUzMjYwNTAz
436
ValueError in generate_chunked (invalid literal for int())
{ "avatar_url": "https://avatars.githubusercontent.com/u/285920?v=4", "events_url": "https://api.github.com/users/umbrae/events{/privacy}", "followers_url": "https://api.github.com/users/umbrae/followers", "following_url": "https://api.github.com/users/umbrae/following{/other_user}", "gists_url": "https://api.github.com/users/umbrae/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/umbrae", "id": 285920, "login": "umbrae", "node_id": "MDQ6VXNlcjI4NTkyMA==", "organizations_url": "https://api.github.com/users/umbrae/orgs", "received_events_url": "https://api.github.com/users/umbrae/received_events", "repos_url": "https://api.github.com/users/umbrae/repos", "site_admin": false, "starred_url": "https://api.github.com/users/umbrae/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/umbrae/subscriptions", "type": "User", "url": "https://api.github.com/users/umbrae", "user_view_type": "public" }
[]
closed
true
null
[]
null
7
2012-02-16T23:20:45Z
2021-09-09T09:00:39Z
2012-03-31T06:31:57Z
CONTRIBUTOR
resolved
Looks like there's some trouble handling some specific URLs in the version 0.10.2 of requests: ``` >>> import requests >>> requests.head('http://feeds.gawker.com/~r/jalopnik/full/~3/gaYrXc40sbA/this-is-the-worst-school-zone-sign-in-history', allow_redirects=True) [...wait a very long time...] Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/Users/umbrae/Envs/rdb/lib/python2.6/site-packages/requests/api.py", line 73, in head return request('head', url, **kwargs) File "/Users/umbrae/Envs/rdb/lib/python2.6/site-packages/requests/api.py", line 39, in request return s.request(method=method, url=url, **kwargs) File "/Users/umbrae/Envs/rdb/lib/python2.6/site-packages/requests/sessions.py", line 200, in request r.send(prefetch=prefetch) File "/Users/umbrae/Envs/rdb/lib/python2.6/site-packages/requests/models.py", line 557, in send self._build_response(r) File "/Users/umbrae/Envs/rdb/lib/python2.6/site-packages/requests/models.py", line 211, in _build_response r.content # Consume socket so it can be released File "/Users/umbrae/Envs/rdb/lib/python2.6/site-packages/requests/models.py", line 746, in content self._content = bytes().join(self.iter_content()) or None File "/Users/umbrae/Envs/rdb/lib/python2.6/site-packages/requests/models.py", line 676, in generate_chunked pending_bytes = int(pending_bytes, 16) ValueError: invalid literal for int() with base 16: '' ``` I can scrape up a few more test case URLs as well if you'd like.
{ "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/436/reactions" }
https://api.github.com/repos/psf/requests/issues/436/timeline
null
completed
null
null
false
[ "Looks like you may need to now pass `allow_redirects=True` to trigger this issue, still exists from what I can tell though.\n", "redirection will follow redirects, while doing so it tries to consume the content\nwhich fails for chunked encoding on head (no content)\n\nit seems there is need for more conditions on when to have custom chunked encoding parsing\n(the custom chunked reading is necessary since httplib is too incappable/broken to correctly pass over chunks/lines)\n\na solution would be to check for Empty Data and break out of the loop (as httplib handling incorrectly would)\n", "@RonnyPfannschmidt Thanks for the insight Ronny.\n", "@RonnyPfannschmidt care to add it? :)\n", "no\n", "Simplified chunks are back now. This shouldn't be a problem anymore.\n", ":+1:\n" ]
https://api.github.com/repos/psf/requests/issues/435
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/435/labels{/name}
https://api.github.com/repos/psf/requests/issues/435/comments
https://api.github.com/repos/psf/requests/issues/435/events
https://github.com/psf/requests/pull/435
3,259,822
MDExOlB1bGxSZXF1ZXN0ODQyMjg5
435
Issue 380: Provide useful exceptions for unexpected URLs.
{ "avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4", "events_url": "https://api.github.com/users/Lukasa/events{/privacy}", "followers_url": "https://api.github.com/users/Lukasa/followers", "following_url": "https://api.github.com/users/Lukasa/following{/other_user}", "gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Lukasa", "id": 1382556, "login": "Lukasa", "node_id": "MDQ6VXNlcjEzODI1NTY=", "organizations_url": "https://api.github.com/users/Lukasa/orgs", "received_events_url": "https://api.github.com/users/Lukasa/received_events", "repos_url": "https://api.github.com/users/Lukasa/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Lukasa/starred{/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
2
2012-02-16T22:33:31Z
2021-09-08T14:00:59Z
2012-02-20T17:21:43Z
MEMBER
resolved
This pull request handles part of the problem raised in issue #380. Specifically, urls whose scheme is not HTTP or HTTPS will throw ValueErrors.
{ "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/435/reactions" }
https://api.github.com/repos/psf/requests/issues/435/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/435.diff", "html_url": "https://github.com/psf/requests/pull/435", "merged_at": "2012-02-20T17:21:43Z", "patch_url": "https://github.com/psf/requests/pull/435.patch", "url": "https://api.github.com/repos/psf/requests/pulls/435" }
true
[ "We already have URLRequired.\n", "Nevermind, this is perfect. Thanks!\n" ]
https://api.github.com/repos/psf/requests/issues/434
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/434/labels{/name}
https://api.github.com/repos/psf/requests/issues/434/comments
https://api.github.com/repos/psf/requests/issues/434/events
https://github.com/psf/requests/issues/434
3,246,639
MDU6SXNzdWUzMjQ2NjM5
434
http post's request.content works in 0.9.1 and is None in 0.10.2
{ "avatar_url": "https://avatars.githubusercontent.com/u/150892?v=4", "events_url": "https://api.github.com/users/davidthewatson/events{/privacy}", "followers_url": "https://api.github.com/users/davidthewatson/followers", "following_url": "https://api.github.com/users/davidthewatson/following{/other_user}", "gists_url": "https://api.github.com/users/davidthewatson/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/davidthewatson", "id": 150892, "login": "davidthewatson", "node_id": "MDQ6VXNlcjE1MDg5Mg==", "organizations_url": "https://api.github.com/users/davidthewatson/orgs", "received_events_url": "https://api.github.com/users/davidthewatson/received_events", "repos_url": "https://api.github.com/users/davidthewatson/repos", "site_admin": false, "starred_url": "https://api.github.com/users/davidthewatson/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/davidthewatson/subscriptions", "type": "User", "url": "https://api.github.com/users/davidthewatson", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2012-02-16T05:34:42Z
2021-09-09T07:05:25Z
2012-07-27T06:01:28Z
NONE
resolved
I have a project using requests for a while on version 0.9.1. After pip installing the new 0.10.2 version in my virtualenv, a post request using HTTP digest auth is failng with request.content == None. ``` def create(self, **kwargs): r = request.post(uri, auth=HTTPDigestAuth(username, password), headers={'host': host, 'content-type': 'application/json' }, data=json.dumps(kwargs)) ``` I believe this is a regression as simply pip installing 0.9.1 causes the code to work unchanged.
{ "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/434/reactions" }
https://api.github.com/repos/psf/requests/issues/434/timeline
null
completed
null
null
false
[ "Seems to happen only if the response is empty:\n\n```\necho -e \"HTTP/1.0 200 OK\\nContent-Length: 0\\n\\n\"|nc -l -p 8080 &\npython -c 'import requests; r = requests.post(\"http://localhost:8080/\"); print repr(r.content)'\nNone\n\necho -e \"HTTP/1.0 200 OK\\nContent-Length: 1\\n\\na\"|nc -l -p 8080 &\npython -c 'import requests; r = requests.post(\"http://localhost:8080/\"); print repr(r.content)'\n'a'\n\n```\n" ]
https://api.github.com/repos/psf/requests/issues/433
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/433/labels{/name}
https://api.github.com/repos/psf/requests/issues/433/comments
https://api.github.com/repos/psf/requests/issues/433/events
https://github.com/psf/requests/pull/433
3,242,625
MDExOlB1bGxSZXF1ZXN0ODM1NTc1
433
Issue #345: Allow None as values in headers.
{ "avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4", "events_url": "https://api.github.com/users/Lukasa/events{/privacy}", "followers_url": "https://api.github.com/users/Lukasa/followers", "following_url": "https://api.github.com/users/Lukasa/following{/other_user}", "gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Lukasa", "id": 1382556, "login": "Lukasa", "node_id": "MDQ6VXNlcjEzODI1NTY=", "organizations_url": "https://api.github.com/users/Lukasa/orgs", "received_events_url": "https://api.github.com/users/Lukasa/received_events", "repos_url": "https://api.github.com/users/Lukasa/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions", "type": "User", "url": "https://api.github.com/users/Lukasa", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2012-02-15T21:59:32Z
2021-09-08T14:00:58Z
2012-02-20T17:32:14Z
MEMBER
resolved
None should be able to be passed as a value in a header. This particular change means that the header will not be passed through to the remote destination. This fixes issue #345.
{ "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/433/reactions" }
https://api.github.com/repos/psf/requests/issues/433/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/433.diff", "html_url": "https://github.com/psf/requests/pull/433", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/433.patch", "url": "https://api.github.com/repos/psf/requests/pulls/433" }
true
[ "This wouldn't merge anymore, so I added by hand. Thanks!\n" ]
https://api.github.com/repos/psf/requests/issues/432
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/432/labels{/name}
https://api.github.com/repos/psf/requests/issues/432/comments
https://api.github.com/repos/psf/requests/issues/432/events
https://github.com/psf/requests/pull/432
3,233,974
MDExOlB1bGxSZXF1ZXN0ODMyMTg5
432
Use correct path when opening file in tests
{ "avatar_url": "https://avatars.githubusercontent.com/u/75171?v=4", "events_url": "https://api.github.com/users/christopherwright/events{/privacy}", "followers_url": "https://api.github.com/users/christopherwright/followers", "following_url": "https://api.github.com/users/christopherwright/following{/other_user}", "gists_url": "https://api.github.com/users/christopherwright/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/christopherwright", "id": 75171, "login": "christopherwright", "node_id": "MDQ6VXNlcjc1MTcx", "organizations_url": "https://api.github.com/users/christopherwright/orgs", "received_events_url": "https://api.github.com/users/christopherwright/received_events", "repos_url": "https://api.github.com/users/christopherwright/repos", "site_admin": false, "starred_url": "https://api.github.com/users/christopherwright/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/christopherwright/subscriptions", "type": "User", "url": "https://api.github.com/users/christopherwright", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2012-02-15T12:59:03Z
2021-09-08T14:00:58Z
2012-02-20T17:34:06Z
NONE
resolved
When running `make test`, several tests failed with a similar error: ``` bash $ make test nosetests --with-color ./tests/* ............EEE..............................................EEE...................................................EEE.................................. ====================================================================== ERROR: test_POSTBIN_GET_POST_FILES (test_requests_async.RequestsTestSuite) ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/lib/python2.7/unittest/case.py", line 327, in run testMethod() File "/home/christopher/code/requests/tests/test_requests.py", line 294, in test_POSTBIN_GET_POST_FILES with open('test_requests.py') as f: IOError: [Errno 2] No such file or directory: 'test_requests.py' (...) ---------------------------------------------------------------------- Ran 152 tests in 11.122 seconds FAILED (errors=9) ``` The problem was that the current working directory was the root of the project, so calling `open('test_requests.py')` failed because it's now in the tests directory. After the fix: ``` bash $ make test nosetests --with-color ./tests/* ................................................................................................................................................................................................................................................................................................................ ---------------------------------------------------------------------- Ran 304 tests in 19.953 seconds OK ```
{ "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/432/reactions" }
https://api.github.com/repos/psf/requests/issues/432/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/432.diff", "html_url": "https://github.com/psf/requests/pull/432", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/432.patch", "url": "https://api.github.com/repos/psf/requests/pulls/432" }
true
[ "Using `__file__` now.\n", "Cool, that makes more sense.\n" ]
https://api.github.com/repos/psf/requests/issues/431
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/431/labels{/name}
https://api.github.com/repos/psf/requests/issues/431/comments
https://api.github.com/repos/psf/requests/issues/431/events
https://github.com/psf/requests/pull/431
3,228,972
MDExOlB1bGxSZXF1ZXN0ODMwNDM1
431
URI cleanup of non-path components
{ "avatar_url": "https://avatars.githubusercontent.com/u/228433?v=4", "events_url": "https://api.github.com/users/mgiuca/events{/privacy}", "followers_url": "https://api.github.com/users/mgiuca/followers", "following_url": "https://api.github.com/users/mgiuca/following{/other_user}", "gists_url": "https://api.github.com/users/mgiuca/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/mgiuca", "id": 228433, "login": "mgiuca", "node_id": "MDQ6VXNlcjIyODQzMw==", "organizations_url": "https://api.github.com/users/mgiuca/orgs", "received_events_url": "https://api.github.com/users/mgiuca/received_events", "repos_url": "https://api.github.com/users/mgiuca/repos", "site_admin": false, "starred_url": "https://api.github.com/users/mgiuca/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/mgiuca/subscriptions", "type": "User", "url": "https://api.github.com/users/mgiuca", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2012-02-15T01:16:31Z
2021-09-08T23:06:23Z
2012-02-15T06:00:59Z
CONTRIBUTOR
resolved
My [previous branch](https://github.com/mgiuca/requests/tree/py3-uri-encoding) fixed URI cleanup for path components. This branch extends that fix to address Issue #429, which requires URI cleanup for the query part of the URI. I have added comprehensive tests for the sanitisation of the query part of the URI, and rearranged the call to `utils.requote_path` so that it is now applied to the whole URI after it is constructed, and not just the path. Note that this required that all URI components be converted to UTF-8 before the URI is reconstructed (since the URI is now sanitised _after_ reconstruction). I have renamed `utils.requote_path` to `requote_uri` to reflect its new role.
{ "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/431/reactions" }
https://api.github.com/repos/psf/requests/issues/431/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/431.diff", "html_url": "https://github.com/psf/requests/pull/431", "merged_at": "2012-02-15T06:00:59Z", "patch_url": "https://github.com/psf/requests/pull/431.patch", "url": "https://api.github.com/repos/psf/requests/pulls/431" }
true
[ "This is fantastic. Thanks a ton. I really appreciate this.\n", ":cake:\n" ]
https://api.github.com/repos/psf/requests/issues/430
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/430/labels{/name}
https://api.github.com/repos/psf/requests/issues/430/comments
https://api.github.com/repos/psf/requests/issues/430/events
https://github.com/psf/requests/issues/430
3,226,416
MDU6SXNzdWUzMjI2NDE2
430
Enhance max_retries functionality
{ "avatar_url": "https://avatars.githubusercontent.com/u/1437975?v=4", "events_url": "https://api.github.com/users/gravesb/events{/privacy}", "followers_url": "https://api.github.com/users/gravesb/followers", "following_url": "https://api.github.com/users/gravesb/following{/other_user}", "gists_url": "https://api.github.com/users/gravesb/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/gravesb", "id": 1437975, "login": "gravesb", "node_id": "MDQ6VXNlcjE0Mzc5NzU=", "organizations_url": "https://api.github.com/users/gravesb/orgs", "received_events_url": "https://api.github.com/users/gravesb/received_events", "repos_url": "https://api.github.com/users/gravesb/repos", "site_admin": false, "starred_url": "https://api.github.com/users/gravesb/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/gravesb/subscriptions", "type": "User", "url": "https://api.github.com/users/gravesb", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2012-02-14T21:28:55Z
2021-09-09T08:00:34Z
2012-06-15T18:44:00Z
NONE
resolved
Right now, the max_retries config looks like it just handles bad connections in the connection pool down in urllib3. What would you think about adding some higher level retry logic to Requests? For example, if a request ended up with a 503 it might be nice to have some retry logic built into requests to try to re-submit the same request again. The number of retries would be controlled by a new arg with a default of 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" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/430/reactions" }
https://api.github.com/repos/psf/requests/issues/430/timeline
null
completed
null
null
false
[ "I think retries should, in general, not be used. I'd rather provide an easy mechanism to send a request again. Currently, you can do this by calling `Request.send(anyway=True)`\n" ]
https://api.github.com/repos/psf/requests/issues/429
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/429/labels{/name}
https://api.github.com/repos/psf/requests/issues/429/comments
https://api.github.com/repos/psf/requests/issues/429/events
https://github.com/psf/requests/issues/429
3,226,159
MDU6SXNzdWUzMjI2MTU5
429
Query params are not properly sanitized
{ "avatar_url": "https://avatars.githubusercontent.com/u/651797?v=4", "events_url": "https://api.github.com/users/foxx/events{/privacy}", "followers_url": "https://api.github.com/users/foxx/followers", "following_url": "https://api.github.com/users/foxx/following{/other_user}", "gists_url": "https://api.github.com/users/foxx/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/foxx", "id": 651797, "login": "foxx", "node_id": "MDQ6VXNlcjY1MTc5Nw==", "organizations_url": "https://api.github.com/users/foxx/orgs", "received_events_url": "https://api.github.com/users/foxx/received_events", "repos_url": "https://api.github.com/users/foxx/repos", "site_admin": false, "starred_url": "https://api.github.com/users/foxx/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/foxx/subscriptions", "type": "User", "url": "https://api.github.com/users/foxx", "user_view_type": "public" }
[]
closed
true
null
[]
null
15
2012-02-14T21:09:27Z
2021-09-09T09:00:39Z
2012-03-08T01:25:13Z
NONE
resolved
Hey, One of our developers (Randy Tobias) encountered a problem today when attempting to query a URL which is collected from the 'Location' header. The following code will fail: ``` _url = "http://www.example.com/?hello=hello world" requests.get(_url) ``` The only way to make this work is to patch up the query string with urlencode - therefore I am submitting this patch for consideration. I believe that enough websites send back broken "Location" headers for this to be included in the core. Without it, we get the following exception: ``` webapp.libs._requests.exceptions.ConnectionError: HTTPSConnectionPool(host=u'online2.statefarm.com', port=443): Max retries exceeded with url: /apps/iarqapply/launch.redirect?postalCode=07017&productId=F1MRW45Q500&effectiveDate=20120214&applicationName=Auto&stateAbbreviation=NJ&regionalOffice=17&endEffectiveDate=20120315&city=East Orange ``` Here is the patch: ``` # models.py def patch_url(i): import urlparse import urllib o = urlparse.urlparse(i) _n = urlparse.ParseResult( scheme = o.scheme, netloc = o.netloc, path = o.path, params = o.params, query = urllib.urlencode(urlparse.parse_qsl(o.query)), fragment = o.fragment, ) return _n.geturl() class Request(object): """The :class:`Request <Request>` object. It carries out all functionality of Requests. Recommended interface is with the Requests functions. """ def __init__(self, url=None, headers=dict(), files=None, method=None, data=dict(), params=dict(), auth=None, cookies=None, timeout=None, redirect=False, allow_redirects=False, proxies=None, hooks=None, config=None, _poolmanager=None, verify=None, session=None): #: Float describes the timeout of the request. # (Use socket.setdefaulttimeout() as fallback) self.timeout = timeout #: Request URL. # if isinstance(url, str): # url = url.encode('utf-8') # print(dir(url)) self.url = patch_url(url) ``` ``` Before patch: https://online2.statefarm.com/apps/iarqapply/launch.redirect?postalCode=07017&productId=F1MRW45Q500&effectiveDate=20120214&applicationName=Auto&stateAbbreviation=NJ&regionalOffice=17&endEffectiveDate=20120315&city=East Orange ``` ``` After patch: https://online2.statefarm.com/apps/iarqapply/launch.redirect?postalCode=07017&productId=F1MRW45Q500&effectiveDate=20120214&applicationName=Auto&stateAbbreviation=NJ&regionalOffice=17&endEffectiveDate=20120315&city=East+Orange ``` Many thanks Cal Leeming Simplicity Media Ltd - Randy Tobias
{ "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/429/reactions" }
https://api.github.com/repos/psf/requests/issues/429/timeline
null
completed
null
null
false
[ "See issue #369. Once changes made by @mgiuca are merged your problem should be fixed as well.\n", "I don't understand exactly what the problem is. It looks like you sent a request to the URL:\n\n```\nhttp://www.example.com/?hello=hello world\n```\n\nAnd then you report an exception involving this URL:\n\n```\n/apps/iarqapply/launch.redirect?postalCode=07017&productId=F1MRW45Q500&effectiveDate=20120214&applicationName=Auto&stateAbbreviation=NJ&regionalOffice=17&endEffectiveDate=20120315&city=East Orange\n```\n\nWhat do those two URLs have to do with each other? They seem to both have in common a space in the query string.\n\nLet's pick a more useful test case: a URL on Kenneth's nice HTTP test site that won't redirect (unlike example.com):\n\n```\nhttp://httpbin.org/get?hello=hello world\n```\n\nMy test code:\n\n```\n>>> _url = \"http://httpbin.org/get?hello=hello world\"\n>>> r = requests.get(_url)\n>>> r.url\nu'http://httpbin.org/get?hello=hello world'\n```\n\n(I'm not sure why it became a Unicode string.)\n\nIndeed, this is a malformed query string, because it has a space in it. Note that this is AFTER my patch was merged. My patch deliberately only dealt with the path component (because I didn't want to mess with the behaviour too much; requests was already munging the path but not the query). If we want requests to automatically fix this, it should fix it as follows:\n\n```\nhttp://httpbin.org/get?hello=hello%20world\n```\n\nIt should NOT be encoding the space as a '+'. Space is NOT equivalent to + in the URI syntax, and doing so would break existing correct code. Space is correctly encoded as %20. The replacement of space with '+' is not part of the general URI syntax; it is part of the HTML specification as [defined by the W3C](http://www.w3.org/TR/REC-html40/interact/forms.html#form-content-type) -- the content type application/x-www-form-urlencoded defines '+' as equivalent to space. Any URI that is not the result of an HTML form submission should not consider those equivalent.\n\nSo the fixes I made on Issue #369 were actually relevant here, it's just that they were only applied to the path. I have pushed a new branch, [uri-cleanup-nonpath](https://github.com/mgiuca/requests/tree/uri-cleanup-nonpath) which extends the application of `requote_path` to the entire URI once it is reconstructed, which means that all parts of the URI will now benefit from cleaning. This gives the following result to the above test:\n\n```\n>>> r.url\n'http://httpbin.org/get?hello=hello%20world'\n```\n\nI have added full tests of the sanitisation of the query part of the URI, and I think that my patch would resolve this issue. I'll put in a pull request.\n\nP.S. When you want to send a patch, please create a Git branch and commit it, then push to GitHub and create a Pull Request. That will make it much easier for people to see what changes you intend to submit, rather than simply pasting code into a bug report.\n", "I should add, one of our developers (James Cleary) found that our previously suggested patch causes other unit tests to break, YMMV.\n", "encode_uri configuration has been added.\n", "Nice! Thank you very much for this Kenneth :)\n", "Also @mgiuca, thank you very much for raising the issue about the + and %20 stuff, our patch was failing on several tests due to this problem - so you've saved us a lot of time :) Thank you again.\n", "No worries :) I'm a bit obsessed with URI encoding issues so I'm happy to help out.\n", "@mgiuca good to know :)\n", "Thanks from me as well! Ran into the issue yesterday, and today it's fixed.\n", "@mgiuca we could really use your help with a new collaboration with @mitsuhiko to merge requests and werkzeug. Would you like to help?\n", "I'd like to but I'm moving house and starting a new job this week, sorry. I might look at it in a few days.\n", "@mgiuca It'll likely be over the next month or two :)\n", "> (...) a new collaboration with @mitsuhiko to merge requests and werkzeug. \n\nWas the intention of merging published somewhere?\n", "@piotr-dobrogost I'm planning on doing a blog post on it today\n", ":tophat:\n" ]