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/1328
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1328/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1328/comments
|
https://api.github.com/repos/psf/requests/issues/1328/events
|
https://github.com/psf/requests/pull/1328
| 13,671,423 |
MDExOlB1bGxSZXF1ZXN0NTM4MzYwOQ==
| 1,328 |
Session CookieJar fix
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/187133?v=4",
"events_url": "https://api.github.com/users/gazpachoking/events{/privacy}",
"followers_url": "https://api.github.com/users/gazpachoking/followers",
"following_url": "https://api.github.com/users/gazpachoking/following{/other_user}",
"gists_url": "https://api.github.com/users/gazpachoking/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/gazpachoking",
"id": 187133,
"login": "gazpachoking",
"node_id": "MDQ6VXNlcjE4NzEzMw==",
"organizations_url": "https://api.github.com/users/gazpachoking/orgs",
"received_events_url": "https://api.github.com/users/gazpachoking/received_events",
"repos_url": "https://api.github.com/users/gazpachoking/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/gazpachoking/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/gazpachoking/subscriptions",
"type": "User",
"url": "https://api.github.com/users/gazpachoking",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 3 |
2013-04-26T02:40:38Z
|
2021-09-08T23:00:59Z
|
2013-04-26T07:02:28Z
|
CONTRIBUTOR
|
resolved
|
Fix for #1324, make any subclass of `cookielib.CookieJar` work as `session.cookies`
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4",
"events_url": "https://api.github.com/users/kennethreitz/events{/privacy}",
"followers_url": "https://api.github.com/users/kennethreitz/followers",
"following_url": "https://api.github.com/users/kennethreitz/following{/other_user}",
"gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/kennethreitz",
"id": 119893,
"login": "kennethreitz",
"node_id": "MDQ6VXNlcjExOTg5Mw==",
"organizations_url": "https://api.github.com/users/kennethreitz/orgs",
"received_events_url": "https://api.github.com/users/kennethreitz/received_events",
"repos_url": "https://api.github.com/users/kennethreitz/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/kennethreitz/starred{/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/1328/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1328/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/1328.diff",
"html_url": "https://github.com/psf/requests/pull/1328",
"merged_at": "2013-04-26T07:02:28Z",
"patch_url": "https://github.com/psf/requests/pull/1328.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/1328"
}
| true |
[
"Whoops, got a small issue to work out still.\n",
":cake: :)\n",
"Thanks @gazpachoking you rock! :cake:\n"
] |
https://api.github.com/repos/psf/requests/issues/1327
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1327/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1327/comments
|
https://api.github.com/repos/psf/requests/issues/1327/events
|
https://github.com/psf/requests/pull/1327
| 13,631,059 |
MDExOlB1bGxSZXF1ZXN0NTM2MzI0Mw==
| 1,327 |
Fixes #1320: transport adapters stored in ordered form
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/55281?v=4",
"events_url": "https://api.github.com/users/ambv/events{/privacy}",
"followers_url": "https://api.github.com/users/ambv/followers",
"following_url": "https://api.github.com/users/ambv/following{/other_user}",
"gists_url": "https://api.github.com/users/ambv/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/ambv",
"id": 55281,
"login": "ambv",
"node_id": "MDQ6VXNlcjU1Mjgx",
"organizations_url": "https://api.github.com/users/ambv/orgs",
"received_events_url": "https://api.github.com/users/ambv/received_events",
"repos_url": "https://api.github.com/users/ambv/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/ambv/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/ambv/subscriptions",
"type": "User",
"url": "https://api.github.com/users/ambv",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 15 |
2013-04-25T10:01:49Z
|
2021-09-08T20:01:15Z
|
2013-05-15T16:43:58Z
|
CONTRIBUTOR
|
resolved
|
As suggested in [this comment](https://github.com/kennethreitz/requests/issues/1320#issuecomment-16992832), I used an OrderedDict. All tests pass on Python 2.6 - 3.3 (provided #1326 is merged for 3.2).
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4",
"events_url": "https://api.github.com/users/kennethreitz/events{/privacy}",
"followers_url": "https://api.github.com/users/kennethreitz/followers",
"following_url": "https://api.github.com/users/kennethreitz/following{/other_user}",
"gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/kennethreitz",
"id": 119893,
"login": "kennethreitz",
"node_id": "MDQ6VXNlcjExOTg5Mw==",
"organizations_url": "https://api.github.com/users/kennethreitz/orgs",
"received_events_url": "https://api.github.com/users/kennethreitz/received_events",
"repos_url": "https://api.github.com/users/kennethreitz/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/kennethreitz/starred{/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/1327/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1327/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/1327.diff",
"html_url": "https://github.com/psf/requests/pull/1327",
"merged_at": "2013-05-15T16:43:58Z",
"patch_url": "https://github.com/psf/requests/pull/1327.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/1327"
}
| true |
[
"There's an easier way to do this with the Ordered Dictionary that doesn't require resorting the keys every time you mount an adapter. \n",
"Is there?\n",
"After testing it, it is probably not going to be as painless as this.\n\n:+1: Nice work @ambv \n",
"Cool. I'm +1 as well. =)\n",
"This looks great! I'm wondering if the length should matter as much as the order in which the adapter was added, maybe. I'm assuming if you add one at any point in your process and it matches, it should be used, no?\n",
"@kennethreitz the idea behind this is that you want to ensure the longest match is the first you'll find. So if you have an adapter for `http://example.com/endpoint1` and `http://example.com` and you issue a reqeust for `http://example.com/endpoint1/resource` you're going to get the first one and find it faster. Of course for the simplest case your performance is sort of awful, but most of those cases won't see people using adapters and as Lukasa mentioned, I doubt anyone is going to have too many adapters mounted in the first place. :)\n",
"@sigmavirus24's explanation was always my understanding of how you intended transport adapters to behave. If mount-order becomes the condition, then your adapters become surprising. For instance, changing the `Session` constructor from \n\n``` python\ns.mount('http://', HTTPAdapter())\ns.mount('https://', HTTPAdapter())\n```\n\nto:\n\n``` python\ns.mount('https://', HTTPAdapter())\ns.mount('http://', HTTPAdapter())\n```\n\ncauses all your HTTPS traffic hits the wrong adapter. There's no functional effect because all that logic is handled underneath, but it sure is strange.\n",
"I also think having **prefixes** in the mounting API suggests using the longest matching one.\n",
"So if we do order added then we'd have to do something else when we find the adapter @kennethreitz that would be akin to what @Lukasa's last pull request did. So the benefit of ordering would make no difference.\n\nThis just ensures that any adapters you have with freakishly long prefixes are matched first and returned.\n",
"Needs a rebase :)\n\nSo, what's the status here? I'm confused :)\n",
"Rebased the PR.\n\nThe status here, as described by @sigmavirus24 in [comment 6](https://github.com/kennethreitz/requests/pull/1327#issuecomment-17009475) and confirmed by @Lukasa in [comment 7](https://github.com/kennethreitz/requests/pull/1327#issuecomment-17010424), is that the existing prefix-based `mount` syntax\n\n``` python\n session_obj.mount('http://git', HTTPAdapter()) # 1\n session_obj.mount('http://github.com', HTTPAdapter()) # 2\n session_obj.mount('http://github.com/about/', HTTPAdapter()) # 3\n```\n\nalways suggested that the longest match will be used, for example `get('http://github.com/about/us/')` will always match rule 3 (never the default http:// nor rules 1 or 2), `get('http://gittip.com')` will always match rule 1 (never the default http://), and so on.\n\nThe `mount()` invocation order does not matter, only the length of the matching prefix.\n",
"Again :+1:\n",
":sparkles: :cake: :sparkles:\n",
":)\n",
":-)\n"
] |
https://api.github.com/repos/psf/requests/issues/1326
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1326/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1326/comments
|
https://api.github.com/repos/psf/requests/issues/1326/events
|
https://github.com/psf/requests/pull/1326
| 13,626,828 |
MDExOlB1bGxSZXF1ZXN0NTM2MTA5MA==
| 1,326 |
Fixed tests failing on Python 3.2
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/55281?v=4",
"events_url": "https://api.github.com/users/ambv/events{/privacy}",
"followers_url": "https://api.github.com/users/ambv/followers",
"following_url": "https://api.github.com/users/ambv/following{/other_user}",
"gists_url": "https://api.github.com/users/ambv/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/ambv",
"id": 55281,
"login": "ambv",
"node_id": "MDQ6VXNlcjU1Mjgx",
"organizations_url": "https://api.github.com/users/ambv/orgs",
"received_events_url": "https://api.github.com/users/ambv/received_events",
"repos_url": "https://api.github.com/users/ambv/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/ambv/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/ambv/subscriptions",
"type": "User",
"url": "https://api.github.com/users/ambv",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 4 |
2013-04-25T07:55:25Z
|
2021-09-08T20:01:15Z
|
2013-04-28T23:59:12Z
|
CONTRIBUTOR
|
resolved
|
A test introduced in #1279 used the `u''` literal which is not present on Python 3.2 which made unit tests fail.
This PR fixes the bug and introduces a rudimentary "tox.ini" which makes local tests with multiple Python versions trivial:
```
$ pip install tox
$ cd requests-sources/
$ tox
GLOB sdist-make: setup.py
py26 inst-nodeps: .tox/dist/requests-1.2.0.zip
py26 runtests: commands[0]
.........................................
Ran 41 tests in 24.071s
OK
py27 inst-nodeps: .tox/dist/requests-1.2.0.zip
py27 runtests: commands[0]
.........................................
Ran 41 tests in 23.269s
OK
py32 inst-nodeps: .tox/dist/requests-1.2.0.zip
py32 runtests: commands[0]
.........................................
Ran 41 tests in 21.836s
OK
py33 inst-nodeps: .tox/dist/requests-1.2.0.zip
py33 runtests: commands[0]
.........................................
Ran 41 tests in 22.674s
OK
________________ summary ________________
py26: commands succeeded
py27: commands succeeded
py32: commands succeeded
py33: commands succeeded
congratulations :)
```
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4",
"events_url": "https://api.github.com/users/kennethreitz/events{/privacy}",
"followers_url": "https://api.github.com/users/kennethreitz/followers",
"following_url": "https://api.github.com/users/kennethreitz/following{/other_user}",
"gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/kennethreitz",
"id": 119893,
"login": "kennethreitz",
"node_id": "MDQ6VXNlcjExOTg5Mw==",
"organizations_url": "https://api.github.com/users/kennethreitz/orgs",
"received_events_url": "https://api.github.com/users/kennethreitz/received_events",
"repos_url": "https://api.github.com/users/kennethreitz/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions",
"type": "User",
"url": "https://api.github.com/users/kennethreitz",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/1326/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1326/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/1326.diff",
"html_url": "https://github.com/psf/requests/pull/1326",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/1326.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/1326"
}
| true |
[
"Nice. =) :+1:\n",
"In related news, is the omission of Python 3.2 in `.travis.yml` deliberate? This is the reason the tests show as green while they actually fail under 3.2.\n\n`setup.py` lists this Python version as compatible in the trove classifiers.\n",
"Not merging for one reason only: `u''` was added to Python 3.3 because of a tweet I made because of this exact issue. I intend to take advantage of this now that it's there :)\n",
"You should then remove 3.1 and 3.2 from trove classifiers for future requests releases.\n"
] |
https://api.github.com/repos/psf/requests/issues/1325
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1325/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1325/comments
|
https://api.github.com/repos/psf/requests/issues/1325/events
|
https://github.com/psf/requests/issues/1325
| 13,620,305 |
MDU6SXNzdWUxMzYyMDMwNQ==
| 1,325 |
wtf happened to strict_mode? (POST should remain POST on redirect)
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/8549?v=4",
"events_url": "https://api.github.com/users/jamshid/events{/privacy}",
"followers_url": "https://api.github.com/users/jamshid/followers",
"following_url": "https://api.github.com/users/jamshid/following{/other_user}",
"gists_url": "https://api.github.com/users/jamshid/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/jamshid",
"id": 8549,
"login": "jamshid",
"node_id": "MDQ6VXNlcjg1NDk=",
"organizations_url": "https://api.github.com/users/jamshid/orgs",
"received_events_url": "https://api.github.com/users/jamshid/received_events",
"repos_url": "https://api.github.com/users/jamshid/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/jamshid/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jamshid/subscriptions",
"type": "User",
"url": "https://api.github.com/users/jamshid",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 9 |
2013-04-25T02:04:23Z
|
2021-09-08T23:10:43Z
|
2013-04-25T17:36:50Z
|
NONE
|
resolved
|
This is a followup to https://github.com/kennethreitz/requests/issues/996.
So I upgraded requests again and again my code broke. I was relying on strict_mode = True. Apparently that config functionality is gone?
What's this "despite standards" crap, aren't y'all supposed to be better than that? I'll make a pull request if you'll use it (and once I figure out the new config mechanism).
```
# Do what the browsers do, despite standards...
if (resp.status_code in (codes.moved, codes.found) and
prepared_request.method == 'POST'):
method = 'GET'
```
|
{
"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/1325/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1325/timeline
| null |
completed
| null | null | false |
[
"First, I'd like to remind you of the general rule for contributing to requests: [Be Cordial or Be On Your Way](http://kennethreitz.org/expressions/be-cordial-or-be-on-your-way). \n\nSecond, you seem to have upgraded from version before 1.0. In 1.0, all configuration was removed, including `strict_mode` so there is no configuration mechanism to be figured out.\n\nThird, requests doesn't advertise it as strictly RFC compliant and in fact, models much of its behaviours after what browsers do. In fact, far too many servers expect that from us. Unfortunately, if you'd like to replicate the behaviour that you are used to, you can do the following:\n\n``` python\n\nr = requests.post(url, data=data, allow_redirects=False)\nwhile r.status_code in (requests.codes.moved, requests.codes.found):\n q = requests.post(r.headers['Location'], data=data, allow_redirects=False)\n history = [r]\n history.extend(r.history)\n q.history = tuple(history)\n r = q\n```\n\nThis will properly preserve history on your request (which is ideal) and will do what you're expecting. I suppose, you could also use hooks, e.g., \n\n``` python\ndef post_redirect_hook(response, *args):\n if not (response.request.method == 'POST' and response.status_code in (requests.codes.moved, requests.codes.found)):\n return response\n\n # else resolve your redirect similar to above\n```\n\nYes it is non-ideal to have to do this, but our current behaviour seems to satisfy approximately 90% (if not more) of our users.\n",
"Hi all,\n\nJust adding a comment how I cope with this in case others stumble upon this issue.\n\nI also needed a strict mode to mimic a client that preserves the POST method on redirects. I chose to create a StrictSession which redefines resolve_redirects for the desired behavior. That way I keep my client code the simple without resorting to hooks with another loop.\n\nhttps://github.com/oohlaf/sprezz/blob/master/sprezz/util/network.py\n",
"Thanks @oohlaf!\n",
"Just adding that this bit me today. I have to talk to a server which expects me to follow the standard here. It's a little disappointing that I had to spend a non-trivial amount of time researching how to enable a standards-compliant mode in requests, then research why the solution I had found (`strict_mode = True`) didn't work, then write extra code because the solution had been removed.\n\nWhile I understand wanting to remove configuration, an extra parameter in `requests.post` would not be hard for users to understand. The parameter would reduce the amount of code users have to write in order to make the requests they want, something which requests has always previously done for me.\n\nI'm willing to write the pull request if you're willing to accept it.\n",
"BTW: The link I posted above was dead because I wanted to refactor my application, but got stalled.\n\nThe code is still there in the history at:\nhttps://github.com/oohlaf/sprezz/blob/be9b2f7e949f3469b970053597e70c2383570375/sprezz/util/network.py\n",
"@num1: The issue is not \"one extra parameter\". The issue is that we get many feature requests all of which want \"one extra parameter\". At some point we either draw a line or end up having many thousands of parameters. \n\nRequests will never be perfect for all use cases. It is impossible to follow the full breadth of both _de jure_ and _de facto_ HTTP usage _and_ have a simple API. It cannot be done. \n\nThe API is what matters to us. This means features that are only useful to a minority of developers but that add complexity to the API for all of them tend not to be accepted. At the moment, that is the case for this feature.\n",
"One extra parameter seems appropriate for something that is both rfc compliant and a feature used by at least the handful of users here. \n\nBut okay, it's you're call, hopefully you'll reconsider or follow the spec when/if implementing the updated HTTP/1.1 RFCs (https://www.mnot.net/blog/2014/06/07/rfc2616_is_dead). The method must not be changed for status codes 307 and 308 (http://tools.ietf.org/html/rfc7231#page-58).\n",
"@jamshid I hope next time you'll investigate the [actual behaviour](https://github.com/kennethreitz/requests/blob/master/requests/sessions.py#L134..L149) of requests. For the status codes that we [may](http://tools.ietf.org/html/rfc7231#section-6.4.2) change the method, we do because this is the unfortunate de facto behaviour that @lukasa referred to. We do **not** change them on 307 or 308 responses, ergo we already follow the new set of RFCs for HTTP/1.1.\n",
"sorry, thanks, point taken\n"
] |
https://api.github.com/repos/psf/requests/issues/1324
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1324/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1324/comments
|
https://api.github.com/repos/psf/requests/issues/1324/events
|
https://github.com/psf/requests/issues/1324
| 13,619,492 |
MDU6SXNzdWUxMzYxOTQ5Mg==
| 1,324 |
Session with CookieJar/LWPCookieJar cause AttributeError
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/29461?v=4",
"events_url": "https://api.github.com/users/falsetru/events{/privacy}",
"followers_url": "https://api.github.com/users/falsetru/followers",
"following_url": "https://api.github.com/users/falsetru/following{/other_user}",
"gists_url": "https://api.github.com/users/falsetru/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/falsetru",
"id": 29461,
"login": "falsetru",
"node_id": "MDQ6VXNlcjI5NDYx",
"organizations_url": "https://api.github.com/users/falsetru/orgs",
"received_events_url": "https://api.github.com/users/falsetru/received_events",
"repos_url": "https://api.github.com/users/falsetru/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/falsetru/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/falsetru/subscriptions",
"type": "User",
"url": "https://api.github.com/users/falsetru",
"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 | 3 |
2013-04-25T01:22:58Z
|
2021-09-09T04:00:33Z
|
2013-04-26T10:57:36Z
|
NONE
|
resolved
|
In 1.2.0 ,
```
>>> import cookielib
>>> import requests
>>> jar = cookielib.LWPCookieJar()
>>> s = requests.session()
>>> s.cookies = jar
>>> s.get('http://httpbin.org/')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/dist-packages/requests/sessions.py", line 369, in get
return self.request('GET', url, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/requests/sessions.py", line 297, in request
merged_cookies = self.cookies.copy()
AttributeError: LWPCookieJar instance has no attribute 'copy'
```
Works in older version. (0.14.2, 1.0.0, 1.0.1, 1.0.2, 1.0.3, 1.1.0)
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/240830?v=4",
"events_url": "https://api.github.com/users/sigmavirus24/events{/privacy}",
"followers_url": "https://api.github.com/users/sigmavirus24/followers",
"following_url": "https://api.github.com/users/sigmavirus24/following{/other_user}",
"gists_url": "https://api.github.com/users/sigmavirus24/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/sigmavirus24",
"id": 240830,
"login": "sigmavirus24",
"node_id": "MDQ6VXNlcjI0MDgzMA==",
"organizations_url": "https://api.github.com/users/sigmavirus24/orgs",
"received_events_url": "https://api.github.com/users/sigmavirus24/received_events",
"repos_url": "https://api.github.com/users/sigmavirus24/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/sigmavirus24/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/sigmavirus24/subscriptions",
"type": "User",
"url": "https://api.github.com/users/sigmavirus24",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/1324/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1324/timeline
| null |
completed
| null | null | false |
[
"So the code which causes this break was introduced partially because of Transport Adapters and partially because the re-factor broke the old code. This is a far more elegant way of managing cookies (in my opinion) than we used to use and I'm really not 100% comfortable changing it back. However, this is a major break in the API (although entirely unintended and not exactly forseen) so I am guessing that @kennethreitz will be entirely in favor of finding a solution to return to the old behaviour.\n\nThis especially is a pain because @gazpachoking and I put a decent amount of effort into restoring cookie persistance and making it elegant. Perhaps he would be interested in tackling this? _Nudge, nudge_\n",
"Hmm, yeah, I wasn't planning for the case that `cookies` attribute of a session would not be a `RequestsCookieJar` or a dict. I'll check it out.\n",
"@gazpachoking seems to have fixed this.\n"
] |
https://api.github.com/repos/psf/requests/issues/1323
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1323/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1323/comments
|
https://api.github.com/repos/psf/requests/issues/1323/events
|
https://github.com/psf/requests/pull/1323
| 13,603,310 |
MDExOlB1bGxSZXF1ZXN0NTM1MDEyMA==
| 1,323 |
Actually choose the best adapter match
|
{
"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 |
2013-04-24T18:49:22Z
|
2021-09-08T20:01:16Z
|
2013-04-25T08:30:44Z
|
MEMBER
|
resolved
|
So it turns out the documentation here has been wrong the whole time! Who knew?
This PR follows #1320, and selects the best matching prefix from the dict in a _really stupid_ way. The _right_ way to do this would be to use a trie, but I thought we probably didn't want the cost of a new structure, especially as it's unlikely a user will mount a large number of adapters to any one session.
Let me know if you think that's a bad idea, and I'll whip up a quick trie and add it to this PR.
|
{
"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/1323/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1323/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/1323.diff",
"html_url": "https://github.com/psf/requests/pull/1323",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/1323.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/1323"
}
| true |
[
"@sigmavirus24: Changes made. =)\n",
"Closed based on the discussion in #1320.\n"
] |
https://api.github.com/repos/psf/requests/issues/1322
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1322/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1322/comments
|
https://api.github.com/repos/psf/requests/issues/1322/events
|
https://github.com/psf/requests/issues/1322
| 13,590,688 |
MDU6SXNzdWUxMzU5MDY4OA==
| 1,322 |
Add note in docs about None not being as data
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/240830?v=4",
"events_url": "https://api.github.com/users/sigmavirus24/events{/privacy}",
"followers_url": "https://api.github.com/users/sigmavirus24/followers",
"following_url": "https://api.github.com/users/sigmavirus24/following{/other_user}",
"gists_url": "https://api.github.com/users/sigmavirus24/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/sigmavirus24",
"id": 240830,
"login": "sigmavirus24",
"node_id": "MDQ6VXNlcjI0MDgzMA==",
"organizations_url": "https://api.github.com/users/sigmavirus24/orgs",
"received_events_url": "https://api.github.com/users/sigmavirus24/received_events",
"repos_url": "https://api.github.com/users/sigmavirus24/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/sigmavirus24/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/sigmavirus24/subscriptions",
"type": "User",
"url": "https://api.github.com/users/sigmavirus24",
"user_view_type": "public"
}
|
[
{
"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/240830?v=4",
"events_url": "https://api.github.com/users/sigmavirus24/events{/privacy}",
"followers_url": "https://api.github.com/users/sigmavirus24/followers",
"following_url": "https://api.github.com/users/sigmavirus24/following{/other_user}",
"gists_url": "https://api.github.com/users/sigmavirus24/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/sigmavirus24",
"id": 240830,
"login": "sigmavirus24",
"node_id": "MDQ6VXNlcjI0MDgzMA==",
"organizations_url": "https://api.github.com/users/sigmavirus24/orgs",
"received_events_url": "https://api.github.com/users/sigmavirus24/received_events",
"repos_url": "https://api.github.com/users/sigmavirus24/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/sigmavirus24/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/sigmavirus24/subscriptions",
"type": "User",
"url": "https://api.github.com/users/sigmavirus24",
"user_view_type": "public"
}
|
[
{
"avatar_url": "https://avatars.githubusercontent.com/u/240830?v=4",
"events_url": "https://api.github.com/users/sigmavirus24/events{/privacy}",
"followers_url": "https://api.github.com/users/sigmavirus24/followers",
"following_url": "https://api.github.com/users/sigmavirus24/following{/other_user}",
"gists_url": "https://api.github.com/users/sigmavirus24/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/sigmavirus24",
"id": 240830,
"login": "sigmavirus24",
"node_id": "MDQ6VXNlcjI0MDgzMA==",
"organizations_url": "https://api.github.com/users/sigmavirus24/orgs",
"received_events_url": "https://api.github.com/users/sigmavirus24/received_events",
"repos_url": "https://api.github.com/users/sigmavirus24/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/sigmavirus24/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/sigmavirus24/subscriptions",
"type": "User",
"url": "https://api.github.com/users/sigmavirus24",
"user_view_type": "public"
}
] | null | 0 |
2013-04-24T14:35:07Z
|
2021-09-09T02:11:52Z
|
2013-07-19T08:19:56Z
|
CONTRIBUTOR
|
resolved
|
See this for more information
https://github.com/kennethreitz/requests/commit/751e7a0a66bc9f57923b8ae039bf2f467e106c60#commitcomment-3077752
I'm going to do this in a couple of weeks unless someone beats me to it. I just don't have the time right now.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4",
"events_url": "https://api.github.com/users/Lukasa/events{/privacy}",
"followers_url": "https://api.github.com/users/Lukasa/followers",
"following_url": "https://api.github.com/users/Lukasa/following{/other_user}",
"gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Lukasa",
"id": 1382556,
"login": "Lukasa",
"node_id": "MDQ6VXNlcjEzODI1NTY=",
"organizations_url": "https://api.github.com/users/Lukasa/orgs",
"received_events_url": "https://api.github.com/users/Lukasa/received_events",
"repos_url": "https://api.github.com/users/Lukasa/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Lukasa",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/1322/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1322/timeline
| null |
completed
| null | null | false |
[] |
https://api.github.com/repos/psf/requests/issues/1321
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1321/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1321/comments
|
https://api.github.com/repos/psf/requests/issues/1321/events
|
https://github.com/psf/requests/pull/1321
| 13,584,315 |
MDExOlB1bGxSZXF1ZXN0NTM0MTEwMQ==
| 1,321 |
Clear preset request headers case-insensitively
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/368520?v=4",
"events_url": "https://api.github.com/users/shaung/events{/privacy}",
"followers_url": "https://api.github.com/users/shaung/followers",
"following_url": "https://api.github.com/users/shaung/following{/other_user}",
"gists_url": "https://api.github.com/users/shaung/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/shaung",
"id": 368520,
"login": "shaung",
"node_id": "MDQ6VXNlcjM2ODUyMA==",
"organizations_url": "https://api.github.com/users/shaung/orgs",
"received_events_url": "https://api.github.com/users/shaung/received_events",
"repos_url": "https://api.github.com/users/shaung/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/shaung/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/shaung/subscriptions",
"type": "User",
"url": "https://api.github.com/users/shaung",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 12 |
2013-04-24T12:47:13Z
|
2021-09-08T20:01:14Z
|
2013-05-21T02:14:55Z
|
NONE
|
resolved
|
While request headers can be removed by setting them to `None`:
```
>>> r = requests.get('http://github.com', headers={'Accept-Encoding': None})
>>> 'Accept-Encoding' in r.request.headers
False
```
the following code gives an `KeyError` instead of doing the same job:
```
>>> # Remove preset header
>>> r = requests.get('http://github.com', headers={'accept-encoding': None})
Traceback (most recent call last):
(...)
File "..\requests\sessions.py", line 313, in request
headers = merge_kwargs(headers, self.headers)
File "..\requests\sessions.py", line 76, in merge_kwargs
del kwargs[k]
File "..\requests\packages\urllib3\packages\ordered_dict.py", line 59, in __delitem__
dict_delitem(self, key)
KeyError: 'accept-encoding'
```
With this patch the key to remove can be specified case-insensitively.
```
>>> r = requests.get('http://github.com', headers={'accept-encoding': None})
>>> 'Accept-Encoding' in r.request.headers
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/1321/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1321/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/1321.diff",
"html_url": "https://github.com/psf/requests/pull/1321",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/1321.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/1321"
}
| true |
[
"Can you fix the test for python 3.3?\n",
"@sigmavirus24 Thank you. I will fix it ASAP.\n",
"@shaung when you fix it, ping me. GitHub won't tell me when you've added commits so don't be afraid to mention me in the commit message or just add a comment here. :)\n",
"@sigmavirus24 Fixed :-)\n",
"Well this looks good to me. :+1:\n",
":+1: \n",
"This looks great! Can you do a rebase so I can merge it in? \n\nMany thanks :)\n",
"@cdunklau is this fixed by your pull request?\n",
"@sigmavirus24 Just tested against the new master after my PR was merged, this issue is not fixed.\n",
"@kennethreitz Thanks! I'm going to do it tonight.\n",
"@kennethreitz Ready for merging (=´ー`)ノ\n",
"I think #1343 + #1339 will make this pull obsolete to a degree. The other issue is that previously we were merging the arguments in a case insensitive way which was only correct for headers. This is better handled by @gazpachoking's PR.\n"
] |
https://api.github.com/repos/psf/requests/issues/1320
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1320/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1320/comments
|
https://api.github.com/repos/psf/requests/issues/1320/events
|
https://github.com/psf/requests/issues/1320
| 13,564,379 |
MDU6SXNzdWUxMzU2NDM3OQ==
| 1,320 |
Transport adapters don't work as advertised
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/55281?v=4",
"events_url": "https://api.github.com/users/ambv/events{/privacy}",
"followers_url": "https://api.github.com/users/ambv/followers",
"following_url": "https://api.github.com/users/ambv/following{/other_user}",
"gists_url": "https://api.github.com/users/ambv/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/ambv",
"id": 55281,
"login": "ambv",
"node_id": "MDQ6VXNlcjU1Mjgx",
"organizations_url": "https://api.github.com/users/ambv/orgs",
"received_events_url": "https://api.github.com/users/ambv/received_events",
"repos_url": "https://api.github.com/users/ambv/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/ambv/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/ambv/subscriptions",
"type": "User",
"url": "https://api.github.com/users/ambv",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 12 |
2013-04-24T00:05:19Z
|
2021-09-09T03:00:39Z
|
2013-05-15T16:43:59Z
|
CONTRIBUTOR
|
resolved
|
Having:
``` python
>>> import requests
>>> s = requests.Session()
```
We cannot currently reliably do::
``` python
>>> import requests_testadapter
>>> s.mount('http://test.com', requests_testadapter.TestAdapter(b'Mock'))
```
We should, this is documented: http://docs.python-requests.org/en/latest/user/advanced/#transport-adapters
Instead, because of [Session.get_adapter()](https://github.com/kennethreitz/requests/blob/master/requests/sessions.py#L478) the following might or might not work as expected:
``` python
>>> s.get('http://test.com')
```
This is because there is already a default adapter for `'http://'` in the form of `requests.adapters.HTTPAdapter`. Depending on the (seemingly random) order of keys in the `s.adapters` dictionary, for some combinations of keys it will work, for others it won't.
## Solutions
There are a couple. As usual, a compromise between backwards compatibility, clarity and performance.
### Slow but compatible
Change `Session.get_adapter()` so that it sorts the keys every time it fetches an adapter. The advantage is that `session_obj.adapters` is still a vanilla dictionary, if you consider it a public API.
### A custom dictionary type
Something like Django's `SortedDict` which would sort the keys on insertion. The advantage is that `session_obj.adapters` is still a mapping and now `Session.get_adapter()` is faster. The disadvantage is the maintenance cost of a custom data structure. Also, mild backwards incompatibility if someone somewhere used the fact that `session_obj.adapters` is exactly of the type `dict` (unlikely, isn't it?).
### A list of tuples
Having `Session.mount()` and `Session.get_adapter()` as the public API for adapters, we might just as well implement the sorting while mounting and just maintain `session_obj.adapters` as a list of tuples. The advantage is that it's the fastest solution with no additional maintenance burden. The disadvantage is backwards incompatibility.
## We have to sort... but how exactly?
This is another design issue. It appears that sorting first from the longest key to shortest, and then alphabetically (for keys of the same length), is the way.
## You decide
What should we do about it? By the way, this test adapter in the example above [is an actual thing](https://pypi.python.org/pypi/requests-testadapter).
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4",
"events_url": "https://api.github.com/users/kennethreitz/events{/privacy}",
"followers_url": "https://api.github.com/users/kennethreitz/followers",
"following_url": "https://api.github.com/users/kennethreitz/following{/other_user}",
"gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/kennethreitz",
"id": 119893,
"login": "kennethreitz",
"node_id": "MDQ6VXNlcjExOTg5Mw==",
"organizations_url": "https://api.github.com/users/kennethreitz/orgs",
"received_events_url": "https://api.github.com/users/kennethreitz/received_events",
"repos_url": "https://api.github.com/users/kennethreitz/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/kennethreitz/starred{/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/1320/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1320/timeline
| null |
completed
| null | null | false |
[
"> This is because there is already a default adapter for 'http://' in the form of requests.adapters.HTTPAdapter. Depending on the (seemingly random) order of keys in the s.adapters dictionary, for some combinations of keys it will work, for others it won't.\n\n**EDIT** None of the information in this comment is correct. There's nothing to see here except my embarrassment.\n\nThis has nothing to do with dictionary order. When we look an adapter we're looking for an adapter based on protocol, not hostname. We use `urlparse` to get the scheme (or protocol) and then we look for that in the adapters dictionary. With this in mind you get\n\n``` python\nuri = urlparse('http://test.com')\nassert uri.scheme == 'http://'\nassert uri.host == 'http://'\n```\n\nAnd we do `self.adapters.get(uri.scheme)` I believe. You would have to monkey patch `get_adapter` to get the behaviour you want.\n\nThat's how we do it now. As for the docs, I have no clue why that example is there because it is just plain wrong. Setting up an adapter for that though would probably be convenient for quite a few people though. One concern I have, though, is that it is a change that sort of breaks the API despite being documented as working that way.\n\n@Lukasa ideas?\n",
"Actually, @ambv is right. Here's the source code for `get_adapter()`:\n\n``` python\ndef get_adapter(self, url):\n \"\"\"Returns the appropriate connnection adapter for the given URL.\"\"\"\n for (prefix, adapter) in self.adapters.items():\n if url.startswith(prefix):\n return adapter\n\n # Nothing matches :-/\n raise InvalidSchema(\"No connection adapters were found for '%s'\" % url)\n```\n\nThis is awkward, because I've provided Transport Adapter information in the past that directly contradicts this behaviour. I think we need to fix this, because the docs behaviour should be correct. I'm happy to take a swing at this.\n",
"I am sincerely sorry @ambv. That'll teach me to work from memory ever again. \n\nHere are my thoughts about this with the code above:\n- We could collect a list of matching adapters instead of returning the first one we find. The problem is then deciding which adapter to use\n- We could maintain two separate adapters registries: 1) user-created 2) default. The user-created adapters would be the first to be searched through and if there's a match in them we could then return that. If none of those match we would then search the default adapters and if nothing matches from there raise the `InvalidSchema` error. To preserve the API we could make `adapters` a property. The `@adapters.setter` method would then only set adapters on the user-created dictionary. The returned information would then be best represented as a list of two-tuples where the user-created items come first and is then followed by the default. This gives an intuitive idea of the overall ordering of discovery of adapters. This, however, would break the case where someone tries to do `session.adapters['http://']`\n- We could create our own `AdaptersRegistry` object which behaves like a dictionary, i.e., has the `__setitem__`, `__getitem__`, `get`, `set`, &c., methods, and does the search for us. Then we just maintain that as the `adapters` attribute.\n\nI could be vastly over-thinking the problem though.\n",
"I think we're totally over-engineering this. If we were going to do this properly we'd implement a trie and cause it to mimic the dictionary interface (not hard).\n\nThe reality is, we don't need to. We can assert that the number of transport adapters plugged into any session is likely to be small. If that's the case, we should just do:\n\n``` python\nbest = ''\nfor key, adapter in self.adapters.items():\n if url.startswith(key) and (len(best) < len(key)):\n best = key\n\nreturn self.adapters.get(best, None)\n```\n\nThis way we don't have to maintain a new data structure. Unless @kennethreitz wants to, of course, in which case I'll happily whip up a pure-Python trie. =)\n",
"> I think we're totally over-engineering this.\n\ns/we/you (where you is me) ;)\n\nAnd yeah that does sound like it should work.\n",
"One of the valid use cases for adapters is unit testing. Tests should run as fast as possible, spending time sorting adapters in place every time is wasteful. I don't like the approach taken in #1323 because `get_adapter()` is called for every single request.\n\nI'd like @kennethreitz to weigh in here whether he considers session.adapters a public API. For what it's worth this attribute is not listed in the \"Developers Interface\" section of the docs here: http://www.python-requests.org/en/latest/api/#request-sessions\n",
"Respectfully, I disagree.\n\nYes, it's not completely optimised. However, you have to consider the use cases. The overwhelming majority of cases will have two adapters installed: the defaults. My fix adds one-half of a dictionary iteration (on average), plus four length checks in this case. The next highest number of cases will have one other adapter in place. This means my fix adds one dictionary iteration (on average), plus six length checks. Actually, my performance is better, because we only do the length check if the prefix matches (so if we're doing HTTP, we don't do a length check on `'https://'`).\n\nFor perspective, on a GET request in Requests as we speak, we hit the following:\n\n```\n ncalls tottime percall cumtime percall filename:lineno(function)\n7975/7767 0.001 0.000 0.001 0.000 {len}\n 66 0.000 0.000 0.000 0.000 {method 'items' of 'dict' objects}\n```\n\nEven being generous and saying we would save six calls to `len` is barely a drop in the water.\n\nIterating over a dictionary isn't slow either. Using the following test code:\n\n``` python\na = {'hi': 'there', 'hello': 'there', 'sup': 'yo'}\n\nfor i in range(0, 1000000):\n for key, value in a.items():\n pass\n```\n\nRunning it in my shell and using `time` (so I'm also bearing the startup and teardown cost of the VM), we get:\n\n```\npython test.py 0.90s user 0.04s system 99% cpu 0.949 total\n```\n\nDividing by the number of iterations gives us 0.949/1000000 = 0.949ms per pass over the dictionary, or 0.3ms per dictionary element. I think we can bear the extra 300 nanoseconds. =)\n",
"Let's just do an ordered dict and search backwards for the first compatible adapter.\n",
"Doesn't ordered dict mean 'insertion order'? Because that won't actually fix our problem.\n",
"Oh, nevermind, we'll just rebuild the dict in the call to `mount()`. Ignore me. =)\n",
"Would you mind if I prepare the PR? :)\n",
"If that was aimed at me, then the answer is of course not. =)\n"
] |
https://api.github.com/repos/psf/requests/issues/1319
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1319/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1319/comments
|
https://api.github.com/repos/psf/requests/issues/1319/events
|
https://github.com/psf/requests/issues/1319
| 13,546,825 |
MDU6SXNzdWUxMzU0NjgyNQ==
| 1,319 |
Infinite recursion on 401 response with digest auth
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/176233?v=4",
"events_url": "https://api.github.com/users/jmakeig/events{/privacy}",
"followers_url": "https://api.github.com/users/jmakeig/followers",
"following_url": "https://api.github.com/users/jmakeig/following{/other_user}",
"gists_url": "https://api.github.com/users/jmakeig/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/jmakeig",
"id": 176233,
"login": "jmakeig",
"node_id": "MDQ6VXNlcjE3NjIzMw==",
"organizations_url": "https://api.github.com/users/jmakeig/orgs",
"received_events_url": "https://api.github.com/users/jmakeig/received_events",
"repos_url": "https://api.github.com/users/jmakeig/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/jmakeig/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jmakeig/subscriptions",
"type": "User",
"url": "https://api.github.com/users/jmakeig",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 7 |
2013-04-23T17:30:54Z
|
2021-09-09T04:00:33Z
|
2013-04-25T20:21:28Z
|
NONE
|
resolved
|
I’ll try to put together a proper test case, but in the meantime, I’m getting recursion depth errors when authentication fails using digest auth.
I’m using v1.1.0 (from pip) with Python 2.7.2 on Mac OS X 10.8.3.
My code doesn’t do anything fancy (though I’m an admitted Python noob):
```
class ModulesClient(object):
def __init__(self, config):
…
if self.auth_type == "digest":
self.auth = HTTPDigestAuth(self.user, self.password)
else:
raise Exception("Unsupported auth_type " + self.auth_type)
def put(self, uri, body, transaction=None):
"Send a file to the remote modules database. URIs are prepended with the root."
params = {"uri": self.root + uri, "perm:app-user": "execute"}
if transaction is not None:
params['txid'] = transaction
headers = {}
r = requests.put(
self.url + "/v1/documents",
params=params,
headers=headers,
auth=self.auth,
data=body
)
if r.status_code > 299 or r.status_code < 200:
raise Exception(r.status_code, r.text)
return ("PUT", r.status_code, params['uri'])
```
Everything works fine if authentication succeeds. However, if I give it invalid credentials I get:
```
Traceback (most recent call last):
File "/Users/jmakeig/Workspaces/modulesdb/src/local-watcher.py", line 216, in <module>
walk(BASEDIR)
File "/Users/jmakeig/Workspaces/modulesdb/src/local-watcher.py", line 61, in walk
file_path=asb
File "/Users/jmakeig/Workspaces/modulesdb/src/modulesclient.py", line 62, in put_file
msg = self.put(uri=uri, body=f.read(), transaction=transaction)
File "/Users/jmakeig/Workspaces/modulesdb/src/modulesclient.py", line 51, in put
data=body
File "/Users/jmakeig/Library/Python/2.7/lib/python/site-packages/requests/api.py", line 98, in put
return request('put', url, data=data, **kwargs)
File "/Users/jmakeig/Library/Python/2.7/lib/python/site-packages/requests/api.py", line 44, in request
return session.request(method=method, url=url, **kwargs)
File "/Users/jmakeig/Library/Python/2.7/lib/python/site-packages/requests/sessions.py", line 279, in request
resp = self.send(prep, stream=stream, timeout=timeout, verify=verify, cert=cert, proxies=proxies)
File "/Users/jmakeig/Library/Python/2.7/lib/python/site-packages/requests/sessions.py", line 374, in send
r = adapter.send(request, **kwargs)
File "/Users/jmakeig/Library/Python/2.7/lib/python/site-packages/requests/adapters.py", line 219, in send
r = self.build_response(request, resp)
File "/Users/jmakeig/Library/Python/2.7/lib/python/site-packages/requests/adapters.py", line 113, in build_response
response = dispatch_hook('response', req.hooks, response)
File "/Users/jmakeig/Library/Python/2.7/lib/python/site-packages/requests/hooks.py", line 39, in dispatch_hook
_hook_data = hook(hook_data)
File "/Users/jmakeig/Library/Python/2.7/lib/python/site-packages/requests/auth.py", line 156, in handle_401
_r = r.connection.send(r.request)
File "/Users/jmakeig/Library/Python/2.7/lib/python/site-packages/requests/adapters.py", line 219, in send
r = self.build_response(request, resp)
File "/Users/jmakeig/Library/Python/2.7/lib/python/site-packages/requests/adapters.py", line 113, in build_response
response = dispatch_hook('response', req.hooks, response)
File "/Users/jmakeig/Library/Python/2.7/lib/python/site-packages/requests/hooks.py", line 39, in dispatch_hook
_hook_data = hook(hook_data)
File "/Users/jmakeig/Library/Python/2.7/lib/python/site-packages/requests/auth.py", line 156, in handle_401
_r = r.connection.send(r.request)
File "/Users/jmakeig/Library/Python/2.7/lib/python/site-packages/requests/adapters.py", line 219, in send
r = self.build_response(request, resp)
File "/Users/jmakeig/Library/Python/2.7/lib/python/site-packages/requests/adapters.py", line 113, in build_response
response = dispatch_hook('response', req.hooks, response)
File "/Users/jmakeig/Library/Python/2.7/lib/python/site-packages/requests/hooks.py", line 39, in dispatch_hook
_hook_data = hook(hook_data)
File "/Users/jmakeig/Library/Python/2.7/lib/python/site-packages/requests/auth.py", line 156, in handle_401
_r = r.connection.send(r.request)
File "/Users/jmakeig/Library/Python/2.7/lib/python/site-packages/requests/adapters.py", line 219, in send
r = self.build_response(request, resp)
File "/Users/jmakeig/Library/Python/2.7/lib/python/site-packages/requests/adapters.py", line 113, in build_response
response = dispatch_hook('response', req.hooks, response)
File "/Users/jmakeig/Library/Python/2.7/lib/python/site-packages/requests/hooks.py", line 39, in dispatch_hook
_hook_data = hook(hook_data)
File "/Users/jmakeig/Library/Python/2.7/lib/python/site-packages/requests/auth.py", line 156, in handle_401
_r = r.connection.send(r.request)
File "/Users/jmakeig/Library/Python/2.7/lib/python/site-packages/requests/adapters.py", line 219, in send
r = self.build_response(request, resp)
File "/Users/jmakeig/Library/Python/2.7/lib/python/site-packages/requests/adapters.py", line 113, in build_response
response = dispatch_hook('response', req.hooks, response)
File "/Users/jmakeig/Library/Python/2.7/lib/python/site-packages/requests/hooks.py", line 39, in dispatch_hook
_hook_data = hook(hook_data)
File "/Users/jmakeig/Library/Python/2.7/lib/python/site-packages/requests/auth.py", line 156, in handle_401
_r = r.connection.send(r.request)
File "/Users/jmakeig/Library/Python/2.7/lib/python/site-packages/requests/adapters.py", line 219, in send
r = self.build_response(request, resp)
File "/Users/jmakeig/Library/Python/2.7/lib/python/site-packages/requests/adapters.py", line 113, in build_response
response = dispatch_hook('response', req.hooks, response)
File "/Users/jmakeig/Library/Python/2.7/lib/python/site-packages/requests/hooks.py", line 39, in dispatch_hook
_hook_data = hook(hook_data)
File "/Users/jmakeig/Library/Python/2.7/lib/python/site-packages/requests/auth.py", line 156, in handle_401
_r = r.connection.send(r.request)
File "/Users/jmakeig/Library/Python/2.7/lib/python/site-packages/requests/adapters.py", line 219, in send
r = self.build_response(request, resp)
File "/Users/jmakeig/Library/Python/2.7/lib/python/site-packages/requests/adapters.py", line 113, in build_response
response = dispatch_hook('response', req.hooks, response)
File "/Users/jmakeig/Library/Python/2.7/lib/python/site-packages/requests/hooks.py", line 39, in dispatch_hook
_hook_data = hook(hook_data)
File "/Users/jmakeig/Library/Python/2.7/lib/python/site-packages/requests/auth.py", line 156, in handle_401
_r = r.connection.send(r.request)
File "/Users/jmakeig/Library/Python/2.7/lib/python/site-packages/requests/adapters.py", line 219, in send
r = self.build_response(request, resp)
File "/Users/jmakeig/Library/Python/2.7/lib/python/site-packages/requests/adapters.py", line 113, in build_response
response = dispatch_hook('response', req.hooks, response)
File "/Users/jmakeig/Library/Python/2.7/lib/python/site-packages/requests/hooks.py", line 39, in dispatch_hook
_hook_data = hook(hook_data)
File "/Users/jmakeig/Library/Python/2.7/lib/python/site-packages/requests/auth.py", line 156, in handle_401
_r = r.connection.send(r.request)
File "/Users/jmakeig/Library/Python/2.7/lib/python/site-packages/requests/adapters.py", line 219, in send
r = self.build_response(request, resp)
File "/Users/jmakeig/Library/Python/2.7/lib/python/site-packages/requests/adapters.py", line 113, in build_response
response = dispatch_hook('response', req.hooks, response)
File "/Users/jmakeig/Library/Python/2.7/lib/python/site-packages/requests/hooks.py", line 39, in dispatch_hook
_hook_data = hook(hook_data)
File "/Users/jmakeig/Library/Python/2.7/lib/python/site-packages/requests/auth.py", line 156, in handle_401
_r = r.connection.send(r.request)
File "/Users/jmakeig/Library/Python/2.7/lib/python/site-packages/requests/adapters.py", line 219, in send
r = self.build_response(request, resp)
File "/Users/jmakeig/Library/Python/2.7/lib/python/site-packages/requests/adapters.py", line 113, in build_response
response = dispatch_hook('response', req.hooks, response)
File "/Users/jmakeig/Library/Python/2.7/lib/python/site-packages/requests/hooks.py", line 39, in dispatch_hook
_hook_data = hook(hook_data)
File "/Users/jmakeig/Library/Python/2.7/lib/python/site-packages/requests/auth.py", line 156, in handle_401
_r = r.connection.send(r.request)
File "/Users/jmakeig/Library/Python/2.7/lib/python/site-packages/requests/adapters.py", line 219, in send
r = self.build_response(request, resp)
File "/Users/jmakeig/Library/Python/2.7/lib/python/site-packages/requests/adapters.py", line 113, in build_response
response = dispatch_hook('response', req.hooks, response)
File "/Users/jmakeig/Library/Python/2.7/lib/python/site-packages/requests/hooks.py", line 39, in dispatch_hook
_hook_data = hook(hook_data)
File "/Users/jmakeig/Library/Python/2.7/lib/python/site-packages/requests/auth.py", line 156, in handle_401
_r = r.connection.send(r.request)
File "/Users/jmakeig/Library/Python/2.7/lib/python/site-packages/requests/adapters.py", line 219, in send
r = self.build_response(request, resp)
File "/Users/jmakeig/Library/Python/2.7/lib/python/site-packages/requests/adapters.py", line 113, in build_response
response = dispatch_hook('response', req.hooks, response)
File "/Users/jmakeig/Library/Python/2.7/lib/python/site-packages/requests/hooks.py", line 39, in dispatch_hook
_hook_data = hook(hook_data)
File "/Users/jmakeig/Library/Python/2.7/lib/python/site-packages/requests/auth.py", line 156, in handle_401
_r = r.connection.send(r.request)
File "/Users/jmakeig/Library/Python/2.7/lib/python/site-packages/requests/adapters.py", line 219, in send
r = self.build_response(request, resp)
File "/Users/jmakeig/Library/Python/2.7/lib/python/site-packages/requests/adapters.py", line 113, in build_response
response = dispatch_hook('response', req.hooks, response)
File "/Users/jmakeig/Library/Python/2.7/lib/python/site-packages/requests/hooks.py", line 39, in dispatch_hook
_hook_data = hook(hook_data)
File "/Users/jmakeig/Library/Python/2.7/lib/python/site-packages/requests/auth.py", line 156, in handle_401
_r = r.connection.send(r.request)
File "/Users/jmakeig/Library/Python/2.7/lib/python/site-packages/requests/adapters.py", line 219, in send
r = self.build_response(request, resp)
File "/Users/jmakeig/Library/Python/2.7/lib/python/site-packages/requests/adapters.py", line 113, in build_response
response = dispatch_hook('response', req.hooks, response)
File "/Users/jmakeig/Library/Python/2.7/lib/python/site-packages/requests/hooks.py", line 39, in dispatch_hook
_hook_data = hook(hook_data)
File "/Users/jmakeig/Library/Python/2.7/lib/python/site-packages/requests/auth.py", line 156, in handle_401
_r = r.connection.send(r.request)
File "/Users/jmakeig/Library/Python/2.7/lib/python/site-packages/requests/adapters.py", line 219, in send
r = self.build_response(request, resp)
File "/Users/jmakeig/Library/Python/2.7/lib/python/site-packages/requests/adapters.py", line 113, in build_response
response = dispatch_hook('response', req.hooks, response)
File "/Users/jmakeig/Library/Python/2.7/lib/python/site-packages/requests/hooks.py", line 39, in dispatch_hook
_hook_data = hook(hook_data)
File "/Users/jmakeig/Library/Python/2.7/lib/python/site-packages/requests/auth.py", line 156, in handle_401
_r = r.connection.send(r.request)
File "/Users/jmakeig/Library/Python/2.7/lib/python/site-packages/requests/adapters.py", line 219, in send
r = self.build_response(request, resp)
File "/Users/jmakeig/Library/Python/2.7/lib/python/site-packages/requests/adapters.py", line 113, in build_response
response = dispatch_hook('response', req.hooks, response)
File "/Users/jmakeig/Library/Python/2.7/lib/python/site-packages/requests/hooks.py", line 39, in dispatch_hook
_hook_data = hook(hook_data)
File "/Users/jmakeig/Library/Python/2.7/lib/python/site-packages/requests/auth.py", line 156, in handle_401
_r = r.connection.send(r.request)
File "/Users/jmakeig/Library/Python/2.7/lib/python/site-packages/requests/adapters.py", line 219, in send
r = self.build_response(request, resp)
File "/Users/jmakeig/Library/Python/2.7/lib/python/site-packages/requests/adapters.py", line 113, in build_response
response = dispatch_hook('response', req.hooks, response)
File "/Users/jmakeig/Library/Python/2.7/lib/python/site-packages/requests/hooks.py", line 39, in dispatch_hook
_hook_data = hook(hook_data)
File "/Users/jmakeig/Library/Python/2.7/lib/python/site-packages/requests/auth.py", line 156, in handle_401
_r = r.connection.send(r.request)
File "/Users/jmakeig/Library/Python/2.7/lib/python/site-packages/requests/adapters.py", line 219, in send
r = self.build_response(request, resp)
File "/Users/jmakeig/Library/Python/2.7/lib/python/site-packages/requests/adapters.py", line 113, in build_response
response = dispatch_hook('response', req.hooks, response)
File "/Users/jmakeig/Library/Python/2.7/lib/python/site-packages/requests/hooks.py", line 39, in dispatch_hook
_hook_data = hook(hook_data)
File "/Users/jmakeig/Library/Python/2.7/lib/python/site-packages/requests/auth.py", line 156, in handle_401
_r = r.connection.send(r.request)
File "/Users/jmakeig/Library/Python/2.7/lib/python/site-packages/requests/adapters.py", line 219, in send
r = self.build_response(request, resp)
File "/Users/jmakeig/Library/Python/2.7/lib/python/site-packages/requests/adapters.py", line 113, in build_response
response = dispatch_hook('response', req.hooks, response)
File "/Users/jmakeig/Library/Python/2.7/lib/python/site-packages/requests/hooks.py", line 39, in dispatch_hook
_hook_data = hook(hook_data)
File "/Users/jmakeig/Library/Python/2.7/lib/python/site-packages/requests/auth.py", line 156, in handle_401
_r = r.connection.send(r.request)
File "/Users/jmakeig/Library/Python/2.7/lib/python/site-packages/requests/adapters.py", line 219, in send
r = self.build_response(request, resp)
File "/Users/jmakeig/Library/Python/2.7/lib/python/site-packages/requests/adapters.py", line 113, in build_response
response = dispatch_hook('response', req.hooks, response)
File "/Users/jmakeig/Library/Python/2.7/lib/python/site-packages/requests/hooks.py", line 39, in dispatch_hook
_hook_data = hook(hook_data)
File "/Users/jmakeig/Library/Python/2.7/lib/python/site-packages/requests/auth.py", line 156, in handle_401
_r = r.connection.send(r.request)
File "/Users/jmakeig/Library/Python/2.7/lib/python/site-packages/requests/adapters.py", line 219, in send
r = self.build_response(request, resp)
File "/Users/jmakeig/Library/Python/2.7/lib/python/site-packages/requests/adapters.py", line 113, in build_response
response = dispatch_hook('response', req.hooks, response)
File "/Users/jmakeig/Library/Python/2.7/lib/python/site-packages/requests/hooks.py", line 39, in dispatch_hook
_hook_data = hook(hook_data)
File "/Users/jmakeig/Library/Python/2.7/lib/python/site-packages/requests/auth.py", line 156, in handle_401
_r = r.connection.send(r.request)
File "/Users/jmakeig/Library/Python/2.7/lib/python/site-packages/requests/adapters.py", line 219, in send
r = self.build_response(request, resp)
File "/Users/jmakeig/Library/Python/2.7/lib/python/site-packages/requests/adapters.py", line 113, in build_response
response = dispatch_hook('response', req.hooks, response)
File "/Users/jmakeig/Library/Python/2.7/lib/python/site-packages/requests/hooks.py", line 39, in dispatch_hook
_hook_data = hook(hook_data)
File "/Users/jmakeig/Library/Python/2.7/lib/python/site-packages/requests/auth.py", line 156, in handle_401
_r = r.connection.send(r.request)
File "/Users/jmakeig/Library/Python/2.7/lib/python/site-packages/requests/adapters.py", line 219, in send
r = self.build_response(request, resp)
File "/Users/jmakeig/Library/Python/2.7/lib/python/site-packages/requests/adapters.py", line 113, in build_response
response = dispatch_hook('response', req.hooks, response)
File "/Users/jmakeig/Library/Python/2.7/lib/python/site-packages/requests/hooks.py", line 39, in dispatch_hook
_hook_data = hook(hook_data)
File "/Users/jmakeig/Library/Python/2.7/lib/python/site-packages/requests/auth.py", line 156, in handle_401
_r = r.connection.send(r.request)
File "/Users/jmakeig/Library/Python/2.7/lib/python/site-packages/requests/adapters.py", line 219, in send
r = self.build_response(request, resp)
File "/Users/jmakeig/Library/Python/2.7/lib/python/site-packages/requests/adapters.py", line 113, in build_response
response = dispatch_hook('response', req.hooks, response)
File "/Users/jmakeig/Library/Python/2.7/lib/python/site-packages/requests/hooks.py", line 39, in dispatch_hook
_hook_data = hook(hook_data)
File "/Users/jmakeig/Library/Python/2.7/lib/python/site-packages/requests/auth.py", line 156, in handle_401
_r = r.connection.send(r.request)
File "/Users/jmakeig/Library/Python/2.7/lib/python/site-packages/requests/adapters.py", line 219, in send
r = self.build_response(request, resp)
File "/Users/jmakeig/Library/Python/2.7/lib/python/site-packages/requests/adapters.py", line 113, in build_response
response = dispatch_hook('response', req.hooks, response)
File "/Users/jmakeig/Library/Python/2.7/lib/python/site-packages/requests/hooks.py", line 39, in dispatch_hook
_hook_data = hook(hook_data)
File "/Users/jmakeig/Library/Python/2.7/lib/python/site-packages/requests/auth.py", line 156, in handle_401
_r = r.connection.send(r.request)
File "/Users/jmakeig/Library/Python/2.7/lib/python/site-packages/requests/adapters.py", line 219, in send
r = self.build_response(request, resp)
File "/Users/jmakeig/Library/Python/2.7/lib/python/site-packages/requests/adapters.py", line 113, in build_response
response = dispatch_hook('response', req.hooks, response)
File "/Users/jmakeig/Library/Python/2.7/lib/python/site-packages/requests/hooks.py", line 39, in dispatch_hook
_hook_data = hook(hook_data)
File "/Users/jmakeig/Library/Python/2.7/lib/python/site-packages/requests/auth.py", line 156, in handle_401
_r = r.connection.send(r.request)
File "/Users/jmakeig/Library/Python/2.7/lib/python/site-packages/requests/adapters.py", line 219, in send
r = self.build_response(request, resp)
File "/Users/jmakeig/Library/Python/2.7/lib/python/site-packages/requests/adapters.py", line 113, in build_response
response = dispatch_hook('response', req.hooks, response)
File "/Users/jmakeig/Library/Python/2.7/lib/python/site-packages/requests/hooks.py", line 39, in dispatch_hook
_hook_data = hook(hook_data)
File "/Users/jmakeig/Library/Python/2.7/lib/python/site-packages/requests/auth.py", line 156, in handle_401
_r = r.connection.send(r.request)
File "/Users/jmakeig/Library/Python/2.7/lib/python/site-packages/requests/adapters.py", line 219, in send
r = self.build_response(request, resp)
File "/Users/jmakeig/Library/Python/2.7/lib/python/site-packages/requests/adapters.py", line 113, in build_response
response = dispatch_hook('response', req.hooks, response)
File "/Users/jmakeig/Library/Python/2.7/lib/python/site-packages/requests/hooks.py", line 39, in dispatch_hook
_hook_data = hook(hook_data)
File "/Users/jmakeig/Library/Python/2.7/lib/python/site-packages/requests/auth.py", line 156, in handle_401
_r = r.connection.send(r.request)
File "/Users/jmakeig/Library/Python/2.7/lib/python/site-packages/requests/adapters.py", line 219, in send
r = self.build_response(request, resp)
File "/Users/jmakeig/Library/Python/2.7/lib/python/site-packages/requests/adapters.py", line 113, in build_response
response = dispatch_hook('response', req.hooks, response)
File "/Users/jmakeig/Library/Python/2.7/lib/python/site-packages/requests/hooks.py", line 39, in dispatch_hook
_hook_data = hook(hook_data)
File "/Users/jmakeig/Library/Python/2.7/lib/python/site-packages/requests/auth.py", line 156, in handle_401
_r = r.connection.send(r.request)
File "/Users/jmakeig/Library/Python/2.7/lib/python/site-packages/requests/adapters.py", line 219, in send
r = self.build_response(request, resp)
File "/Users/jmakeig/Library/Python/2.7/lib/python/site-packages/requests/adapters.py", line 113, in build_response
response = dispatch_hook('response', req.hooks, response)
File "/Users/jmakeig/Library/Python/2.7/lib/python/site-packages/requests/hooks.py", line 39, in dispatch_hook
_hook_data = hook(hook_data)
File "/Users/jmakeig/Library/Python/2.7/lib/python/site-packages/requests/auth.py", line 156, in handle_401
_r = r.connection.send(r.request)
File "/Users/jmakeig/Library/Python/2.7/lib/python/site-packages/requests/adapters.py", line 219, in send
r = self.build_response(request, resp)
File "/Users/jmakeig/Library/Python/2.7/lib/python/site-packages/requests/adapters.py", line 113, in build_response
response = dispatch_hook('response', req.hooks, response)
File "/Users/jmakeig/Library/Python/2.7/lib/python/site-packages/requests/hooks.py", line 39, in dispatch_hook
_hook_data = hook(hook_data)
File "/Users/jmakeig/Library/Python/2.7/lib/python/site-packages/requests/auth.py", line 156, in handle_401
_r = r.connection.send(r.request)
File "/Users/jmakeig/Library/Python/2.7/lib/python/site-packages/requests/adapters.py", line 219, in send
r = self.build_response(request, resp)
…
_r = r.connection.send(r.request)
File "/Users/jmakeig/Library/Python/2.7/lib/python/site-packages/requests/adapters.py", line 219, in send
r = self.build_response(request, resp)
File "/Users/jmakeig/Library/Python/2.7/lib/python/site-packages/requests/adapters.py", line 113, in build_response
response = dispatch_hook('response', req.hooks, response)
File "/Users/jmakeig/Library/Python/2.7/lib/python/site-packages/requests/hooks.py", line 39, in dispatch_hook
_hook_data = hook(hook_data)
File "/Users/jmakeig/Library/Python/2.7/lib/python/site-packages/requests/auth.py", line 156, in handle_401
_r = r.connection.send(r.request)
File "/Users/jmakeig/Library/Python/2.7/lib/python/site-packages/requests/adapters.py", line 219, in send
r = self.build_response(request, resp)
File "/Users/jmakeig/Library/Python/2.7/lib/python/site-packages/requests/adapters.py", line 87, in build_response
response = Response()
File "/Users/jmakeig/Library/Python/2.7/lib/python/site-packages/requests/models.py", line 457, in __init__
self.cookies = cookiejar_from_dict({})
File "/Users/jmakeig/Library/Python/2.7/lib/python/site-packages/requests/cookies.py", line 368, in cookiejar_from_dict
cookiejar = RequestsCookieJar()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/cookielib.py", line 1222, in __init__
self._cookies_lock = _threading.RLock()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 102, in RLock
return _RLock(*args, **kwargs)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 107, in __init__
_Verbose.__init__(self, verbose)
RuntimeError: maximum recursion depth exceeded in __instancecheck__
```
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/176233?v=4",
"events_url": "https://api.github.com/users/jmakeig/events{/privacy}",
"followers_url": "https://api.github.com/users/jmakeig/followers",
"following_url": "https://api.github.com/users/jmakeig/following{/other_user}",
"gists_url": "https://api.github.com/users/jmakeig/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/jmakeig",
"id": 176233,
"login": "jmakeig",
"node_id": "MDQ6VXNlcjE3NjIzMw==",
"organizations_url": "https://api.github.com/users/jmakeig/orgs",
"received_events_url": "https://api.github.com/users/jmakeig/received_events",
"repos_url": "https://api.github.com/users/jmakeig/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/jmakeig/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jmakeig/subscriptions",
"type": "User",
"url": "https://api.github.com/users/jmakeig",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/1319/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1319/timeline
| null |
completed
| null | null | false |
[
"After hacking a local copy of httpbin to constantly ask for Digest Auth, I find I'm unable to reproduce this. What version of Requests are you using?\n",
"I’m using v1.1.0 (from pip) with Python 2.7.2 on Mac OS X 10.8.3.\n",
"Can you try updating to v1.2.0? I have a feeling we might have fixed this between those two versions.\n",
"Yeah, it should have been fixed by 34268b16c397682be38f4147aa181f3ebf112e42.\n",
"Yup, upgrading to 1.2 fixed it. (Sorry for the noob issue.) Thanks, @Lukasa. \n",
"No problem, happy to help. =)\n",
"No need to apologize. We appreciate the fact you decided to report it.\n"
] |
https://api.github.com/repos/psf/requests/issues/1318
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1318/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1318/comments
|
https://api.github.com/repos/psf/requests/issues/1318/events
|
https://github.com/psf/requests/issues/1318
| 13,512,838 |
MDU6SXNzdWUxMzUxMjgzOA==
| 1,318 |
Issue of sending a HTTPS request use http proxy
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1644775?v=4",
"events_url": "https://api.github.com/users/howie1013/events{/privacy}",
"followers_url": "https://api.github.com/users/howie1013/followers",
"following_url": "https://api.github.com/users/howie1013/following{/other_user}",
"gists_url": "https://api.github.com/users/howie1013/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/howie1013",
"id": 1644775,
"login": "howie1013",
"node_id": "MDQ6VXNlcjE2NDQ3NzU=",
"organizations_url": "https://api.github.com/users/howie1013/orgs",
"received_events_url": "https://api.github.com/users/howie1013/received_events",
"repos_url": "https://api.github.com/users/howie1013/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/howie1013/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/howie1013/subscriptions",
"type": "User",
"url": "https://api.github.com/users/howie1013",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 1 |
2013-04-22T23:47:07Z
|
2021-09-09T04:00:36Z
|
2013-04-23T07:21:49Z
|
NONE
|
resolved
|
I try to sending a HTTPS requests by http proxy.
the code is like
``` python
proxy = 'host:port'
proxies = {'https' : proxy}
r = requests.post('https://url', proxies=proxies, timeout=10)
But it just raises the error below, while I tested it OK when using pycurl.
Traceback (most recent call last):
File "c:\python32\lib\site-packages\requests-1.2.0-py3.2.egg\requests\packages\urllib3\connectionpool.py", line 421, in urlopen
body=body, headers=headers)
File "c:\python32\lib\site-packages\requests-1.2.0-py3.2.egg\requests\packages\urllib3\connectionpool.py", line 273, in _make_request
conn.request(method, url, **httplib_request_kw)
File "c:\python32\lib\http\client.py", line 964, in request
self._send_request(method, url, body, headers)
File "c:\python32\lib\http\client.py", line 1002, in _send_request
self.endheaders(body)
File "c:\python32\lib\http\client.py", line 960, in endheaders
self._send_output(message_body)
File "c:\python32\lib\http\client.py", line 805, in _send_output
self.send(msg)
File "c:\python32\lib\http\client.py", line 743, in send
self.connect()
File "c:\python32\lib\site-packages\requests-1.2.0-py3.2.egg\requests\packages\urllib3\connectionpool.py", line 104, in connect
ssl_version=resolved_ssl_version)
File "c:\python32\lib\site-packages\requests-1.2.0-py3.2.egg\requests\packages\urllib3\util.py", line 329, in ssl_wrap_socket
return context.wrap_socket(sock, server_hostname=server_hostname)
File "c:\python32\lib\ssl.py", line 181, in wrap_socket
_context=self)
File "c:\python32\lib\ssl.py", line 268, in __init__
raise x
File "c:\python32\lib\ssl.py", line 264, in __init__
self.do_handshake()
File "c:\python32\lib\ssl.py", line 443, in do_handshake
self._sslobj.do_handshake()
socket.timeout: _ssl.c:376: The handshake operation timed out
```
|
{
"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/1318/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1318/timeline
| null |
completed
| null | null | false |
[
"Unfortunately, Requests is in an awkward place with proxies and HTTPS at the moment. You cannot use the HTTP CONNECT verb, which means the only kind of proxy you can use with HTTPS traffic is an SSL-terminating proxy like mitmproxy.\n\nThe specific bug here is that we're attempting to connect to your proxy and perform the SSL handshake, but the proxy is either not responding or taking too long to respond.\n\nUntil the CONNECT verb is implemented in urllib3 (see shazow/urllib3#170), you will not be able to do what you're attempting to do using Requests.\n\nSorry we can't do more to help you, and thanks for reporting the bug!\n"
] |
https://api.github.com/repos/psf/requests/issues/1317
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1317/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1317/comments
|
https://api.github.com/repos/psf/requests/issues/1317/events
|
https://github.com/psf/requests/issues/1317
| 13,441,667 |
MDU6SXNzdWUxMzQ0MTY2Nw==
| 1,317 |
C Runtime Error R6034 with py2exe
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/4212668?v=4",
"events_url": "https://api.github.com/users/fedeanna/events{/privacy}",
"followers_url": "https://api.github.com/users/fedeanna/followers",
"following_url": "https://api.github.com/users/fedeanna/following{/other_user}",
"gists_url": "https://api.github.com/users/fedeanna/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/fedeanna",
"id": 4212668,
"login": "fedeanna",
"node_id": "MDQ6VXNlcjQyMTI2Njg=",
"organizations_url": "https://api.github.com/users/fedeanna/orgs",
"received_events_url": "https://api.github.com/users/fedeanna/received_events",
"repos_url": "https://api.github.com/users/fedeanna/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/fedeanna/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/fedeanna/subscriptions",
"type": "User",
"url": "https://api.github.com/users/fedeanna",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 9 |
2013-04-20T21:57:03Z
|
2021-09-09T03:00:29Z
|
2013-06-08T08:06:19Z
|
NONE
|
resolved
|
I'm working in a Com Server DLL where I use requests to make POST a multipart form along with some XML file.
Localy, it works great and with no error. I can call the COM object methods and it returns me what I'm expeting to.
Now, when I use py2exe to build a dist version of the app, and try to register the DLL Com Server with regsvr32, I get the following error:
"Runtime Error!
...
R6034
An application has made an attempt to load the C runtime library incorrecly.
..."
Also, I've noticed that if I remove any reference to the requests library in my python code, I don't get this issue (obiously, I've lost the main functionality of the module).
|
{
"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/1317/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1317/timeline
| null |
completed
| null | null | false |
[
"First, do you have the manifest properly set up? I have no experience with py2exe but this [question](http://stackoverflow.com/questions/9793742/py2exe-the-exe-is-created-but-if-you-run-it-you-get-a-runtime-error-r6034) at StackOverflow seems to indicate this can solve your issue.\n\nOn the other hand, what version of requests are you using?\n",
"For what it's worth other similar questions at StackOverflow indicate similar solutions:\n- http://stackoverflow.com/questions/3126379/py2exe-com-dll-problem\n- http://stackoverflow.com/questions/1153643/how-do-i-debug-a-py2exe-application-failed-to-initialize-properly-error\n\nThis other one also suggests you might be missing a dependency (which could be requests if in fact removing it solves your issue):\n- http://stackoverflow.com/questions/11833301/python-executable-getting-a-runtime-error-r6034\n",
"I tried the manifest solution in every possible flavor. Also installed the runtime from the microsoft redistributable installer. No effects whatsoever. I'm possitively sure that it's got nothing to do with the runtime itself.\n\nMade virtual machines with W7 and XP, for testing purposes. I can register the Com server with regsvr32, but the error occurs when calling the method.\nHowever, if I comment the line where I make the POST with the request lib, or if I call another method where request is not involved, no errors occurs and everything seems to be working fine. Of course, the key functionality of the COM is lost, since everything revolves around the request lib. And I sincerely don't want to use the primitive urllib lib...\n\nMy conclusion is the same as yours: seems to be something with py2exe and the request lib. Some dependency has to be missing. Although I can't figure what or why, since py2exe seems to be packing everything...\nNever before has any problem distributing COM servers with py2exe. I'll keep looking for some answers...\n",
"Have you tried using the dependency walker?\n",
"All I can imagine really is that py2exe isn't also packaging the vendored dependencies of requests, i.e., it is packaging requests but not requests.packages, requests.packages.urllib3 or urllib3's vendored dependencies.\n",
"For what it's worth, I'm using py2exe successfully with requests on Windows. I've seen it working on everything from Win 2000, XP, 2003 Server, Vista, Server 2008, 7 and 8. Although having said that, getting all the dependencies right is a tough go for some things, but I never had issues with requests.\n",
"Thanks @dmckeone \n",
"@sigmavirus24 dependency walker gives me two missing dlls, but irrevelant ones.\nI agree with you, and came to the conclusion that py2exe is having some problems packing requests dependencies.\nRunning py2exe indicates some missing modules, corresponding to requests modules (urllib3, etc.)\nUsing modulefinder I've found where the import of those missing modules are. The issue seems to be that requests is using try statements to test python version (2 or 3) and use the corresponding import.\nNow, I'm using python 2.7 and this should be working. But it's not. And I cannot figure out why or how to fix it without messing woth requests source code...\n\n@dmckeone : Wich version of Python are you using?\n",
"@fedeanna I had it working on Python 2.7.3, and now on Python 2.7.4 both 32-bit and 64-bit.\n\nSince I know how much of a hassle this is, here is my `setup.py` script (It's a little ugly, sorry):\n\n```\nfrom __future__ import absolute_import, division\nimport sys\n\nif sys.platform == 'win32':\n from distutils.core import setup\nelse:\n from setuptools import setup\nimport babel\nimport glob\nimport os\n\nMAIN_SCRIPT = 'myapp.py'\nSERVICE_MODULE = 'appservice'\n\nroot_path = os.path.dirname(__file__)\npackage_dir = \"\"\n\nVISUAL_STUDIO_PATHS = [\n 'D:\\\\Microsoft Visual Studio 9.0',\n 'C:\\\\Program Files (x86)\\\\Microsoft Visual Studio 9.0',\n 'C:\\\\Program Files\\\\Microsoft Visual Studio 9.0',\n]\n\nif sys.platform == 'darwin':\n import py2app\n sys.argv.insert(1, \"py2app\")\n sys.argv.insert(2, \"--iconfile\")\n sys.argv.insert(3, \"App.icns\")\n\n extra_options = {\n 'setup_requires': ['py2app'],\n 'app': [MAIN_SCRIPT],\n 'options': {\n 'py2app': {\n 'optimize': 2,\n 'plist': {\n 'LSUIElement': True,\n 'LSBackgroundOnly': True,\n 'CFBundleIdentifier': \"com.aplace.myapp,\n 'NSHumanReadableCopyright': \"Copyright A Place Ltd. 2013\",\n },\n },\n },\n }\n\n extra_data_files = [\n (\"babel\", glob.glob(os.path.join(os.path.dirname(babel.__file__), \"localedata\")))\n ]\n\n dist_path = \"dist\"\n arch = \"universal\"\n package_dir = os.path.join(root_path, dist_path, \"MyApp.app\", \"Contents\")\n\nelif sys.platform == 'win32':\n import py2exe\n sys.argv.insert(1, \"py2exe\")\n\n # Get a good visual studio path\n visual_studio_path = None\n for path in VISUAL_STUDIO_PATHS:\n visual_studio_path = path\n if os.path.exists(visual_studio_path):\n break\n if not visual_studio_path:\n raise ValueError(u\"Unable to locate visual studio path. Tried:\\n{}\".format(u\"\\n\".join(VISUAL_STUDIO_PATHS)))\n\n max_size = u\"{:x}\".format(sys.maxsize)\n if max_size == u\"7fffffffffffffff\":\n # 64-bit systems\n visual_studio_path = os.path.join(visual_studio_path, r'VC\\redist\\amd64\\Microsoft.VC90.CRT\\*.*')\n arch = \"64\"\n dist_path = \"dist64\"\n elif max_size == u\"7fffffff\":\n # 32-bit systems\n visual_studio_path = os.path.join(visual_studio_path, r'VC\\redist\\x86\\Microsoft.VC90.CRT\\*.*')\n arch = \"32\"\n dist_path = \"dist32\"\n else:\n raise ValueError(u\"Unknown system architecture. sys.maxsize == {}\".format(max_size))\n\n includes = [\"win32com\" ,\"win32service\", \"win32serviceutil\", \"win32event\"]\n excludes = ['tcl', 'Tkconstants', 'Tkinter', 'distutils']\n packages = []\n dll_excludes = ['tcl84.dll', 'tk84.dll', 'SHFOLDER.dll', 'Secur32.dll', 'MPR.dll', 'CRYPT32.dll', 'KERNELBASE.dll',\n 'MSASN1.dll', 'API-MS-Win-Core-LocalRegistry-L1-1-0','API-MS-Win-Core-ErrorHandling-L1-1-0.dll',\n 'API-MS-Win-Core-LibraryLoader-L1-1-0.dll', 'API-MS-Win-Core-Misc-L1-1-0.dll',\n 'API-MS-Win-Core-ProcessThreads-L1-1-0.dll', 'API-MS-Win-Core-Profile-L1-1-0.dll',\n 'API-MS-Win-Core-String-L1-1-0.dll', 'API-MS-Win-Core-SysInfo-L1-1-0.dll',\n 'API-MS-Win-Security-Base-L1-1-0.dll'\n ]\n\n extra_options = dict(\n service=[{'modules':[SERVICE_MODULE], 'cmdline_style':'pywin32'}],\n console=[MAIN_SCRIPT],\n options={'py2exe': {\n 'compressed': 2,\n 'optimize': 2,\n 'excludes': excludes,\n 'dll_excludes': dll_excludes,\n \"bundle_files\": 3,\n \"dist_dir\": dist_path,\n \"xref\": False,\n \"skip_archive\": False,\n \"ascii\": False,\n }\n },\n zipfile=\"lib/shared.zip\",\n )\n\n extra_data_files = [\n (\"babel\\\\localedata\", glob.glob(os.path.join(os.path.dirname(babel.__file__), \"localedata\", \"*.*\"))),\n (\"Microsoft.VC90.CRT\", glob.glob(visual_studio_path)),\n ]\n\n package_dir = os.path.join(root_path, dist_path)\n\nelse:\n raise OSError (u\"Unknown Platform\")\n\nsetup(\n name=\"My App\",\n version=0.1,\n author=\"David McKeone\",\n author_email=\"[email protected]\",\n description=\"My App\",\n url=\"http://www.aplace.com\",\n\n data_files=extra_data_files,\n\n **extra_options\n)\n```\n\nIt freezes two .exe files on Windows (a service and a command line program), as well as an .app bundle on the Mac with py2app. Hopefully that can help you par it down to what makes it work. This app is a Flask app that uses babel, so if you aren't using babel you can probably get rid of some of that stuff. \n\nNote that I am missing a copy of the requests cacert.pem file, because I'm not using SSL requests. If you did need verified SSL then you'd need to do something similar to what I did for babel, and use the `requests.get('http://127.0.0.1', cert=path_to_cacert_pem)` or monkey-patch `requests.utils.DEFAULT_CA_BUNDLE_PATH` to be your cacert path\n\nI hope that helps, but if it doesn't then your next stop should likely be the py2exe forums, since I'm fairly certain it's not a Requests issue.\n"
] |
https://api.github.com/repos/psf/requests/issues/1316
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1316/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1316/comments
|
https://api.github.com/repos/psf/requests/issues/1316/events
|
https://github.com/psf/requests/pull/1316
| 13,415,196 |
MDExOlB1bGxSZXF1ZXN0NTI2Njc5MA==
| 1,316 |
MultiDict support for params=, data=, and files=
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/614430?v=4",
"events_url": "https://api.github.com/users/dmckeone/events{/privacy}",
"followers_url": "https://api.github.com/users/dmckeone/followers",
"following_url": "https://api.github.com/users/dmckeone/following{/other_user}",
"gists_url": "https://api.github.com/users/dmckeone/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/dmckeone",
"id": 614430,
"login": "dmckeone",
"node_id": "MDQ6VXNlcjYxNDQzMA==",
"organizations_url": "https://api.github.com/users/dmckeone/orgs",
"received_events_url": "https://api.github.com/users/dmckeone/received_events",
"repos_url": "https://api.github.com/users/dmckeone/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/dmckeone/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/dmckeone/subscriptions",
"type": "User",
"url": "https://api.github.com/users/dmckeone",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 26 |
2013-04-19T18:50:57Z
|
2021-08-29T00:06:57Z
|
2013-05-11T19:33:13Z
|
NONE
|
resolved
|
As discussed in [Add MultiDict Support](https://github.com/kennethreitz/requests/issues/1155), this enables `OrderedMultiDict` support in requests by adding the `OrderedMultiDict` and `MultiDict` structures and using them to marshall the `params=`, `data=`, and `files=` keyword arguments.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/614430?v=4",
"events_url": "https://api.github.com/users/dmckeone/events{/privacy}",
"followers_url": "https://api.github.com/users/dmckeone/followers",
"following_url": "https://api.github.com/users/dmckeone/following{/other_user}",
"gists_url": "https://api.github.com/users/dmckeone/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/dmckeone",
"id": 614430,
"login": "dmckeone",
"node_id": "MDQ6VXNlcjYxNDQzMA==",
"organizations_url": "https://api.github.com/users/dmckeone/orgs",
"received_events_url": "https://api.github.com/users/dmckeone/received_events",
"repos_url": "https://api.github.com/users/dmckeone/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/dmckeone/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/dmckeone/subscriptions",
"type": "User",
"url": "https://api.github.com/users/dmckeone",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/1316/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1316/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/1316.diff",
"html_url": "https://github.com/psf/requests/pull/1316",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/1316.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/1316"
}
| true |
[
"Also, since we're using py.test, use `assert foo > bar`.\n",
"I've added a failing test to prevent this from being accepted (for now), because I've realized that this PR doesn't meet all the requirements. (It just got lucky and passed the existing tests)\n",
"Hey @dmckeone could you rebase this against current master?\n",
"@sigmavirus24 No problem! I've actually never done a rebase before. I think it went ok, but let me know if I should do something differently.\n",
"Well, looks like the rebase didn't go properly. `from_key_val_list()` should be returning an `OrderedMultiDict`. I'm going to review all the changes again.\n\n@sigmavirus24 Since this has gotten a little messy with my screwed up rebase, should I just create a separate pull request and close this one?\n",
"> Well, looks like the rebase didn't go properly. from_key_val_list() should be returning an OrderedMultiDict. I'm going to review all the changes again.\n\nCan we make a test that fails in the current situation too. :)\n",
"@gazpachoking Yes, definitely. That was actually my first step.\n",
"I'm concerned about the implementation of `.utils.to_key_val_list`. It behaves badly when given non-`dict`-descended mappings such as `CaseInsensitiveDict`, as well as non-str sequences containing items with length != 2.\n\nThe implementation as of db9083a:\n\n``` python\n\ndef to_key_val_list(value):\n \"\"\"Take an object and test to see if it can be represented as a\n dictionary. If it can be, return a list of tuples, e.g.,\n\n ::\n\n >>> to_key_val_list([('key', 'val')])\n [('key', 'val')]\n >>> to_key_val_list({'key': 'val'})\n [('key', 'val')]\n >>> to_key_val_list('string')\n ValueError: cannot encode objects that are not 2-tuples.\n \"\"\"\n if value is None:\n return None\n\n if isinstance(value, (str, bytes, bool, int)):\n raise ValueError('cannot encode objects that are not 2-tuples')\n\n if isinstance(value, dict):\n value = value.items()\n try:\n # Check for MultiDict first\n value = value.items(multi=True)\n except TypeError:\n value = value.items()\n\n return list(value)\n```\n\nI suggest instead:\n\n``` python\nimport collections\n\nfrom .compat import basestring\n\ndef to_key_val_list(value):\n if value is None:\n return None\n\n if isinstance(value, collections.Mapping):\n try:\n # Check for MultiDict first\n items = value.items(multi=True)\n except TypeError:\n items = value.items()\n elif (not isinstance(value, basestring) and\n isinstance(value, collections.Sequence) and\n all(len(x) == 2 for x in value)\n ):\n items = value\n else:\n raise ValueError('Value must be a mapping or sequence of 2-iterables')\n\n return list(items)\n```\n\nAnd I don't really know why it has to be a list, either. Maybe this is out of scope for this PR, let me know if I should handle it separately.\n",
"@cdunklau I also noticed that `CaseInsensitiveDict` wasn't caught at any place that checked `isinstance( ... , dict)`, so I altered all of those checks to use `collections.Mapping` instead. As for the sequence check, that looks ok to me as well, happy to integrate it in this PR, but for now I haven't included it.\n",
"@dmckeone yeah I noticed the same thing somewhere in `.models`... but I haven't looked hard enough at it.\n",
"Hmm, we should probably fail fast on strings. I edited my code comment above to do that, along with a typo and some imports\n",
"@cdunklau After some more thought about your changes, I'm not sure if it would handle all inputs in the same way as the previous code. If a `value` was a generator, then `all()` would exhaust it, and the setting of `item` would not work correctly. Perhaps that is why `list()` is used? Your checks for `basestring` are good though, so I included those in a new commit.\n",
"Good point. I _really_ dislike the explicit type checks for bool and int. And we really don't need the check for string, I suspect. How about something more like this:\n\n``` python\ndef to_key_val_list(value):\n if value is None:\n return None\n\n if isinstance(value, collections.Mapping):\n try:\n # Check for MultiDict first\n items = value.items(multi=True)\n except TypeError:\n items = value.items()\n elif isinstance(value, collections.Iterable):\n items = value\n else:\n raise ValueError('Value must be a mapping, or iterable of 2-tuples')\n\n return list((k, v) for k, v in items)\n```\n",
"I would think it reasonable to assume that `.items()` was a list, so perhaps something more like:\n\n``` python\ndef to_key_val_list(value):\n if value is None:\n return None\n\n if isinstance(value, collections.Mapping):\n try:\n # Check for MultiDict first\n items = value.items(multi=True)\n except TypeError:\n items = value.items()\n elif isinstance(value, collections.Iterable):\n items = [(k, v) for k, v in value]\n else:\n raise ValueError('Value must be a mapping, or iterable of 2-tuples')\n\n return items\n```\n\nI'm guessing you are using the generator in list here to catch the 2-tuples?\n\nEDIT: I suppose we can use a list comprehension, rather than `list()`\n",
"`.items` is a view on py3, so that's a very bad assumption :grin:\n",
"I think we should return the list comp regardless, because of the py3 behavior.\n",
"@cdunklau Agreed. Made the commit.\n",
"Nitpicking, the docstring's example should be updated, and I think that ValueError could be worded better.\n",
"@cdunklau Updated. I had initially kept the same Exception message on purpose, but since it all needs to be updated, I suppose it is better to update the language.\n",
"Shiny, looks good at the surface. For what my uninformed opinion is worth, :+1: \n",
"So, I like this change, I was only wondering about a bit of an api change it creates. From the test:\n\n> s = requests.Session()\n> s.params = OrderedMultiDict({'multi': 2})\n> r = s.request('GET', url, params={'multi': '1'})\n> self.assertEqual(r.request.url, \"http://httpbin.org/get?multi=2&multi=1\")\n\nThis used to result in `http://httpbin.org/get?multi=1`, right? I'm not against the new behavior, just pointing out that it is new. Is there a way to override the session setting for `multi` anymore, rather than just extend it with more values?\n\nThis behavior would be a bit surprising if trying to override a particular session header or cookie on a request. In fact, maybe there is a bit more of an issue. With `merge_kwargs` using a `MultiDict`, for headers, I think it would be turned into a `CaseInsensitiveDict` later which means either the value of the session header or request header for a given key would be lost, with no control over which one was used.\n\n(Caveat, I have tested nothing. Just reading the code so far, so I could be wrong.)\n",
"Hmm, I don't like that `.update` _adds_ items. Shouldn't it overwrite them, like `__setitem__` does? I know that's not how werkzeug's multidict does it, but I think this one should.\n\nThere should definitely be an `.update`-like method that uses `__setitem__` instead of `add`.\n",
"Discussed a bit more with @cdunklau on IRC, we are thinking that keys from arguments in a request should still continue to override the same keys (rather than add more of those keys) from the session param.\n\nStill not sure if there should be some way to specifically add to the existing session keys for a given request, maybe if the request argument is explicitly a multidict.\n\nOther opinions are certainly needed, as I'm not sure if I'm considering all use cases. I'm thinking though that the most common would be to want to override a session key rather than add a second same key to a dict.\n",
"I agree with @gazpachoking and @cdunklau, overriding already set keys is the way to go. Sadly, that'll need special-case code.\n",
"Haven't forgotten about this. Closing this request because the discussion brought up a number of changes that needed to be made, and it's probably best done in a new pull request.\n",
"What was the solution to this? I'm trying to use\r\n\r\n```python\r\nimport requests\r\n\r\nfrom werkzeug.datastructures import ImmutableMultiDict\r\n\r\nparams = ImmutableMultiDict([('q1', 'value1'), ('q1', 'value2')])\r\nrequest = requests.Request(method='GET', url='https://my-url.com' params=params)\r\nsession = requests.Session()\r\nprepared_request = request.prepare()\r\n\r\n# getting \"https://my-url.com?q1=value1\",\r\n# but expecting \"https://my-url.com?q1=value1\"&q1=value2\"\r\nprint(prepared_request.url)\r\n\r\nresponse = session.send(prepared_request)\r\n```\r\n\r\n**Update**:\r\n\r\nSolved by removing ImmutableMultiDict. This works:\r\n\r\n```python\r\nimport requests\r\n\r\nparams = [('q1', 'value1'), ('q1', 'value2')]\r\nrequest = requests.Request(method='GET', url='https://my-url.com' params=params)\r\nsession = requests.Session()\r\nprepared_request = request.prepare()\r\n\r\n# \"https://my-url.com?q1=value1\"&q1=value2\"\r\nprint(prepared_request.url)\r\n\r\nresponse = session.send(prepared_request)\r\n```"
] |
https://api.github.com/repos/psf/requests/issues/1315
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1315/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1315/comments
|
https://api.github.com/repos/psf/requests/issues/1315/events
|
https://github.com/psf/requests/pull/1315
| 13,389,150 |
MDExOlB1bGxSZXF1ZXN0NTI1Mzg0MQ==
| 1,315 |
Don't reuse the same prepared request for all redirects
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/660112?v=4",
"events_url": "https://api.github.com/users/reclosedev/events{/privacy}",
"followers_url": "https://api.github.com/users/reclosedev/followers",
"following_url": "https://api.github.com/users/reclosedev/following{/other_user}",
"gists_url": "https://api.github.com/users/reclosedev/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/reclosedev",
"id": 660112,
"login": "reclosedev",
"node_id": "MDQ6VXNlcjY2MDExMg==",
"organizations_url": "https://api.github.com/users/reclosedev/orgs",
"received_events_url": "https://api.github.com/users/reclosedev/received_events",
"repos_url": "https://api.github.com/users/reclosedev/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/reclosedev/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/reclosedev/subscriptions",
"type": "User",
"url": "https://api.github.com/users/reclosedev",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 7 |
2013-04-19T06:38:16Z
|
2021-09-08T20:01:14Z
|
2013-06-08T10:53:16Z
|
CONTRIBUTOR
|
resolved
|
Updated #1275
Example:
``` python
import requests
resp = requests.get("http://httpbin.org/redirect/4")
for r in resp.history:
print("url: {} request.url: {}".format(r.url, r.request.url))
```
Output:
```
url: http://httpbin.org/redirect/4 request.url: http://httpbin.org/redirect/4
url: http://httpbin.org/redirect/3 request.url: http://httpbin.org/get
url: http://httpbin.org/redirect/2 request.url: http://httpbin.org/get
url: http://httpbin.org/redirect/1 request.url: http://httpbin.org/get
```
Desired:
```
url: http://httpbin.org/redirect/4 request.url: http://httpbin.org/redirect/4
url: http://httpbin.org/redirect/3 request.url: http://httpbin.org/redirect/3
...
```
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4",
"events_url": "https://api.github.com/users/kennethreitz/events{/privacy}",
"followers_url": "https://api.github.com/users/kennethreitz/followers",
"following_url": "https://api.github.com/users/kennethreitz/following{/other_user}",
"gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/kennethreitz",
"id": 119893,
"login": "kennethreitz",
"node_id": "MDQ6VXNlcjExOTg5Mw==",
"organizations_url": "https://api.github.com/users/kennethreitz/orgs",
"received_events_url": "https://api.github.com/users/kennethreitz/received_events",
"repos_url": "https://api.github.com/users/kennethreitz/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/kennethreitz/starred{/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/1315/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1315/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/1315.diff",
"html_url": "https://github.com/psf/requests/pull/1315",
"merged_at": "2013-06-08T10:53:16Z",
"patch_url": "https://github.com/psf/requests/pull/1315.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/1315"
}
| true |
[
":+1:\n",
"Nice! Can you do a rebase so I can merge? \n\nMany thanks :)\n",
"@kennethreitz done. \n\nLet me know if something is wrong, I'm doing rebase first time.\n",
":+1: on merging this before a new rebase is necessary\n",
"i missed it :(\n",
"Did a rebase again.\n",
"thanks!\n"
] |
https://api.github.com/repos/psf/requests/issues/1314
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1314/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1314/comments
|
https://api.github.com/repos/psf/requests/issues/1314/events
|
https://github.com/psf/requests/pull/1314
| 13,380,323 |
MDExOlB1bGxSZXF1ZXN0NTI1MDM4OA==
| 1,314 |
Fix small typo in the Support docs
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1574588?v=4",
"events_url": "https://api.github.com/users/duailibe/events{/privacy}",
"followers_url": "https://api.github.com/users/duailibe/followers",
"following_url": "https://api.github.com/users/duailibe/following{/other_user}",
"gists_url": "https://api.github.com/users/duailibe/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/duailibe",
"id": 1574588,
"login": "duailibe",
"node_id": "MDQ6VXNlcjE1NzQ1ODg=",
"organizations_url": "https://api.github.com/users/duailibe/orgs",
"received_events_url": "https://api.github.com/users/duailibe/received_events",
"repos_url": "https://api.github.com/users/duailibe/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/duailibe/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/duailibe/subscriptions",
"type": "User",
"url": "https://api.github.com/users/duailibe",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 3 |
2013-04-18T23:59:45Z
|
2021-09-08T20:01:13Z
|
2013-05-01T17:29:41Z
|
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/1314/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1314/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/1314.diff",
"html_url": "https://github.com/psf/requests/pull/1314",
"merged_at": "2013-05-01T17:29:40Z",
"patch_url": "https://github.com/psf/requests/pull/1314.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/1314"
}
| true |
[
":+1:\n",
":+1:\n",
"Thanks!\n"
] |
|
https://api.github.com/repos/psf/requests/issues/1313
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1313/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1313/comments
|
https://api.github.com/repos/psf/requests/issues/1313/events
|
https://github.com/psf/requests/pull/1313
| 13,315,304 |
MDExOlB1bGxSZXF1ZXN0NTIyMDE5Mg==
| 1,313 |
Fix max_redirects docs issue #1301
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/105852?v=4",
"events_url": "https://api.github.com/users/iurisilvio/events{/privacy}",
"followers_url": "https://api.github.com/users/iurisilvio/followers",
"following_url": "https://api.github.com/users/iurisilvio/following{/other_user}",
"gists_url": "https://api.github.com/users/iurisilvio/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/iurisilvio",
"id": 105852,
"login": "iurisilvio",
"node_id": "MDQ6VXNlcjEwNTg1Mg==",
"organizations_url": "https://api.github.com/users/iurisilvio/orgs",
"received_events_url": "https://api.github.com/users/iurisilvio/received_events",
"repos_url": "https://api.github.com/users/iurisilvio/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/iurisilvio/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/iurisilvio/subscriptions",
"type": "User",
"url": "https://api.github.com/users/iurisilvio",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 1 |
2013-04-17T19:31:47Z
|
2021-09-08T20:01:13Z
|
2013-04-17T19:39:04Z
|
CONTRIBUTOR
|
resolved
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4",
"events_url": "https://api.github.com/users/kennethreitz/events{/privacy}",
"followers_url": "https://api.github.com/users/kennethreitz/followers",
"following_url": "https://api.github.com/users/kennethreitz/following{/other_user}",
"gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/kennethreitz",
"id": 119893,
"login": "kennethreitz",
"node_id": "MDQ6VXNlcjExOTg5Mw==",
"organizations_url": "https://api.github.com/users/kennethreitz/orgs",
"received_events_url": "https://api.github.com/users/kennethreitz/received_events",
"repos_url": "https://api.github.com/users/kennethreitz/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions",
"type": "User",
"url": "https://api.github.com/users/kennethreitz",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/1313/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1313/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/1313.diff",
"html_url": "https://github.com/psf/requests/pull/1313",
"merged_at": "2013-04-17T19:39:04Z",
"patch_url": "https://github.com/psf/requests/pull/1313.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/1313"
}
| true |
[
":+1:\n"
] |
|
https://api.github.com/repos/psf/requests/issues/1312
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1312/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1312/comments
|
https://api.github.com/repos/psf/requests/issues/1312/events
|
https://github.com/psf/requests/issues/1312
| 13,176,685 |
MDU6SXNzdWUxMzE3NjY4NQ==
| 1,312 |
AttributeError: 'HTTPResponse' object has no attribute 'fileno'
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1676904?v=4",
"events_url": "https://api.github.com/users/johnrfrank/events{/privacy}",
"followers_url": "https://api.github.com/users/johnrfrank/followers",
"following_url": "https://api.github.com/users/johnrfrank/following{/other_user}",
"gists_url": "https://api.github.com/users/johnrfrank/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/johnrfrank",
"id": 1676904,
"login": "johnrfrank",
"node_id": "MDQ6VXNlcjE2NzY5MDQ=",
"organizations_url": "https://api.github.com/users/johnrfrank/orgs",
"received_events_url": "https://api.github.com/users/johnrfrank/received_events",
"repos_url": "https://api.github.com/users/johnrfrank/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/johnrfrank/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/johnrfrank/subscriptions",
"type": "User",
"url": "https://api.github.com/users/johnrfrank",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 1 |
2013-04-14T18:26:51Z
|
2021-09-09T04:00:37Z
|
2013-04-14T18:30:16Z
|
NONE
|
resolved
|
If I pass requests.get(url).raw into something that uses select, like subprocess, then I get AttributeError: 'HTTPResponse' object has no attribute 'fileno'
It looks like requests suffers from the problem fixed in urllib2 here:
http://bugs.python.org/issue1327971
Is there a simple work around?
Thanks!
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/240830?v=4",
"events_url": "https://api.github.com/users/sigmavirus24/events{/privacy}",
"followers_url": "https://api.github.com/users/sigmavirus24/followers",
"following_url": "https://api.github.com/users/sigmavirus24/following{/other_user}",
"gists_url": "https://api.github.com/users/sigmavirus24/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/sigmavirus24",
"id": 240830,
"login": "sigmavirus24",
"node_id": "MDQ6VXNlcjI0MDgzMA==",
"organizations_url": "https://api.github.com/users/sigmavirus24/orgs",
"received_events_url": "https://api.github.com/users/sigmavirus24/received_events",
"repos_url": "https://api.github.com/users/sigmavirus24/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/sigmavirus24/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/sigmavirus24/subscriptions",
"type": "User",
"url": "https://api.github.com/users/sigmavirus24",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/1312/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1312/timeline
| null |
completed
| null | null | false |
[
"`HTTPResponse` is actualy from urllib3 in this case, not urllib2. The simple work around would be to check urllib3 for similar issues and if none exist (open or closed) open a new one to see if @shazow likes the idea of making the Responses usable via select. You might be better off (in the interim) looking into the Respones attributes for something that might allow you to use select. It won't be as elegant as doing `Response.raw` but it shouldn't be worse than `Response.raw.attribute`.\n"
] |
https://api.github.com/repos/psf/requests/issues/1311
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1311/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1311/comments
|
https://api.github.com/repos/psf/requests/issues/1311/events
|
https://github.com/psf/requests/pull/1311
| 13,158,854 |
MDExOlB1bGxSZXF1ZXN0NTE0NzE1NQ==
| 1,311 |
Change the method when it isn't already GET/HEAD
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/240830?v=4",
"events_url": "https://api.github.com/users/sigmavirus24/events{/privacy}",
"followers_url": "https://api.github.com/users/sigmavirus24/followers",
"following_url": "https://api.github.com/users/sigmavirus24/following{/other_user}",
"gists_url": "https://api.github.com/users/sigmavirus24/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/sigmavirus24",
"id": 240830,
"login": "sigmavirus24",
"node_id": "MDQ6VXNlcjI0MDgzMA==",
"organizations_url": "https://api.github.com/users/sigmavirus24/orgs",
"received_events_url": "https://api.github.com/users/sigmavirus24/received_events",
"repos_url": "https://api.github.com/users/sigmavirus24/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/sigmavirus24/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/sigmavirus24/subscriptions",
"type": "User",
"url": "https://api.github.com/users/sigmavirus24",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 4 |
2013-04-13T16:32:50Z
|
2021-09-08T20:01:13Z
|
2013-04-13T19:02:29Z
|
CONTRIBUTOR
|
resolved
|
For some reason it was only change the method when a POST was being made. This
is almost certainly my fault.
Fixes #1303
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4",
"events_url": "https://api.github.com/users/kennethreitz/events{/privacy}",
"followers_url": "https://api.github.com/users/kennethreitz/followers",
"following_url": "https://api.github.com/users/kennethreitz/following{/other_user}",
"gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/kennethreitz",
"id": 119893,
"login": "kennethreitz",
"node_id": "MDQ6VXNlcjExOTg5Mw==",
"organizations_url": "https://api.github.com/users/kennethreitz/orgs",
"received_events_url": "https://api.github.com/users/kennethreitz/received_events",
"repos_url": "https://api.github.com/users/kennethreitz/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/kennethreitz/starred{/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/1311/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1311/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/1311.diff",
"html_url": "https://github.com/psf/requests/pull/1311",
"merged_at": "2013-04-13T19:02:29Z",
"patch_url": "https://github.com/psf/requests/pull/1311.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/1311"
}
| true |
[
"cc @Lukasa for code-review\n",
"I pronounce this one line change: REVIEWED. =D\n",
"I was going to reflect on this for a while, but someone can always simply do `allow_redirects=False`, so....\n",
":hatched_chick:\n"
] |
https://api.github.com/repos/psf/requests/issues/1310
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1310/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1310/comments
|
https://api.github.com/repos/psf/requests/issues/1310/events
|
https://github.com/psf/requests/pull/1310
| 13,148,630 |
MDExOlB1bGxSZXF1ZXN0NTE0NDk0OQ==
| 1,310 |
this can solve [Errno 185090050] when built to exe
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/3929477?v=4",
"events_url": "https://api.github.com/users/czjxy881/events{/privacy}",
"followers_url": "https://api.github.com/users/czjxy881/followers",
"following_url": "https://api.github.com/users/czjxy881/following{/other_user}",
"gists_url": "https://api.github.com/users/czjxy881/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/czjxy881",
"id": 3929477,
"login": "czjxy881",
"node_id": "MDQ6VXNlcjM5Mjk0Nzc=",
"organizations_url": "https://api.github.com/users/czjxy881/orgs",
"received_events_url": "https://api.github.com/users/czjxy881/received_events",
"repos_url": "https://api.github.com/users/czjxy881/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/czjxy881/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/czjxy881/subscriptions",
"type": "User",
"url": "https://api.github.com/users/czjxy881",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 6 |
2013-04-13T04:28:07Z
|
2021-09-08T20:01:12Z
|
2013-04-13T19:03:48Z
|
NONE
|
resolved
|
[Errno 185090050] _ssl.c:340: error:0B084002:x509 certificate routines:X509_load
_cert_crl_file:system lib
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4",
"events_url": "https://api.github.com/users/kennethreitz/events{/privacy}",
"followers_url": "https://api.github.com/users/kennethreitz/followers",
"following_url": "https://api.github.com/users/kennethreitz/following{/other_user}",
"gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/kennethreitz",
"id": 119893,
"login": "kennethreitz",
"node_id": "MDQ6VXNlcjExOTg5Mw==",
"organizations_url": "https://api.github.com/users/kennethreitz/orgs",
"received_events_url": "https://api.github.com/users/kennethreitz/received_events",
"repos_url": "https://api.github.com/users/kennethreitz/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/kennethreitz/starred{/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/1310/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1310/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/1310.diff",
"html_url": "https://github.com/psf/requests/pull/1310",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/1310.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/1310"
}
| true |
[
"I'm pretty sure this will break currently existing code, by requiring that cacert.pem be in the working directory. A more complete solution is needed.\n",
"just a temporarily solution\n\n2013/4/13 Cory Benfield [email protected]\n\n> I'm pretty sure this will break currently existing code, by requiring that\n> cacert.pem be in the working directory. A more complete solution is needed.\n> \n> —\n> Reply to this email directly or view it on GitHubhttps://github.com/kennethreitz/requests/pull/1310#issuecomment-16328720\n> .\n",
"No this will almost certainly break requests. `os.path.join` will use the current path of execution of the python binary to form the path so if you `pip install requests`, and then from some project directory try to use it, it will search in that directory for `cacert.pem` not in the directory requests was installed into.\n",
"Whoops, closed this by accident.\n",
"I would set the CURL_CA_BUNDLE environment variable when building an exe, myself. I think it should work with relative paths.\n",
"how to do in windows?\n\n2013/4/14 Kenneth Reitz [email protected]\n\n> I would set the CURL_CA_BUNDLE environment variable when building an exe,\n> myself. I think it should work with relative paths.\n> \n> —\n> Reply to this email directly or view it on GitHubhttps://github.com/kennethreitz/requests/pull/1310#issuecomment-16338812\n> .\n"
] |
https://api.github.com/repos/psf/requests/issues/1309
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1309/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1309/comments
|
https://api.github.com/repos/psf/requests/issues/1309/events
|
https://github.com/psf/requests/pull/1309
| 13,144,204 |
MDExOlB1bGxSZXF1ZXN0NTE0MzQ2NA==
| 1,309 |
Changed HTTPAdapter to allow max retries to be specified when initializing.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/2449?v=4",
"events_url": "https://api.github.com/users/toastdriven/events{/privacy}",
"followers_url": "https://api.github.com/users/toastdriven/followers",
"following_url": "https://api.github.com/users/toastdriven/following{/other_user}",
"gists_url": "https://api.github.com/users/toastdriven/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/toastdriven",
"id": 2449,
"login": "toastdriven",
"node_id": "MDQ6VXNlcjI0NDk=",
"organizations_url": "https://api.github.com/users/toastdriven/orgs",
"received_events_url": "https://api.github.com/users/toastdriven/received_events",
"repos_url": "https://api.github.com/users/toastdriven/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/toastdriven/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/toastdriven/subscriptions",
"type": "User",
"url": "https://api.github.com/users/toastdriven",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 6 |
2013-04-12T23:44:40Z
|
2021-09-08T23:07:33Z
|
2013-04-13T19:05:13Z
|
CONTRIBUTOR
|
resolved
|
Currently, to bump the number of `max_retries`, you need to reach into the `HTTPAdapter` instance & manipulate `HTTPAdapter.max_retries`. The other pool options are passed, with sane defaults, to the constructor so it makes sense this should be configurable in the same breath.
Passes all tests & updated documentation. Should be 100% backward-compatible, since it's a new parameter that's not being passed anywhere else & is being default to the same constant as before.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4",
"events_url": "https://api.github.com/users/kennethreitz/events{/privacy}",
"followers_url": "https://api.github.com/users/kennethreitz/followers",
"following_url": "https://api.github.com/users/kennethreitz/following{/other_user}",
"gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/kennethreitz",
"id": 119893,
"login": "kennethreitz",
"node_id": "MDQ6VXNlcjExOTg5Mw==",
"organizations_url": "https://api.github.com/users/kennethreitz/orgs",
"received_events_url": "https://api.github.com/users/kennethreitz/received_events",
"repos_url": "https://api.github.com/users/kennethreitz/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/kennethreitz/starred{/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/1309/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1309/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/1309.diff",
"html_url": "https://github.com/psf/requests/pull/1309",
"merged_at": "2013-04-13T19:05:13Z",
"patch_url": "https://github.com/psf/requests/pull/1309.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/1309"
}
| true |
[
"I'm +0 on this. It adds no extra complexity.\n",
"I'm also +0 on this.\n",
"Well I'm :+1: to this.\n",
"There's no toast emoji!\n",
"This will have to do...\n\n:bread: :fire:\n",
"It's roughly the same. :sake: \n"
] |
https://api.github.com/repos/psf/requests/issues/1308
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1308/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1308/comments
|
https://api.github.com/repos/psf/requests/issues/1308/events
|
https://github.com/psf/requests/issues/1308
| 13,117,529 |
MDU6SXNzdWUxMzExNzUyOQ==
| 1,308 |
Provide ciphers list for HTTPS requests
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/4136736?v=4",
"events_url": "https://api.github.com/users/damiengermonville/events{/privacy}",
"followers_url": "https://api.github.com/users/damiengermonville/followers",
"following_url": "https://api.github.com/users/damiengermonville/following{/other_user}",
"gists_url": "https://api.github.com/users/damiengermonville/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/damiengermonville",
"id": 4136736,
"login": "damiengermonville",
"node_id": "MDQ6VXNlcjQxMzY3MzY=",
"organizations_url": "https://api.github.com/users/damiengermonville/orgs",
"received_events_url": "https://api.github.com/users/damiengermonville/received_events",
"repos_url": "https://api.github.com/users/damiengermonville/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/damiengermonville/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/damiengermonville/subscriptions",
"type": "User",
"url": "https://api.github.com/users/damiengermonville",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 19 |
2013-04-12T12:49:35Z
|
2021-09-08T04:00:51Z
|
2013-04-25T18:33:53Z
|
NONE
|
resolved
|
Hi,
Since Python 2.7, the ssl module implements a way to provide a list of available ciphers to the SSL object [1]. It would be nice if this feature could be reflected in Requests (and in Urllib3 as well).
I know it's not a key feature but some web servers have a Long Handshake intolerance [2] and that makes tools (and Python scripts) based on OpenSSL 1.0.1+ fail at handshake. A workaround is to provide a short list of ciphers instead of all the available ones.
I've looked into trough the Requests documentation and googled. I didn't find a way to do it. Maybe there is, if so i would appreciate a bit of help :)
Thanks !
[1] http://docs.python.org/2/library/ssl.html?highlight=ssl#ssl.wrap_socket
[2] https://github.com/ssllabs/research/wiki/Long-Handshake-Intolerance
|
{
"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/1308/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1308/timeline
| null |
completed
| null | null | false |
[
"Let us pick and choose what version of SSL we use.\n\ncurl https://www.bbva.pt/\nunless\ncurl --sslv3 https://www.bbva.pt/\n",
"The accepted way of doing this in Requests is to use the Transport Adapter functionality. You can see an example of doing exactly this [here](https://lukasa.co.uk/2013/01/Choosing_SSL_Version_In_Requests/).\n",
"@lukasa thanks, this solves my problem.\n",
"@Lukasa Thanks for the quick answer. I've looked at your post and I think it's a good start to solve my problem maybe (which is setting the ciphers, not the SSL version :p)\n\nThe VerifiedHTTPSConnection wraps the socket and that's where I need to provide ciphers (this is the only way apparently). I'm not sure i'll be able to create a pool and then use it in a adapter, all without having to copy/paste existing code (I'm looking for a clean way of doing it)\n\nMany thanks again\n",
"@damiengermonville you might then need to petition over at shazow/urllib3 for an easier way to pass in the ciphers to the VerifiedHTTPSConnection object. We have no clue what your code looks like, but I imagine this might make it easier. It's also something I don't believe @shazow would be that adverse to, but I'm pretty sick at the moment so it's probable that I'm wrong. :)\n",
"You should already be able to select what version of SSL/TLS you want to force, iirc. Either way, I'm open to adjustments to the VerifiedHTTPSConnection object as long as they're sensible and don't significantly increase code complexity. :)\n",
"@shazow I'm afraid that adjustments have to be made in VerifiedHTTPSConnection but also in urllib3/util.py ssl_wrap_socket() so it can give the ciphers argument to ssl.wrap_socket().\n",
"@damiengermonville Sounds fine. :) \n",
"Hi, \n\nI had exactly the same needs, and I needed some time to find how to add the specific ciphers. So if I may, I will just add what I did so people can find it (please correct me if I am completely wrong):\n\n from requests.packages.urllib3.contrib import pyopenssl\n pyopenssl.DEFAULT_SSL_CIPHER_LIST = 'your list her' \n\nThis will also be handy for people bumping into issues with the OpenSSL version of Ubuntu 14.04 and Requests 2.7 and python 2.7.6\n(see: <a href=\"http://askubuntu.com/questions/649000/openssl-curl-error-ssl23-get-server-hellotlsv1-alert-internal-error\"> here </a> and <a href=\"https://bugs.launchpad.net/ubuntu/+source/openssl/+bug/861137\"> here </a>)\n",
"Hi,\r\n\r\nThe following worked for me!\r\n\r\n```\r\nimport requests\r\n\r\nrequests.packages.urllib3.util.ssl_.DEFAULT_CIPHERS += ':RC4-SHA'\r\ntry:\r\n requests.packages.urllib3.contrib.pyopenssl.DEFAULT_SSL_CIPHER_LIST += ':RC4-SHA'\r\nexcept AttributeError:\r\n # no pyopenssl support used / needed / available\r\n pass\r\n```\r\n\r\nTaken from: http://stackoverflow.com/questions/32650984/why-does-python-requests-ignore-the-verify-parameter/32651967#32651967\r\n",
"*Please* do not do it this way. Instead, follow the approach in [this blog post](https://lukasa.co.uk/2017/02/Configuring_TLS_With_Requests/) and change the ciphers only for specific sites. RC4 is *extremely* dangerous and broken, and enabling it in the way shown in @athoik's comment will enable it for all sites, opening you up to trivial attacks. If you must allow RC4 or other removed ciphers, do so on a site-by-site basis.",
"@Lukasa, I had to enable only the AES256-SHA in my case. \r\n\r\n```\r\nrequests.packages.urllib3.util.ssl_.DEFAULT_CIPHERS = 'AES256-SHA'\r\n```\r\n\r\nI just copy / pasted the original solution. ",
"Ah, I see. In general this is still using a sledgehammer to crack a nut, and a per-host approach as discussed above is the better way to go.",
"I am wondering why does requests provide a list of DEFAULT_CYPHERS in ssl_ when ssl already provides one. \r\nIt took me a long time to discover that it was the reason for the issue I was having. I find SSL is hard to debug enough to have different layer adding their own filters, it is only a the end of my journey now that I know the problem that I find this useful discussion and blog post. \r\nThe solution you are proposing is nice but it requires that we change the code and to use a session, this means possibly a lot of refactoring.\r\nAlso because the server is controlling the encoding there is nothing we can do in the client code, so restricting the list just makes the connection fail.\r\nShouldn't we let people restrict the list easily with publicly documented methods rather than making hard for everyone to use the default values?",
"> I am wondering why does requests provide a list of DEFAULT_CYPHERS in ssl_ when ssl already provides one.\r\n\r\nA number of reasons. For example:\r\n\r\n1. On older Python versions the ssl module does not provide a list of default ciphers.\r\n2. The Python ssl module list is not updated after the release of the module: we can update ours much faster than others. For example, we removed 3DES from our list and got out a release within a month, whereas it took many months for Python to do so, and most Python users still have not seen this update.\r\n\r\n> The solution you are proposing is nice but it requires that we change the code and to use a session, this means possibly a lot of refactoring.\r\n\r\nYes. However, Sessions are a good thing that should be used in all but the simplest of codebases, so it's a major help. And if your code is simple, you can just create a global session and change all your calls to `requests.x` to `session.x`. The refactoring is intentionally very simple.\r\n\r\n> Also because the server is controlling the encoding there is nothing we can do in the client code, so restricting the list just makes the connection fail.\r\n\r\nThis represents a severe misunderstanding of how TLS works. The client and server *together* decide which cipher suite is used, based on the server selecting its preference from the list the client supports. The client is responsible for defending itself against the server making *bad* choices. Clients need to have an opinion about what ciphers are acceptable for use.\r\n\r\nIf your assertion is that the client should allow whatever cipher suite the server chooses, then you are essentially saying that TLS does not serve a security purpose for you at all: it is merely an operational inconvenience. In that case I recommend you don't use HTTPS: you're just adding complexity to your work for no reason.\r\n\r\nOtherwise, the client is responsible for preventing old and badly configured servers from leaking client data.\r\n\r\n> Shouldn't we let people restrict the list easily with publicly documented methods rather than making hard for everyone to use the default values?\r\n\r\nNo.\r\n\r\nRequests has a strong cultural bias towards \"secure by default\". Essentially, if you use Requests in the default configuration then we guarantee that you are using a configuration that is secure based on our understanding of the network threat ecosystem at the time we released. \r\n\r\nUsers should not opt-in to secure configurations because that creates an ecosystem in which only those who have the knowledge to understand the risks are secure. Requests aims to ensure *all* our users are secure, not just those who are keeping up to date with the crypto literature.\r\n\r\nSo our policy is that we will be secure, and give you opt-outs. We don't promise to make them easy: we'll let you point the gun at your foot, but we won't necessarily provide an easy switch to do it. If you have to do a little bit of work to reduce your security, then that is a reasonable trade-off for ensuring that casual users don't accidentally do it.",
"Thank you, you are making very good points. I wish the customization would be documented in requests doc along with some troubleshooting tips, the interface is awesome but this was not a good experience...",
"Yeah, this is an understandable concern. Generally we don't want to make things like this *super* easy to find just to discourage their use a bit more, which is why we've traditionally resorted to \"documenting\" this kind of thing in blog posts rather than inline.",
"Hi, \r\nI've been going through this and several other similar threads for several hours now, and none of the solutions suggested to me seem to work. I think my issue is the older protocol / cipher, but not sure as nothing here has worked.\r\n\r\nError is on this line -> bad handshake / unexpected EOF\r\n`s.get('https://www.elections.ny.gov/regbycounty.html') `\r\n\r\nI'm using Python 2.7.11\r\nHere's the output of pip freeze:\r\n\r\n\r\ncurl makes connection fine with TLSv1.0 and Cipher: RSA_WITH_3DES_EDE_CBC_SHA1\r\n\r\n\r\nI've tried both the not recommended way (adding my cipher string to the DEFAULT_CIPHERS) and the preferred way from [https://lukasa.co.uk/2017/02/Configuring_TLS_With_Requests/](url) with no luck. I think DES-CBC3-SHA is the string I need to be adding, not sure if I'm just doing it wrong (I've tried concatenating to the end of CIPHERS making it the only string in CIPHERS etc.) or if there's something else going on here. \r\n\r\n```\r\nimport requests\r\nfrom requests.adapters import HTTPAdapter\r\nfrom requests.packages.urllib3.util.ssl_ import create_urllib3_context\r\n\r\n# This is the 2.11 Requests cipher string, containing 3DES.\r\nCIPHERS = (\r\n 'ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:ECDH+HIGH:'\r\n 'DH+HIGH:ECDH+3DES:DH+3DES:RSA+AESGCM:RSA+AES:RSA+HIGH:RSA+3DES:!aNULL:'\r\n '!eNULL:!MD5'\r\n)\r\n#CIPHERS += (':DES-CBC3-SHA')\r\n\r\nclass DESAdapter(HTTPAdapter):\r\n \"\"\"\r\n A TransportAdapter that re-enables 3DES support in Requests.\r\n \"\"\"\r\n def init_poolmanager(self, *args, **kwargs):\r\n context = create_urllib3_context(ciphers=CIPHERS)\r\n kwargs['ssl_context'] = context\r\n return super(DESAdapter, self).init_poolmanager(*args, **kwargs)\r\n\r\n def proxy_manager_for(self, *args, **kwargs):\r\n context = create_urllib3_context(ciphers=CIPHERS)\r\n kwargs['ssl_context'] = context\r\n return super(DESAdapter, self).proxy_manager_for(*args, **kwargs)\r\n\r\nprint CIPHERS\r\ns = requests.Session()\r\ns.mount('https://www.elections.ny.gov/regbycounty.html', DESAdapter())\r\nr = s.get('https://www.elections.ny.gov/regbycounty.html')\r\n```\r\nAnd the output (bad handshake)\r\n\r\n\r\nThanks in advance!\r\n\r\n\r\n",
"Hi @IanNMarshall \r\n\r\nI've been bitten in the ass by this \"bug\" as well. It's not a requests issue, nor do the requests authors really care whether or not their documentation RE old ciphers is actually useful, given that it's unreasonable to detect if and when the provided OpenSSL support libraries have the ciphers you ask for.\r\n\r\nAfter a lot of work, I've determined that if you have pyOpenSSL installed, you will get the above error. At least, that's what I thought the issue was, given that removal of pyOpenSSL magically allowed your test program to pass (after enabling the DES-CBC3-SHA cipher)\r\n\r\nLooking closer, I determined that the binary assets being distributed for `cryptography` for OpenSSL fundamentally lacks RC4, 3DES, et al ciphers, which makes pyOpenSSL fail for forcing to \"just\" that cipher. It appears that requests will use pyOpenSSL and failsafe to built-in ssl if it goes missing.\r\n\r\nIf you can prove that the following works with your desired cipher:\r\n\r\n```\r\n(cpython27) btj-gt$ openssl ciphers -V '3DES'\r\n 0xC0,0x12 - ECDHE-RSA-DES-CBC3-SHA SSLv3 Kx=ECDH Au=RSA Enc=3DES(168) Mac=SHA1\r\n 0xC0,0x08 - ECDHE-ECDSA-DES-CBC3-SHA SSLv3 Kx=ECDH Au=ECDSA Enc=3DES(168) Mac=SHA1\r\n 0xC0,0x1C - SRP-DSS-3DES-EDE-CBC-SHA SSLv3 Kx=SRP Au=DSS Enc=3DES(168) Mac=SHA1\r\n 0xC0,0x1B - SRP-RSA-3DES-EDE-CBC-SHA SSLv3 Kx=SRP Au=RSA Enc=3DES(168) Mac=SHA1\r\n 0xC0,0x1A - SRP-3DES-EDE-CBC-SHA SSLv3 Kx=SRP Au=SRP Enc=3DES(168) Mac=SHA1\r\n 0x00,0x16 - EDH-RSA-DES-CBC3-SHA SSLv3 Kx=DH Au=RSA Enc=3DES(168) Mac=SHA1\r\n 0x00,0x13 - EDH-DSS-DES-CBC3-SHA SSLv3 Kx=DH Au=DSS Enc=3DES(168) Mac=SHA1\r\n 0x00,0x10 - DH-RSA-DES-CBC3-SHA SSLv3 Kx=DH/RSA Au=DH Enc=3DES(168) Mac=SHA1\r\n 0x00,0x0D - DH-DSS-DES-CBC3-SHA SSLv3 Kx=DH/DSS Au=DH Enc=3DES(168) Mac=SHA1\r\n 0xC0,0x17 - AECDH-DES-CBC3-SHA SSLv3 Kx=ECDH Au=None Enc=3DES(168) Mac=SHA1\r\n 0x00,0x1B - ADH-DES-CBC3-SHA SSLv3 Kx=DH Au=None Enc=3DES(168) Mac=SHA1\r\n 0xC0,0x0D - ECDH-RSA-DES-CBC3-SHA SSLv3 Kx=ECDH/RSA Au=ECDH Enc=3DES(168) Mac=SHA1\r\n 0xC0,0x03 - ECDH-ECDSA-DES-CBC3-SHA SSLv3 Kx=ECDH/ECDSA Au=ECDH Enc=3DES(168) Mac=SHA1\r\n 0x00,0x0A - DES-CBC3-SHA SSLv3 Kx=RSA Au=RSA Enc=3DES(168) Mac=SHA1\r\n 0x00,0x8B - PSK-3DES-EDE-CBC-SHA SSLv3 Kx=PSK Au=PSK Enc=3DES(168) Mac=SHA1\r\n```\r\n\r\nThen you may be able to just `pip uninstall -y pyOpenSSL` and it may work.\r\n\r\nI was able to make everything \"work\" (even with pyOpenSSL) by making a usable `cryptography` installation via\r\n```\r\nCPPFLAGS=-I/usr/local/opt/openssl/include LDFLAGS=-L/usr/local/opt/openssl/lib pip install --no-binary cryptography cryptography\r\n```"
] |
https://api.github.com/repos/psf/requests/issues/1307
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1307/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1307/comments
|
https://api.github.com/repos/psf/requests/issues/1307/events
|
https://github.com/psf/requests/issues/1307
| 13,082,372 |
MDU6SXNzdWUxMzA4MjM3Mg==
| 1,307 |
Python 3 POST multipart/form-data with encode()
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/3194626?v=4",
"events_url": "https://api.github.com/users/yurii-polishchuk/events{/privacy}",
"followers_url": "https://api.github.com/users/yurii-polishchuk/followers",
"following_url": "https://api.github.com/users/yurii-polishchuk/following{/other_user}",
"gists_url": "https://api.github.com/users/yurii-polishchuk/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/yurii-polishchuk",
"id": 3194626,
"login": "yurii-polishchuk",
"node_id": "MDQ6VXNlcjMxOTQ2MjY=",
"organizations_url": "https://api.github.com/users/yurii-polishchuk/orgs",
"received_events_url": "https://api.github.com/users/yurii-polishchuk/received_events",
"repos_url": "https://api.github.com/users/yurii-polishchuk/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/yurii-polishchuk/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/yurii-polishchuk/subscriptions",
"type": "User",
"url": "https://api.github.com/users/yurii-polishchuk",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 9 |
2013-04-11T18:37:39Z
|
2021-09-09T04:00:38Z
|
2013-04-11T19:07:48Z
|
NONE
|
resolved
|
``` bash
server# FreeBSD 8.1-RELEASE
server# python3 -V
Python 3.3.0
server# python3 -c 'import requests; print(requests.__version__)'
1.2.0
```
I need to solve one issue by using Python3 and requests. So the main purpose:
I have Python script on my PC on the one hand and Web Forum with forms on the other hand.
Web forum accept in forms only multipart/form-data, so I POST them to it by:
``` python
s = requests.Session()
q = s.post('http://siteforum.com/index.php?', headers=headers, data=postdata, files={'':''})
```
All is ok, data are posted.
But the main problem appears when I'm using text encoding in dictionary (cp1251) with .encode()
This is my example of the code:
``` python
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import requests
def main():
s_cp1251 = 'тест'.encode('cp1251')
postdata = {
"TopicTitle" : s_cp1251,
"TopicDesc" : 'тест'.encode('cp1251'),
"Post" : 'test'
}
headers = {
'User-Agent' : 'Mozilla/5.0 (Windows NT 5.1; rv:20.0) Gecko/20100101 Firefox/20.0',
'Accept' : 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
'Accept-Language' : 'en-US,en;q=0.5',
'Accept-Encoding' : 'gzip, deflate',
'Connection' : 'keep-alive'
}
s = requests.Session()
q = s.post('http://siteforum.com/index.php?', headers=headers, data=postdata, files={'':''})
print(q.status_code)
if __name__ == '__main__':
main()
```
1. 'тест' is a 'test' in cyrillic windows 1251 encoding
2. POST multipart/form-data to Web Forum forms:
`
TopicTitle -> b'\xf2\xe5\xf1\xf2'
`
`
TopicDesc -> b'\xf2\xe5\xf1\xf2'
`
`
Post -> test
`
3. The interesting thing is, that in The Python2 code example works fine, TopicTitle - is 'тест' in Web Forum form,
but with Python 3 something like this: b'\xf2\xe5\xf1\xf2'
4. If i send POST form-urlencoded , everything is ok too.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4",
"events_url": "https://api.github.com/users/Lukasa/events{/privacy}",
"followers_url": "https://api.github.com/users/Lukasa/followers",
"following_url": "https://api.github.com/users/Lukasa/following{/other_user}",
"gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Lukasa",
"id": 1382556,
"login": "Lukasa",
"node_id": "MDQ6VXNlcjEzODI1NTY=",
"organizations_url": "https://api.github.com/users/Lukasa/orgs",
"received_events_url": "https://api.github.com/users/Lukasa/received_events",
"repos_url": "https://api.github.com/users/Lukasa/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Lukasa",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/1307/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1307/timeline
| null |
completed
| null | null | false |
[
"Welcome to the exciting world of Python string handling!\n\nThe reason this is happening is that, somewhere in the web stack, someone is calling `str()` on your string. In Python3, calling `str()` on a bytestring returns the exact same thing as calling `repr()`. In this case, that's the byte literal form.\n\nUnfortunately, the current rule is that urllib3 _must_ take native strings. This means you cannot encode your post data: they need to stay as unicode, to be encoded later.\n\nWill your webserver accept UTF-8 encoded data?\n",
"Thank's for the quick answer ;)\nNo, native encoding on this web site is `Windows-1251`, I know it is not right, but I have no access to web server, so i can't change encoding or encode/decode my data in their forms.\n",
"In that case, can you leave the `files` argument out?\n",
"Not in all cases, but yes. If i leave `files` argument out, the data in `POST` send is `form-urlencoded`, and everything is fine. Maybe i'll try to use it or use `Python2`. Anyway thanks for the explanation of the situation in `Python 3`.\n",
"Ok, and I'm sorry there's not much we can do about this at the moment. I'd offer to investigate adding functionality for using specific encodings, but we're in feature freeze at the moment.\n",
"@omatic-hacker is it possible to do `'тест'.encode('cp-1252').decode('utf-8')` or perhaps to `utf-16` or `utf-32` in the event that 8 isn't big enough? That would then be a string and might post correctly.\n",
"@sigmavirus24 That's not how character encodings work. Encoding as CP-1252 gives a series of bytes: decoding those bytes as UTF-8 will give you another 'unicode' string, but its characters will be meaningless. If you encode to CP-1252, you can only ever meaningfully decode as CP-1252.\n",
"Ugh, I need to get over whatever this cold is. Sorry.\n",
"No worries, I've felt the same before. =)\n"
] |
https://api.github.com/repos/psf/requests/issues/1306
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1306/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1306/comments
|
https://api.github.com/repos/psf/requests/issues/1306/events
|
https://github.com/psf/requests/pull/1306
| 13,068,895 |
MDExOlB1bGxSZXF1ZXN0NTEwNzU2Nw==
| 1,306 |
Updated NOTICE copyright from 2022 to 2012
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/675997?v=4",
"events_url": "https://api.github.com/users/pombredanne/events{/privacy}",
"followers_url": "https://api.github.com/users/pombredanne/followers",
"following_url": "https://api.github.com/users/pombredanne/following{/other_user}",
"gists_url": "https://api.github.com/users/pombredanne/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/pombredanne",
"id": 675997,
"login": "pombredanne",
"node_id": "MDQ6VXNlcjY3NTk5Nw==",
"organizations_url": "https://api.github.com/users/pombredanne/orgs",
"received_events_url": "https://api.github.com/users/pombredanne/received_events",
"repos_url": "https://api.github.com/users/pombredanne/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/pombredanne/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/pombredanne/subscriptions",
"type": "User",
"url": "https://api.github.com/users/pombredanne",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 1 |
2013-04-11T14:09:03Z
|
2021-09-08T20:01:12Z
|
2013-04-11T16:04:07Z
|
CONTRIBUTOR
|
resolved
|
Which is likely what you meant, eh?
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4",
"events_url": "https://api.github.com/users/kennethreitz/events{/privacy}",
"followers_url": "https://api.github.com/users/kennethreitz/followers",
"following_url": "https://api.github.com/users/kennethreitz/following{/other_user}",
"gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/kennethreitz",
"id": 119893,
"login": "kennethreitz",
"node_id": "MDQ6VXNlcjExOTg5Mw==",
"organizations_url": "https://api.github.com/users/kennethreitz/orgs",
"received_events_url": "https://api.github.com/users/kennethreitz/received_events",
"repos_url": "https://api.github.com/users/kennethreitz/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/kennethreitz/starred{/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/1306/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1306/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/1306.diff",
"html_url": "https://github.com/psf/requests/pull/1306",
"merged_at": "2013-04-11T16:04:07Z",
"patch_url": "https://github.com/psf/requests/pull/1306.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/1306"
}
| true |
[
"haha, nice catch :)\n"
] |
https://api.github.com/repos/psf/requests/issues/1305
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1305/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1305/comments
|
https://api.github.com/repos/psf/requests/issues/1305/events
|
https://github.com/psf/requests/pull/1305
| 13,051,459 |
MDExOlB1bGxSZXF1ZXN0NTA5OTA4MQ==
| 1,305 |
Fix Advanced docs Twitter Streaming example
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/352270?v=4",
"events_url": "https://api.github.com/users/michaelhelmick/events{/privacy}",
"followers_url": "https://api.github.com/users/michaelhelmick/followers",
"following_url": "https://api.github.com/users/michaelhelmick/following{/other_user}",
"gists_url": "https://api.github.com/users/michaelhelmick/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/michaelhelmick",
"id": 352270,
"login": "michaelhelmick",
"node_id": "MDQ6VXNlcjM1MjI3MA==",
"organizations_url": "https://api.github.com/users/michaelhelmick/orgs",
"received_events_url": "https://api.github.com/users/michaelhelmick/received_events",
"repos_url": "https://api.github.com/users/michaelhelmick/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/michaelhelmick/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/michaelhelmick/subscriptions",
"type": "User",
"url": "https://api.github.com/users/michaelhelmick",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 9 |
2013-04-11T03:51:56Z
|
2021-09-08T20:01:11Z
|
2013-04-13T19:24:21Z
|
NONE
|
resolved
|
I don't know how you feel about adding the dependency of `requests_oauthlib` in the documentation, but Twitter API v1.1 Streaming now requires OAuth Authentication rather than XAuth. I believe v1 is being blacked out sometime at the beginning of May.
(And yeah, I edited this fron the GitHub website... **judge** me :smile:)
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4",
"events_url": "https://api.github.com/users/kennethreitz/events{/privacy}",
"followers_url": "https://api.github.com/users/kennethreitz/followers",
"following_url": "https://api.github.com/users/kennethreitz/following{/other_user}",
"gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/kennethreitz",
"id": 119893,
"login": "kennethreitz",
"node_id": "MDQ6VXNlcjExOTg5Mw==",
"organizations_url": "https://api.github.com/users/kennethreitz/orgs",
"received_events_url": "https://api.github.com/users/kennethreitz/received_events",
"repos_url": "https://api.github.com/users/kennethreitz/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions",
"type": "User",
"url": "https://api.github.com/users/kennethreitz",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/1305/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1305/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/1305.diff",
"html_url": "https://github.com/psf/requests/pull/1305",
"merged_at": "2013-04-13T19:24:21Z",
"patch_url": "https://github.com/psf/requests/pull/1305.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/1305"
}
| true |
[
"I think if we're doing this the preamble needs to be updated to explain how to get `requests-oauthlib`.\n",
"+1 to this and @Lukasa 's suggestion\n",
"@Lukasa Good idea. I'm not too good at copy, I'd probably just confuse the hell out of somebody; so if anybody has suggestions as to what to update the preamble to, I'm open to suggestions :D\n",
"+1, i'll merge then\n",
"@kennethreitz Do _yoooou_ have suggestions on how to introduce `requests_oauthlib` into the docs :smirk: \n",
"A new section here :) http://docs.python-requests.org/en/latest/user/authentication/#other-authentication\n",
"Alright! I'll _try_ and think of some copy that sounds like it was written while I was sipping wine and eating cheese squares that I've never heard of before ;D\n",
"@kennethreitz I've made changes to the Other Authentication section, let me know what you think!\n",
"Thanks so much! Merging :)\n"
] |
https://api.github.com/repos/psf/requests/issues/1304
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1304/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1304/comments
|
https://api.github.com/repos/psf/requests/issues/1304/events
|
https://github.com/psf/requests/issues/1304
| 13,040,099 |
MDU6SXNzdWUxMzA0MDA5OQ==
| 1,304 |
Make it possible to attach additional data to request
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/92239?v=4",
"events_url": "https://api.github.com/users/piotr-dobrogost/events{/privacy}",
"followers_url": "https://api.github.com/users/piotr-dobrogost/followers",
"following_url": "https://api.github.com/users/piotr-dobrogost/following{/other_user}",
"gists_url": "https://api.github.com/users/piotr-dobrogost/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/piotr-dobrogost",
"id": 92239,
"login": "piotr-dobrogost",
"node_id": "MDQ6VXNlcjkyMjM5",
"organizations_url": "https://api.github.com/users/piotr-dobrogost/orgs",
"received_events_url": "https://api.github.com/users/piotr-dobrogost/received_events",
"repos_url": "https://api.github.com/users/piotr-dobrogost/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/piotr-dobrogost/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/piotr-dobrogost/subscriptions",
"type": "User",
"url": "https://api.github.com/users/piotr-dobrogost",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 2 |
2013-04-10T20:46:01Z
|
2021-09-09T04:00:38Z
|
2013-04-11T16:04:35Z
|
NONE
|
resolved
|
It would be useful to be able to attach additional data to request by passing these data to `send()` and other api functions like `get()` etc. We can think of these data as a context in which given request was sent so `context` seems like appropriate name for such a parameter. This is especially useful in async scenario but not only. See kennethreitz/grequests/issues/33 The idea is to have request store only these data for later retrieval by user - it wouldn't be used by Requests anywhere in the process of sending 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/1304/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1304/timeline
| null |
completed
| null | null | false |
[
"This isn't necessary, especially given the fact that there's a perfectly good hook in that issue. The parameters to any of the methods (or to `request`) itself should deal solely with the request data sent or the conditions under which it must be sent (`verify`, `allow_redirects`, etc.). With that being the API, consistency is key and adding this would be wholly inconsistent.\n\nThe hook might be better written as\n\n``` python\ndef set_context(context):\n def hook(resp, **data):\n resp.request.context = context\n return resp\n return hook\n```\n",
"I agree.\n"
] |
https://api.github.com/repos/psf/requests/issues/1303
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1303/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1303/comments
|
https://api.github.com/repos/psf/requests/issues/1303/events
|
https://github.com/psf/requests/issues/1303
| 13,025,980 |
MDU6SXNzdWUxMzAyNTk4MA==
| 1,303 |
requests follows a PUT request's 301 and does a PUT request at the end
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/784229?v=4",
"events_url": "https://api.github.com/users/gcbirzan/events{/privacy}",
"followers_url": "https://api.github.com/users/gcbirzan/followers",
"following_url": "https://api.github.com/users/gcbirzan/following{/other_user}",
"gists_url": "https://api.github.com/users/gcbirzan/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/gcbirzan",
"id": 784229,
"login": "gcbirzan",
"node_id": "MDQ6VXNlcjc4NDIyOQ==",
"organizations_url": "https://api.github.com/users/gcbirzan/orgs",
"received_events_url": "https://api.github.com/users/gcbirzan/received_events",
"repos_url": "https://api.github.com/users/gcbirzan/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/gcbirzan/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/gcbirzan/subscriptions",
"type": "User",
"url": "https://api.github.com/users/gcbirzan",
"user_view_type": "public"
}
|
[] |
closed
| true |
{
"avatar_url": "https://avatars.githubusercontent.com/u/240830?v=4",
"events_url": "https://api.github.com/users/sigmavirus24/events{/privacy}",
"followers_url": "https://api.github.com/users/sigmavirus24/followers",
"following_url": "https://api.github.com/users/sigmavirus24/following{/other_user}",
"gists_url": "https://api.github.com/users/sigmavirus24/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/sigmavirus24",
"id": 240830,
"login": "sigmavirus24",
"node_id": "MDQ6VXNlcjI0MDgzMA==",
"organizations_url": "https://api.github.com/users/sigmavirus24/orgs",
"received_events_url": "https://api.github.com/users/sigmavirus24/received_events",
"repos_url": "https://api.github.com/users/sigmavirus24/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/sigmavirus24/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/sigmavirus24/subscriptions",
"type": "User",
"url": "https://api.github.com/users/sigmavirus24",
"user_view_type": "public"
}
|
[
{
"avatar_url": "https://avatars.githubusercontent.com/u/240830?v=4",
"events_url": "https://api.github.com/users/sigmavirus24/events{/privacy}",
"followers_url": "https://api.github.com/users/sigmavirus24/followers",
"following_url": "https://api.github.com/users/sigmavirus24/following{/other_user}",
"gists_url": "https://api.github.com/users/sigmavirus24/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/sigmavirus24",
"id": 240830,
"login": "sigmavirus24",
"node_id": "MDQ6VXNlcjI0MDgzMA==",
"organizations_url": "https://api.github.com/users/sigmavirus24/orgs",
"received_events_url": "https://api.github.com/users/sigmavirus24/received_events",
"repos_url": "https://api.github.com/users/sigmavirus24/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/sigmavirus24/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/sigmavirus24/subscriptions",
"type": "User",
"url": "https://api.github.com/users/sigmavirus24",
"user_view_type": "public"
}
] | null | 21 |
2013-04-10T15:55:29Z
|
2021-09-09T00:10:07Z
|
2013-04-13T19:02:30Z
|
NONE
|
resolved
|
Not only is that wrong (should behave like POST), but the end request is broken in that it has no content-length and no body.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/240830?v=4",
"events_url": "https://api.github.com/users/sigmavirus24/events{/privacy}",
"followers_url": "https://api.github.com/users/sigmavirus24/followers",
"following_url": "https://api.github.com/users/sigmavirus24/following{/other_user}",
"gists_url": "https://api.github.com/users/sigmavirus24/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/sigmavirus24",
"id": 240830,
"login": "sigmavirus24",
"node_id": "MDQ6VXNlcjI0MDgzMA==",
"organizations_url": "https://api.github.com/users/sigmavirus24/orgs",
"received_events_url": "https://api.github.com/users/sigmavirus24/received_events",
"repos_url": "https://api.github.com/users/sigmavirus24/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/sigmavirus24/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/sigmavirus24/subscriptions",
"type": "User",
"url": "https://api.github.com/users/sigmavirus24",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/1303/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1303/timeline
| null |
completed
| null | null | false |
[
"This should only be the case of `allow_redirects` is explicitly set to `True`.\n",
"Not only is that false:\n\n```\nIn [4]: requests.put('http://127.0.0.1:5000/', data='a')\nOut[4]: <Response [200]>\n\nIn [5]: requests.put('http://127.0.0.1:5000/', data='a', allow_redirects=False)\nOut[5]: <Response [301]>\n```\n\nBut, as I said, the behaviour is not only inconsistent with both the POST behaviour and the RFC, but also completely useless, as the data is lost and the request is not valid.\n",
"Please be cordial or be on your way.\n\nI said that it should only the be case. If it isn't, it's a bug :)\n",
"Uh...that output is totally unclear. Is the method not returning anything at all?\n",
"Also, the logic for redirects is method-independent. Given that it works for GET requests, I also assume that it works for PUT, POST, HEAD, OPTIONS etc.\n",
"Yeah. Github ate my code (it interpreted the repr of the request as tags. bleh). Basically, I have a simple flask app that sends 301 from / to /new/. \n\nWhen I PUT something to /, without specifying `allow_redirects` (so, not explicitly set to True), the redirect is followed to /new/, and the following request is being generated for the new URL:\n\n```\nIn [14]: r=requests.put('http://127.0.0.1:5000/', data='a')\nIn [16]: r.request.path_url, r.request.method, r.request.headers, r.request.body\nOut[16]: \n('/new/',\n 'PUT',\n {'Accept': '*/*',\n 'Accept-Encoding': 'gzip, deflate, compress',\n 'User-Agent': 'python-requests/1.2.0 CPython/2.7.3 Linux/3.2.0-4-amd64'},\n None)\n```\n\nWith `allow_redirects` set to `False`, yes, I just get a 301.\n\nSorry if I sounded abrasive or rude, wasn't my intention.\n\nAnd, Lukasa, the logic is not method independent. There's a special case for POST, which should actually be extended to all methods except GET or HEAD.\n",
"@Lukasa False https://github.com/kennethreitz/requests/blob/master/requests/sessions.py#L121\n",
"The POST special-case is actually a deviation from the RFC, implemented to match what web browsers do. Web browsers don't generally send PUT requests, so we don't special case that.\n\nAs for explicitly set to True, that was likely a brief oversight: the default value of allow_redirects is true.\n",
"In that case, the behaviour should be:\n\n10.3.2 301 Moved Permanently\n\nIf the 301 status code is received in response to a request other than GET or HEAD, the user agent MUST NOT automatically redirect the request unless it can be confirmed by the user, since this might change the conditions under which the request was issued.\n",
"Indeed, that is exactly why `allow_redirects` is named what it is, to allow the user to confirm that they want to follow redirects.\n\nIt absolutely shouldn't be True for PUT.\n",
"Okay, yes, that would solve part of the problem. The other one is what exactly happens _after_ the redirect. Since the RFC does not mention, I think the request should be changed to GET.\n",
"I'll handle this. I was likely the last person to touch any of this code.\n",
"I think this will be as simple as making allow_redirects default to false for the request method. I'm not sure why it isn't...\n\n## \n\nKenneth Reitz\n\nOn Wednesday, April 10, 2013 at 12:57 PM, Ian Cordasco wrote:\n\n> I'll handle this. I was likely the last person to touch any of this code.\n> \n> —\n> Reply to this email directly or view it on GitHub (https://github.com/kennethreitz/requests/issues/1303#issuecomment-16198018).\n",
"That and making sure we aren't making a second PUT\n",
"I just ran into a similar issue while playing with elephant, making a `DELETE` request issues a redirect, which means that a `DELETE` request is made to the next resource, resulting in a 405 (method not allowed).\n\n```\n127.0.0.1 - - [13/Apr/2013 16:35:10] \"DELETE /68f5a299-e15a-42d5-83a3-099229f79579 HTTP/1.1\" 302 -\n127.0.0.1 - - [13/Apr/2013 16:35:10] \"DELETE / HTTP/1.1\" 405 -\n```\n\n[RFC2616's section about 302 redirects](http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3.3) suggests that \"most\" implementations treat a 302 like a 303. Maybe all redirects should be done with a `GET` request to be consistent with other user agents.\n\nWhat do you think?\n",
"This definitely confirms the original report:\n\n``` python\nfrom flask import Flask, redirect, url_for, request, jsonify\n\napp = Flask(__name__)\n\n\[email protected]('/put', methods=['PUT'])\ndef put():\n return redirect(url_for('home'))\n\n\[email protected]('/', methods=['GET', 'PUT'])\ndef home():\n return jsonify(method=request.method, form=request.form,\n data=request.data, json=request.json,\n headers=dict(request.headers))\n\n\nif __name__ == '__main__':\n app.run(debug=True)\n```\n\n``` pycon\n>>> r = requests.put('http://localhost:5000/put', data='foo')\n>>> r.json()\n{u'headers': {u'Content-Length': u'', u'Accept-Encoding': u'gzip, deflate, compress', u'Accept': u'*/*', u'User-Agent': u'python-requests/1.2.0 CPython/2.6.2 Linux/2.6.30.3', u'Host': u'localhost:5000', u'Content-Type': u''}, u'json': None, u'data': u'', u'method': u'PUT', u'form': {}}\n```\n",
"This probably should have been mentioned in the release notes... Our application was relying on the old behaviour for DELETE requests. When we tested against requests 1.2.3 it took me a while to figure out what had changed and whether it was deliberate or a bug somewhere.\n",
"Yeah, we used to be pretty bad at release noting things. We're getting better. Sorry! =(\n",
"Is there any way to retroactively add one? Do you think it's worth it?\n",
"We certainly could. I'll update it now.\n",
"@danc86 for what it's worth, @Lukasa took care of that for you. =)\n"
] |
https://api.github.com/repos/psf/requests/issues/1302
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1302/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1302/comments
|
https://api.github.com/repos/psf/requests/issues/1302/events
|
https://github.com/psf/requests/pull/1302
| 13,024,120 |
MDExOlB1bGxSZXF1ZXN0NTA4NTAyOA==
| 1,302 |
Documents the actual logging methods #1297
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/102495?v=4",
"events_url": "https://api.github.com/users/ssbarnea/events{/privacy}",
"followers_url": "https://api.github.com/users/ssbarnea/followers",
"following_url": "https://api.github.com/users/ssbarnea/following{/other_user}",
"gists_url": "https://api.github.com/users/ssbarnea/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/ssbarnea",
"id": 102495,
"login": "ssbarnea",
"node_id": "MDQ6VXNlcjEwMjQ5NQ==",
"organizations_url": "https://api.github.com/users/ssbarnea/orgs",
"received_events_url": "https://api.github.com/users/ssbarnea/received_events",
"repos_url": "https://api.github.com/users/ssbarnea/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/ssbarnea/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/ssbarnea/subscriptions",
"type": "User",
"url": "https://api.github.com/users/ssbarnea",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 2 |
2013-04-10T15:20:30Z
|
2021-09-09T00:01:25Z
|
2013-04-14T03:25:47Z
|
CONTRIBUTOR
|
resolved
|
- Documented the logging, requested in #1297
- Added build directory and *.egg to .gitignore
- Added sphinx as setup requirement in order to be able to build documentation with `pyhton setup.py build_sphinx`
modified: .gitignore
modified: docs/api.rst
modified: setup.py
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4",
"events_url": "https://api.github.com/users/kennethreitz/events{/privacy}",
"followers_url": "https://api.github.com/users/kennethreitz/followers",
"following_url": "https://api.github.com/users/kennethreitz/following{/other_user}",
"gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/kennethreitz",
"id": 119893,
"login": "kennethreitz",
"node_id": "MDQ6VXNlcjExOTg5Mw==",
"organizations_url": "https://api.github.com/users/kennethreitz/orgs",
"received_events_url": "https://api.github.com/users/kennethreitz/received_events",
"repos_url": "https://api.github.com/users/kennethreitz/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions",
"type": "User",
"url": "https://api.github.com/users/kennethreitz",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/1302/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1302/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/1302.diff",
"html_url": "https://github.com/psf/requests/pull/1302",
"merged_at": "2013-04-14T03:25:47Z",
"patch_url": "https://github.com/psf/requests/pull/1302.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/1302"
}
| true |
[
"**Once fixed**, I'm :+1: on this. I was going to work on the docs (including this), this weekend anyway, but this is one less thing I have to do. :)\n",
"Thanks!\n"
] |
https://api.github.com/repos/psf/requests/issues/1301
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1301/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1301/comments
|
https://api.github.com/repos/psf/requests/issues/1301/events
|
https://github.com/psf/requests/issues/1301
| 13,021,597 |
MDU6SXNzdWUxMzAyMTU5Nw==
| 1,301 |
Unexpected behaviour with max_redirects
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/105852?v=4",
"events_url": "https://api.github.com/users/iurisilvio/events{/privacy}",
"followers_url": "https://api.github.com/users/iurisilvio/followers",
"following_url": "https://api.github.com/users/iurisilvio/following{/other_user}",
"gists_url": "https://api.github.com/users/iurisilvio/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/iurisilvio",
"id": 105852,
"login": "iurisilvio",
"node_id": "MDQ6VXNlcjEwNTg1Mg==",
"organizations_url": "https://api.github.com/users/iurisilvio/orgs",
"received_events_url": "https://api.github.com/users/iurisilvio/received_events",
"repos_url": "https://api.github.com/users/iurisilvio/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/iurisilvio/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/iurisilvio/subscriptions",
"type": "User",
"url": "https://api.github.com/users/iurisilvio",
"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 |
{
"avatar_url": "https://avatars.githubusercontent.com/u/240830?v=4",
"events_url": "https://api.github.com/users/sigmavirus24/events{/privacy}",
"followers_url": "https://api.github.com/users/sigmavirus24/followers",
"following_url": "https://api.github.com/users/sigmavirus24/following{/other_user}",
"gists_url": "https://api.github.com/users/sigmavirus24/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/sigmavirus24",
"id": 240830,
"login": "sigmavirus24",
"node_id": "MDQ6VXNlcjI0MDgzMA==",
"organizations_url": "https://api.github.com/users/sigmavirus24/orgs",
"received_events_url": "https://api.github.com/users/sigmavirus24/received_events",
"repos_url": "https://api.github.com/users/sigmavirus24/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/sigmavirus24/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/sigmavirus24/subscriptions",
"type": "User",
"url": "https://api.github.com/users/sigmavirus24",
"user_view_type": "public"
}
|
[
{
"avatar_url": "https://avatars.githubusercontent.com/u/240830?v=4",
"events_url": "https://api.github.com/users/sigmavirus24/events{/privacy}",
"followers_url": "https://api.github.com/users/sigmavirus24/followers",
"following_url": "https://api.github.com/users/sigmavirus24/following{/other_user}",
"gists_url": "https://api.github.com/users/sigmavirus24/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/sigmavirus24",
"id": 240830,
"login": "sigmavirus24",
"node_id": "MDQ6VXNlcjI0MDgzMA==",
"organizations_url": "https://api.github.com/users/sigmavirus24/orgs",
"received_events_url": "https://api.github.com/users/sigmavirus24/received_events",
"repos_url": "https://api.github.com/users/sigmavirus24/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/sigmavirus24/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/sigmavirus24/subscriptions",
"type": "User",
"url": "https://api.github.com/users/sigmavirus24",
"user_view_type": "public"
}
] | null | 2 |
2013-04-10T14:30:56Z
|
2021-09-09T04:00:34Z
|
2013-04-25T18:34:16Z
|
CONTRIBUTOR
|
resolved
|
It is probably a documentation issue. Based on docs:
> max_redirects: Maximum number of redirects to follow.
I expected it just return a response with a 30x status when `max_redirects` is reached, but it raises a `requests.exceptions.TooManyRedirects`.
|
{
"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/1301/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1301/timeline
| null |
completed
| null | null | false |
[
"You're right, this is an issue with the docs.\n",
"Resolved by #1313.\n"
] |
https://api.github.com/repos/psf/requests/issues/1300
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1300/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1300/comments
|
https://api.github.com/repos/psf/requests/issues/1300/events
|
https://github.com/psf/requests/issues/1300
| 13,021,414 |
MDU6SXNzdWUxMzAyMTQxNA==
| 1,300 |
Set max_redirects per request
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/105852?v=4",
"events_url": "https://api.github.com/users/iurisilvio/events{/privacy}",
"followers_url": "https://api.github.com/users/iurisilvio/followers",
"following_url": "https://api.github.com/users/iurisilvio/following{/other_user}",
"gists_url": "https://api.github.com/users/iurisilvio/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/iurisilvio",
"id": 105852,
"login": "iurisilvio",
"node_id": "MDQ6VXNlcjEwNTg1Mg==",
"organizations_url": "https://api.github.com/users/iurisilvio/orgs",
"received_events_url": "https://api.github.com/users/iurisilvio/received_events",
"repos_url": "https://api.github.com/users/iurisilvio/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/iurisilvio/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/iurisilvio/subscriptions",
"type": "User",
"url": "https://api.github.com/users/iurisilvio",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 7 |
2013-04-10T14:27:41Z
|
2021-09-09T04:00:39Z
|
2013-04-10T14:32:30Z
|
CONTRIBUTOR
|
resolved
|
I expected this code works:
``` python
>>> import requests
>>> requests.__version__
'1.2.0'
>>> requests.get('http://www.google.com', max_redirects=1)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Python27\lib\site-packages\requests\api.py", line 55, in get
return request('get', url, **kwargs)
File "C:\Python27\lib\site-packages\requests\api.py", line 44, in request
return session.request(method=method, url=url, **kwargs)
TypeError: request() got an unexpected keyword argument 'max_redirects'
```
To use `max_redirects`, I have to do it:
``` python
>>> session = requests.Session()
>>> session.max_redirects = 1
>>> session.get('http://www.google.com')
<Response [200]>
```
It is not the obvious way.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/240830?v=4",
"events_url": "https://api.github.com/users/sigmavirus24/events{/privacy}",
"followers_url": "https://api.github.com/users/sigmavirus24/followers",
"following_url": "https://api.github.com/users/sigmavirus24/following{/other_user}",
"gists_url": "https://api.github.com/users/sigmavirus24/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/sigmavirus24",
"id": 240830,
"login": "sigmavirus24",
"node_id": "MDQ6VXNlcjI0MDgzMA==",
"organizations_url": "https://api.github.com/users/sigmavirus24/orgs",
"received_events_url": "https://api.github.com/users/sigmavirus24/received_events",
"repos_url": "https://api.github.com/users/sigmavirus24/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/sigmavirus24/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/sigmavirus24/subscriptions",
"type": "User",
"url": "https://api.github.com/users/sigmavirus24",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/1300/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1300/timeline
| null |
completed
| null | null | false |
[
"Closing in deference to #1301 \n",
"@sigmavirus24 this issue is different than #1301. Here, I just expected the `max_redirects` work per request, because it is the obvious way. I don't want to create a `requests.Session` to be able to set `max_redirects`.\n",
"I think it's important to note that 'obvious' varies depending on where you stand. In this case, Requests seems to be aiming for API consistency. Anything that is a form of 'configuration' belongs on the `Session`. Anything that is intimately related to the sending of data belongs on the `HTTPAdapter`. Anything that is related intimately to the body of a HTTP request belongs in the request. Maximum number of redirects is configuration, and so belongs on the session. =)\n",
"To continue what @Lukasa explained, `max_retries` was an option pre 1.x but was explicitly removed with malice of forethought during the refactor. Really, when you make a specific request there are things that pertain to that specific request, e.g., certificate verification, whether that request should follow redirects, etc. but not how many times that request should be sent. A request is a single object. A browser may retry a request a maximum number of times, but a request is not a browser, a session is the closest thing to a browser you will ever find in requests (but it is not a browser).\n\nThat said, this is a feature request and combined with the fact this feature was already removed and that we're in a feature freeze this will remain closed.\n",
"Understood. The difference between Session and Request was not clear to me. Thanks for the explanation!\n",
"You're very welcome!\n",
"And thank _you_ for raising the issue. =) More people who are prepared to raise issues is always good.\n"
] |
https://api.github.com/repos/psf/requests/issues/1299
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1299/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1299/comments
|
https://api.github.com/repos/psf/requests/issues/1299/events
|
https://github.com/psf/requests/pull/1299
| 13,005,217 |
MDExOlB1bGxSZXF1ZXN0NTA3NTI4MQ==
| 1,299 |
Use streaming decompression feature of urllib3.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/238652?v=4",
"events_url": "https://api.github.com/users/schlamar/events{/privacy}",
"followers_url": "https://api.github.com/users/schlamar/followers",
"following_url": "https://api.github.com/users/schlamar/following{/other_user}",
"gists_url": "https://api.github.com/users/schlamar/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/schlamar",
"id": 238652,
"login": "schlamar",
"node_id": "MDQ6VXNlcjIzODY1Mg==",
"organizations_url": "https://api.github.com/users/schlamar/orgs",
"received_events_url": "https://api.github.com/users/schlamar/received_events",
"repos_url": "https://api.github.com/users/schlamar/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/schlamar/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/schlamar/subscriptions",
"type": "User",
"url": "https://api.github.com/users/schlamar",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 2 |
2013-04-10T06:13:18Z
|
2021-09-08T23:01:12Z
|
2013-04-14T03:27:47Z
|
CONTRIBUTOR
|
resolved
|
This will fix #1249. Additionally, the urllib3 upgrade offers a reasonable way to deal with #465, see [this comment](https://github.com/kennethreitz/requests/issues/465#issuecomment-15106811).
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4",
"events_url": "https://api.github.com/users/kennethreitz/events{/privacy}",
"followers_url": "https://api.github.com/users/kennethreitz/followers",
"following_url": "https://api.github.com/users/kennethreitz/following{/other_user}",
"gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/kennethreitz",
"id": 119893,
"login": "kennethreitz",
"node_id": "MDQ6VXNlcjExOTg5Mw==",
"organizations_url": "https://api.github.com/users/kennethreitz/orgs",
"received_events_url": "https://api.github.com/users/kennethreitz/received_events",
"repos_url": "https://api.github.com/users/kennethreitz/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/kennethreitz/starred{/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/1299/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1299/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/1299.diff",
"html_url": "https://github.com/psf/requests/pull/1299",
"merged_at": "2013-04-14T03:27:47Z",
"patch_url": "https://github.com/psf/requests/pull/1299.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/1299"
}
| true |
[
"Nice work!\n",
":cake:\n"
] |
https://api.github.com/repos/psf/requests/issues/1298
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1298/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1298/comments
|
https://api.github.com/repos/psf/requests/issues/1298/events
|
https://github.com/psf/requests/pull/1298
| 12,989,432 |
MDExOlB1bGxSZXF1ZXN0NTA2NjkyMw==
| 1,298 |
Transport Adapter Docs
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4",
"events_url": "https://api.github.com/users/Lukasa/events{/privacy}",
"followers_url": "https://api.github.com/users/Lukasa/followers",
"following_url": "https://api.github.com/users/Lukasa/following{/other_user}",
"gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Lukasa",
"id": 1382556,
"login": "Lukasa",
"node_id": "MDQ6VXNlcjEzODI1NTY=",
"organizations_url": "https://api.github.com/users/Lukasa/orgs",
"received_events_url": "https://api.github.com/users/Lukasa/received_events",
"repos_url": "https://api.github.com/users/Lukasa/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Lukasa",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 1 |
2013-04-09T20:03:03Z
|
2021-09-08T22:01:16Z
|
2013-04-09T20:17:20Z
|
MEMBER
|
resolved
|
A documentation Pull Request, from @Lukasa? How unexpected! :grin:
There comes a point where I should stop writing blog articles about Requests-y things and start actually adding some documentation to Requests. This will add the Transport Adapter to the API documentation and a description of them to the Advanced 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"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/1298/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1298/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/1298.diff",
"html_url": "https://github.com/psf/requests/pull/1298",
"merged_at": "2013-04-09T20:17:20Z",
"patch_url": "https://github.com/psf/requests/pull/1298.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/1298"
}
| true |
[
":space_invader: :space_invader: :space_invader: :space_invader: :space_invader: :space_invader: :space_invader: :space_invader: :space_invader: :space_invader: :space_invader: :space_invader: :space_invader: :space_invader: \n\n:video_game:\n"
] |
https://api.github.com/repos/psf/requests/issues/1297
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1297/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1297/comments
|
https://api.github.com/repos/psf/requests/issues/1297/events
|
https://github.com/psf/requests/issues/1297
| 12,984,070 |
MDU6SXNzdWUxMjk4NDA3MA==
| 1,297 |
requests logging is not documented, incomplete and works unexpectedly
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/102495?v=4",
"events_url": "https://api.github.com/users/ssbarnea/events{/privacy}",
"followers_url": "https://api.github.com/users/ssbarnea/followers",
"following_url": "https://api.github.com/users/ssbarnea/following{/other_user}",
"gists_url": "https://api.github.com/users/ssbarnea/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/ssbarnea",
"id": 102495,
"login": "ssbarnea",
"node_id": "MDQ6VXNlcjEwMjQ5NQ==",
"organizations_url": "https://api.github.com/users/ssbarnea/orgs",
"received_events_url": "https://api.github.com/users/ssbarnea/received_events",
"repos_url": "https://api.github.com/users/ssbarnea/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/ssbarnea/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/ssbarnea/subscriptions",
"type": "User",
"url": "https://api.github.com/users/ssbarnea",
"user_view_type": "public"
}
|
[] |
closed
| true |
{
"avatar_url": "https://avatars.githubusercontent.com/u/240830?v=4",
"events_url": "https://api.github.com/users/sigmavirus24/events{/privacy}",
"followers_url": "https://api.github.com/users/sigmavirus24/followers",
"following_url": "https://api.github.com/users/sigmavirus24/following{/other_user}",
"gists_url": "https://api.github.com/users/sigmavirus24/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/sigmavirus24",
"id": 240830,
"login": "sigmavirus24",
"node_id": "MDQ6VXNlcjI0MDgzMA==",
"organizations_url": "https://api.github.com/users/sigmavirus24/orgs",
"received_events_url": "https://api.github.com/users/sigmavirus24/received_events",
"repos_url": "https://api.github.com/users/sigmavirus24/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/sigmavirus24/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/sigmavirus24/subscriptions",
"type": "User",
"url": "https://api.github.com/users/sigmavirus24",
"user_view_type": "public"
}
|
[
{
"avatar_url": "https://avatars.githubusercontent.com/u/240830?v=4",
"events_url": "https://api.github.com/users/sigmavirus24/events{/privacy}",
"followers_url": "https://api.github.com/users/sigmavirus24/followers",
"following_url": "https://api.github.com/users/sigmavirus24/following{/other_user}",
"gists_url": "https://api.github.com/users/sigmavirus24/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/sigmavirus24",
"id": 240830,
"login": "sigmavirus24",
"node_id": "MDQ6VXNlcjI0MDgzMA==",
"organizations_url": "https://api.github.com/users/sigmavirus24/orgs",
"received_events_url": "https://api.github.com/users/sigmavirus24/received_events",
"repos_url": "https://api.github.com/users/sigmavirus24/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/sigmavirus24/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/sigmavirus24/subscriptions",
"type": "User",
"url": "https://api.github.com/users/sigmavirus24",
"user_view_type": "public"
}
] | null | 10 |
2013-04-09T18:06:04Z
|
2021-09-01T00:11:38Z
|
2013-04-14T16:54:48Z
|
CONTRIBUTOR
|
resolved
|
Currently logging in `requests` library is not properly documented.
The _API Changes_ section of the documentation reminds about the removal of the config parameter but contains no code. See http://docs.python-requests.org/en/latest/api/?highlight=logging
``` python
import requests
import logging
# these two lines enable debugging at httplib level (requests->urllib3->httplib)
# you will see the REQUEST, including HEADERS and DATA, and RESPONSE with HEADERS but without DATA.
# the only thing missing will be the response.body which is not logged.
import httplib
httplib.HTTPConnection.debuglevel = 1
logging.basicConfig() # you need to initialize logging, otherwise you will not see anything from requests
logging.getLogger().setLevel(logging.DEBUG)
requests_log = logging.getLogger("requests")
requests_log.setLevel(logging.DEBUG)
requests_log.propagate = True
requests.get('http://httpbin.org/headers')
```
So this means there are a few things to do:
#1 add the above piece of code to the documentation (including the API changes section)
#2 provide proper response on few stackoverflow questions related to requests logging
#3 find a way to allow extensive logging (logging BODY too)
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/240830?v=4",
"events_url": "https://api.github.com/users/sigmavirus24/events{/privacy}",
"followers_url": "https://api.github.com/users/sigmavirus24/followers",
"following_url": "https://api.github.com/users/sigmavirus24/following{/other_user}",
"gists_url": "https://api.github.com/users/sigmavirus24/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/sigmavirus24",
"id": 240830,
"login": "sigmavirus24",
"node_id": "MDQ6VXNlcjI0MDgzMA==",
"organizations_url": "https://api.github.com/users/sigmavirus24/orgs",
"received_events_url": "https://api.github.com/users/sigmavirus24/received_events",
"repos_url": "https://api.github.com/users/sigmavirus24/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/sigmavirus24/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/sigmavirus24/subscriptions",
"type": "User",
"url": "https://api.github.com/users/sigmavirus24",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/1297/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1297/timeline
| null |
completed
| null | null | false |
[
"requests does no logging of its own. All logging actually done is done by urllib3 and can be set up similar to your example:\n\n``` python\nimport requests\nimport logging\n\nlogging.getLogger().setLevel(logging.DEBUG)\nrequests_log = logging.getLogger(\"requests.packages.urllib3\")\nrequests_log.setLevel(logging.DEBUG)\nrequests_log.propagate = True\n```\n\nEven if we did do logging, we would not log the data sent in a post. You can, however, do the following:\n\n``` python\nresponse = requests.get(url)\nlogging.debug(\"Response: Status code: %d\", response.status_code)\nlogging.debug(\"Request: %s %s %s\", response.request.method, response.request.url, response.request.body)\n```\n\nI'm only leaving this ticket open as a reminder for myself during the documentation refresh I have planned.\n",
"Have you tried to run the first piece of code? I will not log anything unless you call `logging.debug(\"...\")` first. I tried with requests `1.2.0` and it will not log anything until you log something.\n",
"No I didn't run it because I know for a fact that requests proper does no logging of its own. All logging is done by urllib3 and I strongly suspect that the logging module is only working because urllib3 is technically part of the requests namespace. I'm also writing all of this from a phone so I can't exactly run anything at the moment.\n",
"Thanks Ian, \nI do think that having a way to log what requests is sending and receiving would be extremely useful and should be part of requests itself.\nWhy? For example I am trying to debug `python-jira` package and if I want to see what is sent/received, the only way would be use Wireshark, because it would be a mess to apply your model after all calls made to requests (there are plenty!).\nWe could even use a custom logging level, one that would be lower than logging.DEBUG, so it would not change the current behavior unless you choose to switch to the more verbose mode.\nI could implement this, but first I do want to find out that you do not have anything against this, I don't want to end-up using my custom requests library, and patch it after each requests release. \n",
"Adding extra detail was proposed in #988. Here, as there, any extra logging belongs in urllib3 and should be added there. This is being discussed at shazow/urllib3#107.\n",
"Requests had logging before 1.0 and it was torn out during the refactor. Take from that what you will. I'm entirely indifferent on the proposal. It's up to @kennethreitz no matter what.\n",
"AFAIK, the behavior in the example is because of python logging module itself.\n\nIf \"root logger\" is not initialized, nothing will be outputted. Calling `logging.debug()` (or .info or any other) initializes it with default settings. I think this is the same thing as calling `logging.basicConfig()` first.\n\nMy guess is that the same thing happens with _any_ python library that uses logging.\n\nIf you want output (to console. file, whatever), then you need to initialize the logging to do so.\n",
"@jvtm Thanks! Now I can update the sample code and so we can include it in the documentation.\n",
"@ssbarnea's pull request was merged closing this issue.\n",
"yeah, as @jvtm said, only initialize the \"root logging\" could set the log active for import module, and logging module can not match \"requests.packages.urllib3\", but \"urllib3\", like:\r\n```python\r\nimport requests\r\nimport logging\r\n\r\nlogger = logging.getLogger(\"urllib3\")\r\nlogger.setLevel(level=logging.DEBUG)\r\nlogging.debug(\"\")\r\n```\r\nworking on python 3.6"
] |
https://api.github.com/repos/psf/requests/issues/1296
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1296/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1296/comments
|
https://api.github.com/repos/psf/requests/issues/1296/events
|
https://github.com/psf/requests/pull/1296
| 12,930,566 |
MDExOlB1bGxSZXF1ZXN0NTAzNjU1Mw==
| 1,296 |
Add helpful error message to r.json() method
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/719590?v=4",
"events_url": "https://api.github.com/users/sursh/events{/privacy}",
"followers_url": "https://api.github.com/users/sursh/followers",
"following_url": "https://api.github.com/users/sursh/following{/other_user}",
"gists_url": "https://api.github.com/users/sursh/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/sursh",
"id": 719590,
"login": "sursh",
"node_id": "MDQ6VXNlcjcxOTU5MA==",
"organizations_url": "https://api.github.com/users/sursh/orgs",
"received_events_url": "https://api.github.com/users/sursh/received_events",
"repos_url": "https://api.github.com/users/sursh/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/sursh/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/sursh/subscriptions",
"type": "User",
"url": "https://api.github.com/users/sursh",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 5 |
2013-04-08T16:02:49Z
|
2021-09-08T20:01:11Z
|
2013-04-08T18:01:37Z
|
CONTRIBUTOR
|
resolved
|
It took me a while to figure out that this error was coming from the newest version of Requests rather than somewhere in Django. This updates the documentation to be more control-F friendly.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4",
"events_url": "https://api.github.com/users/kennethreitz/events{/privacy}",
"followers_url": "https://api.github.com/users/kennethreitz/followers",
"following_url": "https://api.github.com/users/kennethreitz/following{/other_user}",
"gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/kennethreitz",
"id": 119893,
"login": "kennethreitz",
"node_id": "MDQ6VXNlcjExOTg5Mw==",
"organizations_url": "https://api.github.com/users/kennethreitz/orgs",
"received_events_url": "https://api.github.com/users/kennethreitz/received_events",
"repos_url": "https://api.github.com/users/kennethreitz/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/kennethreitz/starred{/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/1296/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1296/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/1296.diff",
"html_url": "https://github.com/psf/requests/pull/1296",
"merged_at": "2013-04-08T18:01:37Z",
"patch_url": "https://github.com/psf/requests/pull/1296.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/1296"
}
| true |
[
"+1. I'm always in favour of better documentation.\n",
"I'm not sure this is the only error the json module raises but I'm generally +1 for this.\n",
"Good point @sigmavirus24. Fixed my wording.\n",
"Thanks very much. :+1: I was going to look to see if `json.decode` raised more than a ValueError but I'm too busy with school work so this is a good starting point. I also had plans of digging deep into the docs and checking the validity of them. In particular the hooks documentation, so if you'd like you're more than welcome to attack that too. :)\n",
":sparkles: :cake: :sparkles:\n"
] |
https://api.github.com/repos/psf/requests/issues/1295
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1295/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1295/comments
|
https://api.github.com/repos/psf/requests/issues/1295/events
|
https://github.com/psf/requests/pull/1295
| 12,879,175 |
MDExOlB1bGxSZXF1ZXN0NTAxNjYyNw==
| 1,295 |
Fix #1293
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/240830?v=4",
"events_url": "https://api.github.com/users/sigmavirus24/events{/privacy}",
"followers_url": "https://api.github.com/users/sigmavirus24/followers",
"following_url": "https://api.github.com/users/sigmavirus24/following{/other_user}",
"gists_url": "https://api.github.com/users/sigmavirus24/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/sigmavirus24",
"id": 240830,
"login": "sigmavirus24",
"node_id": "MDQ6VXNlcjI0MDgzMA==",
"organizations_url": "https://api.github.com/users/sigmavirus24/orgs",
"received_events_url": "https://api.github.com/users/sigmavirus24/received_events",
"repos_url": "https://api.github.com/users/sigmavirus24/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/sigmavirus24/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/sigmavirus24/subscriptions",
"type": "User",
"url": "https://api.github.com/users/sigmavirus24",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 1 |
2013-04-06T15:33:15Z
|
2021-09-08T20:01:11Z
|
2013-04-07T00:27:23Z
|
CONTRIBUTOR
|
resolved
|
Technically missing a netloc isn't the same as missing a scheme even if it is more convenient the other way. :-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/1295/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1295/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/1295.diff",
"html_url": "https://github.com/psf/requests/pull/1295",
"merged_at": "2013-04-07T00:27:23Z",
"patch_url": "https://github.com/psf/requests/pull/1295.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/1295"
}
| true |
[
"+1\n"
] |
https://api.github.com/repos/psf/requests/issues/1294
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1294/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1294/comments
|
https://api.github.com/repos/psf/requests/issues/1294/events
|
https://github.com/psf/requests/issues/1294
| 12,878,336 |
MDU6SXNzdWUxMjg3ODMzNg==
| 1,294 |
Getting errno from an SSLError
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1440143?v=4",
"events_url": "https://api.github.com/users/GP89/events{/privacy}",
"followers_url": "https://api.github.com/users/GP89/followers",
"following_url": "https://api.github.com/users/GP89/following{/other_user}",
"gists_url": "https://api.github.com/users/GP89/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/GP89",
"id": 1440143,
"login": "GP89",
"node_id": "MDQ6VXNlcjE0NDAxNDM=",
"organizations_url": "https://api.github.com/users/GP89/orgs",
"received_events_url": "https://api.github.com/users/GP89/received_events",
"repos_url": "https://api.github.com/users/GP89/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/GP89/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/GP89/subscriptions",
"type": "User",
"url": "https://api.github.com/users/GP89",
"user_view_type": "public"
}
|
[
{
"color": "02e10c",
"default": false,
"description": null,
"id": 76800,
"name": "Feature Request",
"node_id": "MDU6TGFiZWw3NjgwMA==",
"url": "https://api.github.com/repos/psf/requests/labels/Feature%20Request"
},
{
"color": "0b02e1",
"default": false,
"description": null,
"id": 191274,
"name": "Contributor Friendly",
"node_id": "MDU6TGFiZWwxOTEyNzQ=",
"url": "https://api.github.com/repos/psf/requests/labels/Contributor%20Friendly"
},
{
"color": "f7c6c7",
"default": false,
"description": null,
"id": 167537670,
"name": "Propose Close",
"node_id": "MDU6TGFiZWwxNjc1Mzc2NzA=",
"url": "https://api.github.com/repos/psf/requests/labels/Propose%20Close"
}
] |
closed
| true |
{
"avatar_url": "https://avatars.githubusercontent.com/u/240830?v=4",
"events_url": "https://api.github.com/users/sigmavirus24/events{/privacy}",
"followers_url": "https://api.github.com/users/sigmavirus24/followers",
"following_url": "https://api.github.com/users/sigmavirus24/following{/other_user}",
"gists_url": "https://api.github.com/users/sigmavirus24/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/sigmavirus24",
"id": 240830,
"login": "sigmavirus24",
"node_id": "MDQ6VXNlcjI0MDgzMA==",
"organizations_url": "https://api.github.com/users/sigmavirus24/orgs",
"received_events_url": "https://api.github.com/users/sigmavirus24/received_events",
"repos_url": "https://api.github.com/users/sigmavirus24/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/sigmavirus24/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/sigmavirus24/subscriptions",
"type": "User",
"url": "https://api.github.com/users/sigmavirus24",
"user_view_type": "public"
}
|
[
{
"avatar_url": "https://avatars.githubusercontent.com/u/240830?v=4",
"events_url": "https://api.github.com/users/sigmavirus24/events{/privacy}",
"followers_url": "https://api.github.com/users/sigmavirus24/followers",
"following_url": "https://api.github.com/users/sigmavirus24/following{/other_user}",
"gists_url": "https://api.github.com/users/sigmavirus24/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/sigmavirus24",
"id": 240830,
"login": "sigmavirus24",
"node_id": "MDQ6VXNlcjI0MDgzMA==",
"organizations_url": "https://api.github.com/users/sigmavirus24/orgs",
"received_events_url": "https://api.github.com/users/sigmavirus24/received_events",
"repos_url": "https://api.github.com/users/sigmavirus24/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/sigmavirus24/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/sigmavirus24/subscriptions",
"type": "User",
"url": "https://api.github.com/users/sigmavirus24",
"user_view_type": "public"
}
] | null | 29 |
2013-04-06T14:20:26Z
|
2021-09-08T23:06:05Z
|
2015-01-19T09:26:36Z
|
NONE
|
resolved
|
I noticed a couple of issues trying to get the `errno` attribute from an `SSLError`.
Firstly the `errno` attribute is accessed via `err.message.message.errno`, which is a little annoying but more annoyingly, for `ConnectionError` the attribute is accessed via `err.message.reason.errno` which is a problem as an except clause catching `ConnectionErrors` will also catch `SSLError` as it's a subclass, so they should really have the same interface.
Another issue I noticed is that the `errno` attribute for the an `SSLError` instance returns `None`
|
{
"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/1294/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1294/timeline
| null |
completed
| null | null | false |
[
"This seems reasonable. I'll take a crack at standardizing the exceptions tonight.\n",
"Thanks! The bigger issue for me is that the `errno` attribute seems to get lost somehow in the wrapped exception, the differing interface is just a bit of a gotcha.\n",
"Yeah. I just figure if we standardize it a bit, I'll find why errno isn't \nbeing properly saved\n",
"Awesome!\n\nAlso something which I noticed, which I guess you probably know about already but might be worth considering is exceptions like these:\n\n`requests.exceptions.SSLError(requests.packages.urllib3.exceptions.SSLError(ssl.SSLError('_ssl.c:488: The handshake operation timed out')))`, `requests.exceptions.SSLError(requests.packages.urllib3.exceptions.SSLError(ssl.SSLError('The read operation timed out')))`\n\nwont get caught by a `requests.exceptions.Timeout` handler.\n",
"So while we could introspect those exceptions, we really only re-wrap \nexceptions so that the user doesn't have to do:\n\n``` python\nfrom requests.packages.urllib3 import SSLError, Timeout, #etc.\n\ntry:\n pass\nexcept SSLError as ssle:\n pass\n```\n\nThose errors are strictly rising out of the SSL library being used so their \nbeing re-wrapped as SSLErrors is perfectly valid. What we would rely on is \nurllib3 doing the introspection but I doubt @shazow would want that there \neither. So that you can consider a \"Won't fix\" item.\n",
"@kennethreitz @Lukasa @GP89 is there any interest in this issue any longer? I'm not keen on the solution I had started to work out and the issue wasn't really ours in the first place as can be seen by the discussion on e4e7eb8\n",
"I view this as a \"Wouldn't It Be Nice If\" issue. I'm happy to leave it open and mark it 'Contributor Friendly'.\n",
"I don't mind \"flattening\" the exceptions but I want to spend my limited spare time on items that aren't on the fence. I'm sure there is value to not having XError(YError(ZError(...),...),...) But we'd need to have a way of accessing those.\n",
"Hmm. I think the only way to do this in any sensible way is, each time we raise an exception, to grab the string error and the errno explicitly. Otherwise the exceptions themselves know way too much about the things they're wrapping. The issue there is that we become very, very brittle against upstream changes (e.g. in urllib3).\n",
"Ugh, this is a nightmare to do cleanly. Our mapping of exceptions isn't 1:1, so not all the exceptions we wrap have the same interface. =(\n",
"I think this was resolved (sort of) by #1475. Closing for now but it can be reopened if necessary.\n",
"#1475 was never merged. =)\n",
"GitHub sometimes displays merged PRs as closed so I figured it was probably merged. Oh well.\n\nThis isn't exactly a bug but more of a feature request, do we have any updated ideas about this? Last I saw: \n\n> this is a nightmare to do cleanly.\n\nThis makes me wonder if we should even be bothering.\n",
"Possibly not. It's certainly hard for me to get excited about at the minute.\n",
"I'll put it on my TODO list. Not sure when I'll get to it though.\n",
"Greetings!\n\nI'm also in a situation where SSLError is getting thrown:\n\n```\n File \"/usr/lib/python2.7/dist-packages/requests/adapters.py\", line 382, in send\n raise SSLError(e, request=request)\nrequests.exceptions.SSLError\n```\n\nAlthough in my case I'm trying to pull message\n\n```\nexcept requests.exceptions.SSLError as e:\n return e.message\n```\n\n and then I get\n\n```\nTraceback (most recent call last):\n File \"exceptionTest.py\", line 5, in <module>\n print con.request()\nTypeError: __str__ returned non-string (type Error)\n```\n\nIt seems related, but I am relatively new to python, so let me know if I'm missing something (or doing something wrong).\n",
"Hey @jgillmanjr \n\nIt doesn't seem that the `TypeError` is caused by how you're handling the exception. It seems like there's a line in your script (`exceptionTest.py`) that reads `print con.request()` and whatever `con.request()` returns cannot be coerced to a string.\n",
"@sigmavirus24 \n\nHere's a gist that I created to give more context: https://gist.github.com/jgillmanjr/fb4431bec403de48cf22\n\nI ultimately realized that it was the cert on the testing box that wasn't passing verification. But I'd still like to know if I was trying to get the exception properly or if the exception that is being returned could use some fixing.\n\nThanks again!\n",
"@jgillmanjr sorry for the delay. I tried out something on my end with requests 2.4.3\n\n``` pycon\nPython 2.7.8 (default, Aug 24 2014, 21:26:19)\n[GCC 4.2.1 Compatible Apple LLVM 5.1 (clang-503.0.40)] on darwin\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\n>>> import requests\n>>> try:\n... r = requests.get('https://www.invalid-cert.com')\n... except requests.exceptions.SSLError as e:\n... m = e.message\n...\n>>> m\nSSLError(SSLError(1, '_ssl.c:510: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed'),)\n>>> print m\n[Errno 1] _ssl.c:510: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed\n>>> print e\n[Errno 1] _ssl.c:510: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed\n```\n\nSo I'm not sure why you're seeing a problem honestly.\n",
"@sigmavirus24 Not a problem.\n\nIt seems when I run it from the interactive shell, it sort of works:\n\n```\nPython 2.7.8 (default, Oct 7 2014, 17:59:21) \n[GCC 4.9.1] on linux2\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\n>>> import requests\n>>> try:\n... r = requests.get('https://api-public.jgillman.dev.liquidweb.com:20900')\n... except requests.exceptions.SSLError as e:\n... m = e.message\n... \n>>> m\nSSLError(SSLError('bad handshake', Error([('SSL routines', 'SSL3_GET_SERVER_CERTIFICATE', 'certificate verify failed')],)),)\n>>> print m\nTraceback (most recent call last):\n File \"<stdin>\", line 1, in <module>\nTypeError: __str__ returned non-string (type Error)\n>>> m\nSSLError(SSLError('bad handshake', Error([('SSL routines', 'SSL3_GET_SERVER_CERTIFICATE', 'certificate verify failed')],)),)\n>>> print e\nTraceback (most recent call last):\n File \"<stdin>\", line 1, in <module>\nTypeError: __str__ returned non-string (type Error)\n>>> e\nSSLError(SSLError(SSLError('bad handshake', Error([('SSL routines', 'SSL3_GET_SERVER_CERTIFICATE', 'certificate verify failed')],)),),)\n```\n\nHowever, it looks as though I'm using 2.3.0\n\n/// Break ///\n\nUpgraded to 2.4.3 and still seeing the same thing.\n",
"@jgillmanjr, I just realized that this is likely due to your using pyOpenSSL, ndg-httpsclient, and pyasn1. I'm going to test with those installed to see if I can reproduce this.\n",
"@sigmavirus24 Well, I _may_ have figured it out.\n\nI forgot that I actually initially installed pip via apt. This subsequently required the package `python-requests` which was only at version 2.3.0. I realized this once I started getting issues with requests after I did a pip upgrade on it and pip proceeded to not work very well any more.\n\nNow that I've removed the packages, installed pip via the `get-pip.py` script, I am not recieving any more errors:\n\n```\n>>> m\nSSLError(SSLError(1, u'[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:581)'),)\n>>> print m\n[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:581)\n>>> e\nSSLError(SSLError(SSLError(1, u'[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:581)'),),)\n>>> print e\n[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:581)\n```\n\nI might have to report a bug to the package managers.\n\nSorry for the time sink!\n\n-Jason\n",
"@sigmavirus24 If you care to weigh in, here is a link to the bug report: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=766481\n",
"That's really bizarre @jgillmanjr I'm going to keep my neck out of that bug report but I trust @eriolv will be a great help to you.\n",
"@sigmavirus24 Thanks as usual for bringing me in! :)\nI have investigated a bit and the problem seems related to pyasn1. See my reply\nhttps://bugs.debian.org/cgi-bin/bugreport.cgi?bug=766481#10\nUnfortunately I can check deeply right now...\n",
"@sigmavirus24 It seems to be somting related to pyasn1: I can reproduce on a virtualenv and @jgillmanjr confirmed it. Can I link the Debian Bug with this one? Or you prefer a new issue since the TypeError is only due pyasn1?\n",
"I'm not sure what there is for requests to do in this case. As you found in your examination this is a problem with pyasn1. I think we can continue the discussion here. Can you tell me what the type is of `e.message`? (That might also have it's own `.message` attribute that would be good to know the type of.)\n",
"@sigmavirus24 `<class 'requests.packages.urllib3.exceptions.SSLError'>` is what I get when I run `print type(e.message)`\n",
"So I can get the SSLError with https://hg.mornie.org but I cannot reproduce this still.\n\n``` python\ntry:\n requests.get('https://hg.mornie.org')\nexcept requests.exceptions.SSLError as e:\n m = e.message\n\nprint(type(m))\nprint(type(m.message)) # ssl.SSLError for me\nprint(m.args) # ('bad handshake', Error([('SSL routines', 'SSL3_GET_SERVER_CERTIFICATE', 'certificate verify failed')],))\nprint(type(m.message.args[1])) # OpenSSL.SSL.Error for me\nprint(type(m.message.args[1].message)) # list\n```\n\nFeel free to explore other attributes to figure out which one is triggering this for you. I can't reproduce it sadly :(\n"
] |
https://api.github.com/repos/psf/requests/issues/1293
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1293/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1293/comments
|
https://api.github.com/repos/psf/requests/issues/1293/events
|
https://github.com/psf/requests/issues/1293
| 12,872,033 |
MDU6SXNzdWUxMjg3MjAzMw==
| 1,293 |
MissingSchema error raised when schema present
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/187133?v=4",
"events_url": "https://api.github.com/users/gazpachoking/events{/privacy}",
"followers_url": "https://api.github.com/users/gazpachoking/followers",
"following_url": "https://api.github.com/users/gazpachoking/following{/other_user}",
"gists_url": "https://api.github.com/users/gazpachoking/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/gazpachoking",
"id": 187133,
"login": "gazpachoking",
"node_id": "MDQ6VXNlcjE4NzEzMw==",
"organizations_url": "https://api.github.com/users/gazpachoking/orgs",
"received_events_url": "https://api.github.com/users/gazpachoking/received_events",
"repos_url": "https://api.github.com/users/gazpachoking/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/gazpachoking/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/gazpachoking/subscriptions",
"type": "User",
"url": "https://api.github.com/users/gazpachoking",
"user_view_type": "public"
}
|
[] |
closed
| true |
{
"avatar_url": "https://avatars.githubusercontent.com/u/240830?v=4",
"events_url": "https://api.github.com/users/sigmavirus24/events{/privacy}",
"followers_url": "https://api.github.com/users/sigmavirus24/followers",
"following_url": "https://api.github.com/users/sigmavirus24/following{/other_user}",
"gists_url": "https://api.github.com/users/sigmavirus24/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/sigmavirus24",
"id": 240830,
"login": "sigmavirus24",
"node_id": "MDQ6VXNlcjI0MDgzMA==",
"organizations_url": "https://api.github.com/users/sigmavirus24/orgs",
"received_events_url": "https://api.github.com/users/sigmavirus24/received_events",
"repos_url": "https://api.github.com/users/sigmavirus24/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/sigmavirus24/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/sigmavirus24/subscriptions",
"type": "User",
"url": "https://api.github.com/users/sigmavirus24",
"user_view_type": "public"
}
|
[
{
"avatar_url": "https://avatars.githubusercontent.com/u/240830?v=4",
"events_url": "https://api.github.com/users/sigmavirus24/events{/privacy}",
"followers_url": "https://api.github.com/users/sigmavirus24/followers",
"following_url": "https://api.github.com/users/sigmavirus24/following{/other_user}",
"gists_url": "https://api.github.com/users/sigmavirus24/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/sigmavirus24",
"id": 240830,
"login": "sigmavirus24",
"node_id": "MDQ6VXNlcjI0MDgzMA==",
"organizations_url": "https://api.github.com/users/sigmavirus24/orgs",
"received_events_url": "https://api.github.com/users/sigmavirus24/received_events",
"repos_url": "https://api.github.com/users/sigmavirus24/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/sigmavirus24/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/sigmavirus24/subscriptions",
"type": "User",
"url": "https://api.github.com/users/sigmavirus24",
"user_view_type": "public"
}
] | null | 1 |
2013-04-06T04:26:46Z
|
2021-09-09T04:00:39Z
|
2013-04-07T00:27:24Z
|
CONTRIBUTOR
|
resolved
|
After [this](https://github.com/kennethreitz/requests/commit/ca85b4ec6ce2428891d2e1ae72dad2b873c87bbe) commit, a `MissingSchema` error can be raised when schema is present, but network location isn't. Seems this should be handled another way.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/240830?v=4",
"events_url": "https://api.github.com/users/sigmavirus24/events{/privacy}",
"followers_url": "https://api.github.com/users/sigmavirus24/followers",
"following_url": "https://api.github.com/users/sigmavirus24/following{/other_user}",
"gists_url": "https://api.github.com/users/sigmavirus24/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/sigmavirus24",
"id": 240830,
"login": "sigmavirus24",
"node_id": "MDQ6VXNlcjI0MDgzMA==",
"organizations_url": "https://api.github.com/users/sigmavirus24/orgs",
"received_events_url": "https://api.github.com/users/sigmavirus24/received_events",
"repos_url": "https://api.github.com/users/sigmavirus24/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/sigmavirus24/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/sigmavirus24/subscriptions",
"type": "User",
"url": "https://api.github.com/users/sigmavirus24",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/1293/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1293/timeline
| null |
completed
| null | null | false |
[
"Yeah, I guess `InvalidURL` would be better in this case. Sorry about that.\n"
] |
https://api.github.com/repos/psf/requests/issues/1292
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1292/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1292/comments
|
https://api.github.com/repos/psf/requests/issues/1292/events
|
https://github.com/psf/requests/issues/1292
| 12,850,034 |
MDU6SXNzdWUxMjg1MDAzNA==
| 1,292 |
HTTP Headers that contains underscore (_) are not transferred to server
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/3738281?v=4",
"events_url": "https://api.github.com/users/spil-bahadir/events{/privacy}",
"followers_url": "https://api.github.com/users/spil-bahadir/followers",
"following_url": "https://api.github.com/users/spil-bahadir/following{/other_user}",
"gists_url": "https://api.github.com/users/spil-bahadir/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/spil-bahadir",
"id": 3738281,
"login": "spil-bahadir",
"node_id": "MDQ6VXNlcjM3MzgyODE=",
"organizations_url": "https://api.github.com/users/spil-bahadir/orgs",
"received_events_url": "https://api.github.com/users/spil-bahadir/received_events",
"repos_url": "https://api.github.com/users/spil-bahadir/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/spil-bahadir/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/spil-bahadir/subscriptions",
"type": "User",
"url": "https://api.github.com/users/spil-bahadir",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 13 |
2013-04-05T15:17:17Z
|
2016-07-15T16:52:17Z
|
2013-04-05T15:27:46Z
|
NONE
| null |
The following could be an HTTP specification, but I'm not sure.
I have netcat opened, submitting the following request via httpie[https://github.com/jkbr/httpie]
``` bash
http POST http://cas/api/v1/users/ X_SPIL_AUTH_TOKEN:test
```
results as the following
```
POST /api/v1/users/ HTTP/1.0
Host: cas
X-Real-IP: 127.0.0.1
Connection: close
Content-Length: 0
User-Agent: HTTPie/0.4.1
Accept: */*
Accept-Encoding: gzip, deflate, compress
```
and submitting the following request
``` bash
http POST http://cas/api/v1/users/ X-SPIL-AUTH-TOKEN:test
```
ends up with the following result
```
POST /api/v1/users/ HTTP/1.0
Host: cas
X-Real-IP: 127.0.0.1
Connection: close
Content-Length: 0
User-Agent: HTTPie/0.4.1
Accept-Encoding: gzip, deflate, compress
Accept: */*
X-SPIL-AUTH-TOKEN: test
```
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/240830?v=4",
"events_url": "https://api.github.com/users/sigmavirus24/events{/privacy}",
"followers_url": "https://api.github.com/users/sigmavirus24/followers",
"following_url": "https://api.github.com/users/sigmavirus24/following{/other_user}",
"gists_url": "https://api.github.com/users/sigmavirus24/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/sigmavirus24",
"id": 240830,
"login": "sigmavirus24",
"node_id": "MDQ6VXNlcjI0MDgzMA==",
"organizations_url": "https://api.github.com/users/sigmavirus24/orgs",
"received_events_url": "https://api.github.com/users/sigmavirus24/received_events",
"repos_url": "https://api.github.com/users/sigmavirus24/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/sigmavirus24/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/sigmavirus24/subscriptions",
"type": "User",
"url": "https://api.github.com/users/sigmavirus24",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/1292/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1292/timeline
| null |
completed
| null | null | false |
[
"Here's the [spec](http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.2). In case you were unsure, I'm 90% sure (assuming my memory still works... probably need to run an fsck some time soon) that HT is short-hand for hyphen (or hyphen text). In other words, underscores are not allowed in header field names. They can exist in the field values, just not the names. If you want translation from `_` to `-`, that would be an issue to raise against jkbr/httpie.\n",
"Thanks for the clarification. I was using httpie to make sure my code wasn't the problem. Apparently the cause was my key selection.\n",
"Just for my own paranoia:\n\n```\niapetus:~ curl -H \"Underscored_Name: Foo\" http://httpbin.org/get\n{\n \"url\": \"http://httpbin.org/get\",\n \"headers\": {\n \"Host\": \"httpbin.org\",\n \"Underscored-Name\": \"Foo\",\n \"Connection\": \"close\",\n \"Accept\": \"*/*\",\n \"User-Agent\": \"curl/7.21.4 (x86_64-unknown-linux-gnu) libcurl/7.21.4 OpenSSL/0.9.8n zlib/1.2.5 libidn/1.19\"\n },\n \"args\": {},\n \"origin\": \"10.84.89.222\"\n}\n```\n\nYou'll see that cURL translated the underscore to a hyphen which only raises my confidence that they can not exist. jkbr/httpie tries to replace cURL so you might want to bring this up as a feature request, but this is certainly not a bug.\n\nThanks for the report though.\n",
"HT stands for horizontal tab, [see here](http://www.w3.org/Protocols/rfc2616/rfc2616-sec2.html#sec2.2).\n",
"If I check it with tcpdump, I see that it's not cURL that translates the underscore but httpbin.org's software. According to any standard I found, you can use any printable character in a header name except colon, so nothing warrants turning underscores to anything else or denying them.\n",
"Then requestb.in is doing something wrong too. It's translating curl requests with underscores to hyphens. If you don't trust me you can create an anonymous bin that will last for 20 minutes.\n",
"It seems a lot of software is handling headers with underscores specially. I found reports about nginx, IIS and some ruby stuff.\nOTH, using primitive tools like netcat one can easily proof, that curl happily sends headers containing underscores:\n\n``` sh\n$ curl -H \"Underscored_Name: Foo\" http://localhost:4000\n```\n\n``` sh\n$ ncat -l 0.0.0.0 4000 # also works with \"netcat\" and \"nc\". Doesn't care about protocols or standards\nGET / HTTP/1.1\nUser-Agent: curl/7.31.0\nHost: localhost:4000\nAccept: */*\nUnderscored_Name: Foo\n```\n",
"I am having same problem & i am using xampp 1.8.0\n\nThis is not working\n\n<pre>\ncurl -i -H \"Accept: application/json\" -H \"X_REST_USERNAME: admin@restuser\" -H \"X_REST_PASSWORD: admin@Access\"\\http://localhost/project/api/test\n</pre>\n\nThis is working.\n\n<pre>\ncurl -i -H \"Accept: application/json\" -H \"X-REST-USERNAME: admin@restuser\" -H \"X-REST-PASSWORD: admin@Access\" \\ http://localhost/project/api/test\n</pre>\n",
"@miteshsc Sorry, but how is that comment relevant to this issue?\n",
"@Lukasa: Sorry for posting irrelevant comment but i was facing problem, thats why i have posted my cUrl call.\n",
"SiteMinder not setting HTTP header with underscore in the name in Apache 2.4\nDocument ID: TEC1712544\nLast Modified Date: 1/22/2016\nShow Technical Document Details\nProblem:\nCustomer installed and configured SiteMinder Web Agent on Apache 2.4.\nHe has a PHP module which is expecting some of the default SiteMinder headers e.g. SM_USER, SM_DOMAIN etc and also some custom headers which has underscore in it's name (e.g USER_NAME etc).\nHowever, when he reads the HTTP headers using PHP module (or a CGI module) , he couldn't find any of the header with underscore in it's name being set.\nAll other headers are working fine.\n\nEnvironment:\nPolicy Server : r12.52 SP1 CR2 (However, this is applicable for any version)\n\nRoot Cause:\nThis is a new feature introduced in Apache 2.4 in multiple modules like mod_cgi,mod_include,mod_isapi,php etc.\nThis was introduced to prevent cross-site-scripting attacks via header injection. Headers containing invalid characters (including underscores) are now silently dropped\n\nResolution: \nFor the default SiteMinder Headers\nYou can specify which naming convention the Web Agent uses for the default HTTP headers with the following parameter:\n\nLegacyVariables\nSpecifies if the Web Agent uses underscores in HTTP header names.\n\nWhen ,\nLegacyVariables = yes (default), the HTTP Headers will have underscore (e.g SM_USER,SM_USERDN etc)\nLegacyVariables = no, the HTTP headers will not have underscores (e.g SMUSER,SMUSERDN)\n\nFor custom HTTP Headers\nLegacyVariables only controls the default SiteMInder HTTP headers. It doesn't modify the user defined HTTP Headers.\nSo. for bypassing this restriction in Apache 2.4, you will need to ensure that your custom HTTP header names does not have any undersore.\n\nAlternatively, you can also refer to the workaround suggested by Apache, which will bascially bypass this new security restriction.\nThis involves setting mod_setenvif and mod_headers which allows you to still accept these headers with underscore.\n",
"@josetiagobispo this seems not at all relevant to this project. Please do not post bug reports related to other projects on this projects issue tracker.\n",
"Due to the recent spam on this issue, I'm locking the conversation down.\n"
] |
https://api.github.com/repos/psf/requests/issues/1291
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1291/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1291/comments
|
https://api.github.com/repos/psf/requests/issues/1291/events
|
https://github.com/psf/requests/pull/1291
| 12,831,163 |
MDExOlB1bGxSZXF1ZXN0NDk5MzU3OQ==
| 1,291 |
Don't set all session cookies on response.cookies
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/187133?v=4",
"events_url": "https://api.github.com/users/gazpachoking/events{/privacy}",
"followers_url": "https://api.github.com/users/gazpachoking/followers",
"following_url": "https://api.github.com/users/gazpachoking/following{/other_user}",
"gists_url": "https://api.github.com/users/gazpachoking/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/gazpachoking",
"id": 187133,
"login": "gazpachoking",
"node_id": "MDQ6VXNlcjE4NzEzMw==",
"organizations_url": "https://api.github.com/users/gazpachoking/orgs",
"received_events_url": "https://api.github.com/users/gazpachoking/received_events",
"repos_url": "https://api.github.com/users/gazpachoking/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/gazpachoking/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/gazpachoking/subscriptions",
"type": "User",
"url": "https://api.github.com/users/gazpachoking",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 3 |
2013-04-05T03:37:35Z
|
2021-09-08T20:01:10Z
|
2013-04-05T03:41:52Z
|
CONTRIBUTOR
|
resolved
|
This prevents all the session cookies from being set in response.cookies. I believe the old behavior was a workaround due to how session cookies were being updated before #1290
After this, response.cookies will match up with the set-cookies header for the response.
As discussed here: https://botbot.me/freenode/python-requests/msg/2568299/
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4",
"events_url": "https://api.github.com/users/kennethreitz/events{/privacy}",
"followers_url": "https://api.github.com/users/kennethreitz/followers",
"following_url": "https://api.github.com/users/kennethreitz/following{/other_user}",
"gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/kennethreitz",
"id": 119893,
"login": "kennethreitz",
"node_id": "MDQ6VXNlcjExOTg5Mw==",
"organizations_url": "https://api.github.com/users/kennethreitz/orgs",
"received_events_url": "https://api.github.com/users/kennethreitz/received_events",
"repos_url": "https://api.github.com/users/kennethreitz/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/kennethreitz/starred{/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/1291/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1291/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/1291.diff",
"html_url": "https://github.com/psf/requests/pull/1291",
"merged_at": "2013-04-05T03:41:52Z",
"patch_url": "https://github.com/psf/requests/pull/1291.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/1291"
}
| true |
[
":sparkles: :cookie: :sparkles:\n",
"Mmm, cookies. :tongue: \n",
":cake:\n"
] |
https://api.github.com/repos/psf/requests/issues/1290
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1290/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1290/comments
|
https://api.github.com/repos/psf/requests/issues/1290/events
|
https://github.com/psf/requests/pull/1290
| 12,829,863 |
MDExOlB1bGxSZXF1ZXN0NDk5Mjk4Ng==
| 1,290 |
fix #1287: Make sure expired cookies get removed from session.cookies
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/187133?v=4",
"events_url": "https://api.github.com/users/gazpachoking/events{/privacy}",
"followers_url": "https://api.github.com/users/gazpachoking/followers",
"following_url": "https://api.github.com/users/gazpachoking/following{/other_user}",
"gists_url": "https://api.github.com/users/gazpachoking/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/gazpachoking",
"id": 187133,
"login": "gazpachoking",
"node_id": "MDQ6VXNlcjE4NzEzMw==",
"organizations_url": "https://api.github.com/users/gazpachoking/orgs",
"received_events_url": "https://api.github.com/users/gazpachoking/received_events",
"repos_url": "https://api.github.com/users/gazpachoking/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/gazpachoking/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/gazpachoking/subscriptions",
"type": "User",
"url": "https://api.github.com/users/gazpachoking",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 3 |
2013-04-05T02:19:15Z
|
2021-09-08T20:01:10Z
|
2013-04-05T03:22:38Z
|
CONTRIBUTOR
|
resolved
|
This changes sessions to update their cookiejar directly from the headers rather than the cookiejar attached to responses. This way cookies that the server marks as expired are removed from the session cookiejar.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4",
"events_url": "https://api.github.com/users/kennethreitz/events{/privacy}",
"followers_url": "https://api.github.com/users/kennethreitz/followers",
"following_url": "https://api.github.com/users/kennethreitz/following{/other_user}",
"gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/kennethreitz",
"id": 119893,
"login": "kennethreitz",
"node_id": "MDQ6VXNlcjExOTg5Mw==",
"organizations_url": "https://api.github.com/users/kennethreitz/orgs",
"received_events_url": "https://api.github.com/users/kennethreitz/received_events",
"repos_url": "https://api.github.com/users/kennethreitz/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/kennethreitz/starred{/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/1290/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1290/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/1290.diff",
"html_url": "https://github.com/psf/requests/pull/1290",
"merged_at": "2013-04-05T03:22:38Z",
"patch_url": "https://github.com/psf/requests/pull/1290.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/1290"
}
| true |
[
"This is absolutely fantastic and I can confirm it works with [this](https://gist.github.com/sigmavirus24/5314553).\n",
"And in case it wasn't obvious, +1000\n",
":cake:\n"
] |
https://api.github.com/repos/psf/requests/issues/1289
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1289/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1289/comments
|
https://api.github.com/repos/psf/requests/issues/1289/events
|
https://github.com/psf/requests/issues/1289
| 12,805,686 |
MDU6SXNzdWUxMjgwNTY4Ng==
| 1,289 |
Python 3.3 requests issue
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/3253989?v=4",
"events_url": "https://api.github.com/users/echohack/events{/privacy}",
"followers_url": "https://api.github.com/users/echohack/followers",
"following_url": "https://api.github.com/users/echohack/following{/other_user}",
"gists_url": "https://api.github.com/users/echohack/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/echohack",
"id": 3253989,
"login": "echohack",
"node_id": "MDQ6VXNlcjMyNTM5ODk=",
"organizations_url": "https://api.github.com/users/echohack/orgs",
"received_events_url": "https://api.github.com/users/echohack/received_events",
"repos_url": "https://api.github.com/users/echohack/repos",
"site_admin": true,
"starred_url": "https://api.github.com/users/echohack/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/echohack/subscriptions",
"type": "User",
"url": "https://api.github.com/users/echohack",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 67 |
2013-04-04T15:34:17Z
|
2021-09-08T18:00:45Z
|
2013-04-25T18:41:08Z
|
NONE
|
resolved
|
I'm getting a strange error when using Requests in Python 3.3 (other flavors of Python 3 do not get this error):
```
Traceback (most recent call last):
File "C:\Python33\lib\site-packages\requests\packages\urllib3\connectionpool.py", line 421, in urlopen
body=body, headers=headers)
File "C:\Python33\lib\site-packages\requests\packages\urllib3\connectionpool.py", line 273, in _make_request
conn.request(method, url, **httplib_request_kw)
File "C:\Python33\lib\http\client.py", line 1049, in request
self._send_request(method, url, body, headers)
File "C:\Python33\lib\http\client.py", line 1087, in _send_request
self.endheaders(body)
File "C:\Python33\lib\http\client.py", line 1045, in endheaders
self._send_output(message_body)
File "C:\Python33\lib\http\client.py", line 890, in _send_output
self.send(msg)
File "C:\Python33\lib\http\client.py", line 828, in send
self.connect()
File "C:\Python33\lib\site-packages\requests\packages\urllib3\connectionpool.py", line 104, in connect
ssl_version=resolved_ssl_version)
File "C:\Python33\lib\site-packages\requests\packages\urllib3\util.py", line 329, in ssl_wrap_socket
return context.wrap_socket(sock, server_hostname=server_hostname)
File "C:\Python33\lib\ssl.py", line 210, in wrap_socket
_context=self)
File "C:\Python33\lib\ssl.py", line 310, in __init__
raise x
File "C:\Python33\lib\ssl.py", line 306, in __init__
self.do_handshake()
File "C:\Python33\lib\ssl.py", line 513, in do_handshake
self._sslobj.do_handshake()
ConnectionResetError: [WinError 10054] An existing connection was forcibly closed by the remote host
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Python33\lib\site-packages\requests\adapters.py", line 211, in send
timeout=timeout
File "C:\Python33\lib\site-packages\requests\packages\urllib3\connectionpool.py", line 465, in urlopen
raise MaxRetryError(self, url, e)
requests.packages.urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='analysiscenter.veracode.com', port=443): Max retries exceeded with url: /api/2.0/getappbuilds.do (Caused by <class 'ConnectionResetError'>: [WinError 10054] An existing connection was forcibly closed by the remote host)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\tfs\Vertafore_TFSDev\CQ\python\veracode\pythontestscriptonation.py", line 33, in <module>
print(v.get_app_builds())
File "C:\tfs\Vertafore_TFSDev\CQ\python\veracode\apiwrapper.py", line 184, in get_app_builds
{}
File "C:\tfs\Vertafore_TFSDev\CQ\python\veracode\apiwrapper.py", line 57, in request
r = requests.get(URL, params=data, auth=username_password)
File "C:\Python33\lib\site-packages\requests\api.py", line 55, in get
return request('get', url, **kwargs)
File "C:\Python33\lib\site-packages\requests\api.py", line 44, in request
return session.request(method=method, url=url, **kwargs)
File "C:\Python33\lib\site-packages\requests\sessions.py", line 354, in request
resp = self.send(prep, **send_kwargs)
File "C:\Python33\lib\site-packages\requests\sessions.py", line 460, in send
r = adapter.send(request, **kwargs)
File "C:\Python33\lib\site-packages\requests\adapters.py", line 246, in send
raise ConnectionError(e)
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='analysiscenter.veracode.com', port=443): Max retries exceeded with url: /api/2.0/getappbuilds.do (Caused by <class 'ConnectionResetError'>: [WinError 10054] An existing connection was forcibly closed by the remote host)
[Finished in 61.0s with exit code 1]
```
This automation has run for months on Python 3.2 and these errors have never occurred. I don't really know enough about requests to investigate this issue, but I'd be happy to help recreate the issue or debug if someone else can. Perhaps there's a bug in how Requests is handling HTTPS requests with Python 3.3? (Did 3.3 change how urllib works?...I don't know offhand...)
Again, I'm not getting any of these issues in Python 3.2 or Python 3.1. Please help! :)
|
{
"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/1289/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1289/timeline
| null |
completed
| null | null | false |
[
"Please reply with the following: `python -c 'import requests; print(requests.__version__)'`\n",
"Requests version 1.1.0.\n",
"@t-8ch can explain this in detail but upgrading to 1.2.0 should fix all of your problems.\n",
"Excellent! I'll test it out. Thank you for your quick response. :)\n",
"If it doesn't fix it for you, feel free to re-open the issue or ask me to do it for you.\n",
"I'm still having the same failure, no matter where I run it.\n\n```\nC:\\Program Files (x86)\\Jenkins\\jobs\\python-test1\\workspace>python -V \nPython 3.3.0\n```\n\n```\nC:\\Program Files (x86)\\Jenkins\\jobs\\python-test1\\workspace>exit 0 \n[workspace] $ python C:\\Windows\\TEMP\\hudson581448604896317111.py\nRequests Version: 1.2.0\nTraceback (most recent call last):\n File \"C:\\Python33\\lib\\site-packages\\requests\\packages\\urllib3\\connectionpool.py\", line 421, in urlopen\n body=body, headers=headers)\n File \"C:\\Python33\\lib\\site-packages\\requests\\packages\\urllib3\\connectionpool.py\", line 273, in _make_request\n conn.request(method, url, **httplib_request_kw)\n File \"C:\\Python33\\lib\\http\\client.py\", line 1049, in request\n self._send_request(method, url, body, headers)\n File \"C:\\Python33\\lib\\http\\client.py\", line 1087, in _send_request\n self.endheaders(body)\n File \"C:\\Python33\\lib\\http\\client.py\", line 1045, in endheaders\n self._send_output(message_body)\n File \"C:\\Python33\\lib\\http\\client.py\", line 890, in _send_output\n self.send(msg)\n File \"C:\\Python33\\lib\\http\\client.py\", line 828, in send\n self.connect()\n File \"C:\\Python33\\lib\\site-packages\\requests\\packages\\urllib3\\connectionpool.py\", line 104, in connect\n ssl_version=resolved_ssl_version)\n File \"C:\\Python33\\lib\\site-packages\\requests\\packages\\urllib3\\util.py\", line 329, in ssl_wrap_socket\n return context.wrap_socket(sock, server_hostname=server_hostname)\n File \"C:\\Python33\\lib\\ssl.py\", line 210, in wrap_socket\n _context=self)\n File \"C:\\Python33\\lib\\ssl.py\", line 310, in __init__\n raise x\n File \"C:\\Python33\\lib\\ssl.py\", line 306, in __init__\n self.do_handshake()\n File \"C:\\Python33\\lib\\ssl.py\", line 513, in do_handshake\n self._sslobj.do_handshake()\nConnectionResetError: [WinError 10054] An existing connection was forcibly closed by the remote host\n\nDuring handling of the above exception, another exception occurred:\n\nTraceback (most recent call last):\n File \"C:\\Python33\\lib\\site-packages\\requests\\adapters.py\", line 211, in send\n timeout=timeout\n File \"C:\\Python33\\lib\\site-packages\\requests\\packages\\urllib3\\connectionpool.py\", line 465, in urlopen\n raise MaxRetryError(self, url, e)\nrequests.packages.urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='analysiscenter.veracode.com', port=443): Max retries exceeded with url: /api/4.0/getapplist.do (Caused by <class 'ConnectionResetError'>: [WinError 10054] An existing connection was forcibly closed by the remote host)\n\nDuring handling of the above exception, another exception occurred:\n\nTraceback (most recent call last):\n File \"C:\\Windows\\TEMP\\hudson581448604896317111.py\", line 11, in <module>\n print(v.get_app_list())\n File \"c:/tfs/Vertafore_TFSDev/CQ/python/veracode\\apiwrapper.py\", line 206, in get_app_list\n {}\n File \"c:/tfs/Vertafore_TFSDev/CQ/python/veracode\\apiwrapper.py\", line 57, in request\n r = requests.get(URL, params=data, auth=username_password)\n File \"C:\\Python33\\lib\\site-packages\\requests\\api.py\", line 55, in get\n return request('get', url, **kwargs)\n File \"C:\\Python33\\lib\\site-packages\\requests\\api.py\", line 44, in request\n return session.request(method=method, url=url, **kwargs)\n File \"C:\\Python33\\lib\\site-packages\\requests\\sessions.py\", line 354, in request\n resp = self.send(prep, **send_kwargs)\n File \"C:\\Python33\\lib\\site-packages\\requests\\sessions.py\", line 460, in send\n r = adapter.send(request, **kwargs)\n File \"C:\\Python33\\lib\\site-packages\\requests\\adapters.py\", line 246, in send\n raise ConnectionError(e)\nrequests.exceptions.ConnectionError: HTTPSConnectionPool(host='analysiscenter.veracode.com', port=443): Max retries exceeded with url: /api/4.0/getapplist.do (Caused by <class 'ConnectionResetError'>: [WinError 10054] An existing connection was forcibly closed by the remote host)\nBuild step 'Execute Python script' marked build as failure\nFinished: FAILURE\n```\n",
"Is the URL meant to be publicly accessible?\nI get timeouts in every way I try to access it,\nso I assume it that the timeout is expected by your testsuite.\n\nOn python3.3 the ssl module raises a `ConnectionResetError`, while on python3.2 it's a `socket.error`.\nBoth are wrapped in `requests.exceptions.ConnectionError`.\n\nCould it be, that your testsuite is somewhere checking the message of the\nexception for \"socket.error\"?\n",
"I _was_ checking for socket.error, however, this isn't the issue (I tested with and without it and it still causes the same failure.) Theoretically, according to PEP 3151, it shouldn't be an issue either, because socket.error is an alias for the new OSError. (right?) http://docs.python.org/dev/whatsnew/3.3.html\n\nUnfortunately this isn't a public API. :(\n\nBased on the error I'm seeing, I'm certain this has to be my code... :|\n\nThank you so much for your kind help. You guys are really awesome. :)\n\nI hope to have this code open sourced before too long here, so I'll update this thread when that happens. Maybe we can get to the bottom of this...\n",
"I'm hitting the same problem with Requests 1.2.3 running on Python3.3.\n",
"@AvivLander Have you tried the solution proposed in #1418?\n",
"@Lukasa Thanks for the suggested solution. Although, I'm not using SSL in my requests. \n",
"Really? You're seeing this error without using SSL? I'm not entirely sure that's possible. Can you copy your traceback?\n",
"@Lukasa, It very well could be an error with the script and not the library. The odd thing here is that the address in question is completely accessible.\n\nHere's a traceback:\n\n```\nTraceback (most recent call last):\n File \"test.py\", line 212, in <module>\n HTTPtests = requests.get(url + '&skip=' + str(skip) + '&limit=' + str(baseBatch), auth=(username, password), timeout=None)\n File \"/usr/local/lib/python3.3/dist-packages/requests-1.2.3-py3.3.egg/requests/api.py\", line 55, in get\n return request('get', url, **kwargs)\n File \"/usr/local/lib/python3.3/dist-packages/requests-1.2.3-py3.3.egg/requests/api.py\", line 44, in request\n return session.request(method=method, url=url, **kwargs)\n File \"/usr/local/lib/python3.3/dist-packages/requests-1.2.3-py3.3.egg/requests/sessions.py\", line 335, in request\n resp = self.send(prep, **send_kwargs)\n File \"/usr/local/lib/python3.3/dist-packages/requests-1.2.3-py3.3.egg/requests/sessions.py\", line 438, in send\n r = adapter.send(request, **kwargs)\n File \"/usr/local/lib/python3.3/dist-packages/requests-1.2.3-py3.3.egg/requests/adapters.py\", line 327, in send\n raise ConnectionError(e)\nrequests.exceptions.ConnectionError: HTTPConnectionPool(host='internal-VPC-blablabla.com', port=12345): Max retries exceeded with url: /test/_design/test/_view/test?group_level=2&startkey=[%221%22]&endkey=[%222%22]&skip=5000&limit=500 (Caused by <class 'http.client.BadStatusLine'>: '')\n\n```\n",
"So the problem here is right at the end of the exception text: the original exception is [`http.client.BadStatusLine`](http://docs.python.org/3.0/library/http.client.html#http.client.BadStatusLine). Can you either a) make the request from your web browser dev tools and check the status line in the response; or b) do so using Wireshark?\n",
"So there's actually an error before:\n\n```\nFile \"/usr/local/lib/python3.3/dist-packages/requests-1.2.3-py3.3.egg\n/requests/packages/urllib3/connectionpool.py\", line 288, in _make_request\n httplib_response = conn.getresponse(buffering=True)\nTypeError: getresponse() got an unexpected keyword argument 'buffering'\n```\n",
"It should not be possible to hit that error. urllib3 has had a try..except block catching that exception since Requests v0.13.2. Try reinstalling Requests?\n",
"The issue was related to urllib3 and AWS ELB. It was resolved when routing the request without the ELB. Hardly a desirable option... Regardless, thanks for your help @Lukasa .\n\n\"First, ELB has internal \"feature\" of closing all incoming HTTP connections that do not get response within 60 seconds. I.e. if your client executes GET ... and waits for more then 60 seconds - ELB will close the connection. This timeout is currently unconfigurable through amazon API and even not advertised in Amazon docs. \"\nhttp://tech.zarmory.com/2013/02/handling-tmeouts-with-amazon-elastic.html\n",
"@AvivLander Glad you managed to get to the bottom of this.\n",
"I still get the <b>TypeError: getresponse() got an unexpected keyword argument 'buffering'</b> for some reason, even though I have Requests 1.2.3 and Python 3.3.1 \n\nI have the following stack trace:\n\n```\nTraceback (most recent call last):\n File \"/usr/local/lib/python3.3/dist-packages/requests/packages/urllib3/connectionpool.py\", line 288, in _make_request\n httplib_response = conn.getresponse(buffering=True)\nTypeError: getresponse() got an unexpected keyword argument 'buffering'\n\nDuring handling of the above exception, another exception occurred:\n\nTraceback (most recent call last):\n File \"/usr/local/lib/python3.3/dist-packages/requests/packages/urllib3/connectionpool.py\", line 428, in urlopen\n body=body, headers=headers)\n File \"/usr/local/lib/python3.3/dist-packages/requests/packages/urllib3/connectionpool.py\", line 290, in _make_request\n httplib_response = conn.getresponse()\n File \"/usr/lib/python3.3/http/client.py\", line 1143, in getresponse\n response.begin()\n File \"/usr/lib/python3.3/http/client.py\", line 354, in begin\n version, status, reason = self._read_status()\n File \"/usr/lib/python3.3/http/client.py\", line 316, in _read_status\n line = str(self.fp.readline(_MAXLINE + 1), \"iso-8859-1\")\n File \"/usr/lib/python3.3/socket.py\", line 297, in readinto\n return self._sock.recv_into(b)\nConnectionResetError: [Errno 104] Connection reset by peer\n\nDuring handling of the above exception, another exception occurred:\n\nTraceback (most recent call last):\n File \"/usr/local/lib/python3.3/dist-packages/requests/adapters.py\", line 292, in send\n timeout=timeout\n File \"/usr/local/lib/python3.3/dist-packages/requests/packages/urllib3/connectionpool.py\", line 474, in urlopen\n raise MaxRetryError(self, url, e)\nrequests.packages.urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='la.wikipedia.org', port=80): Max retries exceeded with url: /w/api.php?bltitle=Britannia+Minor&list=backlinks&action=query&format=json&maxlag=60&blnamespace=0&blredirect=true&bllimit=500 (Caused by <class 'ConnectionResetError'>: [Errno 104] Connection reset by peer)\n\nDuring handling of the above exception, another exception occurred:\n\nTraceback (most recent call last):\n File \"remote_coords_finder_5.py\", line 185, in <module>\n {'list': 'backlinks', 'bltitle': output['title'], 'blnamespace': 0, 'bllimit': 500, 'blredirect': 'true'}, 'backlinks', 'blcontinue'):\n File \"remote_coords_finder_5.py\", line 55, in query\n response = requests.get('http://' + language + '.wikipedia.org/w/api.php', params=req, headers=headers, timeout=60)\n File \"/usr/local/lib/python3.3/dist-packages/requests/api.py\", line 55, in get\n return request('get', url, **kwargs)\n File \"/usr/local/lib/python3.3/dist-packages/requests/api.py\", line 44, in request\n return session.request(method=method, url=url, **kwargs)\n File \"/usr/local/lib/python3.3/dist-packages/requests/sessions.py\", line 335, in request\n resp = self.send(prep, **send_kwargs)\n File \"/usr/local/lib/python3.3/dist-packages/requests/sessions.py\", line 438, in send\n r = adapter.send(request, **kwargs)\n File \"/usr/local/lib/python3.3/dist-packages/requests/adapters.py\", line 327, in send\n raise ConnectionError(e)\nrequests.exceptions.ConnectionError: HTTPConnectionPool(host='la.wikipedia.org', port=80): Max retries exceeded with url: /w/api.php?bltitle=Britannia+Minor&list=backlinks&action=query&format=json&maxlag=60&blnamespace=0&blredirect=true&bllimit=500 (Caused by <class 'ConnectionResetError'>: [Errno 104] Connection reset by peer)\n```\n",
"@9emE0iL18gxCqLT Are you using AWS ELB?\n",
"@Lukasa No. Just a locally run Python script that does simple HTTP requests. I'm on a Kubuntu GNU/Linux x86_64 desktop.\n",
"That's genuinely bizarre. Can you try reinstalling your copy of Requests? (You'll have to delete it first). There's just no way you can hit that exception, because it's inside a try/except block for exactly that purpose.\n",
"@Lukasa I've reinstalled requests after I deleted it first, and installed it with <b>sudo pip install git+git://github.com/kennethreitz/requests.git</b> . I get exactly the same TypeError, that is: \n\n```\nTraceback (most recent call last):\n File \"/usr/local/lib/python3.3/dist-packages/requests/packages/urllib3/connectionpool.py\", line 291, in _make_request\n httplib_response = conn.getresponse(buffering=True)\nTypeError: getresponse() got an unexpected keyword argument 'buffering'\netc...\n```\n",
"@Lukasa httplib.HTTPConnection.getresponse() doesn't accept any keyword arguments in Python 3.3 \n\nSee:\n1) http://docs.python.org/3.3/library/http.client.html?highlight=httpconnection#http.client.HTTPConnection.getresponse\n2) http://hg.python.org/cpython/file/3.3/Lib/http/client.py#l1101\n\nThe comments are incorrect in /usr/local/lib/python3.3/dist-packages/requests/packages/urllib3/connectionpool.py line 290:\n\n``` python\n try: # Python 2.7+, use buffering of HTTP responses\n httplib_response = conn.getresponse(buffering=True)\n except TypeError: # Python 2.6 and older\n httplib_response = conn.getresponse()\n```\n\nI'll try to send a fix to urllib3.\n",
"I agree that the comments are incorrect, but the except block should still catch the TypeError, which is why I'm confused. =)\n",
"> but the except block should still catch the TypeError\n\nWell, it is caught, however another exception occurs. For @9emE0iL18gxCqLT it's `ConnectionResetError`\nIn my case it's `BadStatusLine`\n\n```\nTraceback (most recent call last):\n File \"/Users/prophet/.envs/djangodash2013/lib/python3.3/site-packages/requests/packages/urllib3/connectionpool.py\", line 428, in urlopen\n body=body, headers=headers)\n File \"/Users/prophet/.envs/djangodash2013/lib/python3.3/site-packages/requests/packages/urllib3/connectionpool.py\", line 290, in _make_request\n httplib_response = conn.getresponse()\n File \"/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/http/client.py\", line 1131, in getresponse\n response.begin()\n File \"/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/http/client.py\", line 354, in begin\n version, status, reason = self._read_status()\n File \"/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/http/client.py\", line 324, in _read_status\n raise BadStatusLine(line)\nhttp.client.BadStatusLine: ''\n```\n",
"Does anyone have a URL that they can consistently reproduce this with? I've tried about 10 different websites and cannot get either of those exceptions to fire.\n",
"I've never had any luck reproducing this.\n",
"Hi guys,\n\nI have the same issue here, in the connectionpool.py, line 311, when using Requests 2.1.0:\n\n```\n try:\n try: # Python 2.7+, use buffering of HTTP responses\n httplib_response = conn.getresponse(buffering=True)\n except TypeError: # Python 2.6 and older\n httplib_response = conn.getresponse()\n except SocketTimeout:\n raise ReadTimeoutError(\n self, url, \"Read timed out. (read timeout=%s)\" % read_timeout)\n```\n\nI always get this error, apparently when the connection is not working (I'm currently connecting to an internal ip address, but there's nothing listening on the ip because of some error in the Philips Hue device). If I type in a wrong ip, I don't get this error, then my program just waits a very long time. \n\nIf I can help debugging something, let me know. It's hard for me to reproduce, since the error is not always there, but I can.\n",
"> I always get this error\n\nWhich error? Can you post a stack trace? There have been a couple different ones posted here that are not exactly the same.\n\nFor what it's worth, I still have no way to reproduce this. :(\n"
] |
https://api.github.com/repos/psf/requests/issues/1288
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1288/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1288/comments
|
https://api.github.com/repos/psf/requests/issues/1288/events
|
https://github.com/psf/requests/pull/1288
| 12,784,976 |
MDExOlB1bGxSZXF1ZXN0NDk3MDA3OA==
| 1,288 |
source_address support (rough)
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/516893?v=4",
"events_url": "https://api.github.com/users/jessesherlock/events{/privacy}",
"followers_url": "https://api.github.com/users/jessesherlock/followers",
"following_url": "https://api.github.com/users/jessesherlock/following{/other_user}",
"gists_url": "https://api.github.com/users/jessesherlock/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/jessesherlock",
"id": 516893,
"login": "jessesherlock",
"node_id": "MDQ6VXNlcjUxNjg5Mw==",
"organizations_url": "https://api.github.com/users/jessesherlock/orgs",
"received_events_url": "https://api.github.com/users/jessesherlock/received_events",
"repos_url": "https://api.github.com/users/jessesherlock/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/jessesherlock/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jessesherlock/subscriptions",
"type": "User",
"url": "https://api.github.com/users/jessesherlock",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 2 |
2013-04-04T04:14:02Z
|
2021-09-08T23:08:18Z
|
2013-04-04T05:11:42Z
|
NONE
|
resolved
|
First pass on source_address support (2.7 only).
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4",
"events_url": "https://api.github.com/users/kennethreitz/events{/privacy}",
"followers_url": "https://api.github.com/users/kennethreitz/followers",
"following_url": "https://api.github.com/users/kennethreitz/following{/other_user}",
"gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/kennethreitz",
"id": 119893,
"login": "kennethreitz",
"node_id": "MDQ6VXNlcjExOTg5Mw==",
"organizations_url": "https://api.github.com/users/kennethreitz/orgs",
"received_events_url": "https://api.github.com/users/kennethreitz/received_events",
"repos_url": "https://api.github.com/users/kennethreitz/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/kennethreitz/starred{/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/1288/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1288/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/1288.diff",
"html_url": "https://github.com/psf/requests/pull/1288",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/1288.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/1288"
}
| true |
[
"This is what connection adapters are for.\n",
"Thanks, I'll have a look at connection adapters\n"
] |
https://api.github.com/repos/psf/requests/issues/1287
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1287/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1287/comments
|
https://api.github.com/repos/psf/requests/issues/1287/events
|
https://github.com/psf/requests/issues/1287
| 12,753,026 |
MDU6SXNzdWUxMjc1MzAyNg==
| 1,287 |
Cookies won't get deleted after update to 1.X
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/642195?v=4",
"events_url": "https://api.github.com/users/oczkers/events{/privacy}",
"followers_url": "https://api.github.com/users/oczkers/followers",
"following_url": "https://api.github.com/users/oczkers/following{/other_user}",
"gists_url": "https://api.github.com/users/oczkers/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/oczkers",
"id": 642195,
"login": "oczkers",
"node_id": "MDQ6VXNlcjY0MjE5NQ==",
"organizations_url": "https://api.github.com/users/oczkers/orgs",
"received_events_url": "https://api.github.com/users/oczkers/received_events",
"repos_url": "https://api.github.com/users/oczkers/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/oczkers/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/oczkers/subscriptions",
"type": "User",
"url": "https://api.github.com/users/oczkers",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 5 |
2013-04-03T13:48:27Z
|
2021-09-09T04:00:39Z
|
2013-04-05T03:22:39Z
|
CONTRIBUTOR
|
resolved
|
Requests ignores `Set-Cookie: cookie_user=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; path=/; domain=.netload.in`
full log
```
HTTP/1.1 302 Found
Set-Cookie: PHPSESSID=2a4eed6c32fdf347d77dd3aa07596766; path=/
Set-Cookie: cookie_user=182018%3A75e5d076a5077cc37cf0822c7e49dbb5; expires=Wed, 10-Apr-2013 13:26:08 GMT; path=/; domain=.netload.in
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
Location: /index.php
Content-type: text/html
Content-Length: 0
Date: Wed, 03 Apr 2013 13:26:08 GMT
Server: nginx/1.2.4
GET /index.php?id=15 HTTP/1.1
Host: netload.in
Accept-Language: en;q=0.8
Accept-Encoding: deflate, gzip, x-gzip, identity, *;q=0
Keep-Alive: 300
Accept: text/html, application/xml;q=0.9, application/xhtml+xml, image/png, image/jpeg, image/gif, image/x-xbitmap, */*;q=0.1
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/26.0.1410.43 Safari/537.31
Accept-Charset: utf-8, iso-8859-1, utf-16, *;q=0.1
Connection: Keep-Alive, TE
Cookie: cookie_user=182018%3A75e5d076a5077cc37cf0822c7e49dbb5; PHPSESSID=2a4eed6c32fdf347d77dd3aa07596766
TE: deflate, gzip, chunked, identity, trailers
HTTP/1.1 302 Found
Set-Cookie: cookie_user=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; path=/; domain=.netload.in
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
Location: index.php
Content-type: text/html
Content-Length: 0
Date: Wed, 03 Apr 2013 13:26:08 GMT
Server: nginx/1.2.4
GET /index.php HTTP/1.1
Host: netload.in
Accept-Language: en;q=0.8
Accept-Encoding: deflate, gzip, x-gzip, identity, *;q=0
Keep-Alive: 300
Accept: text/html, application/xml;q=0.9, application/xhtml+xml, image/png, image/jpeg, image/gif, image/x-xbitmap, */*;q=0.1
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/26.0.1410.43 Safari/537.31
Accept-Charset: utf-8, iso-8859-1, utf-16, *;q=0.1
Connection: Keep-Alive, TE
Cookie: cookie_user=182018%3A75e5d076a5077cc37cf0822c7e49dbb5; PHPSESSID=2a4eed6c32fdf347d77dd3aa07596766
TE: deflate, gzip, chunked, identity, trailers
```
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4",
"events_url": "https://api.github.com/users/kennethreitz/events{/privacy}",
"followers_url": "https://api.github.com/users/kennethreitz/followers",
"following_url": "https://api.github.com/users/kennethreitz/following{/other_user}",
"gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/kennethreitz",
"id": 119893,
"login": "kennethreitz",
"node_id": "MDQ6VXNlcjExOTg5Mw==",
"organizations_url": "https://api.github.com/users/kennethreitz/orgs",
"received_events_url": "https://api.github.com/users/kennethreitz/received_events",
"repos_url": "https://api.github.com/users/kennethreitz/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/kennethreitz/starred{/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/1287/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1287/timeline
| null |
completed
| null | null | false |
[
"Could you provide the output from the following? `python -c 'import requests; print(requests.__version__)'`\n",
"It's latest development version (pulled from git few hours ago).\n\n``` python\n# python -c 'import requests; print(requests.__version__)'\n1.2.0\n```\n\nSteps to reproduce error (requests is sending GETs with undeleted cookie and server is bouncing it so we get TooManyRedirects error).\n\n``` python\nimport requests\n\ndata = {'txtuser': '182018', 'txtpass': 'hl16AH', 'txtcheck': 'login', 'txtlogin': ''}\nrequests.post('http://netload.in/index.php', data)\n```\n",
"@gazpachoking any insight? I'm going to take a look at this now\n",
"Also, for the record, the following reproduces this well:\n\n``` python\nimport requests\n\ns = requests.Session()\ns.get('https://httpbin.org/cookies/set', params={'cookiename': 'value'})\nprint(s.cookies['cookiename'])\n# => value\ns.get('https://httpbin.org/response-headers', params={'Set-Cookie': 'cookiename=deletes; expires=Thu, 01-Jan-1970 00:00:01 GMT; domain=httpbin.org'})\nprint(s.cookies['cookiename'])\n# => value\n```\n",
"So as I mentioned to @gazpachoking on IRC, using pdb, I seem to have traced this to an issue in cookielib which makes absolutely no sense. If this was working prior to 1.x there should be no reason for it to have stopped working.\n\nFor future adventurers though here are some relevant snips:\n\n```\n(Pdb) p ns_hdrs\n['httpbin=cookie; expires=Thu, 01-Jan-1970 00:00:01 GMT; path=/; domain=httpbin.org']\n(Pdb) p parse_ns_headers(ns_hdrs)\n[[('httpbin', 'cookie'), ('expires', 1), ('path', '/'), ('domain', 'httpbin.org'), ('version', '0')]]\n(Pdb) p self._cookies_from_attrs_set(parse_ns_headers(ns_hdrs), request)\n[]\n(Pdb) where\n /usr/lib64/python2.6/bdb.py(368)run()\n-> exec cmd in globals, locals\n <string>(1)<module>()\n /home/icordasc/sandbox/requests/requests/sessions.py(365)get()\n-> return self.request('GET', url, **kwargs)\n /home/icordasc/sandbox/requests/requests/sessions.py(350)request()\n-> resp = self.send(prep, **send_kwargs)\n /home/icordasc/sandbox/requests/requests/sessions.py(456)send()\n-> r = adapter.send(request, **kwargs)\n /home/icordasc/sandbox/requests/requests/adapters.py(256)send()\n-> r = self.build_response(request, resp)\n /home/icordasc/sandbox/requests/requests/adapters.py(125)build_response()\n-> extract_cookies_to_jar(response.cookies, req, resp)\n /home/icordasc/sandbox/requests/requests/cookies.py(105)extract_cookies_to_jar()\n-> jar.extract_cookies(res, req)\n /usr/lib64/python2.6/cookielib.py(1637)extract_cookies()\n-> for cookie in self.make_cookies(response, request):\n> /usr/lib64/python2.6/cookielib.py(1581)make_cookies()\n-> self._process_rfc2109_cookies(ns_cookies)\n```\n"
] |
https://api.github.com/repos/psf/requests/issues/1286
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1286/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1286/comments
|
https://api.github.com/repos/psf/requests/issues/1286/events
|
https://github.com/psf/requests/pull/1286
| 12,722,303 |
MDExOlB1bGxSZXF1ZXN0NDk2MjEwMg==
| 1,286 |
Consistent String Encoding
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4",
"events_url": "https://api.github.com/users/Lukasa/events{/privacy}",
"followers_url": "https://api.github.com/users/Lukasa/followers",
"following_url": "https://api.github.com/users/Lukasa/following{/other_user}",
"gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Lukasa",
"id": 1382556,
"login": "Lukasa",
"node_id": "MDQ6VXNlcjEzODI1NTY=",
"organizations_url": "https://api.github.com/users/Lukasa/orgs",
"received_events_url": "https://api.github.com/users/Lukasa/received_events",
"repos_url": "https://api.github.com/users/Lukasa/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Lukasa",
"user_view_type": "public"
}
|
[
{
"color": "e102d8",
"default": false,
"description": null,
"id": 117745,
"name": "Planned",
"node_id": "MDU6TGFiZWwxMTc3NDU=",
"url": "https://api.github.com/repos/psf/requests/labels/Planned"
}
] |
closed
| true |
{
"avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4",
"events_url": "https://api.github.com/users/Lukasa/events{/privacy}",
"followers_url": "https://api.github.com/users/Lukasa/followers",
"following_url": "https://api.github.com/users/Lukasa/following{/other_user}",
"gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Lukasa",
"id": 1382556,
"login": "Lukasa",
"node_id": "MDQ6VXNlcjEzODI1NTY=",
"organizations_url": "https://api.github.com/users/Lukasa/orgs",
"received_events_url": "https://api.github.com/users/Lukasa/received_events",
"repos_url": "https://api.github.com/users/Lukasa/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Lukasa",
"user_view_type": "public"
}
|
[
{
"avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4",
"events_url": "https://api.github.com/users/Lukasa/events{/privacy}",
"followers_url": "https://api.github.com/users/Lukasa/followers",
"following_url": "https://api.github.com/users/Lukasa/following{/other_user}",
"gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Lukasa",
"id": 1382556,
"login": "Lukasa",
"node_id": "MDQ6VXNlcjEzODI1NTY=",
"organizations_url": "https://api.github.com/users/Lukasa/orgs",
"received_events_url": "https://api.github.com/users/Lukasa/received_events",
"repos_url": "https://api.github.com/users/Lukasa/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Lukasa",
"user_view_type": "public"
}
] | null | 14 |
2013-04-02T19:55:53Z
|
2021-09-08T23:11:04Z
|
2013-04-16T19:53:11Z
|
MEMBER
|
resolved
|
Over the last few months there have been multiple issues raised about problems with string encodings. At best Requests is being inconsistent (#1250), and at worst perfectly valid combinations of input are failing (#1279).
I think it's time for Requests to enforce a very consistent behaviour when it comes to string encodings. We need to establish what format the data will be in when we pass it to urllib3, and where we're going to transform it. We need to be consistent so that when users inevitably encounter errors, we can make it very clear what they should have passed in.
@shazow has said that urllib3 wants the following input: bytes in the body, and native strings everywhere else. This defines our interface to urllib3.
To keep in sync with the above, we need to do the following things.
- On Python 2, any unicode strings anywhere on a `PreparedRequest` other than the body should be encoded as UTF-8. The body should also be encoded as UTF-8 if it is a unicode string (unlikely, but unless we can guarantee it won't be we should do the right thing).
- On Python 3, any bytestrings in a PreparedRequest should be decoded to unicode strings. Because we cannot make any intelligent guess, we will use Python's (stupid, stupid, _stupid_) locale-based decoding. This will almost-certainly throw exceptions if an incorrect encoding has been used, alerting the user.
Thoughts?
|
{
"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/1286/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1286/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/1286.diff",
"html_url": "https://github.com/psf/requests/pull/1286",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/1286.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/1286"
}
| true |
[
"One thought I have is that I'm glad you didn't assign this to me. ;)\n\nThe only things I can think of are\n- to make this a dumb function that lives in `requests/utils.py` and will do it for you.\n- heavily document this so users might handle the encoding themselves or at least be able to find out why they're getting this new exception\n- perhaps we should have our own exception so that people will be lead back to this area of the documentation mentioned above\n",
"Ok, so I've taken a first-pass at this. Right now this doesn't do anything about coercing the `body` parameter to bytes, which it needs to.\n\nI want lots of feedback on this. In particular, at some point @kennethreitz is going to need to step in and make an API decision. This change is a massive API change and affects the output of the PreparedRequest. I think it's worth it, but if @kennethreitz doesn't then I'm happy to stop work on this.\n",
"Nice work. This mess with encodings should really be cleaned up.\n",
"It's a lot of work, but I definitely think it is worth it, regardless of the pains this will inflict on the API.\n",
"Good work. +1 for getting this sorted and consistent ASAP.\n",
"I'm no longer convinced by the approach I've taken here. I wonder if it might be better to use unicode internally the whole way through, and then encode at the Transport Adapter layer on Python 2.\n",
"Ugh, actually, that'll be a pain. I'd have to write a compatibility function for string literals to make that work, because Python 3.2 doesn't support `u''` literals. CURSE YOU PYTHON 3.2!\n",
"@Lukasa, the binary can't hear you.\n",
"I think things are working pretty well today and will just magically work perfectly once everyone's on Python 3. \n\nAssuming I'm correct, I think it's a good approach.\n",
"If you are prepared to wait for that day, so am I. =)\n",
"I think it's coming sooner rather than later. :)\n",
"Sounds good. I'll leave my branch on my fork as a reference in case anyone bumps into any problems.\n",
"Thanks for this work, by the way. Having conversations around this stuff, especially with code attached, is super important.\n",
"Always happy to do it. =)\n"
] |
https://api.github.com/repos/psf/requests/issues/1285
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1285/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1285/comments
|
https://api.github.com/repos/psf/requests/issues/1285/events
|
https://github.com/psf/requests/issues/1285
| 12,719,298 |
MDU6SXNzdWUxMjcxOTI5OA==
| 1,285 |
Fail fast on HTTPS calls with the ssl module unavailable
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/240830?v=4",
"events_url": "https://api.github.com/users/sigmavirus24/events{/privacy}",
"followers_url": "https://api.github.com/users/sigmavirus24/followers",
"following_url": "https://api.github.com/users/sigmavirus24/following{/other_user}",
"gists_url": "https://api.github.com/users/sigmavirus24/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/sigmavirus24",
"id": 240830,
"login": "sigmavirus24",
"node_id": "MDQ6VXNlcjI0MDgzMA==",
"organizations_url": "https://api.github.com/users/sigmavirus24/orgs",
"received_events_url": "https://api.github.com/users/sigmavirus24/received_events",
"repos_url": "https://api.github.com/users/sigmavirus24/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/sigmavirus24/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/sigmavirus24/subscriptions",
"type": "User",
"url": "https://api.github.com/users/sigmavirus24",
"user_view_type": "public"
}
|
[
{
"color": "02e10c",
"default": false,
"description": null,
"id": 76800,
"name": "Feature Request",
"node_id": "MDU6TGFiZWw3NjgwMA==",
"url": "https://api.github.com/repos/psf/requests/labels/Feature%20Request"
}
] |
closed
| true |
{
"avatar_url": "https://avatars.githubusercontent.com/u/240830?v=4",
"events_url": "https://api.github.com/users/sigmavirus24/events{/privacy}",
"followers_url": "https://api.github.com/users/sigmavirus24/followers",
"following_url": "https://api.github.com/users/sigmavirus24/following{/other_user}",
"gists_url": "https://api.github.com/users/sigmavirus24/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/sigmavirus24",
"id": 240830,
"login": "sigmavirus24",
"node_id": "MDQ6VXNlcjI0MDgzMA==",
"organizations_url": "https://api.github.com/users/sigmavirus24/orgs",
"received_events_url": "https://api.github.com/users/sigmavirus24/received_events",
"repos_url": "https://api.github.com/users/sigmavirus24/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/sigmavirus24/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/sigmavirus24/subscriptions",
"type": "User",
"url": "https://api.github.com/users/sigmavirus24",
"user_view_type": "public"
}
|
[
{
"avatar_url": "https://avatars.githubusercontent.com/u/240830?v=4",
"events_url": "https://api.github.com/users/sigmavirus24/events{/privacy}",
"followers_url": "https://api.github.com/users/sigmavirus24/followers",
"following_url": "https://api.github.com/users/sigmavirus24/following{/other_user}",
"gists_url": "https://api.github.com/users/sigmavirus24/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/sigmavirus24",
"id": 240830,
"login": "sigmavirus24",
"node_id": "MDQ6VXNlcjI0MDgzMA==",
"organizations_url": "https://api.github.com/users/sigmavirus24/orgs",
"received_events_url": "https://api.github.com/users/sigmavirus24/received_events",
"repos_url": "https://api.github.com/users/sigmavirus24/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/sigmavirus24/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/sigmavirus24/subscriptions",
"type": "User",
"url": "https://api.github.com/users/sigmavirus24",
"user_view_type": "public"
}
] | null | 13 |
2013-04-02T18:45:56Z
|
2021-09-09T04:00:33Z
|
2013-04-25T18:41:58Z
|
CONTRIBUTOR
|
resolved
|
While hanging around the IRC channel today, a user came in with an HTTPS request that was not completing. It turned out that he didn't have ssl configured properly on his python 3 installation (here's looking at you ArchLinux).
It would seem to me that failing quickly as opposed to just hanging there would be far more useful. Admittedly you would hope an advanced user would know if they have SSL installed or enabled, but someone just starting out might not. I know urllib3 smothers the Exception they get when importing ssl, but would anyone object to throwing a custom Exception when users try to make HTTPS requests?
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4",
"events_url": "https://api.github.com/users/Lukasa/events{/privacy}",
"followers_url": "https://api.github.com/users/Lukasa/followers",
"following_url": "https://api.github.com/users/Lukasa/following{/other_user}",
"gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Lukasa",
"id": 1382556,
"login": "Lukasa",
"node_id": "MDQ6VXNlcjEzODI1NTY=",
"organizations_url": "https://api.github.com/users/Lukasa/orgs",
"received_events_url": "https://api.github.com/users/Lukasa/received_events",
"repos_url": "https://api.github.com/users/Lukasa/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Lukasa",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/1285/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1285/timeline
| null |
completed
| null | null | false |
[
"I'm all for it. =)\n",
"@sigmavirus24 \nCould you provide more details/a transcription of the IRC conversation?\nI created a really minimal VM of ArchLinux (base installation + python from the repos + requests from pip and from the repos) and everything worked fine.\n",
"@t-8ch\n\nThe following is the start of the conversation: \nhttps://botbot.me/freenode/python-requests/msg/2523881/\n\nYou can see I worked through it with upmauro until we realized that his \nversion of python 3 had been compiled without support for `ssl`. \n(https://botbot.me/freenode/python-requests/msg/2523881/ to save you some \nreading)\n\nI know that in one of the recent changes I saw in urllib3 the following:\n\n``` python\ntry:\n import ssl\nexcept ImportError:\n ssl = None\n```\n\nI suspect the fact that no exception was raised was because of the silent \nfailure of importing the `ssl` module. I obviously have to attempt to build a \nsystem in which the ssl module would be unavailable in a version of python to \nbe absolutely certain, but judging by the behaviour it seems a fair \nconclusion.\n",
"I can reproduce this now. The mentioned URL also hangs for me on python3.\nImporting ssl on the other hand works just fine.\nOn python2 it takes a bit of time but works in the end.\n\nPython3 on ArchLinux is compiled with ssl:\n\n```\n[~]$ ldd /usr/lib/python3.3/lib-dynload/_ssl.cpython-33m.so \n libssl.so.1.0.0 => /usr/lib/libssl.so.1.0.0 (0x00007f760ef7c000)\n # [..]\n[~]$ pacman -Qi python\nName : python\nVersion : 3.3.0-3\n# [..]\nDepends On : expat bzip2 gdbm openssl libffi zlib\n# [..]\n```\n\nIf I remove `openssl` it dies while importing requests.\n",
"The problem is upmauro has disappeared so I don't know if we'll be able to \nconfirm any of these details. The other issue is that setting a timeout did \nnot work for him.\n",
"I'll look into the issue of the hanging request tomorrow.\nI assume there was some miscommunication between upmauro and you because ArchLinux without openssl is quite unusable (no SSH, no pacman).\n",
"No. ArchLinux had SSL. His version of Python 2 had support for it. His version \nof Python 3 did not.\n",
"The version in the official repos definitely has ssl support.\n",
"Then he did something to install python 3 without ssl support. What, we may \nnever know, but it remains an issue, and python compiled without ssl support \nis apparently a common issue. If it doesn't fail fast, that is a design flaw \nin my candid opinion. I'll figure out how to reproduce the environment and \nupdate the ticket when I do.\n",
"You may want to keep Appengine in mind, where no ssl module is available but `HTTPSConnection` is provided.\n\nUrllib3 should fail the moment one tries to issue a https request on an unsupported platform (determined by feature detection).\nThe many import-ssl-module bugreports for 1.1.0 were caused by a bug I introduced where the ssl module was accessed while importing urllib3 in general. This has been fixed.\n",
"> You may want to keep Appengine in mind, where no ssl module is available but `HTTPSConnection` is provided.\n\nWe don't support Appengine. =)\n",
"Yeah, I am aware of this.\nTo clarify my previous post: urllib3 _already does_ the feature detection and fails if one tries to do HTTPS on unsupported platforms. (Including the fallback on Appengine)\nThe issue upmauro faced also occurs with plain httplib on python3 (works on python2):\n\n``` py\ntry:\n import http.client as lib\nexcept ImportError:\n import httplib as lib\n\nconn = lib.HTTPSConnection('services.redecard.com.br')\nconn.request('GET', '/novoportal/Portals/Servico/PopUp_login_Existente.asp')\n\nr = conn.getresponse()\nprint(r.read(10000))\nprint(r.getheaders())\n```\n",
"Right, so it's probably the website. =) Thanks Thomas!\n"
] |
https://api.github.com/repos/psf/requests/issues/1284
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1284/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1284/comments
|
https://api.github.com/repos/psf/requests/issues/1284/events
|
https://github.com/psf/requests/pull/1284
| 12,704,757 |
MDExOlB1bGxSZXF1ZXN0NDkyOTM0Mw==
| 1,284 |
Add missing return_response parameter support according to the docstring...
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/121741?v=4",
"events_url": "https://api.github.com/users/KamilSzot/events{/privacy}",
"followers_url": "https://api.github.com/users/KamilSzot/followers",
"following_url": "https://api.github.com/users/KamilSzot/following{/other_user}",
"gists_url": "https://api.github.com/users/KamilSzot/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/KamilSzot",
"id": 121741,
"login": "KamilSzot",
"node_id": "MDQ6VXNlcjEyMTc0MQ==",
"organizations_url": "https://api.github.com/users/KamilSzot/orgs",
"received_events_url": "https://api.github.com/users/KamilSzot/received_events",
"repos_url": "https://api.github.com/users/KamilSzot/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/KamilSzot/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/KamilSzot/subscriptions",
"type": "User",
"url": "https://api.github.com/users/KamilSzot",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 4 |
2013-04-02T13:26:22Z
|
2021-09-08T20:01:08Z
|
2013-04-02T18:42:58Z
|
CONTRIBUTOR
|
resolved
|
.... This time with proper whitespaces.
|
{
"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/1284/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1284/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/1284.diff",
"html_url": "https://github.com/psf/requests/pull/1284",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/1284.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/1284"
}
| true |
[
"Sorry for improper indent last time.\n",
"@KamilSzot why would you want the unprepared request in the first place? You can do this very easily on your own and that aside, you can not send an unprepared request to `Session#send` or the underlying adapter. The changes don't make any sense from that point of view. Beyond that, the ability to return the unsent request was **deliberately** removed during the refactor for the 1.x release\n",
"@KamilSzot would you mind closing this?\n",
"I don't mind you closing this if you don't want this feature.\n"
] |
https://api.github.com/repos/psf/requests/issues/1283
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1283/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1283/comments
|
https://api.github.com/repos/psf/requests/issues/1283/events
|
https://github.com/psf/requests/pull/1283
| 12,704,633 |
MDExOlB1bGxSZXF1ZXN0NDkyOTI4Mw==
| 1,283 |
Closes #1280
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/240830?v=4",
"events_url": "https://api.github.com/users/sigmavirus24/events{/privacy}",
"followers_url": "https://api.github.com/users/sigmavirus24/followers",
"following_url": "https://api.github.com/users/sigmavirus24/following{/other_user}",
"gists_url": "https://api.github.com/users/sigmavirus24/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/sigmavirus24",
"id": 240830,
"login": "sigmavirus24",
"node_id": "MDQ6VXNlcjI0MDgzMA==",
"organizations_url": "https://api.github.com/users/sigmavirus24/orgs",
"received_events_url": "https://api.github.com/users/sigmavirus24/received_events",
"repos_url": "https://api.github.com/users/sigmavirus24/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/sigmavirus24/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/sigmavirus24/subscriptions",
"type": "User",
"url": "https://api.github.com/users/sigmavirus24",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 3 |
2013-04-02T13:23:09Z
|
2021-09-08T20:01:09Z
|
2013-04-04T01:04:40Z
|
CONTRIBUTOR
|
resolved
|
I'll close #1280 after you merge this by hand. I forgot to include it in the commit 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/1283/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1283/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/1283.diff",
"html_url": "https://github.com/psf/requests/pull/1283",
"merged_at": "2013-04-04T01:04:40Z",
"patch_url": "https://github.com/psf/requests/pull/1283.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/1283"
}
| true |
[
"Sorry, had to rebase and whatnot\n",
"Also added documentation about using PreparedRequests. I might split that off into a separate pull request if you'd rather.\n",
"<3\n"
] |
https://api.github.com/repos/psf/requests/issues/1282
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1282/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1282/comments
|
https://api.github.com/repos/psf/requests/issues/1282/events
|
https://github.com/psf/requests/pull/1282
| 12,704,348 |
MDExOlB1bGxSZXF1ZXN0NDkyOTE0Nw==
| 1,282 |
Changed tabs to spaces to conform with the style of the file
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/121741?v=4",
"events_url": "https://api.github.com/users/KamilSzot/events{/privacy}",
"followers_url": "https://api.github.com/users/KamilSzot/followers",
"following_url": "https://api.github.com/users/KamilSzot/following{/other_user}",
"gists_url": "https://api.github.com/users/KamilSzot/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/KamilSzot",
"id": 121741,
"login": "KamilSzot",
"node_id": "MDQ6VXNlcjEyMTc0MQ==",
"organizations_url": "https://api.github.com/users/KamilSzot/orgs",
"received_events_url": "https://api.github.com/users/KamilSzot/received_events",
"repos_url": "https://api.github.com/users/KamilSzot/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/KamilSzot/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/KamilSzot/subscriptions",
"type": "User",
"url": "https://api.github.com/users/KamilSzot",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 0 |
2013-04-02T13:16:48Z
|
2021-09-08T19:01:02Z
|
2013-04-02T13:20:42Z
|
CONTRIBUTOR
|
resolved
|
Sorry for the wrong white-spaces in my previous pull request.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/121741?v=4",
"events_url": "https://api.github.com/users/KamilSzot/events{/privacy}",
"followers_url": "https://api.github.com/users/KamilSzot/followers",
"following_url": "https://api.github.com/users/KamilSzot/following{/other_user}",
"gists_url": "https://api.github.com/users/KamilSzot/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/KamilSzot",
"id": 121741,
"login": "KamilSzot",
"node_id": "MDQ6VXNlcjEyMTc0MQ==",
"organizations_url": "https://api.github.com/users/KamilSzot/orgs",
"received_events_url": "https://api.github.com/users/KamilSzot/received_events",
"repos_url": "https://api.github.com/users/KamilSzot/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/KamilSzot/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/KamilSzot/subscriptions",
"type": "User",
"url": "https://api.github.com/users/KamilSzot",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/1282/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1282/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/1282.diff",
"html_url": "https://github.com/psf/requests/pull/1282",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/1282.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/1282"
}
| true |
[] |
https://api.github.com/repos/psf/requests/issues/1281
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1281/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1281/comments
|
https://api.github.com/repos/psf/requests/issues/1281/events
|
https://github.com/psf/requests/pull/1281
| 12,701,312 |
MDExOlB1bGxSZXF1ZXN0NDkyNzU2OA==
| 1,281 |
Fix for the issue https://github.com/kennethreitz/requests/issues/1280
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/121741?v=4",
"events_url": "https://api.github.com/users/KamilSzot/events{/privacy}",
"followers_url": "https://api.github.com/users/KamilSzot/followers",
"following_url": "https://api.github.com/users/KamilSzot/following{/other_user}",
"gists_url": "https://api.github.com/users/KamilSzot/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/KamilSzot",
"id": 121741,
"login": "KamilSzot",
"node_id": "MDQ6VXNlcjEyMTc0MQ==",
"organizations_url": "https://api.github.com/users/KamilSzot/orgs",
"received_events_url": "https://api.github.com/users/KamilSzot/received_events",
"repos_url": "https://api.github.com/users/KamilSzot/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/KamilSzot/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/KamilSzot/subscriptions",
"type": "User",
"url": "https://api.github.com/users/KamilSzot",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 6 |
2013-04-02T11:44:04Z
|
2021-09-08T19:01:02Z
|
2013-04-02T11:44:59Z
|
CONTRIBUTOR
|
resolved
|
https://github.com/kennethreitz/requests/issues/1280
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4",
"events_url": "https://api.github.com/users/kennethreitz/events{/privacy}",
"followers_url": "https://api.github.com/users/kennethreitz/followers",
"following_url": "https://api.github.com/users/kennethreitz/following{/other_user}",
"gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/kennethreitz",
"id": 119893,
"login": "kennethreitz",
"node_id": "MDQ6VXNlcjExOTg5Mw==",
"organizations_url": "https://api.github.com/users/kennethreitz/orgs",
"received_events_url": "https://api.github.com/users/kennethreitz/received_events",
"repos_url": "https://api.github.com/users/kennethreitz/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/kennethreitz/starred{/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/1281/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1281/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/1281.diff",
"html_url": "https://github.com/psf/requests/pull/1281",
"merged_at": "2013-04-02T11:44:59Z",
"patch_url": "https://github.com/psf/requests/pull/1281.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/1281"
}
| true |
[
":metal:\n",
"@kennethreitz why reintroduce this behaviour? It was a documentation mistake on my part.\n",
"Woah why did you open this?\n",
"Oh, you guys have the same avatar. :(\n",
"Reverted.\n",
"So you won't reintroduce this behavior? Could you suggest what should I do instead to achieve same thing?\n"
] |
https://api.github.com/repos/psf/requests/issues/1280
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1280/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1280/comments
|
https://api.github.com/repos/psf/requests/issues/1280/events
|
https://github.com/psf/requests/issues/1280
| 12,700,800 |
MDU6SXNzdWUxMjcwMDgwMA==
| 1,280 |
Session.request doesn't have parameter return_response, contrary to what the docs say.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/121741?v=4",
"events_url": "https://api.github.com/users/KamilSzot/events{/privacy}",
"followers_url": "https://api.github.com/users/KamilSzot/followers",
"following_url": "https://api.github.com/users/KamilSzot/following{/other_user}",
"gists_url": "https://api.github.com/users/KamilSzot/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/KamilSzot",
"id": 121741,
"login": "KamilSzot",
"node_id": "MDQ6VXNlcjEyMTc0MQ==",
"organizations_url": "https://api.github.com/users/KamilSzot/orgs",
"received_events_url": "https://api.github.com/users/KamilSzot/received_events",
"repos_url": "https://api.github.com/users/KamilSzot/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/KamilSzot/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/KamilSzot/subscriptions",
"type": "User",
"url": "https://api.github.com/users/KamilSzot",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 19 |
2013-04-02T11:24:21Z
|
2021-09-09T02:11:57Z
|
2013-04-04T01:04:41Z
|
CONTRIBUTOR
|
resolved
|
```
def request(self, method, url,
params=None,
data=None,
headers=None,
cookies=None,
files=None,
auth=None,
timeout=None,
allow_redirects=True,
proxies=None,
hooks=None,
stream=None,
verify=None,
cert=None):
"""Constructs a :class:`Request <Request>`, prepares it and sends it.
Returns :class:`Response <Response>` object.
:param method: method for the new :class:`Request` object.
:param url: URL for the new :class:`Request` object.
:param params: (optional) Dictionary or bytes to be sent in the query
string for the :class:`Request`.
:param data: (optional) Dictionary or bytes to send in the body of the
:class:`Request`.
:param headers: (optional) Dictionary of HTTP Headers to send with the
:class:`Request`.
:param cookies: (optional) Dict or CookieJar object to send with the
:class:`Request`.
:param files: (optional) Dictionary of 'filename': file-like-objects
for multipart encoding upload.
:param auth: (optional) Auth tuple or callable to enable
Basic/Digest/Custom HTTP Auth.
:param timeout: (optional) Float describing the timeout of the
request.
:param allow_redirects: (optional) Boolean. Set to True by default.
:param proxies: (optional) Dictionary mapping protocol to the URL of
the proxy.
:param return_response: (optional) If False, an un-sent Request object
will returned.
:param config: (optional) A configuration dictionary. See
``request.defaults`` for allowed keys and their default values.
:param prefetch: (optional) whether to immediately download the response
content. Defaults to ``True``.
:param verify: (optional) if ``True``, the SSL cert will be verified.
A CA_BUNDLE path can also be provided.
:param cert: (optional) if String, path to ssl client cert file (.pem).
If Tuple, ('cert', 'key') pair.
"""
```
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/240830?v=4",
"events_url": "https://api.github.com/users/sigmavirus24/events{/privacy}",
"followers_url": "https://api.github.com/users/sigmavirus24/followers",
"following_url": "https://api.github.com/users/sigmavirus24/following{/other_user}",
"gists_url": "https://api.github.com/users/sigmavirus24/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/sigmavirus24",
"id": 240830,
"login": "sigmavirus24",
"node_id": "MDQ6VXNlcjI0MDgzMA==",
"organizations_url": "https://api.github.com/users/sigmavirus24/orgs",
"received_events_url": "https://api.github.com/users/sigmavirus24/received_events",
"repos_url": "https://api.github.com/users/sigmavirus24/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/sigmavirus24/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/sigmavirus24/subscriptions",
"type": "User",
"url": "https://api.github.com/users/sigmavirus24",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/1280/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1280/timeline
| null |
completed
| null | null | false |
[
"Or config and presumably prefetch=> stream also. So basically it seems like the docstring hasn't been updated from pre 1.0 times\n",
"This is my fault. I'll fix it \n",
"So you won't reintroduce this behavior? Could you suggest what should I do instead to achieve same thing?\n\nNamely, I want to create request in session and inspect it and tamper with it before sending it.\n\nI need to add to headers of the request crystallographic signature of the body of the request before sending it.\n",
"I thought we had documented this, but I guess we either haven't or haven't made it prominent enough\n\n``` python\nfrom requests import Request, Session\n\nunprepped = Request('GET', url, data='etc', \n #...\n)\n\nprepared = unprepped.prepare()\nsig = crystallographic_sig(prepared.body)\nprepared.headers['Cystallographic-Signature'] = sig # clearly I don't know which header key is correct, I'm just guessing\ns = Session()\nresp = s.send(prepared)\n```\n\nYou can send other parameters to `Session#send` like you do to `Session#request` like `stream`, `verify`, `cert`, etc.\n",
"Ok. But I had made some requests previously in this session that set some cookies that I wan't to send with this new signed request.\n\nI guess I just have to pass them manually to Request.\n",
"I only created a new Session for the completeness of the example. You don't have to make a new session and if you made the rest of the requests with one session the cookies are stored on it and will be used when you call `Session#send`.\n",
"So you are saying that:\n\n``` python\ns = Session()\ns.request('http://..') # sets some cookies\n\nreq = Request('GET', 'http://...', ...).prepare()\ns.send(req) # cookies previously set in the session get passed along with this request\n```\n",
"Yes\n",
"From source of Session.send doesn't look like it could work. I'll try to verify that it works.\n",
"Which version are you using because it does in 1.2.0\n",
"I'm using the one cloned from here.\n\nAnd I confirmed that this doens't work:\n\n``` python\n# -*- coding: utf-8 -*-\nimport requests\n\n\ns = requests.Session()\ns.get(\"http://localhost/index.php\")\n\nreq = requests.Request(\"GET\", \"http://localhost/index2.php\").prepare()\n\nprint s.send(req).text\n```\n\nindex.php sets cookie, and index2.php outputs it\n\nThis works:\n\n``` python\n# -*- coding: utf-8 -*-\nimport requests\n\n\ns = requests.Session()\ns.get(\"http://localhost/index.php\")\n\nreq = requests.Request(\"GET\", \"http://localhost/index2.php\", cookies = s.cookies).prepare()\n\nprint s.send(req).text\n```\n\nAnd this works too:\n\n``` python\n# -*- coding: utf-8 -*-\nimport requests\n\n\ns = requests.Session()\ns.get(\"http://localhost/index.php\")\n\nprint s.get(\"http://localhost/index2.php\").text\n```\n",
"Eh, that's actually wrong. I thought someone sent a pull request to that effect but I must be remembering something else. Regardless if you session is `s` then when you create the `Request` object just pass in `cookies=s.cookies`.\n",
"... and all the other things that Session keeps track of.\n",
"I think that having method that creates request in session but doesn't send it just yet might be beneficial. Anyway, thank you for your help and for the great stuff you all build.\n",
"It's been proposed and shot down already. Although with this, I'm (personally) starting to warm up to it.\n",
"The Requests-y way of doing this is to use my favourite toy, the all-powerful Transport Adapter. Observe.\n\n``` python\nfrom requests.adapters import HTTPAdapter\n\nclass CrystalAdapter(HTTPAdapter):\n '''\n A transport adapter that automatically applies the Crystallographic \n signature to any request passing through it.\n '''\n def send(self, request, **kwargs):\n signature = do_crystallographic_stuff(request.body)\n request.headers['Crystallographic-Signature'] = signature\n\n return super(CrystalAdapter, self).send(request, **kwargs)\n```\n\nThen, do this:\n\n``` python\n>>> import requests\n>>> from my.awesome.lib import CrystalAdapter\n\n>>> s = requests.Session()\n>>> s.mount('http://mysite.com/', CrystalAdapter())\n>>> r = s.post('http://mysite.com/testytesty', data={'some': 'data'})\n>>> r.request.headers['Crystallographic-Signature']\n'whatever string belongs here'\n```\n\nThis gets you a few benefits. Firstly, you can ensure that only requests going to a specific site get the signature attached. Second, you guarantee that you're signing the data on the wire, nothing else. Third, it's very object-oriented, which is always nice. =)\n",
"Awesome. But I don't think there are any examples of using adapters in the docs.\n",
"There aren't, but I've written one up on my blog [here](https://lukasa.co.uk/2013/01/Choosing_SSL_Version_In_Requests/), and a more complicated one [here](https://lukasa.co.uk/2012/12/Writing_A_Transport_Adapter/). Could write another, more general one if there's interest.\n",
"This is a valid report. The doc-string on Session#request is wrong. I have PR in to fix it though.\n"
] |
https://api.github.com/repos/psf/requests/issues/1279
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1279/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1279/comments
|
https://api.github.com/repos/psf/requests/issues/1279/events
|
https://github.com/psf/requests/pull/1279
| 12,680,586 |
MDExOlB1bGxSZXF1ZXN0NDkxODkzNA==
| 1,279 |
Unicode strings in multipart post requests
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/18160?v=4",
"events_url": "https://api.github.com/users/jemerick/events{/privacy}",
"followers_url": "https://api.github.com/users/jemerick/followers",
"following_url": "https://api.github.com/users/jemerick/following{/other_user}",
"gists_url": "https://api.github.com/users/jemerick/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/jemerick",
"id": 18160,
"login": "jemerick",
"node_id": "MDQ6VXNlcjE4MTYw",
"organizations_url": "https://api.github.com/users/jemerick/orgs",
"received_events_url": "https://api.github.com/users/jemerick/received_events",
"repos_url": "https://api.github.com/users/jemerick/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/jemerick/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jemerick/subscriptions",
"type": "User",
"url": "https://api.github.com/users/jemerick",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 5 |
2013-04-01T22:53:38Z
|
2021-09-08T23:05:19Z
|
2013-04-16T19:55:58Z
|
CONTRIBUTOR
|
resolved
|
When attempting to post a file along with some other data including a unicode string (demonstrated in the added test case) I was running into the following error:
UnicodeEncodeError: 'ascii' codec can't encode character u'\xeb' in position 0: ordinal not in range(128)
I traced the issue back to `_encode_files` where `compat.builtin_str`, in my case `str`, was being applied to the unicode string causing the above error. I changed it to use `compat.str` which seems to have resolved the issue.
``` bash
> python --version
Python 2.7.2
```
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4",
"events_url": "https://api.github.com/users/kennethreitz/events{/privacy}",
"followers_url": "https://api.github.com/users/kennethreitz/followers",
"following_url": "https://api.github.com/users/kennethreitz/following{/other_user}",
"gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/kennethreitz",
"id": 119893,
"login": "kennethreitz",
"node_id": "MDQ6VXNlcjExOTg5Mw==",
"organizations_url": "https://api.github.com/users/kennethreitz/orgs",
"received_events_url": "https://api.github.com/users/kennethreitz/received_events",
"repos_url": "https://api.github.com/users/kennethreitz/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/kennethreitz/starred{/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/1279/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1279/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/1279.diff",
"html_url": "https://github.com/psf/requests/pull/1279",
"merged_at": "2013-04-16T19:55:58Z",
"patch_url": "https://github.com/psf/requests/pull/1279.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/1279"
}
| true |
[
"Hi, and thanks for the bug report!\n\nUnfortunately, you've run straight into Python 2's implicit string encoding/decoding, and your code changes don't resolve the problem: they simply move it somewhere else. In Requests, `str` is aliased to `unicode` in Requests on Python 2. This means your change will call `unicode` on all data passed in to the `data` parameter. If the user has done this:\n\n``` python\nimport requests\nr = requests.post('http://httpbin.org/post', data={'key': u'ëlïxr'.encode('utf-8')})\n```\n\nthey will now get `UnicodeEncodeError`s. I think in this case the correct fix is for Requests to explicitly encode any unicode data as UTF-8 on Python 2.7, so that we only send bytes to urllib3.\n",
"Thanks Cory for your feedback and sorry for my lack of understanding around some of the issues with Python 2's string encoding/decoding...\n\nWhat about modeling `_encode_files` handling of the data after `_encode_params` as in e7247ce since this issue does not seem to happen when just posting data instead of files and data or is this coming back to your point about moving the issue somewhere else?\n",
"No worries. =) Python 2's string encoding issues is one of the reasons Python 3 is backward incompatible: to make these issues more apparent. This has been tripping up developers for a very long time, so I'm not surprised you're not familiar with it.\n\nThis fix looks a lot better! This should resolve the original problem you had nicely. I think there are still a few ways to hit some Unicode errors, but we really need a proper issue that tackles them, because they're sitting in quite a few places in the library. I'm happy with this PR as-is.\n\n+1 :+1: :cake:\n",
":cake:\n",
"Excellent work folks, found this after isolating a problem we had with this today. Looking forward to a pypi release :)\n"
] |
https://api.github.com/repos/psf/requests/issues/1278
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1278/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1278/comments
|
https://api.github.com/repos/psf/requests/issues/1278/events
|
https://github.com/psf/requests/pull/1278
| 12,671,281 |
MDExOlB1bGxSZXF1ZXN0NDkxMzkwNw==
| 1,278 |
fix tiny typo in HISTORY.rst
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/717901?v=4",
"events_url": "https://api.github.com/users/t-8ch/events{/privacy}",
"followers_url": "https://api.github.com/users/t-8ch/followers",
"following_url": "https://api.github.com/users/t-8ch/following{/other_user}",
"gists_url": "https://api.github.com/users/t-8ch/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/t-8ch",
"id": 717901,
"login": "t-8ch",
"node_id": "MDQ6VXNlcjcxNzkwMQ==",
"organizations_url": "https://api.github.com/users/t-8ch/orgs",
"received_events_url": "https://api.github.com/users/t-8ch/received_events",
"repos_url": "https://api.github.com/users/t-8ch/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/t-8ch/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/t-8ch/subscriptions",
"type": "User",
"url": "https://api.github.com/users/t-8ch",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 0 |
2013-04-01T18:47:39Z
|
2021-09-08T19:01:01Z
|
2013-04-02T04:36:49Z
|
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/1278/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1278/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/1278.diff",
"html_url": "https://github.com/psf/requests/pull/1278",
"merged_at": "2013-04-02T04:36:49Z",
"patch_url": "https://github.com/psf/requests/pull/1278.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/1278"
}
| true |
[] |
|
https://api.github.com/repos/psf/requests/issues/1277
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1277/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1277/comments
|
https://api.github.com/repos/psf/requests/issues/1277/events
|
https://github.com/psf/requests/pull/1277
| 12,663,395 |
MDExOlB1bGxSZXF1ZXN0NDkwOTkzNw==
| 1,277 |
Fixed typos
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/77759?v=4",
"events_url": "https://api.github.com/users/pborreli/events{/privacy}",
"followers_url": "https://api.github.com/users/pborreli/followers",
"following_url": "https://api.github.com/users/pborreli/following{/other_user}",
"gists_url": "https://api.github.com/users/pborreli/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/pborreli",
"id": 77759,
"login": "pborreli",
"node_id": "MDQ6VXNlcjc3NzU5",
"organizations_url": "https://api.github.com/users/pborreli/orgs",
"received_events_url": "https://api.github.com/users/pborreli/received_events",
"repos_url": "https://api.github.com/users/pborreli/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/pborreli/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/pborreli/subscriptions",
"type": "User",
"url": "https://api.github.com/users/pborreli",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 3 |
2013-04-01T15:03:21Z
|
2021-09-08T23:01:09Z
|
2013-04-02T04:36:39Z
|
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/1277/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1277/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/1277.diff",
"html_url": "https://github.com/psf/requests/pull/1277",
"merged_at": "2013-04-02T04:36:39Z",
"patch_url": "https://github.com/psf/requests/pull/1277.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/1277"
}
| true |
[
":+1:\n",
":+1: \n",
":cake:\n"
] |
|
https://api.github.com/repos/psf/requests/issues/1276
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1276/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1276/comments
|
https://api.github.com/repos/psf/requests/issues/1276/events
|
https://github.com/psf/requests/pull/1276
| 12,653,514 |
MDExOlB1bGxSZXF1ZXN0NDkwNTQ1MA==
| 1,276 |
is should not be used for comparing numbers
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/772?v=4",
"events_url": "https://api.github.com/users/alex/events{/privacy}",
"followers_url": "https://api.github.com/users/alex/followers",
"following_url": "https://api.github.com/users/alex/following{/other_user}",
"gists_url": "https://api.github.com/users/alex/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/alex",
"id": 772,
"login": "alex",
"node_id": "MDQ6VXNlcjc3Mg==",
"organizations_url": "https://api.github.com/users/alex/orgs",
"received_events_url": "https://api.github.com/users/alex/received_events",
"repos_url": "https://api.github.com/users/alex/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/alex/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/alex/subscriptions",
"type": "User",
"url": "https://api.github.com/users/alex",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 3 |
2013-04-01T06:20:50Z
|
2023-05-23T23:14:22Z
|
2013-04-02T03:42:23Z
|
MEMBER
|
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/1276/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1276/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/1276.diff",
"html_url": "https://github.com/psf/requests/pull/1276",
"merged_at": "2013-04-02T03:42:23Z",
"patch_url": "https://github.com/psf/requests/pull/1276.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/1276"
}
| true |
[
"+1.\n",
":+1:\n",
"Wow, that's an old line of code.\n"
] |
|
https://api.github.com/repos/psf/requests/issues/1275
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1275/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1275/comments
|
https://api.github.com/repos/psf/requests/issues/1275/events
|
https://github.com/psf/requests/pull/1275
| 12,641,373 |
MDExOlB1bGxSZXF1ZXN0NDkwMTE0MQ==
| 1,275 |
Requests in history are overridden on redirect
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/660112?v=4",
"events_url": "https://api.github.com/users/reclosedev/events{/privacy}",
"followers_url": "https://api.github.com/users/reclosedev/followers",
"following_url": "https://api.github.com/users/reclosedev/following{/other_user}",
"gists_url": "https://api.github.com/users/reclosedev/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/reclosedev",
"id": 660112,
"login": "reclosedev",
"node_id": "MDQ6VXNlcjY2MDExMg==",
"organizations_url": "https://api.github.com/users/reclosedev/orgs",
"received_events_url": "https://api.github.com/users/reclosedev/received_events",
"repos_url": "https://api.github.com/users/reclosedev/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/reclosedev/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/reclosedev/subscriptions",
"type": "User",
"url": "https://api.github.com/users/reclosedev",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 4 |
2013-03-31T10:42:56Z
|
2021-09-08T19:01:00Z
|
2013-04-19T06:32:31Z
|
CONTRIBUTOR
|
resolved
|
Example:
``` python
import requests
resp = requests.get("http://httpbin.org/redirect/4")
for r in resp.history:
print("url: {} request.url: {}".format(r.url, r.request.url))
```
Output:
```
url: http://httpbin.org/redirect/4 request.url: http://httpbin.org/redirect/4
url: http://httpbin.org/redirect/3 request.url: http://httpbin.org/get
url: http://httpbin.org/redirect/2 request.url: http://httpbin.org/get
url: http://httpbin.org/redirect/1 request.url: http://httpbin.org/get
```
Simplest solution is to copy `prepared_request` for each redirect. Also `prepared_request` can be created inside the while loop (maybe it's better?).
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/660112?v=4",
"events_url": "https://api.github.com/users/reclosedev/events{/privacy}",
"followers_url": "https://api.github.com/users/reclosedev/followers",
"following_url": "https://api.github.com/users/reclosedev/following{/other_user}",
"gists_url": "https://api.github.com/users/reclosedev/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/reclosedev",
"id": 660112,
"login": "reclosedev",
"node_id": "MDQ6VXNlcjY2MDExMg==",
"organizations_url": "https://api.github.com/users/reclosedev/orgs",
"received_events_url": "https://api.github.com/users/reclosedev/received_events",
"repos_url": "https://api.github.com/users/reclosedev/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/reclosedev/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/reclosedev/subscriptions",
"type": "User",
"url": "https://api.github.com/users/reclosedev",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/1275/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1275/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/1275.diff",
"html_url": "https://github.com/psf/requests/pull/1275",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/1275.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/1275"
}
| true |
[
"My sincere concern with this pull request is that you could have someone making a lot of requests to resources that have at least one redirect each. At that point their memory consumption will grow a lot faster than now.\n\nI would be 100% ok going back to the original 1.x behaviour of only attaching the original prepared request, but I understand that's not what you're asking. This is, however, how requests worked even before 1.x. The final decision is, however, entirely Kenneth's call.\n",
"v1.1.0 doesn't have this issue. It uses `Session.request()` instead `Session.send()`, so new request is created for each redirect anyway.\n\nWith this new behaviour I have problems in `requests-cache` library, because I'm using `response.request` from `response.history` for cache key.\n",
"Ah, I see what the problem is. I think creating the prepared request would be fine inside the while loop. It reduces the cost of the import (yes importing is costly in terms of time).\n",
"It can't be merged now. I'll reopen.\n"
] |
https://api.github.com/repos/psf/requests/issues/1274
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1274/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1274/comments
|
https://api.github.com/repos/psf/requests/issues/1274/events
|
https://github.com/psf/requests/issues/1274
| 12,624,570 |
MDU6SXNzdWUxMjYyNDU3MA==
| 1,274 |
API ratelimit timer
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/3277097?v=4",
"events_url": "https://api.github.com/users/0xcaff/events{/privacy}",
"followers_url": "https://api.github.com/users/0xcaff/followers",
"following_url": "https://api.github.com/users/0xcaff/following{/other_user}",
"gists_url": "https://api.github.com/users/0xcaff/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/0xcaff",
"id": 3277097,
"login": "0xcaff",
"node_id": "MDQ6VXNlcjMyNzcwOTc=",
"organizations_url": "https://api.github.com/users/0xcaff/orgs",
"received_events_url": "https://api.github.com/users/0xcaff/received_events",
"repos_url": "https://api.github.com/users/0xcaff/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/0xcaff/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/0xcaff/subscriptions",
"type": "User",
"url": "https://api.github.com/users/0xcaff",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 1 |
2013-03-30T01:31:10Z
|
2021-09-09T04:00:44Z
|
2013-03-30T03:15:38Z
|
NONE
|
resolved
|
Can you please add a pre-request timer to the session class to comply with certain api ratelimit rules?
Requestobj.ratelimit = 1
Requestobj.get(url) # will wait one second before making the request
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/240830?v=4",
"events_url": "https://api.github.com/users/sigmavirus24/events{/privacy}",
"followers_url": "https://api.github.com/users/sigmavirus24/followers",
"following_url": "https://api.github.com/users/sigmavirus24/following{/other_user}",
"gists_url": "https://api.github.com/users/sigmavirus24/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/sigmavirus24",
"id": 240830,
"login": "sigmavirus24",
"node_id": "MDQ6VXNlcjI0MDgzMA==",
"organizations_url": "https://api.github.com/users/sigmavirus24/orgs",
"received_events_url": "https://api.github.com/users/sigmavirus24/received_events",
"repos_url": "https://api.github.com/users/sigmavirus24/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/sigmavirus24/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/sigmavirus24/subscriptions",
"type": "User",
"url": "https://api.github.com/users/sigmavirus24",
"user_view_type": "public"
}
|
{
"+1": 1,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 1,
"url": "https://api.github.com/repos/psf/requests/issues/1274/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1274/timeline
| null |
completed
| null | null | false |
[
"We're under a feature freeze (#1165) which means this won't be accepted and on top of that you can do the following:\n\n``` python\nimport time\n\n\nclass MySession(requests.Session):\n def __init__(self):\n super(MySession, self).__init__()\n self.ratelimit = 0\n\n def request(*args):\n if self.ratelimit > 0:\n time.sleep(self.ratelimit)\n return super(MySession, self).request(*args)\n```\n"
] |
https://api.github.com/repos/psf/requests/issues/1273
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1273/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1273/comments
|
https://api.github.com/repos/psf/requests/issues/1273/events
|
https://github.com/psf/requests/pull/1273
| 12,623,336 |
MDExOlB1bGxSZXF1ZXN0NDg5NDYzMw==
| 1,273 |
A Session object now maintains a response hook property...
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1027771?v=4",
"events_url": "https://api.github.com/users/rowedonalde/events{/privacy}",
"followers_url": "https://api.github.com/users/rowedonalde/followers",
"following_url": "https://api.github.com/users/rowedonalde/following{/other_user}",
"gists_url": "https://api.github.com/users/rowedonalde/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/rowedonalde",
"id": 1027771,
"login": "rowedonalde",
"node_id": "MDQ6VXNlcjEwMjc3NzE=",
"organizations_url": "https://api.github.com/users/rowedonalde/orgs",
"received_events_url": "https://api.github.com/users/rowedonalde/received_events",
"repos_url": "https://api.github.com/users/rowedonalde/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/rowedonalde/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/rowedonalde/subscriptions",
"type": "User",
"url": "https://api.github.com/users/rowedonalde",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 13 |
2013-03-30T00:06:40Z
|
2021-09-08T19:01:00Z
|
2013-05-01T17:31:56Z
|
NONE
|
resolved
|
...for the most recent request.
This pertains to issue at https://github.com/kennethreitz/requests/issues/1271
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4",
"events_url": "https://api.github.com/users/kennethreitz/events{/privacy}",
"followers_url": "https://api.github.com/users/kennethreitz/followers",
"following_url": "https://api.github.com/users/kennethreitz/following{/other_user}",
"gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/kennethreitz",
"id": 119893,
"login": "kennethreitz",
"node_id": "MDQ6VXNlcjExOTg5Mw==",
"organizations_url": "https://api.github.com/users/kennethreitz/orgs",
"received_events_url": "https://api.github.com/users/kennethreitz/received_events",
"repos_url": "https://api.github.com/users/kennethreitz/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/kennethreitz/starred{/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/1273/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1273/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/1273.diff",
"html_url": "https://github.com/psf/requests/pull/1273",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/1273.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/1273"
}
| true |
[
"You're re-calling the hook. We dispatch hooks elsewhere now. If you want this to be accepted at all, you'll need to set the response attribute in `Session#send`. It would also be nice if you stripped this commit from your repository and force-pushed the new commit with that to the same branch so the Pull Request will automatically update itself.\n\nUntil you do that, I'm :-1: on this. After you do that I'll be entirely indifferent. You might also add a test to make sure we don't accidentally remove this again.\n",
"Thanks for your quick response and advice. By stripping the commit from my repo, do you mean that I should do something like `git reset --hard HEAD~1` locally, make my code changes, and then do a push with --force to replace what's currently on my branch?\n",
"That's exactly it. :-)\n",
"I'm -1 on this. I see no reason to clutter the session object with something that is about to be returned from it. Why is it not sufficient to save the response?\n",
"One current use case I have is a class that maintains a Session object as one of its properties. I've found that it's incredibly useful to have the most recent response available at any given time (after at least one request has been made), especially for debugging and logging purposes. While it's totally possible, of course, to put something like `self.last_response =` before every Session get/post call, it's a lot more convenient if the session keeps track of the response without having to write duplicate code everywhere--the more like a browser it is, the more human-friendly it is.\n",
"I agree that it's convenient, but I don't agree with the last statement. The notion of Requests as a library \"for humans\" rests with its simplicity, not its utility. The original versions of Requests could do very little, but they were still \"for humans\" because their API was simple and they were concerned with doing the right thing, not with the spec.\n\nThe short answer is that this is unlikely to be accepted. This is a change to the Requests API, which are never accepted without good reason. This is neither hard to implement nor overwhelmingly popular, so it's unlikely to be merged. In the meantime, I suggest you do this:\n\n``` python\nfrom requests import Session\n\nclass StorageSession(Session):\n def send(self, request, **kwargs):\n r = super(StorageSession, self).send(request, **kwargs)\n self.last_response = r\n return r\n```\n\nThis provides all the function you need without any code reuse, and without adding anything to Requests' API. =)\n",
"I agree with @lukasa. In fact to expand a bit on his point about the last statement I'll say this: \n\nWe emulate browser behaviour in some instances because in spite of the relevant RFC some servers will only behave \"correctly\" where \"correctly\" is how browsers expect it to behave. In those cases, RFC be damned, that's how we have to behave but at no point is requests a replacement for a browser, or a programmatic browser. Were that the case, we would have to keep a session history tracing back to the very first request. We provide histories for individual requests because being able to know that a redirect occurred is very important. It isn't so important on a session.\n\nI was and remain frankly -0 on this because this existed well into 1.x (I think until 1.1.0) but when we asked if anyone was using it, no one replied until now. If it isn't used, it is just causing code-smell and will only cause confusion for future editors of and contributors to the project.\n\n@Lukasa's solution is elegant and works very well. Even easier might be a hook like so:\n\n``` python\nimport requests\nfrom functools import partial\n\ndef _hook(session, response, **kwargs):\n session.response = response\n return response\n\ns = requests.Session()\nhook = partial(hook, s)\ns.hooks['response'] = [hook]\n\nr = s.get('https://httpbin.org/get')\nr.url == s.response.url\n```\n\nAdmittedly I don't have the time to test that, but I'm 90% sure it will work. :)\n",
"This is admittedly off-topic, but I don't think there's enough currying in Requests code examples. More currying! :curry: \n",
"More of the off-topic discourse: So many people hate currying, but when done in moderation it is SO useful.\n",
"Thanks for the examples; I'll consider them if this PR doesn't go through.\n\n@sigmavirus24: When/where was it asked if anyone was using this response property? I didn't even hear about it until I started pulling straight from github (rather than PyPI).\n",
"I believe I asked the question on GitHub and at least Kenneth retweeted. We also polled the IRC channel. No one responded in the affirmative to either.\n",
"Cool, thanks.\n",
"They're far from ideal methods, but it's impossible to contact everyone.\n"
] |
https://api.github.com/repos/psf/requests/issues/1272
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1272/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1272/comments
|
https://api.github.com/repos/psf/requests/issues/1272/events
|
https://github.com/psf/requests/issues/1272
| 12,616,958 |
MDU6SXNzdWUxMjYxNjk1OA==
| 1,272 |
Multipart files are only multipart/form-data
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1534574?v=4",
"events_url": "https://api.github.com/users/zmelnick/events{/privacy}",
"followers_url": "https://api.github.com/users/zmelnick/followers",
"following_url": "https://api.github.com/users/zmelnick/following{/other_user}",
"gists_url": "https://api.github.com/users/zmelnick/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/zmelnick",
"id": 1534574,
"login": "zmelnick",
"node_id": "MDQ6VXNlcjE1MzQ1NzQ=",
"organizations_url": "https://api.github.com/users/zmelnick/orgs",
"received_events_url": "https://api.github.com/users/zmelnick/received_events",
"repos_url": "https://api.github.com/users/zmelnick/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/zmelnick/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/zmelnick/subscriptions",
"type": "User",
"url": "https://api.github.com/users/zmelnick",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 1 |
2013-03-29T19:59:30Z
|
2021-09-09T04:00:45Z
|
2013-03-30T00:15:15Z
|
NONE
|
resolved
|
Unable to specify multipart/related or application/xop+xml when trying to send files with the file option.
If headers are passed in, no additional information is added to them based on the other options used.
Request:
If header options are passed in, use those for multipart files, and add the boundary information. Currently I see no way to use SOAP with attachments using the multipart
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/240830?v=4",
"events_url": "https://api.github.com/users/sigmavirus24/events{/privacy}",
"followers_url": "https://api.github.com/users/sigmavirus24/followers",
"following_url": "https://api.github.com/users/sigmavirus24/following{/other_user}",
"gists_url": "https://api.github.com/users/sigmavirus24/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/sigmavirus24",
"id": 240830,
"login": "sigmavirus24",
"node_id": "MDQ6VXNlcjI0MDgzMA==",
"organizations_url": "https://api.github.com/users/sigmavirus24/orgs",
"received_events_url": "https://api.github.com/users/sigmavirus24/received_events",
"repos_url": "https://api.github.com/users/sigmavirus24/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/sigmavirus24/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/sigmavirus24/subscriptions",
"type": "User",
"url": "https://api.github.com/users/sigmavirus24",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/1272/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1272/timeline
| null |
completed
| null | null | false |
[
"Requests only does the following encodings:\n- multipart/form-data\n- application/x-www-urlencoded\n\nThe rest is done by the user. The former is specified by using the files parameter as you tried here. We also do chunked encodings but for that we set the `Transfer-Encoding` header and not the `Content-Type` header. We've also debated this before and consistently come to the same conclusion.\n\nAlso, requests is in a Feature Freeze (#1165) so this won't be accepted for that reason as well.\n\nSorry\n"
] |
https://api.github.com/repos/psf/requests/issues/1271
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1271/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1271/comments
|
https://api.github.com/repos/psf/requests/issues/1271/events
|
https://github.com/psf/requests/issues/1271
| 12,616,780 |
MDU6SXNzdWUxMjYxNjc4MA==
| 1,271 |
Response manipulation hook no longer in Session object after request?
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1027771?v=4",
"events_url": "https://api.github.com/users/rowedonalde/events{/privacy}",
"followers_url": "https://api.github.com/users/rowedonalde/followers",
"following_url": "https://api.github.com/users/rowedonalde/following{/other_user}",
"gists_url": "https://api.github.com/users/rowedonalde/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/rowedonalde",
"id": 1027771,
"login": "rowedonalde",
"node_id": "MDQ6VXNlcjEwMjc3NzE=",
"organizations_url": "https://api.github.com/users/rowedonalde/orgs",
"received_events_url": "https://api.github.com/users/rowedonalde/received_events",
"repos_url": "https://api.github.com/users/rowedonalde/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/rowedonalde/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/rowedonalde/subscriptions",
"type": "User",
"url": "https://api.github.com/users/rowedonalde",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 3 |
2013-03-29T19:54:01Z
|
2021-09-09T04:00:40Z
|
2013-04-01T18:35:47Z
|
NONE
|
resolved
|
Commit a721d590b4e13b641b3171a081e7d6a7b3d8b6f2 as applied to request/session.py removes the following (lines 297-299, after request call succeeds):
``` python
# Response manipulation hook.
self.response = dispatch_hook('response', hooks, resp)
```
At the moment, my code which relies on this response property in the Session object works fine with the current 1.1.0 release from PyPI but breaks with this commit. Is there a reason why this hook was removed? It presents a significant compatibility issue.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/240830?v=4",
"events_url": "https://api.github.com/users/sigmavirus24/events{/privacy}",
"followers_url": "https://api.github.com/users/sigmavirus24/followers",
"following_url": "https://api.github.com/users/sigmavirus24/following{/other_user}",
"gists_url": "https://api.github.com/users/sigmavirus24/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/sigmavirus24",
"id": 240830,
"login": "sigmavirus24",
"node_id": "MDQ6VXNlcjI0MDgzMA==",
"organizations_url": "https://api.github.com/users/sigmavirus24/orgs",
"received_events_url": "https://api.github.com/users/sigmavirus24/received_events",
"repos_url": "https://api.github.com/users/sigmavirus24/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/sigmavirus24/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/sigmavirus24/subscriptions",
"type": "User",
"url": "https://api.github.com/users/sigmavirus24",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/1271/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1271/timeline
| null |
completed
| null | null | false |
[
"I've made pull request #1273 if you want to restore this response property to an instance of Session.\n",
"We removed it because when we asked if anyone was using it, no one replied in the affirmative.\n",
"Closing to centralize discussion on #1273\n"
] |
https://api.github.com/repos/psf/requests/issues/1270
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1270/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1270/comments
|
https://api.github.com/repos/psf/requests/issues/1270/events
|
https://github.com/psf/requests/pull/1270
| 12,603,922 |
MDExOlB1bGxSZXF1ZXN0NDg4NDUzNg==
| 1,270 |
add 'max_redirects' to Session's __attrs__
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1274612?v=4",
"events_url": "https://api.github.com/users/makto/events{/privacy}",
"followers_url": "https://api.github.com/users/makto/followers",
"following_url": "https://api.github.com/users/makto/following{/other_user}",
"gists_url": "https://api.github.com/users/makto/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/makto",
"id": 1274612,
"login": "makto",
"node_id": "MDQ6VXNlcjEyNzQ2MTI=",
"organizations_url": "https://api.github.com/users/makto/orgs",
"received_events_url": "https://api.github.com/users/makto/received_events",
"repos_url": "https://api.github.com/users/makto/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/makto/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/makto/subscriptions",
"type": "User",
"url": "https://api.github.com/users/makto",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 4 |
2013-03-29T13:10:31Z
|
2021-09-08T19:00:59Z
|
2013-03-31T05:20:02Z
|
CONTRIBUTOR
|
resolved
|
This patch is to ensure the **proper serialization** with, like, the standard module _pickle_.
See [Issue #1269](https://github.com/kennethreitz/requests/issues/1269) for specific potential error it may produce.
Thanks for reviewing ;)
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4",
"events_url": "https://api.github.com/users/kennethreitz/events{/privacy}",
"followers_url": "https://api.github.com/users/kennethreitz/followers",
"following_url": "https://api.github.com/users/kennethreitz/following{/other_user}",
"gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/kennethreitz",
"id": 119893,
"login": "kennethreitz",
"node_id": "MDQ6VXNlcjExOTg5Mw==",
"organizations_url": "https://api.github.com/users/kennethreitz/orgs",
"received_events_url": "https://api.github.com/users/kennethreitz/received_events",
"repos_url": "https://api.github.com/users/kennethreitz/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/kennethreitz/starred{/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/1270/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1270/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/1270.diff",
"html_url": "https://github.com/psf/requests/pull/1270",
"merged_at": "2013-03-31T05:20:02Z",
"patch_url": "https://github.com/psf/requests/pull/1270.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/1270"
}
| true |
[
"Hey, this looks likely! Nice detective work. :+1:\n",
"@Lukasa \n\nThanks ;)\nGlad to be helpful.\n",
":+1:\n",
":cake:\n"
] |
https://api.github.com/repos/psf/requests/issues/1269
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1269/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1269/comments
|
https://api.github.com/repos/psf/requests/issues/1269/events
|
https://github.com/psf/requests/issues/1269
| 12,598,946 |
MDU6SXNzdWUxMjU5ODk0Ng==
| 1,269 |
'Session' object has no attribute 'max_redirects'
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1274612?v=4",
"events_url": "https://api.github.com/users/makto/events{/privacy}",
"followers_url": "https://api.github.com/users/makto/followers",
"following_url": "https://api.github.com/users/makto/following{/other_user}",
"gists_url": "https://api.github.com/users/makto/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/makto",
"id": 1274612,
"login": "makto",
"node_id": "MDQ6VXNlcjEyNzQ2MTI=",
"organizations_url": "https://api.github.com/users/makto/orgs",
"received_events_url": "https://api.github.com/users/makto/received_events",
"repos_url": "https://api.github.com/users/makto/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/makto/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/makto/subscriptions",
"type": "User",
"url": "https://api.github.com/users/makto",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 4 |
2013-03-29T09:10:42Z
|
2021-09-09T04:00:44Z
|
2013-03-30T08:07:55Z
|
CONTRIBUTOR
|
resolved
|
Django: 1.4
Python: 2.7.3
How could this happened ?
I didn't manually configure the Session object, nor edit the "max_redirects" attribute.
Got no clue……
```
Traceback:
File "/usr/local/sae/python/3rd/django-1.4/django/core/handlers/base.py" in get_response
111. response = callback(request, *callback_args, **callback_kwargs)
File "/usr/local/sae/python/3rd/django-1.4/django/contrib/admin/options.py" in wrapper
366. return self.admin_site.admin_view(view)(*args, **kwargs)
File "/usr/local/sae/python/3rd/django-1.4/django/utils/decorators.py" in _wrapped_view
91. response = view_func(request, *args, **kwargs)
File "/usr/local/sae/python/3rd/django-1.4/django/views/decorators/cache.py" in _wrapped_view_func
89. response = view_func(request, *args, **kwargs)
File "/usr/local/sae/python/3rd/django-1.4/django/contrib/admin/sites.py" in inner
196. return view(request, *args, **kwargs)
File "/usr/local/sae/python/3rd/django-1.4/django/utils/decorators.py" in _wrapper
25. return bound_func(*args, **kwargs)
File "/usr/local/sae/python/3rd/django-1.4/django/utils/decorators.py" in _wrapped_view
91. response = view_func(request, *args, **kwargs)
File "/usr/local/sae/python/3rd/django-1.4/django/utils/decorators.py" in bound_func
21. return func(self, *args2, **kwargs2)
File "/usr/local/sae/python/3rd/django-1.4/django/contrib/admin/options.py" in changelist_view
1153. response = self.response_action(request, queryset=cl.get_query_set(request))
File "/usr/local/sae/python/3rd/django-1.4/django/contrib/admin/options.py" in response_action
908. response = func(self, request, queryset)
File "/data1/www/htdocs/749/codinglabs/2/autosigner/admin.py" in resign
75. newlog = signer(log.user, log.tbname)[0]
File "/data1/www/htdocs/749/codinglabs/2/autosigner/views.py" in signer
245. target = ss.get(TB_HOME, params={'kw':tbname})
File "/data1/www/htdocs/749/codinglabs/2/libs/requests/sessions.py" in get
333. return self.request('GET', url, **kwargs)
File "/data1/www/htdocs/749/codinglabs/2/libs/requests/sessions.py" in request
318. resp = self.send(prep, **send_kwargs)
File "/data1/www/htdocs/749/codinglabs/2/libs/requests/sessions.py" in send
431. history = [resp for resp in gen] if allow_redirects else []
File "/data1/www/htdocs/749/codinglabs/2/libs/requests/sessions.py" in resolve_redirects
100. if i >= self.max_redirects:
Exception Type: AttributeError at /admin/autosigner/logger/
Exception Value: 'Session' object has no attribute 'max_redirects'
```
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1274612?v=4",
"events_url": "https://api.github.com/users/makto/events{/privacy}",
"followers_url": "https://api.github.com/users/makto/followers",
"following_url": "https://api.github.com/users/makto/following{/other_user}",
"gists_url": "https://api.github.com/users/makto/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/makto",
"id": 1274612,
"login": "makto",
"node_id": "MDQ6VXNlcjEyNzQ2MTI=",
"organizations_url": "https://api.github.com/users/makto/orgs",
"received_events_url": "https://api.github.com/users/makto/received_events",
"repos_url": "https://api.github.com/users/makto/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/makto/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/makto/subscriptions",
"type": "User",
"url": "https://api.github.com/users/makto",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/1269/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1269/timeline
| null |
completed
| null | null | false |
[
"Uh...it can't. If the session was instantiated properly, the `max_redirects` parameter must be set. Can I suggest you reinstall Requests in your environment?\n",
"@Lukasa \n\nThank you for your reply :)\nSession object works well most of the time on my machine. This exception occurs only in rare cases.\nI don't think it has anything to do with the installation.\nNever mind, it didn't bother me right now. Just want to help find some potential bugs :)\n",
"@makto could you perhaps give us more relevant information, such as the version of requests you're using and the context (in code) of the exception?\n",
"@sigmavirus24 \nI traced the error and thought it could be brought by `max_redirects`'s missing in **attr**.\nI pickled the session object first and then unpickled it. I believe the max_redirects is missing during the process.\n\nSee my [pull request](https://github.com/kennethreitz/requests/pull/1270)\n"
] |
https://api.github.com/repos/psf/requests/issues/1268
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1268/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1268/comments
|
https://api.github.com/repos/psf/requests/issues/1268/events
|
https://github.com/psf/requests/pull/1268
| 12,563,060 |
MDExOlB1bGxSZXF1ZXN0NDg2MzM5Nw==
| 1,268 |
update vendored urllib3
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/717901?v=4",
"events_url": "https://api.github.com/users/t-8ch/events{/privacy}",
"followers_url": "https://api.github.com/users/t-8ch/followers",
"following_url": "https://api.github.com/users/t-8ch/following{/other_user}",
"gists_url": "https://api.github.com/users/t-8ch/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/t-8ch",
"id": 717901,
"login": "t-8ch",
"node_id": "MDQ6VXNlcjcxNzkwMQ==",
"organizations_url": "https://api.github.com/users/t-8ch/orgs",
"received_events_url": "https://api.github.com/users/t-8ch/received_events",
"repos_url": "https://api.github.com/users/t-8ch/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/t-8ch/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/t-8ch/subscriptions",
"type": "User",
"url": "https://api.github.com/users/t-8ch",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 2 |
2013-03-28T12:53:24Z
|
2021-09-08T23:08:31Z
|
2013-03-31T05:27:59Z
|
CONTRIBUTOR
|
resolved
|
Contains a workaround (fingerprint, random hostname verification) and a solution (pyOpenSSL) for SNI on python 2.
Intended to be included in 1.2 (#1267)
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4",
"events_url": "https://api.github.com/users/kennethreitz/events{/privacy}",
"followers_url": "https://api.github.com/users/kennethreitz/followers",
"following_url": "https://api.github.com/users/kennethreitz/following{/other_user}",
"gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/kennethreitz",
"id": 119893,
"login": "kennethreitz",
"node_id": "MDQ6VXNlcjExOTg5Mw==",
"organizations_url": "https://api.github.com/users/kennethreitz/orgs",
"received_events_url": "https://api.github.com/users/kennethreitz/received_events",
"repos_url": "https://api.github.com/users/kennethreitz/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/kennethreitz/starred{/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/1268/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1268/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/1268.diff",
"html_url": "https://github.com/psf/requests/pull/1268",
"merged_at": "2013-03-31T05:27:59Z",
"patch_url": "https://github.com/psf/requests/pull/1268.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/1268"
}
| true |
[
"+1\n",
":cake:\n"
] |
https://api.github.com/repos/psf/requests/issues/1267
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1267/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1267/comments
|
https://api.github.com/repos/psf/requests/issues/1267/events
|
https://github.com/psf/requests/pull/1267
| 12,547,541 |
MDExOlB1bGxSZXF1ZXN0NDg1NzM3Nw==
| 1,267 |
One last pull request before 1.2 ideally
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/240830?v=4",
"events_url": "https://api.github.com/users/sigmavirus24/events{/privacy}",
"followers_url": "https://api.github.com/users/sigmavirus24/followers",
"following_url": "https://api.github.com/users/sigmavirus24/following{/other_user}",
"gists_url": "https://api.github.com/users/sigmavirus24/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/sigmavirus24",
"id": 240830,
"login": "sigmavirus24",
"node_id": "MDQ6VXNlcjI0MDgzMA==",
"organizations_url": "https://api.github.com/users/sigmavirus24/orgs",
"received_events_url": "https://api.github.com/users/sigmavirus24/received_events",
"repos_url": "https://api.github.com/users/sigmavirus24/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/sigmavirus24/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/sigmavirus24/subscriptions",
"type": "User",
"url": "https://api.github.com/users/sigmavirus24",
"user_view_type": "public"
}
|
[] |
closed
| true |
{
"avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4",
"events_url": "https://api.github.com/users/kennethreitz/events{/privacy}",
"followers_url": "https://api.github.com/users/kennethreitz/followers",
"following_url": "https://api.github.com/users/kennethreitz/following{/other_user}",
"gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/kennethreitz",
"id": 119893,
"login": "kennethreitz",
"node_id": "MDQ6VXNlcjExOTg5Mw==",
"organizations_url": "https://api.github.com/users/kennethreitz/orgs",
"received_events_url": "https://api.github.com/users/kennethreitz/received_events",
"repos_url": "https://api.github.com/users/kennethreitz/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/kennethreitz/starred{/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 | 6 |
2013-03-28T03:49:17Z
|
2021-09-08T19:00:59Z
|
2013-03-31T05:21:52Z
|
CONTRIBUTOR
|
resolved
|
This fixes a few issues once and for all and I updated the HISTORY for the 1.2 release to include all the big changes.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4",
"events_url": "https://api.github.com/users/kennethreitz/events{/privacy}",
"followers_url": "https://api.github.com/users/kennethreitz/followers",
"following_url": "https://api.github.com/users/kennethreitz/following{/other_user}",
"gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/kennethreitz",
"id": 119893,
"login": "kennethreitz",
"node_id": "MDQ6VXNlcjExOTg5Mw==",
"organizations_url": "https://api.github.com/users/kennethreitz/orgs",
"received_events_url": "https://api.github.com/users/kennethreitz/received_events",
"repos_url": "https://api.github.com/users/kennethreitz/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/kennethreitz/starred{/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/1267/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1267/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/1267.diff",
"html_url": "https://github.com/psf/requests/pull/1267",
"merged_at": "2013-03-31T05:21:52Z",
"patch_url": "https://github.com/psf/requests/pull/1267.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/1267"
}
| true |
[
"@Lukasa if you have a chance, some code review would be great. Thanks\n",
"Some of your additions split comments from the relevant code. \n",
"Comments from the diff, otherwise I'm +1 on this PR. Gotta make sure the tests pass too. =)\n",
"repoening for travis test\n",
":metal:\n",
"I don't know how I missed that paren. -_- At least it was caught before 1.2 \n"
] |
https://api.github.com/repos/psf/requests/issues/1266
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1266/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1266/comments
|
https://api.github.com/repos/psf/requests/issues/1266/events
|
https://github.com/psf/requests/issues/1266
| 12,468,024 |
MDU6SXNzdWUxMjQ2ODAyNA==
| 1,266 |
How to upload binary file using PUT?
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/742757?v=4",
"events_url": "https://api.github.com/users/dabono/events{/privacy}",
"followers_url": "https://api.github.com/users/dabono/followers",
"following_url": "https://api.github.com/users/dabono/following{/other_user}",
"gists_url": "https://api.github.com/users/dabono/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/dabono",
"id": 742757,
"login": "dabono",
"node_id": "MDQ6VXNlcjc0Mjc1Nw==",
"organizations_url": "https://api.github.com/users/dabono/orgs",
"received_events_url": "https://api.github.com/users/dabono/received_events",
"repos_url": "https://api.github.com/users/dabono/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/dabono/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/dabono/subscriptions",
"type": "User",
"url": "https://api.github.com/users/dabono",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 7 |
2013-03-26T19:52:09Z
|
2021-09-09T04:00:41Z
|
2013-04-01T18:30:34Z
|
NONE
|
resolved
|
Hi,
I just started using requests recently - it's a big improvement over the urllib2 library! But I'm having some difficulty with uploading files and I hope somebody can help me figure it out.
I'm trying to use a REST API where I need to upload a binary file to the server. The API uses https and Kerberos authentication (I'm also using the requests_kerberos package).
With curl, I can do this:
```
curl --negotiate -u : -H "X-Codesigner-security-token: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" --upload-file <pathname> https://myservice.acme.com/api/v1/requests/24449/unsigned
```
Which results in this:
```
=> Send header, 282 bytes (0x11a)
0000: PUT /api/v1/requests/24449/unsigned HTTP/1.1
002e: User-Agent: curl/7.21.6 (i386-pc-win32) libcurl/7.21.6 OpenSSL/0
006e: .9.8r zlib/1.2.5
0080: Host: myservice.acme.com
009d: Accept: */*
00aa: X-Codesigner-security-token: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
00e9: Content-Length: 4560799
0102: Expect: 100-continue
0118:
<= Recv header, 23 bytes (0x17)
0000: HTTP/1.1 100 Continue
=> Send data, 16384 bytes (0x4000)
…
=> Send data, 16384 bytes (0x4000)
…
```
With requests, I've tried using both streaming upload and chunked upload, but haven't been able to make them work. I'm using the latest master (commit c63472e328946f464ed9fa24c0fadd2890966c5b).
Code snippet using chunked transfer:
```
def filegen(fo):
yield fo.read(CHUNK_SIZE)
def main():
session = requests.Session()
session.auth = HTTPKerberosAuth()
upload_headers = {'X-Codesigner-security-token': 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'}
with open(pathname, 'rb') as infile:
response = session.put(upload_url, headers=upload_headers, data=filegen(infile))
```
This results in:
```
Request headers: {
'Accept-Encoding': 'gzip, deflate, compress',
'X-Codesigner-security-token': 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
'Accept': '*/*',
'User-Agent': 'python-requests/1.1.0 CPython/2.7.1 Windows/7',
'Transfer-Encoding': 'chunked',
'Authorization': 'Negotiate <blah>'
}
Response headers: {
'status': '500',
'content-length': '441',
'content-encoding': 'gzip',
'x-powered-by': 'Phusion Passenger (mod_rails/mod_rack) 3.0.11',
'vary': 'Accept-Encoding,User-Agent',
'connection': 'close',
'server': 'Server',
'x-runtime': '0.564621',
'date': 'Tue, 26 Mar 2013 18:29:44 GMT',
'content-type': 'text/html',
'www-authenticate': 'Negotiate <blah>'
}
```
Using the streaming upload:
```
with open(pathname, 'rb') as infile:
response = session.put(upload_url, headers=upload_headers, data=infile)
```
Results in:
```
Request headers:{
'X-Codesigner-security-token': 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
'Content-Length': u'20319',
'Accept-Encoding': 'gzip, deflate, compress',
'Accept': '*/*',
'User-Agent': 'python-requests/1.1.0 CPython/2.7.1 Windows/7'
}
2013-03-26 12:16:04,440 DEBUG "PUT /api/v1/requests/24539/unsigned HTTP/1.1" 401 401
Traceback (most recent call last):
...
File "C:\Python27\lib\site-packages\requests-1.1.0-py2.7.egg\requests\sessions.py", line 376, in put
return self.request('PUT', url, data=data, **kwargs)
File "C:\Python27\lib\site-packages\requests-1.1.0-py2.7.egg\requests\sessions.py", line 321, in request
resp = self.send(prep, **send_kwargs)
File "C:\Python27\lib\site-packages\requests-1.1.0-py2.7.egg\requests\sessions.py", line 426, in send
r = dispatch_hook('response', hooks, r, **kwargs)
File "C:\Python27\lib\site-packages\requests-1.1.0-py2.7.egg\requests\hooks.py", line 41, in dispatch_hook
_hook_data = hook(hook_data, **kwargs)
File "build\bdist.win32\egg\requests_kerberos\kerberos_.py", line 236, in handle_response
File "build\bdist.win32\egg\requests_kerberos\kerberos_.py", line 158, in handle_401
File "build\bdist.win32\egg\requests_kerberos\kerberos_.py", line 147, in authenticate_user
File "C:\Python27\lib\site-packages\requests-1.1.0-py2.7.egg\requests\adapters.py", line 246, in send
raise ConnectionError(e)
requests.exceptions.ConnectionError:
HTTPSConnectionPool(host='myservice.acme.com', port=443): Max retries exceeded with url: /api/v1/requests/24539/unsigned (Caused by <class 'socket.error'>: [Errno 10054] An existing connection was forcibly closed by the remote host)
```
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/240830?v=4",
"events_url": "https://api.github.com/users/sigmavirus24/events{/privacy}",
"followers_url": "https://api.github.com/users/sigmavirus24/followers",
"following_url": "https://api.github.com/users/sigmavirus24/following{/other_user}",
"gists_url": "https://api.github.com/users/sigmavirus24/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/sigmavirus24",
"id": 240830,
"login": "sigmavirus24",
"node_id": "MDQ6VXNlcjI0MDgzMA==",
"organizations_url": "https://api.github.com/users/sigmavirus24/orgs",
"received_events_url": "https://api.github.com/users/sigmavirus24/received_events",
"repos_url": "https://api.github.com/users/sigmavirus24/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/sigmavirus24/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/sigmavirus24/subscriptions",
"type": "User",
"url": "https://api.github.com/users/sigmavirus24",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/1266/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1266/timeline
| null |
completed
| null | null | false |
[
"This might actually be an issue with `requests_kerberos`. I completely forgot to push our latest version, which I'm about to do now. If you could upgrade after that and see if this persists, I would appreciate it.\n",
"Cool, thanks! I'll pull the latest requests_kerberos after it's been pushed.\n\nI might also have a small contribution for requests_kerberos to make it work with the Windows [kerberos-sspi](https://pypi.python.org/pypi/kerberos-sspi/0.1) package as well as the standard kerberos package.\n",
"Version 0.2 is on PyPI so feel free to upgrade. And we'd love pull requests over at the kerberos repo.\n",
"Thanks for the quick response! Unfortunately, requests_kerberos 0.2 didn't fix the issue for me (I had actually pulled the requests_kerberos source from github and built it locally before you posted 0.2 to PyPI, so it looks like I was essentially using 0.2 already).\n\nI've done a little investigation in the requests sources, specifically in the models.py file. A few questions / observations:\n\nIn models.py line 351:\n\n```\n try:\n length = str(super_len(data))\n```\n\nIf `super_len(data)` returns `None`, then `length == u'None'`, not `None`, which is probably not what was intended.\n\nThat comes into play around line 362:\n\n```\n if length:\n self.headers['Content-Length'] = length\n else:\n self.headers['Transfer-Encoding'] = 'chunked'\n```\n\nSince `length == u'None'`, the `Content-Length` header gets set to the string 'None', instead of the `Transfer-Encoding` header being set to 'chunked.'\n\nAnother question involves the `prepare_auth()` function. at lines 418-419:\n\n```\n # Recompute Content-Length\n self.prepare_content_length(self.body)\n```\n\nSince it calls `self.prepare_content_length()` unconditionally, it could result in a different Content-Length than was set in `prepare_body()`.\n\nI did build a version of requests that attempts to address the behavior above. I managed to get the PUT request to use 'Transfer-Encoding: chunked' instead of setting the Content-Length header (the output in the original post now shows the results), but it still raises the same exception (just a slightly different stack trace).\n\nI can do a pull request with my changes if that helps diagnose the problem.\n",
"So I can't address the first two concerns you brought up from my phone, but the last one is not valid. There are cases where during authentication `self.body` is changed and in those cases the Content-Length header has to be regenerated. That must stay.\n\nCan you give an example of when `super_len` returns `None` for when I can look at this later?\n",
"Hi,\n\nThe case where `super_len` returns `None` is when `data` is a generator. From the documentation, it looks like this is the way to make requests use [chunked encoding](http://docs.python-requests.org/en/latest/user/advanced/#chunk-encoded-requests).\n\nExample:\n\n```\ndef filegen(fo):\n yield fo.read(CHUNK_SIZE)\n\ndef main():\n ...\n with open(pathname, 'rb') as infile:\n response = session.put(upload_url, headers=upload_headers, data=filegen(infile))\n```\n\nRe: `prepare_auth` re-computing the Content-Length - I realize that's by design. It seems that it might need to check whether there's already a 'Transfer-Encoding: chunked' header, and if so, skip re-computing the content length (?). \n\nBut I'm not an HTTP expert, so I don't know if those two headers are mutually exclusive.\n",
"Changes to fix this, according to your estimation of the problem @dabono, are in 1.2.0 which is out on PyPI and Crate. I'm closing this but if you still have this issue, let me know and I'll reopen the issue.\n"
] |
https://api.github.com/repos/psf/requests/issues/1265
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1265/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1265/comments
|
https://api.github.com/repos/psf/requests/issues/1265/events
|
https://github.com/psf/requests/issues/1265
| 12,457,376 |
MDU6SXNzdWUxMjQ1NzM3Ng==
| 1,265 |
Seeing SSLError: [Errno 185090050] _ssl.c:340: error:0B084002:x509 certificate routines:X509_load_cert_crl_file:system lib
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/594239?v=4",
"events_url": "https://api.github.com/users/zopyx/events{/privacy}",
"followers_url": "https://api.github.com/users/zopyx/followers",
"following_url": "https://api.github.com/users/zopyx/following{/other_user}",
"gists_url": "https://api.github.com/users/zopyx/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/zopyx",
"id": 594239,
"login": "zopyx",
"node_id": "MDQ6VXNlcjU5NDIzOQ==",
"organizations_url": "https://api.github.com/users/zopyx/orgs",
"received_events_url": "https://api.github.com/users/zopyx/received_events",
"repos_url": "https://api.github.com/users/zopyx/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/zopyx/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/zopyx/subscriptions",
"type": "User",
"url": "https://api.github.com/users/zopyx",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 18 |
2013-03-26T16:29:28Z
|
2021-09-09T00:34:23Z
|
2013-04-26T08:20:58Z
|
NONE
|
resolved
|
I see a similar problem while running bandersnatcher on Ubuntu 10.04 LTS
```
bandersnatch==1.0dev
cov-core==1.7
coverage==3.6
distribute==0.6.35
mercurial==2.5.2
mock==1.0.1
py==1.4.13
pytest==2.3.4
pytest-cov==1.6
requests==1.1.0
virtualenv==1.6.1
wsgiref==0.1.2
```
```
2013-03-26 17:25:49,493 ERROR: Error syncing package: OpenCorePaste
Traceback (most recent call last):
File "/srv/pypi/lib/python2.7/site-packages/bandersnatch-1.0dev-py2.7.egg/bandersnatch/package.py", line 56, in sync
self.sync_release_files()
File "/srv/pypi/lib/python2.7/site-packages/bandersnatch-1.0dev-py2.7.egg/bandersnatch/package.py", line 74, in sync_release_files
self.download_file(release_file['url'], release_file['md5_digest'])
File "/srv/pypi/lib/python2.7/site-packages/bandersnatch-1.0dev-py2.7.egg/bandersnatch/package.py", line 137, in download_file
r = requests.get(url, stream=True)
File "/srv/pypi/lib/python2.7/site-packages/requests-1.1.0-py2.7.egg/requests/api.py", line 55, in get
return request('get', url, **kwargs)
File "/srv/pypi/lib/python2.7/site-packages/requests-1.1.0-py2.7.egg/requests/api.py", line 44, in request
return session.request(method=method, url=url, **kwargs)
File "/srv/pypi/lib/python2.7/site-packages/requests-1.1.0-py2.7.egg/requests/sessions.py", line 279, in request
resp = self.send(prep, stream=stream, timeout=timeout, verify=verify, cert=cert, proxies=proxies)
File "/srv/pypi/lib/python2.7/site-packages/requests-1.1.0-py2.7.egg/requests/sessions.py", line 374, in send
r = adapter.send(request, **kwargs)
File "/srv/pypi/lib/python2.7/site-packages/requests-1.1.0-py2.7.egg/requests/adapters.py", line 213, in send
raise SSLError(e)
SSLError: [Errno 185090050] _ssl.c:340: error:0B084002:x509 certificate routines:X509_load_cert_crl_file:system lib
```
The error happens with https downloads from PyPI.
|
{
"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/1265/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1265/timeline
| null |
completed
| null | null | false |
[
"Can you upgrade to 1.2.0 and report if this still happens?\n",
"@zopyx could you also report on your version of openssl (`openssl version`).\n",
"I'm very tempted to close this since @zopyx is unresponsive.\n",
"Sorry but have you heard of the concept \"holiday\"?\n\n> openssl version\n> OpenSSL 0.9.8k 25 Mar 2009\n\nI now moved my pypi-mirror to another host and the problem does not exisit on this machine.\n",
"Sorry but people abandoning bugs happens far too frequently. We've had tickets sit open for months because the original reporter won't respond. It gets frustrating after a while.\n\nWhat is different between the machines? Versions of OpenSSL possibly? Versions of requests possibly? Version 1.2.0 included fixes in urllib3 that eliminated most of these ssl bugs. Still, I'd like to know if this ever happens again.\n",
"Additionally everytime I see bandersnatch come up on Distutils-sig I think of this issue. Bandersnatch seems like a great improvement and I want to make sure it works without issues from requests.\n",
"Tried with request 1.2.0 on the old machine....same problem\n",
"Thanks. I'll dig into this later this week but @t-8ch might have some insight on this that could wrap it up sooner.\n",
"Old box: \n\npypi@lvps46-163-78-160:~$ cat /etc/issue\nUbuntu 10.04.4 LTS \\n \\l\n\nNew box:\n\ncat /etc/issue\nCentOS release 6.4 (Final)\nKernel \\r on an \\m\n\nopenssl version\nOpenSSL 1.0.0-fips 29 Mar 2010\n",
"Hm. I do recall there being an issue with versions of OpenSSL older than 1.0.0 but I don't recall if it was directly related to this exact message. Again @t-8ch would know more about it if he has the chance to take a look.\n",
"- What does the following code show you (in the relevant venv)?\n (And does the file exist)\n\n``` python\nimport requests.certs\nprint(requests.certs.where())\n```\n\n_Edit:_\nDo you have `REQUESTS_CA_BUNDLE` set in your environment?\n<\\/edit>\n- Does this happen with plain requests (`requests.get(\"https://httpbin.org\")`?\n- Where did you get python27 from?\n- Does it work with the default python26?\n- Which version of bandersnatch are you using?\n- Does your bandersnatcher change the location of the cert bundle? (via the `verify=` parameter)\n\nI can't reproduce this.\n\n@sigmavirus24 My ubuntu container was slow to install :-)\n",
"Yeah I can't reproduce it either but I want to make sure bandersnatch isn't hampered by us\n",
"> > > import requests.certs\n> > > print(requests.certs.where())\n> > > /srv/pypi/lib/python2.7/site-packages/requests-1.2.0-py2.7.egg/requests/cacert.pem\n\nNo such environment variable exists.\n\nrequests.get(\"https://httpbin.org\") is working\n\npython 2.7 self-compiled\n\nbandersnatch needs Python 2.7 afaik.\n",
"I assume the returned file exists, as the other call works.\nCould you edit `requests/certs.py` to print out or log the path, it is returning from `where()` at actual runtime\nMaybe some weird import magic is messing things up.\nWhich is your exact version (hg revision)?\n",
"@zopyx: Just wanted to remind you about this issue. =)\n",
"sorry, no time and meanwhile working on a different system. So I don't care\n\n2013/4/8 Thomas Weißschuh [email protected]\n\n> I assume the returned file exists, as the other call works.\n> Could you edit requests/certs.py to print out or log the path, it is\n> returning from where() at actual runtime\n> Maybe some weird import magic is messing things up.\n> Which is your exact version (hg revision)?\n> \n> —\n> Reply to this email directly or view it on GitHubhttps://github.com/kennethreitz/requests/issues/1265#issuecomment-16067154\n> .\n",
"Hello,\n\nI'm on Fedora 19 and coursera-dl tool failed for me on same error with python2.\n\n```\n$ python3\nPython 3.3.2 (default, Aug 23 2013, 19:00:04) \n[GCC 4.8.1 20130603 (Red Hat 4.8.1-1)] on linux\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\n>>> import requests\n>>> requests.get(\"https://httpbin.org\")\n/etc/ssl/certs/ca-certificates.crt\nTraceback (most recent call last):\n File \"/usr/lib/python3.3/site-packages/urllib3/util.py\", line 382, in ssl_wrap_socket\n context.load_verify_locations(ca_certs)\nFileNotFoundError: [Errno 2] No such file or directory\n\nDuring handling of the above exception, another exception occurred:\n\nTraceback (most recent call last):\n File \"/usr/lib/python3.3/site-packages/requests/adapters.py\", line 292, in send\n timeout=timeout\n File \"/usr/lib/python3.3/site-packages/urllib3/poolmanager.py\", line 255, in urlopen\n return super(ProxyManager, self).urlopen(method, url, redirect, **kw)\n File \"/usr/lib/python3.3/site-packages/urllib3/poolmanager.py\", line 155, in urlopen\n response = conn.urlopen(method, u.request_uri, **kw)\n File \"/usr/lib/python3.3/site-packages/urllib3/connectionpool.py\", line 454, in urlopen\n conn = self._get_conn(timeout=pool_timeout)\n File \"/usr/lib/python3.3/site-packages/urllib3/connectionpool.py\", line 272, in _get_conn\n return conn or self._new_conn()\n File \"/usr/lib/python3.3/site-packages/urllib3/connectionpool.py\", line 633, in _new_conn\n return self._prepare_conn(connection)\n File \"/usr/lib/python3.3/site-packages/urllib3/connectionpool.py\", line 604, in _prepare_conn\n connection.connect()\n File \"/usr/lib/python3.3/site-packages/urllib3/connectionpool.py\", line 127, in connect\n ssl_version=resolved_ssl_version)\n File \"/usr/lib/python3.3/site-packages/urllib3/util.py\", line 386, in ssl_wrap_socket\n raise SSLError(e)\nurllib3.exceptions.SSLError: [Errno 2] No such file or directory\n\nDuring handling of the above exception, another exception occurred:\n\nTraceback (most recent call last):\n File \"<stdin>\", line 1, in <module>\n File \"/usr/lib/python3.3/site-packages/requests/api.py\", line 55, in get\n return request('get', url, **kwargs)\n File \"/usr/lib/python3.3/site-packages/requests/api.py\", line 44, in request\n return session.request(method=method, url=url, **kwargs)\n File \"/usr/lib/python3.3/site-packages/requests/sessions.py\", line 335, in request\n resp = self.send(prep, **send_kwargs)\n File \"/usr/lib/python3.3/site-packages/requests/sessions.py\", line 438, in send\n r = adapter.send(request, **kwargs)\n File \"/usr/lib/python3.3/site-packages/requests/adapters.py\", line 331, in send\n raise SSLError(e)\nrequests.exceptions.SSLError: [Errno 2] No such file or directory\n>>> \n```\n\nInteresting is line 630 in `/usr/lib/python3.3/site-packages/urllib3/connectionpool.py` which creates new `HTTPSConnection` which uses default `ca_certs='/etc/ssl/certs/ca-certificates.crt'` in constructor, which references file that doesn't exist on Fedora/RHEL.\n\nSimple workaround:\n\n```\nln -s /etc/pki/tls/certs/ca-bundle.crt /etc/ssl/certs/ca-certificates.crt\n```\n",
"This location is inserted by the downstream fedora packaging.\nIt seems they are already fixed this:\nhttp://pkgs.fedoraproject.org/cgit/python-urllib3.git/commit/?id=4670672fa3bc24459a1a4468ab073a102f4d4a1c\n"
] |
https://api.github.com/repos/psf/requests/issues/1264
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1264/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1264/comments
|
https://api.github.com/repos/psf/requests/issues/1264/events
|
https://github.com/psf/requests/issues/1264
| 12,423,954 |
MDU6SXNzdWUxMjQyMzk1NA==
| 1,264 |
PROPFIND Method
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/211847?v=4",
"events_url": "https://api.github.com/users/randfb/events{/privacy}",
"followers_url": "https://api.github.com/users/randfb/followers",
"following_url": "https://api.github.com/users/randfb/following{/other_user}",
"gists_url": "https://api.github.com/users/randfb/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/randfb",
"id": 211847,
"login": "randfb",
"node_id": "MDQ6VXNlcjIxMTg0Nw==",
"organizations_url": "https://api.github.com/users/randfb/orgs",
"received_events_url": "https://api.github.com/users/randfb/received_events",
"repos_url": "https://api.github.com/users/randfb/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/randfb/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/randfb/subscriptions",
"type": "User",
"url": "https://api.github.com/users/randfb",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 1 |
2013-03-25T21:32:26Z
|
2021-09-09T04:00:47Z
|
2013-03-25T21:34:23Z
|
NONE
|
resolved
|
How hard would it be to add a PROPFIND method ? I'd like to interface to a webdav server.
|
{
"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/1264/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1264/timeline
| null |
completed
| null | null | false |
[
"You'd need to plumb it through from [urllib3](https://github.com/shazow/urllib3). The 'right' thing to do is going to be to build a new Transport Adapter.\n"
] |
https://api.github.com/repos/psf/requests/issues/1263
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1263/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1263/comments
|
https://api.github.com/repos/psf/requests/issues/1263/events
|
https://github.com/psf/requests/pull/1263
| 12,417,242 |
MDExOlB1bGxSZXF1ZXN0NDgwMTM1Mg==
| 1,263 |
iter_lines documentation for #1260
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/10137?v=4",
"events_url": "https://api.github.com/users/ghost/events{/privacy}",
"followers_url": "https://api.github.com/users/ghost/followers",
"following_url": "https://api.github.com/users/ghost/following{/other_user}",
"gists_url": "https://api.github.com/users/ghost/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/ghost",
"id": 10137,
"login": "ghost",
"node_id": "MDQ6VXNlcjEwMTM3",
"organizations_url": "https://api.github.com/users/ghost/orgs",
"received_events_url": "https://api.github.com/users/ghost/received_events",
"repos_url": "https://api.github.com/users/ghost/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/ghost/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/ghost/subscriptions",
"type": "User",
"url": "https://api.github.com/users/ghost",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 1 |
2013-03-25T19:25:41Z
|
2021-09-08T19:00:56Z
|
2013-03-25T19:48:45Z
|
NONE
|
resolved
|
I added a short note about the stream=True requirement to avoid loading the entire response all at once.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4",
"events_url": "https://api.github.com/users/kennethreitz/events{/privacy}",
"followers_url": "https://api.github.com/users/kennethreitz/followers",
"following_url": "https://api.github.com/users/kennethreitz/following{/other_user}",
"gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/kennethreitz",
"id": 119893,
"login": "kennethreitz",
"node_id": "MDQ6VXNlcjExOTg5Mw==",
"organizations_url": "https://api.github.com/users/kennethreitz/orgs",
"received_events_url": "https://api.github.com/users/kennethreitz/received_events",
"repos_url": "https://api.github.com/users/kennethreitz/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/kennethreitz/starred{/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/1263/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1263/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/1263.diff",
"html_url": "https://github.com/psf/requests/pull/1263",
"merged_at": "2013-03-25T19:48:45Z",
"patch_url": "https://github.com/psf/requests/pull/1263.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/1263"
}
| true |
[
":cake:\n"
] |
https://api.github.com/repos/psf/requests/issues/1262
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1262/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1262/comments
|
https://api.github.com/repos/psf/requests/issues/1262/events
|
https://github.com/psf/requests/issues/1262
| 12,369,198 |
MDU6SXNzdWUxMjM2OTE5OA==
| 1,262 |
Getting cookies doesn't work in some cases
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/3953504?v=4",
"events_url": "https://api.github.com/users/BugReporter2013/events{/privacy}",
"followers_url": "https://api.github.com/users/BugReporter2013/followers",
"following_url": "https://api.github.com/users/BugReporter2013/following{/other_user}",
"gists_url": "https://api.github.com/users/BugReporter2013/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/BugReporter2013",
"id": 3953504,
"login": "BugReporter2013",
"node_id": "MDQ6VXNlcjM5NTM1MDQ=",
"organizations_url": "https://api.github.com/users/BugReporter2013/orgs",
"received_events_url": "https://api.github.com/users/BugReporter2013/received_events",
"repos_url": "https://api.github.com/users/BugReporter2013/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/BugReporter2013/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/BugReporter2013/subscriptions",
"type": "User",
"url": "https://api.github.com/users/BugReporter2013",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 4 |
2013-03-24T03:50:14Z
|
2021-09-09T04:00:47Z
|
2013-03-24T12:37:20Z
|
NONE
|
resolved
|
Steps to reproduce:
```
import requests
from pyquery import PyQuery
def obtainCookies(username, password):
tokenUrl = 'https://news.ycombinator.com/newslogin'
loginUrl = 'https://news.ycombinator.com/y'
query = PyQuery(requests.get(tokenUrl).content)
token = query('input[name="fnid"]').val()
payload = {
'fnid' : token,
'u' : username,
'p' : password
}
return requests.post(loginUrl, data=payload).cookies
print len(obtainCookies('some_user', 'some_password'))
```
This code will return 0, yet the cookie is clearly being sent (can be seen in Chrome dev tools) AND the login is successful.
Why is this broken?
|
{
"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/1262/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1262/timeline
| null |
completed
| null | null | false |
[
"Chrome dev tools can only see requests made from inside Chrome, which means you don't know that the cookie is being returned in this case. Wireshark can tell you that. Could you check with Wireshark to see if the cookie is actually being returned?\n",
"How would you suggest to do that, given that the connection is TLS encrypted? \n\nRegardless, the login request is definitely successful, as I can see the username being embedded in the HTML of the response object (HN only does that for authenticated users). And I can see the cookie is definitely being set in Chrome when I login via the same page. See more sample code below (you can even run it, provided no one changes the password):\n\n```\nimport requests\nfrom pyquery import PyQuery\n\ntokenUrl = 'https://news.ycombinator.com/newslogin'\nloginUrl = 'https://news.ycombinator.com/y'\nquery = PyQuery(requests.get(tokenUrl).content)\ntoken = query('input[name=\"fnid\"]').val()\n\npayload = {\n 'fnid' : token,\n 'u' : 'requests_bug',\n 'p' : '123456'\n}\n\nr = requests.post(loginUrl, data=payload)\nprint r.text[r.text.index('user?id=requests_bug') - 31 : r.text.index('user?id=requests_bug') + 70]\nprint len(r.cookies)\n```\n\nResult:\n\n```\n>>> print r.text[r.text.index('user?id=requests_bug') - 31 : r.text.index('user?id=requests_bug') + 70]\n<span class=\"pagetop\"><a href=\"user?id=requests_bug\"><font color=#3c963c>requests_bug</font></a> \n>>> print len(r.cookies)\n0\n```\n\nSo, in short, I see no reason why the cookie wouldn't be returned in this case, unless requests drops it.\n",
"Ah, yes, I think this is related to a problem we've been having in v1.1.0 with cookie persistence: see #1228.\n\nThe cookies _are_ there. If you run your code in an interactive interpreter, you can do the following:\n\n``` python\n>>> r.history\n(<Response [302]>,)\n>>> len(r.history[0].cookies)\n1\n```\n\nHopefully v1.1.1 should make this a bit easier, but for now this will have to do.\n",
"Yes, this looks to be the same problem. Good to know it will be fixed as part of the next release.\n"
] |
https://api.github.com/repos/psf/requests/issues/1261
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1261/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1261/comments
|
https://api.github.com/repos/psf/requests/issues/1261/events
|
https://github.com/psf/requests/issues/1261
| 12,347,152 |
MDU6SXNzdWUxMjM0NzE1Mg==
| 1,261 |
Issue arising from #1190
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/240830?v=4",
"events_url": "https://api.github.com/users/sigmavirus24/events{/privacy}",
"followers_url": "https://api.github.com/users/sigmavirus24/followers",
"following_url": "https://api.github.com/users/sigmavirus24/following{/other_user}",
"gists_url": "https://api.github.com/users/sigmavirus24/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/sigmavirus24",
"id": 240830,
"login": "sigmavirus24",
"node_id": "MDQ6VXNlcjI0MDgzMA==",
"organizations_url": "https://api.github.com/users/sigmavirus24/orgs",
"received_events_url": "https://api.github.com/users/sigmavirus24/received_events",
"repos_url": "https://api.github.com/users/sigmavirus24/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/sigmavirus24/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/sigmavirus24/subscriptions",
"type": "User",
"url": "https://api.github.com/users/sigmavirus24",
"user_view_type": "public"
}
|
[
{
"color": "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 | 11 |
2013-03-23T01:21:55Z
|
2021-09-09T04:00:46Z
|
2013-03-27T18:31:37Z
|
CONTRIBUTOR
|
resolved
|
The tests caught this purely by coincidence with #1259.
The issue is that we're now passing optional keyword arguments and typical hooks don't expect them causing exceptions to be raised.
In essence, this is a big breaking change and we will have to make it very clear to users that this is in the next version. requests/requests-kerberos depends on this but this is going to break a good amount of people's code.
Admittedly it only rears its head when we try and set the defaults via `kwargs` in `Session.send`. Again that's due to #1259/#1258 but @geoff-kruss is right in asserting that those defaults should be passed.
Assuming we keep the addition that causes this, we need a plan how to announce it.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/240830?v=4",
"events_url": "https://api.github.com/users/sigmavirus24/events{/privacy}",
"followers_url": "https://api.github.com/users/sigmavirus24/followers",
"following_url": "https://api.github.com/users/sigmavirus24/following{/other_user}",
"gists_url": "https://api.github.com/users/sigmavirus24/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/sigmavirus24",
"id": 240830,
"login": "sigmavirus24",
"node_id": "MDQ6VXNlcjI0MDgzMA==",
"organizations_url": "https://api.github.com/users/sigmavirus24/orgs",
"received_events_url": "https://api.github.com/users/sigmavirus24/received_events",
"repos_url": "https://api.github.com/users/sigmavirus24/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/sigmavirus24/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/sigmavirus24/subscriptions",
"type": "User",
"url": "https://api.github.com/users/sigmavirus24",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/1261/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1261/timeline
| null |
completed
| null | null | false |
[
"So I'm personally in favor of keeping the existing behaviour and trying to make it as clear as possible to users that the behaviour has been changed.\n\nAlso, I forgot to include @mkomitee in on this ticket.\n",
"If I understand this correctly, we would have to _at minimum_ move from 1.1.0 to 1.2 to accomodate this change. Is that right?\n",
"Yeah this isn't a minor change. This is actually a more significant API change than I thought it would be when it was proposed.\n",
"Hmm. On one hand, it's been quite a while since our last big API change. On the other, the last one caused some displeasure amongst some people. If we go ahead we definitely need to document it clearly.\n",
"Frankly, I was surprised at how quickly my patch was accepted for this very reason. That said it's my opinion that the API without the change makes it impossible to do things that the user may expect if we're using an authentication handler which has to send requests. This was less of an issue pre 1.0 because authentication handlers had access to the session object if I recall correctly.\n",
"Our last major change should actually make this less impactful. Fewer people are using hooks now than before because of the reduction of the set of hooks to a single one -- response. Most of the people using the response hook are using it for Authentication handlers. I know we have kerberos covered, and NTLM would be simple to fix (I'll be happy to send a PR to Ben), but I don't know about others.\n\nPerhaps, you or Kenneth could make a blog post accompanying the release of 1.1.1/1.2 to announce this.\n",
"Are there any other API changing patches pending release, or is this the only one?\n",
"This is really the only one I can think of but I'll look over that tonight.\n",
"What I did was the simplest way, but the whole\n\n```\nresponse.content\nresponse.raw.release_conn()\nresponse.connection.send(response.request)\n```\n\nrigamarole isn't that great IMO. \n\nWe could stick these user-supplied parameters on the request object, modify them (as well as headers if needed for authentication purposes) and then call a new method `response.request.resend()`.\n\nIf we're okay with sticking these parameters on the request object itself, this may allow us to effect this change without altering the API.\n",
"... and when I say modify them I mean expose them so that authentication handlers could modify them if they need.\n",
"As part of pulling together the changelog tonight for #1233 I'm going to put together a blog post about this change. As such, I'm marking it closed because the \"fix\" has been decided.\n"
] |
https://api.github.com/repos/psf/requests/issues/1260
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1260/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1260/comments
|
https://api.github.com/repos/psf/requests/issues/1260/events
|
https://github.com/psf/requests/issues/1260
| 12,345,239 |
MDU6SXNzdWUxMjM0NTIzOQ==
| 1,260 |
Documentation for iter_lines doesn't indicate stream=True is required
|
{
"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 | 2 |
2013-03-23T00:04:12Z
|
2021-09-09T04:00:46Z
|
2013-03-25T21:35:30Z
|
NONE
|
resolved
|
This is the current description of `iter_lines`:
> Iterates over the response data, one line at a time. This avoids reading the content at once into memory for large responses.
The "avoids reading the content at once into memory" part seems to imply that this has streaming behavior, but that's not currently the case without specifying stream=True on the request.
Maybe this is just a reading comprehension fail on my part, but it took longer than I would have liked to get the desired behavior.
|
{
"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/1260/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1260/timeline
| null |
completed
| null | null | false |
[
"Feel free to submit a pull request to make it more explicit. We'll be happy to accept it.\n",
"Here's the pull request: https://github.com/kennethreitz/requests/pull/1263\n\nThanks for the quick response!\n"
] |
https://api.github.com/repos/psf/requests/issues/1259
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1259/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1259/comments
|
https://api.github.com/repos/psf/requests/issues/1259/events
|
https://github.com/psf/requests/pull/1259
| 12,339,961 |
MDExOlB1bGxSZXF1ZXN0NDc3MzMwOA==
| 1,259 |
Adding default kwargs in Session.send. Fixes #1258
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/208034?v=4",
"events_url": "https://api.github.com/users/geoff-kruss/events{/privacy}",
"followers_url": "https://api.github.com/users/geoff-kruss/followers",
"following_url": "https://api.github.com/users/geoff-kruss/following{/other_user}",
"gists_url": "https://api.github.com/users/geoff-kruss/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/geoff-kruss",
"id": 208034,
"login": "geoff-kruss",
"node_id": "MDQ6VXNlcjIwODAzNA==",
"organizations_url": "https://api.github.com/users/geoff-kruss/orgs",
"received_events_url": "https://api.github.com/users/geoff-kruss/received_events",
"repos_url": "https://api.github.com/users/geoff-kruss/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/geoff-kruss/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/geoff-kruss/subscriptions",
"type": "User",
"url": "https://api.github.com/users/geoff-kruss",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 3 |
2013-03-22T21:58:17Z
|
2021-09-08T19:00:57Z
|
2013-03-22T22:24:16Z
|
NONE
|
resolved
|
This ensures that the proper defaults are passed along to the associated adapters send() method.
As per the related issue - class attributes previously set on the Session object are not being properly passed along to the adapter when calling Session.send()
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/208034?v=4",
"events_url": "https://api.github.com/users/geoff-kruss/events{/privacy}",
"followers_url": "https://api.github.com/users/geoff-kruss/followers",
"following_url": "https://api.github.com/users/geoff-kruss/following{/other_user}",
"gists_url": "https://api.github.com/users/geoff-kruss/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/geoff-kruss",
"id": 208034,
"login": "geoff-kruss",
"node_id": "MDQ6VXNlcjIwODAzNA==",
"organizations_url": "https://api.github.com/users/geoff-kruss/orgs",
"received_events_url": "https://api.github.com/users/geoff-kruss/received_events",
"repos_url": "https://api.github.com/users/geoff-kruss/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/geoff-kruss/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/geoff-kruss/subscriptions",
"type": "User",
"url": "https://api.github.com/users/geoff-kruss",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/1259/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1259/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/1259.diff",
"html_url": "https://github.com/psf/requests/pull/1259",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/1259.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/1259"
}
| true |
[
"Nope - this doesn't work. On running the unit tests I see now that hook() lands up with an unexpected keyword argument\n",
"It gets an unexpected keyword argument unrelated to your change.\n",
"Scratch that, thought you'd only added the proxies argument as a default.\n"
] |
https://api.github.com/repos/psf/requests/issues/1258
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1258/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1258/comments
|
https://api.github.com/repos/psf/requests/issues/1258/events
|
https://github.com/psf/requests/issues/1258
| 12,338,339 |
MDU6SXNzdWUxMjMzODMzOQ==
| 1,258 |
Should Session.send() ignore Session.proxies?
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/208034?v=4",
"events_url": "https://api.github.com/users/geoff-kruss/events{/privacy}",
"followers_url": "https://api.github.com/users/geoff-kruss/followers",
"following_url": "https://api.github.com/users/geoff-kruss/following{/other_user}",
"gists_url": "https://api.github.com/users/geoff-kruss/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/geoff-kruss",
"id": 208034,
"login": "geoff-kruss",
"node_id": "MDQ6VXNlcjIwODAzNA==",
"organizations_url": "https://api.github.com/users/geoff-kruss/orgs",
"received_events_url": "https://api.github.com/users/geoff-kruss/received_events",
"repos_url": "https://api.github.com/users/geoff-kruss/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/geoff-kruss/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/geoff-kruss/subscriptions",
"type": "User",
"url": "https://api.github.com/users/geoff-kruss",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 5 |
2013-03-22T21:21:15Z
|
2021-09-09T04:00:43Z
|
2013-03-31T05:21:52Z
|
NONE
|
resolved
|
My test code:
``` python
import requests
s = requests.Session()
s.proxies = {'http': 'myproxy:3128'}
r = requests.Request(method='GET', url='http://www.google.com')
s.send(r.prepare())
```
In the above case, the proxy is ignored completely.
It looks to me like in Session.request() the following code is run:
``` python
proxies = merge_kwargs(proxies, self.proxies)
```
But in the send() function this is not happening. I am not sure if this is a bug - or if always passing proxies to the send() function explicitly is the intended behavior.
I am relatively new in using the requests library - my apologies if this has been brought up before or if i'm missing something obvious.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/240830?v=4",
"events_url": "https://api.github.com/users/sigmavirus24/events{/privacy}",
"followers_url": "https://api.github.com/users/sigmavirus24/followers",
"following_url": "https://api.github.com/users/sigmavirus24/following{/other_user}",
"gists_url": "https://api.github.com/users/sigmavirus24/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/sigmavirus24",
"id": 240830,
"login": "sigmavirus24",
"node_id": "MDQ6VXNlcjI0MDgzMA==",
"organizations_url": "https://api.github.com/users/sigmavirus24/orgs",
"received_events_url": "https://api.github.com/users/sigmavirus24/received_events",
"repos_url": "https://api.github.com/users/sigmavirus24/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/sigmavirus24/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/sigmavirus24/subscriptions",
"type": "User",
"url": "https://api.github.com/users/sigmavirus24",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/1258/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1258/timeline
| null |
completed
| null | null | false |
[
"That should be a simple one line fix using `setdefault` on the arguments to send\n",
"@sigmavirus24 something like the following:\n\n``` python\n def send(self, request, **kwargs):\n \"\"\"Send a given PreparedRequest.\"\"\"\n adapter = self.get_adapter(url=request.url)\n\n kwargs.setdefault('stream', self.stream)\n kwargs.setdefault('cert', self.cert)\n kwargs.setdefault('verify', self.verify)\n kwargs.setdefault('proxies', self.proxies)\n\n r = adapter.send(request, **kwargs)\n return r\n```\n",
"Exactly what I was thinking of. :)\n",
"I have opened [Pull Request 1259](https://github.com/kennethreitz/requests/pull/1259) related to this issue.\n",
"See #1267 \n"
] |
https://api.github.com/repos/psf/requests/issues/1257
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1257/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1257/comments
|
https://api.github.com/repos/psf/requests/issues/1257/events
|
https://github.com/psf/requests/issues/1257
| 12,323,000 |
MDU6SXNzdWUxMjMyMzAwMA==
| 1,257 |
Give hooks a way to retry requests in the same session.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/17239?v=4",
"events_url": "https://api.github.com/users/avallee/events{/privacy}",
"followers_url": "https://api.github.com/users/avallee/followers",
"following_url": "https://api.github.com/users/avallee/following{/other_user}",
"gists_url": "https://api.github.com/users/avallee/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/avallee",
"id": 17239,
"login": "avallee",
"node_id": "MDQ6VXNlcjE3MjM5",
"organizations_url": "https://api.github.com/users/avallee/orgs",
"received_events_url": "https://api.github.com/users/avallee/received_events",
"repos_url": "https://api.github.com/users/avallee/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/avallee/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/avallee/subscriptions",
"type": "User",
"url": "https://api.github.com/users/avallee",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 4 |
2013-03-22T15:09:44Z
|
2021-09-09T04:00:43Z
|
2013-03-30T00:16:11Z
|
NONE
|
resolved
|
I am talking to an app with a custom auth module that I've written. The auth object installs a hook, and if the response fails and indicates that the auth object is expired, I get a new auth object.
I'd like to be able to retry the exact same request with the same settings as the previous request but with a new auth object from my response hook. This means I'd like to be able to make the request as part of the same session (ideally) but to also have access to the initial request parameters such as verify.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/240830?v=4",
"events_url": "https://api.github.com/users/sigmavirus24/events{/privacy}",
"followers_url": "https://api.github.com/users/sigmavirus24/followers",
"following_url": "https://api.github.com/users/sigmavirus24/following{/other_user}",
"gists_url": "https://api.github.com/users/sigmavirus24/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/sigmavirus24",
"id": 240830,
"login": "sigmavirus24",
"node_id": "MDQ6VXNlcjI0MDgzMA==",
"organizations_url": "https://api.github.com/users/sigmavirus24/orgs",
"received_events_url": "https://api.github.com/users/sigmavirus24/received_events",
"repos_url": "https://api.github.com/users/sigmavirus24/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/sigmavirus24/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/sigmavirus24/subscriptions",
"type": "User",
"url": "https://api.github.com/users/sigmavirus24",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/1257/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1257/timeline
| null |
completed
| null | null | false |
[
"This is a duplicate of the PR #1190 which was merged. We really have to cut a new release. If that PR suits your needs (which I suspect it does), feel free to close this. I don't want to close it preemptively.\n",
"Also related, #1261\n",
"Closing due to no response\n",
"Yeah, no problem. Looks like #1190 will do for me.\n"
] |
https://api.github.com/repos/psf/requests/issues/1256
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1256/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1256/comments
|
https://api.github.com/repos/psf/requests/issues/1256/events
|
https://github.com/psf/requests/pull/1256
| 12,314,397 |
MDExOlB1bGxSZXF1ZXN0NDc1OTc3OQ==
| 1,256 |
Allowing @ in proxy passwords and usernames.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/3275593?v=4",
"events_url": "https://api.github.com/users/pradyunsg/events{/privacy}",
"followers_url": "https://api.github.com/users/pradyunsg/followers",
"following_url": "https://api.github.com/users/pradyunsg/following{/other_user}",
"gists_url": "https://api.github.com/users/pradyunsg/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/pradyunsg",
"id": 3275593,
"login": "pradyunsg",
"node_id": "MDQ6VXNlcjMyNzU1OTM=",
"organizations_url": "https://api.github.com/users/pradyunsg/orgs",
"received_events_url": "https://api.github.com/users/pradyunsg/received_events",
"repos_url": "https://api.github.com/users/pradyunsg/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/pradyunsg/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/pradyunsg/subscriptions",
"type": "User",
"url": "https://api.github.com/users/pradyunsg",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 2 |
2013-03-22T10:56:34Z
|
2021-09-08T19:00:56Z
|
2013-03-22T10:58:49Z
|
CONTRIBUTOR
|
resolved
|
Well, I don't have much to say, except that, the change that I made, is to allow for @ in the passwords when someone is using a proxy (like me!). Someone may change it to be more readable.
Test script:
``` python
import requests
proxy = {'http':'http://test:test@[email protected]:80'} # imaginary proxy, I used a real one in my case
print requests.get('http://google.com', proxies=proxy)
```
Before:
``` python
Traceback (most recent call last):
File "<pyshell#2>", line 1, in <module>
requests.get('http://google.com', proxies=proxy)
File "C:\Python2.7 For Chintoo\lib\site-packages\requests-1.1.0-py2.7.egg\requests\api.py", line 55, in get
return request('get', url, **kwargs)
File "C:\Python2.7 For Chintoo\lib\site-packages\requests-1.1.0-py2.7.egg\requests\api.py", line 44, in request
return session.request(method=method, url=url, **kwargs)
File "C:\Python2.7 For Chintoo\lib\site-packages\requests-1.1.0-py2.7.egg\requests\sessions.py", line 279, in request
resp = self.send(prep, stream=stream, timeout=timeout, verify=verify, cert=cert, proxies=proxies)
File "C:\Python2.7 For Chintoo\lib\site-packages\requests-1.1.0-py2.7.egg\requests\sessions.py", line 374, in send
r = adapter.send(request, **kwargs)
File "C:\Python2.7 For Chintoo\lib\site-packages\requests-1.1.0-py2.7.egg\requests\adapters.py", line 209, in send
raise ConnectionError(e)
ConnectionError: HTTPConnectionPool(host='[email protected]', port=None): Max retries exceeded with url: http://google.com/ (Caused by <class 'socket.gaierror'>: [Errno 11003] getaddrinfo failed)
```
Now:
``` python
<Response [407]>
```
|
{
"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/1256/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1256/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/1256.diff",
"html_url": "https://github.com/psf/requests/pull/1256",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/1256.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/1256"
}
| true |
[
"This change has been made in urllib3, not in Requests. We vendor in a copy of urllib3 that we keep in sync with the upstream version, so any change in urllib3 should be made [there](https://github.com/shazow/urllib3).\n\nThanks for creating the PR though!\n",
"@LukaTes just saw that, I was going to delete this request...\n"
] |
https://api.github.com/repos/psf/requests/issues/1255
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1255/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1255/comments
|
https://api.github.com/repos/psf/requests/issues/1255/events
|
https://github.com/psf/requests/issues/1255
| 12,303,936 |
MDU6SXNzdWUxMjMwMzkzNg==
| 1,255 |
"Pushable" streaming upload requests
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/347571?v=4",
"events_url": "https://api.github.com/users/naftulikay/events{/privacy}",
"followers_url": "https://api.github.com/users/naftulikay/followers",
"following_url": "https://api.github.com/users/naftulikay/following{/other_user}",
"gists_url": "https://api.github.com/users/naftulikay/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/naftulikay",
"id": 347571,
"login": "naftulikay",
"node_id": "MDQ6VXNlcjM0NzU3MQ==",
"organizations_url": "https://api.github.com/users/naftulikay/orgs",
"received_events_url": "https://api.github.com/users/naftulikay/received_events",
"repos_url": "https://api.github.com/users/naftulikay/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/naftulikay/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/naftulikay/subscriptions",
"type": "User",
"url": "https://api.github.com/users/naftulikay",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 10 |
2013-03-22T01:54:12Z
|
2021-09-09T04:00:45Z
|
2013-03-28T03:47:39Z
|
NONE
|
resolved
|
I have an interesting situation which doesn't seem to be covered by the `requests` API. For a project I'm working on, I have a server which receives a multipart upload from a user in chunks in a handler which looks and works something like this:
```
class MyUploadHandler(BaseUploadHandler):
def on_file_started(self, file_name):
pass
def on_file_chunk(self, chunk):
pass
def on_file_finished(self, file_size):
pass
```
What I'd like to do is something like this:
```
import requests
class MyUploadHandler(BaseUploadHandler):
def on_file_started(self, file_name):
self.request = requests.put("http://secondary.com/upload/url", stream=True)
def on_file_chunk(self, chunk):
self.request.raw.write(chunk)
def on_file_finished(self, file_size):
self.request.finish()
```
It seems that this is currently not possible in the API, though I could be wrong. If I have to rewrite my code to incorporate a [file-like object](http://docs.python-requests.org/en/latest/user/advanced/#streaming-uploads) or a [generator](http://docs.python-requests.org/en/latest/user/advanced/#chunk-encoded-requests), I'd probably have to get my hands dirty with threading and this would make everything 1,000,000 times harder in my application than they should be.
Is what I'm talking about currently possible in `requests`, and if not, can the feature be easily added?
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/240830?v=4",
"events_url": "https://api.github.com/users/sigmavirus24/events{/privacy}",
"followers_url": "https://api.github.com/users/sigmavirus24/followers",
"following_url": "https://api.github.com/users/sigmavirus24/following{/other_user}",
"gists_url": "https://api.github.com/users/sigmavirus24/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/sigmavirus24",
"id": 240830,
"login": "sigmavirus24",
"node_id": "MDQ6VXNlcjI0MDgzMA==",
"organizations_url": "https://api.github.com/users/sigmavirus24/orgs",
"received_events_url": "https://api.github.com/users/sigmavirus24/received_events",
"repos_url": "https://api.github.com/users/sigmavirus24/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/sigmavirus24/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/sigmavirus24/subscriptions",
"type": "User",
"url": "https://api.github.com/users/sigmavirus24",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/1255/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1255/timeline
| null |
completed
| null | null | false |
[
"**tl;dr** It can not be easily added as far as I know and likely won't be considered by Kenneth given we're in a feature freeze.\n\nSomething about the API you show in the second snippet is oddly attractive but not at all what is within the realm of possibility for requests. I think a generator is your best bet in this instance but without knowing exactly what you're doing (beyond this) I can't speak as to the need for threading (although frankly I'm unsure of how that would be necessary for a generator).\n\nWith respect to the feature freeze please see #1165. As for adding this, all we do in requests is prepare a request to be sent using urllib3. You may be able to do something like this using urllib3 but the initial API will not be as simple as ours. It's a great library though and I think it has more functionality than what requests exposes to be frank. @shazow could definitely confirm or deny the ability to do this there though.\n",
"Since I haven't really done work like this in Python before (ie: I'm pretty new and confused by generators) I'm not sure where to start when converting my push to a pull.\n\nEssentially, the data is pushed to me in my handler. I need to essentially write a generator which blocks while reading from a queue of some sort. (If you'd like to help me work this out, you can check out my [question on SO](http://stackoverflow.com/questions/15557841/streaming-upload-request)) As new data becomes available and the `on_file_chunk` method is called, the handler should provide data to the generator which should be able to provide data to the request for the request body. Clear as mud, right?\n\nEssentially, I need something like this:\n\n```\nimport requests\n\nclass MyUploadHandler(BaseUploadHandler):\n\n def on_file_started(self, file_name):\n self.request = requests.put(\"http://secondary.com/upload/url\", data=self.generate_data())\n\n def generate_data(self):\n # block until data is available. when it is, yield it\n ... \n\n def on_file_chunk(self, chunk):\n # send the data to the generator so that it can be returned to the request\n ...\n\n def on_file_finished(self, file_size):\n # inform the generator that it's 'done'\n```\n\nThis part, crossing over between data being pushed to data being pulled, is what's stumping me currently. It's okay that you might not implement the functionality, but I'm totally in the dark on how to make this happen. \n\nAny ideas? Feel free to jump in [on SO](http://stackoverflow.com/questions/15557841/streaming-upload-request).\n",
"In reference to this feature request, what do you guys consider a file-like object? For example, which methods are critical for `requests` to treat an object passed as `data` as a file-like object?\n\nFor example, what objects should I implement in this class:\n\n```\nclass FlieLike(object):\n pass\n\npseudo_file = FileLike()\n\nrequests.put(\"http://outgoing.com/put\", data=pseudo_file)\n```\n\nIs `__iter__` enough? Should I instead implement `next`?\n",
"Actually, `__iter__` and `next` make it an iterable, not a file-like object. Is there any reason you can't block until all the chunks are there and then just build a generator from them?\n",
"File-like objects require at least (I think) a `read` method and I think we also look for a `seek` method so we can determine `Content-Length`. We don't determine that (or chunk) the upload when the object has the `__iter__` method but is not any sort of string, list or dict.\n\nYou could build an object that is a generator easily.\n\n``` python\nfrom collections import Iterator\n\nclass MyGenerator(Iterator):\n def __init__(self, connection):\n self.connection = connection\n\n def __iter__(self):\n while True\n chunk = self.connection.read() # blocks\n if chunk: # e.g., if there's something to send\n yield chunk\n else: # what to do otherwise\n break # you don't necessarily have to do this\n```\n\nThen you would do something roughly like:\n\n``` python\nconn = incoming_data()\nresponse = requests.put(url, data=MyGenerator(conn))\n```\n\nThe `read` should be a blocking method, not a non-blocking `read`, and that should save you. You might need to define (depending on your version of python) either `__next__` or `next`. For that, you can just check out a similar generator I wrote [here](https://github.com/sigmavirus24/github3.py/blob/develop/github3/structs.py#L5). (It isn't exactly the same and isn't simple enough to just show you it for the above purposes, it does a lot more work than you want to do, otherwise I just would have pointed you in that direction.)\n",
"@Lukasa I can't wait until all the chunks are there, because this is a file upload server and it's imperative that only the current chunk from the client stays in memory at any one given time. If they were all being saved, writing a generator or a file-like object would be a cakewalk. \n\n@sigmavirus24 I can't reliably provide `Content-Length`, as I'm accepting uploads from users and I can't know for certain the size of the files they're uploading. They could easily upload a 4GB file and lie to me about the content length being 1024B. \n\nYour example makes a lot more sense of the problem than I've seen so far, so kudos on that! Essentially, it would seem that I'd have to implement a blocking queue and a thread to make this happen:\n\n```\nfrom collections import Iterator\n\nimport requests\n\nclass MyUploadHandler(BaseUploadHandler):\n\n is_running = True \n\n def setup_request(self):\n self.request = requests.put(\"http://myurl.com/put\", data=MyGenerator(self.queue, self))\n\n def on_file_started(self, file_name):\n self.queue = Queue(maxsize=1)\n self.upload_thread = Thread(target=self.setup_request, args=(self))\n self.upload_thread.start()\n\n def on_file_chunk(self, chunk):\n self.queue.put(chunk)\n\n def on_file_finished(self, filesize):\n self.is_running = False\n\nclass MyGenerator(Iterator):\n\n def __init__(self, queue, upload_handler):\n self.queue = queue\n self.upload_handler = upload_handler\n\n def __iter__(self):\n while self.upload_handler.is_running:\n yield queue.get()\n```\n\nSomething like the above would seem to be able to solve my problem, right? Essentially, when a new file comes down the pipe, an upload request is generated in another thread so that it won't block the main thread. Immediately after being created, it attempts to get from the queue, which blocks because it's empty. Then, when the upload handler receives a chunk, it puts it into the queue, which is read by the request. The put will block if there's more than one chunk in the queue, so this will manage memory well. This will continue until the upload is done. Once it's done, we simply set `is_running` to `False`, which breaks the iterator's loop and the thread (presumably) exits gracefully.\n\nThe only problem I can see so far is trying to handle the case in which a request failed. We'd have to check in the `on_file_chunk` method and break the whole process if the request failed. Does this seem to work? Like I said, I'm a bit new at this whole generator thing, but I understand threading fairly well. \n",
"Sorry for the confusion. I don't believe that with the chunked encoding you have to provide `Content-Length`. I meant that was one thing having a file-like object was used for.\n\nI don't quite know python Threads so well, but I'm going to take a few shots in the dark. If there's an issue when you start the thread (when the request is made), you'll need to catch any exceptions from the call and set `is_running` to False. I don't know how Threads raise exceptions (i.e. if an exception was raised from requests how would that affect the running of the thread) so I don't know if there's a better way of doing it.\n\nI am also not 100% sure that you need the Threads. Can you not wait for the first chunk (at least) and then start the put request? Doing that you'd have the first one so your generator would return a chunk immediately and then it would get caught on the read from your client(s). This would have the added benefit that if something went wrong on either end, you wouldn't have to worry about cleaning up threads.\n",
"I'd really like to not have to worry about threading if possible, but I'm not sure how to facilitate it. I guess I'm not understanding your logic. Essentially, I need to have the iterator block until another chunk is ready, and if the request is running in the same thread as my handler, if anything becomes blocked, nothing happens and the whole program hangs. \n\nCan you give me an example of what you're talking about? It's definitely possible for me to start with the first chunk, I'm just not sure about how the implementation would look like for the generator. \n",
"I guess I'm thinking of something like:\n\n``` python\nclass MyUploadHandler(BaseUploadHander):\n def generate_data(self):\n # yields data\n pass\n\n def on_file_started(self):\n self.response = requests.put(url, data=self.generate_data())\n```\n\nHonestly, I wouldn't think the issue of `generate_data` blocking would be negative since that's what you want. And if the `put` request fails then you're process will hang either way. You say you can not keep the entire file in memory so assuming there are two threads, if one hangs the other still can't proceed unless it goes on to try a second put request with the rest of the data. If that's your plan/design then yes you absolutely must use Threads, otherwise I think you might be able to use a simpler design like above.\n",
"@sigmavirus24 In your example, how then would I pass data received in `on_file_chunk` to `generate_data`?\n\nSince I imagine that the call to `requests.put` blocks until completed, I would imagine that this code would essentially immediately hang. Looks like I'm working with threads.\n"
] |
https://api.github.com/repos/psf/requests/issues/1254
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1254/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1254/comments
|
https://api.github.com/repos/psf/requests/issues/1254/events
|
https://github.com/psf/requests/pull/1254
| 12,302,508 |
MDExOlB1bGxSZXF1ZXN0NDc1NDAxMg==
| 1,254 |
url-authentication
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/563398?v=4",
"events_url": "https://api.github.com/users/jkakar/events{/privacy}",
"followers_url": "https://api.github.com/users/jkakar/followers",
"following_url": "https://api.github.com/users/jkakar/following{/other_user}",
"gists_url": "https://api.github.com/users/jkakar/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/jkakar",
"id": 563398,
"login": "jkakar",
"node_id": "MDQ6VXNlcjU2MzM5OA==",
"organizations_url": "https://api.github.com/users/jkakar/orgs",
"received_events_url": "https://api.github.com/users/jkakar/received_events",
"repos_url": "https://api.github.com/users/jkakar/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/jkakar/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jkakar/subscriptions",
"type": "User",
"url": "https://api.github.com/users/jkakar",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 1 |
2013-03-22T00:57:54Z
|
2021-09-08T19:00:55Z
|
2013-03-22T04:06:23Z
|
CONTRIBUTOR
|
resolved
|
- When credentials are included in a URL they are extracted and passed
to the server using HTTP Basic Auth.
I've tested this by hand and it works. I'm not quite sure how I
should test this in `test_requests.py`. I would normally mock this
kind of thing, since I don't have a persistent service that requires
credentials running to use from a test, which seems to be the existing
pattern. I'm reluctant to add a dependency on a mocking library and
jump through all those hoops if that technique is not already used.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4",
"events_url": "https://api.github.com/users/kennethreitz/events{/privacy}",
"followers_url": "https://api.github.com/users/kennethreitz/followers",
"following_url": "https://api.github.com/users/kennethreitz/following{/other_user}",
"gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/kennethreitz",
"id": 119893,
"login": "kennethreitz",
"node_id": "MDQ6VXNlcjExOTg5Mw==",
"organizations_url": "https://api.github.com/users/kennethreitz/orgs",
"received_events_url": "https://api.github.com/users/kennethreitz/received_events",
"repos_url": "https://api.github.com/users/kennethreitz/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/kennethreitz/starred{/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/1254/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1254/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/1254.diff",
"html_url": "https://github.com/psf/requests/pull/1254",
"merged_at": "2013-03-22T04:06:23Z",
"patch_url": "https://github.com/psf/requests/pull/1254.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/1254"
}
| true |
[
":sparkles: :cake: :sparkles:\n"
] |
https://api.github.com/repos/psf/requests/issues/1253
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1253/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1253/comments
|
https://api.github.com/repos/psf/requests/issues/1253/events
|
https://github.com/psf/requests/pull/1253
| 12,292,052 |
MDExOlB1bGxSZXF1ZXN0NDc0ODUwMA==
| 1,253 |
Attach original Request object to Response object.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1479351?v=4",
"events_url": "https://api.github.com/users/markgollnick-wf/events{/privacy}",
"followers_url": "https://api.github.com/users/markgollnick-wf/followers",
"following_url": "https://api.github.com/users/markgollnick-wf/following{/other_user}",
"gists_url": "https://api.github.com/users/markgollnick-wf/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/markgollnick-wf",
"id": 1479351,
"login": "markgollnick-wf",
"node_id": "MDQ6VXNlcjE0NzkzNTE=",
"organizations_url": "https://api.github.com/users/markgollnick-wf/orgs",
"received_events_url": "https://api.github.com/users/markgollnick-wf/received_events",
"repos_url": "https://api.github.com/users/markgollnick-wf/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/markgollnick-wf/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/markgollnick-wf/subscriptions",
"type": "User",
"url": "https://api.github.com/users/markgollnick-wf",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 4 |
2013-03-21T19:54:26Z
|
2021-09-08T19:00:56Z
|
2013-03-21T20:42:40Z
|
NONE
|
resolved
|
Allows for quickly creating Requests similar to those already made, or for
examining Request object manipulation by third party hooks or authentication
methods.
This is particularly useful when using requests with something like oauthlib: https://github.com/requests/requests-oauthlib
There appeared to be an instance of the original request object passed along as far as `Session.send()`, but it was never used after that. So, I grabbed it and attached it to the Response object.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1479351?v=4",
"events_url": "https://api.github.com/users/markgollnick-wf/events{/privacy}",
"followers_url": "https://api.github.com/users/markgollnick-wf/followers",
"following_url": "https://api.github.com/users/markgollnick-wf/following{/other_user}",
"gists_url": "https://api.github.com/users/markgollnick-wf/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/markgollnick-wf",
"id": 1479351,
"login": "markgollnick-wf",
"node_id": "MDQ6VXNlcjE0NzkzNTE=",
"organizations_url": "https://api.github.com/users/markgollnick-wf/orgs",
"received_events_url": "https://api.github.com/users/markgollnick-wf/received_events",
"repos_url": "https://api.github.com/users/markgollnick-wf/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/markgollnick-wf/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/markgollnick-wf/subscriptions",
"type": "User",
"url": "https://api.github.com/users/markgollnick-wf",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/1253/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1253/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/1253.diff",
"html_url": "https://github.com/psf/requests/pull/1253",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/1253.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/1253"
}
| true |
[
"First off, thanks for the contribution :)\n\nThat being said: Request objects are only for creating PreparedRequest objects, and shouldn't be used in this way.\n",
"That's the idea; use the returned Request object to create a PreparedRequest object, and issue a second request using a new or an existing Session. With this, the developer has access, client-side, to what was actually sent to the server, whether doing low-level stuff with Request objects, or simply using `.get()`.\n",
"All responses currently should have a PreparedRequest object attached them already. \n",
"Ah, I see now... `dir()` does indeed show the existence of a PreparedRequest on the Response (which, incidentally, this commit completely overwrites with the Request object...) It wasn't in the documentation so I completely missed it. Got it! Thanks!\n"
] |
https://api.github.com/repos/psf/requests/issues/1252
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1252/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1252/comments
|
https://api.github.com/repos/psf/requests/issues/1252/events
|
https://github.com/psf/requests/issues/1252
| 12,252,455 |
MDU6SXNzdWUxMjI1MjQ1NQ==
| 1,252 |
UnicodeDecodeError: 'ascii' codec can't decode byte 0xff in position 169: ordinal not in range(128)
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/352270?v=4",
"events_url": "https://api.github.com/users/michaelhelmick/events{/privacy}",
"followers_url": "https://api.github.com/users/michaelhelmick/followers",
"following_url": "https://api.github.com/users/michaelhelmick/following{/other_user}",
"gists_url": "https://api.github.com/users/michaelhelmick/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/michaelhelmick",
"id": 352270,
"login": "michaelhelmick",
"node_id": "MDQ6VXNlcjM1MjI3MA==",
"organizations_url": "https://api.github.com/users/michaelhelmick/orgs",
"received_events_url": "https://api.github.com/users/michaelhelmick/received_events",
"repos_url": "https://api.github.com/users/michaelhelmick/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/michaelhelmick/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/michaelhelmick/subscriptions",
"type": "User",
"url": "https://api.github.com/users/michaelhelmick",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 50 |
2013-03-20T22:48:10Z
|
2021-09-08T11:00:35Z
|
2013-05-29T08:02:53Z
|
NONE
|
resolved
|
Something similar has been posted before: https://github.com/kennethreitz/requests/issues/403
This is using `requests 1.1.0`
But this problem is still popping up while trying to post _just_ a file _and_ a file with data.
On top of the similar issue, I've posted about this before and in `requests_oauthlib` it has said to been fixed; If you wish, I'll try and find the issue in that lib, just too lazy to open a new tab now ;P
Error:
```
Traceback (most recent call last):
File "/Users/mikehelmick/.virtualenv/twython/lib/python2.7/site-packages/requests/sessions.py", line 340, in post
return self.request('POST', url, data=data, **kwargs)
File "/Users/mikehelmick/.virtualenv/twython/lib/python2.7/site-packages/requests/sessions.py", line 279, in request
resp = self.send(prep, stream=stream, timeout=timeout, verify=verify, cert=cert, proxies=proxies)
File "/Users/mikehelmick/.virtualenv/twython/lib/python2.7/site-packages/requests/sessions.py", line 374, in send
r = adapter.send(request, **kwargs)
File "/Users/mikehelmick/.virtualenv/twython/lib/python2.7/site-packages/requests/adapters.py", line 174, in send
timeout=timeout
File "/Users/mikehelmick/.virtualenv/twython/lib/python2.7/site-packages/requests/packages/urllib3/connectionpool.py", line 422, in urlopen
body=body, headers=headers)
File "/Users/mikehelmick/.virtualenv/twython/lib/python2.7/site-packages/requests/packages/urllib3/connectionpool.py", line 274, in _make_request
conn.request(method, url, **httplib_request_kw)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 955, in request
self._send_request(method, url, body, headers)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 989, in _send_request
self.endheaders(body)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 951, in endheaders
self._send_output(message_body)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 809, in _send_output
msg += message_body
UnicodeDecodeError: 'ascii' codec can't decode byte 0xff in position 169: ordinal not in range(128)
```
I posted a gist with sample code if any of you needed to test it. If you guys are really being lazy, I can post some app/user tokens for you to use (let me know).
Gist: https://gist.github.com/michaelhelmick/5199754
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4",
"events_url": "https://api.github.com/users/Lukasa/events{/privacy}",
"followers_url": "https://api.github.com/users/Lukasa/followers",
"following_url": "https://api.github.com/users/Lukasa/following{/other_user}",
"gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Lukasa",
"id": 1382556,
"login": "Lukasa",
"node_id": "MDQ6VXNlcjEzODI1NTY=",
"organizations_url": "https://api.github.com/users/Lukasa/orgs",
"received_events_url": "https://api.github.com/users/Lukasa/received_events",
"repos_url": "https://api.github.com/users/Lukasa/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Lukasa",
"user_view_type": "public"
}
|
{
"+1": 1,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 1,
"url": "https://api.github.com/repos/psf/requests/issues/1252/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1252/timeline
| null |
completed
| null | null | false |
[
"So here's my first guess (but I'll obviously look into this more): I think that OAuth1 might be generating unicode and opening the file in binary form will cause this issue due to how httplib sends the message body. Also this may be related to #1250.\n\n@Lukasa, opinions?\n",
"That seems like a reasonable diagnosis. We get lots of obscure bugs in Requests from problems with encoding, I'm adding it to my list of things I need to do. =P\n",
"still no fix? :( \n",
"Virtually all maintained twitter python libraries migrated to use requests > 1.0 and posting images is broken, if you want a very specific example try twython with its twythonAPI.updateProfileImage(open('file','r')) method where this bug is causing pain.\n",
"Ok, so I've tracked this down. Gimme a second to write a fix.\n",
"@grillermo it isn't a matter of reproducing the bug or not believing you. The stack trace is fairly clear on the matter. The problem is that we're all quite busy.\n",
"So, really, this is because oauthlib is converting all the headers to unicode objects. We're then concatenating these unicode objects with the bytes of the file. Python tries to implicitly decode the bytes into unicode using the locale default codec, and obviously fails.\n\nWe can do the 'easy' fix and have `requests-oauthlib` just encode the headers using Latin-1, but that defers the problem. Alternatively, we can do the 'right' thing and take control of header encoding ourselves. I don't know if Kenneth is up for that, though. @kennethreitz, thoughts?\n",
"Just spoke with Kenneth, and he and I agree that we should fix `requests-oauthlib`. This is no longer blocking v1.2.\n",
"@Lukasa We recently had a discussion about header encoding in [shazow/urllib3#164](https://github.com/shazow/urllib3/pull/164#issuecomment-15366629) at which you might want to look.\n",
"Thanks Thomas. I was going to mention that when I got home.\n",
"So wait, urllib3 is expecting us to provide unicode objects, not bytes?\n",
"Cc @shazow\n",
"I think the strategy, as with the rest of Python, is to use the appropriate type where appropriate. I would argue that it makes more sense for header keys to be strings rather than bytes. Is there a counter-argument? (Things like request body should definitely be bytes.)\n",
"My position on the matter would be that headers have a defined encoding on the wire (ISO-8859-1), which means that the only valid headers are ones that can be encoded in that encoding. You can't send strings on the wire, you can only send bytes, and the user shouldn't have to know what bytes those are. I'm happy to leave that encoding to urllib3 though. =)\n\nIncidentally, if urllib3 is passing unicode headers through to httplib without encoding them it might be the cause of our issue.\n",
"Further debugging suggests the problem is in the interface between urllib3 and httplib. This exact problem can be reproduced using the following short program:\n\n``` python\nimport httplib\nconn = httplib.HTTPConnection('httpbin.org', 80)\n\nconn.request('POST', u'/post', '\\xff', {'test': 'value'}) # Exception here.\n```\n\nAny unicode value, whether in the method, the url, or the keys/values of the headers dict, will cause the entire body of the message to be 'promoted' to a unicode string. This is fine unless you are uploading a file that isn't ascii text, which might contain out-of-range bytes. Exceptions will then be dramatically thrown.\n\nI think either urllib3 or requests needs to ensure that by this stage, everything is bytes.\n",
"If we ensure everything is bytes, this will work well for Python 2 because `str`s are `bytes` objects. In python 3 this seems to produce an issue like @t-8ch mentioned. Naturally it's perfectly fine for there to be multiple header values and there are no bizarre characters in headers (and cannot be if I remember the spec properly) so the coercion to whatever will be fine. You might think this falls on our shoulders because it doesn't seem that too many urllib3 users have reported this issue, but you're wrong.\n\nThe problem with doing this is exactly the case where we're reading binary data which is a very common use case. If we're provided a file (or file-like object). We have no way of knowing if it's binary data or not and images and the like can't be coerced to text. This makes me think that the burden lies on urllib3 to coerce everything together.\n\nEither way, I feel obligated to leave [this](http://nedbatchelder.com/text/unipain.html) behind.\n",
"Wouldn't this mean urllib3 has to mess with `Content-Length`? (and maybe other\nthings I am not aware of)\n\n(Python 3):\n\n``` python\n>>> requests.get('http://httpbin.org/post', data='u').json()\n{\n 'data': 'u', # data looks correct\n 'headers': {\n 'Content-Length': '1',\n # [..]\n },\n}\n# note the \"ü\" v\n>>> requests.get('http://httpbin.org/post', data='ü').json()\n{\n 'data': 'data:application/octet-stream;base64,/A==', # ??\n 'headers': {\n 'Content-Length': '1',\n # [..]\n }\n # [..]\n}\n>>> requests.get('http://httpbin.org/post', data='ü'.encode()).json()\n{\n 'data': 'ü', # works\n 'headers': {\n 'Content-Length': '2',\n # [..]\n }\n # [..]\n}\n```\n\n``` sh\n$ curl --data-binary ü http://httpbin.org/post\n{\n \"data\": \"\\u00fc\" # == 'ü'\n \"headers\": {\n \"Content-Length\": \"2\",\n # [..]\n },\n # [..]\n}\n```\n\n[RFC2616](https://tools.ietf.org/html/rfc2616#section-14.13):\n\n```\nOCTET = <any 8-bit sequence of data>\n\n# [..]\n\nThe Content-Length entity-header field indicates the size of the\nentity-body, in decimal number of OCTETs, sent to the recipient or,\nin the case of the HEAD method, the size of the entity-body that\nwould have been sent had the request been a GET.\n```\n",
"I disagree with your assessment of correct. =)\n\nContent-Length, as you rightly pointed out, asks for the length of the data in octets. The unicode string `u'a'` (using Python 2.7 notation to avoid ambiguity) does not _have_ a length in octets, because it's unicode. Only encoded text has any octet-based length. For example:\n\n``` python\n>>> len(u'a'.encode('utf-8'))\n1\n>>> len(u'a'.encode('utf-16')) # Don't forget the BOM will be here too!\n4\n>>> len(u'a'.encode('utf-32'))\n8\n```\n\nThis means that if urllib3 gets unicode data, but no explicit Content-Length header, urllib3 should encode that data and then set the content-length based on that encoding. However, if urllib3 gets an explicit Content-Length header, I'd argue that it should just assume the user knows what they're doing and let it go.\n\nFrom where I'm sitting, the problem here is that urllib3 needs to assume that it might get unicode values for any of these strings, but the wire needs bytes. httplib isn't doing the right thing here, so to avoid the Python interpreter doing its _totally bogus_ implicit encoding/decoding, urllib3 needs to take it into its own hands. This means encoding the unicode.\n\nIt is totally legitimate to ask users of urllib3 to do their own encoding, and if you conclude that that is what you want to do then we can make the fix in requests-oauthlib. However, I think that someone in the stack, either requests or urllib3, needs to take responsibility for this encoding stuff, because Python 2 just does it all wrong.\n",
"(Python 2 works, following is Python 3)\n\n```\nThis means that if urllib3 gets unicode data, but no explicit Content-Length header,\nurllib3 should encode that data and then set the content-length based on that encoding. \n```\n\nUrllib3 does get a explicit `Content-Length`.\n\n``` python\n>>> r = requests.Request('POST', 'http://httpbin.org', data=u'ü').prepare()\n>>> r.headers\n{'Content-Length': '1'}\n```\n\nMy 2 cents:\nUrllib3 should assume native strings for headers and bytes for the body.\n",
"Yeah, I was excluding Requests' behaviour for a moment, and just trying to nail down what urllib3 should be doing. Then we could change Requests to program to that interface. =)\n\nThomas, I'm also quite happy with your proposal there. If @shazow thinks that's the way it should go, the fix belongs outside urllib3. :fireworks:\n",
"I would prefer to avoid doing aggressive type coercion for every input on the urllib3 side. \n",
"So this can not block 1.2.0 unless @kennethreitz really wants it to. \n\nPerhaps to satisfy @michaelhelmick and company we should add a notice to the release that we realize that this is broken and a fix is being worked on in shazow/urllib3\n",
"I was sleeping while all this convo was going on :blush: haha\n\nBut, first and foremost I want to thank all of you for the participation in the issue!\n\nAlthough I feel that it would be weird if 1.2.0 _was_ released, this issue was still valid and then all of the sudden 2 weeks later without any version bump to `requests`, this issue was just solved and file uploading worked, etc worked\n",
"Although, `urllib3` is contained within `requests` so I guess the Kenneth would have to update the internal package anyways; therefore forcing some sort of version bump? So I guess this technically isn't a block for 1.2.0; my apologies.\n",
"@michaelhelmick I hope you got better sleep than I did. :) And yes, as soon as this gets fixed, I would be certain to bug @kennethreitz about a bump to 1.2.1\n\nAnd there's no need to apologize.\n",
"@sigmavirus24 I got about 9 hours, haha. And alright, and if he doesn't bump on your first request; we'll start a trending topic on Twitter ;D\n",
"We just won't upload any images with those tweets. :-P\n",
"xD hahah, I just lol'd haha\n",
"So, everyone in this thread who cares about the requests end of this, I've pushed a fix up to requests-oauthlib. Anyone who cares to test it should download from the `unicodedecodeerror` branch (yes, you will mis-type that at least once), and I welcome code review on the PR at requests/requests-oauthlib#26.\n",
"i would like to try, but i dont know, any guide? im using debian on raspberry pi mainly use for twython to upload picture \n"
] |
https://api.github.com/repos/psf/requests/issues/1251
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1251/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1251/comments
|
https://api.github.com/repos/psf/requests/issues/1251/events
|
https://github.com/psf/requests/issues/1251
| 12,250,982 |
MDU6SXNzdWUxMjI1MDk4Mg==
| 1,251 |
Documentation doesn't mention Session.request
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1095956?v=4",
"events_url": "https://api.github.com/users/lastquestion/events{/privacy}",
"followers_url": "https://api.github.com/users/lastquestion/followers",
"following_url": "https://api.github.com/users/lastquestion/following{/other_user}",
"gists_url": "https://api.github.com/users/lastquestion/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/lastquestion",
"id": 1095956,
"login": "lastquestion",
"node_id": "MDQ6VXNlcjEwOTU5NTY=",
"organizations_url": "https://api.github.com/users/lastquestion/orgs",
"received_events_url": "https://api.github.com/users/lastquestion/received_events",
"repos_url": "https://api.github.com/users/lastquestion/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/lastquestion/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/lastquestion/subscriptions",
"type": "User",
"url": "https://api.github.com/users/lastquestion",
"user_view_type": "public"
}
|
[
{
"color": "0b02e1",
"default": false,
"description": null,
"id": 191274,
"name": "Contributor Friendly",
"node_id": "MDU6TGFiZWwxOTEyNzQ=",
"url": "https://api.github.com/repos/psf/requests/labels/Contributor%20Friendly"
}
] |
closed
| true | null |
[] | null | 2 |
2013-03-20T22:07:10Z
|
2021-09-09T04:00:43Z
|
2013-03-31T05:21:52Z
|
NONE
|
resolved
|
Neither http://docs.python-requests.org/en/latest/user/advanced/#session-objects or http://docs.python-requests.org/en/latest/api/#request-sessions talks about Session.request - which I only found once I cloned the source locally.
Originally I was using session.send(preparedRequest) which wasn't persisting cookies or headers. I thought this was a bug / weird issue so I cloned the source and that's when I saw Session.request.
It would be good to clarify the intent of .request versus .send in regards to cookie persistence, headers, etc. etc.
Happy to put together a pull request to update the docs.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/240830?v=4",
"events_url": "https://api.github.com/users/sigmavirus24/events{/privacy}",
"followers_url": "https://api.github.com/users/sigmavirus24/followers",
"following_url": "https://api.github.com/users/sigmavirus24/following{/other_user}",
"gists_url": "https://api.github.com/users/sigmavirus24/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/sigmavirus24",
"id": 240830,
"login": "sigmavirus24",
"node_id": "MDQ6VXNlcjI0MDgzMA==",
"organizations_url": "https://api.github.com/users/sigmavirus24/orgs",
"received_events_url": "https://api.github.com/users/sigmavirus24/received_events",
"repos_url": "https://api.github.com/users/sigmavirus24/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/sigmavirus24/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/sigmavirus24/subscriptions",
"type": "User",
"url": "https://api.github.com/users/sigmavirus24",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/1251/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1251/timeline
| null |
completed
| null | null | false |
[
"Hm, just noticed https://github.com/kennethreitz/requests/issues/1201\nI'm using the latest sources, maybe the docs haven't been updated? \n",
"Cookie persistence is no longer an issue. That has been fixed in master, so if you're still seeing that issue, let us know. I'm, baffled though that Session#request was lost in the docs. I'm guessing it's doc-string was accidentally deleted which is why it no longer shows up. If you don't want to send a PR, I'll get to this tonight.\n"
] |
https://api.github.com/repos/psf/requests/issues/1250
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1250/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1250/comments
|
https://api.github.com/repos/psf/requests/issues/1250/events
|
https://github.com/psf/requests/issues/1250
| 12,216,745 |
MDU6SXNzdWUxMjIxNjc0NQ==
| 1,250 |
'PreparedRequest.headers' keys are a mixture of bytes and (unicode) strings in Python 3.x
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/305618?v=4",
"events_url": "https://api.github.com/users/paparomeo/events{/privacy}",
"followers_url": "https://api.github.com/users/paparomeo/followers",
"following_url": "https://api.github.com/users/paparomeo/following{/other_user}",
"gists_url": "https://api.github.com/users/paparomeo/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/paparomeo",
"id": 305618,
"login": "paparomeo",
"node_id": "MDQ6VXNlcjMwNTYxOA==",
"organizations_url": "https://api.github.com/users/paparomeo/orgs",
"received_events_url": "https://api.github.com/users/paparomeo/received_events",
"repos_url": "https://api.github.com/users/paparomeo/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/paparomeo/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/paparomeo/subscriptions",
"type": "User",
"url": "https://api.github.com/users/paparomeo",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 2 |
2013-03-20T08:16:20Z
|
2021-09-09T00:01:01Z
|
2013-06-08T08:07:33Z
|
NONE
|
resolved
|
In Python 3.x `PreparedRequest.headers` keys end up being a mixture of byte strings and unicode strings, because in [`PreparedRequest.prepared_headers`](https://github.com/kennethreitz/requests/blob/master/requests/models.py#L326) the headers received from the user are byte encoded but later code in the request preparation (e.g. [`PreparedRequest.prepare_body`](https://github.com/kennethreitz/requests/blob/master/requests/models.py#L331)) will add or modify unicode string keys.
The problem is visible, for example, when the user tries to create a `PreparedRequest` with a given content type with the `'Content-Type'` key as a unicode string, which then in [`PreparedRequest.prepare_body`](https://github.com/kennethreitz/requests/blob/master/requests/models.py#L383) is ignored and a default `Content-Type` header added because the key already in `headers` is a byte string, but a unicode string literal is being used for the existence test.
I tried to use always unicode strings or always byte strings, for the header keys, but that caused unit tests to fail either on Python 2.x or Python 3.x, so clearly a better thought solution is required.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4",
"events_url": "https://api.github.com/users/Lukasa/events{/privacy}",
"followers_url": "https://api.github.com/users/Lukasa/followers",
"following_url": "https://api.github.com/users/Lukasa/following{/other_user}",
"gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Lukasa",
"id": 1382556,
"login": "Lukasa",
"node_id": "MDQ6VXNlcjEzODI1NTY=",
"organizations_url": "https://api.github.com/users/Lukasa/orgs",
"received_events_url": "https://api.github.com/users/Lukasa/received_events",
"repos_url": "https://api.github.com/users/Lukasa/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Lukasa",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/1250/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1250/timeline
| null |
completed
| null | null | false |
[
"Yes, I've wondered about this before. I might work on a PR that has Requests take control of encoding and decoding strings, though it might end up being sufficiently complex that Kenneth won't want to merge it. =)\n",
"#1338 is the most recent pull request that should address this issue, I'm going to close this and move the discussion over there. =)\n"
] |
https://api.github.com/repos/psf/requests/issues/1249
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1249/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1249/comments
|
https://api.github.com/repos/psf/requests/issues/1249/events
|
https://github.com/psf/requests/issues/1249
| 12,179,200 |
MDU6SXNzdWUxMjE3OTIwMA==
| 1,249 |
stream_decompress corrupts output in case of decompress error
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/238652?v=4",
"events_url": "https://api.github.com/users/schlamar/events{/privacy}",
"followers_url": "https://api.github.com/users/schlamar/followers",
"following_url": "https://api.github.com/users/schlamar/following{/other_user}",
"gists_url": "https://api.github.com/users/schlamar/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/schlamar",
"id": 238652,
"login": "schlamar",
"node_id": "MDQ6VXNlcjIzODY1Mg==",
"organizations_url": "https://api.github.com/users/schlamar/orgs",
"received_events_url": "https://api.github.com/users/schlamar/received_events",
"repos_url": "https://api.github.com/users/schlamar/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/schlamar/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/schlamar/subscriptions",
"type": "User",
"url": "https://api.github.com/users/schlamar",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 3 |
2013-03-19T13:11:24Z
|
2021-09-09T00:09:55Z
|
2013-04-14T16:13:03Z
|
CONTRIBUTOR
|
resolved
|
A `zlib.Decompress` object consumes at least one byte without raising an error and without returning any output:
```
>>> zlib_mode = 16 + zlib.MAX_WBITS
>>> any(zlib.decompressobj(zlib_mode).decompress(chr(i)) for i in xrange(256))
False
```
So if there is an zlib.error in `stream_decompress`, there will be at least one byte missing in the output string.
Additionally, there are two variations of the deflate compression in urllib3, while requests is only handling one of them: https://github.com/shazow/urllib3/blob/master/urllib3/response.py#L25
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/238652?v=4",
"events_url": "https://api.github.com/users/schlamar/events{/privacy}",
"followers_url": "https://api.github.com/users/schlamar/followers",
"following_url": "https://api.github.com/users/schlamar/following{/other_user}",
"gists_url": "https://api.github.com/users/schlamar/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/schlamar",
"id": 238652,
"login": "schlamar",
"node_id": "MDQ6VXNlcjIzODY1Mg==",
"organizations_url": "https://api.github.com/users/schlamar/orgs",
"received_events_url": "https://api.github.com/users/schlamar/received_events",
"repos_url": "https://api.github.com/users/schlamar/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/schlamar/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/schlamar/subscriptions",
"type": "User",
"url": "https://api.github.com/users/schlamar",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/1249/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1249/timeline
| null |
completed
| null | null | false |
[
"[This comment](https://github.com/kennethreitz/requests/issues/465#issuecomment-15106811) is also interesting in this context.\n",
"With this https://github.com/shazow/urllib3/pull/159 merged, `stream_decompress` could be dropped entirely.\n",
"Fixed with #1299 \n"
] |
https://api.github.com/repos/psf/requests/issues/1248
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1248/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1248/comments
|
https://api.github.com/repos/psf/requests/issues/1248/events
|
https://github.com/psf/requests/issues/1248
| 12,176,991 |
MDU6SXNzdWUxMjE3Njk5MQ==
| 1,248 |
HTTP Proxy does not handle authentication
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/472286?v=4",
"events_url": "https://api.github.com/users/rjarry/events{/privacy}",
"followers_url": "https://api.github.com/users/rjarry/followers",
"following_url": "https://api.github.com/users/rjarry/following{/other_user}",
"gists_url": "https://api.github.com/users/rjarry/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/rjarry",
"id": 472286,
"login": "rjarry",
"node_id": "MDQ6VXNlcjQ3MjI4Ng==",
"organizations_url": "https://api.github.com/users/rjarry/orgs",
"received_events_url": "https://api.github.com/users/rjarry/received_events",
"repos_url": "https://api.github.com/users/rjarry/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/rjarry/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/rjarry/subscriptions",
"type": "User",
"url": "https://api.github.com/users/rjarry",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 9 |
2013-03-19T12:01:11Z
|
2021-09-09T04:00:48Z
|
2013-03-19T18:56:24Z
|
NONE
|
resolved
|
Hello,
I'm trying to use the **requests** library for making requests through a http proxy that requires authentication.
I tried this but it doesn't work:
```
$ python
Python 2.7.3 (default, May 4 2012, 19:05:38)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-44)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import requests
>>> requests.get('http://pypi.python.org/simple/Django/', proxies={'http': 'http://myproxyusername:<secret>@my.proxy.hostname:8000'})
<Response [407]>
```
Apparently, the `Proxy-Authorization` header is not set correctly. I tried the same thing with curl and it works fine:
```
$ curl -v -U 'myproxyusername:<secret>' -x 'my.proxy.hostname:8000' 'http://pypi.python.org/simple/Django/' >/dev/null
* About to connect() to proxy my.proxy.hostname port 8000
* Trying 10.33.241.200... connected
* Connected to my.proxy.hostname (10.33.241.200) port 8000
* Proxy auth using Basic with user 'myproxyusername'
> GET http://pypi.python.org/simple/Django/ HTTP/1.1
> Proxy-Authorization: Basic QVBQVDAwODIzfeDdmFqZSE3MTM0
> User-Agent: curl/7.15.5 (i686-redhat-linux-gnu) libcurl/7.15.5 OpenSSL/0.9.8b zlib/1.2.3 libidn/0.6.5
> Host: pypi.python.org
> Pragma: no-cache
> Accept: */*
> Proxy-Connection: Keep-Alive
>
< HTTP/1.1 200 OK
< Server: nginx/1.1.19
< Date: Tue, 19 Mar 2013 11:42:38 GMT
< Content-Type: text/html; charset=utf-8
< Content-Length: 9262
< Proxy-Connection: Keep-Alive
< Connection: Keep-Alive
< Age: 0
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 9262 100 9262 0 0 37809 0 --:--:-- --:--:-- --:--:-- 1978kConnection #0 to host my.proxy.hostname left intact
* Closing connection #0
```
NB: when the proxy does not require authentication, it works.
```
$ python
Python 2.7.3 (default, May 4 2012, 19:05:38)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-44)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import requests
>>> requests.get('http://pypi.python.org/simple/Django/', proxies={'http': 'http://other.proxy.without.auth:8000'})
<Response [200]>
```
I noticed that there was a pull request that was merged about this problem a short time ago : https://github.com/kennethreitz/requests/pull/309 . I tried to install the latest code from github and it does not work either.
Can you help? :)
--Robin
|
{
"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/1248/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1248/timeline
| null |
completed
| null | null | false |
[
"Btw, I don't know if that may be a problem, but there is a `!` character in my password.\n",
"Hi there, thanks for the report!\n\nBefore we begin, can you tell me what version of Requests you're using? I ask because #309 is quite old, and the code that was added there ended up being removed. The logic was re-added by me in #1162, and extended in #1210. What version of Requests you're using will let me know what code base I should be investigating.\n",
"Hey, my pleasure :>\n\nI tried both with the latest from pypi : 1.1.0 and the latest code-base you have on github today (which is also tagged as 1.1.0, I guess it should be tagged as 1.2.0.dev or something ^^)\n",
"Ok after going through the pull requests you linked I noticed that the `add_headers` method was removed from the `HTTPAdapter` class.\n\nI added it back in the code I have in site-packages and it works again :+1: \n\nMaybe it was removed by mistake?\n",
"The current HEAD on Github shows `HTTPAdapter.add_headers()` [here](https://github.com/kennethreitz/requests/blob/master/requests/adapters.py#L169), being called [here](https://github.com/kennethreitz/requests/blob/master/requests/adapters.py#L195). The proxy code is not in version 1.1.0, as that version was tagged in January but the proxy code was added in February. Try using the HEAD from GitHub.\n",
"Oops, I may have mixed-up my install of the HEAD. Thanks.\n\nWill you make an official release soon™?\n",
"Issue #1233 is about exactly that. PyCon US is on at the moment so Kenneth is inevitably very busy having lots of fun, so I wouldn't expect one in the next few days, but [probably in the next few weeks](https://developer.valvesoftware.com/wiki/Valve_Time).\n",
"Hehe ok noted, I'll live with the HEAD from github until then.\n",
"@robin-jarry for what it's worth, HEAD is 98% of the time Pretty Damn Stable™\n"
] |
https://api.github.com/repos/psf/requests/issues/1247
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1247/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1247/comments
|
https://api.github.com/repos/psf/requests/issues/1247/events
|
https://github.com/psf/requests/pull/1247
| 12,097,775 |
MDExOlB1bGxSZXF1ZXN0NDY1MzkwMg==
| 1,247 |
proof of concept async requests via futures
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/12789?v=4",
"events_url": "https://api.github.com/users/ross/events{/privacy}",
"followers_url": "https://api.github.com/users/ross/followers",
"following_url": "https://api.github.com/users/ross/following{/other_user}",
"gists_url": "https://api.github.com/users/ross/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/ross",
"id": 12789,
"login": "ross",
"node_id": "MDQ6VXNlcjEyNzg5",
"organizations_url": "https://api.github.com/users/ross/orgs",
"received_events_url": "https://api.github.com/users/ross/received_events",
"repos_url": "https://api.github.com/users/ross/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/ross/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/ross/subscriptions",
"type": "User",
"url": "https://api.github.com/users/ross",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 6 |
2013-03-16T17:28:43Z
|
2021-09-08T19:00:55Z
|
2013-03-21T15:39:02Z
|
NONE
|
resolved
|
this is a proposal/proof of concept. by no means is it expected to be merged.
it provides a FuturesSession which returns concurrent.futures.Future objects to calls in place of requests.Response. this provides a near seamless async requests api.
an example:
```
session = FuturesSession()
future = session.get('http://www.foo.com/bar/')
... do other stuff ...
# wait for response or return immediately if it's already back
response = future.result()
... continue as normal ...
```
as currently implemented it requires no external dependancies and uses the python3 futures, tested with python 3.3.0. if desired support could be added to 2.x releases by either using the backport of futures or without dependancies using methods similar to https://github.com/ross/python-asynchttp.
feedback solicited.
## best,
-rm
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/12789?v=4",
"events_url": "https://api.github.com/users/ross/events{/privacy}",
"followers_url": "https://api.github.com/users/ross/followers",
"following_url": "https://api.github.com/users/ross/following{/other_user}",
"gists_url": "https://api.github.com/users/ross/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/ross",
"id": 12789,
"login": "ross",
"node_id": "MDQ6VXNlcjEyNzg5",
"organizations_url": "https://api.github.com/users/ross/orgs",
"received_events_url": "https://api.github.com/users/ross/received_events",
"repos_url": "https://api.github.com/users/ross/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/ross/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/ross/subscriptions",
"type": "User",
"url": "https://api.github.com/users/ross",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/1247/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1247/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/1247.diff",
"html_url": "https://github.com/psf/requests/pull/1247",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/1247.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/1247"
}
| true |
[
"Very cool. I think it's worth you putting this into its own repository, much like Kenneth has with [grequests](https://github.com/kennethreitz/grequests).\n",
"+1 to @Lukasa's comment :)\n",
"I'll third @Lukasa's comment.\n",
"just threw up a new package, i've registered it in pypi, but haven't built and uploaded it:\n https://github.com/ross/requests-futures\n\ni added the necessary pieces to support it pre 3.3 using the backport of concurrent.futures.\n\nwould appreciate anything you all would be able to do in terms of making it easy for people to find it if/when they go to look for async functionality with requests.\n",
"@ross I tweeted about it and put it in the wiki: https://github.com/kennethreitz/requests/wiki\n\nIf others come asking about similar items, I'll be sure to point them in your direction. :) Thanks\n",
"thanks :)\n"
] |
https://api.github.com/repos/psf/requests/issues/1246
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1246/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1246/comments
|
https://api.github.com/repos/psf/requests/issues/1246/events
|
https://github.com/psf/requests/issues/1246
| 12,057,525 |
MDU6SXNzdWUxMjA1NzUyNQ==
| 1,246 |
Please provide a RELEASE tag
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/102495?v=4",
"events_url": "https://api.github.com/users/ssbarnea/events{/privacy}",
"followers_url": "https://api.github.com/users/ssbarnea/followers",
"following_url": "https://api.github.com/users/ssbarnea/following{/other_user}",
"gists_url": "https://api.github.com/users/ssbarnea/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/ssbarnea",
"id": 102495,
"login": "ssbarnea",
"node_id": "MDQ6VXNlcjEwMjQ5NQ==",
"organizations_url": "https://api.github.com/users/ssbarnea/orgs",
"received_events_url": "https://api.github.com/users/ssbarnea/received_events",
"repos_url": "https://api.github.com/users/ssbarnea/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/ssbarnea/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/ssbarnea/subscriptions",
"type": "User",
"url": "https://api.github.com/users/ssbarnea",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 8 |
2013-03-15T10:22:20Z
|
2021-09-09T04:00:37Z
|
2013-03-19T11:31:30Z
|
CONTRIBUTOR
|
resolved
|
Please provide a release tag for the repository, so we can clone and use sub-repositories that would use the latest released version.
Currently you have tags with versions, but there is no way of getting the latest release using a single command.
It think it shoudn't be hard to modify the tagging on a new release, even as a script. 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/1246/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1246/timeline
| null |
completed
| null | null | false |
[
"I'm not sure I follow. You mean you'd like to have two tags point to the latest release, e.g.,\n\n```\n1.1.0 -> fakesha\nRELEASE -> fakesha\n```\n\nThen when Kenneth releases 1.1.1:\n\n```\n1.1.0 -> fakesha0\n1.1.1 -> fakesha1\nRELEASE -> fakesha1\n```\n\nOr am I missing the concept?\n",
"We used to do this, but like the simplicity of doing it this way now.\n\nExplicit is better than implicit :)\n",
"Are you against because it is hard to make the tagging or for other reasons? If I come up would provide a release utility script that does all the tagging stuff when you release a new version, it would be ok to accept this? Thanks.\n",
"Other reasons. As the Zen of Python states, \"Explicit is better than implicit\". If you are forcing a download of \"RELEASE\", you are implicitly selecting a version. This makes resolving dependencies hard, it means you don't know what version of Requests you're developing against, and it means you shout at us when we make breaking changes. All bad. =)\n",
"@Lukasa \n\"Explicit is better than implicit\" does not really apply to this at all. If someone downloads RELEASE then it's because he wants RELEASE and he knows that he will get RELEASE and what RELEASE means. Let me summarize with another quote - \"All problems in computer science can be solved by another level of indirection\"\n",
"More simply put, this is @kennethreitz's project and he can do as he pleases and he doesn't need to explain his actions to anyone. If he would rather not do this then that is his call.\n",
"@piotr-dobrogost: I respectfully disagree, but happily this is both a) a matter of opinion and b) not something about which our opinions matter at all. =)\n",
"@sigmavirus24 <3\n"
] |
https://api.github.com/repos/psf/requests/issues/1245
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1245/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1245/comments
|
https://api.github.com/repos/psf/requests/issues/1245/events
|
https://github.com/psf/requests/pull/1245
| 12,023,511 |
MDExOlB1bGxSZXF1ZXN0NDYxNzY0Mw==
| 1,245 |
Remove duplicate comment.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1592927?v=4",
"events_url": "https://api.github.com/users/Damgaard/events{/privacy}",
"followers_url": "https://api.github.com/users/Damgaard/followers",
"following_url": "https://api.github.com/users/Damgaard/following{/other_user}",
"gists_url": "https://api.github.com/users/Damgaard/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Damgaard",
"id": 1592927,
"login": "Damgaard",
"node_id": "MDQ6VXNlcjE1OTI5Mjc=",
"organizations_url": "https://api.github.com/users/Damgaard/orgs",
"received_events_url": "https://api.github.com/users/Damgaard/received_events",
"repos_url": "https://api.github.com/users/Damgaard/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Damgaard/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Damgaard/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Damgaard",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 1 |
2013-03-14T15:28:28Z
|
2021-09-08T23:08:13Z
|
2013-03-14T15:29:53Z
|
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/1245/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1245/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/1245.diff",
"html_url": "https://github.com/psf/requests/pull/1245",
"merged_at": "2013-03-14T15:29:53Z",
"patch_url": "https://github.com/psf/requests/pull/1245.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/1245"
}
| true |
[
"Thanks :)\n"
] |
|
https://api.github.com/repos/psf/requests/issues/1244
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1244/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1244/comments
|
https://api.github.com/repos/psf/requests/issues/1244/events
|
https://github.com/psf/requests/pull/1244
| 11,929,056 |
MDExOlB1bGxSZXF1ZXN0NDU3MTAyMg==
| 1,244 |
Fixed further pickeling issues in Session and HTTPAdapter
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/280629?v=4",
"events_url": "https://api.github.com/users/jajadinimueter/events{/privacy}",
"followers_url": "https://api.github.com/users/jajadinimueter/followers",
"following_url": "https://api.github.com/users/jajadinimueter/following{/other_user}",
"gists_url": "https://api.github.com/users/jajadinimueter/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/jajadinimueter",
"id": 280629,
"login": "jajadinimueter",
"node_id": "MDQ6VXNlcjI4MDYyOQ==",
"organizations_url": "https://api.github.com/users/jajadinimueter/orgs",
"received_events_url": "https://api.github.com/users/jajadinimueter/received_events",
"repos_url": "https://api.github.com/users/jajadinimueter/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/jajadinimueter/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jajadinimueter/subscriptions",
"type": "User",
"url": "https://api.github.com/users/jajadinimueter",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 1 |
2013-03-12T15:22:10Z
|
2021-09-08T19:00:55Z
|
2013-03-12T15:23:22Z
|
NONE
|
resolved
|
Added trust_env and stream to Session.**attrs**. Initialize
self._pool_connections and self._pool_maxsize in HTTPAdapter.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4",
"events_url": "https://api.github.com/users/kennethreitz/events{/privacy}",
"followers_url": "https://api.github.com/users/kennethreitz/followers",
"following_url": "https://api.github.com/users/kennethreitz/following{/other_user}",
"gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/kennethreitz",
"id": 119893,
"login": "kennethreitz",
"node_id": "MDQ6VXNlcjExOTg5Mw==",
"organizations_url": "https://api.github.com/users/kennethreitz/orgs",
"received_events_url": "https://api.github.com/users/kennethreitz/received_events",
"repos_url": "https://api.github.com/users/kennethreitz/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/kennethreitz/starred{/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/1244/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1244/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/1244.diff",
"html_url": "https://github.com/psf/requests/pull/1244",
"merged_at": "2013-03-12T15:23:22Z",
"patch_url": "https://github.com/psf/requests/pull/1244.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/1244"
}
| true |
[
":cake:\n"
] |
https://api.github.com/repos/psf/requests/issues/1243
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1243/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1243/comments
|
https://api.github.com/repos/psf/requests/issues/1243/events
|
https://github.com/psf/requests/pull/1243
| 11,890,022 |
MDExOlB1bGxSZXF1ZXN0NDU1MjEzNg==
| 1,243 |
Pickling of Session and HTTPAdapter + a test
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/737634?v=4",
"events_url": "https://api.github.com/users/darjus-amzn/events{/privacy}",
"followers_url": "https://api.github.com/users/darjus-amzn/followers",
"following_url": "https://api.github.com/users/darjus-amzn/following{/other_user}",
"gists_url": "https://api.github.com/users/darjus-amzn/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/darjus-amzn",
"id": 737634,
"login": "darjus-amzn",
"node_id": "MDQ6VXNlcjczNzYzNA==",
"organizations_url": "https://api.github.com/users/darjus-amzn/orgs",
"received_events_url": "https://api.github.com/users/darjus-amzn/received_events",
"repos_url": "https://api.github.com/users/darjus-amzn/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/darjus-amzn/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/darjus-amzn/subscriptions",
"type": "User",
"url": "https://api.github.com/users/darjus-amzn",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 2 |
2013-03-11T18:15:41Z
|
2021-09-08T23:01:09Z
|
2013-03-12T14:37:55Z
|
CONTRIBUTOR
|
resolved
|
This is for issue #1088
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4",
"events_url": "https://api.github.com/users/kennethreitz/events{/privacy}",
"followers_url": "https://api.github.com/users/kennethreitz/followers",
"following_url": "https://api.github.com/users/kennethreitz/following{/other_user}",
"gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/kennethreitz",
"id": 119893,
"login": "kennethreitz",
"node_id": "MDQ6VXNlcjExOTg5Mw==",
"organizations_url": "https://api.github.com/users/kennethreitz/orgs",
"received_events_url": "https://api.github.com/users/kennethreitz/received_events",
"repos_url": "https://api.github.com/users/kennethreitz/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/kennethreitz/starred{/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/1243/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1243/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/1243.diff",
"html_url": "https://github.com/psf/requests/pull/1243",
"merged_at": "2013-03-12T14:37:55Z",
"patch_url": "https://github.com/psf/requests/pull/1243.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/1243"
}
| true |
[
"+1, looks good.\n",
":cake:\n"
] |
https://api.github.com/repos/psf/requests/issues/1242
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1242/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1242/comments
|
https://api.github.com/repos/psf/requests/issues/1242/events
|
https://github.com/psf/requests/pull/1242
| 11,868,120 |
MDExOlB1bGxSZXF1ZXN0NDU0MTIzNg==
| 1,242 |
HTTP Digest Auth case insensitive replacement of "Digest "
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/903275?v=4",
"events_url": "https://api.github.com/users/oviboy/events{/privacy}",
"followers_url": "https://api.github.com/users/oviboy/followers",
"following_url": "https://api.github.com/users/oviboy/following{/other_user}",
"gists_url": "https://api.github.com/users/oviboy/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/oviboy",
"id": 903275,
"login": "oviboy",
"node_id": "MDQ6VXNlcjkwMzI3NQ==",
"organizations_url": "https://api.github.com/users/oviboy/orgs",
"received_events_url": "https://api.github.com/users/oviboy/received_events",
"repos_url": "https://api.github.com/users/oviboy/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/oviboy/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/oviboy/subscriptions",
"type": "User",
"url": "https://api.github.com/users/oviboy",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 15 |
2013-03-11T08:56:27Z
|
2021-09-08T23:07:18Z
|
2013-04-14T03:28:43Z
|
CONTRIBUTOR
|
resolved
|
Hi,
I've encountered this error:
```
File "/sites/.ro-api/api/local/lib/python2.7/site-packages/requests/api.py", line 87, in post
return request('post', url, data=data, **kwargs)
File "/sites/.ro-api/api/local/lib/python2.7/site-packages/requests/api.py", line 44, in request
return session.request(method=method, url=url, **kwargs)
File "/sites/.ro-api/api/local/lib/python2.7/site-packages/requests/sessions.py", line 279, in request
resp = self.send(prep, stream=stream, timeout=timeout, verify=verify, cert=cert, proxies=proxies)
File "/sites/.ro-api/api/local/lib/python2.7/site-packages/requests/sessions.py", line 374, in send
r = adapter.send(request, **kwargs)
File "/sites/.ro-api/api/local/lib/python2.7/site-packages/requests/adapters.py", line 219, in send
r = self.build_response(request, resp)
File "/sites/.ro-api/api/local/lib/python2.7/site-packages/requests/adapters.py", line 113, in build_response
response = dispatch_hook('response', req.hooks, response)
File "/sites/.ro-api/api/local/lib/python2.7/site-packages/requests/hooks.py", line 39, in dispatch_hook
_hook_data = hook(hook_data)
File "/sites/.ro-api/api/local/lib/python2.7/site-packages/requests/auth.py", line 155, in handle_401
r.request.headers['Authorization'] = self.build_digest_header(r.request.method, r.request.url)
File "/sites/.ro-api/api/local/lib/python2.7/site-packages/requests/auth.py", line 69, in build_digest_header
nonce = self.chal['nonce']
KeyError: 'nonce'
```
While investigating i found that the site was sending me the following string:
`"WWW-Authenticate: digest nonce="***********************", qop="auth", realm="***************", algorithm="md5", opaque="*******************=""`
The parsed key in this case was: "digest nonce" and not "nonce", thus, the error above.
So I've modified the s_auth in requests/auth.py (line 154) string to replace "Digest " or "digest " with '' using re module and re.sub function. I've tested the feature and it works.
Regards,
Ovidiu Negrut
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4",
"events_url": "https://api.github.com/users/kennethreitz/events{/privacy}",
"followers_url": "https://api.github.com/users/kennethreitz/followers",
"following_url": "https://api.github.com/users/kennethreitz/following{/other_user}",
"gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/kennethreitz",
"id": 119893,
"login": "kennethreitz",
"node_id": "MDQ6VXNlcjExOTg5Mw==",
"organizations_url": "https://api.github.com/users/kennethreitz/orgs",
"received_events_url": "https://api.github.com/users/kennethreitz/received_events",
"repos_url": "https://api.github.com/users/kennethreitz/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/kennethreitz/starred{/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/1242/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1242/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/1242.diff",
"html_url": "https://github.com/psf/requests/pull/1242",
"merged_at": "2013-04-14T03:28:43Z",
"patch_url": "https://github.com/psf/requests/pull/1242.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/1242"
}
| true |
[
"I hate web server authors. :angry: \n\nThis is a good patch. =) My only question is whether we need the overhead of a regular expression here? @sigmavirus24?\n",
"Thanks for the reply... Yes, I've thought of that also, but I'm thinking that if another \"web server author\" will send a string like 'DiGEst' or another combination of lower and upper letters, the patch will stand.\n",
"Fair enough. In that case, I'm +1.\n",
"Sorry @Lukasa I've been pretty sick for the past few days. I'll take a look later this week I hope. I would think though that the standard string operations would be enough and provide less overhead than a regular expression. \n",
"@sigmavirus24 All this can be done with standard string operations, but you would have to implement parts of what the re module already has. It would be easy if we could just do a s_auth.lower() on the whole thing and replace what we need, but the case on the rest of the string is important.\n\nThe way I see it there are 2 choices. Either we use the re module, or we add code to do a case insensitive replace in requests itself. Basically its a choice between overhead (which I'm not convinced is much) and code complexity. :)\nPisses me off that web server developers don't read the damn standards before implementing something :angry: . \n\nP.S. Get better soon! :D\n",
"Eh, let's just do it twice. \n\n```\ns_auth.replace('Digest ', '').replace('digest ', '')\n```\n",
"Awesome :). Lets just hope some ding-bat doesn't decide to get creative with the case. I swear, if I ever see \"DiGeSt nonce\" in a header somewhere, I will track down the author and make him listen to Justin Bieber for a whole hour!\n",
"There's a fine line between misreading the spec and being willfully disruptive, and anyone doing \"DiGeSt\" is a long, long, _long_ way from that line. We don't have to worry about digest auth failing in those cases. =)\n",
"@kennethreitz you need to update .travis.yml\n",
"already done\n",
"This apparently breaks Requests on Python 2.6 :(\n",
"Yeah this could be done the way I suggested, or you could compile the regular expression first, e.g.,\n\n``` python\nimport re\n\nr = re.compile('digest ', re.IGNORECASE)\nr.sub('', s_auth)\n```\n",
"added the code like sigmavirus24 suggested.\n",
"@kennethreitz this looks good.\n",
"Thanks!\n"
] |
https://api.github.com/repos/psf/requests/issues/1241
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1241/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1241/comments
|
https://api.github.com/repos/psf/requests/issues/1241/events
|
https://github.com/psf/requests/issues/1241
| 11,847,097 |
MDU6SXNzdWUxMTg0NzA5Nw==
| 1,241 |
New "proxies" argument option
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/935203?v=4",
"events_url": "https://api.github.com/users/Anorov/events{/privacy}",
"followers_url": "https://api.github.com/users/Anorov/followers",
"following_url": "https://api.github.com/users/Anorov/following{/other_user}",
"gists_url": "https://api.github.com/users/Anorov/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Anorov",
"id": 935203,
"login": "Anorov",
"node_id": "MDQ6VXNlcjkzNTIwMw==",
"organizations_url": "https://api.github.com/users/Anorov/orgs",
"received_events_url": "https://api.github.com/users/Anorov/received_events",
"repos_url": "https://api.github.com/users/Anorov/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Anorov/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Anorov/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Anorov",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 6 |
2013-03-10T01:59:35Z
|
2021-09-09T04:00:48Z
|
2013-03-19T16:55:07Z
|
NONE
|
resolved
|
I'm currently working on integrating SOCKS proxies into urllib3 (see: https://github.com/shazow/urllib3/pull/68#issuecomment-14672574), and this is a minor change that I think could be useful. Idea was obtained from here: https://github.com/kennethreitz/requests/pull/1192#issuecomment-13564585
I feel the `proxies` keyword argument to Session() should accept a plain string URL in addition to the current dict-of-URLs option (`{"http": "...", "https": "..."}`). In the case of a string being passed, that proxy would be used regardless of the destination URL scheme.
Original:
`requests.get(url, proxies={"http": "http://1.1.1.1:8080"})`
(Proxy would only be used for `"http://website.com"`).
Proposed:
`requests.get(url, proxies="http://1.1.1.1:8080")`
(Proxy would be used for `"https://website.com"` and `"http://website.com"`).
Both would be permitted.
It's very common for users to only specify one proxy. After SOCKS proxies become supported, this will become even more common because SOCKS proxies can handle every kind of connection (an FTP destination, HTTP, HTTPS, etc.). So if a user is using a SOCKS proxy, it doesn't really make sense to specify multiple proxies in a dict. Use of a SOCKS5 proxy would look as follows: `requests.get(url, proxies="socks5://1.1.1.1:1080")`
This would not break the old API in any way, just add a new way of setting a proxy. The only disadvantage is that it creates a bit of a naming mismatch, since `proxies` is plural. I think it would be sillier to create a new `proxy` parameter, though (unless `proxy` simply became an alias for `proxies`).
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/935203?v=4",
"events_url": "https://api.github.com/users/Anorov/events{/privacy}",
"followers_url": "https://api.github.com/users/Anorov/followers",
"following_url": "https://api.github.com/users/Anorov/following{/other_user}",
"gists_url": "https://api.github.com/users/Anorov/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Anorov",
"id": 935203,
"login": "Anorov",
"node_id": "MDQ6VXNlcjkzNTIwMw==",
"organizations_url": "https://api.github.com/users/Anorov/orgs",
"received_events_url": "https://api.github.com/users/Anorov/received_events",
"repos_url": "https://api.github.com/users/Anorov/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Anorov/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Anorov/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Anorov",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/1241/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1241/timeline
| null |
completed
| null | null | false |
[
"Creating a new `proxy` parameter is right out because of Requests [feature freeze](http://docs.python-requests.org/en/latest/dev/todo/#feature-freeze).\n\nAs for adding a global way of specifying proxies for all schemes, I'm +0 on it. It's not a huge change, and could potentially go into 1.2.0, but it _does_ change the API slightly, so it's possible Kenneth won't be keen on it.\n",
"Creating a new \"proxy\" parameter certainly isn't necessary, was just a possible suggestion. It's probably not worth the change.\n\nAs for the API change (via a new string parameter), I personally think it would be sensible since it would be useful for most of the cases in which someone will need to use a proxy with requests.\n",
"Only a slight improvement, but I typically do:\n\n```\nrequests.get(url, proxies=dict.fromkeys(['http', 'https'], \"http://1.1.1.1:8080\"))\n```\n",
"@dhagrow That seems a bit unintuitive.\n",
"Well, I think the typical way to configure a proxy is via `http(s)_proxy` environment variables so I don't think any API change is necessary. (I assume `requests` is dealing with them, if not this would be a huge design bug...)\n\nIt even would break the standard Unix workflow that you specify both, http **and** https, so -1 from me.\n",
"@schlamar actually I believe urllib3 handles getting it via the environment variables for us, so there really shouldn't be an API change necessary.\n\nI'm also :-1: on this\n"
] |
https://api.github.com/repos/psf/requests/issues/1240
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1240/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1240/comments
|
https://api.github.com/repos/psf/requests/issues/1240/events
|
https://github.com/psf/requests/issues/1240
| 11,845,731 |
MDU6SXNzdWUxMTg0NTczMQ==
| 1,240 |
Cannot install as current user
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/2991890?v=4",
"events_url": "https://api.github.com/users/cipri-tom/events{/privacy}",
"followers_url": "https://api.github.com/users/cipri-tom/followers",
"following_url": "https://api.github.com/users/cipri-tom/following{/other_user}",
"gists_url": "https://api.github.com/users/cipri-tom/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/cipri-tom",
"id": 2991890,
"login": "cipri-tom",
"node_id": "MDQ6VXNlcjI5OTE4OTA=",
"organizations_url": "https://api.github.com/users/cipri-tom/orgs",
"received_events_url": "https://api.github.com/users/cipri-tom/received_events",
"repos_url": "https://api.github.com/users/cipri-tom/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/cipri-tom/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/cipri-tom/subscriptions",
"type": "User",
"url": "https://api.github.com/users/cipri-tom",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 2 |
2013-03-09T23:24:11Z
|
2021-09-09T04:00:49Z
|
2013-03-09T23:26:21Z
|
NONE
|
resolved
|
This is a very interesting issue.
I need requests on the place I work, and I do not have administration rights. For that reason, I install it using `python setup.py install --user` .
Actually, I can log in on two different computers: one is where I actually do my work, and has Python version 2.7, the other is the server from where I need to run my program, which has Python 2.4.3
I managed to install it on the working computer (Python v2.7), but it won't work on the server (Python v2.4.3). The error I get is: `python setup.py install --user
Traceback (most recent call last):
File "setup.py", line 6, in ?
import requests
File "/home/S12/tomoiac2/bin/kennethreitz-requests-3e72f23/requests/__init__.py", line 52
from . import utils
^
SyntaxError: invalid syntax`
Any ideas on why this happens and how it can be solved?
Thank you very much
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4",
"events_url": "https://api.github.com/users/Lukasa/events{/privacy}",
"followers_url": "https://api.github.com/users/Lukasa/followers",
"following_url": "https://api.github.com/users/Lukasa/following{/other_user}",
"gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Lukasa",
"id": 1382556,
"login": "Lukasa",
"node_id": "MDQ6VXNlcjEzODI1NTY=",
"organizations_url": "https://api.github.com/users/Lukasa/orgs",
"received_events_url": "https://api.github.com/users/Lukasa/received_events",
"repos_url": "https://api.github.com/users/Lukasa/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Lukasa",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/1240/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1240/timeline
| null |
completed
| null | null | false |
[
"Requests does not support Python 2.4. In this case, I suspect Python 2.4 does not allow relative imports, on which Requests relies.\n",
"Just FYI, Requests only supports 2.6+\n"
] |
https://api.github.com/repos/psf/requests/issues/1239
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1239/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1239/comments
|
https://api.github.com/repos/psf/requests/issues/1239/events
|
https://github.com/psf/requests/pull/1239
| 11,837,387 |
MDExOlB1bGxSZXF1ZXN0NDUzMDE5NA==
| 1,239 |
Use session cookies when following redirects
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/34607?v=4",
"events_url": "https://api.github.com/users/miikka/events{/privacy}",
"followers_url": "https://api.github.com/users/miikka/followers",
"following_url": "https://api.github.com/users/miikka/following{/other_user}",
"gists_url": "https://api.github.com/users/miikka/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/miikka",
"id": 34607,
"login": "miikka",
"node_id": "MDQ6VXNlcjM0NjA3",
"organizations_url": "https://api.github.com/users/miikka/orgs",
"received_events_url": "https://api.github.com/users/miikka/received_events",
"repos_url": "https://api.github.com/users/miikka/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/miikka/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/miikka/subscriptions",
"type": "User",
"url": "https://api.github.com/users/miikka",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 7 |
2013-03-09T11:13:26Z
|
2021-09-08T19:00:54Z
|
2013-03-20T10:37:25Z
|
CONTRIBUTOR
|
resolved
|
A fix for issue #1228.
I have a nagging feeling, that there'd be a better way to do this, but here goes.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4",
"events_url": "https://api.github.com/users/kennethreitz/events{/privacy}",
"followers_url": "https://api.github.com/users/kennethreitz/followers",
"following_url": "https://api.github.com/users/kennethreitz/following{/other_user}",
"gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/kennethreitz",
"id": 119893,
"login": "kennethreitz",
"node_id": "MDQ6VXNlcjExOTg5Mw==",
"organizations_url": "https://api.github.com/users/kennethreitz/orgs",
"received_events_url": "https://api.github.com/users/kennethreitz/received_events",
"repos_url": "https://api.github.com/users/kennethreitz/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/kennethreitz/starred{/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/1239/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1239/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/1239.diff",
"html_url": "https://github.com/psf/requests/pull/1239",
"merged_at": "2013-03-20T10:37:25Z",
"patch_url": "https://github.com/psf/requests/pull/1239.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/1239"
}
| true |
[
"Excited to see this getting fixed!\n\nMy immediate reaction here is perhaps `cookies` shouldn't need to be passed in? `SessionRedirectMixin` is extending `Session`, so we should be able to just reference `self.cookies` directly.\n\nDo you think your code will still work properly if we do that?\n",
"Sure - I attached a commit. You could just do `cookiejar = self.cookies`, but that would make Session.send persist the cookies across calls. I looked at issue #1201 but wasn't sure if that was desirable.\n",
"Yeah, I'm not sure which would be desirable at this time either. Need to think about it more first.\n\nThanks so much for your work on this! \n",
"Hmm, would you mind doing a rebase so i can merge?\n",
"Rebased.\n",
":+1: looks good to me. Sorry I was sick and couldn't review this earlier.\n",
":sparkles: :cake: :sparkles:\n"
] |
https://api.github.com/repos/psf/requests/issues/1238
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1238/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1238/comments
|
https://api.github.com/repos/psf/requests/issues/1238/events
|
https://github.com/psf/requests/pull/1238
| 11,799,009 |
MDExOlB1bGxSZXF1ZXN0NDUxMzAzMg==
| 1,238 |
cleanup (remove max_retries test)
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/642195?v=4",
"events_url": "https://api.github.com/users/oczkers/events{/privacy}",
"followers_url": "https://api.github.com/users/oczkers/followers",
"following_url": "https://api.github.com/users/oczkers/following{/other_user}",
"gists_url": "https://api.github.com/users/oczkers/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/oczkers",
"id": 642195,
"login": "oczkers",
"node_id": "MDQ6VXNlcjY0MjE5NQ==",
"organizations_url": "https://api.github.com/users/oczkers/orgs",
"received_events_url": "https://api.github.com/users/oczkers/received_events",
"repos_url": "https://api.github.com/users/oczkers/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/oczkers/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/oczkers/subscriptions",
"type": "User",
"url": "https://api.github.com/users/oczkers",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 1 |
2013-03-08T10:21:50Z
|
2021-09-08T19:00:54Z
|
2013-03-08T19:51:42Z
|
CONTRIBUTOR
|
resolved
|
It was reverted in b14584f36eca344ed5033d1d2f5a59490fadca56 but again merged in c0d4b23cea430ba1dce407f4325d9362c55d577c
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4",
"events_url": "https://api.github.com/users/kennethreitz/events{/privacy}",
"followers_url": "https://api.github.com/users/kennethreitz/followers",
"following_url": "https://api.github.com/users/kennethreitz/following{/other_user}",
"gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/kennethreitz",
"id": 119893,
"login": "kennethreitz",
"node_id": "MDQ6VXNlcjExOTg5Mw==",
"organizations_url": "https://api.github.com/users/kennethreitz/orgs",
"received_events_url": "https://api.github.com/users/kennethreitz/received_events",
"repos_url": "https://api.github.com/users/kennethreitz/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/kennethreitz/starred{/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/1238/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1238/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/1238.diff",
"html_url": "https://github.com/psf/requests/pull/1238",
"merged_at": "2013-03-08T19:51:42Z",
"patch_url": "https://github.com/psf/requests/pull/1238.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/1238"
}
| true |
[
":cake:\n"
] |
https://api.github.com/repos/psf/requests/issues/1237
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1237/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1237/comments
|
https://api.github.com/repos/psf/requests/issues/1237/events
|
https://github.com/psf/requests/issues/1237
| 11,774,145 |
MDU6SXNzdWUxMTc3NDE0NQ==
| 1,237 |
FTP possible ?
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1226080?v=4",
"events_url": "https://api.github.com/users/YAmikep/events{/privacy}",
"followers_url": "https://api.github.com/users/YAmikep/followers",
"following_url": "https://api.github.com/users/YAmikep/following{/other_user}",
"gists_url": "https://api.github.com/users/YAmikep/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/YAmikep",
"id": 1226080,
"login": "YAmikep",
"node_id": "MDQ6VXNlcjEyMjYwODA=",
"organizations_url": "https://api.github.com/users/YAmikep/orgs",
"received_events_url": "https://api.github.com/users/YAmikep/received_events",
"repos_url": "https://api.github.com/users/YAmikep/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/YAmikep/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/YAmikep/subscriptions",
"type": "User",
"url": "https://api.github.com/users/YAmikep",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 2 |
2013-03-07T19:08:09Z
|
2021-09-09T04:00:49Z
|
2013-03-07T19:11:18Z
|
NONE
|
resolved
|
Is it possible to download a file over FTP with requests?
I have tried it but it does not work.
Thanks.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4",
"events_url": "https://api.github.com/users/Lukasa/events{/privacy}",
"followers_url": "https://api.github.com/users/Lukasa/followers",
"following_url": "https://api.github.com/users/Lukasa/following{/other_user}",
"gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Lukasa",
"id": 1382556,
"login": "Lukasa",
"node_id": "MDQ6VXNlcjEzODI1NTY=",
"organizations_url": "https://api.github.com/users/Lukasa/orgs",
"received_events_url": "https://api.github.com/users/Lukasa/received_events",
"repos_url": "https://api.github.com/users/Lukasa/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Lukasa",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/1237/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1237/timeline
| null |
completed
| null | null | false |
[
"Hey, I have topical knowledge!\n\nThe answer is that, strictly speaking, no. Requests is an HTTP library. However, after the release of v1.0.0, I made a [proof of concept of FTP in Requests](https://github.com/Lukasa/requests-ftp). Feel free to use it. Bear in mind it's barely functional. If you encounter problems, raise an issue and I'll see what I can do.\n",
"All right, that is what I was thinking.\nThank you for your quick answer.\n"
] |
https://api.github.com/repos/psf/requests/issues/1236
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1236/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1236/comments
|
https://api.github.com/repos/psf/requests/issues/1236/events
|
https://github.com/psf/requests/issues/1236
| 11,757,824 |
MDU6SXNzdWUxMTc1NzgyNA==
| 1,236 |
socket.timeout is thrown instead of requests.exceptions.Timeout
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/3797538?v=4",
"events_url": "https://api.github.com/users/dmalenko/events{/privacy}",
"followers_url": "https://api.github.com/users/dmalenko/followers",
"following_url": "https://api.github.com/users/dmalenko/following{/other_user}",
"gists_url": "https://api.github.com/users/dmalenko/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/dmalenko",
"id": 3797538,
"login": "dmalenko",
"node_id": "MDQ6VXNlcjM3OTc1Mzg=",
"organizations_url": "https://api.github.com/users/dmalenko/orgs",
"received_events_url": "https://api.github.com/users/dmalenko/received_events",
"repos_url": "https://api.github.com/users/dmalenko/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/dmalenko/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/dmalenko/subscriptions",
"type": "User",
"url": "https://api.github.com/users/dmalenko",
"user_view_type": "public"
}
|
[
{
"color": "f7c6c7",
"default": false,
"description": null,
"id": 167537670,
"name": "Propose Close",
"node_id": "MDU6TGFiZWwxNjc1Mzc2NzA=",
"url": "https://api.github.com/repos/psf/requests/labels/Propose%20Close"
}
] |
closed
| true | null |
[] | null | 26 |
2013-03-07T12:44:48Z
|
2021-09-08T20:01:00Z
|
2015-01-19T09:27:00Z
|
NONE
|
resolved
|
When _timeout_ parameter is used, socket operations can thrown _socket.timeout_ exception, which is not converted into _requests.exceptions.Timeout_. This causes users to handle two different types of exceptions, which essentially represent the same error.
Here is corresponding traceback:
```
>>> r=requests.get('http://files.animeblog.ru/manga/Bakuman/Bakuman_vol01.rar', timeout=0.5)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/u/vpython/lib/python2.7/site-packages/requests/api.py", line 55, in get
return request('get', url, **kwargs)
File "/Users/u/vpython/lib/python2.7/site-packages/requests/api.py", line 44, in request
return session.request(method=method, url=url, **kwargs)
File "/Users/u/vpython/lib/python2.7/site-packages/requests/sessions.py", line 279, in request
resp = self.send(prep, stream=stream, timeout=timeout, verify=verify, cert=cert, proxies=proxies)
File "/Users/u/vpython/lib/python2.7/site-packages/requests/sessions.py", line 374, in send
r = adapter.send(request, **kwargs)
File "/Users/u/vpython/lib/python2.7/site-packages/requests/adapters.py", line 222, in send
r.content
File "/Users/u/vpython/lib/python2.7/site-packages/requests/models.py", line 550, in content
self._content = bytes().join(self.iter_content(CONTENT_CHUNK_SIZE)) or bytes()
File "/Users/u/vpython/lib/python2.7/site-packages/requests/models.py", line 496, in generate
chunk = self.raw.read(chunk_size)
File "/Users/u/vpython/lib/python2.7/site-packages/requests/packages/urllib3/response.py", line 148, in read
return self._fp.read(amt)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 561, in read
s = self.fp.read(amt)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/socket.py", line 380, in read
data = self._sock.recv(left)
socket.timeout: timed out
```
|
{
"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/1236/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1236/timeline
| null |
completed
| null | null | false |
[
"Good spot, I'll take a look at this. =)\n",
"We don't catch this and urllib3 doesn't try to catch and re-throw this error. If anything, the patch should be submitted upstream to urllib3 and then we won't need changes here.\n",
"I believe this creates a leaky abstraction: requests intentionally or unintentionally exposes internal implementation details, which erode the value of abstraction layer on top of urllib3.\n\nFrom practical standpoint this means that one cannot rely on requests providing consistent and well-defined interface. In particular one would have to handle exceptions that can be thrown by urllib3 and below in addition to requests exceptions, which creates unnecessary dependencies that requests library was meant to abstract.\n\nRegardless of how urllib3 deals socket timeout it would be best for requests to not require users to handle two different exceptions for basically the same error condition. After all requests is HTTP library for human beings.\n",
"Yep, @dmalenko is right. We're getting this exact issue too (with the same traceback). I _don't_ think it's simply urllib3's fault, because it's requests that's calling `urllib3.Response.read()` and not handling errors around that call.\n\nArguably urllib3 should handle socket.timeout or other errors too, and convert them to a urllib3.TimeoutError. But even if it did that, requests would still need to catch that and re-raise a `requests.Timeout`, otherwise the user of requests would still have to know to catch `urllib3.TimeoutError`.\n\nSo I think requests should simply catch the socket.timeout / socket.error in `models.Response.iter_content()`. It could also catch `urllib3.TimeoutError` and do the same thing, in case urllib3 fixes their part of this issue.\n",
"@benhoyt We're in total agreement. I had this assigned to me but haven't had time to do anything about it, and won't do for a few weeks. We're open to a Pull Request if you'd like to write one, otherwise this is unlikely to happen in the next couple of weeks.\n",
"I looked into this a bit. I didn't get too far, but I'll note my observations for the benefit of others. [The documentation](http://docs.python-requests.org/en/latest/user/quickstart/#timeouts) says:\n\n> timeout only effects the connection process itself, not the downloading of the response body.\n\nAs seen here, it's not true. In @dmalenko's case, the connection is opened and the headers are sent fast enough, but the server sends data so slowly that recv timeouts. The same thing happens with `iter_content`.\n\nThis happens because urllib3 sets the timeout for the underlying httplib socket to catch connection timeouts. After the connection is established, the timeout stays set and affects the recv calls, but the errors aren't catched anymore.\n",
"Thanks, @miikka. I notice that part of the documentation is inside a \"Note:\" -- to me it looks like that's basically an implementation detail. I'd think when I specify a timeout I want it to be a timeout on the whole thing, so maybe in this case the documentation can simply be changed to match reality?\n\nNote that I don't think the above affects the issue in any way -- we still want this to be a `requests.Timeout`.\n",
"Yeah @miikka, you're right, it isn't true. Sometimes.\n\nWe confusingly use `timeout` in two different ways. For non-chunked requests, we use `timeout` as a parameter on the underlying HTTP connection, which applies it just as httplib would. For chunked uploads, we use it as a timeout on getting the connection from the connection pool, and then apply no timeout to the connection itself (see #1422). I'll look into getting this mess sorted out, but if you want to try to tackle it yourselves please do. =)\n",
"I am still having this problem. Is this because it has not been corrected or because I am using an old version of urllib3 or requests library?\n",
"Which exact problem are you seeing?\n",
"```\n File \"run_script.py\", line 152, in <module>\n j = requests.get(my_url, params = mbc_params, timeout=10.00)\n File \"/home/nhssr/.PythonVirtualEnvironment/lib/requests/api.py\", line 55, in get\n return request('get', url, **kwargs)\n File \"/home/nhssr/.PythonVirtualEnvironment/lib/requests/api.py\", line 44, in request\n return session.request(method=method, url=url, **kwargs)\n File \"/home/nhssr/.PythonVirtualEnvironment/lib/requests/sessions.py\", line 456, in request\n resp = self.send(prep, **send_kwargs)\n File \"/home/nhssr/.PythonVirtualEnvironment/lib/requests/sessions.py\", line 596, in send\n r.content\n File \"/home/nhssr/.PythonVirtualEnvironment/lib/requests/models.py\", line 694, in content\n self._content = bytes().join(self.iter_content(CONTENT_CHUNK_SIZE)) or bytes()\n File \"/home/nhssr/.PythonVirtualEnvironment/lib/requests/models.py\", line 627, in generate\n for chunk in self.raw.stream(chunk_size, decode_content=True):\n File \"/home/nhssr/.PythonVirtualEnvironment/lib/requests/packages/urllib3/response.py\", line 240, in stream\n data = self.read(amt=amt, decode_content=decode_content)\n File \"/home/nhssr/.PythonVirtualEnvironment/lib/requests/packages/urllib3/response.py\", line 187, in read\n data = self._fp.read(amt)\n File \"/apollo/package/local_1/Linux-2.6c2.5-x86_64/Python27/Python27-309.0-0/lib/python2.7/httplib.py\", line 543, in read\n return self._read_chunked(amt)\n File \"/apollo/package/local_1/Linux-2.6c2.5-x86_64/Python27/Python27-309.0-0/lib/python2.7/httplib.py\", line 585, in _read_chunked\n line = self.fp.readline(_MAXLINE + 1)\n File \"/apollo/package/local_1/Linux-2.6c2.5-x86_64/Python27/Python27-309.0-0/lib/python2.7/socket.py\", line 476, in readline\n data = self._sock.recv(self._rbufsize)\nsocket.timeout: timed out\n```\n",
"I am catching this:\n except requests.exceptions.Timeout:\n",
"But it does not seem to be enough. I am not using any of the low level libraries explicitly. I was hoping I could simple use the requests library to handle all my HTTP requests. Now I am trying to see how I can catch that exception. I guess I am gonna have to import the socket library as well or maybe even urllib. But it would seem to be little bit contrary to the intent of the requests library to be a wrapper for those other libraries that I have to call on them to handle this exception.\n",
"You seem to have misunderstood this bug. It is still open because it remains broken.\n",
"I was wondering if that's the case. Thank your for your response. I'll try \n\nimport socket\n..\nexcept socket.timeout:\n..\n",
"Thanks @miikka for the explanation that let me reliably reproduce this error using HTTPBin's Drip endpoint:\n\n```\nPython 2.7.6 (v2.7.6:3a1db0d2747e, Nov 10 2013, 00:42:54) \n[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\n>>> import requests\n>>> requests.__version__\n'2.2.1'\n>>> r = requests.get('http://httpbin.org/drip?numbytes=5&duration=5', timeout=0.2)\nTraceback (most recent call last):\n File \"<stdin>\", line 1, in <module>\n File \"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/requests/api.py\", line 55, in get\n return request('get', url, **kwargs)\n File \"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/requests/api.py\", line 44, in request\n return session.request(method=method, url=url, **kwargs)\n File \"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/requests/sessions.py\", line 383, in request\n resp = self.send(prep, **send_kwargs)\n File \"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/requests/sessions.py\", line 486, in send\n r = adapter.send(request, **kwargs)\n File \"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/requests/adapters.py\", line 394, in send\n r.content\n File \"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/requests/models.py\", line 679, in content\n self._content = bytes().join(self.iter_content(CONTENT_CHUNK_SIZE)) or bytes()\n File \"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/requests/models.py\", line 616, in generate\n decode_content=True):\n File \"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/requests/packages/urllib3/response.py\", line 236, in stream\n data = self.read(amt=amt, decode_content=decode_content)\n File \"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/requests/packages/urllib3/response.py\", line 183, in read\n data = self._fp.read(amt)\n File \"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py\", line 543, in read\n return self._read_chunked(amt)\n File \"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py\", line 585, in _read_chunked\n line = self.fp.readline(_MAXLINE + 1)\n File \"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/socket.py\", line 476, in readline\n data = self._sock.recv(self._rbufsize)\nsocket.timeout: timed out\n```\n\nI'm working around as @kaisarea suggested, catching both the `RequestException` exception and the `socket.timeout`.\n",
"this is fixed? we can trust requests won't throw socket.timeout or any other exceptions besides http://docs.python-requests.org/en/latest/user/quickstart/#errors-and-exceptions?\n",
"No, you cannot trust that. For example, requests may throw IOError, or ValueError, or a number of other things that are not in that list.\n\nHowever, requests _should not_ throw naked versions of exceptions from urllib3, httplib, or socket. If it does, we consider it a bug. I cannot 100% promise that it doesn't, because we've missed points in the past and probably will again. Bugs happen. =(\n",
"Ok @Lukasa , thanks! I need to implement a \"retry\" logic and I can't use urllib3 retries because I need more control. So I needed to know which exceptions should I catch, but I'll catch `Exception` anyway and catch others to do custom stuff for each one.\n",
"We also see `socket.error` connection reset by peer from the iter content call \n",
"@sbv-csis What version of requests, and where did you install it from?\n",
"@Lukasa We use 2.8.1 from https://pypi.python.org/pypi/requests\n",
"@sbv-csis Can you post any code that will reproduce this? And the traceback?\n",
"In essence it's\n\n```\nwith open(filename, 'wb') as f:\n r = request.get(amazons3url, stream=True)\n for chunk in r.iter_content(128 * 1024):\n f.write(chunk)\n```\n\nThe traceback is:\n\n```\n File \"/opt/python2.7/lib/python2.7/site-packages/saws/s3.py\", line 185, in download\n for block in response.iter_content(block_size):\n File \"/opt/python2.7/lib/python2.7/site-packages/requests/models.py\", line 657, in generate\n for chunk in self.raw.stream(chunk_size, decode_content=True):\n File \"/opt/python2.7/lib/python2.7/site-packages/requests/packages/urllib3/response.py\", line 326, in stream\n data = self.read(amt=amt, decode_content=decode_content)\n File \"/opt/python2.7/lib/python2.7/site-packages/requests/packages/urllib3/response.py\", line 282, in read\n data = self._fp.read(amt)\n File \"/opt/python2.7/lib/python2.7/httplib.py\", line 612, in read\n s = self.fp.read(amt)\n File \"/opt/python2.7/lib/python2.7/socket.py\", line 384, in read\n data = self._sock.recv(left)\n File \"/opt/python2.7/lib/python2.7/ssl.py\", line 734, in recv\n return self.read(buflen)\n File \"/opt/python2.7/lib/python2.7/ssl.py\", line 621, in read\n v = self._sslobj.read(len or 1024)\n socket.error: [Errno 104] Connection reset by peer\n```\n",
"Yup, so this is a urllib3 bug. Thanks for spotting it, I've raised it as shazow/urllib3#756.\n",
"cheers! Thanks for the response.\n"
] |
https://api.github.com/repos/psf/requests/issues/1235
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1235/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1235/comments
|
https://api.github.com/repos/psf/requests/issues/1235/events
|
https://github.com/psf/requests/issues/1235
| 11,684,717 |
MDU6SXNzdWUxMTY4NDcxNw==
| 1,235 |
Removing traling and leading spaces, and newline from headers
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/505230?v=4",
"events_url": "https://api.github.com/users/karlcow/events{/privacy}",
"followers_url": "https://api.github.com/users/karlcow/followers",
"following_url": "https://api.github.com/users/karlcow/following{/other_user}",
"gists_url": "https://api.github.com/users/karlcow/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/karlcow",
"id": 505230,
"login": "karlcow",
"node_id": "MDQ6VXNlcjUwNTIzMA==",
"organizations_url": "https://api.github.com/users/karlcow/orgs",
"received_events_url": "https://api.github.com/users/karlcow/received_events",
"repos_url": "https://api.github.com/users/karlcow/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/karlcow/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/karlcow/subscriptions",
"type": "User",
"url": "https://api.github.com/users/karlcow",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 4 |
2013-03-05T20:30:05Z
|
2021-09-09T04:00:47Z
|
2013-03-10T03:01:11Z
|
CONTRIBUTOR
|
resolved
|
Hello,
currently Requests has the [same issue](http://bugs.python.org/issue17322) (see the full discussion) than the standard library.
```
>>> import requests
>>> url = "http://www.w3.org/"
>>> headers = {'foo': 'bar', ' fooLead': 'bar', 'fooTrail ': 'bar', 'foo\nlish': 'bar'}
>>> r = requests.get(url, headers=headers)
>>> r.text
u'<html><body><h1>400 Bad request</h1>\nYour browser sent an invalid request.\n</body></html>\n'
```
Quick summary on the constraints on HTTP header `field-name`:
- Leading spaces are deprecated and interpreted by conformant servers as continuation line.
- Trailing spaces are forbidden and might create security issues
- Newline break the full thing.
Bonus: Check also if we use only the allowed set of characters.
Would you like me to provide a patch and associated tests for fixing it?
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/505230?v=4",
"events_url": "https://api.github.com/users/karlcow/events{/privacy}",
"followers_url": "https://api.github.com/users/karlcow/followers",
"following_url": "https://api.github.com/users/karlcow/following{/other_user}",
"gists_url": "https://api.github.com/users/karlcow/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/karlcow",
"id": 505230,
"login": "karlcow",
"node_id": "MDQ6VXNlcjUwNTIzMA==",
"organizations_url": "https://api.github.com/users/karlcow/orgs",
"received_events_url": "https://api.github.com/users/karlcow/received_events",
"repos_url": "https://api.github.com/users/karlcow/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/karlcow/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/karlcow/subscriptions",
"type": "User",
"url": "https://api.github.com/users/karlcow",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/1235/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1235/timeline
| null |
completed
| null | null | false |
[
"I don't know if policing this is our job. It's not clear to me that we should police that your headers meet the RFCs.\n",
"Policing, nope.\nBut giving the chance to have a more predictable behavior, yes. At least, if not removing the forbidden characters, a warning could be raised so people are given the opportunity to fix it. Instead of running into circles to see that empty space they had forgotten ;)\n",
"I still don't like requests performing this check either honestly. This is never going to affect the headers that we create and users can send whatever they like, especially by modifying a PreparedRequest object. That would also be the only place to add this check if @kennethreitz wants to add it, but I don't see a real need for it.\n",
"I don't really understand the resistance or friction to improve and make a better predictable product. I will fix things on my side. I'm closing.\n"
] |
https://api.github.com/repos/psf/requests/issues/1234
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1234/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1234/comments
|
https://api.github.com/repos/psf/requests/issues/1234/events
|
https://github.com/psf/requests/pull/1234
| 11,670,998 |
MDExOlB1bGxSZXF1ZXN0NDQ0OTE2MQ==
| 1,234 |
Fix issue #1225 (Documentation: response object status/reason)
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/2497217?v=4",
"events_url": "https://api.github.com/users/Vassius/events{/privacy}",
"followers_url": "https://api.github.com/users/Vassius/followers",
"following_url": "https://api.github.com/users/Vassius/following{/other_user}",
"gists_url": "https://api.github.com/users/Vassius/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Vassius",
"id": 2497217,
"login": "Vassius",
"node_id": "MDQ6VXNlcjI0OTcyMTc=",
"organizations_url": "https://api.github.com/users/Vassius/orgs",
"received_events_url": "https://api.github.com/users/Vassius/received_events",
"repos_url": "https://api.github.com/users/Vassius/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Vassius/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Vassius/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Vassius",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 1 |
2013-03-05T15:25:05Z
|
2021-09-09T00:01:24Z
|
2013-03-05T15:31:11Z
|
CONTRIBUTOR
|
resolved
|
Just a small docs fix.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4",
"events_url": "https://api.github.com/users/kennethreitz/events{/privacy}",
"followers_url": "https://api.github.com/users/kennethreitz/followers",
"following_url": "https://api.github.com/users/kennethreitz/following{/other_user}",
"gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/kennethreitz",
"id": 119893,
"login": "kennethreitz",
"node_id": "MDQ6VXNlcjExOTg5Mw==",
"organizations_url": "https://api.github.com/users/kennethreitz/orgs",
"received_events_url": "https://api.github.com/users/kennethreitz/received_events",
"repos_url": "https://api.github.com/users/kennethreitz/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions",
"type": "User",
"url": "https://api.github.com/users/kennethreitz",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/1234/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1234/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/1234.diff",
"html_url": "https://github.com/psf/requests/pull/1234",
"merged_at": "2013-03-05T15:31:11Z",
"patch_url": "https://github.com/psf/requests/pull/1234.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/1234"
}
| true |
[
"Thanks!\n"
] |
https://api.github.com/repos/psf/requests/issues/1233
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1233/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1233/comments
|
https://api.github.com/repos/psf/requests/issues/1233/events
|
https://github.com/psf/requests/issues/1233
| 11,581,758 |
MDU6SXNzdWUxMTU4MTc1OA==
| 1,233 |
Cut a release for v1.2.0
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4",
"events_url": "https://api.github.com/users/kennethreitz/events{/privacy}",
"followers_url": "https://api.github.com/users/kennethreitz/followers",
"following_url": "https://api.github.com/users/kennethreitz/following{/other_user}",
"gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/kennethreitz",
"id": 119893,
"login": "kennethreitz",
"node_id": "MDQ6VXNlcjExOTg5Mw==",
"organizations_url": "https://api.github.com/users/kennethreitz/orgs",
"received_events_url": "https://api.github.com/users/kennethreitz/received_events",
"repos_url": "https://api.github.com/users/kennethreitz/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions",
"type": "User",
"url": "https://api.github.com/users/kennethreitz",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 13 |
2013-03-02T21:05:11Z
|
2021-09-09T04:00:42Z
|
2013-04-01T18:29:17Z
|
CONTRIBUTOR
|
resolved
|
/cc @sigmavirus24 @slingamn
Anything pending for a new release? A ton of stuff has happened.
_Note_ I updated the title to reflect what is generally believed to be the correct version we should cut. --Ian
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/240830?v=4",
"events_url": "https://api.github.com/users/sigmavirus24/events{/privacy}",
"followers_url": "https://api.github.com/users/sigmavirus24/followers",
"following_url": "https://api.github.com/users/sigmavirus24/following{/other_user}",
"gists_url": "https://api.github.com/users/sigmavirus24/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/sigmavirus24",
"id": 240830,
"login": "sigmavirus24",
"node_id": "MDQ6VXNlcjI0MDgzMA==",
"organizations_url": "https://api.github.com/users/sigmavirus24/orgs",
"received_events_url": "https://api.github.com/users/sigmavirus24/received_events",
"repos_url": "https://api.github.com/users/sigmavirus24/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/sigmavirus24/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/sigmavirus24/subscriptions",
"type": "User",
"url": "https://api.github.com/users/sigmavirus24",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/1233/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1233/timeline
| null |
completed
| null | null | false |
[
"A damn lot has happened. Did you want multidicts ready for this? I'm still trying to think of a good way to handle the merging of keyword arguments. Also, I'm missing one error class from Flask, but my branch isn't really ready for a merge at all.\n\nAlso pinging the jet-lagged @Lukasa \n",
"I'm not sitting on anything that needs doing. =) I've only been doing small stuff while I was on holiday so that I wouldn't hold up any releases.\n",
"What about waiting for HTTPS proxy support: https://github.com/shazow/urllib3/issues/139? This might be worth a 1.2, though.\nChanges for requests would be relatively small, see #1209.\n",
"I don't think it's worth blocking 1.1.1 for that, because shazow's time is always at a premium and it could take quite some time to make it in to urllib3.\n",
"Merge #1223 and I'll be happy. :) Also, we need to figure out what has since 1.1.0. A git log would definitely work. (And it's really what the Linux Kernel does)\n",
"Merged :)\n",
"I'm :+1: for a 1.1.1 release then. Just filter out all the Merge commits from GitHub and use the gitlog for the changelog ;) (It's the lazy way™)\n",
"Yeah, and re @schlamar's concern: https://github.com/shazow/urllib3/pull/56#issuecomment-14412603 would indicate we'd have to wait longer than I think you'd like to.\n",
"Hi all; any updates on this?\n\nI've got a few users running into #1189, so we're all eagerly waiting for this release =)\n",
"Just a side note #1261 is blocking this release in my opinion although, not anything that's too difficult.\n",
"Tonight, I'm going to put together a changelog as best as I can. I post it here, and after @Lukasa wraps up #1252 I think we should cut 1.2 tonight.\n",
"#1252 is no longer blocking this release. See the discussion there.\n",
"I'm working on the changelog. I'll have a pull request ready for tonight. I'm leaving the exact date open to Kenneth.\n"
] |
https://api.github.com/repos/psf/requests/issues/1232
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1232/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1232/comments
|
https://api.github.com/repos/psf/requests/issues/1232/events
|
https://github.com/psf/requests/issues/1232
| 11,581,459 |
MDU6SXNzdWUxMTU4MTQ1OQ==
| 1,232 |
あ
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/3436230?v=4",
"events_url": "https://api.github.com/users/ToruFukui/events{/privacy}",
"followers_url": "https://api.github.com/users/ToruFukui/followers",
"following_url": "https://api.github.com/users/ToruFukui/following{/other_user}",
"gists_url": "https://api.github.com/users/ToruFukui/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/ToruFukui",
"id": 3436230,
"login": "ToruFukui",
"node_id": "MDQ6VXNlcjM0MzYyMzA=",
"organizations_url": "https://api.github.com/users/ToruFukui/orgs",
"received_events_url": "https://api.github.com/users/ToruFukui/received_events",
"repos_url": "https://api.github.com/users/ToruFukui/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/ToruFukui/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/ToruFukui/subscriptions",
"type": "User",
"url": "https://api.github.com/users/ToruFukui",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 0 |
2013-03-02T20:43:06Z
|
2021-09-09T04:00:50Z
|
2013-03-02T20:43:43Z
|
NONE
|
resolved
|
あ
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/3436230?v=4",
"events_url": "https://api.github.com/users/ToruFukui/events{/privacy}",
"followers_url": "https://api.github.com/users/ToruFukui/followers",
"following_url": "https://api.github.com/users/ToruFukui/following{/other_user}",
"gists_url": "https://api.github.com/users/ToruFukui/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/ToruFukui",
"id": 3436230,
"login": "ToruFukui",
"node_id": "MDQ6VXNlcjM0MzYyMzA=",
"organizations_url": "https://api.github.com/users/ToruFukui/orgs",
"received_events_url": "https://api.github.com/users/ToruFukui/received_events",
"repos_url": "https://api.github.com/users/ToruFukui/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/ToruFukui/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/ToruFukui/subscriptions",
"type": "User",
"url": "https://api.github.com/users/ToruFukui",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/1232/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1232/timeline
| null |
completed
| null | null | false |
[] |
https://api.github.com/repos/psf/requests/issues/1231
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1231/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1231/comments
|
https://api.github.com/repos/psf/requests/issues/1231/events
|
https://github.com/psf/requests/pull/1231
| 11,573,007 |
MDExOlB1bGxSZXF1ZXN0NDQwODQyNg==
| 1,231 |
Initial docs patch for migrating from pre 1.0
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/185043?v=4",
"events_url": "https://api.github.com/users/davidfischer/events{/privacy}",
"followers_url": "https://api.github.com/users/davidfischer/followers",
"following_url": "https://api.github.com/users/davidfischer/following{/other_user}",
"gists_url": "https://api.github.com/users/davidfischer/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/davidfischer",
"id": 185043,
"login": "davidfischer",
"node_id": "MDQ6VXNlcjE4NTA0Mw==",
"organizations_url": "https://api.github.com/users/davidfischer/orgs",
"received_events_url": "https://api.github.com/users/davidfischer/received_events",
"repos_url": "https://api.github.com/users/davidfischer/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/davidfischer/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/davidfischer/subscriptions",
"type": "User",
"url": "https://api.github.com/users/davidfischer",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 5 |
2013-03-02T07:24:43Z
|
2021-09-08T19:00:53Z
|
2013-03-02T20:58:49Z
|
CONTRIBUTOR
|
resolved
|
Hopefully this helps with issues like #1196. I know when 1.0 first dropped I went straight to the docs looking for this and I was surprised it didn't exist.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4",
"events_url": "https://api.github.com/users/kennethreitz/events{/privacy}",
"followers_url": "https://api.github.com/users/kennethreitz/followers",
"following_url": "https://api.github.com/users/kennethreitz/following{/other_user}",
"gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/kennethreitz",
"id": 119893,
"login": "kennethreitz",
"node_id": "MDQ6VXNlcjExOTg5Mw==",
"organizations_url": "https://api.github.com/users/kennethreitz/orgs",
"received_events_url": "https://api.github.com/users/kennethreitz/received_events",
"repos_url": "https://api.github.com/users/kennethreitz/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/kennethreitz/starred{/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/1231/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1231/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/1231.diff",
"html_url": "https://github.com/psf/requests/pull/1231",
"merged_at": "2013-03-02T20:58:49Z",
"patch_url": "https://github.com/psf/requests/pull/1231.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/1231"
}
| true |
[
"Thanks for this. I've been working a little bit on something like this on the side, but it's way better if you do it than me. =D This is a great place to start from. I've made one small note in the diff which is worth doing in this PR. I'm +1 on this or something like it.\n",
"I updated the patch based on the feedback. I never actually used streaming responses myself so I didn't actually realize that the logic was inverted. Good catch.\n",
"Thanks so much for this!\n\nMy only feedback is this:\n\n`s = requests.Session()`\n\nInstead of:\n\n`with requests.session() as s:`\n",
"I don't know exactly what the stance on this is, but I can rebase these commits if you prefer.\n",
":sparkles: :cake: :sparkles:\n"
] |
https://api.github.com/repos/psf/requests/issues/1230
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1230/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1230/comments
|
https://api.github.com/repos/psf/requests/issues/1230/events
|
https://github.com/psf/requests/pull/1230
| 11,571,709 |
MDExOlB1bGxSZXF1ZXN0NDQwNzk2MA==
| 1,230 |
Github URL fix
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/185043?v=4",
"events_url": "https://api.github.com/users/davidfischer/events{/privacy}",
"followers_url": "https://api.github.com/users/davidfischer/followers",
"following_url": "https://api.github.com/users/davidfischer/following{/other_user}",
"gists_url": "https://api.github.com/users/davidfischer/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/davidfischer",
"id": 185043,
"login": "davidfischer",
"node_id": "MDQ6VXNlcjE4NTA0Mw==",
"organizations_url": "https://api.github.com/users/davidfischer/orgs",
"received_events_url": "https://api.github.com/users/davidfischer/received_events",
"repos_url": "https://api.github.com/users/davidfischer/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/davidfischer/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/davidfischer/subscriptions",
"type": "User",
"url": "https://api.github.com/users/davidfischer",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 1 |
2013-03-02T04:40:08Z
|
2021-09-08T19:00:53Z
|
2013-03-02T20:59:10Z
|
CONTRIBUTOR
|
resolved
|
Fixed typo.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4",
"events_url": "https://api.github.com/users/kennethreitz/events{/privacy}",
"followers_url": "https://api.github.com/users/kennethreitz/followers",
"following_url": "https://api.github.com/users/kennethreitz/following{/other_user}",
"gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/kennethreitz",
"id": 119893,
"login": "kennethreitz",
"node_id": "MDQ6VXNlcjExOTg5Mw==",
"organizations_url": "https://api.github.com/users/kennethreitz/orgs",
"received_events_url": "https://api.github.com/users/kennethreitz/received_events",
"repos_url": "https://api.github.com/users/kennethreitz/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/kennethreitz/starred{/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/1230/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1230/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/1230.diff",
"html_url": "https://github.com/psf/requests/pull/1230",
"merged_at": "2013-03-02T20:59:10Z",
"patch_url": "https://github.com/psf/requests/pull/1230.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/1230"
}
| true |
[
"Thanks! Keep em coming :)\n"
] |
https://api.github.com/repos/psf/requests/issues/1229
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/1229/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/1229/comments
|
https://api.github.com/repos/psf/requests/issues/1229/events
|
https://github.com/psf/requests/pull/1229
| 11,558,031 |
MDExOlB1bGxSZXF1ZXN0NDQwMTA2Mw==
| 1,229 |
Doc fix: URLError doesn't exist anymore
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/110295?v=4",
"events_url": "https://api.github.com/users/sprt/events{/privacy}",
"followers_url": "https://api.github.com/users/sprt/followers",
"following_url": "https://api.github.com/users/sprt/following{/other_user}",
"gists_url": "https://api.github.com/users/sprt/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/sprt",
"id": 110295,
"login": "sprt",
"node_id": "MDQ6VXNlcjExMDI5NQ==",
"organizations_url": "https://api.github.com/users/sprt/orgs",
"received_events_url": "https://api.github.com/users/sprt/received_events",
"repos_url": "https://api.github.com/users/sprt/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/sprt/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/sprt/subscriptions",
"type": "User",
"url": "https://api.github.com/users/sprt",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 3 |
2013-03-01T19:23:51Z
|
2021-09-08T23:06:29Z
|
2013-03-02T20:59:41Z
|
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/1229/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/1229/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/1229.diff",
"html_url": "https://github.com/psf/requests/pull/1229",
"merged_at": "2013-03-02T20:59:41Z",
"patch_url": "https://github.com/psf/requests/pull/1229.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/1229"
}
| true |
[
":+1:\n",
"+1\n",
":metal:\n"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.