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/828
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/828/labels{/name}
https://api.github.com/repos/psf/requests/issues/828/comments
https://api.github.com/repos/psf/requests/issues/828/events
https://github.com/psf/requests/pull/828
6,590,080
MDExOlB1bGxSZXF1ZXN0MjIyMjg0OA==
828
Develop
{ "avatar_url": "https://avatars.githubusercontent.com/u/1146703?v=4", "events_url": "https://api.github.com/users/SecurityForUs/events{/privacy}", "followers_url": "https://api.github.com/users/SecurityForUs/followers", "following_url": "https://api.github.com/users/SecurityForUs/following{/other_user}", "gists_url": "https://api.github.com/users/SecurityForUs/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/SecurityForUs", "id": 1146703, "login": "SecurityForUs", "node_id": "MDQ6VXNlcjExNDY3MDM=", "organizations_url": "https://api.github.com/users/SecurityForUs/orgs", "received_events_url": "https://api.github.com/users/SecurityForUs/received_events", "repos_url": "https://api.github.com/users/SecurityForUs/repos", "site_admin": false, "starred_url": "https://api.github.com/users/SecurityForUs/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/SecurityForUs/subscriptions", "type": "User", "url": "https://api.github.com/users/SecurityForUs", "user_view_type": "public" }
[]
closed
true
null
[]
null
6
2012-08-31T22:10:35Z
2021-09-08T23:07:26Z
2012-08-31T23:49:18Z
CONTRIBUTOR
resolved
When prefetch = True (by default in 0.13.9) it causes iter_\* functions (i.e.: iter_content() & iter_lines()) to fail with the raised error stating the content has already been consumed. I specified it as 'False' for default so such functions can work. There is not a lot of information on how to fix the issue (with the GitHub links stating the issue is fixed when it really isn't). For people who don't know the inner workings of Request it can be very discouraging.
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/828/reactions" }
https://api.github.com/repos/psf/requests/issues/828/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/828.diff", "html_url": "https://github.com/psf/requests/pull/828", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/828.patch", "url": "https://api.github.com/repos/psf/requests/pulls/828" }
true
[ "This pull request [passes](http://travis-ci.org/kennethreitz/requests/builds/2299035) (merged 4704c771 into 81897dd1).\n", "The adding of \"README\" is an accident which I apologize for you. Was not intended to have that pushed as well.\n", "No worries (about README) :)\n", "Unfortunately, this was a major but very intentional change. We're working to make those methods work in either scenario instead of changing back.\n", "Fair enough. It's also easy to fix it (set prefetch=False) it's just not something that most people think of. Would it be possible to add a notice in the docs to possibly \"prefetch is enabled by default, if you plan on using any iter_\\* functions please set it to False\"?\n", "Hoping to change this very very very soon :)\n" ]
https://api.github.com/repos/psf/requests/issues/827
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/827/labels{/name}
https://api.github.com/repos/psf/requests/issues/827/comments
https://api.github.com/repos/psf/requests/issues/827/events
https://github.com/psf/requests/issues/827
6,572,971
MDU6SXNzdWU2NTcyOTcx
827
SSLError on Windows 7, 64-bit. Appeared in version 0.13.8
{ "avatar_url": "https://avatars.githubusercontent.com/u/1415093?v=4", "events_url": "https://api.github.com/users/stebunovd/events{/privacy}", "followers_url": "https://api.github.com/users/stebunovd/followers", "following_url": "https://api.github.com/users/stebunovd/following{/other_user}", "gists_url": "https://api.github.com/users/stebunovd/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/stebunovd", "id": 1415093, "login": "stebunovd", "node_id": "MDQ6VXNlcjE0MTUwOTM=", "organizations_url": "https://api.github.com/users/stebunovd/orgs", "received_events_url": "https://api.github.com/users/stebunovd/received_events", "repos_url": "https://api.github.com/users/stebunovd/repos", "site_admin": false, "starred_url": "https://api.github.com/users/stebunovd/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/stebunovd/subscriptions", "type": "User", "url": "https://api.github.com/users/stebunovd", "user_view_type": "public" }
[]
closed
true
null
[]
null
4
2012-08-31T07:48:22Z
2021-09-09T05:30:53Z
2012-11-17T11:07:57Z
NONE
resolved
``` C:\Users\stebunovd>pip install requests==0.13.7 Downloading/unpacking requests==0.13.7 Downloading requests-0.13.7.tar.gz (521Kb): 521Kb downloaded Running setup.py egg_info for package requests warning: no files found matching 'tests\*.' Installing collected packages: requests Found existing installation: requests 0.13.8 Uninstalling requests: Successfully uninstalled requests Running setup.py install for requests warning: no files found matching 'tests\*.' Successfully installed requests Cleaning up... C:\Users\stebunovd>python Python 2.7.3 (default, Apr 10 2012, 23:31:26) [MSC v.1500 32 bit (Intel)] on win 32 Type "help", "copyright", "credits" or "license" for more information. >>> import requests >>> requests.get('https://web3ds.masterbank.ru/cgi-bin/cgi_link') <Response [200]> >>> quit() C:\Users\stebunovd>pip install requests==0.13.8 Downloading/unpacking requests==0.13.8 Downloading requests-0.13.8.tar.gz (522Kb): 522Kb downloaded Running setup.py egg_info for package requests warning: no files found matching 'tests\*.' Installing collected packages: requests Found existing installation: requests 0.13.7 Uninstalling requests: Successfully uninstalled requests Running setup.py install for requests warning: no files found matching 'tests\*.' Successfully installed requests Cleaning up... C:\Users\stebunovd>python Python 2.7.3 (default, Apr 10 2012, 23:31:26) [MSC v.1500 32 bit (Intel)] on win 32 Type "help", "copyright", "credits" or "license" for more information. >>> import requests >>> requests.get('https://web3ds.masterbank.ru/cgi-bin/cgi_link') Traceback (most recent call last): File "<stdin>", line 1, in <module> File "C:\Python27\lib\site-packages\requests\api.py", line 65, in get return request('get', url, **kwargs) File "C:\Python27\lib\site-packages\requests\safe_mode.py", line 39, in wrappe d return function(method, url, **kwargs) File "C:\Python27\lib\site-packages\requests\api.py", line 51, in request return session.request(method=method, url=url, **kwargs) File "C:\Python27\lib\site-packages\requests\sessions.py", line 243, in reques t r.send(prefetch=prefetch) File "C:\Python27\lib\site-packages\requests\models.py", line 631, in send raise SSLError(e) requests.exceptions.SSLError: [Errno 8] _ssl.c:504: EOF occurred in violation of protocol >>> ```
{ "avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4", "events_url": "https://api.github.com/users/Lukasa/events{/privacy}", "followers_url": "https://api.github.com/users/Lukasa/followers", "following_url": "https://api.github.com/users/Lukasa/following{/other_user}", "gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Lukasa", "id": 1382556, "login": "Lukasa", "node_id": "MDQ6VXNlcjEzODI1NTY=", "organizations_url": "https://api.github.com/users/Lukasa/orgs", "received_events_url": "https://api.github.com/users/Lukasa/received_events", "repos_url": "https://api.github.com/users/Lukasa/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions", "type": "User", "url": "https://api.github.com/users/Lukasa", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/827/reactions" }
https://api.github.com/repos/psf/requests/issues/827/timeline
null
completed
null
null
false
[ "The bug appears only when using this URL https://web3ds.masterbank.ru/cgi-bin/cgi_link and only on Windows machines (tested on 3 workstations on Win7-64 and one Win8). I was unable to reproduce it on Mac OS X 10.8.1 or Amazon Linux.\n", "This actually looks like it may be related: https://bugs.launchpad.net/ubuntu/+source/openssl/+bug/965371\n", "Just checked latest version, 0.14. The bug is still there. Requests v0.13.6 and 0.13.7 work fine with that URL, but 0.13.8, 0.13.9 and 0.14 throw SSLError.\n", "This happens to me as well (in previous versions it raised a timeout, in 0.14 it raises an SSL error).\n\nThis happens with a web server I have that only accepts TLSv1, TLSv1.1, TLSv1.2 but NOT SSLv2 or SSLv3.\n\nIf I change the following, which is in VerifiedHTTPSConnection.connect() in connectionpool.py on line 99 (as of 0.14):\n\n``` python\n\n self.sock = ssl.wrap_socket(sock, self.key_file, self.cert_file,\n cert_reqs=self.cert_reqs,\n ca_certs=self.ca_certs)\n```\n\nto:\n\n``` python\n\n self.sock = ssl.wrap_socket(sock, self.key_file, self.cert_file,\n cert_reqs=self.cert_reqs,\n ca_certs=self.ca_certs,\n ssl_version=ssl.PROTOCOL_TLSv1)\n\n```\n\nThe connection works fine. Obviously this is not ideal. I was thinking of submitting a patch that would allow you to pass in the preferred SSL version, but it seems like it would just work around the problem. I think it has to do with OpenSSL, but I'm running 1.0.1c and the latest pyOpenSSL.\n\nAlso, I'm on 32-bit Windows 7. And I've tested this on 32-bit Windows Server 2008 as well.\n" ]
https://api.github.com/repos/psf/requests/issues/826
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/826/labels{/name}
https://api.github.com/repos/psf/requests/issues/826/comments
https://api.github.com/repos/psf/requests/issues/826/events
https://github.com/psf/requests/pull/826
6,559,734
MDExOlB1bGxSZXF1ZXN0MjIwODI2Nw==
826
Updated content workflow section of the advanced user docs
{ "avatar_url": "https://avatars.githubusercontent.com/u/128561?v=4", "events_url": "https://api.github.com/users/hazzadous/events{/privacy}", "followers_url": "https://api.github.com/users/hazzadous/followers", "following_url": "https://api.github.com/users/hazzadous/following{/other_user}", "gists_url": "https://api.github.com/users/hazzadous/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/hazzadous", "id": 128561, "login": "hazzadous", "node_id": "MDQ6VXNlcjEyODU2MQ==", "organizations_url": "https://api.github.com/users/hazzadous/orgs", "received_events_url": "https://api.github.com/users/hazzadous/received_events", "repos_url": "https://api.github.com/users/hazzadous/repos", "site_admin": false, "starred_url": "https://api.github.com/users/hazzadous/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/hazzadous/subscriptions", "type": "User", "url": "https://api.github.com/users/hazzadous", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2012-08-30T17:33:54Z
2021-09-08T16:01:00Z
2012-08-31T23:49:47Z
NONE
resolved
The default for prefetch changed in 0.13.6 so have updated the relevant section in the docs. Anything amis? Not sure if you'd rather alter the default instead although I'd say defaulting to True sounds sensible.
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/826/reactions" }
https://api.github.com/repos/psf/requests/issues/826/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/826.diff", "html_url": "https://github.com/psf/requests/pull/826", "merged_at": "2012-08-31T23:49:47Z", "patch_url": "https://github.com/psf/requests/pull/826.patch", "url": "https://api.github.com/repos/psf/requests/pulls/826" }
true
[ "This pull request [passes](http://travis-ci.org/kennethreitz/requests/builds/2286020) (merged 991b853b into 0ad44565).\n", ":cake:\n" ]
https://api.github.com/repos/psf/requests/issues/825
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/825/labels{/name}
https://api.github.com/repos/psf/requests/issues/825/comments
https://api.github.com/repos/psf/requests/issues/825/events
https://github.com/psf/requests/issues/825
6,550,361
MDU6SXNzdWU2NTUwMzYx
825
response.raw broken in >= 0.13.6
{ "avatar_url": "https://avatars.githubusercontent.com/u/128561?v=4", "events_url": "https://api.github.com/users/hazzadous/events{/privacy}", "followers_url": "https://api.github.com/users/hazzadous/followers", "following_url": "https://api.github.com/users/hazzadous/following{/other_user}", "gists_url": "https://api.github.com/users/hazzadous/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/hazzadous", "id": 128561, "login": "hazzadous", "node_id": "MDQ6VXNlcjEyODU2MQ==", "organizations_url": "https://api.github.com/users/hazzadous/orgs", "received_events_url": "https://api.github.com/users/hazzadous/received_events", "repos_url": "https://api.github.com/users/hazzadous/repos", "site_admin": false, "starred_url": "https://api.github.com/users/hazzadous/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/hazzadous/subscriptions", "type": "User", "url": "https://api.github.com/users/hazzadous", "user_view_type": "public" }
[]
closed
true
null
[]
null
3
2012-08-30T10:51:07Z
2021-09-09T06:00:45Z
2012-08-30T15:16:28Z
NONE
resolved
Reading from raw in 0.13.5 gives me the raw content, however in 0.13.6 and above I get an empty string. In 0.13.5: ``` >>> requests.get('http://www.google.com').raw.read() '...' # the correct content ``` In 0.13.6: ``` >>> requests.get('http://www.google.com').raw.read() '' ``` I presume somewhere in requests raw is being mistakenly read from?
{ "avatar_url": "https://avatars.githubusercontent.com/u/128561?v=4", "events_url": "https://api.github.com/users/hazzadous/events{/privacy}", "followers_url": "https://api.github.com/users/hazzadous/followers", "following_url": "https://api.github.com/users/hazzadous/following{/other_user}", "gists_url": "https://api.github.com/users/hazzadous/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/hazzadous", "id": 128561, "login": "hazzadous", "node_id": "MDQ6VXNlcjEyODU2MQ==", "organizations_url": "https://api.github.com/users/hazzadous/orgs", "received_events_url": "https://api.github.com/users/hazzadous/received_events", "repos_url": "https://api.github.com/users/hazzadous/repos", "site_admin": false, "starred_url": "https://api.github.com/users/hazzadous/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/hazzadous/subscriptions", "type": "User", "url": "https://api.github.com/users/hazzadous", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/825/reactions" }
https://api.github.com/repos/psf/requests/issues/825/timeline
null
completed
null
null
false
[ "I'm not familiar with the changes made between 0.13.5 and 0.13.6 but for your example to work you must pass `prefetch=False`, e.g.,:\n\n```\n>>> from requests import get\n>>> r = get('http://httpbin.org/get', prefetch=False)\n>>> r\n<Response [200]>\n>>> r.raw\n<requests.packages.urllib3.response.HTTPResponse object at 0x953350>\n>>> r.raw.read()\n'{\\n \"url\": \"http://httpbin.org/get\",\\n \"headers\": {\\n \"Content-Length\": \"\",\\n \"Accept-Encoding\": \"identity, deflate, compress, gzip\",\\n \"Connection\": \"keep-alive\",\\n \"Accept\": \"*/*\",\\n \"User-Agent\": \"python-requests/0.13.8 CPython/2.6.2 Linux/2.6.30.3\",\\n \"Host\": \"httpbin.org\",\\n \"Content-Type\": \"\"\\n },\\n \"args\": {},\\n \"origin\": \"...\"\\n}'\n>>> r.content\n''\n>>> s = get('http://httpbin.org/get') \n>>> s.raw\n<requests.packages.urllib3.response.HTTPResponse object at 0x953690>\n>>> s.raw.read()\n''\n>>> s.content\n'{\\n \"url\": \"http://httpbin.org/get\",\\n \"headers\": {\\n \"Content-Length\": \"\",\\n \"Accept-Encoding\": \"identity, deflate, compress, gzip\",\\n \"Connection\": \"keep-alive\",\\n \"Accept\": \"*/*\",\\n \"User-Agent\": \"python-requests/0.13.8 CPython/2.6.2 Linux/2.6.30.3\",\\n \"Host\": \"httpbin.org\",\\n \"Content-Type\": \"\"\\n },\\n \"args\": {},\\n \"origin\": \"...\"\\n}'\n```\n\n**Edited** to remove IP address.\n", "Thanks, looks like an API change at [3c0b94047c](https://github.com/kennethreitz/requests/commit/3c0b94047c1ccfca4ac4f2fe32afef0ae314094e#L1L461) which is out of line with the docs at [workflow section of the docs](https://github.com/kennethreitz/requests/blob/develop/docs/user/advanced.rst#body-content-workflow).\n", "Glad to help. You should submit a pull request to change those if you have the \ntime.\n" ]
https://api.github.com/repos/psf/requests/issues/824
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/824/labels{/name}
https://api.github.com/repos/psf/requests/issues/824/comments
https://api.github.com/repos/psf/requests/issues/824/events
https://github.com/psf/requests/pull/824
6,548,231
MDExOlB1bGxSZXF1ZXN0MjIwMjc1Nw==
824
save_as(filename)
{ "avatar_url": "https://avatars.githubusercontent.com/u/621306?v=4", "events_url": "https://api.github.com/users/alicebob/events{/privacy}", "followers_url": "https://api.github.com/users/alicebob/followers", "following_url": "https://api.github.com/users/alicebob/following{/other_user}", "gists_url": "https://api.github.com/users/alicebob/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/alicebob", "id": 621306, "login": "alicebob", "node_id": "MDQ6VXNlcjYyMTMwNg==", "organizations_url": "https://api.github.com/users/alicebob/orgs", "received_events_url": "https://api.github.com/users/alicebob/received_events", "repos_url": "https://api.github.com/users/alicebob/repos", "site_admin": false, "starred_url": "https://api.github.com/users/alicebob/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/alicebob/subscriptions", "type": "User", "url": "https://api.github.com/users/alicebob", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2012-08-30T08:50:11Z
2021-09-08T23:07:25Z
2012-08-30T12:45:56Z
NONE
resolved
So one can do: requests.get("http://foobar.com", prefetch=False).save_as("/tmp/foobar.com.html") Will add it to the 'advanced docs' if this is accepted.
{ "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/824/reactions" }
https://api.github.com/repos/psf/requests/issues/824/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/824.diff", "html_url": "https://github.com/psf/requests/pull/824", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/824.patch", "url": "https://api.github.com/repos/psf/requests/pulls/824" }
true
[ "This pull request [fails](http://travis-ci.org/kennethreitz/requests/builds/2281143) (merged 520e9836 into 0ad44565).\n", "The content in this Pull Request is duplicated by #823. Additionally, the name and description in this PR actually belong to #823 and vice-versa. I'm going to close this one, and centralise all of the discussion in #823.\n" ]
https://api.github.com/repos/psf/requests/issues/823
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/823/labels{/name}
https://api.github.com/repos/psf/requests/issues/823/comments
https://api.github.com/repos/psf/requests/issues/823/events
https://github.com/psf/requests/pull/823
6,548,186
MDExOlB1bGxSZXF1ZXN0MjIwMjczNQ==
823
A warning for iter_content() for prefetch=True requests
{ "avatar_url": "https://avatars.githubusercontent.com/u/621306?v=4", "events_url": "https://api.github.com/users/alicebob/events{/privacy}", "followers_url": "https://api.github.com/users/alicebob/followers", "following_url": "https://api.github.com/users/alicebob/following{/other_user}", "gists_url": "https://api.github.com/users/alicebob/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/alicebob", "id": 621306, "login": "alicebob", "node_id": "MDQ6VXNlcjYyMTMwNg==", "organizations_url": "https://api.github.com/users/alicebob/orgs", "received_events_url": "https://api.github.com/users/alicebob/received_events", "repos_url": "https://api.github.com/users/alicebob/repos", "site_admin": false, "starred_url": "https://api.github.com/users/alicebob/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/alicebob/subscriptions", "type": "User", "url": "https://api.github.com/users/alicebob", "user_view_type": "public" }
[]
closed
true
null
[]
null
9
2012-08-30T08:48:40Z
2021-09-08T23:07:25Z
2012-08-31T23:51:25Z
NONE
resolved
iter_content() doesn't work with requests with prefetch=True, which makes sense, but a warning might help.
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/823/reactions" }
https://api.github.com/repos/psf/requests/issues/823/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/823.diff", "html_url": "https://github.com/psf/requests/pull/823", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/823.patch", "url": "https://api.github.com/repos/psf/requests/pulls/823" }
true
[ "This pull request [fails](http://travis-ci.org/kennethreitz/requests/builds/2281118) (merged 40c813b9 into 0ad44565).\n", "This PR contains the commits from PRs #824 and #822. I've closed those PRs to centralise the discussion here. The messages for each commit are as follows:\n- 4b99498: #822, There was no test for `iter_content()`.\n- 520e983: The message above applies to this commit.\n- 40c813b: #824, Add `save_as(filename)`, so one can do requests.get('http://example.com/', prefetch=False).save_as('/tmp/example.html'). Will add this to the advanced docs if accepted.\n", "Thanks @Lukasa for centralizing the discussion. I'm personally a little torn about the `save_as` function for the Response object. It could easily become unwieldy. For example, what if someone also wants to save the response headers? Then they have to rewrite this recipe for themselves and the function serves no benefit. Still others might want as much information from the Response object as possible including the url they used (if they're using this towards logging). I think it is certainly useful, I just think it could introduce some possible unnecessary arguments in the future over how much it should include. Besides, developers can easily write a function for themselves to dump the content that they want.\n\nI would lean on the side of simplicity and leave it out.\n\nAs for adding tests for `iter_content()`, I'm surprised it didn't already exist. :+1: for catching that.\n", "(Thanks @Lukasa for fixing my messy pullrequest)\n\nI see your reasoning, but because of the prefetch=False gotcha I didn't get it right the first time (I needed to look at the source of iter_content() to figure out how to use it). Having a save_as() which Just Works seems to be nice, if only as an example for anyone to make their own. An other option would be to add it to the documentation as 'recipe'.\n", "I definitely agree having something which \"Just Works\" which is why I said I was torn on adding the functionality. We have a similar service provided with the `json` attribute. I just can see how providing this will cause some people to want to add more to it and get upset when those desires are shot down. In the end it isn't my decision anyway :-P.\n", "I'm +1 on @alicebob's idea of using `save_as()` as a documented 'recipe'. Actually, I'm +1 on having a section of the documentation devoted to interesting examples or use cases. Not sure it should be part of the base library though.\n", ":-1: on save_as. Users should know how to open a file and write to it. We should document how to do so very easily.\n", "Yeah a recipes section of the docs wouldn't be a terrible idea though. Could probably separate the recipes into beginner (for ideas like this) and advanced for caching or using gevent with requests. \n", "@alicebob ping me again once you update this to just include the tests, and i'll happily include it :)\n" ]
https://api.github.com/repos/psf/requests/issues/822
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/822/labels{/name}
https://api.github.com/repos/psf/requests/issues/822/comments
https://api.github.com/repos/psf/requests/issues/822/events
https://github.com/psf/requests/pull/822
6,548,167
MDExOlB1bGxSZXF1ZXN0MjIwMjcyMw==
822
A simple test for iter_content
{ "avatar_url": "https://avatars.githubusercontent.com/u/621306?v=4", "events_url": "https://api.github.com/users/alicebob/events{/privacy}", "followers_url": "https://api.github.com/users/alicebob/followers", "following_url": "https://api.github.com/users/alicebob/following{/other_user}", "gists_url": "https://api.github.com/users/alicebob/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/alicebob", "id": 621306, "login": "alicebob", "node_id": "MDQ6VXNlcjYyMTMwNg==", "organizations_url": "https://api.github.com/users/alicebob/orgs", "received_events_url": "https://api.github.com/users/alicebob/received_events", "repos_url": "https://api.github.com/users/alicebob/repos", "site_admin": false, "starred_url": "https://api.github.com/users/alicebob/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/alicebob/subscriptions", "type": "User", "url": "https://api.github.com/users/alicebob", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2012-08-30T08:47:14Z
2021-09-08T16:00:59Z
2012-08-30T12:46:39Z
NONE
resolved
There was no test for iter_content.
{ "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/822/reactions" }
https://api.github.com/repos/psf/requests/issues/822/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/822.diff", "html_url": "https://github.com/psf/requests/pull/822", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/822.patch", "url": "https://api.github.com/repos/psf/requests/pulls/822" }
true
[ "This pull request [fails](http://travis-ci.org/kennethreitz/requests/builds/2281110) (merged 4b994982 into 0ad44565).\n", "The commit here is duplicated in #823. To ease merging, I'm going to centralise the discussion on these PRs to there.\n" ]
https://api.github.com/repos/psf/requests/issues/821
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/821/labels{/name}
https://api.github.com/repos/psf/requests/issues/821/comments
https://api.github.com/repos/psf/requests/issues/821/events
https://github.com/psf/requests/issues/821
6,544,396
MDU6SXNzdWU2NTQ0Mzk2
821
When proxy is used, Accept header is overwritten
{ "avatar_url": "https://avatars.githubusercontent.com/u/1514856?v=4", "events_url": "https://api.github.com/users/jiangk/events{/privacy}", "followers_url": "https://api.github.com/users/jiangk/followers", "following_url": "https://api.github.com/users/jiangk/following{/other_user}", "gists_url": "https://api.github.com/users/jiangk/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/jiangk", "id": 1514856, "login": "jiangk", "node_id": "MDQ6VXNlcjE1MTQ4NTY=", "organizations_url": "https://api.github.com/users/jiangk/orgs", "received_events_url": "https://api.github.com/users/jiangk/received_events", "repos_url": "https://api.github.com/users/jiangk/repos", "site_admin": false, "starred_url": "https://api.github.com/users/jiangk/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/jiangk/subscriptions", "type": "User", "url": "https://api.github.com/users/jiangk", "user_view_type": "public" }
[]
closed
true
null
[]
null
6
2012-08-30T03:33:04Z
2021-09-09T03:00:40Z
2012-08-30T12:38:08Z
NONE
resolved
When a request specifies both an `Accept` header and a proxy server, the `Accept` header value is overwritten with `*/*`. The provided `Accept` header should not be overwritten. ``` proxy = {'http' : 'http://localhost:8888'} headers = {'Accept' : 'application/json'} r = requests.get('http://www.yahoo.com', proxies=proxy, headers=headers) ``` Raw request from proxy: ``` GET / HTTP/ 1.1 Host: www.yahoo.com Accept-Encoding: identity, deflate, compress, gzip Accept: */* User-Agent: python-requests/0.13.6 CPython/2.7.2 Darwin/12.1.0 ```
{ "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/821/reactions" }
https://api.github.com/repos/psf/requests/issues/821/timeline
null
completed
null
null
false
[ "This is probably due to urllib3's logic here: https://github.com/shazow/urllib3/blob/master/urllib3/poolmanager.py#L131\n\nI'm happy to accept a pull request for urllib3 to invert the logic (set default headers and overwrite if provided).\n", "Thanks, just sent the pull request\n", "Hi, this issue is still in latest requests 1.2.0, why was it closed?\n\nActually it is a little different. The headers are not replaced but duplicated:\n\n```\nGET http://www.yahoo.com/ HTTP/1.1\nAccept-Encoding: identity\nHost: www.yahoo.com\nUser-Agent: python-requests/1.2.0 CPython/3.3.0 Windows/7\nAccept: */*\nAccept-Encoding: gzip, deflate, compress\nAccept: application/json\n```\n\nWhich is worse, since output headers are in random order and therefore the behaviour is random.\n", "@oliverjanik I think you're being bitten by something entirely different. For one, I would bet this happens even without the proxy. Secondly, are you setting the headers case-insensitively? If so, try doing `headers={'Accept': 'application/json', ...}`. Third, this was closed because it was fixed [upstream](https://github.com/shazow/urllib3/pull/93) in urllib3. If it is still present then it is likely still an issue with urllib3. Again, I'm fairly certain you're not being affected by this bug.\n", "@sigmavirus24 I am using the same code as original poster: \n\n``` python\nproxy = {'http' : 'http://localhost:8888'}\nheaders = {'Accept' : 'application/json'}\nr = requests.get('http://www.yahoo.com', proxies=proxy, headers=headers)\n```\n\nWithout proxy:\n\n``` python\nheaders = {'Accept' : 'application/json'}\nr = requests.get('http://www.yahoo.com', headers=headers)\n```\n\nHeaders (via WireShark):\n\n```\nGET / HTTP/1.1\nHost: www.yahoo.com\nAccept-Encoding: identity\nUser-Agent: python-requests/1.2.0 CPython/3.3.0 Windows/7\nAccept: application/json\nAccept-Encoding: gzip, deflate, compress\n```\n\nSo it's not happening without proxy.\n", "After further investigations:\n- Happens with proxy only\n- Requests uses b'Accept' as key\n- Urllib3 uses 'Accept' as key\n- On Python 3 those are different values and are not merged when urllib3 calls update on headers dictionary\n\nIt seems my issue is actually #1338.\n" ]
https://api.github.com/repos/psf/requests/issues/820
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/820/labels{/name}
https://api.github.com/repos/psf/requests/issues/820/comments
https://api.github.com/repos/psf/requests/issues/820/events
https://github.com/psf/requests/pull/820
6,536,292
MDExOlB1bGxSZXF1ZXN0MjE5NzIwOQ==
820
Data encoding should take place after calling into auth provider
{ "avatar_url": "https://avatars.githubusercontent.com/u/155396?v=4", "events_url": "https://api.github.com/users/dergraf/events{/privacy}", "followers_url": "https://api.github.com/users/dergraf/followers", "following_url": "https://api.github.com/users/dergraf/following{/other_user}", "gists_url": "https://api.github.com/users/dergraf/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/dergraf", "id": 155396, "login": "dergraf", "node_id": "MDQ6VXNlcjE1NTM5Ng==", "organizations_url": "https://api.github.com/users/dergraf/orgs", "received_events_url": "https://api.github.com/users/dergraf/received_events", "repos_url": "https://api.github.com/users/dergraf/repos", "site_admin": false, "starred_url": "https://api.github.com/users/dergraf/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/dergraf/subscriptions", "type": "User", "url": "https://api.github.com/users/dergraf", "user_view_type": "public" }
[]
closed
true
null
[]
null
4
2012-08-29T19:29:28Z
2021-09-08T22:01:16Z
2012-09-11T03:06:53Z
CONTRIBUTOR
resolved
I discovered this bug when using the auth.OAuth1 auth provider. If I did a simple ``` python oauth = OAuth1(key,secret,signature_type=SIGNATURE_TYPE_BODY) requests.post(url, data={'some':'param'}, auth=oauth) ``` only the data <code>{'some':'param'}</code> gets transmitted, all the OAuth specific parameters aren't packed into the body. My patch moves the data encoding after the calling into the auth provider.
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/820/reactions" }
https://api.github.com/repos/psf/requests/issues/820/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/820.diff", "html_url": "https://github.com/psf/requests/pull/820", "merged_at": "2012-09-11T03:06:53Z", "patch_url": "https://github.com/psf/requests/pull/820.patch", "url": "https://api.github.com/repos/psf/requests/pulls/820" }
true
[ "This pull request [passes](http://travis-ci.org/kennethreitz/requests/builds/2276322) (merged 52d2e2ee into 0ad44565).\n", "@idan?\n", "just as a short note: the problem is not only related to OAuth , OAuth is just the only auth provider available at the moment that might change the body data and therefore generates this bug.\n", "Thanks!\n" ]
https://api.github.com/repos/psf/requests/issues/819
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/819/labels{/name}
https://api.github.com/repos/psf/requests/issues/819/comments
https://api.github.com/repos/psf/requests/issues/819/events
https://github.com/psf/requests/pull/819
6,490,861
MDExOlB1bGxSZXF1ZXN0MjE3NjU0Mg==
819
Correct OAuth1 with query or data.
{ "avatar_url": "https://avatars.githubusercontent.com/u/406779?v=4", "events_url": "https://api.github.com/users/ayanamist/events{/privacy}", "followers_url": "https://api.github.com/users/ayanamist/followers", "following_url": "https://api.github.com/users/ayanamist/following{/other_user}", "gists_url": "https://api.github.com/users/ayanamist/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/ayanamist", "id": 406779, "login": "ayanamist", "node_id": "MDQ6VXNlcjQwNjc3OQ==", "organizations_url": "https://api.github.com/users/ayanamist/orgs", "received_events_url": "https://api.github.com/users/ayanamist/received_events", "repos_url": "https://api.github.com/users/ayanamist/repos", "site_admin": false, "starred_url": "https://api.github.com/users/ayanamist/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/ayanamist/subscriptions", "type": "User", "url": "https://api.github.com/users/ayanamist", "user_view_type": "public" }
[]
closed
true
null
[]
null
7
2012-08-28T04:55:03Z
2021-09-08T23:07:27Z
2012-08-29T11:29:42Z
CONTRIBUTOR
resolved
Sorry, it's me again. auth.py still have problems. POST with data can't be signed correctly. So i dive into the code and rewrite it. And in fact, there's no "multipart/form-encoded" but only "multipart/form-data".
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/819/reactions" }
https://api.github.com/repos/psf/requests/issues/819/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/819.diff", "html_url": "https://github.com/psf/requests/pull/819", "merged_at": "2012-08-29T11:29:42Z", "patch_url": "https://github.com/psf/requests/pull/819.patch", "url": "https://api.github.com/repos/psf/requests/pulls/819" }
true
[ "This pull request [passes](http://travis-ci.org/kennethreitz/requests/builds/2257949) (merged 8a1d53eb into b9ecf456).\n", "@idan @dgouldin @gulopine code review? :)\n", "This pull request [passes](http://travis-ci.org/kennethreitz/requests/builds/2258667) (merged 46ff4b38 into b9ecf456).\n", "This pull request [passes](http://travis-ci.org/kennethreitz/requests/builds/2258707) (merged aded42f2 into b9ecf456).\n", "Looks good! Needs tests and then ready to merge.\n", "This pull request [passes](http://travis-ci.org/kennethreitz/requests/builds/2258817) (merged babac736 into b9ecf456).\n", "Awesome, thanks!\n" ]
https://api.github.com/repos/psf/requests/issues/818
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/818/labels{/name}
https://api.github.com/repos/psf/requests/issues/818/comments
https://api.github.com/repos/psf/requests/issues/818/events
https://github.com/psf/requests/pull/818
6,487,564
MDExOlB1bGxSZXF1ZXN0MjE3NTAxOA==
818
improve top-level docstring
{ "avatar_url": "https://avatars.githubusercontent.com/u/663366?v=4", "events_url": "https://api.github.com/users/r1chardj0n3s/events{/privacy}", "followers_url": "https://api.github.com/users/r1chardj0n3s/followers", "following_url": "https://api.github.com/users/r1chardj0n3s/following{/other_user}", "gists_url": "https://api.github.com/users/r1chardj0n3s/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/r1chardj0n3s", "id": 663366, "login": "r1chardj0n3s", "node_id": "MDQ6VXNlcjY2MzM2Ng==", "organizations_url": "https://api.github.com/users/r1chardj0n3s/orgs", "received_events_url": "https://api.github.com/users/r1chardj0n3s/received_events", "repos_url": "https://api.github.com/users/r1chardj0n3s/repos", "site_admin": false, "starred_url": "https://api.github.com/users/r1chardj0n3s/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/r1chardj0n3s/subscriptions", "type": "User", "url": "https://api.github.com/users/r1chardj0n3s", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2012-08-27T23:36:56Z
2021-09-08T16:00:59Z
2012-08-28T05:38:47Z
CONTRIBUTOR
resolved
Yay, I had to nuke my branch to get here, but here's the improved docstring :-)
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/818/reactions" }
https://api.github.com/repos/psf/requests/issues/818/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/818.diff", "html_url": "https://github.com/psf/requests/pull/818", "merged_at": "2012-08-28T05:38:47Z", "patch_url": "https://github.com/psf/requests/pull/818.patch", "url": "https://api.github.com/repos/psf/requests/pulls/818" }
true
[ "This pull request [passes](http://travis-ci.org/kennethreitz/requests/builds/2256330) (merged f4311269 into b9ecf456).\n", "Thank you sir :)\n" ]
https://api.github.com/repos/psf/requests/issues/817
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/817/labels{/name}
https://api.github.com/repos/psf/requests/issues/817/comments
https://api.github.com/repos/psf/requests/issues/817/events
https://github.com/psf/requests/pull/817
6,485,118
MDExOlB1bGxSZXF1ZXN0MjE3MzcyNw==
817
Add a `add_params` method to the `Session` class.
{ "avatar_url": "https://avatars.githubusercontent.com/u/305268?v=4", "events_url": "https://api.github.com/users/msabramo/events{/privacy}", "followers_url": "https://api.github.com/users/msabramo/followers", "following_url": "https://api.github.com/users/msabramo/following{/other_user}", "gists_url": "https://api.github.com/users/msabramo/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/msabramo", "id": 305268, "login": "msabramo", "node_id": "MDQ6VXNlcjMwNTI2OA==", "organizations_url": "https://api.github.com/users/msabramo/orgs", "received_events_url": "https://api.github.com/users/msabramo/received_events", "repos_url": "https://api.github.com/users/msabramo/repos", "site_admin": false, "starred_url": "https://api.github.com/users/msabramo/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/msabramo/subscriptions", "type": "User", "url": "https://api.github.com/users/msabramo", "user_view_type": "public" }
[]
closed
true
null
[]
null
13
2012-08-27T21:26:03Z
2021-09-08T23:05:21Z
2012-08-28T05:45:46Z
CONTRIBUTOR
resolved
Otherwise, it's tricky for clients to write code that adds params without them poking inside the innards of `Session`, which can be problematic when the implementation changes. This was motivated by the fact that I just ran some code of mine that depends on requests and it failed, because my virtualenv had a newer version of requests (0.13.9) and the code was written against 0.13.1 and had code that looked like this: ``` python self.session.params['access_token'] = response_obj['access_token'] ``` I do this to add an `access_token` parameter after the user logs in and obtains an access token, because this parameter is needed on subsequent requests after the login. This worked in 0.13.1, because in 0.13.1, `session.params` was a dict, but it is now a list of tuples. The problem arises because there was no public interface for setting params and because this is Python, one can manipulate the attributes of the class whenever they desire. When the implementation changes, this breaks code that relies on that implementation. So I propose to add a `add_params` method to `Session`, which is the official interface for clients to use to add parameters and it can change in the future if the implementation changes and clients code will still work. I guess this is all a really long way of saying...abstraction :-)
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/817/reactions" }
https://api.github.com/repos/psf/requests/issues/817/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/817.diff", "html_url": "https://github.com/psf/requests/pull/817", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/817.patch", "url": "https://api.github.com/repos/psf/requests/pulls/817" }
true
[ "This pull request [passes](http://travis-ci.org/kennethreitz/requests/builds/2255072) (merged aef7b65e into b9ecf456).\n", "Thanks for the contribution, but I don't really see how modifying the very simple dictionary is difficult at all.\n", "My changes towards #179 store parameters as a list of key-value tuples \n\nIt seems besides missing the merge function, I also misunderstood partially what was desired. I'm going to put some effort into this tomorrow or Friday, I already have some ideas started in my fork.\n\nFor my sanity, you want to accept the key value lists but you want to store them as dictionaries?\n\nIf so, I'd like to propose keeping at least the data parameter as a key value list since that can heavily rely on ordering. Or maybe just use OrderedDicts everywhere? \n", "@kennethreitz \n\n> Thanks for the contribution, but I don't really see how modifying the very simple dictionary is difficult at all.\n\nHmmm, maybe I'm missing some easy way to do this? Or maybe you're not familiar with or recalling the recent changes in how `params` is handled? (see @sigmavirus24's comment also)\n\n`params` **used to** be a dict until very recently. Now it is a list of tuples. It's not rocket science of course to append to a list of tuples -- the issue is that it's tricky for folks to write code that reliably handles `params` when they don't know which version of requests is installed. Not impossible, but harder than it needs to be. Here's what I have in my client code now:\n\n``` python\nif isinstance(self.session.params, dict):\n self.session.params['access_token'] = response_obj['access_token']\nelif isinstance(self.session.params, list):\n # At some point, `requests` changed session.params from a dict to a list of tuples (maybe in version 0.13.7?)\n self.session.params.append(('access_token', response_obj['access_token']))\n```\n\nIf I had the `add_params` method then this simply becomes:\n\n``` python\nself.session.add_params({'access_token': response_obj['access_token']})\n```\n", "Oh, I didn't realize it was a list of tuples now. It should definitely be a dictionary. Let's fix that.\n", "Maybe use OrderedDicts everywhere? I think Kenneth should weigh in on how it should work of course.\n", "@msabramo that was my initial thought as well, yes.\n", "Optional idea:\nRelated urllib3 bug for headers: https://github.com/shazow/urllib3/issues/3\nIf we make headers use a MultiDict or similar, then I'd be happy to make filepost encoding use the same. This way there would be less translation happening between requests and urllib3.\n", "@shazow :cake:\n", "OrderedDicts everywhere would be fantastic. Also, I'll fix that up tomorrow gladly. I already have a function to transition to a dictionary from a key, val list. I'll modify it to use ordereddicts though. Sorry about the confusion. This is entirely my fault.\n", "@sigmavirus24 no fault needs to be had, just improvements to a great pull request :)\n", "Hm. So the only problem I have encountered thus far is sending data/files with the same name. OrderedDicts will eat those values by default. I'll push what I have but this one test fails. Apparently this is related to #746. Since these worked as pure lists of key-value tuples, I'm wondering if storing them like this permanently is the solution. These cannot be set when initializing a `Session` object so the use case that spurred this issue shouldn't be encountered. Thoughts?\n", "#817 should take care of this and #804\n" ]
https://api.github.com/repos/psf/requests/issues/816
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/816/labels{/name}
https://api.github.com/repos/psf/requests/issues/816/comments
https://api.github.com/repos/psf/requests/issues/816/events
https://github.com/psf/requests/pull/816
6,464,274
MDExOlB1bGxSZXF1ZXN0MjE2NDY0OA==
816
We should try to convert the variable first but not to raise an unnecessary exception.
{ "avatar_url": "https://avatars.githubusercontent.com/u/406779?v=4", "events_url": "https://api.github.com/users/ayanamist/events{/privacy}", "followers_url": "https://api.github.com/users/ayanamist/followers", "following_url": "https://api.github.com/users/ayanamist/following{/other_user}", "gists_url": "https://api.github.com/users/ayanamist/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/ayanamist", "id": 406779, "login": "ayanamist", "node_id": "MDQ6VXNlcjQwNjc3OQ==", "organizations_url": "https://api.github.com/users/ayanamist/orgs", "received_events_url": "https://api.github.com/users/ayanamist/received_events", "repos_url": "https://api.github.com/users/ayanamist/repos", "site_admin": false, "starred_url": "https://api.github.com/users/ayanamist/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/ayanamist/subscriptions", "type": "User", "url": "https://api.github.com/users/ayanamist", "user_view_type": "public" }
[]
closed
true
null
[]
null
4
2012-08-27T00:15:12Z
2021-09-08T23:01:02Z
2012-08-27T00:16:57Z
CONTRIBUTOR
resolved
Since i pass the dict object with str and int object, an exception will be raised. > Exception on /post [POST] > Traceback (most recent call last): > File "/base/data/home/apps/s~dabr-gae/1.361315839962791826/lib/Flask-0.9-py2.7.zip/flask/app.py", line 1687, in wsgi_app > response = self.full_dispatch_request() > File "/base/data/home/apps/s~dabr-gae/1.361315839962791826/lib/Flask-0.9-py2.7.zip/flask/app.py", line 1360, in full_dispatch_request > rv = self.handle_user_exception(e) > File "/base/data/home/apps/s~dabr-gae/1.361315839962791826/lib/Flask-0.9-py2.7.zip/flask/app.py", line 1358, in full_dispatch_request > rv = self.dispatch_request() > File "/base/data/home/apps/s~dabr-gae/1.361315839962791826/lib/Flask-0.9-py2.7.zip/flask/app.py", line 1344, in dispatch_request > return self.view_functions[rule.endpoint](**req.view_args) > File "/base/data/home/apps/s~dabr-gae/1.361315839962791826/application/utils/decorators.py", line 10, in decorated_view > return func(_args, *_kwargs) > File "/base/data/home/apps/s~dabr-gae/1.361315839962791826/application/views/status.py", line 19, in status_post > result = flask.g.api.reTweet(id=retweet_id, include_entities=1) > File "/base/data/home/apps/s~dabr-gae/1.361315839962791826/lib/twython-2.3.3.zip/twython/twython.py", line 138, in <lambda> > return lambda *_kwargs: self._constructFunc(key, *_kwargs) > File "/base/data/home/apps/s~dabr-gae/1.361315839962791826/lib/twython-2.3.3.zip/twython/twython.py", line 155, in _constructFunc > content = self._request(url, method=fn['method'], params=kwargs) > File "/base/data/home/apps/s~dabr-gae/1.361315839962791826/lib/twython-2.3.3.zip/twython/twython.py", line 175, in _request > response = func(url, data=params, files=files) > File "/base/data/home/apps/s~dabr-gae/1.361315839962791826/lib/requests-0.13.9.zip/requests/sessions.py", line 295, in post > return self.request('post', url, data=data, **kwargs) > File "/base/data/home/apps/s~dabr-gae/1.361315839962791826/lib/requests-0.13.9.zip/requests/sessions.py", line 252, in request > r.send(prefetch=prefetch) > File "/base/data/home/apps/s~dabr-gae/1.361315839962791826/lib/requests-0.13.9.zip/requests/models.py", line 532, in send > r = self.auth(self) > File "/base/data/home/apps/s~dabr-gae/1.361315839962791826/lib/requests-0.13.9.zip/requests/auth.py", line 103, in __call__ > unicode(r.full_url), unicode(r.method), r.data, r.headers) > File "/base/data/home/apps/s~dabr-gae/1.361315839962791826/lib/requests-0.13.9.zip/requests/packages/oauthlib/oauth1/rfc5849/**init**.py", line 211, in sign > request.oauth_params.append((u'oauth_signature', self.get_oauth_signature(request))) > File "/base/data/home/apps/s~dabr-gae/1.361315839962791826/lib/requests-0.13.9.zip/requests/packages/oauthlib/oauth1/rfc5849/**init**.py", line 71, in get_oauth_signature > normalized_params = signature.normalize_parameters(collected_params) > File "/base/data/home/apps/s~dabr-gae/1.361315839962791826/lib/requests-0.13.9.zip/requests/packages/oauthlib/oauth1/rfc5849/signature.py", line 373, in normalize_parameters > key_values = [(utils.escape(k), utils.escape(v)) for k, v in params] > File "/base/data/home/apps/s~dabr-gae/1.361315839962791826/lib/requests-0.13.9.zip/requests/packages/oauthlib/oauth1/rfc5849/utils.py", line 52, in escape > raise ValueError('Only unicode objects are escapable.') > ValueError: Only unicode objects are escapable. The related code is here: https://code.google.com/p/gabr/source/browse/application/views/status.py?r=c67d65b90bdf78d07d4fe92cc1e8f9827cb5eaf8#22 So i must unicode the parameters first: https://code.google.com/p/gabr/source/browse/application/views/status.py?r=7eb65d488db14fb1ced0c848c0334f894191ab7b#20 It's caused by https://github.com/kennethreitz/requests/blob/9576518d69b819b25cd036397d2624daa6ae088c/requests/packages/oauthlib/oauth1/rfc5849/utils.py#L52 which will check the type of the parameters. But i think it's not necessary, because what common.quote do is that it encode the unicode string to utf8, call urllib.quote and decode it. I think even this unicode intermediate object is unnecessary, because the only calling is from https://github.com/kennethreitz/requests/blob/9576518d69b819b25cd036397d2624daa6ae088c/requests/packages/oauthlib/oauth1/rfc5849/signature.py#L373 which convert the object to unicode string again in the next statement. And i think common.quote is unncessary, because the only calling is from oauth1/rfc5849/utils.py , the rest in this package is directly calling urllib.quote. So i think, we should just encoding it if it's a unicode object or do nothing else.
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/816/reactions" }
https://api.github.com/repos/psf/requests/issues/816/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/816.diff", "html_url": "https://github.com/psf/requests/pull/816", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/816.patch", "url": "https://api.github.com/repos/psf/requests/pulls/816" }
true
[ "This pull request [passes](http://travis-ci.org/kennethreitz/requests/builds/2245717) (merged c4ad0fa5 into b9ecf456).\n", "This issue should be opened against oauthlib, not requests.\n\nhttps://github.com/idan/oauthlib\n", "I'm, also getting \"ValueError: Only unicode objects are unescapable\" with latest quote patch\n\nhere are two lines of code that provoke the error:\n\n``` python\nrequest_token_url = 'https://api.linkedin.com/uas/oauth/requestToken?oauth_consumer_key'\nr = requests.post(url=request_token_url, auth=oauth)\n```\n\nif i change the URL to not have a query parameter, then the error is not raised (but the endpoint is wrong'):\n\n``` python\nrequest_token_url = 'https://api.linkedin.com/uas/oauth/requestToken'\nr = requests.post(url=request_token_url, auth=oauth)\n```\n\nmaking it a unicode string (u'xxxx') doesn't help.\nadding \n\n```\nfrom __future__ import unicode_literals\n```\n\ndoesn't help\n\ni'm really stuck here, if someone could provide a suggestion. thanks\n\n> File \"/Users/rbp/Projects/tengahdb/lib/python2.7/site-packages/oauthlib/oauth1/rfc5849/utils.py\", line 64, in unescape\n> raise ValueError('Only unicode objects are unescapable.')\n> ValueError: Only unicode objects are unescapable.\n", "ok, here's how i got around the problem:\n\n``` python\n\nrequest_token_url = 'https://api.linkedin.com/uas/oauth/requestToken'\npayload={'oauth_consumer_key':\"\"}\nr = requests.post(url=request_token_url, auth=oauth, params=payload)\n```\n" ]
https://api.github.com/repos/psf/requests/issues/815
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/815/labels{/name}
https://api.github.com/repos/psf/requests/issues/815/comments
https://api.github.com/repos/psf/requests/issues/815/events
https://github.com/psf/requests/pull/815
6,459,949
MDExOlB1bGxSZXF1ZXN0MjE2MzY2OA==
815
Use logger instead of direct logging call.
{ "avatar_url": "https://avatars.githubusercontent.com/u/406779?v=4", "events_url": "https://api.github.com/users/ayanamist/events{/privacy}", "followers_url": "https://api.github.com/users/ayanamist/followers", "following_url": "https://api.github.com/users/ayanamist/following{/other_user}", "gists_url": "https://api.github.com/users/ayanamist/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/ayanamist", "id": 406779, "login": "ayanamist", "node_id": "MDQ6VXNlcjQwNjc3OQ==", "organizations_url": "https://api.github.com/users/ayanamist/orgs", "received_events_url": "https://api.github.com/users/ayanamist/received_events", "repos_url": "https://api.github.com/users/ayanamist/repos", "site_admin": false, "starred_url": "https://api.github.com/users/ayanamist/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/ayanamist/subscriptions", "type": "User", "url": "https://api.github.com/users/ayanamist", "user_view_type": "public" }
[]
closed
true
null
[]
null
3
2012-08-26T16:45:22Z
2021-09-08T16:00:58Z
2012-08-26T16:46:18Z
CONTRIBUTOR
resolved
Direct call can't be muted by getLogger().setLevel() Also, logger is better for global management of logging.
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/815/reactions" }
https://api.github.com/repos/psf/requests/issues/815/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/815.diff", "html_url": "https://github.com/psf/requests/pull/815", "merged_at": "2012-08-26T16:46:18Z", "patch_url": "https://github.com/psf/requests/pull/815.patch", "url": "https://api.github.com/repos/psf/requests/pulls/815" }
true
[ "Thanks!\n", "This pull request [passes](http://travis-ci.org/kennethreitz/requests/builds/2242841) (merged 913ef867 into 1be2a55a).\n", "@kennethreitz So fast!!!!!\n" ]
https://api.github.com/repos/psf/requests/issues/814
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/814/labels{/name}
https://api.github.com/repos/psf/requests/issues/814/comments
https://api.github.com/repos/psf/requests/issues/814/events
https://github.com/psf/requests/pull/814
6,459,857
MDExOlB1bGxSZXF1ZXN0MjE2MzY0Mw==
814
import cchardet if available
{ "avatar_url": "https://avatars.githubusercontent.com/u/1910945?v=4", "events_url": "https://api.github.com/users/asapo/events{/privacy}", "followers_url": "https://api.github.com/users/asapo/followers", "following_url": "https://api.github.com/users/asapo/following{/other_user}", "gists_url": "https://api.github.com/users/asapo/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/asapo", "id": 1910945, "login": "asapo", "node_id": "MDQ6VXNlcjE5MTA5NDU=", "organizations_url": "https://api.github.com/users/asapo/orgs", "received_events_url": "https://api.github.com/users/asapo/received_events", "repos_url": "https://api.github.com/users/asapo/repos", "site_admin": false, "starred_url": "https://api.github.com/users/asapo/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/asapo/subscriptions", "type": "User", "url": "https://api.github.com/users/asapo", "user_view_type": "public" }
[]
closed
true
null
[]
null
4
2012-08-26T16:30:41Z
2021-09-08T10:01:06Z
2012-08-26T16:47:10Z
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/814/reactions" }
https://api.github.com/repos/psf/requests/issues/814/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/814.diff", "html_url": "https://github.com/psf/requests/pull/814", "merged_at": "2012-08-26T16:47:10Z", "patch_url": "https://github.com/psf/requests/pull/814.patch", "url": "https://api.github.com/repos/psf/requests/pulls/814" }
true
[ "I'll consider this in the future, but chardet doesn't seem to be causing any problems for anyone. :)\n", "This pull request [passes](http://travis-ci.org/kennethreitz/requests/builds/2242765) (merged fc9b8a02 into 1be2a55a).\n", "OK\nBut chardet has some problem.\n\nExample: http://m-p.sakura.ne.jp/Html/anime.html\n\n``` python\nimport requests, cchardet, chardet\n\nr = requests.get(\"http://m-p.sakura.ne.jp/Html/anime.html\")\nchardet.detect(r.content) # ISO-8859-2\ncchardet.detect(r.content) # SHIFT-JIS <- Correct!\n```\n\nOf course, this is a problem of chardet...\nThanks\n", "Hmm, I can include this I suppose, but I'll keep it undocumented.\n" ]
https://api.github.com/repos/psf/requests/issues/813
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/813/labels{/name}
https://api.github.com/repos/psf/requests/issues/813/comments
https://api.github.com/repos/psf/requests/issues/813/events
https://github.com/psf/requests/pull/813
6,459,793
MDExOlB1bGxSZXF1ZXN0MjE2MzYyMA==
813
import cchardet if available
{ "avatar_url": "https://avatars.githubusercontent.com/u/1910945?v=4", "events_url": "https://api.github.com/users/asapo/events{/privacy}", "followers_url": "https://api.github.com/users/asapo/followers", "following_url": "https://api.github.com/users/asapo/following{/other_user}", "gists_url": "https://api.github.com/users/asapo/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/asapo", "id": 1910945, "login": "asapo", "node_id": "MDQ6VXNlcjE5MTA5NDU=", "organizations_url": "https://api.github.com/users/asapo/orgs", "received_events_url": "https://api.github.com/users/asapo/received_events", "repos_url": "https://api.github.com/users/asapo/repos", "site_admin": false, "starred_url": "https://api.github.com/users/asapo/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/asapo/subscriptions", "type": "User", "url": "https://api.github.com/users/asapo", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2012-08-26T16:22:22Z
2021-09-08T16:00:58Z
2012-08-26T16:25:54Z
CONTRIBUTOR
resolved
{ "avatar_url": "https://avatars.githubusercontent.com/u/1910945?v=4", "events_url": "https://api.github.com/users/asapo/events{/privacy}", "followers_url": "https://api.github.com/users/asapo/followers", "following_url": "https://api.github.com/users/asapo/following{/other_user}", "gists_url": "https://api.github.com/users/asapo/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/asapo", "id": 1910945, "login": "asapo", "node_id": "MDQ6VXNlcjE5MTA5NDU=", "organizations_url": "https://api.github.com/users/asapo/orgs", "received_events_url": "https://api.github.com/users/asapo/received_events", "repos_url": "https://api.github.com/users/asapo/repos", "site_admin": false, "starred_url": "https://api.github.com/users/asapo/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/asapo/subscriptions", "type": "User", "url": "https://api.github.com/users/asapo", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/813/reactions" }
https://api.github.com/repos/psf/requests/issues/813/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/813.diff", "html_url": "https://github.com/psf/requests/pull/813", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/813.patch", "url": "https://api.github.com/repos/psf/requests/pulls/813" }
true
[ "This pull request [fails](http://travis-ci.org/kennethreitz/requests/builds/2242726) (merged 9143def7 into 1be2a55a).\n", "I'll consider this in the future, but chardet doesn't seem to be causing any problems for anyone.\n" ]
https://api.github.com/repos/psf/requests/issues/812
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/812/labels{/name}
https://api.github.com/repos/psf/requests/issues/812/comments
https://api.github.com/repos/psf/requests/issues/812/events
https://github.com/psf/requests/issues/812
6,456,735
MDU6SXNzdWU2NDU2NzM1
812
Parsing of "Allow" Headers
{ "avatar_url": "https://avatars.githubusercontent.com/u/897351?v=4", "events_url": "https://api.github.com/users/rhyselsmore/events{/privacy}", "followers_url": "https://api.github.com/users/rhyselsmore/followers", "following_url": "https://api.github.com/users/rhyselsmore/following{/other_user}", "gists_url": "https://api.github.com/users/rhyselsmore/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/rhyselsmore", "id": 897351, "login": "rhyselsmore", "node_id": "MDQ6VXNlcjg5NzM1MQ==", "organizations_url": "https://api.github.com/users/rhyselsmore/orgs", "received_events_url": "https://api.github.com/users/rhyselsmore/received_events", "repos_url": "https://api.github.com/users/rhyselsmore/repos", "site_admin": false, "starred_url": "https://api.github.com/users/rhyselsmore/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/rhyselsmore/subscriptions", "type": "User", "url": "https://api.github.com/users/rhyselsmore", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2012-08-26T05:51:07Z
2021-09-09T05:30:48Z
2012-11-24T11:36:49Z
NONE
resolved
As per the RFC (RFC2616), the "OPTIONS" method is used to identify communication options on the request/response chain. Within a RESTful System, the OPTIONS method can be used to display which methods are allowed for the authenticated user. Typically they are returned as comma-seperated values within the 'Allow' header. e.g Allow: GET, POST, PUT These non-cacheable headers allow for a client to discover the methods available against a resource. I am proposing that the allow headers are parsed if available, and presented within a pragmatic and pythonic way. Here are my thoughts so far (note that the github API does not support options for any of the methods I tried, this is all theoretical): > > > a = requests.options('https://github.com') > > > a.allow('get') > > > True > > > a.allow('post') > > > False Some key things to think of: - Some API will not return allow headers when options is called. - Should this parsing be available only for the options call. Within a RESTful architecture no other method should return the "Allow" header. - All comparisons should be completed on lowercase strings. Can I get your thoughts around introducing this header parsing for the OPTIONS method?
{ "avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4", "events_url": "https://api.github.com/users/Lukasa/events{/privacy}", "followers_url": "https://api.github.com/users/Lukasa/followers", "following_url": "https://api.github.com/users/Lukasa/following{/other_user}", "gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Lukasa", "id": 1382556, "login": "Lukasa", "node_id": "MDQ6VXNlcjEzODI1NTY=", "organizations_url": "https://api.github.com/users/Lukasa/orgs", "received_events_url": "https://api.github.com/users/Lukasa/received_events", "repos_url": "https://api.github.com/users/Lukasa/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions", "type": "User", "url": "https://api.github.com/users/Lukasa", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/812/reactions" }
https://api.github.com/repos/psf/requests/issues/812/timeline
null
completed
null
null
false
[ "If parsing of Allow headers was in any way complicated, I'd be all for this feature. However, Allow headers have got a pretty simple form, so they aren't tough for the end user to parse if they need to. This seems like it would be an addition to the API for no particular gain in simplicity or function.\n" ]
https://api.github.com/repos/psf/requests/issues/811
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/811/labels{/name}
https://api.github.com/repos/psf/requests/issues/811/comments
https://api.github.com/repos/psf/requests/issues/811/events
https://github.com/psf/requests/pull/811
6,451,526
MDExOlB1bGxSZXF1ZXN0MjE2MTM5Mw==
811
Remove exception eating from dispatch_hook.
{ "avatar_url": "https://avatars.githubusercontent.com/u/101894?v=4", "events_url": "https://api.github.com/users/lucian1900/events{/privacy}", "followers_url": "https://api.github.com/users/lucian1900/followers", "following_url": "https://api.github.com/users/lucian1900/following{/other_user}", "gists_url": "https://api.github.com/users/lucian1900/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/lucian1900", "id": 101894, "login": "lucian1900", "node_id": "MDQ6VXNlcjEwMTg5NA==", "organizations_url": "https://api.github.com/users/lucian1900/orgs", "received_events_url": "https://api.github.com/users/lucian1900/received_events", "repos_url": "https://api.github.com/users/lucian1900/repos", "site_admin": false, "starred_url": "https://api.github.com/users/lucian1900/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/lucian1900/subscriptions", "type": "User", "url": "https://api.github.com/users/lucian1900", "user_view_type": "public" }
[]
closed
true
null
[]
null
4
2012-08-25T15:02:54Z
2021-09-08T23:06:09Z
2012-08-25T15:06:56Z
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/811/reactions" }
https://api.github.com/repos/psf/requests/issues/811/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/811.diff", "html_url": "https://github.com/psf/requests/pull/811", "merged_at": "2012-08-25T15:06:56Z", "patch_url": "https://github.com/psf/requests/pull/811.patch", "url": "https://api.github.com/repos/psf/requests/pulls/811" }
true
[ "Resolves #782.\n", "This pull request [passes](http://travis-ci.org/kennethreitz/requests/builds/2235143) (merged 57b4d397 into 94869e72).\n", "This pull request [passes](http://travis-ci.org/kennethreitz/requests/builds/2235147) (merged 57b4d397 into 94869e72).\n", ":cake:\n" ]
https://api.github.com/repos/psf/requests/issues/810
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/810/labels{/name}
https://api.github.com/repos/psf/requests/issues/810/comments
https://api.github.com/repos/psf/requests/issues/810/events
https://github.com/psf/requests/issues/810
6,450,034
MDU6SXNzdWU2NDUwMDM0
810
Certificate verification errors not end-user friendly
{ "avatar_url": "https://avatars.githubusercontent.com/u/975735?v=4", "events_url": "https://api.github.com/users/Bluehorn/events{/privacy}", "followers_url": "https://api.github.com/users/Bluehorn/followers", "following_url": "https://api.github.com/users/Bluehorn/following{/other_user}", "gists_url": "https://api.github.com/users/Bluehorn/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Bluehorn", "id": 975735, "login": "Bluehorn", "node_id": "MDQ6VXNlcjk3NTczNQ==", "organizations_url": "https://api.github.com/users/Bluehorn/orgs", "received_events_url": "https://api.github.com/users/Bluehorn/received_events", "repos_url": "https://api.github.com/users/Bluehorn/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Bluehorn/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Bluehorn/subscriptions", "type": "User", "url": "https://api.github.com/users/Bluehorn", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2012-08-25T10:27:25Z
2021-09-09T06:00:47Z
2012-08-25T14:30:23Z
NONE
resolved
We are currently using requests in a rich client application (still in development). It is indeed a great improvement over urllib2 and friends! Especially it is great that it does verify the server certificate when using https. The error reporting though is quite lacking - the API reports a single SSLError for any verification failure: ``` SSLError: [Errno 1] _ssl.c:504: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed ``` In this case the host name did not match the name given in the certificate but it is not possible to infer that from the Exception. When accessing the same site from Firefox I get ``` <host.example.com> uses an invalid security certificate. The certificate is not trusted because it is self-signed. The certificate is only valid for <otherhost.example.com> (Error code: sec_error_untrusted_issuer) ``` I think requests should report similar information in the result exception for SSLError. I know this is asking for much since the underlying SSL modules do not do this yet.
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/810/reactions" }
https://api.github.com/repos/psf/requests/issues/810/timeline
null
completed
null
null
false
[ "I've considered doing this in the past, but due to the complexities of SSL errors (and the fairly hands-off support we have of them), I decided to keep it as transparent as possible. \n\nThis might change in the future though :)\n" ]
https://api.github.com/repos/psf/requests/issues/809
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/809/labels{/name}
https://api.github.com/repos/psf/requests/issues/809/comments
https://api.github.com/repos/psf/requests/issues/809/events
https://github.com/psf/requests/issues/809
6,449,243
MDU6SXNzdWU2NDQ5MjQz
809
Timing of Request
{ "avatar_url": "https://avatars.githubusercontent.com/u/897351?v=4", "events_url": "https://api.github.com/users/rhyselsmore/events{/privacy}", "followers_url": "https://api.github.com/users/rhyselsmore/followers", "following_url": "https://api.github.com/users/rhyselsmore/following{/other_user}", "gists_url": "https://api.github.com/users/rhyselsmore/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/rhyselsmore", "id": 897351, "login": "rhyselsmore", "node_id": "MDQ6VXNlcjg5NzM1MQ==", "organizations_url": "https://api.github.com/users/rhyselsmore/orgs", "received_events_url": "https://api.github.com/users/rhyselsmore/received_events", "repos_url": "https://api.github.com/users/rhyselsmore/repos", "site_admin": false, "starred_url": "https://api.github.com/users/rhyselsmore/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/rhyselsmore/subscriptions", "type": "User", "url": "https://api.github.com/users/rhyselsmore", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2012-08-25T07:39:47Z
2021-09-09T06:00:46Z
2012-08-25T14:31:27Z
NONE
resolved
I am not sure if this is out of scope of requests, but I was wondering about the implementation of some sort of request time metric, as in the time it takes from the start to completion of the request. For example: > > > resp = requests.get('https://github.com') > > > resp.time #(or something similar) > > > 124ms # (Represented as ms/seconds etc, but actually returned as milliseconds within a time object or similar) I am more then happy to get started on this, I would just like a discussion about the relevance of this feature to the context and purpose of requests as a package.
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/809/reactions" }
https://api.github.com/repos/psf/requests/issues/809/timeline
null
completed
null
null
false
[ "I considered adding this early on, actually, but decided to keep the scope of the library as concise as possible. It's pretty easy to do this now with the existing hooks system, which seems to be what people are doing now.\n\n---\n\nKeep this issues coming though, these are great :)\n", "Thanks for the response :)\n\nOn 26/08/2012, at 12:31 AM, Kenneth Reitz [email protected] wrote:\n\nI considered adding this early on, actually, but decided to keep the scope\nof the library as concise as possible. It's pretty easy to do this now with\n\n## the existing hooks system, which seems to be what people are doing now.\n\nKeep this issues coming though, these are great :)\n\n—\nReply to this email directly or view it on\nGitHubhttps://github.com/kennethreitz/requests/issues/809#issuecomment-8023784.\n" ]
https://api.github.com/repos/psf/requests/issues/808
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/808/labels{/name}
https://api.github.com/repos/psf/requests/issues/808/comments
https://api.github.com/repos/psf/requests/issues/808/events
https://github.com/psf/requests/issues/808
6,443,231
MDU6SXNzdWU2NDQzMjMx
808
updateStatusWithMedia not working
{ "avatar_url": "https://avatars.githubusercontent.com/u/613045?v=4", "events_url": "https://api.github.com/users/y2rayk/events{/privacy}", "followers_url": "https://api.github.com/users/y2rayk/followers", "following_url": "https://api.github.com/users/y2rayk/following{/other_user}", "gists_url": "https://api.github.com/users/y2rayk/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/y2rayk", "id": 613045, "login": "y2rayk", "node_id": "MDQ6VXNlcjYxMzA0NQ==", "organizations_url": "https://api.github.com/users/y2rayk/orgs", "received_events_url": "https://api.github.com/users/y2rayk/received_events", "repos_url": "https://api.github.com/users/y2rayk/repos", "site_admin": false, "starred_url": "https://api.github.com/users/y2rayk/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/y2rayk/subscriptions", "type": "User", "url": "https://api.github.com/users/y2rayk", "user_view_type": "public" }
[]
closed
true
null
[]
null
3
2012-08-24T20:16:38Z
2021-09-09T05:30:58Z
2012-08-25T14:50:25Z
NONE
resolved
i think this could be related to the other issue "Post not working". i get an error: twython.twython.TwythonError: u'Unauthorized: Authentication credentials were missing or incorrect. -- Could not authenticate you.' for a workaround, until this get fixes, i had to generate the headers to work. here is an example workaround: from twython import Twython twitter = Twython( twitter_token = 'XXXXX', twitter_secret = 'XXXX', oauth_token = 'XXXX', oauth_token_secret = 'XXXX', headers = { "Authorization": 'OAuth oauth_consumer_key="XXXXX", oauth_nonce="XXXXX", oauth_signature="XXXX", oauth_signature_method="HMAC-SHA1", oauth_timestamp="1345442", oauth_token="XXXXXXX", oauth_version="1.0"' } ) twitter.updateStatusWithMedia('sample.jpg', status='hello!')
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/808/reactions" }
https://api.github.com/repos/psf/requests/issues/808/timeline
null
completed
null
null
false
[ "This should be better now :)\n", "still does not work for me ... \n\n``` python\n response = twitterImage.updateStatusWithMedia(\"C:\\\\Users\\\\Desktop\\\\python-twitter-0.8.2\\\\examples\\\\data\\\\1.png\", status='thats me :)')\n File \"build\\bdist.win32\\egg\\twython\\twython.py\", line 445, in updateStatusWithMedia\n File \"build\\bdist.win32\\egg\\twython\\twython.py\", line 448, in _media_update\n File \"build\\bdist.win32\\egg\\twython\\twython.py\", line 233, in post\n File \"build\\bdist.win32\\egg\\twython\\twython.py\", line 225, in request\n File \"build\\bdist.win32\\egg\\twython\\twython.py\", line 206, in _request\nython.twython.TwythonError: u'Unauthorized: Authentication credentials were missing or incorrect. -- Could not authenticate you.'\n```\n\nnormal status update works great!\n", "I'm getting the same error - does anyone have this working with the latest version of Twython? \n\n@y2rayk how do you get the oauth_signature param for the headers in your workaround?\n" ]
https://api.github.com/repos/psf/requests/issues/807
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/807/labels{/name}
https://api.github.com/repos/psf/requests/issues/807/comments
https://api.github.com/repos/psf/requests/issues/807/events
https://github.com/psf/requests/issues/807
6,416,418
MDU6SXNzdWU2NDE2NDE4
807
Add option to strip headers on redirect
{ "avatar_url": "https://avatars.githubusercontent.com/u/188302?v=4", "events_url": "https://api.github.com/users/hamstah/events{/privacy}", "followers_url": "https://api.github.com/users/hamstah/followers", "following_url": "https://api.github.com/users/hamstah/following{/other_user}", "gists_url": "https://api.github.com/users/hamstah/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/hamstah", "id": 188302, "login": "hamstah", "node_id": "MDQ6VXNlcjE4ODMwMg==", "organizations_url": "https://api.github.com/users/hamstah/orgs", "received_events_url": "https://api.github.com/users/hamstah/received_events", "repos_url": "https://api.github.com/users/hamstah/repos", "site_admin": false, "starred_url": "https://api.github.com/users/hamstah/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/hamstah/subscriptions", "type": "User", "url": "https://api.github.com/users/hamstah", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2012-08-23T18:54:42Z
2021-09-09T06:00:48Z
2012-08-24T01:21:26Z
NONE
resolved
When a request is redirect, most headers are sent to the new location. This poses a problem with authentication headers and privacy in general. It would be nice to have an option/setting to decide to strip all headers, or whitelist headers that are ok to carry on redirect.
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/807/reactions" }
https://api.github.com/repos/psf/requests/issues/807/timeline
null
completed
null
null
false
[ "I've considered this in the past, but i'll consider it more in the future. \n\nThanks for the suggestion!\n" ]
https://api.github.com/repos/psf/requests/issues/806
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/806/labels{/name}
https://api.github.com/repos/psf/requests/issues/806/comments
https://api.github.com/repos/psf/requests/issues/806/events
https://github.com/psf/requests/pull/806
6,398,286
MDExOlB1bGxSZXF1ZXN0MjEzNTYyNA==
806
General Housekeeping
{ "avatar_url": "https://avatars.githubusercontent.com/u/897351?v=4", "events_url": "https://api.github.com/users/rhyselsmore/events{/privacy}", "followers_url": "https://api.github.com/users/rhyselsmore/followers", "following_url": "https://api.github.com/users/rhyselsmore/following{/other_user}", "gists_url": "https://api.github.com/users/rhyselsmore/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/rhyselsmore", "id": 897351, "login": "rhyselsmore", "node_id": "MDQ6VXNlcjg5NzM1MQ==", "organizations_url": "https://api.github.com/users/rhyselsmore/orgs", "received_events_url": "https://api.github.com/users/rhyselsmore/received_events", "repos_url": "https://api.github.com/users/rhyselsmore/repos", "site_admin": false, "starred_url": "https://api.github.com/users/rhyselsmore/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/rhyselsmore/subscriptions", "type": "User", "url": "https://api.github.com/users/rhyselsmore", "user_view_type": "public" }
[]
closed
true
null
[]
null
4
2012-08-23T06:20:47Z
2021-09-08T16:00:58Z
2012-08-25T04:48:30Z
NONE
resolved
os was imported twice. Not much of a change. Tests worked A-Ok
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/806/reactions" }
https://api.github.com/repos/psf/requests/issues/806/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/806.diff", "html_url": "https://github.com/psf/requests/pull/806", "merged_at": "2012-08-25T04:48:30Z", "patch_url": "https://github.com/psf/requests/pull/806.patch", "url": "https://api.github.com/repos/psf/requests/pulls/806" }
true
[ "This pull request [passes](http://travis-ci.org/kennethreitz/requests/builds/2209649) (merged 217a9d50 into 4889adce).\n", "This pull request [passes](http://travis-ci.org/kennethreitz/requests/builds/2209653) (merged 217a9d50 into 4889adce).\n", "This pull request [passes](http://travis-ci.org/kennethreitz/requests/builds/2209686) (merged 29aa21a2 into 4889adce).\n", "Thanks!\n" ]
https://api.github.com/repos/psf/requests/issues/805
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/805/labels{/name}
https://api.github.com/repos/psf/requests/issues/805/comments
https://api.github.com/repos/psf/requests/issues/805/events
https://github.com/psf/requests/pull/805
6,391,525
MDExOlB1bGxSZXF1ZXN0MjEzMjQwMQ==
805
Remove None values from post data.
{ "avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4", "events_url": "https://api.github.com/users/Lukasa/events{/privacy}", "followers_url": "https://api.github.com/users/Lukasa/followers", "following_url": "https://api.github.com/users/Lukasa/following{/other_user}", "gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Lukasa", "id": 1382556, "login": "Lukasa", "node_id": "MDQ6VXNlcjEzODI1NTY=", "organizations_url": "https://api.github.com/users/Lukasa/orgs", "received_events_url": "https://api.github.com/users/Lukasa/received_events", "repos_url": "https://api.github.com/users/Lukasa/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions", "type": "User", "url": "https://api.github.com/users/Lukasa", "user_view_type": "public" }
[]
closed
true
null
[]
null
3
2012-08-22T21:35:59Z
2021-09-08T16:00:57Z
2012-08-25T14:35:06Z
MEMBER
resolved
This pull request resolves the discussion in #378 by preventing None values from being posted.
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/805/reactions" }
https://api.github.com/repos/psf/requests/issues/805/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/805.diff", "html_url": "https://github.com/psf/requests/pull/805", "merged_at": "2012-08-25T14:35:06Z", "patch_url": "https://github.com/psf/requests/pull/805.patch", "url": "https://api.github.com/repos/psf/requests/pulls/805" }
true
[ "This pull request [passes](http://travis-ci.org/kennethreitz/requests/builds/2206075) (merged 751e7a0a into 4889adce).\n", "This pull request [passes](http://travis-ci.org/kennethreitz/requests/builds/2206079) (merged 751e7a0a into 4889adce).\n", "Awesome, thanks!\n" ]
https://api.github.com/repos/psf/requests/issues/804
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/804/labels{/name}
https://api.github.com/repos/psf/requests/issues/804/comments
https://api.github.com/repos/psf/requests/issues/804/events
https://github.com/psf/requests/issues/804
6,375,435
MDU6SXNzdWU2Mzc1NDM1
804
Session params ommited in 0.13.8
{ "avatar_url": "https://avatars.githubusercontent.com/u/1542066?v=4", "events_url": "https://api.github.com/users/dorvak/events{/privacy}", "followers_url": "https://api.github.com/users/dorvak/followers", "following_url": "https://api.github.com/users/dorvak/following{/other_user}", "gists_url": "https://api.github.com/users/dorvak/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/dorvak", "id": 1542066, "login": "dorvak", "node_id": "MDQ6VXNlcjE1NDIwNjY=", "organizations_url": "https://api.github.com/users/dorvak/orgs", "received_events_url": "https://api.github.com/users/dorvak/received_events", "repos_url": "https://api.github.com/users/dorvak/repos", "site_admin": false, "starred_url": "https://api.github.com/users/dorvak/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/dorvak/subscriptions", "type": "User", "url": "https://api.github.com/users/dorvak", "user_view_type": "public" }
[]
closed
true
null
[]
null
12
2012-08-22T12:08:13Z
2021-09-09T06:00:44Z
2012-08-25T14:34:31Z
NONE
resolved
Whenn subclassing the Session class like this: class TubeQuery(Session): ``` def __init__(self): super(TubeQuery,self).__init__(params={'v':'2','key':devkey,"alt":"json"}) self.server="http://gdata.youtube.com" self.key=devkey ``` and then using the session in a "with"-statement, the params are not passed anymore, since 0.13.8. Is this supposed to be like that? with self as req: reg.get(self.server+"foobar")
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/804/reactions" }
https://api.github.com/repos/psf/requests/issues/804/timeline
null
completed
null
null
false
[ "This seems to be broken by [1722f289](https://github.com/kennethreitz/requests/commit/1722f289711e3d03b0e00fb548f3e8ea92544775). Since params and proxies are no longer dictionaries and are lists of tuples instead, they no longer have an 'items' function, which is a check in the session#merge_kwargs() function. Therefore instead of merging the params passed in with the request and the session, it only uses the local params.\n\nNot sure of an ideal solution for this, doing a check for the items() function or type list might not be strict enough as the elements in the list are significant.\n\n``` python\n # Bypass if not a dictionary (e.g. timeout)\n if not hasattr(default_kwarg, 'items'):\n return local_kwarg\n```\n", "That's one of my commits so I'll dive into this and see if I can fix it ASAP.\n", "I just gave this a shot, not sure if this is the best way to go about it but it seems to work: [f18733d2be](https://github.com/weak/requests/commit/f18733d2be4a9c3d0d3ceea31be9e191c05f21d6).\n", "I'm trying to do it the opposite way by finishing what I had started (e.g. coercing everything to a list of key-value tuples).\n", "Sounds good, thanks for taking a look :)\n", "Thank you for narrowing it down. But I'm going to say that yours looks like the least mess for two reasons:\n1. My work so far trips over boolean values, e.g., `local_kwarg = to_key_val_list(local_kwarg)` where `isinstance(local_kwarg, bool) is True`.\n2. If the defaults have something like `{'page': '1'}` and local has `{'page': '2'}`, we would have to do a lot more work to overwrite the default. I'm going to think about this more to see if I'm missing an obvious way of doing this in a quick way so that ordering isn't lost.\n", "Like I mention in my commit message, 5025bd5 has the potential (because of nested for-loops) to take a while on large dictionaries/(key, val) lists. It does work though and can be tested with this [gist](https://gist.github.com/3426624)\n\nShould have run the tests, this breaks hooks (at least) and probably also headers. I guess I may as well put the work into finally getting those to coerce to key, val lists.\n", "And fixing this for hooks isn't viable since requests relies on the setdefault ability for hooks, which is why I ruled them out on #179.\n\nI'm going to keep working on this to see if there's anyway to do this with the (key, val) lists.\n", "Fixed by @weak, thanks!\n", "@sigmavirus24 feel free to send your final version when it's ready :)\n", "In switching everything functionally back to dicts (as OrderedDicts) this will be fixed. Just waiting on a verification in #817. Sorry for the delay.\n", "No one seems to have any objections, so I'm going to go ahead and implement it like this.\n" ]
https://api.github.com/repos/psf/requests/issues/803
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/803/labels{/name}
https://api.github.com/repos/psf/requests/issues/803/comments
https://api.github.com/repos/psf/requests/issues/803/events
https://github.com/psf/requests/pull/803
6,351,979
MDExOlB1bGxSZXF1ZXN0MjExNDQ4Nw==
803
Custom mimetypes for files in multipart request
{ "avatar_url": "https://avatars.githubusercontent.com/u/582622?v=4", "events_url": "https://api.github.com/users/vasa81/events{/privacy}", "followers_url": "https://api.github.com/users/vasa81/followers", "following_url": "https://api.github.com/users/vasa81/following{/other_user}", "gists_url": "https://api.github.com/users/vasa81/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/vasa81", "id": 582622, "login": "vasa81", "node_id": "MDQ6VXNlcjU4MjYyMg==", "organizations_url": "https://api.github.com/users/vasa81/orgs", "received_events_url": "https://api.github.com/users/vasa81/received_events", "repos_url": "https://api.github.com/users/vasa81/repos", "site_admin": false, "starred_url": "https://api.github.com/users/vasa81/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/vasa81/subscriptions", "type": "User", "url": "https://api.github.com/users/vasa81", "user_view_type": "public" }
[]
closed
true
null
[]
null
7
2012-08-21T14:40:05Z
2021-09-08T23:05:16Z
2012-08-25T14:35:37Z
NONE
resolved
I added support for custom mimetypes in mutipart request. Usage: r = requests.post(url, files={'file': ('file.xml', file_content)}) or r = requests.post(url, files={'file': ('file.xml', file_content, 'text/xml')}) or r = requests.post(url, files={'file': ('file.xml', file_content, 'application/xml')})
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 1, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 1, "url": "https://api.github.com/repos/psf/requests/issues/803/reactions" }
https://api.github.com/repos/psf/requests/issues/803/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/803.diff", "html_url": "https://github.com/psf/requests/pull/803", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/803.patch", "url": "https://api.github.com/repos/psf/requests/pulls/803" }
true
[ "This pull request [passes](http://travis-ci.org/kennethreitz/requests/builds/2189646) (merged 2f9b4b41 into 4889adce).\n", "Part of this should actually be a PR on shazow/urllib3 and the other part would depend on @shazow accepting it unless I'm speaking out of turn.\n", "This pull request [passes](http://travis-ci.org/kennethreitz/requests/builds/2189650) (merged 2f9b4b41 into 4889adce).\n", "+1 for pull request on urllib3.\n", "We should indeed have this discussion in urllib3 land, though I'm wondering if having no-tuple, 2-tuple, 3-tuple is going too far. Perhaps we need a better interface at this point. :)\n", "Same here, I think it's very unintuitive.\n", "@vasa81 thanks for the contribution, but we're going to hold off for now until we figure out a better way to approach this.\n" ]
https://api.github.com/repos/psf/requests/issues/802
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/802/labels{/name}
https://api.github.com/repos/psf/requests/issues/802/comments
https://api.github.com/repos/psf/requests/issues/802/events
https://github.com/psf/requests/pull/802
6,329,076
MDExOlB1bGxSZXF1ZXN0MjEwMzc2MA==
802
Tiny formatting changes in Advanced 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
3
2012-08-20T16:02:18Z
2021-09-08T16:00:57Z
2012-08-20T16:04:45Z
MEMBER
resolved
Just noticed when checking out the documentation for the new [link headers](http://docs.python-requests.org/en/latest/user/advanced/#link-headers) feature (quite the productive sprint you're having in Hobart! Very cool.) that there were quite a few paragraphs ending in ".:", which was ugly. Removed those, and generally made changes with colons.
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/802/reactions" }
https://api.github.com/repos/psf/requests/issues/802/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/802.diff", "html_url": "https://github.com/psf/requests/pull/802", "merged_at": "2012-08-20T16:04:45Z", "patch_url": "https://github.com/psf/requests/pull/802.patch", "url": "https://api.github.com/repos/psf/requests/pulls/802" }
true
[ "Excellent, thanks :)\n", "This pull request [fails](http://travis-ci.org/kennethreitz/requests/builds/2178783) (merged b5ce5029 into c323047d).\n", "This pull request [passes](http://travis-ci.org/kennethreitz/requests/builds/2178787) (merged b5ce5029 into c323047d).\n" ]
https://api.github.com/repos/psf/requests/issues/801
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/801/labels{/name}
https://api.github.com/repos/psf/requests/issues/801/comments
https://api.github.com/repos/psf/requests/issues/801/events
https://github.com/psf/requests/pull/801
6,327,152
MDExOlB1bGxSZXF1ZXN0MjEwMjg3OQ==
801
Added in a link handler as per issue #711
{ "avatar_url": "https://avatars.githubusercontent.com/u/897351?v=4", "events_url": "https://api.github.com/users/rhyselsmore/events{/privacy}", "followers_url": "https://api.github.com/users/rhyselsmore/followers", "following_url": "https://api.github.com/users/rhyselsmore/following{/other_user}", "gists_url": "https://api.github.com/users/rhyselsmore/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/rhyselsmore", "id": 897351, "login": "rhyselsmore", "node_id": "MDQ6VXNlcjg5NzM1MQ==", "organizations_url": "https://api.github.com/users/rhyselsmore/orgs", "received_events_url": "https://api.github.com/users/rhyselsmore/received_events", "repos_url": "https://api.github.com/users/rhyselsmore/repos", "site_admin": false, "starred_url": "https://api.github.com/users/rhyselsmore/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/rhyselsmore/subscriptions", "type": "User", "url": "https://api.github.com/users/rhyselsmore", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2012-08-20T14:49:29Z
2021-09-08T16:00:56Z
2012-08-20T14:54:48Z
NONE
resolved
Basic Basic handling of links. So far has very basic error handling, and might not cater for some cases. Handles the syntax of link headers that are demonstrated below. > > > from requests.utils import parse_header_links > > > parse_header_links('http:/.../front.jpeg; rel=front; type="image/jpeg",http://.../back.jpeg; rel=back;type="image/jpeg"') > > > [{'url': 'http:/.../front.jpeg', 'type': 'image/jpeg', 'rel': 'front'}, {'url': 'http://.../back.jpeg', 'type': 'image/jpeg', 'rel': 'back'}] > > > parse_header_links('http:/.../front.jpeg;') > > > [{'url': 'http:/.../front.jpeg'}] > > > parse_header_links('http:/.../front.jpeg') > > > [{'url': 'http:/.../front.jpeg'}] > > > parse_header_links('http:/.../front.jpeg; a=t') > > > [{'url': 'http:/.../front.jpeg', 'a': 't'}]
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/801/reactions" }
https://api.github.com/repos/psf/requests/issues/801/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/801.diff", "html_url": "https://github.com/psf/requests/pull/801", "merged_at": "2012-08-20T14:54:48Z", "patch_url": "https://github.com/psf/requests/pull/801.patch", "url": "https://api.github.com/repos/psf/requests/pulls/801" }
true
[ ":sparkles: :cake: :sparkles:\n", "This pull request [fails](http://travis-ci.org/kennethreitz/requests/builds/2178021) (merged f3159ed4 into 3514816d).\n" ]
https://api.github.com/repos/psf/requests/issues/800
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/800/labels{/name}
https://api.github.com/repos/psf/requests/issues/800/comments
https://api.github.com/repos/psf/requests/issues/800/events
https://github.com/psf/requests/pull/800
6,321,180
MDExOlB1bGxSZXF1ZXN0MjEwMDE1Mw==
800
Fix kennethreitz/requests#790
{ "avatar_url": "https://avatars.githubusercontent.com/u/406779?v=4", "events_url": "https://api.github.com/users/ayanamist/events{/privacy}", "followers_url": "https://api.github.com/users/ayanamist/followers", "following_url": "https://api.github.com/users/ayanamist/following{/other_user}", "gists_url": "https://api.github.com/users/ayanamist/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/ayanamist", "id": 406779, "login": "ayanamist", "node_id": "MDQ6VXNlcjQwNjc3OQ==", "organizations_url": "https://api.github.com/users/ayanamist/orgs", "received_events_url": "https://api.github.com/users/ayanamist/received_events", "repos_url": "https://api.github.com/users/ayanamist/repos", "site_admin": false, "starred_url": "https://api.github.com/users/ayanamist/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/ayanamist/subscriptions", "type": "User", "url": "https://api.github.com/users/ayanamist", "user_view_type": "public" }
[]
closed
true
null
[]
null
7
2012-08-20T09:19:04Z
2021-09-08T16:00:56Z
2012-08-25T14:41:15Z
CONTRIBUTOR
resolved
Fix kennethreitz/requests#790
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/800/reactions" }
https://api.github.com/repos/psf/requests/issues/800/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/800.diff", "html_url": "https://github.com/psf/requests/pull/800", "merged_at": "2012-08-25T14:41:15Z", "patch_url": "https://github.com/psf/requests/pull/800.patch", "url": "https://api.github.com/repos/psf/requests/pulls/800" }
true
[ "This pull request [passes](http://travis-ci.org/kennethreitz/requests/builds/2174801) (merged 301d1a83 into 2d5d6f99).\n", "This pull request [passes](http://travis-ci.org/kennethreitz/requests/builds/2174805) (merged 301d1a83 into 2d5d6f99).\n", "Anyone can handle this?\nWhat the bot said is wrong. It is not merged. The bot gives a wrong commit.\ncc @Lukasa @kennethreitz\n", "Correct. If you want Travis to re-test your commit, you should rebase onto the newest commit from `kennethreitz/requests`. (Add `kennethreitz/requests` as a git remote then `git pull --rebase` from it.)\n\nFor what it's worth, PEP8 recommends that you should use Python's [implicit line continuation](http://www.python.org/dev/peps/pep-0008/#maximum-line-length) instead of the backslash.\n\nEDIT: So it's clear, only Kenneth merges pull requests. Until he gets time to look at this, nothing more will happen on it. =)\n", "@Lukasa Thank you. Either form is accepted. If the issue can be fixed, i don't care what and how is modified.\n", "@ayanamist hmm, this seems like an odd way to fix the problem. I need to get a better understanding of why this is necessary. Any additional info would be great!\n", "Merging with a few changes, thanks!\n" ]
https://api.github.com/repos/psf/requests/issues/799
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/799/labels{/name}
https://api.github.com/repos/psf/requests/issues/799/comments
https://api.github.com/repos/psf/requests/issues/799/events
https://github.com/psf/requests/pull/799
6,317,398
MDExOlB1bGxSZXF1ZXN0MjA5ODY1Ng==
799
Fix SSL3 error on Ubuntu 12.04
{ "avatar_url": "https://avatars.githubusercontent.com/u/503584?v=4", "events_url": "https://api.github.com/users/joequery/events{/privacy}", "followers_url": "https://api.github.com/users/joequery/followers", "following_url": "https://api.github.com/users/joequery/following{/other_user}", "gists_url": "https://api.github.com/users/joequery/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/joequery", "id": 503584, "login": "joequery", "node_id": "MDQ6VXNlcjUwMzU4NA==", "organizations_url": "https://api.github.com/users/joequery/orgs", "received_events_url": "https://api.github.com/users/joequery/received_events", "repos_url": "https://api.github.com/users/joequery/repos", "site_admin": false, "starred_url": "https://api.github.com/users/joequery/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/joequery/subscriptions", "type": "User", "url": "https://api.github.com/users/joequery", "user_view_type": "public" }
[]
closed
true
null
[]
null
22
2012-08-20T02:53:22Z
2021-09-09T00:01:23Z
2012-08-20T05:38:39Z
CONTRIBUTOR
resolved
When attempting to request (get or post) to a resource responding only to SSL version 3, we'd get the following response on Ubuntu 12.04: ``` >>> import requests >>> requests.post("https://sis-portal-prod.uttyler.edu/psp/TAPPRD/EMPLOYEE/EMPL/?&cmd=login") Traceback (most recent call last): File "<stdin>", line 1, in <module> File "requests/api.py", line 98, in post return request('post', url, data=data, **kwargs) File "requests/safe_mode.py", line 39, in wrapped return function(method, url, **kwargs) File "requests/api.py", line 51, in request return session.request(method=method, url=url, **kwargs) File "requests/sessions.py", line 243, in request r.send(prefetch=prefetch) File "requests/models.py", line 630, in send raise SSLError(e) requests.exceptions.SSLError: [Errno 1] _ssl.c:504: error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version ``` There's a [good number of people](http://www.google.com/search?q=python+error%3A1407742E%3ASSL+routines%3ASSL23_GET_SERVER_HELLO%3Atlsv1+alert+protocol+version&sugexp=chrome,mod=8&sourceid=chrome&ie=UTF-8) having the error. Fix taken from [this thread](http://bugs.python.org/issue11220). Specs pass. Even if you don't accept this into master, hopefully someone will see this pull request on Google.
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/799/reactions" }
https://api.github.com/repos/psf/requests/issues/799/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/799.diff", "html_url": "https://github.com/psf/requests/pull/799", "merged_at": "2012-08-20T05:38:39Z", "patch_url": "https://github.com/psf/requests/pull/799.patch", "url": "https://api.github.com/repos/psf/requests/pulls/799" }
true
[ "This pull request [fails](http://travis-ci.org/kennethreitz/requests/builds/2173252) (merged 413d4b3d into b130b980).\n", "This pull request [fails](http://travis-ci.org/kennethreitz/requests/builds/2173256) (merged 413d4b3d into b130b980).\n", "This pull request [passes](http://travis-ci.org/kennethreitz/requests/builds/2173308) (merged 6ac66b3d into b130b980).\n", "Rebasing for a neater pull. \n", "This pull request [passes](http://travis-ci.org/kennethreitz/requests/builds/2173320) (merged c19650b0 into b130b980).\n", "@joequery You should be making this pull request against urllib3, not requests :)\n", "@kennethreitz :O You merged urllib3 pull request code into requests. Naughty.\n", "god damn it, i hit the wrong button\n", "Consequences will never be the same. :P\n", "Reverted\n", "Is there a known fix for this issue elsewhere? It looks like [#606](https://github.com/kennethreitz/requests/issues/606) is along the lines of what I'm looking for. However, requests was functioning fine on my mac, but not on Ubuntu 12.04, even after upgrading OpenSSL. \n", "@Schwanksta The respective issue on urllib3 has been closed. :)\n", "I'm a little confused as to the status of what happened, here. My perception is that one change was made to urllib (allowing a SSL version to be passed) and that this PR was reverted, leaving only the @joequery fork of requests, where the only real change was to attempt SSL3 and _then_ SSL23.\n\nThere still exists a problem where any error will be caught and another connection reattempted using SSL23, sometimes or always causing the \"unknown protocol\" error. This can simply be fixed by reraising the exception unless the message matches the TLS-version error:\n\n```\n try:\n self.sock = ssl.wrap_socket(sock, self.key_file, self.cert_file,\n cert_reqs=self.cert_reqs,\n ca_certs=self.ca_certs,\n ssl_version=ssl.PROTOCOL_SSLv3)\n except ssl.SSLError as e:\n if str(e).endswith(':tlsv1 alert protocol version') is False:\n raise\n\n self.sock = ssl.wrap_socket(sock, self.key_file, self.cert_file,\n cert_reqs=self.cert_reqs,\n ca_certs=self.ca_certs,\n ssl_version=ssl.PROTOCOL_SSLv23)\n```\n\nI'd submit an issue, but apparently forks can't have issues.\n\n@joequery I think your fork might still be the only solution. Please confirm. If so, please consider the fix, above.\n", "@dsoprea Please think very carefully before commenting on two-year-old issues. There was definitely a better, less-noisy way to handle providing your input.\n\nYour reading of this issue is wrong. This pull request contained only changes to urllib3, which is a separate module to requests, maintained elsewhere. We do not accept code changes in urllib3 in this repository, as we simply bring in urllib3 wholesale. Any urllib3 changes therefore need to be made at the core repository, shazow/urllib3. This means even if we wanted to, we could not consider this fix, because it's not our fix to make.\n\nKenneth accidentally merged this fix when he intended to close it, so he also reverted it.\n\nIf you'd carefully checked the internet, you'd know that there is an accepted way to choose the SSL version used by Requests. It is documented [in this blog post](https://lukasa.co.uk/2013/01/Choosing_SSL_Version_In_Requests/) (now more than a year old), [this StackOverflow question](http://stackoverflow.com/questions/14102416/python-requests-requests-exceptions-sslerror-errno-8-ssl-c504-eof-occurred), [this Requests issue](https://github.com/kennethreitz/requests/issues/1083), and will be implemented in [this open-source library](https://github.com/sigmavirus24/requests-toolbelt).\n", "I did a search for the bug that I was having, and I ended-up in that PR. I\napologize for posting the comment. Joe seemed to be fixing a bug that I\nencountered first thing in the morning, and it seemed the most relevant to\na bug that never got fixed. I did not notice the timestamp, and got lost in\nall of the various cross-linking. I appreciate the links in your response.\n\nI would caution you against being so abrasive. I'll be careful to respond\nto you as you have responded to me, should you ever have a question about\nanomalous behavior in one of my projects that you might suddenly find\nyourself relying on.\n\nOn Tue, Jan 7, 2014 at 10:58 AM, Cory Benfield [email protected]:\n\n> @dsoprea https://github.com/dsoprea Please think very carefully before\n> commenting on two-year-old issues. There was definitely a better,\n> less-noisy way to handle providing your input.\n> \n> Your reading of this issue is wrong. This pull request contained only\n> changes to urllib3, which is a separate module to requests, maintained\n> elsewhere. We do not accept code changes in urllib3 in this repository, as\n> we simply bring in urllib3 wholesale. Any urllib3 changes therefore need to\n> be made at the core repository, shazow/urllib3. This means even if we\n> wanted to, we could not consider this fix, because it's not our fix to make.\n> \n> Kenneth accidentally merged this fix when he intended to close it, so he\n> also reverted it.\n> \n> If you'd carefully checked the internet, you'd know that there is an\n> accepted way to choose the SSL version used by Requests. It is documented in\n> this blog posthttps://lukasa.co.uk/2013/01/Choosing_SSL_Version_In_Requests/(now more than a year old), this\n> StackOverflow questionhttp://stackoverflow.com/questions/14102416/python-requests-requests-exceptions-sslerror-errno-8-ssl-c504-eof-occurred,\n> this Requests issue https://github.com/kennethreitz/requests/issues/1083,\n> and will be implemented in this open-source libraryhttps://github.com/sigmavirus24/requests-toolbelt\n> .\n> \n> —\n> Reply to this email directly or view it on GitHubhttps://github.com/kennethreitz/requests/pull/799#issuecomment-31749628\n> .\n", "I did not intend for that message to seem like I was chastising you, or to seem abrasive: I'm sorry.\n\nIt's worth noting that, as I mentioned, this comes up very frequently. This means that a lot of developer time is spent responding to duplicate issues and comments on previous issues. Any GitHub comment is responded to as if it is urgent, because they often are. This means a comment or GitHub issue is an instant cost of our time (as I'm sure you can appreciate from your own projects).\n\nThis is what I meant when I said there were \"lower-noise\" ways of raising this issue. For example, Stack Overflow would have been a suitable place to ask. Alternatively, emailing one of the triagers would have been just as appropriate: both @sigmavirus24 and I have our email addresses published very clearly.\n\nMy response was born in part from frustration at repeatedly having to follow up on issues opened or commented on that could have been resolved by more care. I'm sure you just made a mistake, and as I said, I'm sorry for not taking care with my language.\n", "I appreciate that, Cory. I was also very frustrated, as it seems like I've\nbeen dealing with tiny, obstructive bugs from every dependency lately, and\nI just spent a week rebuilding a new solution as an alternative to an\nexisting one that was broken and blocking me. Right when I was about to\ncheck-off the last feature, I run into a mechanical issue with SSL, where\nI'm a bit fuzzy when it comes to implementation on _ssl and urllib, and how\nrequests wraps one or both. I'd be more careful in the afternoon, but when\nI just couldn't get it done before having to walk out, this morning, I got\nhasty.\n\nOn Tue, Jan 7, 2014 at 1:57 PM, Cory Benfield [email protected]:\n\n> I did not intend for that message to seem like I was chastising you, or to\n> seem abrasive: I'm sorry.\n> \n> It's worth noting that, as I mentioned, this comes up very frequently.\n> This means that a lot of developer time is spent responding to duplicate\n> issues and comments on previous issues. Any GitHub comment is responded to\n> as if it is urgent, because they often are. This means a comment or GitHub\n> issue is an instant cost of our time (as I'm sure you can appreciate from\n> your own projects).\n> \n> This is what I meant when I said there were \"lower-noise\" ways of raising\n> this issue. For example, Stack Overflow would have been a suitable place to\n> ask. Alternatively, emailing one of the triagers would have been just as\n> appropriate: both @sigmavirus24 https://github.com/sigmavirus24 and I\n> have our email addresses published very clearly.\n> \n> My response was born in part from frustration at repeatedly having to\n> follow up on issues opened or commented on that could have been resolved by\n> more care. I'm sure you just made a mistake, and as I said, I'm sorry for\n> not taking care with my language.\n> \n> —\n> Reply to this email directly or view it on GitHubhttps://github.com/kennethreitz/requests/pull/799#issuecomment-31767192\n> .\n", "I'm glad we could both step back and talk this out. =) Gives me a little more faith in humanity. I'm sorry you've been encountering SSL issues. Let me know if the linked solution helps you out: if it doesn't, I'll happily spend some time looking at your problem further (just, you know, email me first!).\n", "I'm all for that. Thanks, Cory. That's what makes opensource work.\n\nOn Tue, Jan 7, 2014 at 2:36 PM, Cory Benfield [email protected]:\n\n> I'm glad we could both step back and talk this out. =) Gives me a little\n> more faith in humanity. I'm sorry you've been encountering SSL issues. Let\n> me know if the linked solution helps you out: if it doesn't, I'll happily\n> spend some time looking at your problem further (just, you know, email me\n> first!).\n> \n> —\n> Reply to this email directly or view it on GitHubhttps://github.com/kennethreitz/requests/pull/799#issuecomment-31771002\n> .\n", "@dsoprea My fork existed back when documentation concerning choosing SSL versions wasn't as easy to find. I still use my fork from time to time when I deal with scraping sites which exclusively deal with sslv3, because I'm lazy and don't feel like doing that mounting process :P\n\nI'll make the update you provided anyway, so thanks for that. I also didn't think your initial comment was rude or inconsiderate at all, and I don't see how commenting on an issue similar to your own is \"noisy\".\n", "He's a good guy. I was confused and annoyed by the presence of no seemingly\nstandard, staightforward solution, and he was just annoyed by something\nbeing brought-up that seemed a bit more straightforward to him, and\nresurrected an old thread.\n\nI saw a reference by Ken to \"transport adapters\" on another thread, and\nthen, through more searches than I would've hoped, finally found my way to\nthe \"transport adapters\" section in the docs. I then just overrode\n_init_poolmanager_, and added ssl_version as a parameter.\n\nI think that HTTPAdapter should have this already, but I can't imagine it\nwouldn't be there unless there was an exceptional reason.\n\nI'll propose a PR that introduces an SSL example in the \"transport\nadapters\" section of the documentation that I referred-to, above.\n\nDustin\n\nOn Wed, Jan 8, 2014 at 11:52 AM, Joseph McCullough <[email protected]\n\n> wrote:\n> \n> @dsoprea https://github.com/dsoprea My fork existed back before\n> documentation concerning choosing SSL versions wasn't as easy to find. I\n> still use my fork from time to time when I deal with scraping sites which\n> exclusively deal with sslv3, because I'm lazy and don't feel like doing\n> that mounting process :P\n> \n> I'll make the update you provided anyway, so thanks for that. I also\n> didn't think your initial comment was rude or inconsiderate at all, and I\n> don't see how commenting on an issue similar to your own is \"noisy\".\n> \n> —\n> Reply to this email directly or view it on GitHubhttps://github.com/kennethreitz/requests/pull/799#issuecomment-31852884\n> .\n", "@joequery As @dsoprea just said, we both managed to get our wires crossed and weren't entirely our best selves. These things happen, apologies all round and everyone's friends again. =)\n\n@dsoprea You mention that you're not sure why the SSL version isn't available on the default `HTTPAdapter`. This is a fair question. The short answer is that we don't want to provide options on the `HTTPAdapter` for _every single argument_ urllib3 takes on any of the functions we call. That will lead to a nightmare god-object, and worse, will lead to us duplicating the default values that are already in urllib3. That's a potential source of many many bugs.\n\nWith that in mind, we had to pick which attributes we thought were important enough to specify explicitly and which we thought weren't. This was an arbitrary decision, and Kenneth made it as he saw fit. In principle the `ssl_version` should never need to be set: it looks like the bug we're encountering here is related tangentially to buggy versions of OpenSSL (see a very recent discussion at #1847 and #1850, where the tone of the conversation provides an idea of how frustrating the maintainer + contributors find this SSL bugginess). This makes `ssl_version` a prime candidate to simply leave at its default urllib3 value.\n\nThis dovetails with the fact that the Transport Adapter interface is _intended_ to be an inheritance-based interface, not a function-parameters one. Again, [I've written briefly about this](https://lukasa.co.uk/2013/04/Requests_Two_APIs/) (though if you read the `SSLAdapter` post you'll find this retreads a lot of ground).\n\nIf you strongly disagree with this design decision, I can get Kenneth to weigh in on it, but we're strongly resisting changes to Requests' interfaces.\n\nAs for proposing an SSL Transport Adapter example in the documentation, I think we'd be happy to have it. =) I've documented it myself in a number of places that aren't the official documentation, and it's now present in what is likely to be a very popular companion library, but it also makes a good example.\n" ]
https://api.github.com/repos/psf/requests/issues/798
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/798/labels{/name}
https://api.github.com/repos/psf/requests/issues/798/comments
https://api.github.com/repos/psf/requests/issues/798/events
https://github.com/psf/requests/issues/798
6,317,093
MDU6SXNzdWU2MzE3MDkz
798
Support SSL client certificates
{ "avatar_url": "https://avatars.githubusercontent.com/u/236562?v=4", "events_url": "https://api.github.com/users/nicois/events{/privacy}", "followers_url": "https://api.github.com/users/nicois/followers", "following_url": "https://api.github.com/users/nicois/following{/other_user}", "gists_url": "https://api.github.com/users/nicois/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/nicois", "id": 236562, "login": "nicois", "node_id": "MDQ6VXNlcjIzNjU2Mg==", "organizations_url": "https://api.github.com/users/nicois/orgs", "received_events_url": "https://api.github.com/users/nicois/received_events", "repos_url": "https://api.github.com/users/nicois/repos", "site_admin": false, "starred_url": "https://api.github.com/users/nicois/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/nicois/subscriptions", "type": "User", "url": "https://api.github.com/users/nicois", "user_view_type": "public" }
[]
closed
true
null
[]
null
3
2012-08-20T02:08:43Z
2021-09-09T06:00:49Z
2012-08-20T02:12:49Z
NONE
resolved
It would be handy if we could support HTTP transactions where the server required client-side SSL authentication. An ugly urllib2/httplib implementation is here: http://stackoverflow.com/a/5899320 I imagine a sample interaction would look something like this: ``` response = requests.get(url, client_cert="/path/to/cert", client_key="/path/to/key") ``` or ``` response = requests.get(url, pem="/path/to/pem") ```
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/798/reactions" }
https://api.github.com/repos/psf/requests/issues/798/timeline
null
completed
null
null
false
[ "These are fully supported.\n", "They just happen to be fully undocumented :)\n", "Oops, I take that back:\n\nhttp://docs.python-requests.org/en/latest/user/advanced/#ssl-cert-verification\n" ]
https://api.github.com/repos/psf/requests/issues/797
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/797/labels{/name}
https://api.github.com/repos/psf/requests/issues/797/comments
https://api.github.com/repos/psf/requests/issues/797/events
https://github.com/psf/requests/pull/797
6,314,955
MDExOlB1bGxSZXF1ZXN0MjA5NzkwNQ==
797
Fix order of data+params
{ "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
2012-08-19T20:40:47Z
2021-09-08T16:00:56Z
2012-08-20T07:55:17Z
CONTRIBUTOR
resolved
There's an important fix in the code that I found when Travis ran the tests after the first commit in this PR. It was a mistake I made in not keeping my naming consistent. Related to #795
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/797/reactions" }
https://api.github.com/repos/psf/requests/issues/797/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/797.diff", "html_url": "https://github.com/psf/requests/pull/797", "merged_at": "2012-08-20T07:55:17Z", "patch_url": "https://github.com/psf/requests/pull/797.patch", "url": "https://api.github.com/repos/psf/requests/pulls/797" }
true
[ "This pull request [passes](http://travis-ci.org/kennethreitz/requests/builds/2171155) (merged 6d418d91 into b130b980).\n", "This pull request [passes](http://travis-ci.org/kennethreitz/requests/builds/2171159) (merged 6d418d91 into b130b980).\n", "Thanks!\n", "You're welcome. Thanks for requests.\n" ]
https://api.github.com/repos/psf/requests/issues/796
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/796/labels{/name}
https://api.github.com/repos/psf/requests/issues/796/comments
https://api.github.com/repos/psf/requests/issues/796/events
https://github.com/psf/requests/pull/796
6,314,925
MDExOlB1bGxSZXF1ZXN0MjA5Nzg5Mw==
796
Fix ordering of data + params
{ "avatar_url": "https://avatars.githubusercontent.com/u/240830?v=4", "events_url": "https://api.github.com/users/sigmavirus24/events{/privacy}", "followers_url": "https://api.github.com/users/sigmavirus24/followers", "following_url": "https://api.github.com/users/sigmavirus24/following{/other_user}", "gists_url": "https://api.github.com/users/sigmavirus24/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/sigmavirus24", "id": 240830, "login": "sigmavirus24", "node_id": "MDQ6VXNlcjI0MDgzMA==", "organizations_url": "https://api.github.com/users/sigmavirus24/orgs", "received_events_url": "https://api.github.com/users/sigmavirus24/received_events", "repos_url": "https://api.github.com/users/sigmavirus24/repos", "site_admin": false, "starred_url": "https://api.github.com/users/sigmavirus24/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/sigmavirus24/subscriptions", "type": "User", "url": "https://api.github.com/users/sigmavirus24", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2012-08-19T20:37:20Z
2021-09-08T16:00:55Z
2012-08-19T20:37:56Z
CONTRIBUTOR
resolved
Also there's an important fix in the code that I found when Travis ran the tests after the first commit. It was a mistake I made in not keeping my naming consistent.
{ "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/796/reactions" }
https://api.github.com/repos/psf/requests/issues/796/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/796.diff", "html_url": "https://github.com/psf/requests/pull/796", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/796.patch", "url": "https://api.github.com/repos/psf/requests/pulls/796" }
true
[ "Actually, I have some bizarre commits here, let me fix that and submit a new pr.\n", "This pull request [passes](http://travis-ci.org/kennethreitz/requests/builds/2171113) (merged 4fdcfe1b into b130b980).\n" ]
https://api.github.com/repos/psf/requests/issues/795
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/795/labels{/name}
https://api.github.com/repos/psf/requests/issues/795/comments
https://api.github.com/repos/psf/requests/issues/795/events
https://github.com/psf/requests/issues/795
6,314,113
MDU6SXNzdWU2MzE0MTEz
795
Order of operations
{ "avatar_url": "https://avatars.githubusercontent.com/u/240830?v=4", "events_url": "https://api.github.com/users/sigmavirus24/events{/privacy}", "followers_url": "https://api.github.com/users/sigmavirus24/followers", "following_url": "https://api.github.com/users/sigmavirus24/following{/other_user}", "gists_url": "https://api.github.com/users/sigmavirus24/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/sigmavirus24", "id": 240830, "login": "sigmavirus24", "node_id": "MDQ6VXNlcjI0MDgzMA==", "organizations_url": "https://api.github.com/users/sigmavirus24/orgs", "received_events_url": "https://api.github.com/users/sigmavirus24/received_events", "repos_url": "https://api.github.com/users/sigmavirus24/repos", "site_admin": false, "starred_url": "https://api.github.com/users/sigmavirus24/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/sigmavirus24/subscriptions", "type": "User", "url": "https://api.github.com/users/sigmavirus24", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2012-08-19T18:40:51Z
2021-09-09T06:00:49Z
2012-08-20T07:55:18Z
CONTRIBUTOR
resolved
So I realized in changing github3.py's download creation function that when @jkbr changed the encoding of files (`_encode_files`) he inserted the file tuples first. So making a call like: ``` python from requests import post r = post('http://httpbin.org/post', data=[('some', 'data'), ('some', 'more data')], files=[('file', open(__file__, 'rb'))]) ``` Will actually have the structure (sent to urllib3) of ``` python [('file', '<data from __file__>'), ('some', 'data'), ('some', 'more data')] ``` Whereas before that it would be: ``` python [('some', 'data'), ('some', 'more data'), ('file', '<data from __file__>')] ``` And this changes the previously expected/exhibited behavior. I kept that construction assuming it had been approved, but I can't find that and I'm not sure if anyone was aware of this. I can change the ordering very easily, but I was wondering if I should or if this is ok.
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/795/reactions" }
https://api.github.com/repos/psf/requests/issues/795/timeline
null
completed
null
null
false
[ "The ordering change I made wasn't really intentional. I think it's a good idea to switch back to the original ordering for the sake of consistency.\n", "Ah ok, I'll just wait for word from @kennethreitz before issuing the pull request.\n" ]
https://api.github.com/repos/psf/requests/issues/794
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/794/labels{/name}
https://api.github.com/repos/psf/requests/issues/794/comments
https://api.github.com/repos/psf/requests/issues/794/events
https://github.com/psf/requests/issues/794
6,310,449
MDU6SXNzdWU2MzEwNDQ5
794
Comma encoding in request params
{ "avatar_url": "https://avatars.githubusercontent.com/u/212338?v=4", "events_url": "https://api.github.com/users/sweenzor/events{/privacy}", "followers_url": "https://api.github.com/users/sweenzor/followers", "following_url": "https://api.github.com/users/sweenzor/following{/other_user}", "gists_url": "https://api.github.com/users/sweenzor/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/sweenzor", "id": 212338, "login": "sweenzor", "node_id": "MDQ6VXNlcjIxMjMzOA==", "organizations_url": "https://api.github.com/users/sweenzor/orgs", "received_events_url": "https://api.github.com/users/sweenzor/received_events", "repos_url": "https://api.github.com/users/sweenzor/repos", "site_admin": false, "starred_url": "https://api.github.com/users/sweenzor/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/sweenzor/subscriptions", "type": "User", "url": "https://api.github.com/users/sweenzor", "user_view_type": "public" }
[]
closed
true
null
[]
null
5
2012-08-19T06:51:38Z
2021-09-07T00:06:22Z
2012-08-20T01:51:31Z
CONTRIBUTOR
resolved
I'm making requests against an API which takes comma separated parameter values. A working request looks like this: ``` curl http://localhost:4444/endpoint?val=555,666 ``` When I pass these parameters in with `requests.get()` however, the resulting URL looks like this: ``` >>> r = requests.get('http://localhost:4444/endpoint/', params={'val': '555,666'}) >>> r.url u'http://localhost:4444/endpoint/?val=555%2C666' ``` I can build the URL myself, but I'm wondering if this is the intended behavior?
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
{ "+1": 1, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 1, "url": "https://api.github.com/repos/psf/requests/issues/794/reactions" }
https://api.github.com/repos/psf/requests/issues/794/timeline
null
completed
null
null
false
[ "Ehh...standards are hard.\n\nThe comma (along with some other characters) is defined in [RFC 3986](http://pretty-rfc.herokuapp.com/RFC3986#reserved) as a reserved character. This means the comma has defined meaning at various parts in a URL, and if it is not being used in that context it needs to be percent-encoded.\n\nThat said, the [query parameter](http://pretty-rfc.herokuapp.com/RFC3986#query) doesn't give the comma any special syntax, so in query parameters we probably shouldn't be encoding it. That said, it's not entirely Requests' fault: the parameters are encoded using [`urllib.urlencode()`](http://docs.python.org/library/urllib#urllib.urlencode), which is what is percent-encoding the query parameters.\n\nThis isn't easy to fix though, because some web services use `,` and some use `%2C`, and neither is wrong. You might just have to handle this encoding yourself.\n\n@kennethreitz, can you think of anyone who would have a better insight into this problem?\n", "If you are passing it in via `params`, we should be doing a full encoding. If you're adding it to the URL yourself, it should not be escaped.\n", "Thanks for the quick response and clarification!\n", "thanks.it cleared the mist in my brain", "It seems a little inconsistent to encode the comma despite the standard allowing commas in that context, while a param set to a list is encoded like `?myparam=foo&myparam=bar`, which has different behavior in different languages/frameworks (some parse this as an array, some take the last value, etc) due to the standard not defining correct behavior there.\r\n\r\nTo prevent comma encoding, it's as simple as calling `urlencode` with kwarg `safe` set to \",\" if using python3. I'm sure a suitable polyfill to support python2 would be trivial to implement.\r\n\r\nObviously the default behavior of passing a list as a params dict entry value shouldn't change, but perhaps a configuration parameter could be passed to override this behavior?\r\n\r\nIf either/both of those endeavors get a maintainer's blessing, I'd be happy to whip up a pull request or two." ]
https://api.github.com/repos/psf/requests/issues/793
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/793/labels{/name}
https://api.github.com/repos/psf/requests/issues/793/comments
https://api.github.com/repos/psf/requests/issues/793/events
https://github.com/psf/requests/pull/793
6,307,757
MDExOlB1bGxSZXF1ZXN0MjA5NTc3OQ==
793
Typo fix in tests.
{ "avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4", "events_url": "https://api.github.com/users/Lukasa/events{/privacy}", "followers_url": "https://api.github.com/users/Lukasa/followers", "following_url": "https://api.github.com/users/Lukasa/following{/other_user}", "gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Lukasa", "id": 1382556, "login": "Lukasa", "node_id": "MDQ6VXNlcjEzODI1NTY=", "organizations_url": "https://api.github.com/users/Lukasa/orgs", "received_events_url": "https://api.github.com/users/Lukasa/received_events", "repos_url": "https://api.github.com/users/Lukasa/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions", "type": "User", "url": "https://api.github.com/users/Lukasa", "user_view_type": "public" }
[]
closed
true
null
[]
null
3
2012-08-18T20:24:45Z
2021-09-08T16:00:55Z
2012-08-18T21:32:48Z
MEMBER
resolved
Addresses #792.
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/793/reactions" }
https://api.github.com/repos/psf/requests/issues/793/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/793.diff", "html_url": "https://github.com/psf/requests/pull/793", "merged_at": "2012-08-18T21:32:48Z", "patch_url": "https://github.com/psf/requests/pull/793.patch", "url": "https://api.github.com/repos/psf/requests/pulls/793" }
true
[ "This pull request [passes](http://travis-ci.org/kennethreitz/requests/builds/2163928) (merged a04775f8 into cb0fdd80).\n", "This pull request [passes](http://travis-ci.org/kennethreitz/requests/builds/2163932) (merged a04775f8 into cb0fdd80).\n", "thanks!\n" ]
https://api.github.com/repos/psf/requests/issues/792
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/792/labels{/name}
https://api.github.com/repos/psf/requests/issues/792/comments
https://api.github.com/repos/psf/requests/issues/792/events
https://github.com/psf/requests/issues/792
6,306,967
MDU6SXNzdWU2MzA2OTY3
792
Typo in tests/test_requests_ext.py
{ "avatar_url": "https://avatars.githubusercontent.com/u/656294?v=4", "events_url": "https://api.github.com/users/Arfrever/events{/privacy}", "followers_url": "https://api.github.com/users/Arfrever/followers", "following_url": "https://api.github.com/users/Arfrever/following{/other_user}", "gists_url": "https://api.github.com/users/Arfrever/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Arfrever", "id": 656294, "login": "Arfrever", "node_id": "MDQ6VXNlcjY1NjI5NA==", "organizations_url": "https://api.github.com/users/Arfrever/orgs", "received_events_url": "https://api.github.com/users/Arfrever/received_events", "repos_url": "https://api.github.com/users/Arfrever/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Arfrever/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Arfrever/subscriptions", "type": "User", "url": "https://api.github.com/users/Arfrever", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2012-08-18T18:12:16Z
2021-09-09T06:00:50Z
2012-08-19T10:31:42Z
NONE
resolved
tests/test_requests_ext.py seems to contain a typo in RequestsTestSuite.test_cookies_on_redirects(). The last lines in this function are: ``` # get cookies on another domain r2 = s.get(url='http://httpbin.org/cookies') # the cookie is not there self.assertTrue('preview' not in json.loads(r2.text)['cookies']) # this redirects to another domain, httpbin.org # cookies of the first domain should NOT be sent to the next one r3 = s.get(url='http://tinyurl.com/7zp3jnr') assert r3.url == 'http://httpbin.org/cookies' self.assertTrue('preview' not in json.loads(r2.text)['cookies']) ``` r2.text should be r3.text in last line.
{ "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/792/reactions" }
https://api.github.com/repos/psf/requests/issues/792/timeline
null
completed
null
null
false
[ "Fix is in Pull Request #793.\n", "Nice catch\n" ]
https://api.github.com/repos/psf/requests/issues/791
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/791/labels{/name}
https://api.github.com/repos/psf/requests/issues/791/comments
https://api.github.com/repos/psf/requests/issues/791/events
https://github.com/psf/requests/pull/791
6,306,855
MDExOlB1bGxSZXF1ZXN0MjA5NTQ3MQ==
791
Key val lists
{ "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
11
2012-08-18T17:50:27Z
2021-09-08T16:00:54Z
2012-08-18T22:54:49Z
CONTRIBUTOR
resolved
Accept lists of `(key, val)` tuples everywhere. This should close/solve issue #179. Unfortunately @jkbr had duplicated some of the effort so I had to remove his contributions there, but all the tests pass. Also, I apologize in advance for the likely very ugly history. I wanted to keep up-to-date while working on this so there are a few (possibly unnecessary) merge commits.
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/791/reactions" }
https://api.github.com/repos/psf/requests/issues/791/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/791.diff", "html_url": "https://github.com/psf/requests/pull/791", "merged_at": "2012-08-18T22:54:49Z", "patch_url": "https://github.com/psf/requests/pull/791.patch", "url": "https://api.github.com/repos/psf/requests/pulls/791" }
true
[ "Scratch that, python 3 is failing. \n", "This pull request [fails](http://travis-ci.org/kennethreitz/requests/builds/2163101) (merged f01694e2 into cb0fdd80).\n", "This pull request [fails](http://travis-ci.org/kennethreitz/requests/builds/2163113) (merged f01694e2 into cb0fdd80).\n", "This pull request [passes](http://travis-ci.org/kennethreitz/requests/builds/2163403) (merged ab56e4a9 into cb0fdd80).\n", "I need to rework how headers are dealt with in the Request object, but until then most of the rest of the parameters that only accepted dictionaries before now accept lists of `(key, value)` tuples. When I am certain that I have the headers logic fixed, I'll submit a separate pull request for that.\n", "This is serious work, I'm very impressed. I'm sure Kenneth will be too. =)\n\nQuick note: to avoid merge commits, use `git pull --rebase` to get the new commits without adding merge commits.\n", "@kennethreitz @Lukasa should I start a new branch off of develop and cherry pick my commits on top of it to avoid the merges? Besides, one of the merges would not have been able to be automatic, so it would have required a merge commit anyway.\n", ":sparkles: :cake: :sparkles:\n\nDude, this is excellent. Thank you.\n\n---\n\nI'll merge this if you change one thing: removing those newlines you added in the middle of a function call to follow PEP8. I hate those :)\n", "@kennethreitz done.\n", "This pull request [passes](http://travis-ci.org/kennethreitz/requests/builds/2164620) (merged a5d462e1 into cb0fdd80).\n", "<3\n" ]
https://api.github.com/repos/psf/requests/issues/790
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/790/labels{/name}
https://api.github.com/repos/psf/requests/issues/790/comments
https://api.github.com/repos/psf/requests/issues/790/events
https://github.com/psf/requests/issues/790
6,305,622
MDU6SXNzdWU2MzA1NjIy
790
oauth post does not work
{ "avatar_url": "https://avatars.githubusercontent.com/u/406779?v=4", "events_url": "https://api.github.com/users/ayanamist/events{/privacy}", "followers_url": "https://api.github.com/users/ayanamist/followers", "following_url": "https://api.github.com/users/ayanamist/following{/other_user}", "gists_url": "https://api.github.com/users/ayanamist/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/ayanamist", "id": 406779, "login": "ayanamist", "node_id": "MDQ6VXNlcjQwNjc3OQ==", "organizations_url": "https://api.github.com/users/ayanamist/orgs", "received_events_url": "https://api.github.com/users/ayanamist/received_events", "repos_url": "https://api.github.com/users/ayanamist/repos", "site_admin": false, "starred_url": "https://api.github.com/users/ayanamist/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/ayanamist/subscriptions", "type": "User", "url": "https://api.github.com/users/ayanamist", "user_view_type": "public" }
[]
closed
true
null
[]
null
8
2012-08-18T14:15:07Z
2021-09-09T06:00:46Z
2012-08-25T14:45:54Z
CONTRIBUTOR
resolved
Since requests can be attached with an auth method, and there is oauth files in the package, so we can pass auth method to requests in order to archive auto auth function. However, the code of oauth is conflicting with current trunk code. Let's see https://github.com/kennethreitz/requests/blob/develop/requests/models.py#L535 So if i pass in a dict object as post data, content-type will be set automatically. Then see here https://github.com/kennethreitz/requests/blob/develop/requests/auth.py#L81 If content-type is set, oauth won't work! It expects signing will be executed by manual operation! Let's summarize all things: Content-Type is set for the existence of non-plain dict object, oauth rejects to work for the existence of content-type. WTF! Either cancel automatically adding content-type or always sign the request without thinking about content-type will finally solve the problem. Plz fix it.
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/790/reactions" }
https://api.github.com/repos/psf/requests/issues/790/timeline
null
completed
null
null
false
[ "So, I know nothing about OAuth, but it looks like we just shouldn't be checking the Content Type header. The OAuth code appears to check for the presence of a file anyway, so it doesn't seem like it matters.\n\nThoughts @kennethreitz?\n", "So nobody cares?\n@kennethreitz has so many activities today.\n", "I'm on the go, but very generally:\n\nIf you're passing in a dict, requests will render the dict as www-form-urlencoded in the HTTP body, and set the appropriate content type. These parameters are taken as input when building the base signing string (http://tools.ietf.org/html/rfc5849#section-3.4.1.3.1), but only if the content-type header is set to \"application/x-www-form-urlencoded\", otherwise the request body is ignored for the purpose of signing.\n\nSince the act of passing a body dict payload in requests is a clear signal of your intention to have form-urlencoded body, the content-type is set automatically.\n\nIf the body is anything but a dict (or a manually-generated, valid x-www-form-urlencoded body), oauth should be ignoring the body for the purposes of signing and should not be setting a content-type (since you're doing something special).\n\nThat's how it should work. If it works any other way, then we need to look into it. \n\nOn Monday, August 20, 2012 at 9:33 AM, 老A wrote:\n\n> So nobody cares?\n> @kennethreitz (https://github.com/kennethreitz) has so many activities today. \n> \n> —\n> Reply to this email directly or view it on GitHub (https://github.com/kennethreitz/requests/issues/790#issuecomment-7861749). \n", "@idan I understand the complete workflow, but the design purpose make all things complicated.\n\nYou can see how kennethreitz/requests use requests, and i agree what they do.\n\nIf i pass the auth to requests, i think requests should do all auth stuffs, but not like current situation, i must manually add oauth signature. If requests needs manual operation, why i pass the auth arguments to it?\n\nPassing dict object as post data parameters is a normal demand, but not doing something special!!! Every developer are doing like this after read your documentation. Passing the auth and thinking auth function will do things automatically is also a normal thought. If i want to do something special, i will do it before pass the whole thing into requests.\n\nThe content-type is set by your code not mine, and the conditional which ignore the post data is also part of your logical but not mine. So what a special thing you think may happen is made by your code but not mine.\n\n> but only if the content-type header is set to \"application/x-www-form-urlencoded\", otherwise the request body is ignored for the purpose of signing.\n\nWhy you ignore to sign? What's the reason? So i must sign the request by myself although i told the requests \"plz do the auth work\"? Does your thought make things simpler or more complicated?\n", "In fact, https://github.com/kennethreitz/requests/blob/develop/requests/models.py#L514 here set content-type to 'application/x-www-form-urlencoded' and if it's not set, it will still be set on https://github.com/kennethreitz/requests/blob/develop/requests/auth.py#L97\nSo you are doing duplicate work and make the whole thing really complicated.\n\nAnd if someone set incorrect content-type(anything other than 'multipart/form-encoded') and post a file, you just let the incorrect thing pass by?\n\nSo what's your root design purpose @idan ? If you think developers will do things special, you should remove the code which add content-type automatically, or remove the content-type detect conditions in order to make signing work.\n", "Relax, @ayanamist, @idan is agreeing with you. He said that the parameters should be taken as input to the signing function only if the `Content-Type` header is `application/x-www-form-urlencoded`. If you pass in a dict, such a header is set, so we should be signing it, but we aren't. **This is a bug.**\n\nAs for \"why is the request body ignored for signing in other cases\", it's because the specification says to ignore it. This isn't Requests' decision, it's just what the specification says to do.\n", "Fixed!\n", "@kennethreitz Thank you very much :-)\n" ]
https://api.github.com/repos/psf/requests/issues/789
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/789/labels{/name}
https://api.github.com/repos/psf/requests/issues/789/comments
https://api.github.com/repos/psf/requests/issues/789/events
https://github.com/psf/requests/pull/789
6,303,234
MDExOlB1bGxSZXF1ZXN0MjA5NDM2NQ==
789
HTTPDigestAuth fixes
{ "avatar_url": "https://avatars.githubusercontent.com/u/2172830?v=4", "events_url": "https://api.github.com/users/zigmonty/events{/privacy}", "followers_url": "https://api.github.com/users/zigmonty/followers", "following_url": "https://api.github.com/users/zigmonty/following{/other_user}", "gists_url": "https://api.github.com/users/zigmonty/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/zigmonty", "id": 2172830, "login": "zigmonty", "node_id": "MDQ6VXNlcjIxNzI4MzA=", "organizations_url": "https://api.github.com/users/zigmonty/orgs", "received_events_url": "https://api.github.com/users/zigmonty/received_events", "repos_url": "https://api.github.com/users/zigmonty/repos", "site_admin": false, "starred_url": "https://api.github.com/users/zigmonty/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/zigmonty/subscriptions", "type": "User", "url": "https://api.github.com/users/zigmonty", "user_view_type": "public" }
[]
closed
true
null
[]
null
3
2012-08-18T05:41:58Z
2021-09-08T16:00:55Z
2012-08-19T00:42:41Z
CONTRIBUTOR
resolved
Fixes issues described in #788. Also extended the digest test case to do two requests with digest auth and check the history length to confirm the second one is zero (ie no second 401).
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/789/reactions" }
https://api.github.com/repos/psf/requests/issues/789/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/789.diff", "html_url": "https://github.com/psf/requests/pull/789", "merged_at": "2012-08-19T00:42:41Z", "patch_url": "https://github.com/psf/requests/pull/789.patch", "url": "https://api.github.com/repos/psf/requests/pulls/789" }
true
[ "This pull request [passes](http://travis-ci.org/kennethreitz/requests/builds/2158977) (merged 6d020360 into cb0fdd80).\n", "This pull request [passes](http://travis-ci.org/kennethreitz/requests/builds/2158981) (merged 6d020360 into cb0fdd80).\n", "This is beautiful. Thanks!\n" ]
https://api.github.com/repos/psf/requests/issues/788
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/788/labels{/name}
https://api.github.com/repos/psf/requests/issues/788/comments
https://api.github.com/repos/psf/requests/issues/788/events
https://github.com/psf/requests/issues/788
6,303,030
MDU6SXNzdWU2MzAzMDMw
788
HTTPDigestAuth doesn't retain credentials
{ "avatar_url": "https://avatars.githubusercontent.com/u/2172830?v=4", "events_url": "https://api.github.com/users/zigmonty/events{/privacy}", "followers_url": "https://api.github.com/users/zigmonty/followers", "following_url": "https://api.github.com/users/zigmonty/following{/other_user}", "gists_url": "https://api.github.com/users/zigmonty/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/zigmonty", "id": 2172830, "login": "zigmonty", "node_id": "MDQ6VXNlcjIxNzI4MzA=", "organizations_url": "https://api.github.com/users/zigmonty/orgs", "received_events_url": "https://api.github.com/users/zigmonty/received_events", "repos_url": "https://api.github.com/users/zigmonty/repos", "site_admin": false, "starred_url": "https://api.github.com/users/zigmonty/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/zigmonty/subscriptions", "type": "User", "url": "https://api.github.com/users/zigmonty", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2012-08-18T04:32:59Z
2021-09-09T06:00:50Z
2012-08-19T04:13:41Z
CONTRIBUTOR
resolved
HTTPDigestAuth always tries to make a request first and only responds with an Authorization header when it receives a 401 (and then promptly forgets). This doesn't match my understanding of how it's supposed to work and doesn't match the behaviour of browsers eg Chrome. The correct behaviour (I believe) is to store the credentials information the server gives you, and send Authorization on all subsequent requests. The old server nonce, etc is reused but the client creates a new cnonce and increments the nonce counter. If the server decides to change its nonce, it will send a new 401. Draft fix is here: 5017aeb06c3893a1e500ae73d7d343b480a9c8c2 I'm storing the state in the HTTPDigestAuth object itself, which made some sort of sense to me. This means you have to reuse the same HTTPDigestAuth in subsequent requests to reuse the credentials.
{ "avatar_url": "https://avatars.githubusercontent.com/u/2172830?v=4", "events_url": "https://api.github.com/users/zigmonty/events{/privacy}", "followers_url": "https://api.github.com/users/zigmonty/followers", "following_url": "https://api.github.com/users/zigmonty/following{/other_user}", "gists_url": "https://api.github.com/users/zigmonty/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/zigmonty", "id": 2172830, "login": "zigmonty", "node_id": "MDQ6VXNlcjIxNzI4MzA=", "organizations_url": "https://api.github.com/users/zigmonty/orgs", "received_events_url": "https://api.github.com/users/zigmonty/received_events", "repos_url": "https://api.github.com/users/zigmonty/repos", "site_admin": false, "starred_url": "https://api.github.com/users/zigmonty/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/zigmonty/subscriptions", "type": "User", "url": "https://api.github.com/users/zigmonty", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/788/reactions" }
https://api.github.com/repos/psf/requests/issues/788/timeline
null
completed
null
null
false
[ "Sorry, should mention that there are two commits here. The previous one is 53d454c8137e3c4863d7c1ecef8e3664f399f883 on which i based the one above.\n\nThe purpose of that was to get the digest handler to release the connection with the 401 before it reconnects. I was having deadlocks when forcing requests to only open a single outbound connection using the code below because the original connection was still open. The same technique is used by requests when handling redirects.\n\n``` python\nclass MySession(requests.Session):\n def init_poolmanager(self):\n self.poolmanager = PoolManager(num_pools=2,maxsize=1,block=True)\n```\n" ]
https://api.github.com/repos/psf/requests/issues/787
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/787/labels{/name}
https://api.github.com/repos/psf/requests/issues/787/comments
https://api.github.com/repos/psf/requests/issues/787/events
https://github.com/psf/requests/pull/787
6,286,271
MDExOlB1bGxSZXF1ZXN0MjA4NTk1Nw==
787
"There many ..." to "There are many ..." in quickstart
{ "avatar_url": "https://avatars.githubusercontent.com/u/1530877?v=4", "events_url": "https://api.github.com/users/kayzhu/events{/privacy}", "followers_url": "https://api.github.com/users/kayzhu/followers", "following_url": "https://api.github.com/users/kayzhu/following{/other_user}", "gists_url": "https://api.github.com/users/kayzhu/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kayzhu", "id": 1530877, "login": "kayzhu", "node_id": "MDQ6VXNlcjE1MzA4Nzc=", "organizations_url": "https://api.github.com/users/kayzhu/orgs", "received_events_url": "https://api.github.com/users/kayzhu/received_events", "repos_url": "https://api.github.com/users/kayzhu/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kayzhu/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kayzhu/subscriptions", "type": "User", "url": "https://api.github.com/users/kayzhu", "user_view_type": "public" }
[]
closed
true
null
[]
null
3
2012-08-17T10:16:02Z
2021-09-08T16:00:54Z
2012-08-17T20:47:47Z
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/787/reactions" }
https://api.github.com/repos/psf/requests/issues/787/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/787.diff", "html_url": "https://github.com/psf/requests/pull/787", "merged_at": "2012-08-17T20:47:47Z", "patch_url": "https://github.com/psf/requests/pull/787.patch", "url": "https://api.github.com/repos/psf/requests/pulls/787" }
true
[ "This pull request [passes](http://travis-ci.org/kennethreitz/requests/builds/2150797) (merged 76f90054 into 4130cf9b).\n", "This pull request [passes](http://travis-ci.org/kennethreitz/requests/builds/2150801) (merged 76f90054 into 4130cf9b).\n", "Thanks!\n" ]
https://api.github.com/repos/psf/requests/issues/786
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/786/labels{/name}
https://api.github.com/repos/psf/requests/issues/786/comments
https://api.github.com/repos/psf/requests/issues/786/events
https://github.com/psf/requests/pull/786
6,276,867
MDExOlB1bGxSZXF1ZXN0MjA4MjE4OQ==
786
Lint fixes following PEP8.
{ "avatar_url": "https://avatars.githubusercontent.com/u/542728?v=4", "events_url": "https://api.github.com/users/dicato/events{/privacy}", "followers_url": "https://api.github.com/users/dicato/followers", "following_url": "https://api.github.com/users/dicato/following{/other_user}", "gists_url": "https://api.github.com/users/dicato/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/dicato", "id": 542728, "login": "dicato", "node_id": "MDQ6VXNlcjU0MjcyOA==", "organizations_url": "https://api.github.com/users/dicato/orgs", "received_events_url": "https://api.github.com/users/dicato/received_events", "repos_url": "https://api.github.com/users/dicato/repos", "site_admin": false, "starred_url": "https://api.github.com/users/dicato/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/dicato/subscriptions", "type": "User", "url": "https://api.github.com/users/dicato", "user_view_type": "public" }
[]
closed
true
null
[]
null
4
2012-08-16T22:14:11Z
2021-09-08T16:00:53Z
2012-08-17T20:57:01Z
CONTRIBUTOR
resolved
These are generally only whitespace fixes. I excluded the `packages` directory for now. Let me know if you want that code cleaned up also. I can do other PEP8 fixes if interested; unused imports, one import per line for different modules, etc. =)
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/786/reactions" }
https://api.github.com/repos/psf/requests/issues/786/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/786.diff", "html_url": "https://github.com/psf/requests/pull/786", "merged_at": "2012-08-17T20:57:01Z", "patch_url": "https://github.com/psf/requests/pull/786.patch", "url": "https://api.github.com/repos/psf/requests/pulls/786" }
true
[ "This pull request [passes](http://travis-ci.org/kennethreitz/requests/builds/2146435) (merged 42d0a216 into 4130cf9b).\n", "This pull request [passes](http://travis-ci.org/kennethreitz/requests/builds/2146439) (merged 42d0a216 into 4130cf9b).\n", "Excluding `packages` is correct, those are brought in from their respective projects.\n", "Thanks for the attention detail. This is fantastic :)\n" ]
https://api.github.com/repos/psf/requests/issues/785
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/785/labels{/name}
https://api.github.com/repos/psf/requests/issues/785/comments
https://api.github.com/repos/psf/requests/issues/785/events
https://github.com/psf/requests/issues/785
6,276,480
MDU6SXNzdWU2Mjc2NDgw
785
Allow lists in the dict values of the hooks argument
{ "avatar_url": "https://avatars.githubusercontent.com/u/146720?v=4", "events_url": "https://api.github.com/users/flub/events{/privacy}", "followers_url": "https://api.github.com/users/flub/followers", "following_url": "https://api.github.com/users/flub/following{/other_user}", "gists_url": "https://api.github.com/users/flub/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/flub", "id": 146720, "login": "flub", "node_id": "MDQ6VXNlcjE0NjcyMA==", "organizations_url": "https://api.github.com/users/flub/orgs", "received_events_url": "https://api.github.com/users/flub/received_events", "repos_url": "https://api.github.com/users/flub/repos", "site_admin": false, "starred_url": "https://api.github.com/users/flub/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/flub/subscriptions", "type": "User", "url": "https://api.github.com/users/flub", "user_view_type": "public" }
[ { "color": "e102d8", "default": false, "description": null, "id": 117745, "name": "Planned", "node_id": "MDU6TGFiZWwxMTc3NDU=", "url": "https://api.github.com/repos/psf/requests/labels/Planned" } ]
closed
true
null
[]
null
5
2012-08-16T21:57:19Z
2021-09-09T06:00:43Z
2012-09-23T01:49:20Z
NONE
resolved
Currently the Request class has a .register_hook() method but it parses the dictionary it expects from it's hooks argument weirdly: the argument can only specify one hook function per hook. If you pass in a list of hook functions per hook the code in Request.**init**() will wrap the list in a list which then fails when the hooks are consumed (since a list is not callable). This is especially annoying since you can not use multiple hooks from a session. The only way to get multiple hooks now is to create the request object without sending it, then call .register_hook() multiple times and then finally call .send(). This would all be much easier if Request.**init**() parsed the hooks parameter in a way that it accepts lists as it's values.
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/785/reactions" }
https://api.github.com/repos/psf/requests/issues/785/timeline
null
completed
null
null
false
[ "If anyone OKs this feature request, I'd be happy to dig into it.\n", "@sigmavirus24 :+1:\n", "Just need to make sure that the current workflow also continues to work with this change.\n", "Once @kennethreitz has time to review #833, I'll start working on this. I have a feeling opening a branch for this would cause a merge conflict if I were to have two Pull Requests that are ignorant of each other for the same file. Could be wrong though. Also, I'm in no rush since I'm fairly busy and I know @kennethreitz is more busy than I am with conferences and whatnot. Just wanted to keep @flub updated.\n", "I'm going to start work on this Friday at the earliest.\n" ]
https://api.github.com/repos/psf/requests/issues/784
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/784/labels{/name}
https://api.github.com/repos/psf/requests/issues/784/comments
https://api.github.com/repos/psf/requests/issues/784/events
https://github.com/psf/requests/pull/784
6,274,322
MDExOlB1bGxSZXF1ZXN0MjA4MDgyNg==
784
Change variable '_r' to 'r' for consistency.
{ "avatar_url": "https://avatars.githubusercontent.com/u/542728?v=4", "events_url": "https://api.github.com/users/dicato/events{/privacy}", "followers_url": "https://api.github.com/users/dicato/followers", "following_url": "https://api.github.com/users/dicato/following{/other_user}", "gists_url": "https://api.github.com/users/dicato/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/dicato", "id": 542728, "login": "dicato", "node_id": "MDQ6VXNlcjU0MjcyOA==", "organizations_url": "https://api.github.com/users/dicato/orgs", "received_events_url": "https://api.github.com/users/dicato/received_events", "repos_url": "https://api.github.com/users/dicato/repos", "site_admin": false, "starred_url": "https://api.github.com/users/dicato/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/dicato/subscriptions", "type": "User", "url": "https://api.github.com/users/dicato", "user_view_type": "public" }
[]
closed
true
null
[]
null
13
2012-08-16T20:26:44Z
2021-09-08T23:01:11Z
2012-08-17T20:59:29Z
CONTRIBUTOR
resolved
I don't think there is a reason for the leading underscore in this section of documentation, but if there is, this pull request can be ignored, or used to clarify the documentation.
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/784/reactions" }
https://api.github.com/repos/psf/requests/issues/784/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/784.diff", "html_url": "https://github.com/psf/requests/pull/784", "merged_at": "2012-08-17T20:59:29Z", "patch_url": "https://github.com/psf/requests/pull/784.patch", "url": "https://api.github.com/repos/psf/requests/pulls/784" }
true
[ "This pull request [passes](http://travis-ci.org/kennethreitz/requests/builds/2145448) (merged ff55d737 into 4130cf9b).\n", "This pull request [passes](http://travis-ci.org/kennethreitz/requests/builds/2145452) (merged ff55d737 into 4130cf9b).\n", "Ooh, this one I can explain!\n\nThe intent is that you can walk through the quickstart documentation and get the same results. The purpose of the underscore was so that the user wouldn't clobber the previous `r` variable when they reached this part of the documentation. You'll notice that after the block with `_r`, we immediately call `r.raise_for_status()`. If we'd used `r` in the section we used `_r`, the second `raise_for_status()` call would also throw an exception, which would be no good.\n\nYou can certainly use a different variable name than `_r`, but it shouldn't be `r`.\n", "That's reasonable. My brain immediately thought \"are they implying something about this instance being private?\", which did not make sense. Want me to rename to something else, `bad_r`, or leave it be? \n", "I'm happy for it to be named something else, `bad_r` would do great. =) You're quite right, I did violate a Python convention with that name, so it _should_ be changed.\n", "This pull request [passes](http://travis-ci.org/kennethreitz/requests/builds/2145708) (merged b9d3ce2e into 4130cf9b).\n", "Done! Let me know if that works for you.\n", "I like it. =) I don't accept Pull Requests, that's Kenneth's job, but this should be good to go.\n\nThanks!\n", "Your very welcome. On a different note, my sublimetext setup strips trailing whitespace, would you like me to do that for all the docs (in this same pull request, or a separate)?\n", "There's no reason to keep it. By all means remove it as part of this pull request. =)\n", "What's funny is, I started using SublimeText2 with the linter plugin due to Kenneth's blog post about it. =)\n", "This pull request [passes](http://travis-ci.org/kennethreitz/requests/builds/2145886) (merged b31a4399 into 4130cf9b).\n", "Fantastic, thanks! :cake:\n" ]
https://api.github.com/repos/psf/requests/issues/783
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/783/labels{/name}
https://api.github.com/repos/psf/requests/issues/783/comments
https://api.github.com/repos/psf/requests/issues/783/events
https://github.com/psf/requests/pull/783
6,273,185
MDExOlB1bGxSZXF1ZXN0MjA4MDIwOA==
783
add .show() to Response
{ "avatar_url": "https://avatars.githubusercontent.com/u/1636347?v=4", "events_url": "https://api.github.com/users/doda-zz/events{/privacy}", "followers_url": "https://api.github.com/users/doda-zz/followers", "following_url": "https://api.github.com/users/doda-zz/following{/other_user}", "gists_url": "https://api.github.com/users/doda-zz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/doda-zz", "id": 1636347, "login": "doda-zz", "node_id": "MDQ6VXNlcjE2MzYzNDc=", "organizations_url": "https://api.github.com/users/doda-zz/orgs", "received_events_url": "https://api.github.com/users/doda-zz/received_events", "repos_url": "https://api.github.com/users/doda-zz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/doda-zz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/doda-zz/subscriptions", "type": "User", "url": "https://api.github.com/users/doda-zz", "user_view_type": "public" }
[]
closed
true
null
[]
null
4
2012-08-16T19:36:35Z
2021-09-08T23:07:14Z
2012-08-16T19:59:20Z
NONE
resolved
i find this very handy while figuring out how to call into an API (especially the ones made for humans). Thoughts on adding something like this into requests?
{ "avatar_url": "https://avatars.githubusercontent.com/u/1636347?v=4", "events_url": "https://api.github.com/users/doda-zz/events{/privacy}", "followers_url": "https://api.github.com/users/doda-zz/followers", "following_url": "https://api.github.com/users/doda-zz/following{/other_user}", "gists_url": "https://api.github.com/users/doda-zz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/doda-zz", "id": 1636347, "login": "doda-zz", "node_id": "MDQ6VXNlcjE2MzYzNDc=", "organizations_url": "https://api.github.com/users/doda-zz/orgs", "received_events_url": "https://api.github.com/users/doda-zz/received_events", "repos_url": "https://api.github.com/users/doda-zz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/doda-zz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/doda-zz/subscriptions", "type": "User", "url": "https://api.github.com/users/doda-zz", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/783/reactions" }
https://api.github.com/repos/psf/requests/issues/783/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/783.diff", "html_url": "https://github.com/psf/requests/pull/783", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/783.patch", "url": "https://api.github.com/repos/psf/requests/pulls/783" }
true
[ "Obviously, whether this gets pulled is up to @kennethreitz, but I would suspect that answer will be that it won't be.\n\nRequests is not intended for formatting or displaying data, but for obtaining it. Even the `Response.json` method only really exists as a courtesy, with any fault-tolerant JSON handling being done by the end user (see #691). Requests generally does not deal with the data beyond decoding the response and handing it back to the programmer.\n\nAs @kennethreitz [has said before](https://github.com/kennethreitz/requests/issues/769#issuecomment-7622419), Requests is an HTTP library, not anything else. This is **not** my decision, but I think it's likely that the answer will be that this pull request is not accepted. Don't take my word for it though, wait for Kenneth to look at it. I might be talking total rubbish. =)\n", "haha i might as well close this then, thanks\n", "It's totally up to you, but if I it were me I'd wait for Kenneth's word on it. This is his baby, not mine. =)\n", "@doda @Lukasa I agree :)\n" ]
https://api.github.com/repos/psf/requests/issues/782
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/782/labels{/name}
https://api.github.com/repos/psf/requests/issues/782/comments
https://api.github.com/repos/psf/requests/issues/782/events
https://github.com/psf/requests/issues/782
6,267,825
MDU6SXNzdWU2MjY3ODI1
782
dispatch_hook eats exceptions
{ "avatar_url": "https://avatars.githubusercontent.com/u/101894?v=4", "events_url": "https://api.github.com/users/lucian1900/events{/privacy}", "followers_url": "https://api.github.com/users/lucian1900/followers", "following_url": "https://api.github.com/users/lucian1900/following{/other_user}", "gists_url": "https://api.github.com/users/lucian1900/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/lucian1900", "id": 101894, "login": "lucian1900", "node_id": "MDQ6VXNlcjEwMTg5NA==", "organizations_url": "https://api.github.com/users/lucian1900/orgs", "received_events_url": "https://api.github.com/users/lucian1900/received_events", "repos_url": "https://api.github.com/users/lucian1900/repos", "site_admin": false, "starred_url": "https://api.github.com/users/lucian1900/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/lucian1900/subscriptions", "type": "User", "url": "https://api.github.com/users/lucian1900", "user_view_type": "public" }
[]
closed
true
null
[]
null
9
2012-08-16T15:47:30Z
2021-09-09T06:00:45Z
2012-08-25T15:06:38Z
CONTRIBUTOR
resolved
I tried to signal failures in a hook via exceptions, but all I got was two tracebacks printed. This happens because `dispatch_hook` catches `Exception`. https://github.com/kennethreitz/requests/blob/develop/requests/hooks.py#L50 It seems to me like that's a bad idea.
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/782/reactions" }
https://api.github.com/repos/psf/requests/issues/782/timeline
null
completed
null
null
false
[ "This is intentional, but is certainly work reconsidering now :)\n", "Out of interest, what was the reasoning behind the decision?\n", "I'm trying to recall :)\n\nI believe I was under the impression that people would be writing all kinds of hooks and that if one failed, your request should still go through. For example, our cookie parsing used to be quite problematic, so instead of just halting when there was an issue with it, it would raise an error and carry on.\n\n---\n\nI see little value/purpose in this today, so I'm +1 on removing the suppression, unless anyone objects.\n", "Fair enough.\n\nShould be an easy fix. =)\n", "@Lukasa want to send a pull request? :)\n", "Happy to. Will save me from writing Objective-C as a bonus. =)\n", "I have one here https://github.com/kennethreitz/requests/pull/811. Not sure how I could get github to link it here.\n", "Just got to mention it in a comment, like this: #811. Looks good!\n", "Thanks!\n" ]
https://api.github.com/repos/psf/requests/issues/781
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/781/labels{/name}
https://api.github.com/repos/psf/requests/issues/781/comments
https://api.github.com/repos/psf/requests/issues/781/events
https://github.com/psf/requests/pull/781
6,258,140
MDExOlB1bGxSZXF1ZXN0MjA3Mjk3NQ==
781
permissive implementation of iter_content
{ "avatar_url": "https://avatars.githubusercontent.com/u/376448?v=4", "events_url": "https://api.github.com/users/slingamn/events{/privacy}", "followers_url": "https://api.github.com/users/slingamn/followers", "following_url": "https://api.github.com/users/slingamn/following{/other_user}", "gists_url": "https://api.github.com/users/slingamn/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/slingamn", "id": 376448, "login": "slingamn", "node_id": "MDQ6VXNlcjM3NjQ0OA==", "organizations_url": "https://api.github.com/users/slingamn/orgs", "received_events_url": "https://api.github.com/users/slingamn/received_events", "repos_url": "https://api.github.com/users/slingamn/repos", "site_admin": false, "starred_url": "https://api.github.com/users/slingamn/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/slingamn/subscriptions", "type": "User", "url": "https://api.github.com/users/slingamn", "user_view_type": "public" }
[ { "color": "e102d8", "default": false, "description": null, "id": 117745, "name": "Planned", "node_id": "MDU6TGFiZWwxMTc3NDU=", "url": "https://api.github.com/repos/psf/requests/labels/Planned" }, { "color": "0b02e1", "default": false, "description": null, "id": 191274, "name": "Contributor Friendly", "node_id": "MDU6TGFiZWwxOTEyNzQ=", "url": "https://api.github.com/repos/psf/requests/labels/Contributor%20Friendly" } ]
closed
true
null
[]
null
6
2012-08-16T07:11:56Z
2021-09-08T16:00:53Z
2012-09-02T08:44:20Z
CONTRIBUTOR
resolved
This allows iter_content and iter_lines to succeed without crashing even after the response content has been fetched (iter_content gives you a one-item iterator containing the content). It should mitigate the API break I introduced in #760 (as discussed on #775 and #597).
{ "avatar_url": "https://avatars.githubusercontent.com/u/376448?v=4", "events_url": "https://api.github.com/users/slingamn/events{/privacy}", "followers_url": "https://api.github.com/users/slingamn/followers", "following_url": "https://api.github.com/users/slingamn/following{/other_user}", "gists_url": "https://api.github.com/users/slingamn/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/slingamn", "id": 376448, "login": "slingamn", "node_id": "MDQ6VXNlcjM3NjQ0OA==", "organizations_url": "https://api.github.com/users/slingamn/orgs", "received_events_url": "https://api.github.com/users/slingamn/received_events", "repos_url": "https://api.github.com/users/slingamn/repos", "site_admin": false, "starred_url": "https://api.github.com/users/slingamn/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/slingamn/subscriptions", "type": "User", "url": "https://api.github.com/users/slingamn", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/781/reactions" }
https://api.github.com/repos/psf/requests/issues/781/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/781.diff", "html_url": "https://github.com/psf/requests/pull/781", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/781.patch", "url": "https://api.github.com/repos/psf/requests/pulls/781" }
true
[ "This pull request [passes](http://travis-ci.org/kennethreitz/requests/builds/2139018) (merged 4095a9f3 into 4130cf9b).\n", "This pull request [passes](http://travis-ci.org/kennethreitz/requests/builds/2139022) (merged 4095a9f3 into 4130cf9b).\n", "Hmm, this is an interesting fix. \n\nWhy would we return everything at once instead of spitting up the response as if it wasn't downloaded already?\n", "Hmm, as in, it would be better to split it into strings of length `chunk_size` (currently 1 byte by default)?\n\nBasically, I like this for simplicity, and because generally when you specify a read size it is understood to be only a hint. (Although typically when your hint is not respected, it's because you're getting less data than you asked for, not more as in this patch.) Anyone who specifies a chunk size of, say, 10, and then expects to get exactly 10 bytes back each time is in trouble already, because the final segment of the page may have fewer than 10 bytes in it.\n\nI'm not totally sure.\n", "Thoughts? If you think `iter_content` should always return strings of length <= `chunk_size`, I can definitely do it that way.\n", "@slingamn if you do that, I'll accept it :)\n" ]
https://api.github.com/repos/psf/requests/issues/780
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/780/labels{/name}
https://api.github.com/repos/psf/requests/issues/780/comments
https://api.github.com/repos/psf/requests/issues/780/events
https://github.com/psf/requests/pull/780
6,253,838
MDExOlB1bGxSZXF1ZXN0MjA3MTEzOA==
780
minor cleanup
{ "avatar_url": "https://avatars.githubusercontent.com/u/97695?v=4", "events_url": "https://api.github.com/users/jwagenleitner/events{/privacy}", "followers_url": "https://api.github.com/users/jwagenleitner/followers", "following_url": "https://api.github.com/users/jwagenleitner/following{/other_user}", "gists_url": "https://api.github.com/users/jwagenleitner/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/jwagenleitner", "id": 97695, "login": "jwagenleitner", "node_id": "MDQ6VXNlcjk3Njk1", "organizations_url": "https://api.github.com/users/jwagenleitner/orgs", "received_events_url": "https://api.github.com/users/jwagenleitner/received_events", "repos_url": "https://api.github.com/users/jwagenleitner/repos", "site_admin": false, "starred_url": "https://api.github.com/users/jwagenleitner/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/jwagenleitner/subscriptions", "type": "User", "url": "https://api.github.com/users/jwagenleitner", "user_view_type": "public" }
[]
closed
true
null
[]
null
5
2012-08-15T23:31:56Z
2021-09-08T16:00:52Z
2012-09-11T03:07:09Z
NONE
resolved
Very minor change, but thought I'd submit anyway. Figured 3 less LOC might be considered a contribution. :)
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/780/reactions" }
https://api.github.com/repos/psf/requests/issues/780/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/780.diff", "html_url": "https://github.com/psf/requests/pull/780", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/780.patch", "url": "https://api.github.com/repos/psf/requests/pulls/780" }
true
[ "This pull request [passes](http://travis-ci.org/kennethreitz/requests/builds/2136498) (merged 025d0a73 into 4130cf9b).\n", "This pull request [passes](http://travis-ci.org/kennethreitz/requests/builds/2136502) (merged 025d0a73 into 4130cf9b).\n", "This pull request [fails](http://travis-ci.org/kennethreitz/requests/builds/2180815) (merged cc5a6305 into 4889adce).\n", "(closed/opened to retrigger build)\n", "This pull request [passes](http://travis-ci.org/kennethreitz/requests/builds/2256427) (merged c72071c1 into b9ecf456).\n" ]
https://api.github.com/repos/psf/requests/issues/779
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/779/labels{/name}
https://api.github.com/repos/psf/requests/issues/779/comments
https://api.github.com/repos/psf/requests/issues/779/events
https://github.com/psf/requests/pull/779
6,245,500
MDExOlB1bGxSZXF1ZXN0MjA2NzAwNw==
779
Make sure proxy exclusions work properly.
{ "avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4", "events_url": "https://api.github.com/users/Lukasa/events{/privacy}", "followers_url": "https://api.github.com/users/Lukasa/followers", "following_url": "https://api.github.com/users/Lukasa/following{/other_user}", "gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Lukasa", "id": 1382556, "login": "Lukasa", "node_id": "MDQ6VXNlcjEzODI1NTY=", "organizations_url": "https://api.github.com/users/Lukasa/orgs", "received_events_url": "https://api.github.com/users/Lukasa/received_events", "repos_url": "https://api.github.com/users/Lukasa/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions", "type": "User", "url": "https://api.github.com/users/Lukasa", "user_view_type": "public" }
[]
closed
true
null
[]
null
3
2012-08-15T17:20:03Z
2021-09-08T16:00:53Z
2012-08-19T00:40:53Z
MEMBER
resolved
This should fix the issue in #776. Any unit test for this problem requires either the existence of a proxy to test against or the using of some pretty gnarly test hooks. You want it anyway?
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/779/reactions" }
https://api.github.com/repos/psf/requests/issues/779/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/779.diff", "html_url": "https://github.com/psf/requests/pull/779", "merged_at": "2012-08-19T00:40:53Z", "patch_url": "https://github.com/psf/requests/pull/779.patch", "url": "https://api.github.com/repos/psf/requests/pulls/779" }
true
[ "This pull request [passes](http://travis-ci.org/kennethreitz/requests/builds/2132558) (merged 00b4ca3b into 4130cf9b).\n", "This pull request [passes](http://travis-ci.org/kennethreitz/requests/builds/2132562) (merged 00b4ca3b into 4130cf9b).\n", "Thanks!\n" ]
https://api.github.com/repos/psf/requests/issues/778
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/778/labels{/name}
https://api.github.com/repos/psf/requests/issues/778/comments
https://api.github.com/repos/psf/requests/issues/778/events
https://github.com/psf/requests/issues/778
6,230,442
MDU6SXNzdWU2MjMwNDQy
778
POST file tests fail when run from byte code (.pyc)
{ "avatar_url": "https://avatars.githubusercontent.com/u/447371?v=4", "events_url": "https://api.github.com/users/randomir/events{/privacy}", "followers_url": "https://api.github.com/users/randomir/followers", "following_url": "https://api.github.com/users/randomir/following{/other_user}", "gists_url": "https://api.github.com/users/randomir/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/randomir", "id": 447371, "login": "randomir", "node_id": "MDQ6VXNlcjQ0NzM3MQ==", "organizations_url": "https://api.github.com/users/randomir/orgs", "received_events_url": "https://api.github.com/users/randomir/received_events", "repos_url": "https://api.github.com/users/randomir/repos", "site_admin": false, "starred_url": "https://api.github.com/users/randomir/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/randomir/subscriptions", "type": "User", "url": "https://api.github.com/users/randomir", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2012-08-14T23:48:24Z
2021-09-09T06:00:45Z
2012-08-25T14:53:47Z
CONTRIBUTOR
resolved
Four test methods in `test_requests.pyc` fail: ``` test_POSTBIN_GET_POST_FILES test_POSTBIN_GET_POST_FILES_STRINGS test_POSTBIN_GET_POST_FILES_WITH_HEADERS test_POSTBIN_GET_POST_FILES_WITH_PARAMS ``` due to http://httpbin.org/post returning 500. All 4 methods, at some point, send the running script (file) as the POST data. Tests pass when `test_requests.py` is run for the first time (and ascii sent), but fail the next and every other time, when python byte code (`test_requests.pyc`) exists and is run (binary file sent). As it seems, the culprit is `httpbin` itself, which fails when raw binary data is sent to the `/post` endpoint. I submitted the [patch](https://github.com/kennethreitz/httpbin/pull/60) that should fix this issue, but I'm also documenting it here, just in case someone else runs into the same problem.
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/778/reactions" }
https://api.github.com/repos/psf/requests/issues/778/timeline
null
completed
null
null
false
[ "Yeah I'd been seeing this occasionally so I got into the habit of just running `make clean && make travis`\n", "HTTPbin is fixed for this now. \n\nIn genreal though, I advocate the use of `PYTHONDONTWRITEBYTECODE`\n" ]
https://api.github.com/repos/psf/requests/issues/777
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/777/labels{/name}
https://api.github.com/repos/psf/requests/issues/777/comments
https://api.github.com/repos/psf/requests/issues/777/events
https://github.com/psf/requests/pull/777
6,229,910
MDExOlB1bGxSZXF1ZXN0MjA2MDA2NQ==
777
minor (`make test` fix for second run)
{ "avatar_url": "https://avatars.githubusercontent.com/u/447371?v=4", "events_url": "https://api.github.com/users/randomir/events{/privacy}", "followers_url": "https://api.github.com/users/randomir/followers", "following_url": "https://api.github.com/users/randomir/following{/other_user}", "gists_url": "https://api.github.com/users/randomir/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/randomir", "id": 447371, "login": "randomir", "node_id": "MDQ6VXNlcjQ0NzM3MQ==", "organizations_url": "https://api.github.com/users/randomir/orgs", "received_events_url": "https://api.github.com/users/randomir/received_events", "repos_url": "https://api.github.com/users/randomir/repos", "site_admin": false, "starred_url": "https://api.github.com/users/randomir/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/randomir/subscriptions", "type": "User", "url": "https://api.github.com/users/randomir", "user_view_type": "public" }
[]
closed
true
null
[]
null
3
2012-08-14T23:13:40Z
2021-09-08T16:00:52Z
2012-08-19T00:41:23Z
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/777/reactions" }
https://api.github.com/repos/psf/requests/issues/777/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/777.diff", "html_url": "https://github.com/psf/requests/pull/777", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/777.patch", "url": "https://api.github.com/repos/psf/requests/pulls/777" }
true
[ "This pull request [passes](http://travis-ci.org/kennethreitz/requests/builds/2125110) (merged e797a29a into 4130cf9b).\n", "This pull request [passes](http://travis-ci.org/kennethreitz/requests/builds/2125114) (merged e797a29a into 4130cf9b).\n", "Thanks :)\n" ]
https://api.github.com/repos/psf/requests/issues/776
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/776/labels{/name}
https://api.github.com/repos/psf/requests/issues/776/comments
https://api.github.com/repos/psf/requests/issues/776/events
https://github.com/psf/requests/issues/776
6,192,782
MDU6SXNzdWU2MTkyNzgy
776
no_proxy handling doesn't account for port in URL
{ "avatar_url": "https://avatars.githubusercontent.com/u/26976?v=4", "events_url": "https://api.github.com/users/Pewpewarrows/events{/privacy}", "followers_url": "https://api.github.com/users/Pewpewarrows/followers", "following_url": "https://api.github.com/users/Pewpewarrows/following{/other_user}", "gists_url": "https://api.github.com/users/Pewpewarrows/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Pewpewarrows", "id": 26976, "login": "Pewpewarrows", "node_id": "MDQ6VXNlcjI2OTc2", "organizations_url": "https://api.github.com/users/Pewpewarrows/orgs", "received_events_url": "https://api.github.com/users/Pewpewarrows/received_events", "repos_url": "https://api.github.com/users/Pewpewarrows/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Pewpewarrows/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Pewpewarrows/subscriptions", "type": "User", "url": "https://api.github.com/users/Pewpewarrows", "user_view_type": "public" }
[]
closed
true
null
[]
null
4
2012-08-13T15:12:44Z
2021-09-09T06:00:50Z
2012-08-19T10:33:11Z
NONE
resolved
On https://github.com/kennethreitz/requests/blob/develop/requests/models.py#L556 ``` python if proxy and not any(map(_p.netloc.endswith, no_proxy)): ``` I don't believe `_p.netloc.endswith` is the correct way to check if the hostname is in the `$no_proxy` ENV variable (or `proxies` dict param). If the URL passed to requests contains a port, then `netloc` will look like `127.0.0.1:8000`, which will incorrectly fail to exempt `127.0.0.1` from the proxy. I'd submit a pull request, but the test suite doesn't play nicely with the proxy I'm behind to begin with. It should be as simple as replacing: `_p.netloc.endswith` with: `_p.netloc.split(':')[0].endswith` But I don't know if you want to account for more complex scenarios.
{ "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/776/reactions" }
https://api.github.com/repos/psf/requests/issues/776/timeline
null
completed
null
null
false
[ "Splitting on the colon is an accident waiting to happen: the [relevant RFC](http://pretty-rfc.herokuapp.com/RFC3986) seems to indicate that you are allowed additional colons in the `netloc` section returned by urlparse. It might be better to use the `urlparse(url).hostname` method on the original URL, e.g.:\n\n``` python\n>>> from urlparse import urlparse\n>>> urlparse('//127.0.0.1:8000').hostname\n'127.0.0.1'\n```\n\nThere's probably a bit of a perf hit for hitting urlparse twice. Not too bad though.\n", "@Lukasa It appears that `hostname` is already available on `_p`, from the previous `urlparse()`.\n\nSo `_p.hostname.endswith` should be the new callable to pass to `map`, in my opinion.\n", "Good spot, you're quite right.\n\nIf you want to file a pull request, go ahead, TravisCI will run tests against it for you. If you don't want to, I'm sure someone will be happy to write it on your behalf.\n", "Resolved by #779.\n" ]
https://api.github.com/repos/psf/requests/issues/775
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/775/labels{/name}
https://api.github.com/repos/psf/requests/issues/775/comments
https://api.github.com/repos/psf/requests/issues/775/events
https://github.com/psf/requests/issues/775
6,188,800
MDU6SXNzdWU2MTg4ODAw
775
Content marked as consumed in 0.13.6
{ "avatar_url": "https://avatars.githubusercontent.com/u/208316?v=4", "events_url": "https://api.github.com/users/davechallis/events{/privacy}", "followers_url": "https://api.github.com/users/davechallis/followers", "following_url": "https://api.github.com/users/davechallis/following{/other_user}", "gists_url": "https://api.github.com/users/davechallis/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/davechallis", "id": 208316, "login": "davechallis", "node_id": "MDQ6VXNlcjIwODMxNg==", "organizations_url": "https://api.github.com/users/davechallis/orgs", "received_events_url": "https://api.github.com/users/davechallis/received_events", "repos_url": "https://api.github.com/users/davechallis/repos", "site_admin": false, "starred_url": "https://api.github.com/users/davechallis/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/davechallis/subscriptions", "type": "User", "url": "https://api.github.com/users/davechallis", "user_view_type": "public" }
[]
closed
true
null
[]
null
4
2012-08-13T12:21:40Z
2021-09-09T06:00:51Z
2012-08-13T12:42:29Z
NONE
resolved
Content is immediately marked as consumed in 0.13.6, causing calls to e.g. response.iter_content() to throw an error. Test code (tested with python 2.6): ``` import requests r = requests.get('http://docs.python-requests.org/') if r._content_consumed: print 'consumed' else: print 'not consumed' ``` In 0.13.5 this prints: not consumed In 0.13.6 this prints: consumed
{ "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/775/reactions" }
https://api.github.com/repos/psf/requests/issues/775/timeline
null
completed
null
null
false
[ "This is a known bug in 0.13.6, and was resolved by #764. If you need immediately to fix the problem you can do one of the following: clone the development branch in its current state, use 0.13.6 with the patch from #764 applied, or wait until the next minor version is released, which will include the fix.\n", "I think to some extent, this is an API change rather than a bug. In 0.13.6, the default value of prefetch changed from False to True. Thus, unless you explicitly pass `prefetch=False`, calls to `iter_content` will throw exceptions even in develop:\n\n```\n>>> import requests\n>>> r = requests.get('http://docs.python-requests.org/')\n>>> list(r.iter_content())\nTraceback (most recent call last):\n File \"<stdin>\", line 1, in <module>\n File \"requests/models.py\", line 752, in iter_content\n 'The content for this response was already consumed'\nRuntimeError: The content for this response was already consumed\n```\n\nThe rationale for this change is at #520. Basically, without making this change, it was difficult to guarantee that Requests would not leak sockets.\n", "Thanks, that helps a lot, downgrading to 0.13.5 and explicitly setting prefetch=False for the next release should work for me.\n", "Thanks for understanding. I didn't anticipate this problem when I changed the default, unfortunately.\n\n@kennethreitz maybe `iter_content` and `iter_lines` should still work after the content is fetched, for example, `iter_content` could return an iterator containing a single item, the entire response body?\n" ]
https://api.github.com/repos/psf/requests/issues/774
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/774/labels{/name}
https://api.github.com/repos/psf/requests/issues/774/comments
https://api.github.com/repos/psf/requests/issues/774/events
https://github.com/psf/requests/pull/774
6,157,081
MDExOlB1bGxSZXF1ZXN0MjAyOTA4MQ==
774
Throw clear exceptions
{ "avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4", "events_url": "https://api.github.com/users/Lukasa/events{/privacy}", "followers_url": "https://api.github.com/users/Lukasa/followers", "following_url": "https://api.github.com/users/Lukasa/following{/other_user}", "gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Lukasa", "id": 1382556, "login": "Lukasa", "node_id": "MDQ6VXNlcjEzODI1NTY=", "organizations_url": "https://api.github.com/users/Lukasa/orgs", "received_events_url": "https://api.github.com/users/Lukasa/received_events", "repos_url": "https://api.github.com/users/Lukasa/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions", "type": "User", "url": "https://api.github.com/users/Lukasa", "user_view_type": "public" }
[]
closed
true
null
[]
null
9
2012-08-10T16:49:52Z
2021-09-08T23:06:12Z
2012-08-13T21:14:19Z
MEMBER
resolved
I'm not super invested in this: I think the UnicodeError is reasonably clear, but it probably helps to throw a Requests based exception when there is an error in the URL. The InvalidURL exception subclasses ValueError, which means anyone catching this by looking for ValueErrors will still catch this exception. That said, you might just want to keep throwing the Unicode Error. (Inspired by me really wanting to close #697.)
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/774/reactions" }
https://api.github.com/repos/psf/requests/issues/774/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/774.diff", "html_url": "https://github.com/psf/requests/pull/774", "merged_at": "2012-08-13T21:14:19Z", "patch_url": "https://github.com/psf/requests/pull/774.patch", "url": "https://api.github.com/repos/psf/requests/pulls/774" }
true
[ "This pull request [fails](http://travis-ci.org/kennethreitz/requests/builds/2087975) (merged 5b5cff77 into 64646182).\n", "This pull request [fails](http://travis-ci.org/kennethreitz/requests/builds/2087975) (merged 5b5cff77 into 64646182).\n", "@travisbot, you want to try testing this again? /poke\n", "Oh it'll only test if there's no merge conflicts. Need to rebase :)\n", "This pull request [passes](http://travis-ci.org/kennethreitz/requests/builds/2111792) (merged 79d53d3b into 27b55a74).\n", "Yeah, damn straight it does @travisbot. Would have passed the first time too, if your VM hadn't broken.\n", "ouch :)\n", "=P Been a long day, taking my stress out on an inanimate bot seemed like the way to go.\n", ":cake:\n" ]
https://api.github.com/repos/psf/requests/issues/773
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/773/labels{/name}
https://api.github.com/repos/psf/requests/issues/773/comments
https://api.github.com/repos/psf/requests/issues/773/events
https://github.com/psf/requests/pull/773
6,155,818
MDExOlB1bGxSZXF1ZXN0MjAyODQ0NA==
773
Tests: python2.6 compat (`assertIn` new in python2.7)
{ "avatar_url": "https://avatars.githubusercontent.com/u/447371?v=4", "events_url": "https://api.github.com/users/randomir/events{/privacy}", "followers_url": "https://api.github.com/users/randomir/followers", "following_url": "https://api.github.com/users/randomir/following{/other_user}", "gists_url": "https://api.github.com/users/randomir/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/randomir", "id": 447371, "login": "randomir", "node_id": "MDQ6VXNlcjQ0NzM3MQ==", "organizations_url": "https://api.github.com/users/randomir/orgs", "received_events_url": "https://api.github.com/users/randomir/received_events", "repos_url": "https://api.github.com/users/randomir/repos", "site_admin": false, "starred_url": "https://api.github.com/users/randomir/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/randomir/subscriptions", "type": "User", "url": "https://api.github.com/users/randomir", "user_view_type": "public" }
[]
closed
true
null
[]
null
8
2012-08-10T15:54:18Z
2021-09-08T16:00:52Z
2012-08-10T16:03:09Z
CONTRIBUTOR
resolved
"test_requests_ext.py" should now be python 2.6 compatible (where `unittest.TestCase` does not have `assertIn` and `assertNotIn` methods).
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/773/reactions" }
https://api.github.com/repos/psf/requests/issues/773/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/773.diff", "html_url": "https://github.com/psf/requests/pull/773", "merged_at": "2012-08-10T16:03:09Z", "patch_url": "https://github.com/psf/requests/pull/773.patch", "url": "https://api.github.com/repos/psf/requests/pulls/773" }
true
[ "This pull request [passes](http://travis-ci.org/kennethreitz/requests/builds/2087478) (merged 4da47928 into 40ba6b4e).\n", "thanks!\n", "Heh, I thought Travis was covering Python 2.6 --- I wonder how these were passing?\n", "Dunno, they were passing for me when I ran them with a 2.6 virtualenv too.\n", "I'm not sure about Travis, but `unittest` in Python 2.6 _does not_ support `assertIn` (and many assert methods, see [docs](http://docs.python.org/library/unittest.html#unittest.TestCase.assertIn)). There is, of course the `unittest2` (a backport of new unittest features from Python 2.7 to older Pythons), but I don't think some assert-sugar (in this case) justifies requiring an additional package.\n", "I think neither I nor @slingamn are saying this pull request is anything other than brilliant. We just don't understand how the tests were passing to begin with. I always test locally before I submit a pull request, including in 2.6, and never had the tests fail.\n\nFor me, this is just a curiosity, nothing more. =)\n", "Just to satisfy the curiosity, here's why Travis didn't complain.. :-)\n`Makefile:16`:\n\n```\n# test_requests_ext.py depends on external services, and async doesn't work under Python 3\n# Travis/Jenkins should be ensuring that all other tests pass on all supported versions\nCI_TESTS=$(shell find tests/ -name \"*.py\" ! -name \"test_requests_ext.py\" ! -name \"test_requests_async.py\")\n```\n\nNote: the `test_requests_ext.py` is excluded.\n", "@radomir: @Lukasa is right, this change was great. I was just worried that the testing infrastructure for Requests was broken somehow. But `test_requests_ext.py` is intentionally excluded, so that explains it. Thanks for your contribution!\n" ]
https://api.github.com/repos/psf/requests/issues/772
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/772/labels{/name}
https://api.github.com/repos/psf/requests/issues/772/comments
https://api.github.com/repos/psf/requests/issues/772/events
https://github.com/psf/requests/pull/772
6,151,050
MDExOlB1bGxSZXF1ZXN0MjAyNzAyNQ==
772
First pass at documenting encodings and RFC compliance.
{ "avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4", "events_url": "https://api.github.com/users/Lukasa/events{/privacy}", "followers_url": "https://api.github.com/users/Lukasa/followers", "following_url": "https://api.github.com/users/Lukasa/following{/other_user}", "gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Lukasa", "id": 1382556, "login": "Lukasa", "node_id": "MDQ6VXNlcjEzODI1NTY=", "organizations_url": "https://api.github.com/users/Lukasa/orgs", "received_events_url": "https://api.github.com/users/Lukasa/received_events", "repos_url": "https://api.github.com/users/Lukasa/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions", "type": "User", "url": "https://api.github.com/users/Lukasa", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2012-08-10T13:50:12Z
2021-09-08T16:00:51Z
2012-08-10T16:05:08Z
MEMBER
resolved
My first run at dealing with #524 and #527. Let me know what you think of the changes and if you want me to take a different approach with some or all of it. I've set the Compliance section up so that it is easily expanded if/when you want to document other compliance cases.
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/772/reactions" }
https://api.github.com/repos/psf/requests/issues/772/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/772.diff", "html_url": "https://github.com/psf/requests/pull/772", "merged_at": "2012-08-10T16:05:08Z", "patch_url": "https://github.com/psf/requests/pull/772.patch", "url": "https://api.github.com/repos/psf/requests/pulls/772" }
true
[ "This pull request [passes](http://travis-ci.org/kennethreitz/requests/builds/2086391) (merged 7a9419ce into 40ba6b4e).\n", "Beautiful! I couldn't have written it better myself.\n\nI'm merging now, I like it so much. Keep sending pull requests if you have additional changes ;)\n" ]
https://api.github.com/repos/psf/requests/issues/771
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/771/labels{/name}
https://api.github.com/repos/psf/requests/issues/771/comments
https://api.github.com/repos/psf/requests/issues/771/events
https://github.com/psf/requests/issues/771
6,149,391
MDU6SXNzdWU2MTQ5Mzkx
771
socket leak (suspected due to redirection)
{ "avatar_url": "https://avatars.githubusercontent.com/u/1485066?v=4", "events_url": "https://api.github.com/users/eranrund/events{/privacy}", "followers_url": "https://api.github.com/users/eranrund/followers", "following_url": "https://api.github.com/users/eranrund/following{/other_user}", "gists_url": "https://api.github.com/users/eranrund/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/eranrund", "id": 1485066, "login": "eranrund", "node_id": "MDQ6VXNlcjE0ODUwNjY=", "organizations_url": "https://api.github.com/users/eranrund/orgs", "received_events_url": "https://api.github.com/users/eranrund/received_events", "repos_url": "https://api.github.com/users/eranrund/repos", "site_admin": false, "starred_url": "https://api.github.com/users/eranrund/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/eranrund/subscriptions", "type": "User", "url": "https://api.github.com/users/eranrund", "user_view_type": "public" }
[ { "color": "e10c02", "default": false, "description": null, "id": 117744, "name": "Bug", "node_id": "MDU6TGFiZWwxMTc3NDQ=", "url": "https://api.github.com/repos/psf/requests/labels/Bug" } ]
closed
true
null
[]
null
47
2012-08-10T12:21:29Z
2021-09-09T05:30:52Z
2012-11-17T11:17:01Z
NONE
resolved
It seems requests forgets to properly close a socket when a redirection occurs. See the following gist for the code that causes the issue (at least here..): https://gist.github.com/3313868
{ "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/771/reactions" }
https://api.github.com/repos/psf/requests/issues/771/timeline
null
completed
null
null
false
[ "Have you tried the latest release? v0.13.6 fixed a bunch of socket leaking\n", "`Session.close()` was added in the new release, so it's possible that there's a problem.\n\nHowever I forked the gist to do a `lsof` automatically, as in bluehorn's test, and didn't see any problem under the master or develop branches: [https://gist.github.com/3318253]\n", "This is how it looks here, unfortunately :(\n\n$ cat 3318253/gistfile1.txt\nimport requests\nimport os\nimport subprocess\npid = os.getpid()\nreqsess = requests.session()\ntry:\n r = reqsess.get(r'http://www.mouser.com/Search/Refine.aspx?Keyword=test')\n d = r.text\nfinally:\n reqsess.close()\n\nprint 'done, calling lsof'\nsubprocess.call(\"lsof -p%d -a -iTCP\" % (pid,), shell=True)\nprint 'done'\n$ git clone https://github.com/kennethreitz/requests.git\nCloning into 'requests'...\nremote: Counting objects: 8196, done.\nremote: Compressing objects: 100% (2795/2795), done.\nremote: Total 8196 (delta 5593), reused 7911 (delta 5344)\nReceiving objects: 100% (8196/8196), 1.53 MiB | 570 KiB/s, done.\nResolving deltas: 100% (5593/5593), done.\n$ PYTHONPATH=requests python ./3318253/gistfile1.txt\ndone, calling lsof\nCOMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME\npython 1686 eran 3u IPv4 1394237 0t0 TCP 192.168.0.107:38028->a92-122-135-23.deploy.akamaitechnologies.com:http (CLOSE_WAIT)\ndone\n$\n", "If you are interested, I will gladly provide access to this machine for experimenting.\nAlso, if you want me to add some logging in any specific places, let me know.\n\nThanks!\n", "Using @slingamn's Gist, I can also reproduce the bug.\n\nUsing Python with the following build info:\n\n```\nPython 2.7.1 (r271:86832, Jun 16 2011, 16:59:05) \n[GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)] on darwin\n```\n\nAnd using the `develop` branch of Requests @ 27b55a7, I get the output:\n\n```\ndone, calling lsof\nCOMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME\npython 12214 lukasa 3u IPv4 0xffffff8012a634e0 0t0 TCP 192.168.1.4:61042->2.16.231.23:http (CLOSE_WAIT)\ndone\n```\n", "That's really weird; I can't reproduce this under Python 2.6.7 or 2.7.3.\n\nAnyone know if that open socket is to the first server (the one that sent the redirect) or the last server?\n", "debian stable, python v 2.6.6 it works with no leaking. \nOn commit 27b55a74d7b9bd2f8c60fd0ee342bcbbf40e0a66\nbranch develop\n\nAccording to wireshark:\n\n<pre>\nGET /Search/Refine.aspx?Keyword=test HTTP/1.1\nHost: www.mouser.com\nAccept-Encoding: identity, deflate, compress, gzip\nAccept: */*\nUser-Agent: python-requests/0.13.6 CPython/2.6.6 Linux/2.6.32-5-amd64\n\nHTTP/1.1 302 Moved Temporarily\nContent-Type: text/html; charset=utf-8\nLocation: http://de.mouser.com/Search/Refine.aspx?Keyword=test\nX-AspNet-Version: 4.0.30319\nX-Powered-By: ASP.NET\nDate: Tue, 14 Aug 2012 07:32:08 GMT\nConnection: close\nVary: Accept-Encoding\nSet-Cookie: ASP.NET_SessionId=12vbkqzdf4o4y502nbwd14vf; domain=.mouser.com; path=/; HttpOnly\nSet-Cookie: CARTCOOKIEUUID=84b5edd5-864f-4f48-aea5-e267cd86c0df; domain=.mouser.com; expires=Wed, 14-Aug-2013 07:28:31 GMT; path=/\nSet-Cookie: preferences=; domain=.mouser.com; path=/\nSet-Cookie: TS604485=55d4f36503ed1bff5312fc5334dfee9022925ff451cc8b8c5029fef836af3f5ef6da005fbefdd30bfdbd1f58fdf092e3ffffffff; Path=/\nCache-Control: private\n\n<html><head><title>Object moved</title></head><body>\n<h2>Object moved to <a href=\"http://de.mouser.com/Search/Refine.aspx?Keyword=test\">here</a>.</h2>\n</body></html>\n\n</pre>\n\n\nThen the redirect is followed :\n\n<pre>\nGET /Search/Refine.aspx?Keyword=test HTTP/1.1\nHost: de.mouser.com\nCookie: CARTCOOKIEUUID=84b5edd5-864f-4f48-aea5-e267cd86c0df; ASP.NET_SessionId=12vbkqzdf4o4y502nbwd14vf; preferences=\nAccept-Encoding: identity, deflate, compress, gzip\nAccept: */*\nUser-Agent: python-requests/0.13.6 CPython/2.6.6 Linux/2.6.32-5-amd64\n\nHTTP/1.1 200 OK\nContent-Type: text/html; charset=utf-8\nX-AspNet-Version: 4.0.30319\nX-Powered-By: ASP.NET\nVary: Accept-Encoding\nContent-Encoding: gzip\nDate: Tue, 14 Aug 2012 07:32:10 GMT\nTransfer-Encoding: chunked\nConnection: keep-alive\nConnection: Transfer-Encoding\nSet-Cookie: preferences=ps=de&pl=de-DE&pc_de=EUR; domain=.mouser.com; path=/\nSet-Cookie: TS604485=c6aab6eabd6798c9eb3a18f9f40a1e622b6b6b5dc26917a75029fef9fdf092e3cb3bd022; Path=/\nCache-Control: private\n</pre>\n\n... data follows\n", "Ugh. I was wondering if this was an OS X versus Linux issue, so I tested it on my Ubuntu 12.04 LTS box.\n\nPython build info:\n\n```\nPython 2.7.3 (default, Aug 1 2012, 05:14:39) \n[GCC 4.6.3] on linux2\n```\n\nUsing commit [`27b55a7`](https://github.com/kennethreitz/requests/commit/27b55a74d7b9bd2f8c60fd0ee342bcbbf40e0a66) build of Requests, I get:\n\n```\ndone, calling lsof\nlsof: WARNING: can't stat() fuse.gvfs-fuse-daemon file system /var/lib/lightdm/.gvfs\n Output information may be incomplete.\nCOMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME\npython 6820 lukasa 3u IPv4 17429 0t0 TCP Sweden.local:40976->a23-33-215-23.deploy.akamaitechnologies.com:http (CLOSE_WAIT)\ndone\n```\n\nStill leaking.\n", "Oh, heh, the reason it doesn't reproduce for me is because that page returns me a 200 OK and sends back a body. It probably depends on your IP address.\n\n`http://www.gogle.com` sends me a 301 to `http://www.google.com/`, but when I use that URL in the test, I still can't reproduce the bug. Can anyone reproduce the bug with this URL?\n", "It must, because from the UK I get a 302 and a redirect to `gb.mouser.com`.\n\nIf I try `http://www.gogle.com` I get a 301 to `http://www.google.com/` followed by a 302 to `http://www.google.co.uk`. The test script **does not indicate a leak**.\n", "Maybe someone who can reproduce this could try running the script under `strace -e network,file -s 4096`?\n", "strace output where the issue reproduces: https://gist.github.com/3368251\n", "Heh, apparently strace doesn't consider `close(2)` \"file-related\" (or network-related). That's silly.\n\nMy fork has a branch `leak_patch` [https://github.com/slingamn/requests/tree/leak_patch] which adds some debugging prints for the connection cleanup code. Could you try it and post the output?\n", "Here is is:\n\n> adding new connection for www.mouser.com\n> returning to pool: www.mouser.com adding new connection for il.mouser.com\n> returning to pool: il.mouser.com 4\n> closing requests.sessions.Session\n> Pool is empty: www.mouser.com\n> Closing FD il.mouser.com 4\n> Pool is empty: il.mouser.com\n> done, calling lsof\n> COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME\n> python 20466 eran 3u IPv4 2341665 0t0 TCP 192.168.0.107:35936->a92-122-135-> 23.deploy.akamaitechnologies.com:http (CLOSE_WAIT)\n> done\n", "Is this a leak from Requests or Urllib3?\n", "I'm afraid I have no idea. Could you advise on how to inspect this?\nThanks\nOn Aug 25, 2012 5:52 PM, \"Kenneth Reitz\" [email protected] wrote:\n\n> Is this a leak from Requests or Urllib3?\n> \n> —\n> Reply to this email directly or view it on GitHubhttps://github.com/kennethreitz/requests/issues/771#issuecomment-8023994.\n", "Unfortunately this is quite challenging to debug, because the relevant code extends across Requests, urllib3, and the standard-library `httplib`. Also, it's hard to reproduce :-/\n\nI think some hints about how to inspect the problem are in the debugging patch mentioned above. Basically, try and identify every time a socket is created, and figure out who is creating it and storing it, and output its `fileno` whenever possible, and then try and correlate that with output from `lsof` and/or `strace` describing the actions taken by the program on its file descriptors. An interactive debugger (pdb, ipdb, pudb) might help.\n\n@keves this is hard, but we'd be really appreciative if you could investigate the issue :-)\n\nOne thing I thought was interesting from the debugging output was:\n\n```\nreturning to pool: www.mouser.com adding new connection for il.mouser.com\n```\n\nSeemed like there should have been a newline in between the \"returning\" and \"adding\" messages. I think I saw a similar missing newline when I was playing with google.com's redirection, but I didn't have a corresponding leak.\n", "I would be glad to investigate the issue on my own, however it will take me\nsome time to get into that as I'm pretty overwhelmed with work at the\nmoment and as you say, this isn't the simplest of bugs :/\n\nWhat I can do, in the meantime, is offer ssh access to a Linux VM where\nthis constantly reproduces. If anyone feels like playing with this, let me\nknow and I will set it up. If not, I'm hoping to have some time to look\ninto it myself in the near future. Tracking the socket from its creation\nsounds like a good idea, and maybe I could monkey-patch the socket module\nto print a stack-trace when a new socket is created and then match it\nagainst the lsof output and find out the offender.\n\nOn Fri, Sep 7, 2012 at 7:03 AM, Shivaram Lingamneni <\[email protected]> wrote:\n\n> Unfortunately this is quite challenging to debug, because the relevant\n> code extends across Requests, urllib3, and the standard-library httplib.\n> Also, it's hard to reproduce :-/\n> \n> I think some hints about how to inspect the problem are in the debugging\n> patch mentioned above. Basically, try and identify every time a socket is\n> created, and figure out who is creating it and storing it, and output its\n> fileno whenever possible, and then try and correlate that with output\n> from lsof and/or strace describing the actions taken by the program on\n> its file descriptors. An interactive debugger (pdb, ipdb, pudb) might help.\n> \n> @keves https://github.com/keves this is hard, but we'd be really\n> appreciative if you could investigate the issue :-)\n> \n> One thing I thought was interesting from the debugging output was:\n> \n> returning to pool: www.mouser.com adding new connection for il.mouser.com\n> \n> Seemed like there should have been a newline in between the \"returning\"\n> and \"adding\" messages. I think I saw a similar missing newline when I was\n> playing with google.com's redirection, but I didn't have a corresponding\n> leak.\n> \n> —\n> Reply to this email directly or view it on GitHubhttps://github.com/kennethreitz/requests/issues/771#issuecomment-8355455.\n", "Well, this turns out to be very ugly. I also patch the close() method on the socket object, and I see it gets called twice - for both file descriptors.\n\nHere is the code I used and its output: https://gist.github.com/3665659\n\n```\n\n--> new sock 3\n\n--> close sock 3\nRELEASE: False\nteh release!!!\n--> new sock 4\n\nRELEASE: False\n--> close sock 4\ndone, calling lsof\nCOMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME\npython 11087 eran 3u IPv4 33696 0t0 TCP 192.168.0.105:44490->a88-221-75-23.deploy.akamaitechnologies.com:http (CLOSE_WAIT)\ndone\n```\n", "Oh, excellent --- patching `socket` was a great idea.\n\nYou can use `import traceback; traceback.print_stack()` to find the exact places in requests/urllib3/httplib where the sockets are being created and closed.\n", "Ah, I see you already tried that.\n\nWell, this is suspicious; the output claims that we closed file descriptor 3, but it ends up in the lsof output anyway. Maybe a different FD was opened after the close and given the number 3?\n\nAnother thing you can play with is `os.close()`, which lets you close arbitrary FDs by number --- if you put an `os.close(3)` before the lsof, do you still see CLOSE_WAIT?\n", "Some updates:\n1) Calling os.close() explicitly before calling lsof fixes the issue (as expected)\n2) The following shows a snippet of strace running the test Python script in the gist https://gist.github.com/3665659:\n\n```\n\nsocket(PF_INET, SOCK_STREAM, IPPROTO_TCP) = 3\nfstat(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 2), ...}) = 0\nmmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7ffe16e66000\nwrite(1, \"--> new sock 3\\n\", 15) = 15\nwrite(1, \"\\n\", 1) = 1\nfcntl(3, F_GETFL) = 0x2 (flags O_RDWR)\nfcntl(3, F_SETFL, O_RDWR) = 0\nconnect(3, {sa_family=AF_INET, sin_port=htons(80), sin_addr=inet_addr(\"88.221.75.23\")}, 16) = 0\nsendto(3, \"GET /Search/Refine.aspx?Keyword=\"..., 209, 0, NULL, 0) = 209\nfcntl(3, F_GETFL) = 0x2 (flags O_RDWR)\nfcntl(3, F_SETFL, O_RDWR) = 0\nrecvfrom(3, \"HTTP/1.1 302 Moved Temporarily\\r\\n\"..., 8192, 0, NULL, NULL) = 877\nwrite(1, \"--> before close sock 3\\n\", 24) = 24\nwrite(1, \"--> after close sock\\n\", 21) = 21\n```\n\nLook closely at the gist script and at the 2 write(1,...) lines at the bottom. The close() syscall should have appeared there!\nLooking further down the strace:\n\n```\nwrite(1, \"--> before close sock 4\\n\", 24) = 24\nclose(4) = 0\nwrite(1, \"--> after close sock\\n\", 21) = 21\n```\n\nThe first socket doesn't get closed, the second one does. Whats wrong with socket's close() method?\n\n3) The combination of the 2 discoveries above made me think that maybe _sock.close()_ isn't calling _os.close()_, but as further investigation revealed, the actual socket is implemented in C and is closed from there by means of reference counting. The socket is closed when the object is finalized.\n\nI then used objgraph to print the backrefs to the actual _sock object (the C object inside the Pythonic wrapper in _socket.py_ from stdlib) and noticed the difference between the socket that gets properly closed and the one that is left open: The broken one has an _httplib.HTTPResponse_ instance which references it through its _fp_ member.\n\nDigging deeper, I eventually found out that _r.history_ (_r_ is the request returned from _reqsess.get()_ in the test script) references the 302 redirection request. If I clear _r.history_, the garbage socket gets disposed...\nI think now would be a good time for people familiar with requests code to jump in...\n\n**TL;DR**: r.history keeps a reference to the redirection response, which in turn keeps a reference to the httplib.HTTPResponse, which in turn keeps a reference to the socket - and this is why we're seeing the 'junk' socket. Perhaps someone familiar enough with requests/urllib internals could hint at this?\n", "This is extremely helpful, thanks so much!\n\nIt looks like `socket.close()` is not guaranteed to close the socket, but `socket.shutdown()` can help with that: [http://docs.python.org/library/socket.html#socket.socket.close] But I'm not clear on the mechanics of why this happens.\n\nIn general we are hoping not to rely on the semantics of the garbage collector for socket disposal, since we are also targeting pypy, which doesn't use reference counting and thus has less predictable/eager garbage collection behavior. So ideally the fix would be something other than trying to zero out the refcount of the socket object. However, as per this comment in `socket.py`:\n\n```\n# Wrapper around platform socket objects. This implements\n# a platform-independent dup() functionality. The\n# implementation currently relies on reference counting\n# to close the underlying socket object.\n```\n\nthere may be no other way. This patch should drop the reference to the socket from the history list; could you see if it fixes the problem for you? [https://gist.github.com/5ae6b972b067d7b81e96]\n\nI'd like to think more about this, in particular to understand why the cpython socket module does things this way, and to figure out what the best practices are for writing socket code for both cpython and pypy.\n\nP.S. Taking the cpython docs at their word, here's a patch that calls shutdown on the sockets prior to disposal, but it probably doesn't help: [https://gist.github.com/32f5030728b9d241d128]\n", "@slingamn my first instinct about the docs telling you to use shutdown first is that it changes the behavior of the socket just like shutdown would do with [C sockets](http://beej.us/guide/bgnet/output/html/singlepage/bgnet.html#closedown). I would agree with you that the shutdown call will not likely help, but it is worth trying.\n", "Hello.\n\nThe suggested patch (setting raw to None) fixes the issue. The shutdown patch doesn't, as expected.\n", "I was looking into why I couldn't reproduce the bug locally, and it looks like we are supposed to be handling this already. Basically, the reference chain `r.history[0].raw._fp.fp` is supposed to be broken at the last `.`, by `_fp` (an `httplib.HTTPResponse`) having `.close()` called on it when the content is consumed. This is supposed to set `_fp.fp` to `None`.\n\nSee this traceback:\n\n```\n File \"./buggist.py\", line 25, in <module>\n r = reqsess.get(r'http://www.google.in/')\n File \"/home/shivaram/workspace/requests/requests/sessions.py\", line 265, in get\n return self.request('get', url, **kwargs)\n File \"/home/shivaram/workspace/requests/requests/sessions.py\", line 252, in request\n r.send(prefetch=prefetch)\n File \"/home/shivaram/workspace/requests/requests/models.py\", line 640, in send\n self._build_response(r)\n File \"/home/shivaram/workspace/requests/requests/models.py\", line 233, in _build_response\n r.content # Consume socket so it can be released\n File \"/home/shivaram/workspace/requests/requests/models.py\", line 793, in content\n self._content = bytes().join(self.iter_content(CONTENT_CHUNK_SIZE)) or bytes()\n File \"/home/shivaram/workspace/requests/requests/models.py\", line 739, in generate\n chunk = self.raw.read(chunk_size)\n File \"/home/shivaram/workspace/requests/requests/packages/urllib3/response.py\", line 165, in read\n return self._fp.read(amt)\n File \"/usr/lib64/python2.7/httplib.py\", line 565, in read\n self.close()\n```\n\nwhich I obtained using a monkeypatching technique similar to yours: [https://gist.github.com/955bfeaded8099b1a99f]. The crucial step is that `_build_response` calls `r.content`, which reads the entire response, triggering a call to `close()`. (In my gist I had to copy and paste the original code of `HTTPResponse.close` into my instrumented subclass --- it's an old-style class and I was having some headaches getting the superclass call to work.)\n\nDo you have any idea why this isn't happening correctly on your system?\n", "Hi,\n\nI didn't have time to look into yet, so currently I have no idea.\nI added a printing of self.fp in the print \"close intercepted!!!!!\" line.\nHere is the output:\n\nclose intercepted!!!!! <socket._fileobject object at 0x1f35550>\n File \"t2.py\", line 23, in <module>\n r = reqsess.get(r'http://www.mouser.com/Search/Refine.aspx?Keyword=test\n')\n File \"/home/eran/tmp/xxx/requests/requests/sessions.py\", line 256, in get\n return self.request('get', url, **kwargs)\n File \"/home/eran/tmp/xxx/requests/requests/sessions.py\", line 243, in\nrequest\n r.send(prefetch=prefetch)\n File \"/home/eran/tmp/xxx/requests/requests/models.py\", line 640, in send\n self._build_response(r)\n File \"/home/eran/tmp/xxx/requests/requests/models.py\", line 310, in\n_build_response\n request.send()\n File \"/home/eran/tmp/xxx/requests/requests/models.py\", line 654, in send\n self.response.content\n File \"/home/eran/tmp/xxx/requests/requests/models.py\", line 794, in\ncontent\n self._content = bytes().join(self.iter_content(CONTENT_CHUNK_SIZE)) or\nbytes()\n File \"/home/eran/tmp/xxx/requests/requests/utils.py\", line 412, in\nstream_decompress\n for chunk in iterator:\n File \"/home/eran/tmp/xxx/requests/requests/models.py\", line 740, in\ngenerate\n chunk = self.raw.read(chunk_size)\n File \"/home/eran/tmp/xxx/requests/requests/packages/urllib3/response.py\",\nline 146, in read\n return self._fp.read(amt)\n File \"/usr/lib/python2.7/httplib.py\", line 541, in read\n return self._read_chunked(amt)\n File \"/usr/lib/python2.7/httplib.py\", line 622, in _read_chunked\n self.close()\n File \"t2.py\", line 7, in close\n traceback.print_stack()\nclose intercepted!!!!! None\n File \"t2.py\", line 27, in <module>\n reqsess.close()\n File \"/home/eran/tmp/xxx/requests/requests/sessions.py\", line 119, in\nclose\n self.poolmanager.clear()\n File\n\"/home/eran/tmp/xxx/requests/requests/packages/urllib3/poolmanager.py\",\nline 63, in clear\n self.pools.clear()\n File\n\"/home/eran/tmp/xxx/requests/requests/packages/urllib3/_collections.py\",\nline 90, in clear\n self.dispose_func(value)\n File\n\"/home/eran/tmp/xxx/requests/requests/packages/urllib3/poolmanager.py\",\nline 54, in <lambda>\n dispose_func=lambda p: p.close())\n File\n\"/home/eran/tmp/xxx/requests/requests/packages/urllib3/connectionpool.py\",\nline 306, in close\n conn.close()\n File \"/usr/lib/python2.7/httplib.py\", line 768, in close\n self.__response.close()\n File \"t2.py\", line 7, in close\n traceback.print_stack()\n_fp is <__main__.Instrumented instance at 0x1f93fc8>\n_fp.fp is <socket._fileobject object at 0x1f354d0>\ndone, calling lsof\nCOMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME\npython 2070 eran 3u IPv4 11206 0t0 TCP 192.168.0.105:58925\n->a88-221-75-23.deploy.akamaitechnologies.com:http (CLOSE_WAIT)\ndone\n\nAre the _fp prints before the \"done, calling lsof\" line as same as on your\nmachine?\n", "Mine looks more like this: [https://gist.github.com/777b41131a8bb39aa8d0]\n", "Hi,\n\nWith google.in I am getting similar results to what you are seeing.\nCould you try it with the mouser url?\nWould you be interested in a capture of the HTTP traffic?\n\nThanks\n\nOn Sun, Sep 16, 2012 at 10:48 AM, Shivaram Lingamneni <\[email protected]> wrote:\n\n> Mine looks more like this: [https://gist.github.com/777b41131a8bb39aa8d0]\n> \n> —\n> Reply to this email directly or view it on GitHubhttps://github.com/kennethreitz/requests/issues/771#issuecomment-8592890.\n", "I can't reproduce using the Mouser URL, since it returns a 200-OK for me (I think possibly because of my IP address).\n\nIf you have time, could you look into the question of why `r.content` isn't breaking the reference chain, by setting `_fp.fp` to None? I think that's the core question here, since it is intended to prevent exactly this situation.\n" ]
https://api.github.com/repos/psf/requests/issues/770
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/770/labels{/name}
https://api.github.com/repos/psf/requests/issues/770/comments
https://api.github.com/repos/psf/requests/issues/770/events
https://github.com/psf/requests/issues/770
6,131,080
MDU6SXNzdWU2MTMxMDgw
770
requests
{ "avatar_url": "https://avatars.githubusercontent.com/u/2124079?v=4", "events_url": "https://api.github.com/users/simple-mia/events{/privacy}", "followers_url": "https://api.github.com/users/simple-mia/followers", "following_url": "https://api.github.com/users/simple-mia/following{/other_user}", "gists_url": "https://api.github.com/users/simple-mia/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/simple-mia", "id": 2124079, "login": "simple-mia", "node_id": "MDQ6VXNlcjIxMjQwNzk=", "organizations_url": "https://api.github.com/users/simple-mia/orgs", "received_events_url": "https://api.github.com/users/simple-mia/received_events", "repos_url": "https://api.github.com/users/simple-mia/repos", "site_admin": false, "starred_url": "https://api.github.com/users/simple-mia/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/simple-mia/subscriptions", "type": "User", "url": "https://api.github.com/users/simple-mia", "user_view_type": "public" }
[]
closed
true
null
[]
null
0
2012-08-09T16:22:48Z
2021-09-09T06:00:54Z
2012-08-09T16:42:04Z
NONE
resolved
{ "avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4", "events_url": "https://api.github.com/users/Lukasa/events{/privacy}", "followers_url": "https://api.github.com/users/Lukasa/followers", "following_url": "https://api.github.com/users/Lukasa/following{/other_user}", "gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Lukasa", "id": 1382556, "login": "Lukasa", "node_id": "MDQ6VXNlcjEzODI1NTY=", "organizations_url": "https://api.github.com/users/Lukasa/orgs", "received_events_url": "https://api.github.com/users/Lukasa/received_events", "repos_url": "https://api.github.com/users/Lukasa/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions", "type": "User", "url": "https://api.github.com/users/Lukasa", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/770/reactions" }
https://api.github.com/repos/psf/requests/issues/770/timeline
null
completed
null
null
false
[]
https://api.github.com/repos/psf/requests/issues/769
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/769/labels{/name}
https://api.github.com/repos/psf/requests/issues/769/comments
https://api.github.com/repos/psf/requests/issues/769/events
https://github.com/psf/requests/issues/769
6,130,036
MDU6SXNzdWU2MTMwMDM2
769
add request.json
{ "avatar_url": "https://avatars.githubusercontent.com/u/2088?v=4", "events_url": "https://api.github.com/users/sanga/events{/privacy}", "followers_url": "https://api.github.com/users/sanga/followers", "following_url": "https://api.github.com/users/sanga/following{/other_user}", "gists_url": "https://api.github.com/users/sanga/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/sanga", "id": 2088, "login": "sanga", "node_id": "MDQ6VXNlcjIwODg=", "organizations_url": "https://api.github.com/users/sanga/orgs", "received_events_url": "https://api.github.com/users/sanga/received_events", "repos_url": "https://api.github.com/users/sanga/repos", "site_admin": false, "starred_url": "https://api.github.com/users/sanga/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/sanga/subscriptions", "type": "User", "url": "https://api.github.com/users/sanga", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2012-08-09T15:45:43Z
2021-09-09T06:00:53Z
2012-08-09T18:25:32Z
NONE
resolved
I use Requests to test a JSON over HTTP API - which I suppose is a pretty common usecase. Given that, I find the response.json property to be pretty convenient and would find a request.json property to be similarly useful (for put and post requests). A patch to do such a thing would be trivial, which I could provide. Prior to doing that though, I was wondering if you had any objection to such a patch? So it'd go like: ``` Python r = requests.post(...., body=json.dumps(....)) => <response 400> hmmmm, I wonder what I did wrong r.request.json => {'nmae': 'tim', ....} ``` Actually, it'd be nice to be able to instantiate a request directly with json content i.e. ``` python req = requests.post(...., json={'name': 'tim'}) as opposed to: req = requests.post(....., body=json.dumps({'name': 'tim'})) ```
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/769/reactions" }
https://api.github.com/repos/psf/requests/issues/769/timeline
null
completed
null
null
false
[ "I've considered this heavily in the past, but decided to draw the line and not support this. Requests is a HTTP library, not anything else :)\n" ]
https://api.github.com/repos/psf/requests/issues/768
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/768/labels{/name}
https://api.github.com/repos/psf/requests/issues/768/comments
https://api.github.com/repos/psf/requests/issues/768/events
https://github.com/psf/requests/issues/768
6,118,644
MDU6SXNzdWU2MTE4NjQ0
768
Erorr on requests docs site
{ "avatar_url": "https://avatars.githubusercontent.com/u/96469?v=4", "events_url": "https://api.github.com/users/philipn/events{/privacy}", "followers_url": "https://api.github.com/users/philipn/followers", "following_url": "https://api.github.com/users/philipn/following{/other_user}", "gists_url": "https://api.github.com/users/philipn/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/philipn", "id": 96469, "login": "philipn", "node_id": "MDQ6VXNlcjk2NDY5", "organizations_url": "https://api.github.com/users/philipn/orgs", "received_events_url": "https://api.github.com/users/philipn/received_events", "repos_url": "https://api.github.com/users/philipn/repos", "site_admin": false, "starred_url": "https://api.github.com/users/philipn/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/philipn/subscriptions", "type": "User", "url": "https://api.github.com/users/philipn", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2012-08-09T02:58:23Z
2021-09-09T06:00:54Z
2012-08-09T04:32:41Z
NONE
resolved
"For security reasons, framing is not allowed." JS alert when visiting docs.python-requests.org/
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/768/reactions" }
https://api.github.com/repos/psf/requests/issues/768/timeline
null
completed
null
null
false
[ "https://github.com/markdotto/github-buttons/issues/23\n", "all better, thanks for the heads up!\n" ]
https://api.github.com/repos/psf/requests/issues/767
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/767/labels{/name}
https://api.github.com/repos/psf/requests/issues/767/comments
https://api.github.com/repos/psf/requests/issues/767/events
https://github.com/psf/requests/pull/767
6,110,541
MDExOlB1bGxSZXF1ZXN0MjAwNzU4NQ==
767
Wrap socket.error in ConnectionError (+ unit tests)
{ "avatar_url": "https://avatars.githubusercontent.com/u/188869?v=4", "events_url": "https://api.github.com/users/stfp/events{/privacy}", "followers_url": "https://api.github.com/users/stfp/followers", "following_url": "https://api.github.com/users/stfp/following{/other_user}", "gists_url": "https://api.github.com/users/stfp/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/stfp", "id": 188869, "login": "stfp", "node_id": "MDQ6VXNlcjE4ODg2OQ==", "organizations_url": "https://api.github.com/users/stfp/orgs", "received_events_url": "https://api.github.com/users/stfp/received_events", "repos_url": "https://api.github.com/users/stfp/repos", "site_admin": false, "starred_url": "https://api.github.com/users/stfp/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/stfp/subscriptions", "type": "User", "url": "https://api.github.com/users/stfp", "user_view_type": "public" }
[]
closed
true
null
[]
null
3
2012-08-08T18:58:42Z
2021-09-08T23:01:14Z
2012-08-08T20:23:10Z
NONE
resolved
On connection refused, requests recently started throwing lower-level socket.error exceptions instead of ConnectionError, which does not match the API docs and breaks existing code. I reported this here: https://github.com/kennethreitz/requests/issues/748 I believe the following commit introduced this bug: https://github.com/kennethreitz/requests/commit/e02fb2eb6c2acfa67793a2c77a3c7bd47998a024 This pull request simply catches socket.error in Request.send, and re-raises ConnectionError It also adds two (now passing) unit tests, based on existing ones that are commented out (I left them untouched).
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/767/reactions" }
https://api.github.com/repos/psf/requests/issues/767/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/767.diff", "html_url": "https://github.com/psf/requests/pull/767", "merged_at": "2012-08-08T20:23:10Z", "patch_url": "https://github.com/psf/requests/pull/767.patch", "url": "https://api.github.com/repos/psf/requests/pulls/767" }
true
[ "This pull request [passes](http://travis-ci.org/kennethreitz/requests/builds/2069544) (merged 875c9e18 into bc7b2f9a).\n", "A recent comment on #748 suggests that the underlying problem actually belongs to `urllib3`.\n", "Thanks!\n" ]
https://api.github.com/repos/psf/requests/issues/766
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/766/labels{/name}
https://api.github.com/repos/psf/requests/issues/766/comments
https://api.github.com/repos/psf/requests/issues/766/events
https://github.com/psf/requests/pull/766
6,101,639
MDExOlB1bGxSZXF1ZXN0MjAwMzM0NA==
766
Accept objects with string representations as URLs.
{ "avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4", "events_url": "https://api.github.com/users/Lukasa/events{/privacy}", "followers_url": "https://api.github.com/users/Lukasa/followers", "following_url": "https://api.github.com/users/Lukasa/following{/other_user}", "gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Lukasa", "id": 1382556, "login": "Lukasa", "node_id": "MDQ6VXNlcjEzODI1NTY=", "organizations_url": "https://api.github.com/users/Lukasa/orgs", "received_events_url": "https://api.github.com/users/Lukasa/received_events", "repos_url": "https://api.github.com/users/Lukasa/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions", "type": "User", "url": "https://api.github.com/users/Lukasa", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2012-08-08T12:40:01Z
2021-09-08T16:00:51Z
2012-08-08T20:18:40Z
MEMBER
resolved
This should provide the functionality requested in #423. This does _not_ implement schema-less URLs, and if we want that it should be filed as a separate issue. I've tested with `furl` on Python 2.7, and this seems to work fine.
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/766/reactions" }
https://api.github.com/repos/psf/requests/issues/766/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/766.diff", "html_url": "https://github.com/psf/requests/pull/766", "merged_at": "2012-08-08T20:18:40Z", "patch_url": "https://github.com/psf/requests/pull/766.patch", "url": "https://api.github.com/repos/psf/requests/pulls/766" }
true
[ "This pull request [passes](http://travis-ci.org/kennethreitz/requests/builds/2066367) (merged 6166ba7e into bc7b2f9a).\n", "Beautiful.\n" ]
https://api.github.com/repos/psf/requests/issues/765
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/765/labels{/name}
https://api.github.com/repos/psf/requests/issues/765/comments
https://api.github.com/repos/psf/requests/issues/765/events
https://github.com/psf/requests/issues/765
6,072,578
MDU6SXNzdWU2MDcyNTc4
765
Chardet sometimes fails and force the wrong encoding
{ "avatar_url": "https://avatars.githubusercontent.com/u/1333493?v=4", "events_url": "https://api.github.com/users/josemariaruiz/events{/privacy}", "followers_url": "https://api.github.com/users/josemariaruiz/followers", "following_url": "https://api.github.com/users/josemariaruiz/following{/other_user}", "gists_url": "https://api.github.com/users/josemariaruiz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/josemariaruiz", "id": 1333493, "login": "josemariaruiz", "node_id": "MDQ6VXNlcjEzMzM0OTM=", "organizations_url": "https://api.github.com/users/josemariaruiz/orgs", "received_events_url": "https://api.github.com/users/josemariaruiz/received_events", "repos_url": "https://api.github.com/users/josemariaruiz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/josemariaruiz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/josemariaruiz/subscriptions", "type": "User", "url": "https://api.github.com/users/josemariaruiz", "user_view_type": "public" }
[]
closed
true
null
[]
null
14
2012-08-07T10:07:31Z
2021-09-09T00:01:04Z
2012-08-07T18:17:38Z
NONE
resolved
I've a problem that I've traced back to the method/property "text" of Request. Chadet is returning the wrong encoding "ISO-8859-2" when the string is UTF-8! The result are, as you can imagine, nasty strings everywhere you have something that is not ascii. This is happening in production :( What can I do? You are shipping chardet with requests :(
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/765/reactions" }
https://api.github.com/repos/psf/requests/issues/765/timeline
null
completed
null
null
false
[ "@josemariaruiz, do you have sample strings to reproduce the bug?\n", "I wanted to cancel a comment and closed the bug! sorry. The string contains my personal data... can I send it to someone by email? I don't want to see it published everywhere :-/\n", "@josemariaruiz, reduce it to the characters that are creating the problem and post the representation of the object here (`repr(my_string)`).\n", "In the meantime, if you want a work-around, you can use `Response.content` property and decode it yourself. This will work so long as you know that you're receiving UTF-8.\n\nIn short, instead of:\n\n``` python\nr = requests.get('http://example.com/')\nprint r.text\n```\n\nuse:\n\n``` python\nr = requests.get('http://example.com/')\nprint r.content.decode('utf-8')\n```\n", "Lukasa, this is exactly what I'm doing now: use r.content and json.loads().\n\nThe string is my own name: \"José María Ruiz\" (this is like in http://xkcd.com/327/)\n\n``` python\n>>> repr(response.content)\n '....\"name\":[\"Jos\\\\xc3\\\\xa9 Mar\\\\xc3\\\\xada Ruiz\"]....'\n```\n", "After installing the last chardet version with pip I made this test (the webservice is firewalled sorry):\n\n``` bash\n$ curl \"WEBSERVICE URL\" | chardet\n % Total % Received % Xferd Average Speed Time Time Time Current\n Dload Upload Total Spent Left Speed\n100 967 100 967 0 0 1968 0 --:--:-- --:--:-- --:--:-- 2571\n<stdin>: ISO-8859-2 (confidence: 0.82)\n```\n\nIf I dump the data to a file and use file:\n\n``` bash\n$ file dump.txt \ndump.txt: UTF-8 Unicode text, with very long lines, with no line terminators\n```\n\nThe problem is related to the file and not to my name. The data returned by the webservice that cause the problem have my name once while when the name appears twice the detected encoding is utf-8.\n", "Requests uses `ISO-8859-1` when the content-type begins with `text`, as the RFC states.\n", "http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.7.1\n\n> The \"charset\" parameter is used with some media types to define the character set (section 3.4) of the data. When no explicit charset parameter is provided by the sender, media subtypes of the \"text\" type are defined to have a default charset value of \"ISO-8859-1\" when received via HTTP. Data in character sets other than \"ISO-8859-1\" or its subsets MUST be labeled with an appropriate charset value. See section 3.4.1 for compatibility problems.\n", "Hi Kenneth this is a dump of the headers from Amazon WS CloudSearch (the service I'm requesting):\n\n``` python\n{'connection': 'keep-alive',\n 'content-length': '5344',\n 'content-type': 'application/json',\n 'date': 'Wed, 08 Aug 2012 08:39:36 GMT',\n 'server': 'Server'}\n```\n\nDoes content-type begins with \"text\"? And the problem is not ISO-8859-1, but that the code then uses Chardet and asign as encoding ISO-8859-2! \n", "Ah, sorry I misread. \n\nUnfortunately, this detection cannot be improved at this time. Amazon should really be providing their charset in the headers.\n\nLuckily, you can actually set the value of encoding yourself to suit your needs.\n", "Note that JSON is always supposed to be encoded in one of the UTF encodings; UTF-8 is the default, but -16 and -32 are allowed too.\n\nThe improvement thus is to _not_ use `self.text` (which uses chardet to guess wrong in the case where no encoding has been set) but to detect the UTF encoding used instead; the first 4 bytes are enough to determine this. The [section 3 of the JSON RFC](http://tools.ietf.org/html/rfc4627#section-3) tells you how to do this even.\n\nI'd say: when no encoding has been set, use `self.content` and use the RFC rules to detect the encoding used and pass that to the `json.loads` function. If that raises an error, or `self.encoding` _has_ been set, fall back to `self.text`.\n\n(Correction: json.loads only handles UTF-8 or Unicode objects).\n", "[Useful test case](http://cdn.content.easports.com/fifa/fltOnlineAssets/2013/fut/items/web/199074.json); it does not specify an encoding, the contained JSON is correctly encoded as UTF-8, but chardet pegs it as `ISO-8859-2` and the end-result is that you get mis-decoded content in `.json`. Using `json.loads(r.content)` gives correct results.\n\nWork-around: set `.encoding` to `UTF-8` before accessing `.json`.\n", "0.14.2 was just released, which includes my proposed JSON UTF handling code from pull request #909. That release will now automatically detect what UTF encoding was used for a JSON response without an encoding set.\n", ":sparkles: :cake: :sparkles:\n" ]
https://api.github.com/repos/psf/requests/issues/764
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/764/labels{/name}
https://api.github.com/repos/psf/requests/issues/764/comments
https://api.github.com/repos/psf/requests/issues/764/events
https://github.com/psf/requests/pull/764
6,064,721
MDExOlB1bGxSZXF1ZXN0MTk4NzEzNQ==
764
test and fix regressions from #760
{ "avatar_url": "https://avatars.githubusercontent.com/u/376448?v=4", "events_url": "https://api.github.com/users/slingamn/events{/privacy}", "followers_url": "https://api.github.com/users/slingamn/followers", "following_url": "https://api.github.com/users/slingamn/following{/other_user}", "gists_url": "https://api.github.com/users/slingamn/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/slingamn", "id": 376448, "login": "slingamn", "node_id": "MDQ6VXNlcjM3NjQ0OA==", "organizations_url": "https://api.github.com/users/slingamn/orgs", "received_events_url": "https://api.github.com/users/slingamn/received_events", "repos_url": "https://api.github.com/users/slingamn/repos", "site_admin": false, "starred_url": "https://api.github.com/users/slingamn/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/slingamn/subscriptions", "type": "User", "url": "https://api.github.com/users/slingamn", "user_view_type": "public" }
[]
closed
true
null
[]
null
3
2012-08-06T22:57:23Z
2021-09-08T23:08:13Z
2012-08-06T23:14:00Z
CONTRIBUTOR
resolved
This adds unit tests corresponding to the issues @dhagrow identified on #760, then fixes them.
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/764/reactions" }
https://api.github.com/repos/psf/requests/issues/764/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/764.diff", "html_url": "https://github.com/psf/requests/pull/764", "merged_at": "2012-08-06T23:14:00Z", "patch_url": "https://github.com/psf/requests/pull/764.patch", "url": "https://api.github.com/repos/psf/requests/pulls/764" }
true
[ "This pull request [fails](http://travis-ci.org/kennethreitz/requests/builds/2052399) (merged 000c1053 into a94fcb87).\n", "This pull request [passes](http://travis-ci.org/kennethreitz/requests/builds/2052525) (merged 291859c1 into a94fcb87).\n", "Thanks :)\n" ]
https://api.github.com/repos/psf/requests/issues/763
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/763/labels{/name}
https://api.github.com/repos/psf/requests/issues/763/comments
https://api.github.com/repos/psf/requests/issues/763/events
https://github.com/psf/requests/issues/763
6,064,301
MDU6SXNzdWU2MDY0MzAx
763
prefetch=False isn't respected for redirects
{ "avatar_url": "https://avatars.githubusercontent.com/u/326885?v=4", "events_url": "https://api.github.com/users/jkbrzt/events{/privacy}", "followers_url": "https://api.github.com/users/jkbrzt/followers", "following_url": "https://api.github.com/users/jkbrzt/following{/other_user}", "gists_url": "https://api.github.com/users/jkbrzt/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/jkbrzt", "id": 326885, "login": "jkbrzt", "node_id": "MDQ6VXNlcjMyNjg4NQ==", "organizations_url": "https://api.github.com/users/jkbrzt/orgs", "received_events_url": "https://api.github.com/users/jkbrzt/received_events", "repos_url": "https://api.github.com/users/jkbrzt/repos", "site_admin": false, "starred_url": "https://api.github.com/users/jkbrzt/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/jkbrzt/subscriptions", "type": "User", "url": "https://api.github.com/users/jkbrzt", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2012-08-06T22:35:36Z
2021-09-09T06:00:55Z
2012-08-06T23:14:23Z
CONTRIBUTOR
resolved
``` import requests r = requests.get('http://httpbin.org/status/301', prefetch=False, allow_redirects=True) next(r.iter_lines()) Traceback (most recent call last): File "<ipython-input-8-a2f7272b22ca>", line 1, in <module> next(r.iter_lines()) File "python2.7/site-packages/requests/models.py", line 740, in iter_lines decode_unicode=decode_unicode): File "python2.7/site-packages/requests/models.py", line 712, in iter_content 'The content for this response was already consumed' RuntimeError: The content for this response was already consumed ```
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/763/reactions" }
https://api.github.com/repos/psf/requests/issues/763/timeline
null
completed
null
null
false
[ "Fixed by #764 !\n", "Awesome :)\n" ]
https://api.github.com/repos/psf/requests/issues/762
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/762/labels{/name}
https://api.github.com/repos/psf/requests/issues/762/comments
https://api.github.com/repos/psf/requests/issues/762/events
https://github.com/psf/requests/pull/762
6,056,232
MDExOlB1bGxSZXF1ZXN0MTk4MzI3Ng==
762
Correctly handle encoding numbers when POSTing.
{ "avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4", "events_url": "https://api.github.com/users/Lukasa/events{/privacy}", "followers_url": "https://api.github.com/users/Lukasa/followers", "following_url": "https://api.github.com/users/Lukasa/following{/other_user}", "gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Lukasa", "id": 1382556, "login": "Lukasa", "node_id": "MDQ6VXNlcjEzODI1NTY=", "organizations_url": "https://api.github.com/users/Lukasa/orgs", "received_events_url": "https://api.github.com/users/Lukasa/received_events", "repos_url": "https://api.github.com/users/Lukasa/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions", "type": "User", "url": "https://api.github.com/users/Lukasa", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2012-08-06T16:42:59Z
2021-09-08T23:06:30Z
2012-08-06T21:05:22Z
MEMBER
resolved
Resolves #759.
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/762/reactions" }
https://api.github.com/repos/psf/requests/issues/762/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/762.diff", "html_url": "https://github.com/psf/requests/pull/762", "merged_at": "2012-08-06T21:05:22Z", "patch_url": "https://github.com/psf/requests/pull/762.patch", "url": "https://api.github.com/repos/psf/requests/pulls/762" }
true
[ "This pull request [passes](http://travis-ci.org/kennethreitz/requests/builds/2049164) (merged 55bf436f into fc6ddfd7).\n", "thanks!\n" ]
https://api.github.com/repos/psf/requests/issues/761
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/761/labels{/name}
https://api.github.com/repos/psf/requests/issues/761/comments
https://api.github.com/repos/psf/requests/issues/761/events
https://github.com/psf/requests/issues/761
6,050,138
MDU6SXNzdWU2MDUwMTM4
761
ssl cert problems
{ "avatar_url": "https://avatars.githubusercontent.com/u/275330?v=4", "events_url": "https://api.github.com/users/geier/events{/privacy}", "followers_url": "https://api.github.com/users/geier/followers", "following_url": "https://api.github.com/users/geier/following{/other_user}", "gists_url": "https://api.github.com/users/geier/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/geier", "id": 275330, "login": "geier", "node_id": "MDQ6VXNlcjI3NTMzMA==", "organizations_url": "https://api.github.com/users/geier/orgs", "received_events_url": "https://api.github.com/users/geier/received_events", "repos_url": "https://api.github.com/users/geier/repos", "site_admin": false, "starred_url": "https://api.github.com/users/geier/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/geier/subscriptions", "type": "User", "url": "https://api.github.com/users/geier", "user_view_type": "public" }
[]
closed
true
null
[]
null
10
2012-08-06T13:45:13Z
2021-09-09T01:22:24Z
2012-08-07T17:04:14Z
NONE
resolved
I'm having an issue with ssl verification. ``` >>> import requests >>> requests.get('https://myserver.tld', cert='/home/cg/cacert.pem') Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/local/lib/python2.7/dist-packages/requests/api.py", line 63, in get return request('get', url, **kwargs) File "/usr/local/lib/python2.7/dist-packages/requests/safe_mode.py", line 38, in wrapped return function(method, url, **kwargs) File "/usr/local/lib/python2.7/dist-packages/requests/api.py", line 50, in request return session.request(method=method, url=url, **kwargs) File "/usr/local/lib/python2.7/dist-packages/requests/sessions.py", line 238, in request r.send(prefetch=prefetch) File "/usr/local/lib/python2.7/dist-packages/requests/models.py", line 612, in send raise SSLError(e) requests.exceptions.SSLError: [Errno 336265225] _ssl.c:351: error:140B0009:SSL routines:SSL_CTX_use_PrivateKey_file:PEM lib ``` but the cacert.pem file does not seem to be the problem, as it works fine with curl? % curl --cacert /home/cg/cacert.pem https:/myvserver.tld <html><body><h1>It works!</h1></body></html> Does anyone know what the issue here is?
{ "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/761/reactions" }
https://api.github.com/repos/psf/requests/issues/761/timeline
null
completed
null
null
false
[ "the curl command prints html, I'm not sure how to escape it, but you get the picture\n", "ok, it looks like this is an urllib3 problem, will take it there\n", "This doesn't seem to be fixed?\n", "@llama it isn't closed because it was fixed, it was closed because it isn't an issue with requests. It **is** an issue with a library requests relies on which @geier indicated in their last comment.\n", "Ahh understood, thanks for that @sigmavirus24.\n", "No problem\n", "I'm using requests version 1.2.0 and seeing the same problem: `requests` crashes with `SSLError` on https://selectedpapers.net, whereas `openssl s_client -connect selectedpapers.net:443` verifies the certificate successfully (and any browser not IE on XP accepts the certificate; here's another example of the same problem: http://hearsum.ca/blog/python-and-ssl-certificate-verification/). I searched the urllib3 issue tracker but couldn't find a clear match to this bug. \n\n@geier @sigmavirus24 can you give a link to the urllib3 issue that tracks this? I'd like to see whether urllib3 has actually fixed this, and if so why requests 1.2.0 still doesn't work for this https request.\n", "@cjlee112 you're using an outdated version of requests. Re-attempt with that version and if it persists open a new issue with the details.\n", "Oddly enough @cjlee112 running your `openssl` command on my machine ends with:\n\n```\nVerify return code: 20 (unable to get local issuer certificate)\n```\n\nBut on 1.2.3 I am seeing the same SSLError because of a certificate mismatch. So the certificate you purchased will not work with requests unless you use the system certificates (which seem to work for you but not for me) by specifying as is described in the blog post you linked.\n\nIncidentally if I do\n\n```\nopenssl s_client -CApath /etc/ssl/certs/ -connect selectedpapers.net:443\n```\n\nthat will verify the certificate correctly.\n", "@sigmavirus24 Thanks for looking into this!! I wasn't looking for a workaround, but rather trying to find the urllib3 issue number that tracks the resolution of this bug. You guys said \"it looks like this is an urllib3 problem, will take it there\" but gave no details, and hunting around there I couldn't find a clear match. I think those details should be entered here, for the record, since it strongly affects `requests` users. For example, if `urllib3` (for whatever reason) ends up not truly fixing this bug, it will (continue to) be a big issue for people trying to use `requests`. So the `requests` issue tracker should have an explicit record of what `urllib3` issue number(s) address this.\n" ]
https://api.github.com/repos/psf/requests/issues/760
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/760/labels{/name}
https://api.github.com/repos/psf/requests/issues/760/comments
https://api.github.com/repos/psf/requests/issues/760/events
https://github.com/psf/requests/pull/760
6,042,350
MDExOlB1bGxSZXF1ZXN0MTk3ODAwNQ==
760
address connection leak issue from #520
{ "avatar_url": "https://avatars.githubusercontent.com/u/376448?v=4", "events_url": "https://api.github.com/users/slingamn/events{/privacy}", "followers_url": "https://api.github.com/users/slingamn/followers", "following_url": "https://api.github.com/users/slingamn/following{/other_user}", "gists_url": "https://api.github.com/users/slingamn/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/slingamn", "id": 376448, "login": "slingamn", "node_id": "MDQ6VXNlcjM3NjQ0OA==", "organizations_url": "https://api.github.com/users/slingamn/orgs", "received_events_url": "https://api.github.com/users/slingamn/received_events", "repos_url": "https://api.github.com/users/slingamn/repos", "site_admin": false, "starred_url": "https://api.github.com/users/slingamn/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/slingamn/subscriptions", "type": "User", "url": "https://api.github.com/users/slingamn", "user_view_type": "public" }
[]
closed
true
null
[]
null
7
2012-08-06T04:03:46Z
2021-09-08T16:00:50Z
2012-08-06T04:38:12Z
CONTRIBUTOR
resolved
Piggybacking on the recent upgrade of urllib3 inside Requests, here's my much-delayed shot at a real fix for #520. From the commit message: - prefetch now defaults to True, ensuring that by default, sockets are returned to the urllib3 connection pool on request end - sessions now have a close() method, notifying urllib3 to close pooled connections - the module-level API, e.g., `requests.get('http://www.google.com')`, explicitly closes its session when finished When prefetch is False, the open socket becomes part of the state of the Response object, and it's the client's responsibility to read the whole body, at which point the socket will be returned to the pool.
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/760/reactions" }
https://api.github.com/repos/psf/requests/issues/760/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/760.diff", "html_url": "https://github.com/psf/requests/pull/760", "merged_at": "2012-08-06T04:38:12Z", "patch_url": "https://github.com/psf/requests/pull/760.patch", "url": "https://api.github.com/repos/psf/requests/pulls/760" }
true
[ "This pull request [fails](http://travis-ci.org/kennethreitz/requests/builds/2044485) (merged 0caaf682 into 1898077f).\n", "This pull request [passes](http://travis-ci.org/kennethreitz/requests/builds/2044576) (merged 3c0b9404 into 1898077f).\n", "The first Travis failure was due to a Python 3 issue, which I subsequently fixed.\n\nUnrelated: `test_POSTBIN_GET_POST_FILES_WITH_PARAMS` is flaking locally for me, has anyone else seen this?\n", "Beautiful work. :)\n\n:sparkles: :cake: :sparkles:\n", "RELEASED! :shipit:\n", "This breaks prefetch=False in certain cases.\n\nRedirect:\n\n```\n>>> res = requests.get('http://google.com', prefetch=False)\n... next(res.iter_content(10))\nTraceback (most recent call last):\nRuntimeError: The content for this response was already consumed\n```\n\nreturn_response=False (unless prefetch=False is also passed to .get):\n\n```\n>>> req = requests.get('http://www.google.com', return_response=False)\n... req.send(prefetch=False)\n... next(req.response.iter_content(10))\nTraceback (most recent call last):\nRuntimeError: The content for this response was already consumed\n```\n", "Thanks for the report! I'll send a pull request including regression tests and fixes.\n" ]
https://api.github.com/repos/psf/requests/issues/759
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/759/labels{/name}
https://api.github.com/repos/psf/requests/issues/759/comments
https://api.github.com/repos/psf/requests/issues/759/events
https://github.com/psf/requests/issues/759
6,041,789
MDU6SXNzdWU2MDQxNzg5
759
long type not accepted as a parameter when files provided
{ "avatar_url": "https://avatars.githubusercontent.com/u/2100675?v=4", "events_url": "https://api.github.com/users/deadbeef404/events{/privacy}", "followers_url": "https://api.github.com/users/deadbeef404/followers", "following_url": "https://api.github.com/users/deadbeef404/following{/other_user}", "gists_url": "https://api.github.com/users/deadbeef404/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/deadbeef404", "id": 2100675, "login": "deadbeef404", "node_id": "MDQ6VXNlcjIxMDA2NzU=", "organizations_url": "https://api.github.com/users/deadbeef404/orgs", "received_events_url": "https://api.github.com/users/deadbeef404/received_events", "repos_url": "https://api.github.com/users/deadbeef404/repos", "site_admin": false, "starred_url": "https://api.github.com/users/deadbeef404/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/deadbeef404/subscriptions", "type": "User", "url": "https://api.github.com/users/deadbeef404", "user_view_type": "public" }
[]
closed
true
null
[]
null
5
2012-08-06T02:34:40Z
2021-09-09T06:00:55Z
2012-08-06T21:06:10Z
NONE
resolved
When we provide a file and a long-type parameter through to the request functions, we get an exception thrown. urllib3 seems to turn integer types into strings, but doesn't convert python long types. The exception is raised by urllib3's encode_multipart_formdata function. Not sure if this is a urllib3 issue as in their function, "# Backwards compatibility" is written next to their int conversion code. As that might be removed at some point, maybe integer/long conversions should not be relied upon within that library. ``` python import requests import tempfile filename = tempfile.mkstemp()[1] file1 = open(filename, 'w') file1.write('test') file1.close() file1 = open(filename, 'rb') response = requests.post( url='http://www.google.com', data={'aparam1': 12L}, files={testfile': file1,} ) ```
{ "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/759/reactions" }
https://api.github.com/repos/psf/requests/issues/759/timeline
null
completed
null
null
false
[ "This _is_ a `urllib3` issue. It's also a stupid Python version problem.\n\nIn Python 2, the correct code would read:\n\n``` python\nif isinstance(data, (int, long)):\n # do type coercion\n```\n\nIn Python 3, that's a NameError because the `long` type was removed. @shazow, does this fix look useful?\n\nWhack this function definition into `util.py`:\n\n``` python\nimport platform\n\ndef integer_types():\n if (platform.python_version_tuple[0] == '3'):\n return int\n else:\n return (int, long)\n```\n\nThen just replace the test with:\n\n``` python\nif isinstance(data, integer_types()):\n # do type coercion\n```\n", "Nope, @deadbeef404 is correct. You shouldn't depend on urllib3 to coerce your types for you. If we want ints, longs, and whatever else to be auto-coerced into strings, then please do that in Requests before passing it to urllib3.\n\nI do plan to remove the backwards compatibility block, so please make sure everything will continue working in Requests. :)\n", "Ok cool. =)\n", "Resolved in #762.\n", "Cheers for the quick turnaround. Also, I commend you all on the library's API. Very nice!\n" ]
https://api.github.com/repos/psf/requests/issues/758
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/758/labels{/name}
https://api.github.com/repos/psf/requests/issues/758/comments
https://api.github.com/repos/psf/requests/issues/758/events
https://github.com/psf/requests/pull/758
6,027,762
MDExOlB1bGxSZXF1ZXN0MTk3MzQ2NA==
758
Develop
{ "avatar_url": "https://avatars.githubusercontent.com/u/69447?v=4", "events_url": "https://api.github.com/users/volker48/events{/privacy}", "followers_url": "https://api.github.com/users/volker48/followers", "following_url": "https://api.github.com/users/volker48/following{/other_user}", "gists_url": "https://api.github.com/users/volker48/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/volker48", "id": 69447, "login": "volker48", "node_id": "MDQ6VXNlcjY5NDQ3", "organizations_url": "https://api.github.com/users/volker48/orgs", "received_events_url": "https://api.github.com/users/volker48/received_events", "repos_url": "https://api.github.com/users/volker48/repos", "site_admin": false, "starred_url": "https://api.github.com/users/volker48/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/volker48/subscriptions", "type": "User", "url": "https://api.github.com/users/volker48", "user_view_type": "public" }
[]
closed
true
null
[]
null
5
2012-08-04T03:22:06Z
2021-09-08T23:01:00Z
2012-08-04T15:39:25Z
CONTRIBUTOR
resolved
Fixes kennethreitz/requests#747.
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/758/reactions" }
https://api.github.com/repos/psf/requests/issues/758/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/758.diff", "html_url": "https://github.com/psf/requests/pull/758", "merged_at": "2012-08-04T15:39:25Z", "patch_url": "https://github.com/psf/requests/pull/758.patch", "url": "https://api.github.com/repos/psf/requests/pulls/758" }
true
[ "This pull request [fails](http://travis-ci.org/kennethreitz/requests/builds/2033776) (merged 2d321b22 into b5ca4b44).\n", "hmm, looks like this fails on Python 3 because of your str import.\n", "Sorry about that I thought I tested it on Python 3, but I obviously didn't. Let me try something else.\n", "This pull request [passes](http://travis-ci.org/kennethreitz/requests/builds/2035479) (merged f60579dd into b5ca4b44).\n", "Excellent, thanks!\n" ]
https://api.github.com/repos/psf/requests/issues/757
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/757/labels{/name}
https://api.github.com/repos/psf/requests/issues/757/comments
https://api.github.com/repos/psf/requests/issues/757/events
https://github.com/psf/requests/pull/757
6,022,627
MDExOlB1bGxSZXF1ZXN0MTk3MTAwMw==
757
Adds `quote_plus` option
{ "avatar_url": "https://avatars.githubusercontent.com/u/1032706?v=4", "events_url": "https://api.github.com/users/dlitvakb/events{/privacy}", "followers_url": "https://api.github.com/users/dlitvakb/followers", "following_url": "https://api.github.com/users/dlitvakb/following{/other_user}", "gists_url": "https://api.github.com/users/dlitvakb/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/dlitvakb", "id": 1032706, "login": "dlitvakb", "node_id": "MDQ6VXNlcjEwMzI3MDY=", "organizations_url": "https://api.github.com/users/dlitvakb/orgs", "received_events_url": "https://api.github.com/users/dlitvakb/received_events", "repos_url": "https://api.github.com/users/dlitvakb/repos", "site_admin": false, "starred_url": "https://api.github.com/users/dlitvakb/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/dlitvakb/subscriptions", "type": "User", "url": "https://api.github.com/users/dlitvakb", "user_view_type": "public" }
[]
closed
true
null
[]
null
14
2012-08-03T20:04:38Z
2021-09-08T16:00:49Z
2012-08-08T20:24:03Z
NONE
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": 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/757/reactions" }
https://api.github.com/repos/psf/requests/issues/757/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/757.diff", "html_url": "https://github.com/psf/requests/pull/757", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/757.patch", "url": "https://api.github.com/repos/psf/requests/pulls/757" }
true
[ "Some sites give a 401 error when encoding url parameters and body data with the default urlencode function, as they send `+` instead of `%20` for encoding spaces.\n\nAn issue for this has been posted to [urllib](http://bugs.python.org/issue13866) but as it doesn't seem to be nowhere near to be accepted. I propose that an additional parameter can be added to requests API to replicate that feature.\n", "This pull request [passes](http://travis-ci.org/kennethreitz/requests/builds/2031301) (merged 3dcaff99 into b5ca4b44).\n", "Instead of adding a new option, I'd rather fix our encoding (which has been worked on heavily).\n\nA web browser doesn't have url parsing options, so Reqeusts shouldn't need one either.\n", "@kennethreitz , the problem is not how browsers work, there are some APIs which use OAuth and need specifically to receive `%20` as the scape character for `space` according to the [RFC 5849](http://tools.ietf.org/html/rfc5849#section-3.6)\n\nThis should be an available option, as if it is done other way, it would result in a 401 response\n", "Why not always send `%20`? That's what the browsers do, no?\n", "Not sure about that, urls are formatted with `+` in browsers, and `application/xxx-form-urlencoded` sent with post from browsers too.\n", "I've just had the same problem with an API that requires spaces in the query string to be encoded as `%20` (it does not like `+`).\n\nRequests uses `urllib.urlencode` to build the query string from the _params_ argument, which in turn uses `urllib.quote_plus`, which causes the problem (see [Python issue 13866](http://bugs.python.org/issue13866) mentioned earlier).\n\nI have seen several APIs that break when you encode spaces as `+` instead of `%20`, but I have never seen the opposite case. So I guess it would be OK to default to using `%20` in query strings (i.e. use `quote`), and maybe add an optional parameter to use pluses instead (using `quote_plus`). The use of `urlencode` would then be limited to the encoding of POST data.\n", "@ronnix since we now provide the fully mutable PreparedRequest object, you can change the url to be whatever you need :)\n", "Thanks. I've glanced at the code, but do you have an example of how I would use that?\n", "Roughly:\n\n``` python\n\nfrom requests import Request, session\n\nrequest = Request('GET', 'https://example.com', data='foo bar bogus')\nprepared = request.prepare()\nprepared.url = 'https://abc.example.com'\ns = session()\ns.send(prepared)\n```\n", "Thanks, but why do I need the prepared request anyway? Can I just build my URL and use it with `requests.get`, like:\n\n```\nurl = 'https://example.com/?' + _build_my_query_string()\nresponse = requests.get(url)\n```\n", "@ronnix yeah that will work too\n", "@sigmavirus24 \n\n```\nprepared = request.prepare()\nprepared.url = 'https://abc.example.com'\n```\n\nOut of curiosity; how can user know what is safe to change after the request had been prepared? It looks like playing with fire :)\n", "The `PreparedRequest` object is a perfect example of the \"we're all consenting adults here\" philosophy. Yes, you can totally break your request if you do something silly with the `PreparedRequest`. However, there are also plenty of things you can usefully do with that kind of low-level access. That complexity is only shown to a user who specifically asks for it, by using `Request.prepare()`, so it won't bite anyone. =)\n" ]
https://api.github.com/repos/psf/requests/issues/756
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/756/labels{/name}
https://api.github.com/repos/psf/requests/issues/756/comments
https://api.github.com/repos/psf/requests/issues/756/events
https://github.com/psf/requests/issues/756
6,022,610
MDU6SXNzdWU2MDIyNjEw
756
Allow a quote_plus option to the API, some sites give a 401 with default urlencode
{ "avatar_url": "https://avatars.githubusercontent.com/u/1032706?v=4", "events_url": "https://api.github.com/users/dlitvakb/events{/privacy}", "followers_url": "https://api.github.com/users/dlitvakb/followers", "following_url": "https://api.github.com/users/dlitvakb/following{/other_user}", "gists_url": "https://api.github.com/users/dlitvakb/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/dlitvakb", "id": 1032706, "login": "dlitvakb", "node_id": "MDQ6VXNlcjEwMzI3MDY=", "organizations_url": "https://api.github.com/users/dlitvakb/orgs", "received_events_url": "https://api.github.com/users/dlitvakb/received_events", "repos_url": "https://api.github.com/users/dlitvakb/repos", "site_admin": false, "starred_url": "https://api.github.com/users/dlitvakb/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/dlitvakb/subscriptions", "type": "User", "url": "https://api.github.com/users/dlitvakb", "user_view_type": "public" }
[]
closed
true
null
[]
null
4
2012-08-03T20:03:31Z
2021-09-08T12:00:56Z
2012-08-03T20:07:42Z
NONE
resolved
Some sites give a 401 error when encoding url parameters and body data with the default urlencode function, as they send `+` instead of `%20` for encoding spaces. An issue for this has been posted to [urllib](http://bugs.python.org/issue13866) but as it doesn't seem to be nowhere near to be accepted. I propose that an additional parameter can be added to requests API to replicate that feature.
{ "avatar_url": "https://avatars.githubusercontent.com/u/1032706?v=4", "events_url": "https://api.github.com/users/dlitvakb/events{/privacy}", "followers_url": "https://api.github.com/users/dlitvakb/followers", "following_url": "https://api.github.com/users/dlitvakb/following{/other_user}", "gists_url": "https://api.github.com/users/dlitvakb/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/dlitvakb", "id": 1032706, "login": "dlitvakb", "node_id": "MDQ6VXNlcjEwMzI3MDY=", "organizations_url": "https://api.github.com/users/dlitvakb/orgs", "received_events_url": "https://api.github.com/users/dlitvakb/received_events", "repos_url": "https://api.github.com/users/dlitvakb/repos", "site_admin": false, "starred_url": "https://api.github.com/users/dlitvakb/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/dlitvakb/subscriptions", "type": "User", "url": "https://api.github.com/users/dlitvakb", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/756/reactions" }
https://api.github.com/repos/psf/requests/issues/756/timeline
null
completed
null
null
false
[ "Hi,\r\n\r\nSo how to use it ?\r\n\r\n```\r\nimport requests\r\n\r\nrequests.post(\"https://www.google.fr\", data={'q': 'test 1'}, quote_plus=True)\r\n```\r\n\r\n`\r\nTypeError: request() got an unexpected keyword argument 'quote_plus'\r\n`\r\n INSTALLED: 2.13.0 (latest)\r\n\r\n", "The option does not exist: this was never added. We recommend mutating a preparedrequest object instead. ", "@zen0x90 this was related to the pull request #757 which was no accepted. This feature wasn't accepted either. If you want to have your data `quote_plus`'d, you should do it yourself with [`quote_plus`](https://docs.python.org/3.5/library/urllib.parse.html#urllib.parse.quote_plus)", "ok I see thank you.\r\n" ]
https://api.github.com/repos/psf/requests/issues/755
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/755/labels{/name}
https://api.github.com/repos/psf/requests/issues/755/comments
https://api.github.com/repos/psf/requests/issues/755/events
https://github.com/psf/requests/pull/755
6,018,066
MDExOlB1bGxSZXF1ZXN0MTk2ODc0Mg==
755
Multipart filenames only sent if provided.
{ "avatar_url": "https://avatars.githubusercontent.com/u/62200?v=4", "events_url": "https://api.github.com/users/enginoid/events{/privacy}", "followers_url": "https://api.github.com/users/enginoid/followers", "following_url": "https://api.github.com/users/enginoid/following{/other_user}", "gists_url": "https://api.github.com/users/enginoid/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/enginoid", "id": 62200, "login": "enginoid", "node_id": "MDQ6VXNlcjYyMjAw", "organizations_url": "https://api.github.com/users/enginoid/orgs", "received_events_url": "https://api.github.com/users/enginoid/received_events", "repos_url": "https://api.github.com/users/enginoid/repos", "site_admin": false, "starred_url": "https://api.github.com/users/enginoid/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/enginoid/subscriptions", "type": "User", "url": "https://api.github.com/users/enginoid", "user_view_type": "public" }
[]
closed
true
null
[]
null
6
2012-08-03T16:11:44Z
2021-09-08T16:00:50Z
2012-08-03T17:11:34Z
NONE
resolved
Before this change, `filename` parameter (in `Content-Disposition`) was sent with every subpart in a multipart even if one was not provided. This changes request semantics, indicating to the server that the part is indeed a file. This commit fixes #732.
{ "avatar_url": "https://avatars.githubusercontent.com/u/62200?v=4", "events_url": "https://api.github.com/users/enginoid/events{/privacy}", "followers_url": "https://api.github.com/users/enginoid/followers", "following_url": "https://api.github.com/users/enginoid/following{/other_user}", "gists_url": "https://api.github.com/users/enginoid/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/enginoid", "id": 62200, "login": "enginoid", "node_id": "MDQ6VXNlcjYyMjAw", "organizations_url": "https://api.github.com/users/enginoid/orgs", "received_events_url": "https://api.github.com/users/enginoid/received_events", "repos_url": "https://api.github.com/users/enginoid/repos", "site_admin": false, "starred_url": "https://api.github.com/users/enginoid/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/enginoid/subscriptions", "type": "User", "url": "https://api.github.com/users/enginoid", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/755/reactions" }
https://api.github.com/repos/psf/requests/issues/755/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/755.diff", "html_url": "https://github.com/psf/requests/pull/755", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/755.patch", "url": "https://api.github.com/repos/psf/requests/pulls/755" }
true
[ "This pull request [fails](http://travis-ci.org/kennethreitz/requests/builds/2029683) (merged c50239b2 into 664880db).\n", "@enginous if you pull develop and merge, your PR should pass unless there's a way to kick @travisbot to merge it against the current head.\n", "There seem to be errors related to my change as well. I'll make sure to pull and merge after I've fixed those.\n", "Ah, okay. I hadn't tried them, I just know that @travisbot doesn't \nalways keep up.\n", "This pull request [fails](http://travis-ci.org/kennethreitz/requests/builds/2029758) (merged c50239b2 into 664880db).\n", "It's breaking tests and it's dawned on me reading through the tests that this isn't actually solving anything. See #732.\n" ]
https://api.github.com/repos/psf/requests/issues/754
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/754/labels{/name}
https://api.github.com/repos/psf/requests/issues/754/comments
https://api.github.com/repos/psf/requests/issues/754/events
https://github.com/psf/requests/pull/754
6,017,434
MDExOlB1bGxSZXF1ZXN0MTk2ODQzNA==
754
Fix raise_for_status()
{ "avatar_url": "https://avatars.githubusercontent.com/u/240830?v=4", "events_url": "https://api.github.com/users/sigmavirus24/events{/privacy}", "followers_url": "https://api.github.com/users/sigmavirus24/followers", "following_url": "https://api.github.com/users/sigmavirus24/following{/other_user}", "gists_url": "https://api.github.com/users/sigmavirus24/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/sigmavirus24", "id": 240830, "login": "sigmavirus24", "node_id": "MDQ6VXNlcjI0MDgzMA==", "organizations_url": "https://api.github.com/users/sigmavirus24/orgs", "received_events_url": "https://api.github.com/users/sigmavirus24/received_events", "repos_url": "https://api.github.com/users/sigmavirus24/repos", "site_admin": false, "starred_url": "https://api.github.com/users/sigmavirus24/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/sigmavirus24/subscriptions", "type": "User", "url": "https://api.github.com/users/sigmavirus24", "user_view_type": "public" }
[]
closed
true
null
[]
null
3
2012-08-03T15:43:44Z
2021-09-08T16:00:48Z
2012-08-03T16:21:28Z
CONTRIBUTOR
resolved
Found by @enginous https://github.com/kennethreitz/requests/commit/204649521bf8d165690b78a349d0f7c10d03bb99#requests/models.py-P27
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/754/reactions" }
https://api.github.com/repos/psf/requests/issues/754/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/754.diff", "html_url": "https://github.com/psf/requests/pull/754", "merged_at": "2012-08-03T16:21:28Z", "patch_url": "https://github.com/psf/requests/pull/754.patch", "url": "https://api.github.com/repos/psf/requests/pulls/754" }
true
[ "This pull request [passes](http://travis-ci.org/kennethreitz/requests/builds/2029564) (merged b4bc76f8 into 664880db).\n", "Thank you sir!\n", "Not a problem.\n" ]
https://api.github.com/repos/psf/requests/issues/753
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/753/labels{/name}
https://api.github.com/repos/psf/requests/issues/753/comments
https://api.github.com/repos/psf/requests/issues/753/events
https://github.com/psf/requests/pull/753
6,001,888
MDExOlB1bGxSZXF1ZXN0MTk2MDk3OQ==
753
Refactoring in |raise_for_status| method.
{ "avatar_url": "https://avatars.githubusercontent.com/u/26338?v=4", "events_url": "https://api.github.com/users/berkerpeksag/events{/privacy}", "followers_url": "https://api.github.com/users/berkerpeksag/followers", "following_url": "https://api.github.com/users/berkerpeksag/following{/other_user}", "gists_url": "https://api.github.com/users/berkerpeksag/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/berkerpeksag", "id": 26338, "login": "berkerpeksag", "node_id": "MDQ6VXNlcjI2MzM4", "organizations_url": "https://api.github.com/users/berkerpeksag/orgs", "received_events_url": "https://api.github.com/users/berkerpeksag/received_events", "repos_url": "https://api.github.com/users/berkerpeksag/repos", "site_admin": false, "starred_url": "https://api.github.com/users/berkerpeksag/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/berkerpeksag/subscriptions", "type": "User", "url": "https://api.github.com/users/berkerpeksag", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2012-08-02T20:50:02Z
2021-09-08T16:00:49Z
2012-08-02T20:52:36Z
MEMBER
resolved
- Simplified the if statements. - Remove duplicate code.
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/753/reactions" }
https://api.github.com/repos/psf/requests/issues/753/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/753.diff", "html_url": "https://github.com/psf/requests/pull/753", "merged_at": "2012-08-02T20:52:36Z", "patch_url": "https://github.com/psf/requests/pull/753.patch", "url": "https://api.github.com/repos/psf/requests/pulls/753" }
true
[ "Beautiful. Thanks!\n", "This pull request [fails](http://travis-ci.org/kennethreitz/requests/builds/2022784) (merged 20464952 into 54842cdc).\n" ]
https://api.github.com/repos/psf/requests/issues/752
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/752/labels{/name}
https://api.github.com/repos/psf/requests/issues/752/comments
https://api.github.com/repos/psf/requests/issues/752/events
https://github.com/psf/requests/pull/752
5,990,446
MDExOlB1bGxSZXF1ZXN0MTk1NTM4NA==
752
file posting example looked wrong
{ "avatar_url": "https://avatars.githubusercontent.com/u/147840?v=4", "events_url": "https://api.github.com/users/anentropic/events{/privacy}", "followers_url": "https://api.github.com/users/anentropic/followers", "following_url": "https://api.github.com/users/anentropic/following{/other_user}", "gists_url": "https://api.github.com/users/anentropic/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/anentropic", "id": 147840, "login": "anentropic", "node_id": "MDQ6VXNlcjE0Nzg0MA==", "organizations_url": "https://api.github.com/users/anentropic/orgs", "received_events_url": "https://api.github.com/users/anentropic/received_events", "repos_url": "https://api.github.com/users/anentropic/repos", "site_admin": false, "starred_url": "https://api.github.com/users/anentropic/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/anentropic/subscriptions", "type": "User", "url": "https://api.github.com/users/anentropic", "user_view_type": "public" }
[]
closed
true
null
[]
null
3
2012-08-02T11:58:08Z
2021-09-08T16:00:49Z
2012-08-02T11:59:38Z
CONTRIBUTOR
resolved
From what I can tell from the source code (down thru urllib3) the key in the `files` dict is always the 'fieldname', while specifying a custom 'filename' is optional. So in this example it was confusing to have a `fieldname` of 'report.xls' (the same as the filename) when all the other examples use a fieldname of 'file'.
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/752/reactions" }
https://api.github.com/repos/psf/requests/issues/752/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/752.diff", "html_url": "https://github.com/psf/requests/pull/752", "merged_at": "2012-08-02T11:59:38Z", "patch_url": "https://github.com/psf/requests/pull/752.patch", "url": "https://api.github.com/repos/psf/requests/pulls/752" }
true
[ "This pull request [passes](http://travis-ci.org/kennethreitz/requests/builds/2018277) (merged fdec88de into b4741853).\n", "Great insight. Thanks. :)\n", "thank _you_ for the awesome module!\n" ]
https://api.github.com/repos/psf/requests/issues/751
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/751/labels{/name}
https://api.github.com/repos/psf/requests/issues/751/comments
https://api.github.com/repos/psf/requests/issues/751/events
https://github.com/psf/requests/pull/751
5,989,893
MDExOlB1bGxSZXF1ZXN0MTk1NTEyNw==
751
Catch socket.gaierror in safe mode.
{ "avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4", "events_url": "https://api.github.com/users/Lukasa/events{/privacy}", "followers_url": "https://api.github.com/users/Lukasa/followers", "following_url": "https://api.github.com/users/Lukasa/following{/other_user}", "gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Lukasa", "id": 1382556, "login": "Lukasa", "node_id": "MDQ6VXNlcjEzODI1NTY=", "organizations_url": "https://api.github.com/users/Lukasa/orgs", "received_events_url": "https://api.github.com/users/Lukasa/received_events", "repos_url": "https://api.github.com/users/Lukasa/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions", "type": "User", "url": "https://api.github.com/users/Lukasa", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2012-08-02T11:19:14Z
2021-09-08T16:00:48Z
2012-08-02T20:53:06Z
MEMBER
resolved
This should resolve Issue #750. No explicit test in this pull request, let me know if you want one.
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/751/reactions" }
https://api.github.com/repos/psf/requests/issues/751/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/751.diff", "html_url": "https://github.com/psf/requests/pull/751", "merged_at": "2012-08-02T20:53:06Z", "patch_url": "https://github.com/psf/requests/pull/751.patch", "url": "https://api.github.com/repos/psf/requests/pulls/751" }
true
[ "This pull request [passes](http://travis-ci.org/kennethreitz/requests/builds/2018028) (merged 4f40b3be into b4741853).\n", "Thank you sir :)\n" ]
https://api.github.com/repos/psf/requests/issues/750
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/750/labels{/name}
https://api.github.com/repos/psf/requests/issues/750/comments
https://api.github.com/repos/psf/requests/issues/750/events
https://github.com/psf/requests/issues/750
5,981,929
MDU6SXNzdWU1OTgxOTI5
750
safe_mode not catching socket.gaierror
{ "avatar_url": "https://avatars.githubusercontent.com/u/379552?v=4", "events_url": "https://api.github.com/users/jassinm/events{/privacy}", "followers_url": "https://api.github.com/users/jassinm/followers", "following_url": "https://api.github.com/users/jassinm/following{/other_user}", "gists_url": "https://api.github.com/users/jassinm/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/jassinm", "id": 379552, "login": "jassinm", "node_id": "MDQ6VXNlcjM3OTU1Mg==", "organizations_url": "https://api.github.com/users/jassinm/orgs", "received_events_url": "https://api.github.com/users/jassinm/received_events", "repos_url": "https://api.github.com/users/jassinm/repos", "site_admin": false, "starred_url": "https://api.github.com/users/jassinm/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/jassinm/subscriptions", "type": "User", "url": "https://api.github.com/users/jassinm", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2012-08-01T23:54:30Z
2021-09-09T06:00:56Z
2012-08-02T17:33:57Z
NONE
resolved
doing a request to a non existsing server will raise socket.gaierror even if save_mode is set. ``` python import requests requests.get('http://x.lala.com', config={'safe_mode':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" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/750/reactions" }
https://api.github.com/repos/psf/requests/issues/750/timeline
null
completed
null
null
false
[ "Good catch! Pull Request #751 should resolve this.\n", "thanks this merge will fix the issue\n" ]
https://api.github.com/repos/psf/requests/issues/749
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/749/labels{/name}
https://api.github.com/repos/psf/requests/issues/749/comments
https://api.github.com/repos/psf/requests/issues/749/events
https://github.com/psf/requests/issues/749
5,979,220
MDU6SXNzdWU1OTc5MjIw
749
TLS SNI Support
{ "avatar_url": "https://avatars.githubusercontent.com/u/1297754?v=4", "events_url": "https://api.github.com/users/pythonmobile/events{/privacy}", "followers_url": "https://api.github.com/users/pythonmobile/followers", "following_url": "https://api.github.com/users/pythonmobile/following{/other_user}", "gists_url": "https://api.github.com/users/pythonmobile/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/pythonmobile", "id": 1297754, "login": "pythonmobile", "node_id": "MDQ6VXNlcjEyOTc3NTQ=", "organizations_url": "https://api.github.com/users/pythonmobile/orgs", "received_events_url": "https://api.github.com/users/pythonmobile/received_events", "repos_url": "https://api.github.com/users/pythonmobile/repos", "site_admin": false, "starred_url": "https://api.github.com/users/pythonmobile/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/pythonmobile/subscriptions", "type": "User", "url": "https://api.github.com/users/pythonmobile", "user_view_type": "public" }
[]
closed
true
null
[]
null
47
2012-08-01T21:40:20Z
2021-02-14T17:04:28Z
2013-02-10T22:33:58Z
NONE
resolved
It seems I'm having problems using requests with servers that need TLS SNI support. When will requests have this feature? Is this something that is planned? Thanks, --Ram
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/749/reactions" }
https://api.github.com/repos/psf/requests/issues/749/timeline
null
completed
null
null
false
[ "Not posisble in Python 2.x on top of the stdlib's ssl module.\n", "Twisted has it, right? Perhaps time to depend on pyopenssl or some other ssl module?\n", "There's a pull request for urllib3 adding SNI support for Py32+, but still needs test coverage. https://github.com/shazow/urllib3/pull/89\n", "shzow: Thanks for the pointer. I'm unfortunately using Twisted/Flask, which means I'm stuck to 2.7. Twisted it seems can do something like this, but i've not seen examples, and it would need pyopenssl + twisted decoding to do this. Am not an expert in either to pull this off. At this point, just thinking of wrapping some command line utility like wget... :(\n", "PyOpenSSL should be able to do it on 2.x. So there is hope.\n", "I could make it work with pyopenssl. But I still am having a hard time getting it done in twisted correctly. http://pbin.be/show/719/ -- kind of works. But then one has to build an API on it for it to be any useful. I still cant figure out how to pass the correct context to Agent. \n", "Lukasa: was this resolved? \n", "No. We're blocked on shazow/urllib3#89.\n", "Merged. Carry on. :)\n", "Note that it's only supported on Py32+ for now. Should be enough to get started though.\n", "Another fair warning: Some tests on Py32 are failing on urllib3 master right now. Some help resolving this would be greatly appreciated (and might affect this functionality): https://github.com/shazow/urllib3/issues/128\n", "works for me on archlinux x64 on py26, py27, py32, py33\n", "Ah I should have qualified that this is on OSX. Scumbag OSX.\n", "t-8ch: Are the sni tests passing on py26/27/32 and 33 for you? \n", "The SNI tests aren't even run on py2, but on py32 and py33 it works.\nThere is no way to do SNI with the ssl module of the standard library before py32.\n", "@shazow: Presumably you have no interest in making urllib3 depend on PyOpenSSL?\n", "I'd be happy to have a separate library which adds SSL via PyOpenSSL support to urllib3.\n", "It looks like @t-8ch is knocking it out of the park with the work on urllib3. I'll let him tell us when this can be closed.\n", "urllib3 has optional support for SNI with python2, though with a few optional dependencies. (See [urllib3#156](https://github.com/shazow/urllib3/pull/156)).\n\nI belive this should work using:\n\n```\nfrom requests.packages.urllib3.contrib import pyopenssl\npyopenssl.inject_into_urllib3\n```\n\nAfter adding this to `packages` in `setup.py`\n\n```\nrequests.packages.urllib3.contrib\n```\n\nNote that the `contrib` package is not imported by default.\n\nThere are basically two alternatives to enable SNI in requests:\n- Create function to manually enable SNI that basically runs the above code. (the downside is that users will need to explicitly enable SNI support).\n- Try to import the pre-requisites. If they exists, enable SNI, else don't.\n\nI've no problem implementing any of both alternatives, though I'd prefer to know which would be the prefer one for requests. I personally vote for the second alternative.\n\nBTW: can we reopen the issue, now that we have support from urllib3?\n", "I actually prefer the former because the people who need it are the ones who know they'll need it and they're few enough that it won't cause too many complaints. However, if we're going to be consistent with the existing API, the latter would be the way to implement it. Currently, urllib3 (and requests) will provide the API to send HTTPS requests without the ssl module present but will fail in the case where the ssl module is not available. In other words, the API is there and you can use it but it just won't work and that is indicated by an exception.\n\nAs to re-opening this, that's up to @kennethreitz. The issue of course (with all of this) is that we're currently under a feature freeze (#1165, #1168) so I'm not sure if the work is even worth doing because it might not be accepted.\n", "Let me be a bit clearer: what I meant by the second alternative was \"Try to use SNI if the optional deps are available, but still use SSL as we always have it they aren't.\". This shouldn't break anything existing up to now.\n\nAs for reopening (or not) the issue, IMHO, this issue shouldn't be taken lightly. requests can become useless without SNI support for many scenarios. In particular, multiple domains on a single IPv4 host without SNI become impossible. And additional IPv4 addresses are out of the questions for many users (due to their cost).\n\nIn any case, this is half feature, half bug, though I'll await @kennethreitz's reply regarding reopening the issue. \n", "Hugo: I just did pip install -U requests, and when I can't import contrib.\nHow do I fix that? (Importerror : No module named contrib).\n\nOn Fri, May 3, 2013 at 1:12 PM, Hugo Osvaldo Barrera <\[email protected]> wrote:\n\n> urllib3 has optional support for SNI with python2, though with a few\n> optional dependencies. (See urllib3#156https://github.com/shazow/urllib3/pull/156\n> ).\n> \n> I belive this should work using:\n> \n> from requests.packages.urllib3.contrib import pyopenssl\n> pyopenssl.inject_into_urllib3\n> \n> Note that the contrib package is not imported by default.\n> \n> There are basically two alternatives to enable SNI in requests:\n> - Create function to manually enable SNI that basically runs the above\n> code. (the downside is that users will need to explicitly enable SNI\n> support).\n> - Try to import the pre-requisites. If they exists, enable SNI, else\n> don't.\n> \n> I've no problem implementing any of both alternatives, though I'd prefer\n> to know which would be the prefer one for requests. I personally vote for\n> the second alternative.\n> \n> —\n> Reply to this email directly or view it on GitHubhttps://github.com/kennethreitz/requests/issues/749#issuecomment-17406518\n> .\n", "request's setup.py doesn't include that package (the source it's there, but it's excluded when installing/packaging), so it's not installed, that's why I mentioned:\n\n> After adding this to `packages in setup.py`\n> requests.packages.urllib3.contrib\n\nYou'll basically need to install from source.\nCheck out my pull request if you're interested, making this work is just a couple of lines. :)\n", "> \"Try to use SNI if the optional deps are available, but still use SSL as we always have it they aren't.\"\n\nSSL is not always there though. That was my point. Currently we try and use it but fail hard and fast if we don't have it and a user tries to make an https request. The way you had described it though, I was under the impression SNI would require the user to pass some extra notion to urllib3 and you were focusing on just the set-up for it. If all that is necessary is #1347 then I'm 100% behind this.\n", "It would be really nice if this was the default (SNI Support) and requests\njust works without any extra code or setup from source. For urllib3 its 2\nlines of code. Why not just add that to requests. Am I day dreaming? :)\n\nOn Fri, May 3, 2013 at 10:43 PM, Ian Cordasco [email protected]:\n\n> \"Try to use SNI if the optional deps are available, but still use SSL as\n> we always have it they aren't.\"\n> \n> SSL is not always there though. That was my point. Currently we try and\n> use it but fail hard and fast if we don't have it and a user tries to make\n> an https request. The way you had described it though, I was under the\n> impression SNI would require the user to pass some extra notion to urllib3\n> and you were focusing on just the set-up for it. If all that is necessary\n> is #1347 https://github.com/kennethreitz/requests/issues/1347 then I'm\n> 100% behind this.\n> \n> —\n> Reply to this email directly or view it on GitHubhttps://github.com/kennethreitz/requests/issues/749#issuecomment-17426626\n> .\n", "@pythonmobile spin a top. If it doesn't stop spinning, you're dreaming.\n\n![inception](https://gs1.wac.edgecastcdn.net/8019B6/data.tumblr.com/tumblr_lzpbw5SP2X1r94e9jo1_500.gif)\n", "Leaving a comment for the sake of others who may run into the same issue as me:\nIf you are having trouble making secure requests using the `requests` library, in particular when trying to hit an app hosted on Google App Engine, this may be why. The error I was seeing was \"EOF occurred in violation of protocol\". To diagnose this, try hitting the same host using `s_client` (replace `example.com` with the host in question):\n\n```\nopenssl s_client -connect example.com:443\nopenssl s_client -connect example.com:443 -servername example.com\n```\n\nIf the first command fails with \"handshake failure\" and the second succeeds, then you are trying to hit a server that uses SNI. The present thread has some good info on how to get `requests` working in this situation. What I did was try to run `from requests.packages.urllib3.contrib import pyopenssl` in ipython, and I kept on pip installing any import errors. YMMV.\n", "@mshang Version 1.2.3 should do this for you already; are you sure you're running that version?\n", "@hobarrera Yes, I'm running 1.2.3. `requests.packages.urllib3.contrib` was there, but that import statements still threw a bunch of import errors. I had to install `ndg-httpsclient` and I forget what else.\n", "Correct. Requests just attempts to import the needed modules, and if it can't gives up and goes on with its life. It might be a good idea to document what you need to use SNI with Requests, though.\n" ]
https://api.github.com/repos/psf/requests/issues/748
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/748/labels{/name}
https://api.github.com/repos/psf/requests/issues/748/comments
https://api.github.com/repos/psf/requests/issues/748/events
https://github.com/psf/requests/issues/748
5,976,184
MDU6SXNzdWU1OTc2MTg0
748
On connection refused, socket.error instead of requests.exceptions.ConnectionError
{ "avatar_url": "https://avatars.githubusercontent.com/u/188869?v=4", "events_url": "https://api.github.com/users/stfp/events{/privacy}", "followers_url": "https://api.github.com/users/stfp/followers", "following_url": "https://api.github.com/users/stfp/following{/other_user}", "gists_url": "https://api.github.com/users/stfp/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/stfp", "id": 188869, "login": "stfp", "node_id": "MDQ6VXNlcjE4ODg2OQ==", "organizations_url": "https://api.github.com/users/stfp/orgs", "received_events_url": "https://api.github.com/users/stfp/received_events", "repos_url": "https://api.github.com/users/stfp/repos", "site_admin": false, "starred_url": "https://api.github.com/users/stfp/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/stfp/subscriptions", "type": "User", "url": "https://api.github.com/users/stfp", "user_view_type": "public" }
[]
closed
true
null
[]
null
6
2012-08-01T19:23:06Z
2021-09-09T06:00:54Z
2012-08-08T20:22:18Z
NONE
resolved
With requests==0.11.1 > > > requests.get('http://127.0.0.1') > > > Traceback (most recent call last): > > > File "<stdin>", line 1, in <module> > > > File "/var/blah/envs/dev/lib/python2.7/site-packages/requests/api.py", line 52, in get > > > return request('get', url, *_kwargs) > > > File "/var/blah/envs/dev/lib/python2.7/site-packages/requests/api.py", line 40, in request > > > return s.request(method=method, url=url, *_kwargs) > > > File "/var/blah/envs/dev/lib/python2.7/site-packages/requests/sessions.py", line 208, in request > > > r.send(prefetch=prefetch) > > > File "/var/blah/envs/dev/lib/python2.7/site-packages/requests/models.py", line 580, in send > > > raise ConnectionError(e) > > > requests.exceptions.ConnectionError: HTTPConnectionPool(host='127.0.0.1', port=80): Max retries exceeded with url: / With requests==0.13.5 > > > requests.get('http://127.0.0.1') > > > Traceback (most recent call last): > > > File "<stdin>", line 1, in <module> > > > File "/var/blah/envs/dev/lib/python2.7/site-packages/requests/api.py", line 54, in get > > > return request('get', url, *_kwargs) > > > File "/var/blah/envs/dev/lib/python2.7/site-packages/requests/safe_mode.py", line 37, in wrapped > > > return function(method, url, *_kwargs) > > > File "/var/blah/envs/dev/lib/python2.7/site-packages/requests/api.py", line 42, in request > > > return s.request(method=method, url=url, *_kwargs) > > > File "/var/blah/envs/dev/lib/python2.7/site-packages/requests/sessions.py", line 230, in request > > > r.send(prefetch=prefetch) > > > File "/var/blah/envs/dev/lib/python2.7/site-packages/requests/models.py", line 603, in send > > > timeout=self.timeout, > > > File "/var/blah/envs/dev/lib/python2.7/site-packages/requests/packages/urllib3/connectionpool.py", line 415, in urlopen > > > body=body, headers=headers) > > > File "/var/blah/envs/dev/lib/python2.7/site-packages/requests/packages/urllib3/connectionpool.py", line 267, 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 941, in request > > > self._send_request(method, url, body, headers) > > > File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 975, in _send_request > > > self.endheaders(body) > > > File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 937, in endheaders > > > self._send_output(message_body) > > > File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 797, in _send_output > > > self.send(msg) > > > File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 759, in send > > > self.connect() > > > File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 740, in connect > > > self.timeout, self.source_address) > > > File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/socket.py", line 571, in create_connection > > > raise err > > > socket.error: [Errno 61] Connection refused
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/748/reactions" }
https://api.github.com/repos/psf/requests/issues/748/timeline
null
completed
null
null
false
[ "This was fixed a long time ago, please update :)\n", "I'm confused, isn't 0.13.5 the latest release ?\n", "Oh, I'm sorry, I only saw the first traceback :)\n", "Cool! Quick git bisect seems to point to https://github.com/kennethreitz/requests/commit/e02fb2eb6c2acfa67793a2c77a3c7bd47998a024 \n", "This was caused by a change in urllib3 which broke socket.error catching in their connection pool. I've submitted a pull request that fixes it:\n\nhttps://github.com/shazow/urllib3/pull/92\n\nThis should fix the issue once the change gets into the urllib3 version bundled with requests.\n", "#648\n" ]
https://api.github.com/repos/psf/requests/issues/747
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/747/labels{/name}
https://api.github.com/repos/psf/requests/issues/747/comments
https://api.github.com/repos/psf/requests/issues/747/events
https://github.com/psf/requests/issues/747
5,928,424
MDU6SXNzdWU1OTI4NDI0
747
requests.{post,patch} set Content-Type to application/x-www-form-urlencoded even when ``data`` arg is a string
{ "avatar_url": "https://avatars.githubusercontent.com/u/576874?v=4", "events_url": "https://api.github.com/users/nisavid/events{/privacy}", "followers_url": "https://api.github.com/users/nisavid/followers", "following_url": "https://api.github.com/users/nisavid/following{/other_user}", "gists_url": "https://api.github.com/users/nisavid/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/nisavid", "id": 576874, "login": "nisavid", "node_id": "MDQ6VXNlcjU3Njg3NA==", "organizations_url": "https://api.github.com/users/nisavid/orgs", "received_events_url": "https://api.github.com/users/nisavid/received_events", "repos_url": "https://api.github.com/users/nisavid/repos", "site_admin": false, "starred_url": "https://api.github.com/users/nisavid/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/nisavid/subscriptions", "type": "User", "url": "https://api.github.com/users/nisavid", "user_view_type": "public" }
[ { "color": "e10c02", "default": false, "description": null, "id": 117744, "name": "Bug", "node_id": "MDU6TGFiZWwxMTc3NDQ=", "url": "https://api.github.com/repos/psf/requests/labels/Bug" }, { "color": "0b02e1", "default": false, "description": null, "id": 191274, "name": "Contributor Friendly", "node_id": "MDU6TGFiZWwxOTEyNzQ=", "url": "https://api.github.com/repos/psf/requests/labels/Contributor%20Friendly" } ]
closed
true
null
[]
null
3
2012-07-30T20:18:22Z
2021-09-09T06:00:56Z
2012-08-04T15:39:39Z
NONE
resolved
the Requests documentation [clearly states](http://docs.python-requests.org/en/latest/user/quickstart/#more-complicated-post-requests), > There are many times that you want to send data that is not form-encoded. If you pass in a `string` instead of a `dict`, that data will be posted directly. i presume that it's safe to interpret "`string`" here as meaning "`str` or `unicode`" (minor documentation error). i'm not sure what the string being "posted directly" is supposed to mean. i suppose it should mean that the request's `Content-Type` is `text/plain`, since that's a reasonable interpretation of a generic string. in any case, i'm quite sure that it's _not_ supposed to mean that the string is passed in as form-encoded data. that would defeat the stated purpose of passing in a string instead of a `dict`. unfortunately, passing a `str` as the `data` does in fact cause the request to have `Content-Type` `application/x-www-form-urlencoded`, just as in the `dict` case. either this behavior is incorrect or the documentation is incorrect. i'd prefer it to be the former. the automatic conversion of a `dict` of parameters as form-encoded data seems to be specific to the case where `data` is a mapping (in fact, i'd prefer this special case to likewise interpret any `collections.Mapping` objects rather than just `dict`s). when `data` is a string, on the other hand, it seems natural to interpret it as a plain-text string (`text/plain`) unless otherwise specified. in other words, the particular media type of the request entity is application-dependent; automatically applying `application/x-www-form-urlencoded` is an act of incorrectly imposing one application's assumptions on another. the current behavior leads to confusing bugs when a user forgets to specify the proper media type, Requests (incorrectly) applies `application/x-www-form-urlencoded`, and the receiving server subsequently parses the entity (incorrectly) as such. `text/plain` has no inherent syntax, so an unsuspecting web server will not mangle it if the user forgets to specify the correct media type.
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/747/reactions" }
https://api.github.com/repos/psf/requests/issues/747/timeline
null
completed
null
null
false
[ "It's intentionally labelled as \"string\" because you can pass either byte strings or unicode. Depends on the version of Python and your use case.\n\nWe should not be setting that content-type header though, nice catch :)\n", "I started working on this and wrote a regression test that exposes the problem, but I wanted to get your opinion on how you want this fixed @kennethreitz . My first question is do you want the content-type header to be text/plain or do you just want it unset? The second question is in how to fix it. The issue is that the compat.py rebinds str to be the unicode class so in models.py line 496 where there is a check for `instanceof(self.data, str)` where str is actually unicode and not the __builtin__.str. Should I just add in another isinstance check for the __builtin__ str type or do something else? Let me know how you would like this fixed and I can put in a pull request.\n", "It should be unset.\n" ]
https://api.github.com/repos/psf/requests/issues/746
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/746/labels{/name}
https://api.github.com/repos/psf/requests/issues/746/comments
https://api.github.com/repos/psf/requests/issues/746/events
https://github.com/psf/requests/pull/746
5,878,509
MDExOlB1bGxSZXF1ZXN0MTkwODk0MQ==
746
Fixed encoding of fields with the same name, multipart/form-data fixes.
{ "avatar_url": "https://avatars.githubusercontent.com/u/326885?v=4", "events_url": "https://api.github.com/users/jkbrzt/events{/privacy}", "followers_url": "https://api.github.com/users/jkbrzt/followers", "following_url": "https://api.github.com/users/jkbrzt/following{/other_user}", "gists_url": "https://api.github.com/users/jkbrzt/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/jkbrzt", "id": 326885, "login": "jkbrzt", "node_id": "MDQ6VXNlcjMyNjg4NQ==", "organizations_url": "https://api.github.com/users/jkbrzt/orgs", "received_events_url": "https://api.github.com/users/jkbrzt/received_events", "repos_url": "https://api.github.com/users/jkbrzt/repos", "site_admin": false, "starred_url": "https://api.github.com/users/jkbrzt/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/jkbrzt/subscriptions", "type": "User", "url": "https://api.github.com/users/jkbrzt", "user_view_type": "public" }
[]
closed
true
null
[]
null
16
2012-07-27T15:17:21Z
2021-09-08T23:11:03Z
2012-08-11T06:30:21Z
CONTRIBUTOR
resolved
- Properly handle repeated data fields for multipart/form-data requests (#737) - Allow a list of 2-tuples as the `files` agument. - Consistently serialize lists a of parameters (#729). - Use BytesIO for bytes.
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/746/reactions" }
https://api.github.com/repos/psf/requests/issues/746/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/746.diff", "html_url": "https://github.com/psf/requests/pull/746", "merged_at": "2012-08-11T06:30:21Z", "patch_url": "https://github.com/psf/requests/pull/746.patch", "url": "https://api.github.com/repos/psf/requests/pulls/746" }
true
[ "This pull request [fails](http://travis-ci.org/kennethreitz/requests/builds/1970172) (merged 1f7aeacb into 02dcc40a).\n", "Looks good to me. I'm uncomfortable merging pull requests on @kennethreitz 's behalf, so I'll let him do it.\n\nThat TravisCI failure is worrying me, because it seems to come and go, and not be related to the contents of a particular build. /pensiveface\n", "Yeah, It looks like Travis or httpbin.org is having hiccups:\n\n```\nHTTPError: 503 Server Error: Service Unavailable\n-------------------- >> begin captured logging << --------------------\nrequests.packages.urllib3.connectionpool: INFO: Starting new HTTP connection (1): httpbin.org\nrequests.packages.urllib3.connectionpool: DEBUG: \"GET /redirect/4 HTTP/1.1\" 503 601\n49--------------------- >> end captured logging << ------------------\n```\n\nI was running the tests locally and got some 5xx's as well but they seemed unrelated to my changes and also happened with the stable requests release, but still it would be good to have a successful run of the tests.\n", "What bothers me more is not that these issues are happening, but that on Travis running Python 3.2 the actual cause of the error is totally obscured by some exceptions thrown in `nose` or `traceback`. If I could at least see for sure that they're 5xx's I'd be happier ignoring the failure.\n", "@Lukasa if you edit the verbosity of the tests in a local branch of yours and set up Travis with it, you should be able to get more information on your own from Travis.\n", "Ah, good idea. =)\n\nIf they're 5xx's though, it's probably on httpbin.org's side (aka. it's @kennethreitz 's problem, not mine. =D ).\n", "This pull request [fails](http://travis-ci.org/kennethreitz/requests/builds/1988839) (merged 181d8967 into 02dcc40a).\n", "Any feedback on the changes?\n", "Hmm, looks like your branch is a bit stale — would you mind updating it?\n", "This pull request [fails](http://travis-ci.org/kennethreitz/requests/builds/2088411) (merged dee3693e into 64646182).\n", "Sure, rebased against upstream. All tests pass when run locally.\n", "Not on Python 3 :) \n", "This pull request [passes](http://travis-ci.org/kennethreitz/requests/builds/2092783) (merged 88c762e2 into 64646182).\n", "Woo!\n", "Thanks for the awesome work :sparkles: :cake: :sparkles:\n", "Ups, fixed now. Got confused by the strange Travis log.\n\nBTW, I have good experience with [Tox](http://tox.testrun.org/latest/) ([example config](https://github.com/jkbr/httpie/blob/master/tox.ini)). It makes it very easy to run tests on multiple Pythons also locally.\n" ]
https://api.github.com/repos/psf/requests/issues/745
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/745/labels{/name}
https://api.github.com/repos/psf/requests/issues/745/comments
https://api.github.com/repos/psf/requests/issues/745/events
https://github.com/psf/requests/issues/745
5,876,640
MDU6SXNzdWU1ODc2NjQw
745
SSL handshake error
{ "avatar_url": "https://avatars.githubusercontent.com/u/106409?v=4", "events_url": "https://api.github.com/users/dArignac/events{/privacy}", "followers_url": "https://api.github.com/users/dArignac/followers", "following_url": "https://api.github.com/users/dArignac/following{/other_user}", "gists_url": "https://api.github.com/users/dArignac/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/dArignac", "id": 106409, "login": "dArignac", "node_id": "MDQ6VXNlcjEwNjQwOQ==", "organizations_url": "https://api.github.com/users/dArignac/orgs", "received_events_url": "https://api.github.com/users/dArignac/received_events", "repos_url": "https://api.github.com/users/dArignac/repos", "site_admin": false, "starred_url": "https://api.github.com/users/dArignac/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/dArignac/subscriptions", "type": "User", "url": "https://api.github.com/users/dArignac", "user_view_type": "public" }
[]
closed
true
null
[]
null
7
2012-07-27T13:51:55Z
2021-09-09T06:00:57Z
2012-07-30T10:36:17Z
NONE
resolved
With the current version, 0.13.5, when I try to get from a page with an unsigned ssl certificate the whole request blocks, so the execution of the normal code is blocked. If I cancel the execution, the error below was generated. Using Python 2.7.2. I used version 0.11.2 before, there everything works. ``` >>> import requests >>> r = requests.get('https://127.0.0.1:8015/', verify=False) (nothing happens, no return, unable to execute another statement) ``` Error after Ctrl+C: ``` File "<stdin>", line 1, in <module> File "/home/darignac/ve/tests/lib/python2.7/site-packages/requests/api.py", line 54, in get return request('get', url, **kwargs) File "/home/darignac/ve/tests/lib/python2.7/site-packages/requests/safe_mode.py", line 37, in wrapped return function(method, url, **kwargs) File "/home/darignac/ve/tests/lib/python2.7/site-packages/requests/api.py", line 42, in request return s.request(method=method, url=url, **kwargs) File "/home/darignac/ve/tests/lib/python2.7/site-packages/requests/sessions.py", line 230, in request r.send(prefetch=prefetch) File "/home/darignac/ve/tests/lib/python2.7/site-packages/requests/models.py", line 603, in send timeout=self.timeout, File "/home/darignac/ve/tests/lib/python2.7/site-packages/requests/packages/urllib3/poolmanager.py", line 153, in urlopen return self.proxy_pool.urlopen(method, url, **kw) File "/home/darignac/ve/tests/lib/python2.7/site-packages/requests/packages/urllib3/connectionpool.py", line 415, in urlopen body=body, headers=headers) File "/home/darignac/ve/tests/lib/python2.7/site-packages/requests/packages/urllib3/connectionpool.py", line 267, in _make_request conn.request(method, url, **httplib_request_kw) File "/usr/local/lib/python2.7/httplib.py", line 955, in request self._send_request(method, url, body, headers) File "/usr/local/lib/python2.7/httplib.py", line 989, in _send_request self.endheaders(body) File "/usr/local/lib/python2.7/httplib.py", line 951, in endheaders self._send_output(message_body) File "/usr/local/lib/python2.7/httplib.py", line 811, in _send_output self.send(msg) File "/usr/local/lib/python2.7/httplib.py", line 773, in send self.connect() File "/home/darignac/ve/tests/lib/python2.7/site-packages/requests/packages/urllib3/connectionpool.py", line 101, in connect ca_certs=self.ca_certs) File "/usr/local/lib/python2.7/ssl.py", line 372, in wrap_socket ciphers=ciphers) File "/usr/local/lib/python2.7/ssl.py", line 134, in __init__ self.do_handshake() File "/usr/local/lib/python2.7/ssl.py", line 296, in do_handshake self._sslobj.do_handshake() ```
{ "avatar_url": "https://avatars.githubusercontent.com/u/106409?v=4", "events_url": "https://api.github.com/users/dArignac/events{/privacy}", "followers_url": "https://api.github.com/users/dArignac/followers", "following_url": "https://api.github.com/users/dArignac/following{/other_user}", "gists_url": "https://api.github.com/users/dArignac/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/dArignac", "id": 106409, "login": "dArignac", "node_id": "MDQ6VXNlcjEwNjQwOQ==", "organizations_url": "https://api.github.com/users/dArignac/orgs", "received_events_url": "https://api.github.com/users/dArignac/received_events", "repos_url": "https://api.github.com/users/dArignac/repos", "site_admin": false, "starred_url": "https://api.github.com/users/dArignac/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/dArignac/subscriptions", "type": "User", "url": "https://api.github.com/users/dArignac", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/745/reactions" }
https://api.github.com/repos/psf/requests/issues/745/timeline
null
completed
null
null
false
[ "Odd, that doesn't seem to be coming from Requests at all.\n\nI don't have the time to spin up a web server and a self-signed cert right now, but if I use https://www.pcwebshop.co.uk/, which is a publicly accessible webpage with a self-signed cert, using Python 2.7.1:\n\n``` python\n>>> import requests\n>>> r = requests.get('https://www.pcwebshop.co.uk/')\nTraceback (most recent call last):\n...snip...\nSSLError: [Errno 1] certificate verify failed\n>>> r = requests.get('https://www.pcwebshop.co.uk/', verify = False)\n>>> r.status_code\n200\n```\n\nDo you show the same behaviour with that site as I do, or do you hang?\n", "Hi Cory, thanks for getting back. I'll check this on monday as I'm not in the office right now.\n", "Whether using verify=True or verify=False, when calling the get method on the pcwebshop site my Python just hangs up, I have to cancel with Ctrl+C an get the error I mentioned before. I waited like 10 minutes before I canceled.\n", "Right, so the most obvious difference between your machine and mine is the Python version. At some point today I'll try to spin up a VM and see if I can reproduce the issue using Python 2.7.2.\n", "Right, I don't get a hang when using 2.7.2 on OS X. Unfortunately, the top of your stack trace is in `_ssl`, which is a library that is a `.so` in my 2.7.2 install.\n\nMy suspicion would be that there is something not-quite-right with your Python install. Is 2.7.2 the version that was installed with your machine, or have you changed it recently?\n", "The 2.7.2 install is not the system installation, it's an alternative I once installed a while ago (using Ubuntu 10 with Python 2.6 as default). I'll check the behaviour on a linux with 2.7 as default installation.\nMeanwhile, I waited until the \"request.get(...)\" timed out (which took like forever), the output was\n\n```\nrequests.exceptions.SSLError: [Errno 8] _ssl.c:503: EOF occurred in violation of protocol\n```\n", "Ok, I checked it on Ubuntu 12 with Python 2.7.3, there it works. I don't even get the \"certificate verify failed\" error, which maybe is an error? Usage of verify seems to be ignored, at least there is no difference in requesting with varify=True or varify=False.\nSo it seems to be an issue on my 2.7.2 installation (althoug the old version did work, weird...) Sorry for bothering you and thanks for the help!\n" ]
https://api.github.com/repos/psf/requests/issues/744
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/744/labels{/name}
https://api.github.com/repos/psf/requests/issues/744/comments
https://api.github.com/repos/psf/requests/issues/744/events
https://github.com/psf/requests/pull/744
5,874,223
MDExOlB1bGxSZXF1ZXN0MTkwNjk0Mw==
744
Set content type before authentication
{ "avatar_url": "https://avatars.githubusercontent.com/u/97768?v=4", "events_url": "https://api.github.com/users/tax/events{/privacy}", "followers_url": "https://api.github.com/users/tax/followers", "following_url": "https://api.github.com/users/tax/following{/other_user}", "gists_url": "https://api.github.com/users/tax/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/tax", "id": 97768, "login": "tax", "node_id": "MDQ6VXNlcjk3NzY4", "organizations_url": "https://api.github.com/users/tax/orgs", "received_events_url": "https://api.github.com/users/tax/received_events", "repos_url": "https://api.github.com/users/tax/repos", "site_admin": false, "starred_url": "https://api.github.com/users/tax/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/tax/subscriptions", "type": "User", "url": "https://api.github.com/users/tax", "user_view_type": "public" }
[]
closed
true
null
[]
null
3
2012-07-27T11:19:54Z
2021-09-08T16:00:48Z
2012-07-31T01:13:17Z
CONTRIBUTOR
resolved
AWS S3 authentication adds content type header (when it exist) to canonical string that is signed. Since it is set after authentication is done authentication on S3 fails
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/744/reactions" }
https://api.github.com/repos/psf/requests/issues/744/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/744.diff", "html_url": "https://github.com/psf/requests/pull/744", "merged_at": "2012-07-31T01:13:17Z", "patch_url": "https://github.com/psf/requests/pull/744.patch", "url": "https://api.github.com/repos/psf/requests/pulls/744" }
true
[ "This pull request [passes](http://travis-ci.org/kennethreitz/requests/builds/1968492) (merged 5e175ef2 into 02dcc40a).\n", "A little more context: https://github.com/tax/python-requests-aws this is the authentication backend. \n", "Awesome, thanks!\n" ]
https://api.github.com/repos/psf/requests/issues/743
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/743/labels{/name}
https://api.github.com/repos/psf/requests/issues/743/comments
https://api.github.com/repos/psf/requests/issues/743/events
https://github.com/psf/requests/issues/743
5,868,208
MDU6SXNzdWU1ODY4MjA4
743
Case for OAuth with multipart/form-data signing parameters when files are present
{ "avatar_url": "https://avatars.githubusercontent.com/u/145617?v=4", "events_url": "https://api.github.com/users/djt/events{/privacy}", "followers_url": "https://api.github.com/users/djt/followers", "following_url": "https://api.github.com/users/djt/following{/other_user}", "gists_url": "https://api.github.com/users/djt/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/djt", "id": 145617, "login": "djt", "node_id": "MDQ6VXNlcjE0NTYxNw==", "organizations_url": "https://api.github.com/users/djt/orgs", "received_events_url": "https://api.github.com/users/djt/received_events", "repos_url": "https://api.github.com/users/djt/repos", "site_admin": false, "starred_url": "https://api.github.com/users/djt/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/djt/subscriptions", "type": "User", "url": "https://api.github.com/users/djt", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2012-07-27T01:27:36Z
2021-09-09T07:05:19Z
2012-07-27T06:11:22Z
NONE
resolved
Not 100% sure if there is a wider use case for this, but working with the tumblr API (and I believe others, will investigate further soon) submitting a post request with an attached file, as well as other data, requires that the data dict be included in the signature. The following code does not sign the data dict at all as it removes it from the request. ``` python if r.files: # Omit body data in the signing and since it will always # be empty (cant add paras to body if multipart) and we wish # to preserve body. r.headers['Content-Type'] = 'multipart/form-encoded' r.url, r.headers, _ = self.client.sign( unicode(r.full_url), unicode(r.method), None, r.headers) ``` I can confirm that if I bypass the check for files, the signature will include the data dict (but not the attached files), and produce the needed signed request. Is Tumblr out of spec for this, or could it be that the check for files is not needed?
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/743/reactions" }
https://api.github.com/repos/psf/requests/issues/743/timeline
null
completed
null
null
false
[ "@idan @dgouldin @gulopine?\n", "Interesting. Dropbox puts their parameters in the QueryString, even for a file PUT. Of course, they also use a plaintext signature, which doesn't take the parameters into account anyway.\n" ]
https://api.github.com/repos/psf/requests/issues/742
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/742/labels{/name}
https://api.github.com/repos/psf/requests/issues/742/comments
https://api.github.com/repos/psf/requests/issues/742/events
https://github.com/psf/requests/issues/742
5,867,546
MDU6SXNzdWU1ODY3NTQ2
742
SSL certs aren't working with https://graph.facebook.com in Mac OS
{ "avatar_url": "https://avatars.githubusercontent.com/u/464746?v=4", "events_url": "https://api.github.com/users/yeeland/events{/privacy}", "followers_url": "https://api.github.com/users/yeeland/followers", "following_url": "https://api.github.com/users/yeeland/following{/other_user}", "gists_url": "https://api.github.com/users/yeeland/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/yeeland", "id": 464746, "login": "yeeland", "node_id": "MDQ6VXNlcjQ2NDc0Ng==", "organizations_url": "https://api.github.com/users/yeeland/orgs", "received_events_url": "https://api.github.com/users/yeeland/received_events", "repos_url": "https://api.github.com/users/yeeland/repos", "site_admin": false, "starred_url": "https://api.github.com/users/yeeland/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/yeeland/subscriptions", "type": "User", "url": "https://api.github.com/users/yeeland", "user_view_type": "public" }
[]
closed
true
null
[]
null
10
2012-07-27T00:23:42Z
2021-09-09T04:00:37Z
2012-07-27T05:42:26Z
NONE
resolved
I hope it's not something I'm doing wrong but... > import requests > requests.get('https://graph.facebook.com') and I get this: > requests.exceptions.SSLError: [Errno 1] _ssl.c:480: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed in line 604 of requests/models.py My cert_loc seems to be going with the DEFAULT_CA_BUNDLE_PATH, which is certifi/cacert.pem. I made sure that I have the latest certifi, too. Anyone have any ideas?
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/742/reactions" }
https://api.github.com/repos/psf/requests/issues/742/timeline
null
completed
null
null
false
[ "Usually an OpenSSL version difference.\n", "Looks like I was on 0.9.8r. I just upgraded to 1.0.1c and I'm still getting the same error.\n", "Please make sure you're using the latest version of Requests as well.\n", "Closing until further reports emerge.\n", "I'm having exactly this issue on MacOSX 10.8.3 with OpenSSL 0.9.8r Feb 2011. My Windows 7 machine will connect and verify just fine, but the Mac throws the SSL3_GET_SERVER_CERTIFICATE:certificate verify failed error as listed above.\nThis is using 1.2.0 of requests, Python 2.7.2 (On Mac)/Python 2.7 (on Windows).\n", "What URL is causing it? I have the same setup, so I'm interested to see if I can reproduce it.\n", "connection = requests.get(u'https://forums.eveonline.com', verify=True, stream=True)\n", "Hmm, works fine for me. What version of Requests are you using?\n", "For me:\n\n``` python\n>>> import requests \n>>> r = requests.get('https://forums.eveonline.com', verify=True, stream=True)\n>>> r\n<Response [200]>\n>>> q = requests.get('https://graph.facebook.com')\n>>> q\n<Response [400]>\n```\n\nOn linux with python 2.6 and python 3.2. I think python 2.7.4 (which was recently released) contained some corrections to the ssl module, could you try installing that?\n", "For me the same as for sigmavirus24 with py26,27,31 and 32.\nWhat response does the following give you?\n\n``` sh\nopenssl s_client -connect forums.eveonline.com:443 -CAfile `python -c 'import requests; print(requests.certs.where())'`\n```\n\n(Note the backticks)\n\nThe commandline version has much better error reporting than pythons' version.\n" ]
https://api.github.com/repos/psf/requests/issues/741
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/741/labels{/name}
https://api.github.com/repos/psf/requests/issues/741/comments
https://api.github.com/repos/psf/requests/issues/741/events
https://github.com/psf/requests/issues/741
5,865,930
MDU6SXNzdWU1ODY1OTMw
741
Multiple Link: headers in response
{ "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
15
2012-07-26T22:30:16Z
2021-09-09T05:29:59Z
2012-07-27T00:08:19Z
CONTRIBUTOR
resolved
Using 0.13.3 requests So let's see, we have a URI with multiple links ``` curl -I http://www.la-grange.net/2012/07/26/csstests/foo HTTP/1.1 200 OK Date: Thu, 26 Jul 2012 22:27:21 GMT Server: Apache Content-Location: foo.html Vary: negotiate,Accept-Encoding TCN: choice Last-Modified: Thu, 26 Jul 2012 20:55:56 GMT Accept-Ranges: bytes Content-Length: 675 Expires: Thu, 02 Aug 2012 22:27:21 GMT Link: </2012/07/26/csstests/csshttplink.css>;rel=stylesheet Link: </>;rel=next Content-Type: text/html; charset=utf-8 ``` Let's use requests to inspect the Link. ``` >>> import requests >>> r = requests.get('http://www.la-grange.net/2012/07/26/csstests/foo') >>> r.headers {'content-length': '375', 'content-location': 'foo.html', 'content-encoding': 'gzip', 'accept-ranges': 'bytes', 'expires': 'Thu, 02 Aug 2012 22:19:41 GMT', 'vary': 'negotiate,Accept-Encoding', 'server': 'Apache', 'tcn': 'choice', 'last-modified': 'Thu, 26 Jul 2012 20:55:56 GMT', 'link': '</2012/07/26/csstests/csshttplink.css>;rel=stylesheet, </>;rel=next', 'date': 'Thu, 26 Jul 2012 22:19:41 GMT', 'content-type': 'text/html; charset=utf-8'} >>> r.headers['link'] '</2012/07/26/csstests/csshttplink.css>;rel=stylesheet, </>;rel=next' ``` Not right :) I haven't dig yet in the source code where the parsing of link headers was happening. But putting it here before I forget.
{ "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/741/reactions" }
https://api.github.com/repos/psf/requests/issues/741/timeline
null
completed
null
null
false
[ "This is a side effect of how httplib works, unfortunately.\n", "So from `utils.py`, requests is using `urllib2.py` to parse the headers: `parse_http_list(s)` but it doesn't seem it is it. \nin `response.py` ?\n", "It happens before any of that, at the actual httplib level, deep within urllib3.\n", "ah ok requests is a bit of syntactic sugar on the broken httplib for this part. :/ hmmm\n\n```\n>>> import httplib\n>>> class HTTP11(httplib.HTTP):\n... _http_vsn = 11\n... _http_vsn_str = 'HTTP/1.1'\n... \n>>> h = HTTP11('www.la-grange.net')\n>>> h.putrequest('GET', 'http://www.la-grange.net/2012/07/26/csstests/foo')\n>>> h.endheaders()\n>>> status, reason, headers = h.getreply()\n>>> h.close()\n>>> headers.keys()\n['content-length', 'content-location', 'accept-ranges', 'expires', 'vary', 'server', 'tcn', 'last-modified', 'link', 'date', 'content-type']\n>>> headers['link']\n'</2012/07/26/csstests/csshttplink.css>;rel=stylesheet, </>;rel=next'\n>>>\n```\n\nIndeed.\n", "Way more than syntactic sugar, but yes, that's where the problem lies.\n\nWe have plans to fix this I believe, right @shazow?\n", "Correct:\n\nhttps://github.com/shazow/urllib3/issues/3\n\nMost of the planning is done, someone just needs to implement it. :)\n", "Digging into httplib I see the comment about [combining headers](http://hg.python.org/cpython/file/2.7/Lib/httplib.py#l249).\n\nOK now onto the [RFC 2616 section 4.2](http://tools.ietf.org/html/rfc2616#section-4.2)\n\n> Multiple message-header fields with the same field-name MAY be\n> present in a message if and only if the entire field-value for that\n> header field is defined as a comma-separated list [i.e., #(values)].\n> It MUST be possible to combine the multiple header fields into one\n> \"field-name: field-value\" pair, without changing the semantics of the\n> message, by appending each subsequent field-value to the first, each\n> separated by a comma. The order in which header fields with the same\n> field-name are received is therefore significant to the\n> interpretation of the combined field value, and thus a proxy MUST NOT\n> change the order of these field values when a message is forwarded.\n\nHeading to the work of HTTPbis WG to see if it has been changed. [Semantics draft document](http://tools.ietf.org/html/draft-ietf-httpbis-p1-messaging#section-3.2) Section 3.2\n\n> Multiple header fields with the same field name **MUST NOT be sent** in a\n> message unless the entire field value for that header field is\n> defined as a comma-separated list [i.e., #(values)]. Multiple header\n> fields with the same field name can be combined into one \"field-name:\n> field-value\" pair, without changing the semantics of the message, by\n> appending each subsequent field value to the combined field value in\n> order, separated by a comma. The order in which header fields with\n> the same field name are received is therefore significant to the\n> interpretation of the combined field value; a proxy MUST NOT change\n> the order of these field values when forwarding a message.\n\nOK there is nothing to fix then! \n\nAnd my server implementation is wrong as it should send a list of csv for the header `Link:`.\nCool! \n\nNow what could be practical for requests is a way to access for headers which have csv list a sub-dict. In the meantime I will iterate on the list. \n\nClosing the comment.\n", "@karlcow\n\n_And my server implementation is wrong as it should send a list of csv for the header Link:._\n\nI think you are wrong here. Firstly, there seems to be no change in rules regarding multiple header fields with the same field name between RFC 2616 and the draft of httpbis you cited. The wording has changed but the sense is the same. Secondly, [RFC 5988 section 5](http://tools.ietf.org/html/rfc5988#section-5) defines the value of `Link` header as a list of comma separated values (`Link = \"Link\" \":\" #link-value`) which means, according to the rules you cited, that there CAN be multiple `Link` headers and that they CAN be merged into one, comma separated list of values.\n", "> **Multiple header fields with the same field name**\n\n```\nheader-field = field-name \":\" OWS field-value BWS\n```\n\nSo let's say:\n\n```\nLink: </2012/07/26/csstests/csshttplink.css>;rel=stylesheet\nLink: </>;rel=next\n```\n\nfield-name is `Link` and `Link`, aka the same value.\n\n> **MUST NOT be sent in a message**\n\nOK, can't send the previous message. but there is one exception\n\n> unless the entire field value for that header field is defined as a comma-separated list [i.e., #(values)].\n\nWhen the value is of a type `a, b, c, d`, we can't combine it in one header field because the comma for separation the values of the field, and the comma for separation of the values of the value of the field would not be parseable anymore in the right components. \n\nTo be clearer, let's imagine a field name `Foo: a, b, c, d` defined as it is. The value is a list of 3 or 4 tokens.\n\n```\nFoo: a, b, c, d\nFoo: e, f, g\n```\n\nYou can NOT combine these two headers because it would not be possible to parse.\n\n```\nFoo: a, b, c, d, e, f, g\n```\n\nAnd the other hand, `Link` can be combined in one header.\n\n```\nLink: </2012/07/26/csstests/csshttplink.css>;rel=stylesheet, </>;rel=next\n```\n", "`Set-Cookie` is a specific issue. It is even mentioned\n\n> Note: The \"Set-Cookie\" header field as implemented in practice can occur multiple times, but does not use the list syntax, and thus cannot be combined into a single line ([RFC6265]). (See Appendix A.2.3 of [Kri2001] for details.) Also note that the Set-Cookie2 header field specified in [RFC2965] does not share this problem.\n", "Well, it's interesting how seemingly simple things are difficult to specify so that there's no room for different interpretations :)\n\n> (...) unless the entire field value for that header field is defined as a comma-separated list [i.e., #(values)]\n\nI think the above statement is not entirely clear by itself. I guess the assumption is, no value (from values) includes unquoted comma. If so then taking your example it would be legal to combine\n\n`\nFoo: a, b, c, d\nFoo: e, f, g\n`\n\ninto\n\n`Foo: a, b, c, d, e, f, g`\n\nas long as none of the letters represents value with unquoted comma. The reasoning being, all values can be parsed and all are treated equally as long as order is intact.\n\n_And the other hand, Link can be combined in one header._\n\nIn two places RFC 5988 mandates quoting values if they contain semicolon or comma, indeed. We would have to follow whole grammar and make sure all possible commas are quoted but I guess this is the case thus multiple Link header fields can be combined into one. However, I wasn't arguing with this (on the contrary, I stated the same myself) but with your statement _And my server implementation is wrong as it should send a list of csv for the header Link:._ which I think is not true.\n", "Why is this discussion taking place on a closed issue?\n", "Sigh.\n", "@sigmavirus24 because it is still not sure sure if it has be reopened or not. Trying to understand the issue first. In the other hand, if there is a better place for it. I will be happy to discuss it there. \n", "For those interested we asked for clarification on httbis working group's email list - see thread starting with http://lists.w3.org/Archives/Public/ietf-http-wg/2013JanMar/0016.html\n" ]
https://api.github.com/repos/psf/requests/issues/740
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/740/labels{/name}
https://api.github.com/repos/psf/requests/issues/740/comments
https://api.github.com/repos/psf/requests/issues/740/events
https://github.com/psf/requests/pull/740
5,847,817
MDExOlB1bGxSZXF1ZXN0MTg5NDQ1NA==
740
do not update the request.url from the OAuth signing call as it results ...
{ "avatar_url": "https://avatars.githubusercontent.com/u/663366?v=4", "events_url": "https://api.github.com/users/r1chardj0n3s/events{/privacy}", "followers_url": "https://api.github.com/users/r1chardj0n3s/followers", "following_url": "https://api.github.com/users/r1chardj0n3s/following{/other_user}", "gists_url": "https://api.github.com/users/r1chardj0n3s/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/r1chardj0n3s", "id": 663366, "login": "r1chardj0n3s", "node_id": "MDQ6VXNlcjY2MzM2Ng==", "organizations_url": "https://api.github.com/users/r1chardj0n3s/orgs", "received_events_url": "https://api.github.com/users/r1chardj0n3s/received_events", "repos_url": "https://api.github.com/users/r1chardj0n3s/repos", "site_admin": false, "starred_url": "https://api.github.com/users/r1chardj0n3s/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/r1chardj0n3s/subscriptions", "type": "User", "url": "https://api.github.com/users/r1chardj0n3s", "user_view_type": "public" }
[]
closed
true
null
[]
null
8
2012-07-26T07:11:58Z
2021-09-08T23:06:09Z
2012-07-27T05:28:35Z
CONTRIBUTOR
resolved
...in the request URL params all being doubled (and the URL doesn't need to be updated based on the signing anyway) This was noticed when attempting a file upload OAuth1a request to PyPI - the params were all doubled-up when performing POST with URL params (the only way to do OAuth1a file upload AFAIK.) I don't believe the OAuth signing should ever modify they URL so I believe this modification is safe.
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/740/reactions" }
https://api.github.com/repos/psf/requests/issues/740/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/740.diff", "html_url": "https://github.com/psf/requests/pull/740", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/740.patch", "url": "https://api.github.com/repos/psf/requests/pulls/740" }
true
[ "This pull request [passes](http://travis-ci.org/kennethreitz/requests/builds/1957207) (merged 6f0a2242 into 52b55ccf).\n", "This pull request [passes](http://travis-ci.org/kennethreitz/requests/builds/1965210) (merged 0b8b859f into 52b55ccf).\n", "... 80 changed files?\n", "Closing this, @r1chardj0n3s thanks for the patch! Can you send again with only 6f0a224? \n", "I have absolutely no idea what the hell happened there. Will do.\n", "I believe this was fixed in #722 actually.\n", "Yes, that appears to fix the problem.\n", "Awesome, will be released shortly.\n" ]
https://api.github.com/repos/psf/requests/issues/739
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/739/labels{/name}
https://api.github.com/repos/psf/requests/issues/739/comments
https://api.github.com/repos/psf/requests/issues/739/events
https://github.com/psf/requests/pull/739
5,834,479
MDExOlB1bGxSZXF1ZXN0MTg4ODA3OA==
739
Appengine workaround
{ "avatar_url": "https://avatars.githubusercontent.com/u/143557?v=4", "events_url": "https://api.github.com/users/saevarom/events{/privacy}", "followers_url": "https://api.github.com/users/saevarom/followers", "following_url": "https://api.github.com/users/saevarom/following{/other_user}", "gists_url": "https://api.github.com/users/saevarom/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/saevarom", "id": 143557, "login": "saevarom", "node_id": "MDQ6VXNlcjE0MzU1Nw==", "organizations_url": "https://api.github.com/users/saevarom/orgs", "received_events_url": "https://api.github.com/users/saevarom/received_events", "repos_url": "https://api.github.com/users/saevarom/repos", "site_admin": false, "starred_url": "https://api.github.com/users/saevarom/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/saevarom/subscriptions", "type": "User", "url": "https://api.github.com/users/saevarom", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2012-07-25T16:41:39Z
2021-09-09T00:01:19Z
2012-07-27T05:29:18Z
NONE
resolved
This commit fixes #498, at least in the Python 2.7 environment on Appengine. Verified that it works on appengine.
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/739/reactions" }
https://api.github.com/repos/psf/requests/issues/739/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/739.diff", "html_url": "https://github.com/psf/requests/pull/739", "merged_at": "2012-07-27T05:29:18Z", "patch_url": "https://github.com/psf/requests/pull/739.patch", "url": "https://api.github.com/repos/psf/requests/pulls/739" }
true
[ "This pull request [passes](http://travis-ci.org/kennethreitz/requests/builds/1952357) (merged 350be4a5 into 52b55ccf).\n", "thanks!\n" ]
https://api.github.com/repos/psf/requests/issues/738
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/738/labels{/name}
https://api.github.com/repos/psf/requests/issues/738/comments
https://api.github.com/repos/psf/requests/issues/738/events
https://github.com/psf/requests/issues/738
5,823,472
MDU6SXNzdWU1ODIzNDcy
738
pip install error on py3k
{ "avatar_url": "https://avatars.githubusercontent.com/u/220039?v=4", "events_url": "https://api.github.com/users/clee704/events{/privacy}", "followers_url": "https://api.github.com/users/clee704/followers", "following_url": "https://api.github.com/users/clee704/following{/other_user}", "gists_url": "https://api.github.com/users/clee704/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/clee704", "id": 220039, "login": "clee704", "node_id": "MDQ6VXNlcjIyMDAzOQ==", "organizations_url": "https://api.github.com/users/clee704/orgs", "received_events_url": "https://api.github.com/users/clee704/received_events", "repos_url": "https://api.github.com/users/clee704/repos", "site_admin": false, "starred_url": "https://api.github.com/users/clee704/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/clee704/subscriptions", "type": "User", "url": "https://api.github.com/users/clee704", "user_view_type": "public" }
[ { "color": "e10c02", "default": false, "description": null, "id": 117744, "name": "Bug", "node_id": "MDU6TGFiZWwxMTc3NDQ=", "url": "https://api.github.com/repos/psf/requests/labels/Bug" }, { "color": "0b02e1", "default": false, "description": null, "id": 191274, "name": "Contributor Friendly", "node_id": "MDU6TGFiZWwxOTEyNzQ=", "url": "https://api.github.com/repos/psf/requests/labels/Contributor%20Friendly" } ]
closed
true
null
[]
null
7
2012-07-25T05:47:28Z
2021-09-09T05:31:03Z
2012-07-27T06:11:43Z
NONE
resolved
With Python 3.2.3 and pip 1.1, `pip install requests` installs Requests 0.13.3 printing scary words like SyntaxError although it seems to work fine after installation. The exact output is below. If further information is needed, please let me know. ``` $ pip-3.2 install requests Downloading/unpacking requests Downloading requests-0.13.3.tar.gz (515Kb): 515Kb downloaded Running setup.py egg_info for package requests warning: no files found matching 'tests/*.' Installing collected packages: requests Running setup.py install for requests warning: no files found matching 'tests/*.' File "/usr/local/lib/python3.2/dist-packages/requests/packages/oauthlib/oauth2/draft25/__init__.py", line 15 AUTH_HEADER = u'auth_header' ^ SyntaxError: invalid syntax File "/usr/local/lib/python3.2/dist-packages/requests/packages/oauthlib/oauth2/draft25/parameters.py", line 50 params = [((u'response_type', response_type)), ^ SyntaxError: invalid syntax File "/usr/local/lib/python3.2/dist-packages/requests/packages/oauthlib/oauth2/draft25/tokens.py", line 22 body=None, ext=u'', hash_algorithm=u'hmac-sha-1'): ^ SyntaxError: invalid syntax File "/usr/local/lib/python3.2/dist-packages/requests/packages/oauthlib/oauth2/draft25/utils.py", line 18 u'HTTP': u'80', ^ SyntaxError: invalid syntax File "/usr/local/lib/python3.2/dist-packages/requests/packages/oauthlib/oauth1/rfc5849/__init__.py", line 20 SIGNATURE_HMAC = u"HMAC-SHA1" ^ SyntaxError: invalid syntax File "/usr/local/lib/python3.2/dist-packages/requests/packages/oauthlib/oauth1/rfc5849/parameters.py", line 60 part = u'{0}="{1}"'.format(escaped_name, escaped_value) ^ SyntaxError: invalid syntax File "/usr/local/lib/python3.2/dist-packages/requests/packages/oauthlib/oauth1/rfc5849/signature.py", line 76 base_string += u'&' ^ SyntaxError: invalid syntax File "/usr/local/lib/python3.2/dist-packages/requests/packages/oauthlib/oauth1/rfc5849/utils.py", line 36 is_oauth = lambda kv: kv[0].startswith(u"oauth_") ^ SyntaxError: invalid syntax File "/usr/local/lib/python3.2/dist-packages/requests/packages/oauthlib/common.py", line 22 always_safe = (u'ABCDEFGHIJKLMNOPQRSTUVWXYZ' ^ SyntaxError: invalid syntax File "/usr/local/lib/python3.2/dist-packages/requests/packages/chardet/langgreekmodel.py", line 215 'keepEnglishLetter': constants.False, ^ SyntaxError: invalid syntax File "/usr/local/lib/python3.2/dist-packages/requests/packages/chardet/constants.py", line 46 False = __builtin__.False ^ SyntaxError: invalid syntax File "/usr/local/lib/python3.2/dist-packages/requests/packages/chardet/universaldetector.py", line 51 self.done = constants.False ^ SyntaxError: invalid syntax File "/usr/local/lib/python3.2/dist-packages/requests/packages/chardet/sbcsgroupprober.py", line 59 logicalHebrewProber = SingleByteCharSetProber(Win1255HebrewModel, constants.False, hebrewProber) ^ SyntaxError: invalid syntax File "/usr/local/lib/python3.2/dist-packages/requests/packages/chardet/langcyrillicmodel.py", line 287 'keepEnglishLetter': constants.False, ^ SyntaxError: invalid syntax File "/usr/local/lib/python3.2/dist-packages/requests/packages/chardet/langthaimodel.py", line 198 'keepEnglishLetter': constants.False, ^ SyntaxError: invalid syntax File "/usr/local/lib/python3.2/dist-packages/requests/packages/chardet/langbulgarianmodel.py", line 218 'keepEnglishLetter': constants.False, ^ SyntaxError: invalid syntax File "/usr/local/lib/python3.2/dist-packages/requests/packages/chardet/chardistribution.py", line 48 self._mDone = constants.False # If this flag is set to constants.True, detection is done and conclusion has been made ^ SyntaxError: invalid syntax File "/usr/local/lib/python3.2/dist-packages/requests/packages/chardet/langhebrewmodel.py", line 199 'keepEnglishLetter': constants.False, ^ SyntaxError: invalid syntax File "/usr/local/lib/python3.2/dist-packages/requests/packages/chardet/charsetgroupprober.py", line 44 prober.active = constants.True ^ SyntaxError: invalid syntax File "/usr/local/lib/python3.2/dist-packages/requests/packages/chardet/sbcharsetprober.py", line 42 def __init__(self, model, reversed=constants.False, nameProber=None): ^ SyntaxError: invalid syntax File "/usr/local/lib/python3.2/dist-packages/requests/packages/chardet/escprober.py", line 48 codingSM.active = constants.True ^ SyntaxError: invalid syntax File "/usr/local/lib/python3.2/dist-packages/requests/packages/chardet/jpcntx.py", line 132 self._mDone = constants.False # If this flag is set to constants.True, detection is done and conclusion has been made ^ SyntaxError: invalid syntax File "/usr/local/lib/python3.2/dist-packages/requests/packages/chardet/langhungarianmodel.py", line 215 'keepEnglishLetter': constants.True, ^ SyntaxError: invalid syntax Successfully installed requests Cleaning up... $ python3.2 >>> import requests >>> r = requests.get('http://www.google.com') >>> r.ok 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" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/738/reactions" }
https://api.github.com/repos/psf/requests/issues/738/timeline
null
completed
null
null
false
[ "These are all genuine Python 3 Syntax Errors that are in libraries included within `requests`. The errors in `chardet` don't affect functionality, as in Python 3 `chardet2` is imported instead, which does not have these problems. It would be nice if we could somehow exclude the module entirely in Python 3 though.\n\n`oauthlib` is a separate problem. Looking at the code in `auth.py`, the Syntax Errors raised when importing `oauthlib` cause the import to fail, and that's handled by the except block [here](https://github.com/kennethreitz/requests/blob/develop/requests/auth.py#L22). In the Python 3 case, that except block allows you to use the other Auth methods in that file, but _will_ cause OAuth1 to fail. (For detail, it fails with a NameError because `Client` was not successfully imported.)\n\nInterestingly, all of the Syntax Errors in `oauthlib` are caused by unicode literals, which means they will stop being errors in Python 3.3. It's @kennethreitz 's call, but I know that he's planning to drop Python 3.2 as a supported version sometime after the release of 3.3, when this problem will go away.\n", "Hmm, I vote to wait for Python 3.3 :)\n", "seems this is still a problem?\n\npip install on Python 3.3.0 still has this problem.\n\n```\n(py3kvenv) yegle@yegle-laptop ~/git/requests/requests/packages/chardet $ python constants.py \n File \"constants.py\", line 46\n False = __builtin__.False\n ^\nSyntaxError: invalid syntax\n```\n", "It is a known problem.\n", "@kennethreitz Could you point us to some details on this known problem?\n", "This comes up a lot; see #832, #869. Basically, these messages are harmless. The files are not syntactically valid for Python 3, but we don't import them when Python 3 is detected.\n", "I wish I could figure out a better solution :(\n" ]
https://api.github.com/repos/psf/requests/issues/737
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/737/labels{/name}
https://api.github.com/repos/psf/requests/issues/737/comments
https://api.github.com/repos/psf/requests/issues/737/events
https://github.com/psf/requests/issues/737
5,803,847
MDU6SXNzdWU1ODAzODQ3
737
multipart/form-data and multiple fields with the same name
{ "avatar_url": "https://avatars.githubusercontent.com/u/326885?v=4", "events_url": "https://api.github.com/users/jkbrzt/events{/privacy}", "followers_url": "https://api.github.com/users/jkbrzt/followers", "following_url": "https://api.github.com/users/jkbrzt/following{/other_user}", "gists_url": "https://api.github.com/users/jkbrzt/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/jkbrzt", "id": 326885, "login": "jkbrzt", "node_id": "MDQ6VXNlcjMyNjg4NQ==", "organizations_url": "https://api.github.com/users/jkbrzt/orgs", "received_events_url": "https://api.github.com/users/jkbrzt/received_events", "repos_url": "https://api.github.com/users/jkbrzt/repos", "site_admin": false, "starred_url": "https://api.github.com/users/jkbrzt/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/jkbrzt/subscriptions", "type": "User", "url": "https://api.github.com/users/jkbrzt", "user_view_type": "public" }
[]
closed
true
null
[]
null
9
2012-07-24T14:26:04Z
2021-09-09T02:11:53Z
2012-08-11T09:03:58Z
CONTRIBUTOR
resolved
I'm sending a `POST` request with multiple fields with the same name which normally works well when passed in a `dict`: ``` >>> from requests import post >>> print post('http://httpbin.org/post', data={'field': ['a', 'b']}).content { "origin": "[...]", "files": {}, "form": { "field": [ "a", "b" ] }, "url": "http://httpbin.org/post", "args": {}, "headers": { "Content-Length": "15", "Accept-Encoding": "identity, deflate, compress, gzip", "Connection": "keep-alive", "Accept": "*/*", "User-Agent": "python-requests/0.13.1", "Host": "httpbin.org", "Content-Type": "application/x-www-form-urlencoded" }, "json": null, "data": "" } ``` But fails with a `TypeError` when the request is a `multipart/form-data` one: ``` >>> print post('http://httpbin.org/post', data={'field': ['a', 'b']}, files={'file': open('/etc/hosts')}).content Traceback (most recent call last): File "<ipython-input-15-4008ff697f5a>", line 1, in <module> print requests.post('http://httpbin.org/post', data={'field': ['a', 'b']}, files={'file': open('/etc/hosts')}).content File "python2.7/site-packages/requests/api.py", line 87, in post return request('post', url, data=data, **kwargs) File "python2.7/site-packages/requests/safe_mode.py", line 37, in wrapped return function(method, url, **kwargs) File "python2.7/site-packages/requests/api.py", line 42, in request return s.request(method=method, url=url, **kwargs) File "python2.7/site-packages/requests/sessions.py", line 230, in request r.send(prefetch=prefetch) File "python2.7/site-packages/requests/models.py", line 507, in send (body, content_type) = self._encode_files(self.files) File "site-packages/requests/models.py", line 366, in _encode_files (body, content_type) = encode_multipart_formdata(fields) File "site-packages/requests/packages/urllib3/filepost.py", line 80, in encode_multipart_formdata body.write(data) TypeError: 'list' does not have the buffer interface ``` Passing a `list` of `tuple`s doesn't raise an exception but only the last item is included in the request: ``` >>> print requests.post('http://httpbin.org/post', data=[('field', 'a'), ('field', 'b')], files={'file': open('/etc/hosts')}).content { "origin": "[...]", "files": { "file": "[...]" }, "form": { "field": "b" }, "url": "http://httpbin.org/post", "args": {}, "headers": { "Content-Length": "862", "Accept-Encoding": "identity, deflate, compress, gzip", "Connection": "keep-alive", "Accept": "*/*", "User-Agent": "python-requests/0.13.1", "Host": "httpbin.org", "Content-Type": "multipart/form-data; boundary=127.0.0.1.501.73436.1343139319.461.6" }, "json": null, "data": "" } ```
{ "avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4", "events_url": "https://api.github.com/users/Lukasa/events{/privacy}", "followers_url": "https://api.github.com/users/Lukasa/followers", "following_url": "https://api.github.com/users/Lukasa/following{/other_user}", "gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Lukasa", "id": 1382556, "login": "Lukasa", "node_id": "MDQ6VXNlcjEzODI1NTY=", "organizations_url": "https://api.github.com/users/Lukasa/orgs", "received_events_url": "https://api.github.com/users/Lukasa/received_events", "repos_url": "https://api.github.com/users/Lukasa/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions", "type": "User", "url": "https://api.github.com/users/Lukasa", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/737/reactions" }
https://api.github.com/repos/psf/requests/issues/737/timeline
null
completed
null
null
false
[ "I've just started looking into this, and I can explain the behaviour of the second case. The list of tuples you provided to `data` has `dict()` called on it. Dictionaries (obviously) don't allow duplicate keys, but your list of tuples has duplicate keys, so the last item in the iterable takes the value for that key. Exactly the same behaviour is shown if you provide a list of tuples to `data` without the `files` argument, so I'd assume that this is intended behaviour.\n\nI'm significantly less sure about your first case. The actual exception is occurring in urllib3, which does not expect to be passed a list. If I had to hazard a guess, I'd say that the fix should be applied to requests, not urllib3, because requests already has edge case code for lists in [`_encode_params()`](https://github.com/kennethreitz/requests/blob/develop/requests/models.py#L306). It's a fix I'm prepared to write, but I would want @kennethreitz to confirm that this is a bug, and not actually correct behaviour, first.\n", "@Lukasa :+1:\n", "Good news everybody! Unrelated problem #661 has led to pull request #729 fixing this issue. I'll push up my test for this issue, but otherwise it seems to be resolved.\n", "Thanks! There is still a small problem, though: If there is a file with the same name as one of the data fields then the data fields are overwritten and only the file field is sent:\n\n```\n>>> print post('http://httpbin.org/post', data={'X': 'a'}, files={'X': open('/etc/hosts')}).content\n{\n \"origin\": \"[...]\",\n \"files\": {\n \"X\": \"[...]\"\n },\n \"form\": {},\n \"url\": \"http://httpbin.org/post\",\n \"args\": {},\n \"headers\": {\n \"Content-Length\": \"779\",\n \"Accept-Encoding\": \"identity, deflate, compress, gzip\",\n \"Connection\": \"keep-alive\",\n \"Accept\": \"*/*\",\n \"User-Agent\": \"python-requests/0.13.4 CPython/2.7.3 Darwin/12.0.0\",\n \"Host\": \"httpbin.org\",\n \"Content-Type\": \"multipart/form-data; boundary=f38e57e2619e4190b4b3b1399602ab40\"\n },\n \"json\": null,\n \"data\": \"\"\n}\n```\n", "Another problem is that now (after #729) the serialisation of lists is inconsistent between `application/x-www-form-urlencoded` and `multipart/form-data` requests.\n\nWith `application/x-www-form-urlencoded` the field is repeated multiple times (which is think is a reasonable serialization):\n\n```\n>>> print post('http://httpbin.org/post', data={'X': ['a', 'b']}).content\n{\n \"origin\": \"195.249.187.189\",\n \"files\": {},\n \"form\": {\n \"X\": [\n \"a\",\n \"b\"\n ]\n },\n \"url\": \"http://httpbin.org/post\",\n \"args\": {},\n \"headers\": {\n \"Content-Length\": \"7\",\n \"Accept-Encoding\": \"identity, deflate, compress, gzip\",\n \"Connection\": \"keep-alive\",\n \"Accept\": \"*/*\",\n \"User-Agent\": \"python-requests/0.13.4 CPython/2.7.3 Darwin/12.0.0\",\n \"Host\": \"httpbin.org\",\n \"Content-Type\": \"application/x-www-form-urlencoded\"\n },\n \"json\": null,\n \"data\": \"\"\n}\n```\n\nWhereas with `multipart/form-data` the field is included only once with the values joined by `,` (which doesn't seem to follow any convention):\n\n```\n>>> print post('http://httpbin.org/post', data={'X': ['a', 'b']}, files={'Z': open('/etc/hosts')}).content\n{\n \"origin\": \"[...]\",\n \"files\": {\n \"Z\": \"[...]\"\n },\n \"form\": {\n \"X\": \"a, b\"\n },\n \"url\": \"http://httpbin.org/post\",\n \"args\": {},\n \"headers\": {\n \"Content-Length\": \"296\",\n \"Accept-Encoding\": \"identity, deflate, compress, gzip\",\n \"Connection\": \"keep-alive\",\n \"Accept\": \"*/*\",\n \"User-Agent\": \"python-requests/0.13.4 CPython/2.7.3 Darwin/12.0.0\",\n \"Host\": \"httpbin.org\",\n \"Content-Type\": \"multipart/form-data; boundary=c451c91af593431a8f0bf5c3ecb9c388\"\n },\n \"json\": null,\n \"data\": \"\"\n}\n```\n", "Good spot. The inconsistency is an easy fix. The overwrite is less so. I'll start a pull request to handle these problems, unless you want to do it yourself. =)\n", "I actually think I have a fix for both – working on tests now, will send a pull in a minute\n", "Brilliant! Always happy to have other people do work for me. =D\n", "Fixed by #746.\n" ]
https://api.github.com/repos/psf/requests/issues/736
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/736/labels{/name}
https://api.github.com/repos/psf/requests/issues/736/comments
https://api.github.com/repos/psf/requests/issues/736/events
https://github.com/psf/requests/pull/736
5,754,798
MDExOlB1bGxSZXF1ZXN0MTg1NjU1Ng==
736
Make OAuth path hack platform independent.
{ "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
4
2012-07-21T17:14:04Z
2021-09-08T23:07:34Z
2012-07-27T05:29:58Z
MEMBER
resolved
This _should_ resolve issue #735. I'd love it if someone could run a test on a Windows box, as I don't have easy access to one at the minute.
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/736/reactions" }
https://api.github.com/repos/psf/requests/issues/736/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/736.diff", "html_url": "https://github.com/psf/requests/pull/736", "merged_at": "2012-07-27T05:29:58Z", "patch_url": "https://github.com/psf/requests/pull/736.patch", "url": "https://api.github.com/repos/psf/requests/pulls/736" }
true
[ "This pull request [passes](http://travis-ci.org/kennethreitz/requests/builds/1922177) (merged 79aa9edd into 876e1744).\n", "Thought I'd fix up some typos while I had a pull request open. Can't hurt.\n", "This pull request [passes](http://travis-ci.org/kennethreitz/requests/builds/1950590) (merged 55237ad6 into 876e1744).\n", "Thank you sir :)\n" ]
https://api.github.com/repos/psf/requests/issues/735
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/735/labels{/name}
https://api.github.com/repos/psf/requests/issues/735/comments
https://api.github.com/repos/psf/requests/issues/735/events
https://github.com/psf/requests/issues/735
5,750,477
MDU6SXNzdWU1NzUwNDc3
735
NameError: global name 'Client' is not defined
{ "avatar_url": "https://avatars.githubusercontent.com/u/1452723?v=4", "events_url": "https://api.github.com/users/linguinee/events{/privacy}", "followers_url": "https://api.github.com/users/linguinee/followers", "following_url": "https://api.github.com/users/linguinee/following{/other_user}", "gists_url": "https://api.github.com/users/linguinee/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/linguinee", "id": 1452723, "login": "linguinee", "node_id": "MDQ6VXNlcjE0NTI3MjM=", "organizations_url": "https://api.github.com/users/linguinee/orgs", "received_events_url": "https://api.github.com/users/linguinee/received_events", "repos_url": "https://api.github.com/users/linguinee/repos", "site_admin": false, "starred_url": "https://api.github.com/users/linguinee/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/linguinee/subscriptions", "type": "User", "url": "https://api.github.com/users/linguinee", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2012-07-21T02:30:30Z
2021-09-09T07:05:32Z
2012-07-21T20:48:15Z
NONE
resolved
I ran into trouble running [Twython](https://github.com/ryanmcgrath/twython). It seems to be a problem with `requests`, since my authentication keys are correct (and the script runs on another computer). ``` Traceback (most recent call last): File "C:\Users\Yi-Yi\Documents\Yi-Yi\Projects\Programs\Twitter Art Bot\foo.py", line 11, in <module> oauth_token_secret=ACCESS_TOKEN_SECRET) File "C:\Python27\lib\site-packages\twython-2.3.2-py2.7.egg\twython\twython.py", line 131, in __init__ signature_type='auth_header') File "C:\Python27\lib\site-packages\requests-0.13.3-py2.7.egg\requests\auth.py", line 57, in __init__ self.client = Client(client_key, client_secret, resource_owner_key, NameError: global name 'Client' is not defined ``` The code the error is from: ``` from twython import Twython CONSUMER_KEY = '...' CONSUMER_SECRET = '...' ACCESS_TOKEN = '...' ACCESS_TOKEN_SECRET = '...' t = Twython(app_key=CONSUMER_KEY, app_secret=CONSUMER_SECRET, oauth_token=ACCESS_TOKEN, oauth_token_secret=ACCESS_TOKEN_SECRET) print t.getHomeTimeline() ``` I'm running `requests.__version__` 0.13.3. I'm running this on Windows Vista 64-bit, Python 2.7.3.
{ "avatar_url": "https://avatars.githubusercontent.com/u/1452723?v=4", "events_url": "https://api.github.com/users/linguinee/events{/privacy}", "followers_url": "https://api.github.com/users/linguinee/followers", "following_url": "https://api.github.com/users/linguinee/following{/other_user}", "gists_url": "https://api.github.com/users/linguinee/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/linguinee", "id": 1452723, "login": "linguinee", "node_id": "MDQ6VXNlcjE0NTI3MjM=", "organizations_url": "https://api.github.com/users/linguinee/orgs", "received_events_url": "https://api.github.com/users/linguinee/received_events", "repos_url": "https://api.github.com/users/linguinee/repos", "site_admin": false, "starred_url": "https://api.github.com/users/linguinee/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/linguinee/subscriptions", "type": "User", "url": "https://api.github.com/users/linguinee", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/735/reactions" }
https://api.github.com/repos/psf/requests/issues/735/timeline
null
completed
null
null
false
[ "This is the result of a bug in the OAuth path hack, I think. Specifically, [this path hack](https://github.com/kennethreitz/requests/blob/develop/requests/_oauth.py#L19) works great on *nix where the path separator is /, but does not work on Windows where it is .\n\nIf you want a quick fix, you can install OAuthLib from PyPI. I recommend using `pip install oauthlib` but [here is a direct link if you prefer](http://pypi.python.org/pypi/oauthlib/).\n\nEDIT: I have opened pull request #736 to deal with this issue.\n", "Installing `oauthlib` fixed it for me. Thank you for addressing the issue!\n" ]
https://api.github.com/repos/psf/requests/issues/734
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/734/labels{/name}
https://api.github.com/repos/psf/requests/issues/734/comments
https://api.github.com/repos/psf/requests/issues/734/events
https://github.com/psf/requests/pull/734
5,743,354
MDExOlB1bGxSZXF1ZXN0MTg1MjA3Nw==
734
Include response.reason in raised HTTPErrors
{ "avatar_url": "https://avatars.githubusercontent.com/u/817118?v=4", "events_url": "https://api.github.com/users/doismellburning/events{/privacy}", "followers_url": "https://api.github.com/users/doismellburning/followers", "following_url": "https://api.github.com/users/doismellburning/following{/other_user}", "gists_url": "https://api.github.com/users/doismellburning/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/doismellburning", "id": 817118, "login": "doismellburning", "node_id": "MDQ6VXNlcjgxNzExOA==", "organizations_url": "https://api.github.com/users/doismellburning/orgs", "received_events_url": "https://api.github.com/users/doismellburning/received_events", "repos_url": "https://api.github.com/users/doismellburning/repos", "site_admin": false, "starred_url": "https://api.github.com/users/doismellburning/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/doismellburning/subscriptions", "type": "User", "url": "https://api.github.com/users/doismellburning", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2012-07-20T18:35:00Z
2021-09-08T23:08:22Z
2012-07-24T13:46:35Z
CONTRIBUTOR
resolved
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/734/reactions" }
https://api.github.com/repos/psf/requests/issues/734/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/734.diff", "html_url": "https://github.com/psf/requests/pull/734", "merged_at": "2012-07-24T13:46:35Z", "patch_url": "https://github.com/psf/requests/pull/734.patch", "url": "https://api.github.com/repos/psf/requests/pulls/734" }
true
[ "This pull request [passes](http://travis-ci.org/kennethreitz/requests/builds/1916144) (merged c485928a into 876e1744).\n", "thanks!\n" ]
https://api.github.com/repos/psf/requests/issues/733
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/733/labels{/name}
https://api.github.com/repos/psf/requests/issues/733/comments
https://api.github.com/repos/psf/requests/issues/733/events
https://github.com/psf/requests/pull/733
5,742,549
MDExOlB1bGxSZXF1ZXN0MTg1MTYyMQ==
733
Include response.content in raised HTTPErrors
{ "avatar_url": "https://avatars.githubusercontent.com/u/817118?v=4", "events_url": "https://api.github.com/users/doismellburning/events{/privacy}", "followers_url": "https://api.github.com/users/doismellburning/followers", "following_url": "https://api.github.com/users/doismellburning/following{/other_user}", "gists_url": "https://api.github.com/users/doismellburning/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/doismellburning", "id": 817118, "login": "doismellburning", "node_id": "MDQ6VXNlcjgxNzExOA==", "organizations_url": "https://api.github.com/users/doismellburning/orgs", "received_events_url": "https://api.github.com/users/doismellburning/received_events", "repos_url": "https://api.github.com/users/doismellburning/repos", "site_admin": false, "starred_url": "https://api.github.com/users/doismellburning/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/doismellburning/subscriptions", "type": "User", "url": "https://api.github.com/users/doismellburning", "user_view_type": "public" }
[]
closed
true
null
[]
null
8
2012-07-20T17:52:00Z
2021-09-08T23:08:23Z
2012-07-20T17:53:28Z
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/733/reactions" }
https://api.github.com/repos/psf/requests/issues/733/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/733.diff", "html_url": "https://github.com/psf/requests/pull/733", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/733.patch", "url": "https://api.github.com/repos/psf/requests/pulls/733" }
true
[ "I don't think this is a good idea. I wouldn't be against adding `response.reason` though.\n", "So, I had a niggling feeling that it might not be, but no idea why; I'd be curious to hear your reasoning...\n", "Requests doesn't read the response bodies until the user access them.\n\nAlso, many responses are binary and therefore can't be printed to the screen without encoding errors.\n", "Keep the pull requests coming though ;)\n", "This pull request [passes](http://travis-ci.org/kennethreitz/requests/builds/1915888) (merged 6eb1ac44 into 876e1744).\n", "Ah, hadn't realised `reason` had been added. \n\nI'd erroneously thought [RFC2616](http://www.ietf.org/rfc/rfc2616.txt) had some plain-text-y limitations on `message-body` format in the event of an error, but I can't seem to find anything saying that, so presumably imagined it, apologies.\n\nThanks for the feedback\n", "No need to apologize, it was a great idea ;)\n", "#734 adds `response.reason` as you mention above then :)\n" ]
https://api.github.com/repos/psf/requests/issues/732
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/732/labels{/name}
https://api.github.com/repos/psf/requests/issues/732/comments
https://api.github.com/repos/psf/requests/issues/732/events
https://github.com/psf/requests/issues/732
5,691,987
MDU6SXNzdWU1NjkxOTg3
732
`Content-Disposition` in subpart header includes `filename` for non-file multipart fields
{ "avatar_url": "https://avatars.githubusercontent.com/u/62200?v=4", "events_url": "https://api.github.com/users/enginoid/events{/privacy}", "followers_url": "https://api.github.com/users/enginoid/followers", "following_url": "https://api.github.com/users/enginoid/following{/other_user}", "gists_url": "https://api.github.com/users/enginoid/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/enginoid", "id": 62200, "login": "enginoid", "node_id": "MDQ6VXNlcjYyMjAw", "organizations_url": "https://api.github.com/users/enginoid/orgs", "received_events_url": "https://api.github.com/users/enginoid/received_events", "repos_url": "https://api.github.com/users/enginoid/repos", "site_admin": false, "starred_url": "https://api.github.com/users/enginoid/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/enginoid/subscriptions", "type": "User", "url": "https://api.github.com/users/enginoid", "user_view_type": "public" }
[]
closed
true
null
[]
null
4
2012-07-18T15:21:43Z
2021-09-09T06:00:56Z
2012-08-03T17:10:08Z
NONE
resolved
The `files` parameter can be used to submit multipart form data. I'm not certain whether `files` is a misnomer (since multipart form data doesn't necessary) or whether the implementation purposefully limits itself to supporting files as multipart data. However, there are valid use cases for multipart forms where some of the fields are not files. Take for example an API that allows you to POST a file along with a description of that file: ``` python >>> url = 'http://httpbin.org/post' >>> files = { 'file': open('report.xls', 'rb'), 'description': 'The PKIs that will drive synergy for the quarterly social' 'media campaign in the cloud.' } >>> r = requests.post(url, files=files) ``` In this case, the `description` field is not being used for file data. The problem is that this field is nevertheless treated as being file data, as `filename` is added to `Content-Disposition` header of the subpart, defaulting to the value of `name` (or using `file.name` if available.) `urllib3` supports subparts that don't have file names (in `urllib3.filepost.encode_multipart_formdata`), and appropriately omits the `filename` parameter: ``` python def encode_multipart_formdata(fields, boundary=None): # ... for fieldname, value in iter_fields(fields): # ... if isinstance(value, tuple): filename, data = value writer(body).write('Content-Disposition: form-data; name="%s"; ' 'filename="%s"\r\n' % (fieldname, filename)) body.write(b('Content-Type: %s\r\n\r\n' % (get_content_type(filename)))) else: data = value writer(body).write('Content-Disposition: form-data; name="%s"\r\n' % (fieldname)) body.write(b'Content-Type: text/plain\r\n\r\n') ``` However, `isinstance(value, tuple)` in this function is always true, courtesy of this code in the library: ``` python class Request(object): # ... def _encode_files(self, files): # ... for (k, v) in list(files.items()): # support for explicit filename if isinstance(v, (tuple, list)): fn, fp = v else: fn = guess_filename(v) or k fp = v if isinstance(fp, (bytes, str)): fp = StringIO(fp) fields.update({k: (fn, fp.read())}) (body, content_type) = encode_multipart_formdata(fields) return (body, content_type) ``` I'd like to suggest that if no filename is provided (and it can't be read from `file.name`), the default behavior is to not include the `filename` parameter in the `Content-Disposition` subpart header. This is simply a matter of not passing `encode_multipart_formdata` a filename for a given field if one is not provided in the `Request.files` parameter (instead of providing a default, as is now done.) I'm posting this because a service I'm interfacing with changes its behavior if the `filename` is provided for a non-file field. After reading through RFC 2388, I determined that the right place to fix this is probably in `requests` instead of the original library. I can elaborate if necessary.
{ "avatar_url": "https://avatars.githubusercontent.com/u/62200?v=4", "events_url": "https://api.github.com/users/enginoid/events{/privacy}", "followers_url": "https://api.github.com/users/enginoid/followers", "following_url": "https://api.github.com/users/enginoid/following{/other_user}", "gists_url": "https://api.github.com/users/enginoid/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/enginoid", "id": 62200, "login": "enginoid", "node_id": "MDQ6VXNlcjYyMjAw", "organizations_url": "https://api.github.com/users/enginoid/orgs", "received_events_url": "https://api.github.com/users/enginoid/received_events", "repos_url": "https://api.github.com/users/enginoid/repos", "site_admin": false, "starred_url": "https://api.github.com/users/enginoid/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/enginoid/subscriptions", "type": "User", "url": "https://api.github.com/users/enginoid", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/732/reactions" }
https://api.github.com/repos/psf/requests/issues/732/timeline
null
completed
null
null
false
[ "You can specify a blank filename if you'd like.\n", "Also, you can pass both a `data` and `files` parameter, and they will be merged appropriately. \n", "Yes, that suits my purposes quite nicely. My problem is that even when I specify a blank filename, the `filename` parameter is still passed into `Content-Disposition`, changing the semantics of the field as well as behavior in some services.\n\nThis appears to be a simple bug, because the urllib3 multipart encoding function offers the possibility to omit the `filename` parameter in `Content-Disposition` by not specifying a filename (by not passing a tuple), but `Request._encode_files` always sets a filename and passes in a tuple to urllib3 in all cases, so that execution path is never run.\n", "I'm not sure what went through my head when you said I could use the `data` and `files` parameters and that they would be merged, but that is doing absolutely the same thing as the patch I'm proposing.\n\nIt is also without the drawback of requiring the developer to pass actual field data into `files` (which, as it has been clearly named to indicate, is meant for files.)\n\nPoorly thought out. Sorry!\n" ]
https://api.github.com/repos/psf/requests/issues/731
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/731/labels{/name}
https://api.github.com/repos/psf/requests/issues/731/comments
https://api.github.com/repos/psf/requests/issues/731/events
https://github.com/psf/requests/pull/731
5,686,152
MDExOlB1bGxSZXF1ZXN0MTgyNTMwOQ==
731
breaks under python 2.7, without the from __future__ import
{ "avatar_url": "https://avatars.githubusercontent.com/u/92518?v=4", "events_url": "https://api.github.com/users/jorjun/events{/privacy}", "followers_url": "https://api.github.com/users/jorjun/followers", "following_url": "https://api.github.com/users/jorjun/following{/other_user}", "gists_url": "https://api.github.com/users/jorjun/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/jorjun", "id": 92518, "login": "jorjun", "node_id": "MDQ6VXNlcjkyNTE4", "organizations_url": "https://api.github.com/users/jorjun/orgs", "received_events_url": "https://api.github.com/users/jorjun/received_events", "repos_url": "https://api.github.com/users/jorjun/repos", "site_admin": false, "starred_url": "https://api.github.com/users/jorjun/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/jorjun/subscriptions", "type": "User", "url": "https://api.github.com/users/jorjun", "user_view_type": "public" }
[]
closed
true
null
[]
null
6
2012-07-18T10:59:45Z
2021-09-08T16:00:47Z
2012-07-18T14:44:37Z
NONE
resolved
If python support < 2.6 is required, will need to make this import conditional
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/731/reactions" }
https://api.github.com/repos/psf/requests/issues/731/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/731.diff", "html_url": "https://github.com/psf/requests/pull/731", "merged_at": "2012-07-18T14:44:37Z", "patch_url": "https://github.com/psf/requests/pull/731.patch", "url": "https://api.github.com/repos/psf/requests/pulls/731" }
true
[ "This pull request [passes](http://travis-ci.org/kennethreitz/requests/builds/1893840) (merged 2c241d28 into 73815e2e).\n", "No need to make the import conditional: [Requests only supports 2.6 and higher](http://docs.python-requests.org/en/latest/community/faq/#python-3-support).\n", "Ah, thanks. Do I need to do anything else? Or will this minor change be incorporated into trunk at some point? (sorry, just starting out on github).\n", "I checked it out on my machine and it looks good, to me, so you don't need to do anything else. @kennethreitz will pop by at some point when he has time and will handle merging into the development branch, but it'll merge nicely so it shouldn't be a big deal. If you want to, you could add your name to the Authors file, but that's really up to you. As for trunk, it should make it into the next minor version of requests.\n", "Sounds good - I will now remove my attention from this. Thanks for info.\n", "Thanks guys!\n\nAnd thanks for the rundown @Lukasa :)\n" ]
https://api.github.com/repos/psf/requests/issues/730
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/730/labels{/name}
https://api.github.com/repos/psf/requests/issues/730/comments
https://api.github.com/repos/psf/requests/issues/730/events
https://github.com/psf/requests/issues/730
5,634,270
MDU6SXNzdWU1NjM0Mjcw
730
HTTPS failing with protocol error / timeout
{ "avatar_url": "https://avatars.githubusercontent.com/u/229943?v=4", "events_url": "https://api.github.com/users/dpnova/events{/privacy}", "followers_url": "https://api.github.com/users/dpnova/followers", "following_url": "https://api.github.com/users/dpnova/following{/other_user}", "gists_url": "https://api.github.com/users/dpnova/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/dpnova", "id": 229943, "login": "dpnova", "node_id": "MDQ6VXNlcjIyOTk0Mw==", "organizations_url": "https://api.github.com/users/dpnova/orgs", "received_events_url": "https://api.github.com/users/dpnova/received_events", "repos_url": "https://api.github.com/users/dpnova/repos", "site_admin": false, "starred_url": "https://api.github.com/users/dpnova/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/dpnova/subscriptions", "type": "User", "url": "https://api.github.com/users/dpnova", "user_view_type": "public" }
[]
closed
true
null
[]
null
0
2012-07-16T08:15:52Z
2021-09-09T07:05:32Z
2012-07-27T05:46:31Z
NONE
resolved
Connecting to some HTTP sites is failing. It seems to be sites that use TLS and OpenSSL isn't selecting the right SSL protocol to communicate with the server. This seems to be an issue on Ubuntu 12.04 so far.. There is more discussion here: https://bugs.launchpad.net/ubuntu/+source/openssl/+bug/965371 Example to test is below: ``` >>> import requests >>> requests.get("https://www.acgov.org/alco_ssl_app/rov/voter_info/voter_profile.jsp?formLanguage=E") Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/dpn/.virtualenvs/scrapers/local/lib/python2.7/site-packages/requests/api.py", line 54, in get return request('get', url, **kwargs) File "/home/dpn/.virtualenvs/scrapers/local/lib/python2.7/site-packages/requests/safe_mode.py", line 37, in wrapped return function(method, url, **kwargs) File "/home/dpn/.virtualenvs/scrapers/local/lib/python2.7/site-packages/requests/api.py", line 42, in request return s.request(method=method, url=url, **kwargs) File "/home/dpn/.virtualenvs/scrapers/local/lib/python2.7/site-packages/requests/sessions.py", line 230, in request r.send(prefetch=prefetch) File "/home/dpn/.virtualenvs/scrapers/local/lib/python2.7/site-packages/requests/models.py", line 613, in send raise SSLError(e) requests.exceptions.SSLError: [Errno 8] _ssl.c:504: EOF occurred in violation of protocol >>> requests.get("https://www.acgov.org/alco_ssl_app/rov/voter_info/voter_profile.jsp?formLanguage=E", verify=False) Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/dpn/.virtualenvs/scrapers/local/lib/python2.7/site-packages/requests/api.py", line 54, in get return request('get', url, **kwargs) File "/home/dpn/.virtualenvs/scrapers/local/lib/python2.7/site-packages/requests/safe_mode.py", line 37, in wrapped return function(method, url, **kwargs) File "/home/dpn/.virtualenvs/scrapers/local/lib/python2.7/site-packages/requests/api.py", line 42, in request return s.request(method=method, url=url, **kwargs) File "/home/dpn/.virtualenvs/scrapers/local/lib/python2.7/site-packages/requests/sessions.py", line 230, in request r.send(prefetch=prefetch) File "/home/dpn/.virtualenvs/scrapers/local/lib/python2.7/site-packages/requests/models.py", line 615, in send raise Timeout('Request timed out.') requests.exceptions.Timeout: Request timed out. >>> ``` It seems that manually specifying the SSL version to use may be the best option until the problem is fixed. It seems the issue of selecting SSL version has come up here before: https://github.com/kennethreitz/requests/issues/606
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/730/reactions" }
https://api.github.com/repos/psf/requests/issues/730/timeline
null
completed
null
null
false
[]
https://api.github.com/repos/psf/requests/issues/729
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/729/labels{/name}
https://api.github.com/repos/psf/requests/issues/729/comments
https://api.github.com/repos/psf/requests/issues/729/events
https://github.com/psf/requests/pull/729
5,623,421
MDExOlB1bGxSZXF1ZXN0MTc5NzUxNQ==
729
Added needed cast for when POSTing data and files (Issue #661)
{ "avatar_url": "https://avatars.githubusercontent.com/u/1755286?v=4", "events_url": "https://api.github.com/users/vickimo/events{/privacy}", "followers_url": "https://api.github.com/users/vickimo/followers", "following_url": "https://api.github.com/users/vickimo/following{/other_user}", "gists_url": "https://api.github.com/users/vickimo/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/vickimo", "id": 1755286, "login": "vickimo", "node_id": "MDQ6VXNlcjE3NTUyODY=", "organizations_url": "https://api.github.com/users/vickimo/orgs", "received_events_url": "https://api.github.com/users/vickimo/received_events", "repos_url": "https://api.github.com/users/vickimo/repos", "site_admin": false, "starred_url": "https://api.github.com/users/vickimo/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/vickimo/subscriptions", "type": "User", "url": "https://api.github.com/users/vickimo", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2012-07-14T22:30:26Z
2021-09-08T23:07:32Z
2012-07-27T05:33:51Z
CONTRIBUTOR
resolved
Co-Authored By: Timnit Gebru [email protected] @tgebru Co-Authored By: Sarah Gonzalez [email protected] @smargonz Co-Authored By: Leila Muhtasib [email protected] @muhtasib This is a fix for Issue #661.
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/729/reactions" }
https://api.github.com/repos/psf/requests/issues/729/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/729.diff", "html_url": "https://github.com/psf/requests/pull/729", "merged_at": "2012-07-27T05:33:51Z", "patch_url": "https://github.com/psf/requests/pull/729.patch", "url": "https://api.github.com/repos/psf/requests/pulls/729" }
true
[ "This pull request [passes](http://travis-ci.org/kennethreitz/requests/builds/1867038) (merged f9c0ddf4 into a97a5133).\n", "Thanks!\n" ]